import { JSONObject } from "../../common/jsonTypes"; import { RawDocument } from "../../document/document"; import { CallbackManager, Traceable } from "../../utils/callbacks"; export interface Authentication { authToken?: string; } /** * Defines how to connect to a data source. */ export type ConnectionInfo = JSONObject & { endpoint?: string; auth?: Authentication; }; /** * The base interface for all data sources to load documents from. */ export interface DataSource extends Traceable { name: string; connectionInfo?: ConnectionInfo; metadata?: { [key: string]: string; }; attributes?: { [key: string]: string; }; /** * Tests the connection to the data source. HTTP status codes are used to indicate success or failure. */ testConnection(): Promise; /** * Loads documents from the data source that matches the specified properties. * @param filters The filters to apply to the documents. Can include/exclude things like document IDs, recursive traversal, file extensions, etc. * @param limit The maximum number of documents to load. */ loadDocuments(filters: JSONObject, limit?: number): Promise; } export declare class GoogleDrive implements DataSource, Traceable { name: string; connectionInfo?: ConnectionInfo | undefined; metadata?: { [key: string]: string; } | undefined; attributes?: { [key: string]: string; } | undefined; callbackManager?: CallbackManager; constructor(callbackManager?: CallbackManager); testConnection(): Promise; loadDocuments(_filters: JSONObject, _limit?: number | undefined): Promise; } export declare class OneDrive implements DataSource, Traceable { name: string; connectionInfo?: ConnectionInfo | undefined; metadata?: { [key: string]: string; } | undefined; attributes?: { [key: string]: string; } | undefined; callbackManager?: CallbackManager; constructor(callbackManager?: CallbackManager); testConnection(): Promise; loadDocuments(_filters: JSONObject, _limit?: number | undefined): Promise; }