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,6 +1,6 @@
|
||||
/* eslint-disable n8n-nodes-base/node-filename-against-convention */
|
||||
import type { IExecuteFunctions } from 'n8n-core';
|
||||
import type {
|
||||
IExecuteFunctions,
|
||||
INodeExecutionData,
|
||||
INodeType,
|
||||
INodeTypeBaseDescription,
|
||||
|
||||
@@ -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 { updateDisplayOptions } from '@utils/utilities';
|
||||
|
||||
@@ -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 { getResolvables, updateDisplayOptions } from '@utils/utilities';
|
||||
|
||||
@@ -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 { updateDisplayOptions } from '@utils/utilities';
|
||||
|
||||
|
||||
@@ -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 { updateDisplayOptions } from '@utils/utilities';
|
||||
|
||||
|
||||
@@ -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 { updateDisplayOptions } from '@utils/utilities';
|
||||
|
||||
@@ -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 { updateDisplayOptions } from '@utils/utilities';
|
||||
|
||||
@@ -20,9 +20,9 @@ export async function router(this: IExecuteFunctions): Promise<INodeExecutionDat
|
||||
|
||||
const { db, pgp, sshClient } = await configurePostgres(credentials, options);
|
||||
|
||||
const runQueries = configureQueryRunner(
|
||||
const runQueries = configureQueryRunner.call(
|
||||
this,
|
||||
this.getNode(),
|
||||
this.helpers.constructExecutionMetaData,
|
||||
this.continueOnFail(),
|
||||
pgp,
|
||||
db,
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
import type {
|
||||
IDataObject,
|
||||
INodeExecutionData,
|
||||
IPairedItemData,
|
||||
NodeExecutionWithMetadata,
|
||||
} from 'n8n-workflow';
|
||||
import type { IDataObject, INodeExecutionData } from 'n8n-workflow';
|
||||
import type pgPromise from 'pg-promise';
|
||||
import type pg from 'pg-promise/typescript/pg-subset';
|
||||
import type { Client } from 'ssh2';
|
||||
@@ -33,13 +28,6 @@ export type PgpDatabase = pgPromise.IDatabase<{}, pg.IClient>;
|
||||
export type PgpConnectionParameters = pg.IConnectionParameters<pg.IClient>;
|
||||
export type ConnectionsData = { db: PgpDatabase; pgp: PgpClient; sshClient?: Client };
|
||||
|
||||
export type ConstructExecutionMetaData = (
|
||||
inputData: INodeExecutionData[],
|
||||
options: {
|
||||
itemData: IPairedItemData | IPairedItemData[];
|
||||
},
|
||||
) => NodeExecutionWithMetadata[];
|
||||
|
||||
export type QueriesRunner = (
|
||||
queries: QueryWithValues[],
|
||||
items: INodeExecutionData[],
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
import type { IDataObject, INode, INodeExecutionData, INodePropertyOptions } from 'n8n-workflow';
|
||||
import type {
|
||||
IDataObject,
|
||||
IExecuteFunctions,
|
||||
INode,
|
||||
INodeExecutionData,
|
||||
INodePropertyOptions,
|
||||
} from 'n8n-workflow';
|
||||
import { NodeOperationError } from 'n8n-workflow';
|
||||
|
||||
import type {
|
||||
ColumnInfo,
|
||||
ConstructExecutionMetaData,
|
||||
EnumInfo,
|
||||
PgpClient,
|
||||
PgpDatabase,
|
||||
@@ -194,15 +199,14 @@ export function addReturning(
|
||||
return [`${query} RETURNING $${replacementIndex}:name`, [...replacements, outputColumns]];
|
||||
}
|
||||
|
||||
export const configureQueryRunner =
|
||||
(
|
||||
node: INode,
|
||||
constructExecutionMetaData: ConstructExecutionMetaData,
|
||||
continueOnFail: boolean,
|
||||
pgp: PgpClient,
|
||||
db: PgpDatabase,
|
||||
) =>
|
||||
async (queries: QueryWithValues[], items: INodeExecutionData[], options: IDataObject) => {
|
||||
export function configureQueryRunner(
|
||||
this: IExecuteFunctions,
|
||||
node: INode,
|
||||
continueOnFail: boolean,
|
||||
pgp: PgpClient,
|
||||
db: PgpDatabase,
|
||||
) {
|
||||
return async (queries: QueryWithValues[], items: INodeExecutionData[], options: IDataObject) => {
|
||||
let returnData: INodeExecutionData[] = [];
|
||||
|
||||
const queryBatching = (options.queryBatching as QueryMode) || 'single';
|
||||
@@ -211,7 +215,7 @@ export const configureQueryRunner =
|
||||
try {
|
||||
returnData = (await db.multi(pgp.helpers.concat(queries)))
|
||||
.map((result, i) => {
|
||||
return constructExecutionMetaData(wrapData(result as IDataObject[]), {
|
||||
return this.helpers.constructExecutionMetaData(wrapData(result as IDataObject[]), {
|
||||
itemData: { item: i },
|
||||
});
|
||||
})
|
||||
@@ -242,7 +246,7 @@ export const configureQueryRunner =
|
||||
queries[i].values,
|
||||
);
|
||||
|
||||
const executionData = constructExecutionMetaData(
|
||||
const executionData = this.helpers.constructExecutionMetaData(
|
||||
wrapData(transactionResult.length ? transactionResult : [{ success: true }]),
|
||||
{ itemData: { item: i } },
|
||||
);
|
||||
@@ -269,7 +273,7 @@ export const configureQueryRunner =
|
||||
queries[i].values,
|
||||
);
|
||||
|
||||
const executionData = constructExecutionMetaData(
|
||||
const executionData = this.helpers.constructExecutionMetaData(
|
||||
wrapData(transactionResult.length ? transactionResult : [{ success: true }]),
|
||||
{ itemData: { item: i } },
|
||||
);
|
||||
@@ -287,6 +291,7 @@ export const configureQueryRunner =
|
||||
|
||||
return returnData;
|
||||
};
|
||||
}
|
||||
|
||||
export function replaceEmptyStringsByNulls(
|
||||
items: INodeExecutionData[],
|
||||
|
||||
Reference in New Issue
Block a user