mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
refactor: Delete unnecessary interface re-exports from core, and delete unused code in nodes-base (no-changelog) (#6631)
This commit is contained in:
committed by
GitHub
parent
329d22f5d1
commit
e57e85edf7
@@ -1,8 +1,8 @@
|
||||
import type { INodeTypes } from 'n8n-workflow';
|
||||
|
||||
import { setup, workflowToTests } from '../../../../../../test/nodes/Helpers';
|
||||
import type { WorkflowTestData } from '../../../../../../test/nodes/types';
|
||||
import { executeWorkflow } from '../../../../../../test/nodes/ExecuteWorkflow';
|
||||
import { setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
import type { WorkflowTestData } from '@test/nodes/types';
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
|
||||
import * as transport from '../../../v2/transport';
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { INodeTypes } from 'n8n-workflow';
|
||||
|
||||
import { setup, workflowToTests } from '../../../../../../test/nodes/Helpers';
|
||||
import type { WorkflowTestData } from '../../../../../../test/nodes/types';
|
||||
import { executeWorkflow } from '../../../../../../test/nodes/ExecuteWorkflow';
|
||||
import { setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
import type { WorkflowTestData } from '@test/nodes/types';
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import * as transport from '../../../v2/transport';
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { INodeTypes } from 'n8n-workflow';
|
||||
|
||||
import { setup, workflowToTests } from '../../../../../../test/nodes/Helpers';
|
||||
import type { WorkflowTestData } from '../../../../../../test/nodes/types';
|
||||
import { executeWorkflow } from '../../../../../../test/nodes/ExecuteWorkflow';
|
||||
import { setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
import type { WorkflowTestData } from '@test/nodes/types';
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import * as transport from '../../../v2/transport';
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
import type { IDataObject } from 'n8n-workflow';
|
||||
import type { IDataObject, IExecuteFunctions } from 'n8n-workflow';
|
||||
import { constructExecutionMetaData } from 'n8n-core';
|
||||
import { prepareOutput } from '../../../v2/helpers/utils';
|
||||
import { mock } from 'jest-mock-extended';
|
||||
|
||||
describe('Google BigQuery v2 Utils', () => {
|
||||
it('should prepareOutput', () => {
|
||||
const thisArg = mock<IExecuteFunctions>({ helpers: mock({ constructExecutionMetaData }) });
|
||||
const response: IDataObject = {
|
||||
kind: 'bigquery#getQueryResultsResponse',
|
||||
etag: 'e_tag',
|
||||
@@ -211,7 +214,7 @@ describe('Google BigQuery v2 Utils', () => {
|
||||
jobComplete: true,
|
||||
cacheHit: true,
|
||||
};
|
||||
const returnData = prepareOutput(response, 0, false, false);
|
||||
const returnData = prepareOutput.call(thisArg, response, 0, false, false);
|
||||
|
||||
expect(returnData).toBeDefined();
|
||||
// expect(returnData).toHaveProperty('nodes');
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
/* eslint-disable n8n-nodes-base/node-filename-against-convention */
|
||||
import type { IExecuteFunctions } from 'n8n-core';
|
||||
|
||||
import type {
|
||||
IDataObject,
|
||||
IExecuteFunctions,
|
||||
ILoadOptionsFunctions,
|
||||
INodeExecutionData,
|
||||
INodePropertyOptions,
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/* eslint-disable n8n-nodes-base/node-filename-against-convention */
|
||||
import type { IExecuteFunctions } from 'n8n-core';
|
||||
|
||||
import type {
|
||||
IExecuteFunctions,
|
||||
INodeExecutionData,
|
||||
INodeType,
|
||||
INodeTypeBaseDescription,
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
import type { IExecuteFunctions } from 'n8n-core';
|
||||
|
||||
import type { IDataObject, INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
||||
import type {
|
||||
IDataObject,
|
||||
IExecuteFunctions,
|
||||
INodeExecutionData,
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import { NodeOperationError, sleep } from 'n8n-workflow';
|
||||
import { getResolvables, updateDisplayOptions } from '@utils/utilities';
|
||||
@@ -232,7 +235,7 @@ export async function execute(this: IExecuteFunctions): Promise<INodeExecutionDa
|
||||
qs,
|
||||
);
|
||||
|
||||
returnData.push(...prepareOutput(queryResponse, i, raw, includeSchema));
|
||||
returnData.push(...prepareOutput.call(this, queryResponse, i, raw, includeSchema));
|
||||
} else {
|
||||
jobs.push({ jobId, projectId, i, raw, includeSchema, location: options.location });
|
||||
}
|
||||
@@ -271,7 +274,7 @@ export async function execute(this: IExecuteFunctions): Promise<INodeExecutionDa
|
||||
if (response.jobComplete) {
|
||||
completedJobs.push(job.jobId);
|
||||
|
||||
returnData.push(...prepareOutput(response, job.i, job.raw, job.includeSchema));
|
||||
returnData.push(...prepareOutput.call(this, response, job.i, job.raw, job.includeSchema));
|
||||
}
|
||||
if ((response?.errors as IDataObject[])?.length) {
|
||||
const errorMessages = (response.errors as IDataObject[]).map((error) => error.message);
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
import type { IExecuteFunctions } from 'n8n-core';
|
||||
import type { IDataObject, INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
||||
import type {
|
||||
IDataObject,
|
||||
IExecuteFunctions,
|
||||
INodeExecutionData,
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
import { NodeOperationError } from 'n8n-workflow';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import { updateDisplayOptions } from '@utils/utilities';
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import type { IExecuteFunctions } from 'n8n-core';
|
||||
import type { INodeExecutionData } from 'n8n-workflow';
|
||||
import type { IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
|
||||
import { NodeOperationError } from 'n8n-workflow';
|
||||
import type { GoogleBigQuery } from './node.type';
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import type { IExecuteFunctions } from 'n8n-core';
|
||||
import { constructExecutionMetaData } from 'n8n-core';
|
||||
import type { IDataObject, INodeExecutionData } from 'n8n-workflow';
|
||||
import type { IDataObject, IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
|
||||
import { jsonParse, NodeOperationError } from 'n8n-workflow';
|
||||
import type { SchemaField, TableRawData, TableSchema } from './interfaces';
|
||||
|
||||
@@ -56,6 +54,7 @@ export function simplify(data: TableRawData[], schema: SchemaField[], includeSch
|
||||
}
|
||||
|
||||
export function prepareOutput(
|
||||
this: IExecuteFunctions,
|
||||
response: IDataObject,
|
||||
itemIndex: number,
|
||||
rawOutput: boolean,
|
||||
@@ -82,9 +81,12 @@ export function prepareOutput(
|
||||
}
|
||||
}
|
||||
|
||||
const executionData = constructExecutionMetaData(wrapData(responseData as IDataObject[]), {
|
||||
itemData: { item: itemIndex },
|
||||
});
|
||||
const executionData = this.helpers.constructExecutionMetaData(
|
||||
wrapData(responseData as IDataObject[]),
|
||||
{
|
||||
itemData: { item: itemIndex },
|
||||
},
|
||||
);
|
||||
|
||||
return executionData;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
import type { OptionsWithUri } from 'request';
|
||||
|
||||
import type { IExecuteFunctions, IExecuteSingleFunctions, ILoadOptionsFunctions } from 'n8n-core';
|
||||
import type { IDataObject, JsonObject } from 'n8n-workflow';
|
||||
import type {
|
||||
IDataObject,
|
||||
IExecuteFunctions,
|
||||
IExecuteSingleFunctions,
|
||||
ILoadOptionsFunctions,
|
||||
JsonObject,
|
||||
} from 'n8n-workflow';
|
||||
import { NodeApiError, NodeOperationError } from 'n8n-workflow';
|
||||
import { getGoogleAccessToken } from '../../../GenericFunctions';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user