feat: integrate OneDrive connector with UI components and configuration options

This commit is contained in:
Anish Sarkar 2026-03-28 17:00:52 +05:30
parent 028c88be72
commit 147061284b
13 changed files with 516 additions and 10 deletions

View file

@ -277,6 +277,19 @@ class ConnectorsApiService {
}>(`/api/v1/connectors/${connectorId}/drive-picker-token`);
};
/**
* List OneDrive folders and files
*/
listOneDriveFolders = async (request: { connector_id: number; parent_id?: string }) => {
const queryParams = request.parent_id
? `?parent_id=${encodeURIComponent(request.parent_id)}`
: "";
return baseApiService.get(
`/api/v1/connectors/${request.connector_id}/onedrive/folders${queryParams}`,
listGoogleDriveFoldersResponse
);
};
// =============================================================================
// MCP Connector Methods
// =============================================================================

View file

@ -132,11 +132,30 @@ export function buildContentForPersistence(
return parts.length > 0 ? parts : [{ type: "text", text: "" }];
}
export type SSEEvent =
| { type: "text-delta"; delta: string }
| { type: "tool-input-start"; toolCallId: string; toolName: string }
| {
type: "tool-input-available";
toolCallId: string;
toolName: string;
input: Record<string, unknown>;
}
| {
type: "tool-output-available";
toolCallId: string;
output: Record<string, unknown>;
}
| { type: "data-thinking-step"; data: ThinkingStepData }
| { type: "data-thread-title-update"; data: { threadId: number; title: string } }
| { type: "data-interrupt-request"; data: Record<string, unknown> }
| { type: "error"; errorText: string };
/**
* Async generator that reads an SSE stream and yields parsed JSON objects.
* Handles buffering, event splitting, and skips malformed JSON / [DONE] lines.
*/
export async function* readSSEStream(response: Response): AsyncGenerator<unknown> {
export async function* readSSEStream(response: Response): AsyncGenerator<SSEEvent> {
if (!response.body) {
throw new Error("No response body");
}

View file

@ -8,6 +8,7 @@ export const getConnectorTypeDisplay = (type: string): string => {
BAIDU_SEARCH_API: "Baidu Search",
SLACK_CONNECTOR: "Slack",
TEAMS_CONNECTOR: "Microsoft Teams",
ONEDRIVE_CONNECTOR: "OneDrive",
NOTION_CONNECTOR: "Notion",
GITHUB_CONNECTOR: "GitHub",
LINEAR_CONNECTOR: "Linear",