mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
docs: remove impertinent Jsdocs comments (no-changelog) (#4181)
* 🔥 Remove impertinent Jsdocs comments
* Lint fixes
This commit is contained in:
@@ -36,10 +36,6 @@ export class ActiveExecutions {
|
||||
/**
|
||||
* Add a new active execution
|
||||
*
|
||||
* @param {ChildProcess} process
|
||||
* @param {IWorkflowExecutionDataProcess} executionData
|
||||
* @returns {string}
|
||||
* @memberof ActiveExecutions
|
||||
*/
|
||||
async add(
|
||||
executionData: IWorkflowExecutionDataProcess,
|
||||
@@ -103,9 +99,6 @@ export class ActiveExecutions {
|
||||
/**
|
||||
* Attaches an execution
|
||||
*
|
||||
* @param {string} executionId
|
||||
* @param {PCancelable<IRun>} workflowExecution
|
||||
* @memberof ActiveExecutions
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
||||
attachWorkflowExecution(executionId: string, workflowExecution: PCancelable<IRun>) {
|
||||
@@ -143,10 +136,6 @@ export class ActiveExecutions {
|
||||
/**
|
||||
* Remove an active execution
|
||||
*
|
||||
* @param {string} executionId
|
||||
* @param {IRun} fullRunData
|
||||
* @returns {void}
|
||||
* @memberof ActiveExecutions
|
||||
*/
|
||||
remove(executionId: string, fullRunData?: IRun): void {
|
||||
if (this.activeExecutions[executionId] === undefined) {
|
||||
@@ -168,8 +157,6 @@ export class ActiveExecutions {
|
||||
*
|
||||
* @param {string} executionId The id of the execution to stop
|
||||
* @param {string} timeout String 'timeout' given if stop due to timeout
|
||||
* @returns {(Promise<IRun | undefined>)}
|
||||
* @memberof ActiveExecutions
|
||||
*/
|
||||
async stopExecution(executionId: string, timeout?: string): Promise<IRun | undefined> {
|
||||
if (this.activeExecutions[executionId] === undefined) {
|
||||
@@ -204,8 +191,6 @@ export class ActiveExecutions {
|
||||
* with the given id
|
||||
*
|
||||
* @param {string} executionId The id of the execution to wait for
|
||||
* @returns {Promise<IRun>}
|
||||
* @memberof ActiveExecutions
|
||||
*/
|
||||
async getPostExecutePromise(executionId: string): Promise<IRun | undefined> {
|
||||
// Create the promise which will be resolved when the execution finished
|
||||
@@ -224,8 +209,6 @@ export class ActiveExecutions {
|
||||
/**
|
||||
* Returns all the currently active executions
|
||||
*
|
||||
* @returns {IExecutionsCurrentSummary[]}
|
||||
* @memberof ActiveExecutions
|
||||
*/
|
||||
getActiveExecutions(): IExecutionsCurrentSummary[] {
|
||||
const returnData: IExecutionsCurrentSummary[] = [];
|
||||
|
||||
@@ -154,8 +154,6 @@ export class ActiveWorkflowRunner {
|
||||
/**
|
||||
* Removes all the currently active workflows
|
||||
*
|
||||
* @returns {Promise<void>}
|
||||
* @memberof ActiveWorkflowRunner
|
||||
*/
|
||||
async removeAll(): Promise<void> {
|
||||
let activeWorkflowIds: string[] = [];
|
||||
@@ -185,12 +183,6 @@ export class ActiveWorkflowRunner {
|
||||
/**
|
||||
* Checks if a webhook for the given method and path exists and executes the workflow.
|
||||
*
|
||||
* @param {WebhookHttpMethod} httpMethod
|
||||
* @param {string} path
|
||||
* @param {express.Request} req
|
||||
* @param {express.Response} res
|
||||
* @returns {Promise<object>}
|
||||
* @memberof ActiveWorkflowRunner
|
||||
*/
|
||||
async executeWebhook(
|
||||
httpMethod: WebhookHttpMethod,
|
||||
@@ -354,8 +346,6 @@ export class ActiveWorkflowRunner {
|
||||
* Gets all request methods associated with a single webhook
|
||||
*
|
||||
* @param {string} path webhook path
|
||||
* @returns {Promise<string[]>}
|
||||
* @memberof ActiveWorkflowRunner
|
||||
*/
|
||||
async getWebhookMethods(path: string): Promise<string[]> {
|
||||
const webhooks = await Db.collections.Webhook.find({ webhookPath: path });
|
||||
@@ -368,8 +358,6 @@ export class ActiveWorkflowRunner {
|
||||
/**
|
||||
* Returns the ids of the currently active workflows
|
||||
*
|
||||
* @returns {string[]}
|
||||
* @memberof ActiveWorkflowRunner
|
||||
*/
|
||||
async getActiveWorkflows(user?: User): Promise<IWorkflowDb[]> {
|
||||
let activeWorkflows: WorkflowEntity[] = [];
|
||||
@@ -401,8 +389,6 @@ export class ActiveWorkflowRunner {
|
||||
* Returns if the workflow is active
|
||||
*
|
||||
* @param {string} id The id of the workflow to check
|
||||
* @returns {boolean}
|
||||
* @memberof ActiveWorkflowRunner
|
||||
*/
|
||||
async isActive(id: string): Promise<boolean> {
|
||||
const workflow = await Db.collections.Workflow.findOne(id);
|
||||
@@ -413,8 +399,6 @@ export class ActiveWorkflowRunner {
|
||||
* Return error if there was a problem activating the workflow
|
||||
*
|
||||
* @param {string} id The id of the workflow to return the error of
|
||||
* @returns {(IActivationError | undefined)}
|
||||
* @memberof ActiveWorkflowRunner
|
||||
*/
|
||||
getActivationError(id: string): IActivationError | undefined {
|
||||
if (this.activationErrors[id] === undefined) {
|
||||
@@ -427,11 +411,6 @@ export class ActiveWorkflowRunner {
|
||||
/**
|
||||
* Adds all the webhooks of the workflow
|
||||
*
|
||||
* @param {Workflow} workflow
|
||||
* @param {IWorkflowExecuteAdditionalDataWorkflow} additionalData
|
||||
* @param {WorkflowExecuteMode} mode
|
||||
* @returns {Promise<void>}
|
||||
* @memberof ActiveWorkflowRunner
|
||||
*/
|
||||
async addWorkflowWebhooks(
|
||||
workflow: Workflow,
|
||||
@@ -533,9 +512,6 @@ export class ActiveWorkflowRunner {
|
||||
/**
|
||||
* Remove all the webhooks of the workflow
|
||||
*
|
||||
* @param {string} workflowId
|
||||
* @returns
|
||||
* @memberof ActiveWorkflowRunner
|
||||
*/
|
||||
async removeWorkflowWebhooks(workflowId: string): Promise<void> {
|
||||
const workflowData = await Db.collections.Workflow.findOne(workflowId, {
|
||||
@@ -588,13 +564,6 @@ export class ActiveWorkflowRunner {
|
||||
/**
|
||||
* Runs the given workflow
|
||||
*
|
||||
* @param {IWorkflowDb} workflowData
|
||||
* @param {INode} node
|
||||
* @param {INodeExecutionData[][]} data
|
||||
* @param {IWorkflowExecuteAdditionalDataWorkflow} additionalData
|
||||
* @param {WorkflowExecuteMode} mode
|
||||
* @returns
|
||||
* @memberof ActiveWorkflowRunner
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
||||
async runWorkflow(
|
||||
@@ -644,11 +613,6 @@ export class ActiveWorkflowRunner {
|
||||
* Return poll function which gets the global functions from n8n-core
|
||||
* and overwrites the __emit to be able to start it in subprocess
|
||||
*
|
||||
* @param {IWorkflowDb} workflowData
|
||||
* @param {IWorkflowExecuteAdditionalDataWorkflow} additionalData
|
||||
* @param {WorkflowExecuteMode} mode
|
||||
* @returns {IGetExecutePollFunctions}
|
||||
* @memberof ActiveWorkflowRunner
|
||||
*/
|
||||
getExecutePollFunctions(
|
||||
workflowData: IWorkflowDb,
|
||||
@@ -686,11 +650,6 @@ export class ActiveWorkflowRunner {
|
||||
* Return trigger function which gets the global functions from n8n-core
|
||||
* and overwrites the emit to be able to start it in subprocess
|
||||
*
|
||||
* @param {IWorkflowDb} workflowData
|
||||
* @param {IWorkflowExecuteAdditionalDataWorkflow} additionalData
|
||||
* @param {WorkflowExecuteMode} mode
|
||||
* @returns {IGetExecuteTriggerFunctions}
|
||||
* @memberof ActiveWorkflowRunner
|
||||
*/
|
||||
getExecuteTriggerFunctions(
|
||||
workflowData: IWorkflowDb,
|
||||
@@ -795,8 +754,6 @@ export class ActiveWorkflowRunner {
|
||||
*
|
||||
* @param {string} workflowId The id of the workflow to activate
|
||||
* @param {IWorkflowDb} [workflowData] If workflowData is given it saves the DB query
|
||||
* @returns {Promise<void>}
|
||||
* @memberof ActiveWorkflowRunner
|
||||
*/
|
||||
async add(
|
||||
workflowId: string,
|
||||
@@ -985,8 +942,6 @@ export class ActiveWorkflowRunner {
|
||||
* Makes a workflow inactive
|
||||
*
|
||||
* @param {string} workflowId The id of the workflow to deactivate
|
||||
* @returns {Promise<void>}
|
||||
* @memberof ActiveWorkflowRunner
|
||||
*/
|
||||
async remove(workflowId: string): Promise<void> {
|
||||
if (this.activeWorkflows !== null) {
|
||||
|
||||
@@ -250,8 +250,6 @@ export class CredentialsHelper extends ICredentialsHelper {
|
||||
*
|
||||
* @param {INodeCredentialsDetails} nodeCredential id and name to return instance of
|
||||
* @param {string} type Type of the credential to return instance of
|
||||
* @returns {Credentials}
|
||||
* @memberof CredentialsHelper
|
||||
*/
|
||||
async getCredentials(
|
||||
nodeCredential: INodeCredentialsDetails,
|
||||
@@ -287,8 +285,6 @@ export class CredentialsHelper extends ICredentialsHelper {
|
||||
* Returns all the properties of the credentials with the given name
|
||||
*
|
||||
* @param {string} type The name of the type to return credentials off
|
||||
* @returns {INodeProperties[]}
|
||||
* @memberof CredentialsHelper
|
||||
*/
|
||||
getCredentialsProperties(type: string): INodeProperties[] {
|
||||
const credentialTypeData = this.credentialTypes.getByName(type);
|
||||
@@ -319,8 +315,6 @@ export class CredentialsHelper extends ICredentialsHelper {
|
||||
* @param {INodeCredentialsDetails} nodeCredentials id and name to return instance of
|
||||
* @param {string} type Type of the credentials to return data of
|
||||
* @param {boolean} [raw] Return the data as supplied without defaults or overwrites
|
||||
* @returns {ICredentialDataDecryptedObject}
|
||||
* @memberof CredentialsHelper
|
||||
*/
|
||||
async getDecrypted(
|
||||
nodeCredentials: INodeCredentialsDetails,
|
||||
@@ -351,8 +345,6 @@ export class CredentialsHelper extends ICredentialsHelper {
|
||||
*
|
||||
* @param {ICredentialDataDecryptedObject} decryptedDataOriginal The credential data to overwrite data on
|
||||
* @param {string} type Type of the credentials to overwrite data of
|
||||
* @returns {ICredentialDataDecryptedObject}
|
||||
* @memberof CredentialsHelper
|
||||
*/
|
||||
applyDefaultsAndOverwrites(
|
||||
decryptedDataOriginal: ICredentialDataDecryptedObject,
|
||||
@@ -443,8 +435,6 @@ export class CredentialsHelper extends ICredentialsHelper {
|
||||
* @param {string} name Name of the credentials to set data of
|
||||
* @param {string} type Type of the credentials to set data of
|
||||
* @param {ICredentialDataDecryptedObject} data The data to set
|
||||
* @returns {Promise<void>}
|
||||
* @memberof CredentialsHelper
|
||||
*/
|
||||
async updateCredentials(
|
||||
nodeCredentials: INodeCredentialsDetails,
|
||||
|
||||
@@ -42,8 +42,6 @@ let versionCache: IPackageVersions | undefined;
|
||||
/**
|
||||
* Returns the base URL n8n is reachable from
|
||||
*
|
||||
* @export
|
||||
* @returns {string}
|
||||
*/
|
||||
export function getBaseUrl(): string {
|
||||
const protocol = config.getEnv('protocol');
|
||||
@@ -60,9 +58,6 @@ export function getBaseUrl(): string {
|
||||
/**
|
||||
* Returns the session id if one is set
|
||||
*
|
||||
* @export
|
||||
* @param {express.Request} req
|
||||
* @returns {(string | undefined)}
|
||||
*/
|
||||
export function getSessionId(req: express.Request): string | undefined {
|
||||
return req.headers.sessionid as string | undefined;
|
||||
@@ -71,8 +66,6 @@ export function getSessionId(req: express.Request): string | undefined {
|
||||
/**
|
||||
* Returns information which version of the packages are installed
|
||||
*
|
||||
* @export
|
||||
* @returns {Promise<IPackageVersions>}
|
||||
*/
|
||||
export async function getVersions(): Promise<IPackageVersions> {
|
||||
if (versionCache !== undefined) {
|
||||
@@ -94,9 +87,6 @@ export async function getVersions(): Promise<IPackageVersions> {
|
||||
/**
|
||||
* Extracts configuration schema for key
|
||||
*
|
||||
* @param {string} configKey
|
||||
* @param {IDataObject} configSchema
|
||||
* @returns {IDataObject} schema of the configKey
|
||||
*/
|
||||
function extractSchemaForKey(configKey: string, configSchema: IDataObject): IDataObject {
|
||||
const configKeyParts = configKey.split('.');
|
||||
@@ -118,9 +108,7 @@ function extractSchemaForKey(configKey: string, configSchema: IDataObject): IDat
|
||||
/**
|
||||
* Gets value from config with support for "_FILE" environment variables
|
||||
*
|
||||
* @export
|
||||
* @param {string} configKey The key of the config data to get
|
||||
* @returns {(Promise<string | boolean | number | undefined>)}
|
||||
*/
|
||||
export async function getConfigValue(
|
||||
configKey: string,
|
||||
|
||||
@@ -163,8 +163,6 @@ class LoadNodesAndCredentialsClass {
|
||||
* Returns all the names of the packages which could
|
||||
* contain n8n nodes
|
||||
*
|
||||
* @returns {Promise<string[]>}
|
||||
* @memberof LoadNodesAndCredentialsClass
|
||||
*/
|
||||
async getN8nNodePackages(baseModulesPath: string): Promise<string[]> {
|
||||
const getN8nNodePackagesRecursive = async (relativePath: string): Promise<string[]> => {
|
||||
@@ -196,7 +194,6 @@ class LoadNodesAndCredentialsClass {
|
||||
*
|
||||
* @param {string} credentialName The name of the credentials
|
||||
* @param {string} filePath The file to read credentials from
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
loadCredentialsFromFile(credentialName: string, filePath: string): void {
|
||||
let tempCredential: ICredentialType;
|
||||
@@ -347,7 +344,6 @@ class LoadNodesAndCredentialsClass {
|
||||
* @param {string} packageName The package name to set for the found nodes
|
||||
* @param {string} nodeName Tha name of the node
|
||||
* @param {string} filePath The file to read node from
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
loadNodeFromFile(
|
||||
packageName: string,
|
||||
@@ -433,7 +429,6 @@ class LoadNodesAndCredentialsClass {
|
||||
* alias (if defined) from the codex data for the node at the given file path.
|
||||
*
|
||||
* @param {string} filePath The file path to a `*.node.js` file
|
||||
* @returns {CodexData}
|
||||
*/
|
||||
getCodex(filePath: string): CodexData {
|
||||
// eslint-disable-next-line global-require, import/no-dynamic-require, @typescript-eslint/no-var-requires
|
||||
@@ -454,11 +449,9 @@ class LoadNodesAndCredentialsClass {
|
||||
* Adds a node codex `categories` and `subcategories` (if defined)
|
||||
* to a node description `codex` property.
|
||||
*
|
||||
* @param {object} obj
|
||||
* @param obj.node Node to add categories to
|
||||
* @param obj.filePath Path to the built node
|
||||
* @param obj.isCustom Whether the node is custom
|
||||
* @returns {void}
|
||||
*/
|
||||
addCodex({
|
||||
node,
|
||||
@@ -495,7 +488,6 @@ class LoadNodesAndCredentialsClass {
|
||||
*
|
||||
* @param {string} setPackageName The package name to set for the found nodes
|
||||
* @param {string} directory The directory to look in
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
async loadDataFromDirectory(setPackageName: string, directory: string): Promise<void> {
|
||||
const files = await glob('**/*.@(node|credentials).js', {
|
||||
@@ -524,7 +516,6 @@ class LoadNodesAndCredentialsClass {
|
||||
* Loads nodes and credentials from the package with the given name
|
||||
*
|
||||
* @param {string} packagePath The path to read data from
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
async loadDataFromPackage(packagePath: string): Promise<INodeTypeNameVersion[]> {
|
||||
// Get the absolute path of the package
|
||||
|
||||
@@ -141,7 +141,6 @@ export function sanitizeCredentials(
|
||||
* to a JSON Schema (see https://json-schema.org/). With
|
||||
* the JSON Schema definition we can validate the credential's shape
|
||||
* @param properties - Credentials properties
|
||||
* @returns The credentials schema definition.
|
||||
*/
|
||||
export function toJsonSchema(properties: INodeProperties[]): IDataObject {
|
||||
const jsonSchema: IJsonSchema = {
|
||||
|
||||
@@ -53,7 +53,6 @@ export class Push {
|
||||
* @param {string} sessionId The id of the session
|
||||
* @param {express.Request} req The request
|
||||
* @param {express.Response} res The response
|
||||
* @memberof Push
|
||||
*/
|
||||
add(sessionId: string, req: express.Request, res: express.Response) {
|
||||
Logger.debug(`Add editor-UI session`, { sessionId });
|
||||
@@ -74,8 +73,6 @@ export class Push {
|
||||
*
|
||||
* @param {string} sessionId The session id of client to send data to
|
||||
* @param {string} type Type of data to send
|
||||
* @param {*} data
|
||||
* @memberof Push
|
||||
*/
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
|
||||
@@ -19,7 +19,6 @@ import {
|
||||
/**
|
||||
* Special Error which allows to return also an error code and http status code
|
||||
*
|
||||
* @export
|
||||
* @class ResponseError
|
||||
* @extends {Error}
|
||||
*/
|
||||
@@ -41,7 +40,6 @@ export class ResponseError extends Error {
|
||||
* @param {number} [errorCode] The error code which can be used by frontend to identify the actual error
|
||||
* @param {number} [httpStatusCode] The HTTP status code the response should have
|
||||
* @param {string} [hint] The error hint to provide a context (webhook related)
|
||||
* @memberof ResponseError
|
||||
*/
|
||||
constructor(message: string, errorCode?: number, httpStatusCode?: number, hint?: string) {
|
||||
super(message);
|
||||
@@ -143,9 +141,7 @@ const isUniqueConstraintError = (error: Error) =>
|
||||
* all the responses have the same format
|
||||
*
|
||||
*
|
||||
* @export
|
||||
* @param {(req: Request, res: Response) => Promise<any>} processFunction The actual function to process the request
|
||||
* @returns
|
||||
*/
|
||||
|
||||
export function send<T, R extends Request, S extends Response>(
|
||||
@@ -173,9 +169,7 @@ export function send<T, R extends Request, S extends Response>(
|
||||
* As it contains a lot of references which normally would be saved as duplicate data
|
||||
* with regular JSON.stringify it gets flattened which keeps the references in place.
|
||||
*
|
||||
* @export
|
||||
* @param {IExecutionDb} fullExecutionData The data to flatten
|
||||
* @returns {IExecutionFlatted}
|
||||
*/
|
||||
export function flattenExecutionData(fullExecutionData: IExecutionDb): IExecutionFlatted {
|
||||
// Flatten the data
|
||||
@@ -210,9 +204,7 @@ export function flattenExecutionData(fullExecutionData: IExecutionDb): IExecutio
|
||||
/**
|
||||
* Unflattens the Execution data.
|
||||
*
|
||||
* @export
|
||||
* @param {IExecutionFlattedDb} fullExecutionData The data to unflatten
|
||||
* @returns {IExecutionResponse}
|
||||
*/
|
||||
export function unflattenExecutionData(fullExecutionData: IExecutionFlattedDb): IExecutionResponse {
|
||||
const returnData: IExecutionResponse = {
|
||||
|
||||
@@ -335,8 +335,6 @@ class App {
|
||||
/**
|
||||
* Returns the current epoch time
|
||||
*
|
||||
* @returns {number}
|
||||
* @memberof App
|
||||
*/
|
||||
getCurrentDate(): Date {
|
||||
return new Date();
|
||||
|
||||
@@ -40,12 +40,6 @@ export class TestWebhooks {
|
||||
* data gets additionally send to the UI. After the request got handled it
|
||||
* automatically remove the test-webhook.
|
||||
*
|
||||
* @param {WebhookHttpMethod} httpMethod
|
||||
* @param {string} path
|
||||
* @param {express.Request} request
|
||||
* @param {express.Response} response
|
||||
* @returns {Promise<object>}
|
||||
* @memberof TestWebhooks
|
||||
*/
|
||||
async callTestWebhook(
|
||||
httpMethod: WebhookHttpMethod,
|
||||
@@ -193,10 +187,6 @@ export class TestWebhooks {
|
||||
* for it and resolves with the result of the workflow if not it simply resolves
|
||||
* with undefined
|
||||
*
|
||||
* @param {IWorkflowDb} workflowData
|
||||
* @param {Workflow} workflow
|
||||
* @returns {(Promise<IExecutionDb | undefined>)}
|
||||
* @memberof TestWebhooks
|
||||
*/
|
||||
async needsWebhookData(
|
||||
workflowData: IWorkflowDb,
|
||||
@@ -263,9 +253,6 @@ export class TestWebhooks {
|
||||
/**
|
||||
* Removes a test webhook of the workflow with the given id
|
||||
*
|
||||
* @param {string} workflowId
|
||||
* @returns {boolean}
|
||||
* @memberof TestWebhooks
|
||||
*/
|
||||
cancelTestWebhook(workflowId: string): boolean {
|
||||
let foundWebhook = false;
|
||||
|
||||
@@ -66,10 +66,6 @@ export const WEBHOOK_METHODS = ['DELETE', 'GET', 'HEAD', 'PATCH', 'POST', 'PUT']
|
||||
/**
|
||||
* Returns all the webhooks which should be created for the give workflow
|
||||
*
|
||||
* @export
|
||||
* @param {string} workflowId
|
||||
* @param {Workflow} workflow
|
||||
* @returns {IWebhookData[]}
|
||||
*/
|
||||
export function getWorkflowWebhooks(
|
||||
workflow: Workflow,
|
||||
@@ -137,16 +133,8 @@ export function encodeWebhookResponse(
|
||||
/**
|
||||
* Executes a webhook
|
||||
*
|
||||
* @export
|
||||
* @param {IWebhookData} webhookData
|
||||
* @param {IWorkflowDb} workflowData
|
||||
* @param {INode} workflowStartNode
|
||||
* @param {WorkflowExecuteMode} executionMode
|
||||
* @param {(string | undefined)} sessionId
|
||||
* @param {express.Request} req
|
||||
* @param {express.Response} res
|
||||
* @param {((error: Error | null, data: IResponseCallbackData) => void)} responseCallback
|
||||
* @returns {(Promise<string | undefined>)}
|
||||
*/
|
||||
export async function executeWebhook(
|
||||
workflow: Workflow,
|
||||
@@ -694,8 +682,6 @@ export async function executeWebhook(
|
||||
/**
|
||||
* Returns the base URL of the webhooks
|
||||
*
|
||||
* @export
|
||||
* @returns
|
||||
*/
|
||||
export function getWebhookBaseUrl() {
|
||||
let urlBaseWebhook = GenericHelpers.getBaseUrl();
|
||||
|
||||
@@ -222,8 +222,6 @@ class App {
|
||||
/**
|
||||
* Returns the current epoch time
|
||||
*
|
||||
* @returns {number}
|
||||
* @memberof App
|
||||
*/
|
||||
getCurrentDate(): Date {
|
||||
return new Date();
|
||||
|
||||
@@ -235,7 +235,6 @@ function pruneExecutionData(this: WorkflowHooks): void {
|
||||
/**
|
||||
* Returns hook functions to push data to Editor-UI
|
||||
*
|
||||
* @returns {IWorkflowExecuteHooks}
|
||||
*/
|
||||
function hookFunctionsPush(): IWorkflowExecuteHooks {
|
||||
return {
|
||||
@@ -473,7 +472,6 @@ export function hookFunctionsPreExecute(parentProcessMode?: string): IWorkflowEx
|
||||
/**
|
||||
* Returns hook functions to save workflow execution and call error workflow
|
||||
*
|
||||
* @returns {IWorkflowExecuteHooks}
|
||||
*/
|
||||
function hookFunctionsSave(parentProcessMode?: string): IWorkflowExecuteHooks {
|
||||
return {
|
||||
@@ -655,7 +653,6 @@ function hookFunctionsSave(parentProcessMode?: string): IWorkflowExecuteHooks {
|
||||
* for running with queues. Manual executions should never run on queues as
|
||||
* they are always executed in the main process.
|
||||
*
|
||||
* @returns {IWorkflowExecuteHooks}
|
||||
*/
|
||||
function hookFunctionsSaveWorker(): IWorkflowExecuteHooks {
|
||||
return {
|
||||
@@ -866,11 +863,7 @@ export async function getWorkflowData(
|
||||
/**
|
||||
* Executes the workflow with the given ID
|
||||
*
|
||||
* @export
|
||||
* @param {string} workflowId The id of the workflow to execute
|
||||
* @param {IWorkflowExecuteAdditionalData} additionalData
|
||||
* @param {INodeExecutionData[]} [inputData]
|
||||
* @returns {(Promise<Array<INodeExecutionData[] | null>>)}
|
||||
*/
|
||||
export async function executeWorkflow(
|
||||
workflowInfo: IExecuteWorkflowInfo,
|
||||
@@ -1066,10 +1059,6 @@ export function sendMessageToUI(source: string, messages: any[]) {
|
||||
/**
|
||||
* Returns the base additional data without webhooks
|
||||
*
|
||||
* @export
|
||||
* @param {userId} string
|
||||
* @param {INodeParameters} currentNodeParameters
|
||||
* @returns {Promise<IWorkflowExecuteAdditionalData>}
|
||||
*/
|
||||
export async function getBase(
|
||||
userId: string,
|
||||
@@ -1174,10 +1163,6 @@ export function getWorkflowHooksWorkerMain(
|
||||
/**
|
||||
* Returns WorkflowHooks instance for running the main workflow
|
||||
*
|
||||
* @export
|
||||
* @param {IWorkflowExecutionDataProcess} data
|
||||
* @param {string} executionId
|
||||
* @returns {WorkflowHooks}
|
||||
*/
|
||||
export function getWorkflowHooksMain(
|
||||
data: IWorkflowExecutionDataProcess,
|
||||
|
||||
@@ -49,9 +49,6 @@ const ERROR_TRIGGER_TYPE = config.getEnv('nodes.errorTriggerType');
|
||||
/**
|
||||
* Returns the data of the last executed node
|
||||
*
|
||||
* @export
|
||||
* @param {IRun} inputData
|
||||
* @returns {(ITaskData | undefined)}
|
||||
*/
|
||||
export function getDataLastExecutedNodeData(inputData: IRun): ITaskData | undefined {
|
||||
const { runData, pinData = {} } = inputData.data.resultData;
|
||||
@@ -91,8 +88,6 @@ export function getDataLastExecutedNodeData(inputData: IRun): ITaskData | undefi
|
||||
* Returns if the given id is a valid workflow id
|
||||
*
|
||||
* @param {(string | null | undefined)} id The id to check
|
||||
* @returns {boolean}
|
||||
* @memberof App
|
||||
*/
|
||||
export function isWorkflowIdValid(id: string | null | undefined | number): boolean {
|
||||
if (typeof id === 'string') {
|
||||
@@ -109,10 +104,8 @@ export function isWorkflowIdValid(id: string | null | undefined | number): boole
|
||||
/**
|
||||
* Executes the error workflow
|
||||
*
|
||||
* @export
|
||||
* @param {string} workflowId The id of the error workflow
|
||||
* @param {IWorkflowErrorData} workflowErrorData The error data
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
export async function executeErrorWorkflow(
|
||||
workflowId: string,
|
||||
@@ -248,8 +241,6 @@ export async function executeErrorWorkflow(
|
||||
/**
|
||||
* Returns all the defined NodeTypes
|
||||
*
|
||||
* @export
|
||||
* @returns {ITransferNodeTypes}
|
||||
*/
|
||||
export function getAllNodeTypeData(): ITransferNodeTypes {
|
||||
const nodeTypes = NodeTypes();
|
||||
@@ -274,8 +265,6 @@ export function getAllNodeTypeData(): ITransferNodeTypes {
|
||||
/**
|
||||
* Returns all the defined CredentialTypes
|
||||
*
|
||||
* @export
|
||||
* @returns {ICredentialsTypeData}
|
||||
*/
|
||||
export function getAllCredentalsTypeData(): ICredentialsTypeData {
|
||||
const credentialTypes = CredentialTypes();
|
||||
@@ -301,9 +290,6 @@ export function getAllCredentalsTypeData(): ICredentialsTypeData {
|
||||
* Returns the data of the node types that are needed
|
||||
* to execute the given nodes
|
||||
*
|
||||
* @export
|
||||
* @param {INode[]} nodes
|
||||
* @returns {ITransferNodeTypes}
|
||||
*/
|
||||
export function getNodeTypeData(nodes: INode[]): ITransferNodeTypes {
|
||||
const nodeTypes = NodeTypes();
|
||||
@@ -333,9 +319,7 @@ export function getNodeTypeData(nodes: INode[]): ITransferNodeTypes {
|
||||
* Returns the credentials data of the given type and its parent types
|
||||
* it extends
|
||||
*
|
||||
* @export
|
||||
* @param {string} type The credential type to return data off
|
||||
* @returns {ICredentialsTypeData}
|
||||
*/
|
||||
export function getCredentialsDataWithParents(type: string): ICredentialsTypeData {
|
||||
const credentialTypes = CredentialTypes();
|
||||
@@ -370,9 +354,7 @@ export function getCredentialsDataWithParents(type: string): ICredentialsTypeDat
|
||||
* Returns all the credentialTypes which are needed to resolve
|
||||
* the given workflow credentials
|
||||
*
|
||||
* @export
|
||||
* @param {IWorkflowCredentials} credentials The credentials which have to be able to be resolved
|
||||
* @returns {ICredentialsTypeData}
|
||||
*/
|
||||
export function getCredentialsDataByNodes(nodes: INode[]): ICredentialsTypeData {
|
||||
const credentialTypeData: ICredentialsTypeData = {};
|
||||
@@ -398,9 +380,6 @@ export function getCredentialsDataByNodes(nodes: INode[]): ICredentialsTypeData
|
||||
* Returns the names of the NodeTypes which are are needed
|
||||
* to execute the gives nodes
|
||||
*
|
||||
* @export
|
||||
* @param {INode[]} nodes
|
||||
* @returns {string[]}
|
||||
*/
|
||||
export function getNeededNodeTypes(nodes: INode[]): Array<{ type: string; version: number }> {
|
||||
// Check which node-types have to be loaded
|
||||
@@ -417,9 +396,6 @@ export function getNeededNodeTypes(nodes: INode[]): Array<{ type: string; versio
|
||||
/**
|
||||
* Saves the static data if it changed
|
||||
*
|
||||
* @export
|
||||
* @param {Workflow} workflow
|
||||
* @returns {Promise <void>}
|
||||
*/
|
||||
export async function saveStaticData(workflow: Workflow): Promise<void> {
|
||||
if (workflow.staticData.__dataChanged === true) {
|
||||
@@ -443,10 +419,8 @@ export async function saveStaticData(workflow: Workflow): Promise<void> {
|
||||
/**
|
||||
* Saves the given static data on workflow
|
||||
*
|
||||
* @export
|
||||
* @param {(string | number)} workflowId The id of the workflow to save data on
|
||||
* @param {IDataObject} newStaticData The static data to save
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
export async function saveStaticDataById(
|
||||
workflowId: string | number,
|
||||
@@ -460,9 +434,7 @@ export async function saveStaticDataById(
|
||||
/**
|
||||
* Returns the static data of workflow
|
||||
*
|
||||
* @export
|
||||
* @param {(string | number)} workflowId The id of the workflow to get static data of
|
||||
* @returns
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
||||
export async function getStaticDataById(workflowId: string | number) {
|
||||
@@ -481,7 +453,6 @@ export async function getStaticDataById(workflowId: string | number) {
|
||||
/**
|
||||
* Set node ids if not already set
|
||||
*
|
||||
* @param workflow
|
||||
*/
|
||||
export function addNodeIds(workflow: WorkflowEntity) {
|
||||
const { nodes } = workflow;
|
||||
|
||||
@@ -81,9 +81,6 @@ export class WorkflowRunner {
|
||||
/**
|
||||
* The process did send a hook message so execute the appropriate hook
|
||||
*
|
||||
* @param {WorkflowHooks} workflowHooks
|
||||
* @param {IProcessMessageDataHook} hookData
|
||||
* @memberof WorkflowRunner
|
||||
*/
|
||||
processHookMessage(workflowHooks: WorkflowHooks, hookData: IProcessMessageDataHook) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||
@@ -93,11 +90,6 @@ export class WorkflowRunner {
|
||||
/**
|
||||
* The process did error
|
||||
*
|
||||
* @param {ExecutionError} error
|
||||
* @param {Date} startedAt
|
||||
* @param {WorkflowExecuteMode} executionMode
|
||||
* @param {string} executionId
|
||||
* @memberof WorkflowRunner
|
||||
*/
|
||||
async processError(
|
||||
error: ExecutionError,
|
||||
@@ -135,11 +127,8 @@ export class WorkflowRunner {
|
||||
/**
|
||||
* Run the workflow
|
||||
*
|
||||
* @param {IWorkflowExecutionDataProcess} data
|
||||
* @param {boolean} [loadStaticData] If set will the static data be loaded from
|
||||
* the workflow and added to input data
|
||||
* @returns {Promise<string>}
|
||||
* @memberof WorkflowRunner
|
||||
*/
|
||||
async run(
|
||||
data: IWorkflowExecutionDataProcess,
|
||||
@@ -203,11 +192,8 @@ export class WorkflowRunner {
|
||||
/**
|
||||
* Run the workflow in current process
|
||||
*
|
||||
* @param {IWorkflowExecutionDataProcess} data
|
||||
* @param {boolean} [loadStaticData] If set will the static data be loaded from
|
||||
* the workflow and added to input data
|
||||
* @returns {Promise<string>}
|
||||
* @memberof WorkflowRunner
|
||||
*/
|
||||
async runMainProcess(
|
||||
data: IWorkflowExecutionDataProcess,
|
||||
@@ -595,11 +581,8 @@ export class WorkflowRunner {
|
||||
/**
|
||||
* Run the workflow
|
||||
*
|
||||
* @param {IWorkflowExecutionDataProcess} data
|
||||
* @param {boolean} [loadStaticData] If set will the static data be loaded from
|
||||
* the workflow and added to input data
|
||||
* @returns {Promise<string>}
|
||||
* @memberof WorkflowRunner
|
||||
*/
|
||||
async runSubprocess(
|
||||
data: IWorkflowExecutionDataProcess,
|
||||
|
||||
@@ -392,9 +392,6 @@ export class WorkflowRunnerProcess {
|
||||
/**
|
||||
* Sends hook data to the parent process that it executes them
|
||||
*
|
||||
* @param {string} hook
|
||||
* @param {any[]} parameters
|
||||
* @memberof WorkflowRunnerProcess
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
||||
async sendHookToParentProcess(hook: string, parameters: any[]) {
|
||||
@@ -413,7 +410,6 @@ export class WorkflowRunnerProcess {
|
||||
* the parent process where they then can be executed with access
|
||||
* to database and to PushService
|
||||
*
|
||||
* @returns
|
||||
*/
|
||||
getProcessForwardHooks(): WorkflowHooks {
|
||||
const hookFunctions: IWorkflowExecuteHooks = {
|
||||
@@ -463,7 +459,6 @@ export class WorkflowRunnerProcess {
|
||||
*
|
||||
* @param {string} type The type of data to send
|
||||
* @param {*} data The data
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
async function sendToParentProcess(type: string, data: any): Promise<void> {
|
||||
|
||||
Reference in New Issue
Block a user