Skip to content

Commit

Permalink
inline upsertSharedWithMeFolder
Browse files Browse the repository at this point in the history
  • Loading branch information
aubin-tchoi committed Dec 19, 2024
1 parent 4e46a14 commit a41b0a9
Showing 1 changed file with 10 additions and 16 deletions.
26 changes: 10 additions & 16 deletions connectors/src/connectors/google_drive/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,16 @@ export class GoogleDriveConnectorManager extends BaseConnectorManager<null> {
googleDriveConfigurationBlob
);

await upsertSharedWithMeFolder(connector);
// Upserts to data_sources_folders (core) a top-level folder "Shared with me".
const folderId = getInternalId(GOOGLE_DRIVE_SHARED_WITH_ME_VIRTUAL_ID);
await upsertDataSourceFolder({
dataSourceConfig: dataSourceConfigFromConnector(connector),
folderId,
parents: [folderId],
parentId: null,
title: "Shared with me",
mimeType: "application/vnd.dust.googledrive.folder",
});

// We mark it artificially as sync succeeded as google drive is created empty.
await syncSucceeded(connector.id);
Expand Down Expand Up @@ -982,18 +991,3 @@ function getSourceUrlForGoogleDriveFiles(f: GoogleDriveFiles): string {

return `https://drive.google.com/file/d/${f.driveFileId}/view`;
}

/**
* Upserts to data_sources_folders (core) a top-level folder "Shared with me".
*/
async function upsertSharedWithMeFolder(connector: ConnectorResource) {
const folderId = getInternalId(GOOGLE_DRIVE_SHARED_WITH_ME_VIRTUAL_ID);
await upsertDataSourceFolder({
dataSourceConfig: dataSourceConfigFromConnector(connector),
folderId,
parents: [folderId],
parentId: null,
title: "Shared with me",
mimeType: "application/vnd.dust.googledrive.folder",
});
}

0 comments on commit a41b0a9

Please sign in to comment.