fix: correct all the spelling typos (#3960)

* Improve code health
Fix TS typos in local variables
Fix CSS typos in local styles
Fix typos in comments
Fix typos in strings

* Fix order of n8n setup sections in CONTRIBUTING.md
This commit is contained in:
Aaron Delasy
2022-09-02 17:13:17 +03:00
committed by GitHub
parent a3791c22b3
commit 49c85a1df8
69 changed files with 167 additions and 167 deletions

View File

@@ -15,7 +15,7 @@ interface IResult {
interface IExecutionResult {
workflowId: string | number;
workflowName: string;
executionTime: number; // Given in seconds with decimals for milisseconds
executionTime: number; // Given in seconds with decimals for milliseconds
finished: boolean;
executionStatus: ExecutionStatus;
error?: string;

View File

@@ -98,7 +98,7 @@ export class ExecuteBatch extends Command {
}),
shallow: flags.boolean({
description:
'Compares only if attributes output from node are the same, with no regards to neste JSON objects.',
'Compares only if attributes output from node are the same, with no regards to nested JSON objects.',
}),
skipList: flags.string({
description: 'File containing a comma separated list of workflow IDs to skip.',
@@ -152,7 +152,7 @@ export class ExecuteBatch extends Command {
executingWorkflows = activeExecutionsInstance.getActiveExecutions();
}
// We may receive true but when called from `process.on`
// we get the signal (SIGNIT, etc.)
// we get the signal (SIGINT, etc.)
if (skipExit !== true) {
process.exit(0);
}
@@ -864,7 +864,7 @@ export class ExecuteBatch extends Command {
}
}
// Save snapshots only after comparing - this is to make sure we're updating
// After comparing to existing verion.
// After comparing to existing version.
if (ExecuteBatch.snapshot !== undefined) {
const fileName = `${
ExecuteBatch.snapshot.endsWith(sep)

View File

@@ -86,7 +86,7 @@ export class ExportCredentialsCommand extends Command {
if (fs.existsSync(flags.output)) {
if (!fs.lstatSync(flags.output).isDirectory()) {
console.info(`The paramenter --output must be a directory`);
console.info(`The parameter --output must be a directory`);
return;
}
} else {
@@ -105,7 +105,7 @@ export class ExportCredentialsCommand extends Command {
} else if (flags.output) {
if (fs.existsSync(flags.output)) {
if (fs.lstatSync(flags.output).isDirectory()) {
console.info(`The paramenter --output must be a writeble file`);
console.info(`The parameter --output must be a writeable file`);
return;
}
}

View File

@@ -78,7 +78,7 @@ export class ExportWorkflowsCommand extends Command {
if (fs.existsSync(flags.output)) {
if (!fs.lstatSync(flags.output).isDirectory()) {
console.info(`The paramenter --output must be a directory`);
console.info(`The parameter --output must be a directory`);
return;
}
} else {
@@ -97,7 +97,7 @@ export class ExportWorkflowsCommand extends Command {
} else if (flags.output) {
if (fs.existsSync(flags.output)) {
if (fs.lstatSync(flags.output).isDirectory()) {
console.info(`The paramenter --output must be a writeble file`);
console.info(`The parameter --output must be a writeable file`);
return;
}
}

View File

@@ -256,7 +256,7 @@ export class Start extends Command {
missingPackages.delete(missingPackage);
}
LoggerProxy.info(
'Packages reinstalled successfully. Resuming regular intiailization.',
'Packages reinstalled successfully. Resuming regular initialization.',
);
} catch (error) {
LoggerProxy.error('n8n was unable to install the missing packages.');

View File

@@ -106,7 +106,7 @@ export class Webhook extends Command {
* as it is unable to determine if it is still running or crashed
* - You cannot stop currently executing jobs from webhook processes
* when running without queues as the main process cannot talk to
* the wehbook processes to communicate workflow execution interruption.
* the webhook processes to communicate workflow execution interruption.
*/
this.error('Webhook processes can only run with execution mode as queue.');

View File

@@ -391,7 +391,7 @@ export class Worker extends Command {
}
// Just to be complete, generally will the worker stop automatically
// if it loses the conection to redis
// if it loses the connection to redis
try {
// Redis ping
await Worker.jobQueue.client.ping();

View File

@@ -151,7 +151,7 @@ export const schema = {
// Allows to set default values for credentials which
// get automatically prefilled and the user does not get
// displayed and can not change.
// Format: { CREDENTIAL_NAME: { PARAMTER: VALUE }}
// Format: { CREDENTIAL_NAME: { PARAMETER: VALUE }}
doc: 'Overwrites for credentials',
format: '*',
default: '{}',
@@ -248,7 +248,7 @@ export const schema = {
env: 'EXECUTIONS_DATA_SAVE_ON_SUCCESS',
},
saveExecutionProgress: {
doc: 'Wether or not to save progress for each node executed',
doc: 'Whether or not to save progress for each node executed',
format: 'Boolean',
default: false,
env: 'EXECUTIONS_DATA_SAVE_ON_PROGRESS',
@@ -363,7 +363,7 @@ export const schema = {
generic: {
// The timezone to use. Is important for nodes like "Cron" which start the
// workflow automatically at a specified time. This setting can also be
// overwritten on a per worfklow basis in the workflow settings in the
// overwritten on a per workflow basis in the workflow settings in the
// editor.
timezone: {
doc: 'The timezone to use',
@@ -607,7 +607,7 @@ export const schema = {
format: Boolean,
default: false,
env: 'N8N_WORKFLOW_TAGS_DISABLED',
doc: 'Disable worfklow tags.',
doc: 'Disable workflow tags.',
},
userManagement: {
@@ -945,7 +945,7 @@ export const schema = {
onboardingCallPrompt: {
enabled: {
doc: 'Whether onboarding call propmpt feature is available',
doc: 'Whether onboarding call prompt feature is available',
format: Boolean,
default: true,
env: 'N8N_ONBOARDING_CALL_PROMPTS_ENABLED',

View File

@@ -75,7 +75,7 @@ export class ActiveWorkflowRunner {
// NOTE
// Here I guess we can have a flag on the workflow table like hasTrigger
// so intead of pulling all the active wehhooks just pull the actives that have a trigger
// so instead of pulling all the active webhooks just pull the actives that have a trigger
const workflowsData: IWorkflowDb[] = (await Db.collections.Workflow.find({
where: { active: true },
relations: ['shared', 'shared.user', 'shared.user.globalRole'],
@@ -183,7 +183,7 @@ export class ActiveWorkflowRunner {
req: express.Request,
res: express.Response,
): Promise<IResponseCallbackData> {
Logger.debug(`Received webhoook "${httpMethod}" for path "${path}"`);
Logger.debug(`Received webhook "${httpMethod}" for path "${path}"`);
if (this.activeWorkflows === null) {
throw new ResponseHelper.ResponseError(
'The "activeWorkflows" instance did not get initialized yet.',
@@ -480,7 +480,7 @@ export class ActiveWorkflowRunner {
config.getEnv('endpoints.skipWebhoooksDeregistrationOnShutdown') &&
error.name === 'QueryFailedError'
) {
// When skipWebhoooksDeregistrationOnShutdown is enabled,
// When skipWebhooksDeregistrationOnShutdown is enabled,
// n8n does not remove the registered webhooks on exit.
// This means that further initializations will always fail
// when inserting to database. This is why we ignore this error
@@ -504,7 +504,7 @@ export class ActiveWorkflowRunner {
if (error.name === 'QueryFailedError') {
error.message = `The URL path that the "${webhook.node}" node uses is already taken. Please change it to something else.`;
} else if (error.detail) {
// it's a error runnig the webhook methods (checkExists, create)
// it's a error running the webhook methods (checkExists, create)
error.message = error.detail;
}

View File

@@ -307,7 +307,7 @@ export class CredentialsHelper extends ICredentialsHelper {
NodeHelpers.mergeNodeProperties(combineProperties, mergeCredentialProperties);
}
// The properties defined on the parent credentials take presidence
// The properties defined on the parent credentials take precedence
NodeHelpers.mergeNodeProperties(combineProperties, credentialTypeData.properties);
return combineProperties;
@@ -526,11 +526,11 @@ export class CredentialsHelper extends ICredentialsHelper {
}
}
}
// Test is defined as string which links to a functoin
// Test is defined as string which links to a function
return (node as unknown as INodeType).methods?.credentialTest![credential.testedBy];
}
// Test is defined as JSON with a defintion for the request to make
// Test is defined as JSON with a definition for the request to make
return {
nodeType,
testRequest: credential.testedBy,
@@ -574,7 +574,7 @@ export class CredentialsHelper extends ICredentialsHelper {
// Credentials get tested via request instructions
// TODO: Temp worfklows get created at multiple locations (for example also LoadNodeParameterOptions),
// TODO: Temp workflows get created at multiple locations (for example also LoadNodeParameterOptions),
// check if some of them are identical enough that it can be combined
let nodeType: INodeType;

View File

@@ -121,7 +121,7 @@ export async function getConfigValue(
return config.getEnv(configKey);
}
// Check if special file enviroment variable exists
// Check if special file environment variable exists
const fileEnvironmentVariable = process.env[`${currentSchema.env}_FILE`];
if (fileEnvironmentVariable === undefined) {
// Does not exist, so return value from config

View File

@@ -216,7 +216,7 @@ export interface IExecutionResponse extends IExecutionBase {
workflowData: IWorkflowBase;
}
// Flatted data to save memory when saving in database or transfering
// Flatted data to save memory when saving in database or transferring
// via REST API
export interface IExecutionFlatted extends IExecutionBase {
data: string;

View File

@@ -343,7 +343,7 @@ export class InternalHooksClass implements IInternalHooksClass {
public_api: boolean;
}): Promise<void> {
return this.telemetry.track(
'Instance sent transacptional email to user',
'Instance sent transactional email to user',
userTransactionalEmailData,
);
}

View File

@@ -201,7 +201,7 @@ class LoadNodesAndCredentialsClass {
// Add serializer method "toJSON" to the class so that authenticate method (if defined)
// gets mapped to the authenticate attribute before it is sent to the client.
// The authenticate property is used by the client to decide whether or not to
// include the credential type in the predifined credentials (HTTP node)
// include the credential type in the predefined credentials (HTTP node)
// eslint-disable-next-line func-names
tempModule[credentialName].prototype.toJSON = function () {
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
@@ -426,7 +426,7 @@ class LoadNodesAndCredentialsClass {
return;
}
// Check if the node should be skiped
// Check if the node should be skipped
if (this.excludeNodes !== undefined && this.excludeNodes.includes(fullNodeName)) {
return;
}

View File

@@ -24,7 +24,7 @@ function createApiRouter(
): Router {
const n8nPath = config.getEnv('path');
const swaggerDocument = YAML.load(openApiSpecPath) as swaggerUi.JsonObject;
// add the server depeding on the config so the user can interact with the API
// add the server depending on the config so the user can interact with the API
// from the Swagger UI
swaggerDocument.server = [
{

View File

@@ -137,9 +137,9 @@ export function sanitizeCredentials(
/**
* toJsonSchema
* Take an array of crendentials parameter and map it
* Take an array of credentials parameter and map it
* to a JSON Schema (see https://json-schema.org/). With
* the JSON Schema defintion we can validate the credential's shape
* the JSON Schema definition we can validate the credential's shape
* @param properties - Credentials properties
* @returns The credentials schema definition.
*/
@@ -155,7 +155,7 @@ export function toJsonSchema(properties: INodeProperties[]): IDataObject {
const optionsValues: { [key: string]: string[] } = {};
const resolveProperties: string[] = [];
// get all posible values of properties type "options"
// get all possible values of properties type "options"
// so we can later resolve the displayOptions dependencies
properties
.filter((property) => property.type === 'options')
@@ -177,7 +177,7 @@ export function toJsonSchema(properties: INodeProperties[]): IDataObject {
requiredFields.push(property.name);
if (property.type === 'options') {
// if the property is type options,
// include all possible values in the anum property.
// include all possible values in the enum property.
Object.assign(jsonSchema.properties, {
[property.name]: {
type: 'string',

View File

@@ -251,7 +251,7 @@ export = {
return res.json(sharedWorkflow.workflow);
}
// nothing to do as the wokflow is already active
// nothing to do as the workflow is already active
return res.json(sharedWorkflow.workflow);
},
],
@@ -280,7 +280,7 @@ export = {
return res.json(sharedWorkflow.workflow);
}
// nothing to do as the wokflow is already inactive
// nothing to do as the workflow is already inactive
return res.json(sharedWorkflow.workflow);
},
],

View File

@@ -68,7 +68,7 @@ export class Push {
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
send(type: IPushDataType, data: any, sessionId?: string) {
if (sessionId !== undefined && this.connections[sessionId] === undefined) {
Logger.error(`The session "${sessionId}" is not registred.`, { sessionId });
Logger.error(`The session "${sessionId}" is not registered.`, { sessionId });
return;
}

View File

@@ -1748,7 +1748,7 @@ class App {
this.app.all(
`/${this.endpointWebhookTest}/*`,
async (req: express.Request, res: express.Response) => {
// Cut away the "/webhook-test/" to get the registred part of the url
// Cut away the "/webhook-test/" to get the registered part of the url
const requestUrl = (req as ICustomRequest).parsedUrl!.pathname!.slice(
this.endpointWebhookTest.length + 2,
);
@@ -1936,7 +1936,7 @@ export async function start(): Promise<void> {
await app.externalHooks.run('n8n.ready', [app, config]);
const cpus = os.cpus();
const binarDataConfig = config.getEnv('binaryDataManager');
const binaryDataConfig = config.getEnv('binaryDataManager');
const diagnosticInfo: IDiagnosticInfo = {
basicAuthActive: config.getEnv('security.basicAuth.active'),
databaseType: (await GenericHelpers.getConfigValue('database.type')) as DatabaseType,
@@ -1973,7 +1973,7 @@ export async function start(): Promise<void> {
executions_data_prune_timeout: config.getEnv('executions.pruneDataTimeout'),
},
deploymentType: config.getEnv('deployment.type'),
binaryDataMode: binarDataConfig.mode,
binaryDataMode: binaryDataConfig.mode,
n8n_multi_user_allowed: isUserManagementEnabled(),
smtp_set_up: config.getEnv('userManagement.emails.mode') === 'smtp',
};

View File

@@ -290,7 +290,7 @@ export class TestWebhooks {
this.testWebhookData[webhookKey].sessionId,
);
} catch (error) {
// Could not inform editor, probably is not connected anymore. So sipmly go on.
// Could not inform editor, probably is not connected anymore. So simply go on.
}
}

View File

@@ -161,7 +161,7 @@ export async function checkPermissionsForExecution(
credentialNames.forEach((credentialName) => {
const credentialDetail = node.credentials![credentialName];
// If it does not contain an id, it means it is a very old
// workflow. Nowaways it should not happen anymore.
// workflow. Nowadays it should not happen anymore.
// Migrations should handle the case where a credential does
// not have an id.
if (credentialDetail.id === null) {
@@ -189,7 +189,7 @@ export async function checkPermissionsForExecution(
return true;
}
// If this check happens on top, we may get
// unitialized db errors.
// uninitialized db errors.
// Db is certainly initialized if workflow uses credentials.
const user = await getUserById(userId);
if (user.globalRole.name === 'owner') {

View File

@@ -43,14 +43,14 @@ export class WaitTrackerClass {
// Poll every 60 seconds a list of upcoming executions
this.mainTimer = setInterval(() => {
this.getwaitingExecutions();
this.getWaitingExecutions();
}, 60000);
this.getwaitingExecutions();
this.getWaitingExecutions();
}
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
async getwaitingExecutions() {
async getWaitingExecutions() {
Logger.debug('Wait tracker querying database for waiting executions');
// Find all the executions which should be triggered in the next 70 seconds
const findQuery: FindManyOptions<IExecutionFlattedDb> = {
@@ -100,7 +100,7 @@ export class WaitTrackerClass {
async stopExecution(executionId: string): Promise<IExecutionsStopData> {
if (this.waitingExecutions[executionId] !== undefined) {
// The waiting execution was already sheduled to execute.
// The waiting execution was already scheduled to execute.
// So stop timer and remove.
clearTimeout(this.waitingExecutions[executionId].timer);
delete this.waitingExecutions[executionId];

View File

@@ -35,7 +35,7 @@ export class WaitingWebhooks {
req: express.Request,
res: express.Response,
): Promise<IResponseCallbackData> {
Logger.debug(`Received waiting-webhoook "${httpMethod}" for path "${fullPath}"`);
Logger.debug(`Received waiting-webhook "${httpMethod}" for path "${fullPath}"`);
// Reset request parameters
req.params = {};

View File

@@ -75,7 +75,7 @@ export function getWorkflowWebhooks(
workflow: Workflow,
additionalData: IWorkflowExecuteAdditionalData,
destinationNode?: string,
ignoreRestartWehbooks = false,
ignoreRestartWebhooks = false,
): IWebhookData[] {
// Check all the nodes in the workflow if they have webhooks
@@ -97,7 +97,7 @@ export function getWorkflowWebhooks(
}
returnData.push.apply(
returnData,
NodeHelpers.getNodeWebhooks(workflow, node, additionalData, ignoreRestartWehbooks),
NodeHelpers.getNodeWebhooks(workflow, node, additionalData, ignoreRestartWebhooks),
);
}
@@ -346,7 +346,7 @@ export async function executeWebhook(
}
// Now that we know that the workflow should run we can return the default response
// directly if responseMode it set to "onReceived" and a respone should be sent
// directly if responseMode it set to "onReceived" and a response should be sent
if (responseMode === 'onReceived' && !didSendResponse) {
// Return response directly and do not wait for the workflow to finish
if (responseData === 'noData') {
@@ -478,7 +478,7 @@ export async function executeWebhook(
if (!didSendResponse) {
responseCallback(null, {
data: {
message: 'Workflow executed sucessfully but no data was returned',
message: 'Workflow executed successfully but no data was returned',
},
responseCode,
});
@@ -510,7 +510,7 @@ export async function executeWebhook(
// Return an error if no Webhook-Response node did send any data
responseCallback(null, {
data: {
message: 'Workflow executed sucessfully',
message: 'Workflow executed successfully',
},
responseCode,
});
@@ -523,7 +523,7 @@ export async function executeWebhook(
if (!didSendResponse) {
responseCallback(null, {
data: {
message: 'Workflow executed sucessfully but the last node did not return any data',
message: 'Workflow executed successfully but the last node did not return any data',
},
responseCode,
});

View File

@@ -47,7 +47,7 @@ export function registerProductionWebhooks() {
this.app.all(
`/${this.endpointWebhook}/*`,
async (req: express.Request, res: express.Response) => {
// Cut away the "/webhook/" to get the registred part of the url
// Cut away the "/webhook/" to get the registered part of the url
const requestUrl = (req as ICustomRequest).parsedUrl!.pathname!.slice(
this.endpointWebhook.length + 2,
);
@@ -112,14 +112,14 @@ export function registerProductionWebhooks() {
this.app.all(
`/${this.endpointWebhookWaiting}/*`,
async (req: express.Request, res: express.Response) => {
// Cut away the "/webhook-waiting/" to get the registred part of the url
// Cut away the "/webhook-waiting/" to get the registered part of the url
const requestUrl = (req as ICustomRequest).parsedUrl!.pathname!.slice(
this.endpointWebhookWaiting.length + 2,
);
const method = req.method.toUpperCase() as WebhookHttpMethod;
// TOOD: Add support for OPTIONS in the future
// TODO: Add support for OPTIONS in the future
// if (method === 'OPTIONS') {
// }

View File

@@ -930,7 +930,7 @@ export async function executeWorkflow(
await checkPermissionsForExecution(workflow, additionalData.userId);
// Create new additionalData to have different workflow loaded and to call
// different webooks
// different webhooks
const additionalDataIntegrated = await getBase(additionalData.userId);
additionalDataIntegrated.hooks = getWorkflowHooksIntegrated(
runData.executionMode,
@@ -1059,7 +1059,7 @@ export function sendMessageToUI(source: string, messages: any[]) {
this.sessionId,
);
} catch (error) {
Logger.warn(`There was a problem sending messsage to UI: ${error.message}`);
Logger.warn(`There was a problem sending message to UI: ${error.message}`);
}
}

View File

@@ -251,7 +251,7 @@ export async function executeErrorWorkflow(
export function getAllNodeTypeData(): ITransferNodeTypes {
const nodeTypes = NodeTypes();
// Get the data of all thenode types that they
// Get the data of all the node types that they
// can be loaded again in the process
const returnData: ITransferNodeTypes = {};
for (const nodeTypeName of Object.keys(nodeTypes.nodeTypes)) {

View File

@@ -82,7 +82,7 @@ export class WorkflowRunner {
}
/**
* The process did send a hook message so execute the appropiate hook
* The process did send a hook message so execute the appropriate hook
*
* @param {WorkflowHooks} workflowHooks
* @param {IProcessMessageDataHook} hookData
@@ -469,7 +469,7 @@ export class WorkflowRunner {
* when Redis crashes and recovers shortly *
* but during this time, some execution(s) *
* finished. The end result is that the main *
* process will wait indefinitively and never *
* process will wait indefinitely and never *
* get a response. This adds an active polling to*
* the queue that allows us to identify that the *
* execution finished and get information from *

View File

@@ -178,23 +178,23 @@ export class WorkflowRunnerProcess {
// Credentials should now be loaded from database.
// We check if any node uses credentials. If it does, then
// init database.
let shouldInitializaDb = false;
let shouldInitializeDb = false;
// eslint-disable-next-line array-callback-return
inputData.workflowData.nodes.map((node) => {
if (Object.keys(node.credentials === undefined ? {} : node.credentials).length > 0) {
shouldInitializaDb = true;
shouldInitializeDb = true;
}
if (node.type === 'n8n-nodes-base.executeWorkflow') {
// With UM, child workflows from arbitrary JSON
// Should be persisted by the child process,
// so DB needs to be initialized
shouldInitializaDb = true;
shouldInitializeDb = true;
}
});
// This code has been split into 4 ifs just to make it easier to understand
// Can be made smaller but in the end it will make it impossible to read.
if (shouldInitializaDb) {
if (shouldInitializeDb) {
// initialize db as we need to load credentials
await Db.init();
} else if (
@@ -490,7 +490,7 @@ async function sendToParentProcess(type: string, data: any): Promise<void> {
const workflowRunner = new WorkflowRunnerProcess();
// Listen to messages from parent process which send the data of
// the worflow to process
// the workflow to process
process.on('message', async (message: IProcessMessage) => {
try {
if (message.type === 'startWorkflow') {

View File

@@ -415,7 +415,7 @@ executionsController.post(
const sharedWorkflowIds = await getSharedWorkflowIds(req.user);
const binaryDataManager = BinaryDataManager.getInstance();
// delete executions by date, if user may access the underyling workflows
// delete executions by date, if user may access the underlying workflows
if (deleteBefore) {
const filters: IDataObject = {
@@ -446,7 +446,7 @@ executionsController.post(
return;
}
// delete executions by IDs, if user may access the underyling workflows
// delete executions by IDs, if user may access the underlying workflows
if (ids) {
const executions = await Db.collections.Execution.find({

View File

@@ -232,7 +232,7 @@ test('GET /executions should fail due to invalid API Key', async () => {
expect(response.statusCode).toBe(401);
});
test('GET /executions should retrieve all successfull executions', async () => {
test('GET /executions should retrieve all successful executions', async () => {
const owner = await testDb.createUser({ globalRole: globalOwnerRole, apiKey: randomApiKey() });
const authOwnerAgent = utils.createAgent(app, {

View File

@@ -793,7 +793,7 @@ test('POST /workflows/:id/deactivate should fail due to non-existing workflow',
expect(response.statusCode).toBe(404);
});
test('POST /workflows/:id/deactivate should deactive workflow', async () => {
test('POST /workflows/:id/deactivate should deactivate workflow', async () => {
const member = await testDb.createUser({ globalRole: globalMemberRole, apiKey: randomApiKey() });
const authAgent = utils.createAgent(app, {
@@ -837,7 +837,7 @@ test('POST /workflows/:id/deactivate should deactive workflow', async () => {
expect(await workflowRunner.isActive(workflow.id.toString())).toBe(false);
});
test('POST /workflows/:id/deactivate should deactive non-owned workflow when owner', async () => {
test('POST /workflows/:id/deactivate should deactivate non-owned workflow when owner', async () => {
const owner = await testDb.createUser({ globalRole: globalOwnerRole, apiKey: randomApiKey() });
const member = await testDb.createUser({ globalRole: globalMemberRole });