docs: remove impertinent Jsdocs comments (no-changelog) (#4181)

* 🔥 Remove impertinent Jsdocs comments

* Lint fixes
This commit is contained in:
agobrech
2022-09-29 14:37:56 +02:00
committed by GitHub
parent 64fffa0579
commit 8bd99e0600
77 changed files with 6 additions and 888 deletions

View File

@@ -23,10 +23,6 @@ export class ActiveWebhooks {
/**
* Adds a new webhook
*
* @param {IWebhookData} webhookData
* @param {WorkflowExecuteMode} mode
* @returns {Promise<void>}
* @memberof ActiveWebhooks
*/
async add(
workflow: Workflow,
@@ -104,11 +100,7 @@ export class ActiveWebhooks {
/**
* Returns webhookData if a webhook with matches is currently registered
*
* @param {WebhookHttpMethod} httpMethod
* @param {string} path
* @param {(string | undefined)} webhookId
* @returns {(IWebhookData | undefined)}
* @memberof ActiveWebhooks
*/
get(httpMethod: WebhookHttpMethod, path: string, webhookId?: string): IWebhookData | undefined {
const webhookKey = this.getWebhookKey(httpMethod, path, webhookId);
@@ -140,7 +132,6 @@ export class ActiveWebhooks {
/**
* Gets all request methods associated with a single webhook
* @param path
*/
getWebhookMethods(path: string): string[] {
const methods: string[] = [];
@@ -158,8 +149,6 @@ export class ActiveWebhooks {
/**
* Returns the ids of all the workflows which have active webhooks
*
* @returns {string[]}
* @memberof ActiveWebhooks
*/
getWorkflowIds(): string[] {
return Object.keys(this.workflowWebhooks);
@@ -168,11 +157,7 @@ export class ActiveWebhooks {
/**
* Returns key to uniquely identify a webhook
*
* @param {WebhookHttpMethod} httpMethod
* @param {string} path
* @param {(string | undefined)} webhookId
* @returns {string}
* @memberof ActiveWebhooks
*/
getWebhookKey(httpMethod: WebhookHttpMethod, path: string, webhookId?: string): string {
if (webhookId) {
@@ -189,9 +174,6 @@ export class ActiveWebhooks {
/**
* Removes all webhooks of a workflow
*
* @param {Workflow} workflow
* @returns {boolean}
* @memberof ActiveWebhooks
*/
async removeWorkflow(workflow: Workflow): Promise<boolean> {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion

View File

@@ -32,8 +32,6 @@ export class ActiveWorkflows {
* Returns if the workflow is active
*
* @param {string} id The id of the workflow to check
* @returns {boolean}
* @memberof ActiveWorkflows
*/
isActive(id: string): boolean {
// eslint-disable-next-line no-prototype-builtins
@@ -43,8 +41,6 @@ export class ActiveWorkflows {
/**
* Returns the ids of the currently active workflows
*
* @returns {string[]}
* @memberof ActiveWorkflows
*/
allActiveWorkflows(): string[] {
return Object.keys(this.workflowData);
@@ -54,9 +50,6 @@ export class ActiveWorkflows {
* Returns the Workflow data for the workflow with
* the given id if it is currently active
*
* @param {string} id
* @returns {(WorkflowData | undefined)}
* @memberof ActiveWorkflows
*/
get(id: string): IWorkflowData | undefined {
return this.workflowData[id];
@@ -68,8 +61,6 @@ export class ActiveWorkflows {
* @param {string} id The id of the workflow to activate
* @param {Workflow} workflow The workflow to activate
* @param {IWorkflowExecuteAdditionalData} additionalData The additional data which is needed to run workflows
* @returns {Promise<void>}
* @memberof ActiveWorkflows
*/
async add(
id: string,
@@ -142,12 +133,6 @@ export class ActiveWorkflows {
/**
* Activates polling for the given node
*
* @param {INode} node
* @param {Workflow} workflow
* @param {IWorkflowExecuteAdditionalData} additionalData
* @param {IGetExecutePollFunctions} getPollFunctions
* @returns {Promise<IPollResponse>}
* @memberof ActiveWorkflows
*/
async activatePolling(
node: INode,
@@ -225,8 +210,6 @@ export class ActiveWorkflows {
* Makes a workflow inactive
*
* @param {string} id The id of the workflow to deactivate
* @returns {Promise<void>}
* @memberof ActiveWorkflows
*/
async remove(id: string): Promise<void> {
if (!this.isActive(id)) {

View File

@@ -84,8 +84,6 @@ export class LoadNodeParameterOptions {
/**
* Returns data of a fake workflow
*
* @returns
* @memberof LoadNodeParameterOptions
*/
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
getWorkflowData() {
@@ -103,9 +101,6 @@ export class LoadNodeParameterOptions {
* Returns the available options via a predefined method
*
* @param {string} methodName The name of the method of which to get the data from
* @param {IWorkflowExecuteAdditionalData} additionalData
* @returns {Promise<INodePropertyOptions[]>}
* @memberof LoadNodeParameterOptions
*/
async getOptionsViaMethodName(
methodName: string,
@@ -140,9 +135,6 @@ export class LoadNodeParameterOptions {
* Returns the available options via a load request information
*
* @param {ILoadOptions} loadOptions The load options which also contain the request information
* @param {IWorkflowExecuteAdditionalData} additionalData
* @returns {Promise<INodePropertyOptions[]>}
* @memberof LoadNodeParameterOptions
*/
async getOptionsViaRequestProperty(
loadOptions: ILoadOptions,

View File

@@ -803,12 +803,6 @@ async function httpRequest(
/**
* Returns binary data buffer for given item index and property name.
*
* @export
* @param {ITaskDataConnections} inputData
* @param {number} itemIndex
* @param {string} propertyName
* @param {number} inputIndex
* @returns {Promise<Buffer>}
*/
export async function getBinaryDataBuffer(
inputData: ITaskDataConnections,
@@ -840,11 +834,6 @@ export async function setBinaryDataBuffer(
* Takes a buffer and converts it into the format n8n uses. It encodes the binary data as
* base64 and adds metadata.
*
* @export
* @param {Buffer} binaryData
* @param {string} [filePath]
* @param {string} [mimeType]
* @returns {Promise<IBinaryData>}
*/
export async function prepareBinaryData(
binaryData: Buffer,
@@ -911,14 +900,8 @@ export async function prepareBinaryData(
/**
* Makes a request using OAuth data for authentication
*
* @export
* @param {IAllExecuteFunctions} this
* @param {string} credentialsType
* @param {(OptionsWithUri | requestPromise.RequestPromiseOptions)} requestOptions
* @param {INode} node
* @param {IWorkflowExecuteAdditionalData} additionalData
*
* @returns
*/
export async function requestOAuth2(
this: IAllExecuteFunctions,
@@ -1142,11 +1125,7 @@ export async function requestOAuth2(
/* Makes a request using OAuth1 data for authentication
*
* @export
* @param {IAllExecuteFunctions} this
* @param {string} credentialsType
* @param {(OptionsWithUrl | requestPromise.RequestPromiseOptions)} requestOptions
* @returns
*/
export async function requestOAuth1(
this: IAllExecuteFunctions,
@@ -1321,9 +1300,7 @@ export async function httpRequestWithAuthentication(
/**
* Takes generic input data and brings it into the json format n8n uses.
*
* @export
* @param {(IDataObject | IDataObject[])} jsonData
* @returns {INodeExecutionData[]}
*/
export function returnJsonArray(jsonData: IDataObject | IDataObject[]): INodeExecutionData[] {
const returnData: INodeExecutionData[] = [];
@@ -1346,10 +1323,8 @@ export function returnJsonArray(jsonData: IDataObject | IDataObject[]): INodeExe
/**
* Takes generic input data and brings it into the new json, pairedItem format n8n uses.
* @export
* @param {(IPairedItemData)} itemData
* @param {(INodeExecutionData[])} inputData
* @returns {(NodeExecutionWithMetadata[])}
*/
export function constructExecutionMetaData(
inputData: INodeExecutionData[],
@@ -1366,9 +1341,7 @@ export function constructExecutionMetaData(
* Automatically put the objects under a 'json' key and don't error,
* if some objects contain json/binary keys and others don't, throws error 'Inconsistent item format'
*
* @export
* @param {INodeExecutionData | INodeExecutionData[]} executionData
* @returns {INodeExecutionData[]}
*/
export function normalizeItems(
executionData: INodeExecutionData | INodeExecutionData[],
@@ -1511,9 +1484,6 @@ export async function requestWithAuthentication(
/**
* Returns the additional keys for Expressions and Function-Nodes
*
* @export
* @param {IWorkflowExecuteAdditionalData} additionalData
* @returns {(IWorkflowDataProxyAdditionalKeys)}
*/
export function getAdditionalKeys(
additionalData: IWorkflowExecuteAdditionalData,
@@ -1528,12 +1498,9 @@ export function getAdditionalKeys(
/**
* Returns the requested decrypted credentials if the node has access to them.
*
* @export
* @param {Workflow} workflow Workflow which requests the data
* @param {INode} node Node which request the data
* @param {string} type The credential type to return
* @param {IWorkflowExecuteAdditionalData} additionalData
* @returns {(ICredentialDataDecryptedObject | undefined)}
*/
export async function getCredentials(
workflow: Workflow,
@@ -1662,9 +1629,6 @@ export async function getCredentials(
/**
* Returns a copy of the node
*
* @export
* @param {INode} node
* @returns {INode}
*/
export function getNode(node: INode): INode {
return JSON.parse(JSON.stringify(node));
@@ -1703,16 +1667,7 @@ function cleanupParameterData(inputData: NodeParameterValueType): NodeParameterV
/**
* Returns the requested resolved (all expressions replaced) node parameters.
*
* @export
* @param {Workflow} workflow
* @param {(IRunExecutionData | null)} runExecutionData
* @param {number} runIndex
* @param {INodeExecutionData[]} connectionInputData
* @param {INode} node
* @param {string} parameterName
* @param {number} itemIndex
* @param {*} [fallbackValue]
* @returns {(NodeParameterValue | INodeParameters | NodeParameterValue[] | INodeParameters[] | object)}
*/
export function getNodeParameter(
workflow: Workflow,
@@ -1773,9 +1728,6 @@ export function getNodeParameter(
/**
* Returns if execution should be continued even if there was an error.
*
* @export
* @param {INode} node
* @returns {boolean}
*/
export function continueOnFail(node: INode): boolean {
return get(node, 'continueOnFail', false);
@@ -1784,13 +1736,6 @@ export function continueOnFail(node: INode): boolean {
/**
* Returns the webhook URL of the webhook with the given name
*
* @export
* @param {string} name
* @param {Workflow} workflow
* @param {INode} node
* @param {IWorkflowExecuteAdditionalData} additionalData
* @param {boolean} [isTest]
* @returns {(string | undefined)}
*/
export function getNodeWebhookUrl(
name: string,
@@ -1839,10 +1784,6 @@ export function getNodeWebhookUrl(
/**
* Returns the timezone for the workflow
*
* @export
* @param {Workflow} workflow
* @param {IWorkflowExecuteAdditionalData} additionalData
* @returns {string}
*/
export function getTimezone(
workflow: Workflow,
@@ -1858,11 +1799,6 @@ export function getTimezone(
/**
* Returns the full webhook description of the webhook with the given name
*
* @export
* @param {string} name
* @param {Workflow} workflow
* @param {INode} node
* @returns {(IWebhookDescription | undefined)}
*/
export function getWebhookDescription(
name: string,
@@ -1889,9 +1825,6 @@ export function getWebhookDescription(
/**
* Returns the workflow metadata
*
* @export
* @param {Workflow} workflow
* @returns {IWorkflowMetadata}
*/
export function getWorkflowMetadata(workflow: Workflow): IWorkflowMetadata {
return {
@@ -1904,12 +1837,6 @@ export function getWorkflowMetadata(workflow: Workflow): IWorkflowMetadata {
/**
* Returns the execute functions the poll nodes have access to.
*
* @export
* @param {Workflow} workflow
* @param {INode} node
* @param {IWorkflowExecuteAdditionalData} additionalData
* @param {WorkflowExecuteMode} mode
* @returns {ITriggerFunctions}
*/
// TODO: Check if I can get rid of: additionalData, and so then maybe also at ActiveWorkflowRunner.add
export function getExecutePollFunctions(
@@ -2056,12 +1983,6 @@ export function getExecutePollFunctions(
/**
* Returns the execute functions the trigger nodes have access to.
*
* @export
* @param {Workflow} workflow
* @param {INode} node
* @param {IWorkflowExecuteAdditionalData} additionalData
* @param {WorkflowExecuteMode} mode
* @returns {ITriggerFunctions}
*/
// TODO: Check if I can get rid of: additionalData, and so then maybe also at ActiveWorkflowRunner.add
export function getExecuteTriggerFunctions(
@@ -2211,16 +2132,6 @@ export function getExecuteTriggerFunctions(
/**
* Returns the execute functions regular nodes have access to.
*
* @export
* @param {Workflow} workflow
* @param {IRunExecutionData} runExecutionData
* @param {number} runIndex
* @param {INodeExecutionData[]} connectionInputData
* @param {ITaskDataConnections} inputData
* @param {INode} node
* @param {IWorkflowExecuteAdditionalData} additionalData
* @param {WorkflowExecuteMode} mode
* @returns {IExecuteFunctions}
*/
export function getExecuteFunctions(
workflow: Workflow,
@@ -2480,17 +2391,6 @@ export function getExecuteFunctions(
/**
* Returns the execute functions regular nodes have access to when single-function is defined.
*
* @export
* @param {Workflow} workflow
* @param {IRunExecutionData} runExecutionData
* @param {number} runIndex
* @param {INodeExecutionData[]} connectionInputData
* @param {ITaskDataConnections} inputData
* @param {INode} node
* @param {number} itemIndex
* @param {IWorkflowExecuteAdditionalData} additionalData
* @param {WorkflowExecuteMode} mode
* @returns {IExecuteSingleFunctions}
*/
export function getExecuteSingleFunctions(
workflow: Workflow,
@@ -2721,11 +2621,6 @@ export function getCredentialTestFunctions(): ICredentialTestFunctions {
/**
* Returns the execute functions regular nodes have access to in load-options-function.
*
* @export
* @param {Workflow} workflow
* @param {INode} node
* @param {IWorkflowExecuteAdditionalData} additionalData
* @returns {ILoadOptionsFunctions}
*/
export function getLoadOptionsFunctions(
workflow: Workflow,
@@ -2853,12 +2748,6 @@ export function getLoadOptionsFunctions(
/**
* Returns the execute functions regular nodes have access to in hook-function.
*
* @export
* @param {Workflow} workflow
* @param {INode} node
* @param {IWorkflowExecuteAdditionalData} additionalData
* @param {WorkflowExecuteMode} mode
* @returns {IHookFunctions}
*/
export function getExecuteHookFunctions(
workflow: Workflow,
@@ -3005,13 +2894,6 @@ export function getExecuteHookFunctions(
/**
* Returns the execute functions regular nodes have access to when webhook-function is defined.
*
* @export
* @param {Workflow} workflow
* @param {IRunExecutionData} runExecutionData
* @param {INode} node
* @param {IWorkflowExecuteAdditionalData} additionalData
* @param {WorkflowExecuteMode} mode
* @returns {IWebhookFunctions}
*/
export function getExecuteWebhookFunctions(
workflow: Workflow,

View File

@@ -30,7 +30,6 @@ let settingsCache: IUserSettings | undefined;
/**
* Creates the user settings if they do not exist yet
*
* @export
*/
export async function prepareUserSettings(): Promise<IUserSettings> {
const settingsPath = getUserSettingsPath();
@@ -71,8 +70,6 @@ export async function prepareUserSettings(): Promise<IUserSettings> {
* Returns the encryption key which is used to encrypt
* the credentials.
*
* @export
* @returns
*/
export async function getEncryptionKey(): Promise<string> {
@@ -92,8 +89,6 @@ export async function getEncryptionKey(): Promise<string> {
/**
* Returns the instance ID
*
* @export
* @returns
*/
export async function getInstanceId(): Promise<string> {
const userSettings = await getUserSettings();
@@ -123,10 +118,8 @@ async function generateInstanceId(key?: string) {
* Adds/Overwrite the given settings in the currently
* saved user settings
*
* @export
* @param {IUserSettings} addSettings The settings to add/overwrite
* @param {string} [settingsPath] Optional settings file path
* @returns {Promise<IUserSettings>}
*/
export async function addToUserSettings(
addSettings: IUserSettings,
@@ -151,10 +144,8 @@ export async function addToUserSettings(
/**
* Writes a user settings file
*
* @export
* @param {IUserSettings} userSettings The settings to write
* @param {string} [settingsPath] Optional settings file path
* @returns {Promise<IUserSettings>}
*/
export async function writeUserSettings(
userSettings: IUserSettings,
@@ -190,8 +181,6 @@ export async function writeUserSettings(
/**
* Returns the content of the user settings
*
* @export
* @returns {UserSettings}
*/
export async function getUserSettings(
settingsPath?: string,
@@ -229,8 +218,6 @@ export async function getUserSettings(
/**
* Returns the path to the user settings
*
* @export
* @returns {string}
*/
export function getUserSettingsPath(): string {
const n8nFolder = getUserN8nFolderPath();
@@ -242,8 +229,6 @@ export function getUserSettingsPath(): string {
* Returns the path to the n8n folder in which all n8n
* related data gets saved
*
* @export
* @returns {string}
*/
export function getUserN8nFolderPath(): string {
let userFolder;
@@ -260,8 +245,6 @@ export function getUserN8nFolderPath(): string {
* Returns the path to the n8n user folder with the custom
* extensions like nodes and credentials
*
* @export
* @returns {string}
*/
export function getUserN8nFolderCustomExtensionPath(): string {
return path.join(getUserN8nFolderPath(), EXTENSIONS_SUBDIRECTORY);
@@ -271,8 +254,6 @@ export function getUserN8nFolderCustomExtensionPath(): string {
* Returns the path to the n8n user folder with the nodes that
* have been downloaded
*
* @export
* @returns {string}
*/
export function getUserN8nFolderDowloadedNodesPath(): string {
return path.join(getUserN8nFolderPath(), DOWNLOADED_NODES_SUBDIRECTORY);
@@ -283,8 +264,6 @@ export function getUserN8nFolderDowloadedNodesPath(): string {
* none can be found it falls back to the current
* working directory
*
* @export
* @returns {string}
*/
export function getUserHome(): string {
let variableName = 'HOME';

View File

@@ -77,8 +77,6 @@ export class WorkflowExecute {
* @param {Workflow} workflow The workflow to execute
* @param {INode[]} [startNodes] Node to start execution from
* @param {string} [destinationNode] Node to stop execution at
* @returns {(Promise<string>)}
* @memberof WorkflowExecute
*/
// IMPORTANT: Do not add "async" to this function, it will then convert the
// PCancelable to a regular Promise and does so not allow canceling
@@ -145,11 +143,8 @@ export class WorkflowExecute {
* Executes the given workflow but only
*
* @param {Workflow} workflow The workflow to execute
* @param {IRunData} runData
* @param {string[]} startNodes Nodes to start execution from
* @param {string} destinationNode Node to stop execution at
* @returns {(Promise<string>)}
* @memberof WorkflowExecute
*/
// IMPORTANT: Do not add "async" to this function, it will then convert the
// PCancelable to a regular Promise and does so not allow canceling
@@ -289,10 +284,6 @@ export class WorkflowExecute {
/**
* Executes the hook with the given name
*
* @param {string} hookName
* @param {any[]} parameters
* @returns {Promise<IRun>}
* @memberof WorkflowExecute
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
async executeHook(hookName: string, parameters: any[]): Promise<void> {
@@ -679,9 +670,6 @@ export class WorkflowExecute {
/**
* Runs the given execution data.
*
* @param {Workflow} workflow
* @returns {Promise<string>}
* @memberof WorkflowExecute
*/
// IMPORTANT: Do not add "async" to this function, it will then convert the
// PCancelable to a regular Promise and does so not allow canceling