mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-11 21:07:28 -08:00
fix(Google Drive Node): Fix issue preventing upload / update working in some configurations (#8417)
This commit is contained in:
parent
a8b4684192
commit
4b3ea81028
|
@ -26,7 +26,7 @@ describe('test GoogleDriveV2: file copy', () => {
|
||||||
jest.unmock('../../../../v2/transport');
|
jest.unmock('../../../../v2/transport');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('shuold be called with', async () => {
|
it('should be called with', async () => {
|
||||||
const nodeParameters = {
|
const nodeParameters = {
|
||||||
operation: 'copy',
|
operation: 'copy',
|
||||||
fileId: {
|
fileId: {
|
||||||
|
|
|
@ -26,7 +26,7 @@ describe('test GoogleDriveV2: file createFromText', () => {
|
||||||
jest.unmock('../../../../v2/transport');
|
jest.unmock('../../../../v2/transport');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('shuold be called with', async () => {
|
it('should be called with', async () => {
|
||||||
const nodeParameters = {
|
const nodeParameters = {
|
||||||
operation: 'createFromText',
|
operation: 'createFromText',
|
||||||
content: 'hello drive!',
|
content: 'hello drive!',
|
||||||
|
|
|
@ -26,7 +26,7 @@ describe('test GoogleDriveV2: file deleteFile', () => {
|
||||||
jest.unmock('../../../../v2/transport');
|
jest.unmock('../../../../v2/transport');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('shuold be called with', async () => {
|
it('should be called with', async () => {
|
||||||
const nodeParameters = {
|
const nodeParameters = {
|
||||||
operation: 'deleteFile',
|
operation: 'deleteFile',
|
||||||
fileId: {
|
fileId: {
|
||||||
|
|
|
@ -31,7 +31,7 @@ describe('test GoogleDriveV2: file move', () => {
|
||||||
jest.unmock('../../../../v2/transport');
|
jest.unmock('../../../../v2/transport');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('shuold be called with', async () => {
|
it('should be called with', async () => {
|
||||||
const nodeParameters = {
|
const nodeParameters = {
|
||||||
operation: 'move',
|
operation: 'move',
|
||||||
fileId: {
|
fileId: {
|
||||||
|
|
|
@ -26,7 +26,7 @@ describe('test GoogleDriveV2: file share', () => {
|
||||||
jest.unmock('../../../../v2/transport');
|
jest.unmock('../../../../v2/transport');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('shuold be called with', async () => {
|
it('should be called with', async () => {
|
||||||
const nodeParameters = {
|
const nodeParameters = {
|
||||||
operation: 'share',
|
operation: 'share',
|
||||||
fileId: {
|
fileId: {
|
||||||
|
|
|
@ -26,7 +26,7 @@ describe('test GoogleDriveV2: file update', () => {
|
||||||
jest.unmock('../../../../v2/transport');
|
jest.unmock('../../../../v2/transport');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('shuold be called with', async () => {
|
it('should be called with', async () => {
|
||||||
const nodeParameters = {
|
const nodeParameters = {
|
||||||
operation: 'update',
|
operation: 'update',
|
||||||
fileId: {
|
fileId: {
|
||||||
|
|
|
@ -48,7 +48,7 @@ describe('test GoogleDriveV2: file upload', () => {
|
||||||
jest.unmock('../../../../v2/helpers/utils');
|
jest.unmock('../../../../v2/helpers/utils');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('shuold be called with', async () => {
|
it('should be called with', async () => {
|
||||||
const nodeParameters = {
|
const nodeParameters = {
|
||||||
name: 'newFile.txt',
|
name: 'newFile.txt',
|
||||||
folderId: {
|
folderId: {
|
||||||
|
@ -75,7 +75,7 @@ describe('test GoogleDriveV2: file upload', () => {
|
||||||
undefined,
|
undefined,
|
||||||
{ uploadType: 'resumable' },
|
{ uploadType: 'resumable' },
|
||||||
undefined,
|
undefined,
|
||||||
{ resolveWithFullResponse: true },
|
{ returnFullResponse: true },
|
||||||
);
|
);
|
||||||
expect(transport.googleApiRequest).toHaveBeenCalledWith(
|
expect(transport.googleApiRequest).toHaveBeenCalledWith(
|
||||||
'PATCH',
|
'PATCH',
|
||||||
|
|
|
@ -203,7 +203,7 @@ export async function execute(this: IExecuteFunctions, i: number): Promise<INode
|
||||||
{ uploadType: 'resumable' },
|
{ uploadType: 'resumable' },
|
||||||
undefined,
|
undefined,
|
||||||
{
|
{
|
||||||
resolveWithFullResponse: true,
|
returnFullResponse: true,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
const uploadUrl = resumableUpload.headers.location;
|
const uploadUrl = resumableUpload.headers.location;
|
||||||
|
|
|
@ -123,9 +123,10 @@ export async function execute(this: IExecuteFunctions, i: number): Promise<INode
|
||||||
{ uploadType: 'resumable' },
|
{ uploadType: 'resumable' },
|
||||||
undefined,
|
undefined,
|
||||||
{
|
{
|
||||||
resolveWithFullResponse: true,
|
returnFullResponse: true,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
const uploadUrl = resumableUpload.headers.location;
|
const uploadUrl = resumableUpload.headers.location;
|
||||||
|
|
||||||
let offset = 0;
|
let offset = 0;
|
||||||
|
|
Loading…
Reference in a new issue