Skip to content

Commit

Permalink
Issue #25 Added support for shared drives
Browse files Browse the repository at this point in the history
  • Loading branch information
ajmas committed Apr 16, 2024
1 parent 6b25799 commit b2d72d5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,8 @@ async function visitDirectory (drive: Drive, fileId: string, folderPath: string,

do {
const response = await drive.files.list({
supportsAllDrives: options.supportsAllDrives,
includeItemsFromAllDrives: options.includeItemsFromAllDrives,
pageToken: nextPageToken,
spaces: 'drive',
fields: 'nextPageToken, files(id, name, parents, mimeType, createdTime, modifiedTime, shortcutDetails)',
Expand Down Expand Up @@ -312,7 +314,8 @@ async function visitDirectory (drive: Drive, fileId: string, folderPath: string,
async function fetchContents(drive: Drive, fileId: string, destFolder: string, options: IOptions) {
const response = await drive.files.get({
fileId: fileId,
fields: 'id, name, parents, mimeType, createdTime, modifiedTime'
fields: 'id, name, parents, mimeType, createdTime, modifiedTime',
supportsAllDrives: options.supportsAllDrives
});

const { data } = response;
Expand Down
4 changes: 3 additions & 1 deletion src/interfaces/IOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ interface IOptions {
fallbackGSuiteFileType?: string,
abortOnError?: boolean,
logger?: any,
sleepTime?: number
sleepTime?: number,
supportsAllDrives?: boolean,
includeItemsFromAllDrives?: boolean
}

export default IOptions;

0 comments on commit b2d72d5

Please sign in to comment.