Merge pull request #640 from CREDO23/google-drive-connector

[Feat] Add Google drive connector
This commit is contained in:
Rohan Verma 2025-12-29 20:51:34 -08:00 committed by GitHub
commit 23870042f3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
35 changed files with 2877 additions and 26 deletions

View file

@ -0,0 +1,29 @@
import { useQuery } from "@tanstack/react-query";
import { connectorsApiService } from "@/lib/apis/connectors-api.service";
import { cacheKeys } from "@/lib/query-client/cache-keys";
interface UseGoogleDriveFoldersOptions {
connectorId: number;
parentId?: string;
enabled?: boolean;
}
export function useGoogleDriveFolders({
connectorId,
parentId,
enabled = true,
}: UseGoogleDriveFoldersOptions) {
return useQuery({
queryKey: cacheKeys.connectors.googleDrive.folders(connectorId, parentId),
queryFn: async () => {
return connectorsApiService.listGoogleDriveFolders({
connector_id: connectorId,
parent_id: parentId,
});
},
enabled: enabled && !!connectorId,
staleTime: 5 * 60 * 1000, // 5 minutes
retry: 2,
});
}

View file

@ -267,7 +267,9 @@ export const useSearchSourceConnectors = (lazy: boolean = false, searchSpaceId?:
connectorId: number,
searchSpaceId: string | number,
startDate?: string,
endDate?: string
endDate?: string,
folderIds?: string,
folderNames?: string
) => {
try {
// Build query parameters
@ -280,6 +282,12 @@ export const useSearchSourceConnectors = (lazy: boolean = false, searchSpaceId?:
if (endDate) {
params.append("end_date", endDate);
}
if (folderIds) {
params.append("folder_ids", folderIds);
}
if (folderNames) {
params.append("folder_names", folderNames);
}
const response = await authenticatedFetch(
`${