mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-24 04:59:13 +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 { getResultNodeData, setup, workflowToTests } from '../../../../../../../test/nodes/Helpers';
|
||||
import type { WorkflowTestData } from '../../../../../../../test/nodes/types';
|
||||
import { executeWorkflow } from '../../../../../../../test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, 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 { getResultNodeData, setup, workflowToTests } from '../../../../../../../test/nodes/Helpers';
|
||||
import type { WorkflowTestData } from '../../../../../../../test/nodes/types';
|
||||
import { executeWorkflow } from '../../../../../../../test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, 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 { getResultNodeData, setup, workflowToTests } from '../../../../../../../test/nodes/Helpers';
|
||||
import type { WorkflowTestData } from '../../../../../../../test/nodes/types';
|
||||
import { executeWorkflow } from '../../../../../../../test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, 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 { getResultNodeData, setup, workflowToTests } from '../../../../../../../test/nodes/Helpers';
|
||||
import type { WorkflowTestData } from '../../../../../../../test/nodes/types';
|
||||
import { executeWorkflow } from '../../../../../../../test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, 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 { getResultNodeData, setup, workflowToTests } from '../../../../../../../test/nodes/Helpers';
|
||||
import type { WorkflowTestData } from '../../../../../../../test/nodes/types';
|
||||
import { executeWorkflow } from '../../../../../../../test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, 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 { getResultNodeData, setup, workflowToTests } from '../../../../../../../test/nodes/Helpers';
|
||||
import type { WorkflowTestData } from '../../../../../../../test/nodes/types';
|
||||
import { executeWorkflow } from '../../../../../../../test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, 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 { getResultNodeData, setup, workflowToTests } from '../../../../../../../test/nodes/Helpers';
|
||||
import type { WorkflowTestData } from '../../../../../../../test/nodes/types';
|
||||
import { executeWorkflow } from '../../../../../../../test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, 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 { getResultNodeData, setup, workflowToTests } from '../../../../../../../test/nodes/Helpers';
|
||||
import type { WorkflowTestData } from '../../../../../../../test/nodes/types';
|
||||
import { executeWorkflow } from '../../../../../../../test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, 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 { getResultNodeData, setup, workflowToTests } from '../../../../../../../test/nodes/Helpers';
|
||||
import type { WorkflowTestData } from '../../../../../../../test/nodes/types';
|
||||
import { executeWorkflow } from '../../../../../../../test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, 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 { getResultNodeData, setup, workflowToTests } from '../../../../../../../test/nodes/Helpers';
|
||||
import type { WorkflowTestData } from '../../../../../../../test/nodes/types';
|
||||
import { executeWorkflow } from '../../../../../../../test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, 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,10 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||
import type { IDataObject } from 'n8n-workflow';
|
||||
|
||||
import { equalityTest, setup, workflowToTests } from '../../../../../../../test/nodes/Helpers';
|
||||
|
||||
// eslint-disable-next-line unused-imports/no-unused-imports
|
||||
import * as transport from '../../../../v2/transport';
|
||||
import { equalityTest, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
||||
import nock from 'nock';
|
||||
|
||||
@@ -12,14 +6,7 @@ jest.mock('../../../../v2/transport', () => {
|
||||
const originalModule = jest.requireActual('../../../../v2/transport');
|
||||
return {
|
||||
...originalModule,
|
||||
microsoftApiRequest: jest.fn(async function (
|
||||
method: string,
|
||||
resource: string,
|
||||
body?: IDataObject,
|
||||
qs?: IDataObject,
|
||||
uri?: string,
|
||||
headers?: IDataObject,
|
||||
) {
|
||||
microsoftApiRequest: jest.fn(async function (method: string, resource: string) {
|
||||
if (method === 'GET' && resource.includes('usedRange')) {
|
||||
return {
|
||||
address: 'Sheet4!A1:D6',
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { INodeTypes } from 'n8n-workflow';
|
||||
|
||||
import { getResultNodeData, setup, workflowToTests } from '../../../../../../../test/nodes/Helpers';
|
||||
import type { WorkflowTestData } from '../../../../../../../test/nodes/types';
|
||||
import { executeWorkflow } from '../../../../../../../test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, 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 { getResultNodeData, setup, workflowToTests } from '../../../../../../../test/nodes/Helpers';
|
||||
import type { WorkflowTestData } from '../../../../../../../test/nodes/types';
|
||||
import { executeWorkflow } from '../../../../../../../test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, 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 { getResultNodeData, setup, workflowToTests } from '../../../../../../../test/nodes/Helpers';
|
||||
import type { WorkflowTestData } from '../../../../../../../test/nodes/types';
|
||||
import { executeWorkflow } from '../../../../../../../test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, 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,7 +1,4 @@
|
||||
import { equalityTest, setup, workflowToTests } from '../../../../../../../test/nodes/Helpers';
|
||||
|
||||
// eslint-disable-next-line unused-imports/no-unused-imports
|
||||
import * as _transport from '../../../../v2/transport';
|
||||
import { equalityTest, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
||||
import nock from 'nock';
|
||||
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
import { equalityTest, setup, workflowToTests } from '../../../../../../../test/nodes/Helpers';
|
||||
|
||||
// eslint-disable-next-line unused-imports/no-unused-imports
|
||||
import * as _transport from '../../../../v2/transport';
|
||||
import { equalityTest, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
||||
import nock from 'nock';
|
||||
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
import { equalityTest, setup, workflowToTests } from '../../../../../../../test/nodes/Helpers';
|
||||
|
||||
// eslint-disable-next-line unused-imports/no-unused-imports
|
||||
import * as _transport from '../../../../v2/transport';
|
||||
import { equalityTest, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
||||
import nock from 'nock';
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { get } from 'lodash';
|
||||
import { mock } from 'jest-mock-extended';
|
||||
import type { IDataObject, IExecuteFunctions, IGetNodeParameterOptions, INode } from 'n8n-workflow';
|
||||
import { constructExecutionMetaData } from 'n8n-core';
|
||||
import {
|
||||
prepareOutput,
|
||||
updateByAutoMaping,
|
||||
@@ -86,27 +88,34 @@ const responseData = {
|
||||
};
|
||||
|
||||
describe('Test MicrosoftExcelV2, prepareOutput', () => {
|
||||
const thisArg = mock<IExecuteFunctions>({
|
||||
helpers: mock({ constructExecutionMetaData }),
|
||||
});
|
||||
|
||||
it('should return empty array', () => {
|
||||
const output = prepareOutput(node, { values: [] }, { rawData: false });
|
||||
const output = prepareOutput.call(thisArg, node, { values: [] }, { rawData: false });
|
||||
expect(output).toBeDefined();
|
||||
expect(output).toEqual([]);
|
||||
});
|
||||
|
||||
it('should return raw response', () => {
|
||||
const output = prepareOutput(node, responseData, { rawData: true });
|
||||
const output = prepareOutput.call(thisArg, node, responseData, { rawData: true });
|
||||
expect(output).toBeDefined();
|
||||
expect(output[0].json.data).toEqual(responseData);
|
||||
});
|
||||
|
||||
it('should return raw response in custom property', () => {
|
||||
const customKey = 'customKey';
|
||||
const output = prepareOutput(node, responseData, { rawData: true, dataProperty: customKey });
|
||||
const output = prepareOutput.call(thisArg, node, responseData, {
|
||||
rawData: true,
|
||||
dataProperty: customKey,
|
||||
});
|
||||
expect(output).toBeDefined();
|
||||
expect(output[0].json.customKey).toEqual(responseData);
|
||||
});
|
||||
|
||||
it('should return formated response', () => {
|
||||
const output = prepareOutput(node, responseData, { rawData: false });
|
||||
const output = prepareOutput.call(thisArg, node, responseData, { rawData: false });
|
||||
expect(output).toBeDefined();
|
||||
expect(output.length).toEqual(3);
|
||||
expect(output[0].json).toEqual({
|
||||
@@ -118,7 +127,10 @@ describe('Test MicrosoftExcelV2, prepareOutput', () => {
|
||||
});
|
||||
|
||||
it('should return response with selected first data row', () => {
|
||||
const output = prepareOutput(node, responseData, { rawData: false, firstDataRow: 3 });
|
||||
const output = prepareOutput.call(thisArg, node, responseData, {
|
||||
rawData: false,
|
||||
firstDataRow: 3,
|
||||
});
|
||||
expect(output).toBeDefined();
|
||||
expect(output.length).toEqual(1);
|
||||
expect(output[0].json).toEqual({
|
||||
@@ -132,7 +144,11 @@ describe('Test MicrosoftExcelV2, prepareOutput', () => {
|
||||
it('should return response with selected first data row', () => {
|
||||
const [firstRow, ...rest] = responseData.values;
|
||||
const response = { values: [...rest, firstRow] };
|
||||
const output = prepareOutput(node, response, { rawData: false, keyRow: 3, firstDataRow: 0 });
|
||||
const output = prepareOutput.call(thisArg, node, response, {
|
||||
rawData: false,
|
||||
keyRow: 3,
|
||||
firstDataRow: 0,
|
||||
});
|
||||
expect(output).toBeDefined();
|
||||
expect(output.length).toEqual(3);
|
||||
expect(output[0].json).toEqual({
|
||||
|
||||
Reference in New Issue
Block a user