Skip to content

Commit

Permalink
refactor: Remove n8n-core dependency in nodes-base (no-changelog) (#5649
Browse files Browse the repository at this point in the history
)
  • Loading branch information
netroy authored Mar 9, 2023
1 parent 5790e5e commit 7a4e9ef
Show file tree
Hide file tree
Showing 667 changed files with 1,843 additions and 1,585 deletions.
3 changes: 2 additions & 1 deletion packages/cli/src/WebhookHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import type express from 'express';
import get from 'lodash.get';

import { BINARY_ENCODING, BinaryDataManager, NodeExecuteFunctions, eventEmitter } from 'n8n-core';
import { BinaryDataManager, NodeExecuteFunctions, eventEmitter } from 'n8n-core';

import type {
IBinaryKeyData,
Expand All @@ -35,6 +35,7 @@ import type {
WorkflowExecuteMode,
} from 'n8n-workflow';
import {
BINARY_ENCODING,
createDeferredPromise,
ErrorReporterProxy as ErrorReporter,
LoggerProxy as Logger,
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/BinaryDataManager/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { readFile, stat } from 'fs/promises';
import type { BinaryMetadata, IBinaryData, INodeExecutionData } from 'n8n-workflow';
import prettyBytes from 'pretty-bytes';
import type { Readable } from 'stream';
import { BINARY_ENCODING } from '../Constants';
import { BINARY_ENCODING } from 'n8n-workflow';
import type { IBinaryDataConfig, IBinaryDataManager } from '../Interfaces';
import { BinaryDataFileSystem } from './FileSystem';
import { binaryToBuffer } from './utils';
Expand Down
2 changes: 0 additions & 2 deletions packages/core/src/Constants.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* eslint-disable @typescript-eslint/naming-convention */
export const BINARY_ENCODING = 'base64';
export const CUSTOM_EXTENSION_ENV = 'N8N_CUSTOM_EXTENSIONS';
export const DOWNLOADED_NODES_SUBDIRECTORY = 'nodes';
export const ENCRYPTION_KEY_ENV_OVERWRITE = 'N8N_ENCRYPTION_KEY';
Expand All @@ -10,7 +9,6 @@ export const USER_SETTINGS_SUBFOLDER = '.n8n';
export const PLACEHOLDER_EMPTY_EXECUTION_ID = '__UNKNOWN__';
export const PLACEHOLDER_EMPTY_WORKFLOW_ID = '__EMPTY__';
export const TUNNEL_SUBDOMAIN_ENV = 'N8N_TUNNEL_SUBDOMAIN';
export const WAIT_TIME_UNLIMITED = '3000-01-01T00:00:00.000Z';

export const RESPONSE_ERROR_MESSAGES = {
NO_ENCRYPTION_KEY: 'Encryption key is missing or was not set',
Expand Down
6 changes: 0 additions & 6 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,3 @@ export * from './NodeExecuteFunctions';
export * from './WorkflowExecute';
export { eventEmitter, NodeExecuteFunctions, UserSettings };
export * from './errors';

declare module 'http' {
export interface IncomingMessage {
rawBody: Buffer;
}
}
2 changes: 1 addition & 1 deletion packages/node-dev/src/Build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export async function createCustomTsconfig() {
/**
* Builds and copies credentials and nodes
*
* @param {IBuildOptions} [options] Options to overwrite default behaviour
* @param {IBuildOptions} [options] Options to overwrite default behavior
*/
export async function buildFiles({
destinationFolder = UserSettings.getUserN8nFolderCustomExtensionPath(),
Expand Down
8 changes: 6 additions & 2 deletions packages/node-dev/templates/execute/simple.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { IExecuteFunctions } from 'n8n-core';
import { INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
import {
IExecuteFunctions,
INodeExecutionData,
INodeType,
INodeTypeDescription,
} from 'n8n-workflow';

export class ClassNameReplace implements INodeType {
description: INodeTypeDescription = {
Expand Down
3 changes: 1 addition & 2 deletions packages/node-dev/templates/trigger/simple.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ITriggerFunctions } from 'n8n-core';
import { INodeType, INodeTypeDescription, ITriggerResponse } from 'n8n-workflow';
import { ITriggerFunctions, INodeType, INodeTypeDescription, ITriggerResponse } from 'n8n-workflow';

export class ClassNameReplace implements INodeType {
description: INodeTypeDescription = {
Expand Down
10 changes: 7 additions & 3 deletions packages/node-dev/templates/webhook/simple.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { IWebhookFunctions } from 'n8n-core';

import { IDataObject, INodeTypeDescription, INodeType, IWebhookResponseData } from 'n8n-workflow';
import {
IDataObject,
IWebhookFunctions,
INodeTypeDescription,
INodeType,
IWebhookResponseData,
} from 'n8n-workflow';

export class ClassNameReplace implements INodeType {
description: INodeTypeDescription = {
Expand Down
2 changes: 1 addition & 1 deletion packages/nodes-base/credentials/ShopifyApi.credentials.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BINARY_ENCODING } from 'n8n-core';
import { BINARY_ENCODING } from 'n8n-workflow';
import type {
ICredentialDataDecryptedObject,
ICredentialTestRequest,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type { IExecuteFunctions } from 'n8n-core';

import type {
IDataObject,
IExecuteFunctions,
INodeExecutionData,
INodeType,
INodeTypeDescription,
Expand Down
4 changes: 1 addition & 3 deletions packages/nodes-base/nodes/ActionNetwork/GenericFunctions.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import type { IExecuteFunctions } from 'n8n-core';

import type { IDataObject, ILoadOptionsFunctions } from 'n8n-workflow';
import type { IDataObject, IExecuteFunctions, ILoadOptionsFunctions } from 'n8n-workflow';

import type { OptionsWithUri } from 'request';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { IExecuteFunctions } from 'n8n-core';

import type {
IExecuteFunctions,
IDataObject,
ILoadOptionsFunctions,
INodeExecutionData,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { IHookFunctions, IWebhookFunctions } from 'n8n-core';

import type {
IHookFunctions,
IWebhookFunctions,
IDataObject,
ILoadOptionsFunctions,
INodePropertyOptions,
Expand Down
11 changes: 8 additions & 3 deletions packages/nodes-base/nodes/ActiveCampaign/GenericFunctions.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import type { IExecuteFunctions, IHookFunctions } from 'n8n-core';

import type { IDataObject, ILoadOptionsFunctions, INodeProperties, JsonObject } from 'n8n-workflow';
import type {
IDataObject,
IExecuteFunctions,
IHookFunctions,
ILoadOptionsFunctions,
INodeProperties,
JsonObject,
} from 'n8n-workflow';
import { NodeApiError } from 'n8n-workflow';

import type { OptionsWithUri } from 'request';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { IHookFunctions, IWebhookFunctions } from 'n8n-core';

import type {
IHookFunctions,
IWebhookFunctions,
IDataObject,
INodeType,
INodeTypeDescription,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import type { OptionsWithUri } from 'request';
import type {
IDataObject,
IExecuteFunctions,
IExecuteSingleFunctions,
IHookFunctions,
ILoadOptionsFunctions,
IWebhookFunctions,
} from 'n8n-core';
import type { IDataObject, JsonObject } from 'n8n-workflow';
JsonObject,
} from 'n8n-workflow';
import { NodeApiError } from 'n8n-workflow';

export async function acuitySchedulingApiRequest(
Expand Down
3 changes: 1 addition & 2 deletions packages/nodes-base/nodes/Affinity/Affinity.node.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { IExecuteFunctions } from 'n8n-core';

import type {
IExecuteFunctions,
IDataObject,
ILoadOptionsFunctions,
INodeExecutionData,
Expand Down
4 changes: 2 additions & 2 deletions packages/nodes-base/nodes/Affinity/AffinityTrigger.node.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { IHookFunctions, IWebhookFunctions } from 'n8n-core';

import type {
IHookFunctions,
IWebhookFunctions,
IDataObject,
INodeType,
INodeTypeDescription,
Expand Down
14 changes: 9 additions & 5 deletions packages/nodes-base/nodes/Affinity/GenericFunctions.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import type { OptionsWithUri } from 'request';

import type { IExecuteFunctions, ILoadOptionsFunctions } from 'n8n-core';
import { BINARY_ENCODING } from 'n8n-core';

import type { IDataObject, IHookFunctions, IWebhookFunctions, JsonObject } from 'n8n-workflow';
import { NodeApiError } from 'n8n-workflow';
import type {
IDataObject,
IExecuteFunctions,
ILoadOptionsFunctions,
IHookFunctions,
IWebhookFunctions,
JsonObject,
} from 'n8n-workflow';
import { BINARY_ENCODING, NodeApiError } from 'n8n-workflow';

export async function affinityApiRequest(
this: IExecuteFunctions | IWebhookFunctions | IHookFunctions | ILoadOptionsFunctions,
Expand Down
3 changes: 1 addition & 2 deletions packages/nodes-base/nodes/AgileCrm/AgileCrm.node.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { IExecuteFunctions } from 'n8n-core';

import type {
IExecuteFunctions,
IDataObject,
INodeExecutionData,
INodeType,
Expand Down
6 changes: 3 additions & 3 deletions packages/nodes-base/nodes/AgileCrm/GenericFunctions.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import type { OptionsWithUri } from 'request';

import type {
IDataObject,
IExecuteFunctions,
IExecuteSingleFunctions,
IHookFunctions,
ILoadOptionsFunctions,
} from 'n8n-core';

import type { IDataObject, JsonObject } from 'n8n-workflow';
JsonObject,
} from 'n8n-workflow';
import { NodeApiError } from 'n8n-workflow';

import type { IContactUpdate } from './ContactInterface';
Expand Down
3 changes: 1 addition & 2 deletions packages/nodes-base/nodes/Airtable/Airtable.node.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { IExecuteFunctions } from 'n8n-core';

import type {
IExecuteFunctions,
IDataObject,
INodeExecutionData,
INodeType,
Expand Down
3 changes: 1 addition & 2 deletions packages/nodes-base/nodes/Airtable/AirtableTrigger.node.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { IPollFunctions } from 'n8n-core';

import type {
IPollFunctions,
IDataObject,
INodeExecutionData,
INodeType,
Expand Down
4 changes: 2 additions & 2 deletions packages/nodes-base/nodes/Airtable/GenericFunctions.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { IExecuteFunctions, IPollFunctions } from 'n8n-core';

import type { OptionsWithUri } from 'request';

import type {
IBinaryKeyData,
IDataObject,
IExecuteFunctions,
IPollFunctions,
ILoadOptionsFunctions,
INodeExecutionData,
} from 'n8n-workflow';
Expand Down
2 changes: 1 addition & 1 deletion packages/nodes-base/nodes/Amqp/Amqp.node.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { ContainerOptions, Dictionary, EventContext } from 'rhea';
import { create_container } from 'rhea';

import type { IExecuteFunctions } from 'n8n-core';
import type {
IExecuteFunctions,
IDataObject,
INodeExecutionData,
INodeType,
Expand Down
9 changes: 7 additions & 2 deletions packages/nodes-base/nodes/Amqp/AmqpTrigger.node.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import type { ContainerOptions, EventContext, Message, ReceiverOptions } from 'rhea';
import { create_container } from 'rhea';

import type { ITriggerFunctions } from 'n8n-core';
import type { IDataObject, INodeType, INodeTypeDescription, ITriggerResponse } from 'n8n-workflow';
import type {
ITriggerFunctions,
IDataObject,
INodeType,
INodeTypeDescription,
ITriggerResponse,
} from 'n8n-workflow';
import { deepCopy, jsonParse, NodeOperationError } from 'n8n-workflow';

export class AmqpTrigger implements INodeType {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { IExecuteFunctions } from 'n8n-core';

import type {
IExecuteFunctions,
IDataObject,
ILoadOptionsFunctions,
INodeExecutionData,
Expand Down
3 changes: 1 addition & 2 deletions packages/nodes-base/nodes/ApiTemplateIo/GenericFunctions.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type { OptionsWithUri } from 'request';

import type { IExecuteFunctions, ILoadOptionsFunctions } from 'n8n-core';
import type { JsonObject } from 'n8n-workflow';
import type { IExecuteFunctions, ILoadOptionsFunctions, JsonObject } from 'n8n-workflow';
import { NodeApiError } from 'n8n-workflow';

export async function apiTemplateIoApiRequest(
Expand Down
3 changes: 1 addition & 2 deletions packages/nodes-base/nodes/Asana/Asana.node.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { IExecuteFunctions } from 'n8n-core';

import type {
IExecuteFunctions,
IDataObject,
IHttpRequestMethods,
ILoadOptionsFunctions,
Expand Down
4 changes: 2 additions & 2 deletions packages/nodes-base/nodes/Asana/AsanaTrigger.node.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { IHookFunctions, IWebhookFunctions } from 'n8n-core';

import type {
IHookFunctions,
IWebhookFunctions,
IDataObject,
ILoadOptionsFunctions,
INodePropertyOptions,
Expand Down
5 changes: 3 additions & 2 deletions packages/nodes-base/nodes/Asana/GenericFunctions.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import type { IExecuteFunctions, IHookFunctions, ILoadOptionsFunctions } from 'n8n-core';

import type {
IDataObject,
IExecuteFunctions,
IHookFunctions,
ILoadOptionsFunctions,
IHttpRequestMethods,
IHttpRequestOptions,
INodePropertyOptions,
Expand Down
3 changes: 1 addition & 2 deletions packages/nodes-base/nodes/Automizy/Automizy.node.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { IExecuteFunctions } from 'n8n-core';

import type {
IExecuteFunctions,
IDataObject,
ILoadOptionsFunctions,
INodeExecutionData,
Expand Down
10 changes: 7 additions & 3 deletions packages/nodes-base/nodes/Automizy/GenericFunctions.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import type { OptionsWithUri } from 'request';

import type { IExecuteFunctions, IExecuteSingleFunctions, ILoadOptionsFunctions } from 'n8n-core';

import type { IDataObject, JsonObject } from 'n8n-workflow';
import type {
IExecuteFunctions,
IExecuteSingleFunctions,
ILoadOptionsFunctions,
IDataObject,
JsonObject,
} from 'n8n-workflow';
import { NodeApiError } from 'n8n-workflow';

export async function automizyApiRequest(
Expand Down
3 changes: 1 addition & 2 deletions packages/nodes-base/nodes/Autopilot/Autopilot.node.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { IExecuteFunctions } from 'n8n-core';

import type {
IExecuteFunctions,
IDataObject,
ILoadOptionsFunctions,
INodeExecutionData,
Expand Down
4 changes: 2 additions & 2 deletions packages/nodes-base/nodes/Autopilot/AutopilotTrigger.node.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { IHookFunctions, IWebhookFunctions } from 'n8n-core';

import type {
IHookFunctions,
IWebhookFunctions,
IDataObject,
INodeType,
INodeTypeDescription,
Expand Down
11 changes: 8 additions & 3 deletions packages/nodes-base/nodes/Autopilot/GenericFunctions.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import type { OptionsWithUri } from 'request';

import type { IExecuteFunctions, ILoadOptionsFunctions } from 'n8n-core';

import type { IDataObject, IHookFunctions, IWebhookFunctions, JsonObject } from 'n8n-workflow';
import type {
IExecuteFunctions,
ILoadOptionsFunctions,
IDataObject,
IHookFunctions,
IWebhookFunctions,
JsonObject,
} from 'n8n-workflow';
import { NodeApiError } from 'n8n-workflow';

export async function autopilotApiRequest(
Expand Down
2 changes: 1 addition & 1 deletion packages/nodes-base/nodes/Aws/AwsLambda.node.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { IExecuteFunctions } from 'n8n-core';
import type {
IExecuteFunctions,
IDataObject,
ILoadOptionsFunctions,
INodeExecutionData,
Expand Down
Loading

0 comments on commit 7a4e9ef

Please sign in to comment.