n8n-nodes-base
Version:
Base nodes of n8n
93 lines (88 loc) • 4.24 kB
text/typescript
/**
* Google Drive Node - Version 3
* Discriminator: resource=fileFolder, operation=search
*/
interface Credentials {
googleApi: CredentialReference;
googleDriveOAuth2Api: CredentialReference;
}
/** Search or list files and folders */
export type GoogleDriveV3FileFolderSearchParams = {
resource: 'fileFolder';
operation: 'search';
authentication?: 'oAuth2' | 'serviceAccount' | Expression<string>;
/**
* Whether to search for the file/folder name or use a query string
* @default name
*/
searchMethod?: 'name' | 'query' | Expression<string>;
/**
* The name of the file or folder to search for. Returns also files and folders whose names partially match this search term.
* @displayOptions.show { searchMethod: ["name"] }
*/
queryString?: string | Expression<string> | PlaceholderValue;
/**
* Whether to return all results or only up to a given limit
* @default false
*/
returnAll?: boolean | Expression<boolean>;
/**
* Max number of results to return
* @displayOptions.show { returnAll: [false] }
* @default 50
*/
limit?: number | Expression<number>;
/**
* Filter
* @default {}
*/
filter?: {
/** The drive you want to search in. By default, the personal "My Drive" is used.
* @default {"mode":"list","value":"My Drive"}
*/
driveId?: { __rl: true; mode: 'list' | 'url' | 'id'; value: string; cachedResultName?: string };
/** The folder you want to search in. By default, the root folder of the drive is used. If you select a folder other than the root folder, only the direct children will be included.
* @default {"mode":"list","value":"root","cachedResultName":"/ (Root folder)"}
*/
folderId?: { __rl: true; mode: 'list' | 'url' | 'id'; value: string; cachedResultName?: string };
/** What to Search
* @default all
*/
whatToSearch?: 'all' | 'files' | 'folders' | Expression<string>;
/** Return only items corresponding to the selected MIME types
* @displayOptions.show { whatToSearch: ["all"] }
* @default []
*/
fileTypes?: Array<'*' | 'application/vnd.google-apps.drive-sdk' | 'application/vnd.google-apps.audio' | 'application/vnd.google-apps.folder' | 'application/vnd.google-apps.script' | 'application/vnd.google-apps.document' | 'application/vnd.google-apps.drawing' | 'application/vnd.google-apps.form' | 'application/vnd.google-apps.fusiontable' | 'application/vnd.google-apps.map' | 'application/vnd.google-apps.spreadsheet' | 'application/vnd.google-apps.sites' | 'application/vnd.google-apps.presentation' | 'application/vnd.google-apps.photo' | 'application/vnd.google-apps.unknown' | 'application/vnd.google-apps.video'>;
/** Return only items corresponding to the selected MIME types
* @displayOptions.show { whatToSearch: ["files"] }
* @default []
*/
fileTypes?: Array<'*' | 'application/vnd.google-apps.drive-sdk' | 'application/vnd.google-apps.audio' | 'application/vnd.google-apps.script' | 'application/vnd.google-apps.document' | 'application/vnd.google-apps.drawing' | 'application/vnd.google-apps.form' | 'application/vnd.google-apps.fusiontable' | 'application/vnd.google-apps.map' | 'application/vnd.google-apps.spreadsheet' | 'application/vnd.google-apps.sites' | 'application/vnd.google-apps.presentation' | 'application/vnd.google-apps.photo' | 'application/vnd.google-apps.unknown' | 'application/vnd.google-apps.video'>;
/** Whether to return also items in the Drive's bin
* @default false
*/
includeTrashed?: boolean | Expression<boolean>;
};
/**
* Options
* @default {}
*/
options?: {
/** The fields to return
* @default []
*/
fields?: Array<'*' | 'explicitlyTrashed' | 'exportLinks' | 'hasThumbnail' | 'iconLink' | 'id' | 'kind' | 'mimeType' | 'name' | 'permissions' | 'shared' | 'spaces' | 'starred' | 'thumbnailLink' | 'trashed' | 'version' | 'webViewLink'>;
};
};
export type GoogleDriveV3FileFolderSearchOutput = {
id?: string;
name?: string;
};
export type GoogleDriveV3FileFolderSearchNode = {
type: 'n8n-nodes-base.googleDrive';
version: 3;
credentials?: Credentials;
config: NodeConfig<GoogleDriveV3FileFolderSearchParams>;
output?: Items<GoogleDriveV3FileFolderSearchOutput>;
};