fix(Google BigQuery Node): Send timeoutMs in query, pagination support (#10205)

This commit is contained in:
Michael Kret
2024-07-29 21:28:16 +03:00
committed by GitHub
parent cf70b06545
commit f5722e8823
8 changed files with 80 additions and 47 deletions

View File

@@ -1,5 +1,5 @@
import type { IDataObject, ILoadOptionsFunctions, INodeListSearchResult } from 'n8n-workflow';
import { googleApiRequest } from '../transport';
import { googleBigQueryApiRequest } from '../transport';
export async function searchProjects(
this: ILoadOptionsFunctions,
@@ -10,7 +10,7 @@ export async function searchProjects(
pageToken: (paginationToken as string) || undefined,
};
const response = await googleApiRequest.call(this, 'GET', '/v2/projects', undefined, qs);
const response = await googleBigQueryApiRequest.call(this, 'GET', '/v2/projects', undefined, qs);
let { projects } = response;
@@ -45,7 +45,7 @@ export async function searchDatasets(
pageToken: (paginationToken as string) || undefined,
};
const response = await googleApiRequest.call(
const response = await googleBigQueryApiRequest.call(
this,
'GET',
`/v2/projects/${projectId}/datasets`,
@@ -87,7 +87,7 @@ export async function searchTables(
pageToken: (paginationToken as string) || undefined,
};
const response = await googleApiRequest.call(
const response = await googleBigQueryApiRequest.call(
this,
'GET',
`/v2/projects/${projectId}/datasets/${datasetId}/tables`,

View File

@@ -1,12 +1,12 @@
import type { IDataObject, ILoadOptionsFunctions, INodePropertyOptions } from 'n8n-workflow';
import { googleApiRequest } from '../transport';
import { googleBigQueryApiRequest } from '../transport';
export async function getDatasets(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
const projectId = this.getNodeParameter('projectId', undefined, {
extractValue: true,
});
const returnData: INodePropertyOptions[] = [];
const { datasets } = await googleApiRequest.call(
const { datasets } = await googleBigQueryApiRequest.call(
this,
'GET',
`/v2/projects/${projectId}/datasets`,
@@ -33,7 +33,7 @@ export async function getSchema(this: ILoadOptionsFunctions): Promise<INodePrope
const returnData: INodePropertyOptions[] = [];
const { schema } = await googleApiRequest.call(
const { schema } = await googleBigQueryApiRequest.call(
this,
'GET',
`/v2/projects/${projectId}/datasets/${datasetId}/tables/${tableId}`,