Implementation:Infiniflow Ragflow DataSourceService
Appearance
| Knowledge Sources | |
|---|---|
| Domains | Frontend, API, Data_Pipeline |
| Last Updated | 2026-02-12 06:00 GMT |
Overview
Concrete frontend HTTP API client for managing external data source connections with OAuth flow endpoints for the RAGFlow frontend.
Description
The services/data-source-service.ts module defines API endpoints for: listing available data source types, initiating OAuth authentication flows, managing connected data sources, and fetching data from external sources like Google Drive, Dropbox, etc.
Usage
Import these service functions in data source management views and dataset configuration where external data sources are linked.
Code Reference
Source Location
- Repository: Infiniflow_Ragflow
- File: web/src/services/data-source-service.ts
- Lines: 1-59
Signature
export const listDataSources: () => Promise<Response>;
export const getOAuthUrl: (type: string) => Promise<Response>;
export const connectDataSource: (data) => Promise<Response>;
export const disconnectDataSource: (id: string) => Promise<Response>;
Import
import { listDataSources, getOAuthUrl } from '@/services/data-source-service';
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | Data source type for OAuth URL |
| id | string | Yes | Data source ID for disconnect |
Outputs
| Name | Type | Description |
|---|---|---|
| returns | Promise<Response> | API response with data source info |
Usage Examples
import { getOAuthUrl } from '@/services/data-source-service';
const { data } = await getOAuthUrl('google_drive');
window.location.href = data.oauth_url; // Redirect to OAuth
Related Pages
Page Connections
Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment