mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-19 19:11:13 +00:00
refactor(Google Drive Node): Use node streams for uploading and downloading files (#5017)
* use streams to upload files to google drive * use streams to download files from google drive * use resumable uploads api for google drive * avoid dangling promises, and reduce memory usage in error logging
This commit is contained in:
committed by
GitHub
parent
8b19fdd5f0
commit
54126b2c87
@@ -40,10 +40,16 @@ export interface IBinaryData {
|
||||
fileName?: string;
|
||||
directory?: string;
|
||||
fileExtension?: string;
|
||||
fileSize?: string;
|
||||
fileSize?: string; // TODO: change this to number and store the actual value
|
||||
id?: string;
|
||||
}
|
||||
|
||||
export interface BinaryMetadata {
|
||||
fileName?: string;
|
||||
mimeType?: string;
|
||||
fileSize: number;
|
||||
}
|
||||
|
||||
// All properties in this interface except for
|
||||
// "includeCredentialsOnRefreshOnBody" will get
|
||||
// removed once we add the OAuth2 hooks to the
|
||||
@@ -641,6 +647,9 @@ export interface BinaryHelperFunctions {
|
||||
): Promise<IBinaryData>;
|
||||
setBinaryDataBuffer(data: IBinaryData, binaryData: Buffer): Promise<IBinaryData>;
|
||||
copyBinaryFile(filePath: string, fileName: string, mimeType?: string): Promise<IBinaryData>;
|
||||
|
||||
getBinaryStream(binaryDataId: string, chunkSize?: number): Readable;
|
||||
getBinaryMetadata(binaryDataId: string): Promise<BinaryMetadata>;
|
||||
}
|
||||
|
||||
export interface RequestHelperFunctions {
|
||||
@@ -721,7 +730,6 @@ export type IExecuteFunctions = ExecuteFunctions.GetNodeParameterFn &
|
||||
inputData: INodeExecutionData[],
|
||||
options: { itemData: IPairedItemData | IPairedItemData[] },
|
||||
): NodeExecutionWithMetadata[];
|
||||
|
||||
getBinaryDataBuffer(itemIndex: number, propertyName: string): Promise<Buffer>;
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user