From 216ecfa4dba811198413094ca3ff9f01f641790a Mon Sep 17 00:00:00 2001 From: Michael Kret Date: Fri, 18 Nov 2022 12:31:17 +0200 Subject: [PATCH 1/8] :zap: removed existing rule exceptions --- packages/cli/src/ActiveWorkflowRunner.ts | 13 +++++-------- packages/cli/src/TestWebhooks.ts | 7 +++---- packages/cli/src/WaitTracker.ts | 5 ++--- packages/cli/src/WaitingWebhooks.ts | 3 +-- packages/cli/src/WorkflowRunner.ts | 18 ++++++++---------- packages/cli/src/WorkflowRunnerProcess.ts | 3 +-- packages/cli/src/commands/executeBatch.ts | 3 +-- packages/cli/src/commands/start.ts | 4 +--- packages/cli/src/commands/worker.ts | 10 ++++++---- 9 files changed, 28 insertions(+), 38 deletions(-) diff --git a/packages/cli/src/ActiveWorkflowRunner.ts b/packages/cli/src/ActiveWorkflowRunner.ts index ca5b9996e58d4..f4b1ed4277a63 100644 --- a/packages/cli/src/ActiveWorkflowRunner.ts +++ b/packages/cli/src/ActiveWorkflowRunner.ts @@ -4,7 +4,6 @@ /* eslint-disable no-console */ /* eslint-disable no-await-in-loop */ /* eslint-disable no-restricted-syntax */ -/* eslint-disable @typescript-eslint/no-floating-promises */ /* eslint-disable @typescript-eslint/no-shadow */ /* eslint-disable @typescript-eslint/no-unsafe-call */ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ @@ -261,7 +260,6 @@ export class ActiveWorkflowRunner { } // @ts-ignore - // eslint-disable-next-line no-param-reassign path = webhook.webhookPath; // extracting params from path // @ts-ignore @@ -318,8 +316,7 @@ export class ActiveWorkflowRunner { return new Promise((resolve, reject) => { const executionMode = 'webhook'; - // @ts-ignore - WebhookHelpers.executeWebhook( + void WebhookHelpers.executeWebhook( workflow, webhookData, workflowData, @@ -634,7 +631,7 @@ export class ActiveWorkflowRunner { ): void => { // eslint-disable-next-line @typescript-eslint/restrict-template-expressions Logger.debug(`Received event to trigger execution for workflow "${workflow.name}"`); - WorkflowHelpers.saveStaticData(workflow); + void WorkflowHelpers.saveStaticData(workflow); const executePromise = this.runWorkflow( workflowData, node, @@ -645,7 +642,7 @@ export class ActiveWorkflowRunner { ); if (donePromise) { - executePromise.then((executionId) => { + void executePromise.then((executionId) => { ActiveExecutions.getInstance() .getPostExecutePromise(executionId) .then(donePromise.resolve) @@ -690,7 +687,7 @@ export class ActiveWorkflowRunner { ): void => { // eslint-disable-next-line @typescript-eslint/restrict-template-expressions Logger.debug(`Received trigger for workflow "${workflow.name}"`); - WorkflowHelpers.saveStaticData(workflow); + void WorkflowHelpers.saveStaticData(workflow); // eslint-disable-next-line id-denylist const executePromise = this.runWorkflow( workflowData, @@ -702,7 +699,7 @@ export class ActiveWorkflowRunner { ); if (donePromise) { - executePromise.then((executionId) => { + void executePromise.then((executionId) => { ActiveExecutions.getInstance() .getPostExecutePromise(executionId) .then(donePromise.resolve) diff --git a/packages/cli/src/TestWebhooks.ts b/packages/cli/src/TestWebhooks.ts index 1763dbf8707c3..4f21a40bb77d2 100644 --- a/packages/cli/src/TestWebhooks.ts +++ b/packages/cli/src/TestWebhooks.ts @@ -159,8 +159,8 @@ export class TestWebhooks { clearTimeout(this.testWebhookData[webhookKey].timeout); delete this.testWebhookData[webhookKey]; } - // eslint-disable-next-line @typescript-eslint/no-floating-promises - this.activeWebhooks!.removeWorkflow(workflow); + + await this.activeWebhooks!.removeWorkflow(workflow); }); } @@ -290,8 +290,7 @@ export class TestWebhooks { if (!foundWebhook) { // As it removes all webhooks of the workflow execute only once - // eslint-disable-next-line @typescript-eslint/no-floating-promises - this.activeWebhooks!.removeWorkflow(workflow); + void this.activeWebhooks!.removeWorkflow(workflow); } foundWebhook = true; diff --git a/packages/cli/src/WaitTracker.ts b/packages/cli/src/WaitTracker.ts index dbacda38beeb7..cb755b8893805 100644 --- a/packages/cli/src/WaitTracker.ts +++ b/packages/cli/src/WaitTracker.ts @@ -3,7 +3,6 @@ /* eslint-disable @typescript-eslint/naming-convention */ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ /* eslint-disable @typescript-eslint/restrict-template-expressions */ -/* eslint-disable @typescript-eslint/no-floating-promises */ // eslint-disable-next-line @typescript-eslint/no-unused-vars import { ErrorReporterProxy as ErrorReporter, @@ -43,10 +42,10 @@ export class WaitTrackerClass { // Poll every 60 seconds a list of upcoming executions this.mainTimer = setInterval(() => { - this.getWaitingExecutions(); + void this.getWaitingExecutions(); }, 60000); - this.getWaitingExecutions(); + void this.getWaitingExecutions(); } // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types diff --git a/packages/cli/src/WaitingWebhooks.ts b/packages/cli/src/WaitingWebhooks.ts index e61390232511c..15c9552ad3145 100644 --- a/packages/cli/src/WaitingWebhooks.ts +++ b/packages/cli/src/WaitingWebhooks.ts @@ -141,8 +141,7 @@ export class WaitingWebhooks { return new Promise((resolve, reject) => { const executionMode = 'webhook'; - // eslint-disable-next-line @typescript-eslint/no-floating-promises - WebhookHelpers.executeWebhook( + void WebhookHelpers.executeWebhook( workflow, webhookData, workflowData as IWorkflowDb, diff --git a/packages/cli/src/WorkflowRunner.ts b/packages/cli/src/WorkflowRunner.ts index 5dc546bf25c7d..e004dbb8d8726 100644 --- a/packages/cli/src/WorkflowRunner.ts +++ b/packages/cli/src/WorkflowRunner.ts @@ -5,7 +5,6 @@ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ /* eslint-disable @typescript-eslint/restrict-template-expressions */ /* eslint-disable @typescript-eslint/no-shadow */ -/* eslint-disable @typescript-eslint/no-floating-promises */ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ /* eslint-disable @typescript-eslint/prefer-optional-chain */ /* eslint-disable no-param-reassign */ @@ -85,8 +84,7 @@ export class WorkflowRunner { * */ processHookMessage(workflowHooks: WorkflowHooks, hookData: IProcessMessageDataHook) { - // eslint-disable-next-line @typescript-eslint/no-floating-promises - workflowHooks.executeHookFunctions(hookData.hook, hookData.parameters); + void workflowHooks.executeHookFunctions(hookData.hook, hookData.parameters); } /** @@ -277,7 +275,7 @@ export class WorkflowRunner { error, error.node, ); - additionalData.hooks + await additionalData.hooks .executeHookFunctions('workflowExecuteAfter', [failedExecution]) .then(() => { this.activeExecutions.remove(executionId, failedExecution); @@ -350,7 +348,7 @@ export class WorkflowRunner { if (workflowTimeout > 0) { const timeout = Math.min(workflowTimeout, config.getEnv('executions.maxTimeout')) * 1000; // as seconds executionTimeout = setTimeout(() => { - this.activeExecutions.stopExecution(executionId, 'timeout'); + void this.activeExecutions.stopExecution(executionId, 'timeout'); }, timeout); } @@ -363,7 +361,7 @@ export class WorkflowRunner { this.activeExecutions.remove(executionId, fullRunData); }) .catch((error) => { - this.processError( + void this.processError( error, new Date(), data.executionMode, @@ -434,7 +432,7 @@ export class WorkflowRunner { // Normally also workflow should be supplied here but as it only used for sending // data to editor-UI is not needed. - hooks.executeHookFunctions('workflowExecuteBefore', []); + await hooks.executeHookFunctions('workflowExecuteBefore', []); } catch (error) { // We use "getWorkflowHooksWorkerExecuter" as "getWorkflowHooksWorkerMain" does not contain the // "workflowExecuteAfter" which we require. @@ -551,7 +549,7 @@ export class WorkflowRunner { this.activeExecutions.remove(executionId, runData); // Normally also static data should be supplied here but as it only used for sending // data to editor-UI is not needed. - hooks.executeHookFunctions('workflowExecuteAfter', [runData]); + await hooks.executeHookFunctions('workflowExecuteAfter', [runData]); try { // Check if this execution data has to be removed from database // based on workflow settings. @@ -674,7 +672,7 @@ export class WorkflowRunner { } const processTimeoutFunction = (timeout: number) => { - this.activeExecutions.stopExecution(executionId, 'timeout'); + void this.activeExecutions.stopExecution(executionId, 'timeout'); executionTimeout = setTimeout(() => subprocess.kill(), Math.max(timeout * 0.2, 5000)); // minimum 5 seconds }; @@ -738,7 +736,7 @@ export class WorkflowRunner { const timeoutError = new WorkflowOperationError('Workflow execution timed out!'); // No need to add hook here as the subprocess takes care of calling the hooks - this.processError(timeoutError, startedAt, data.executionMode, executionId); + await this.processError(timeoutError, startedAt, data.executionMode, executionId); } else if (message.type === 'startExecution') { const executionId = await this.activeExecutions.add(message.data.runData); childExecutionIds.push(executionId); diff --git a/packages/cli/src/WorkflowRunnerProcess.ts b/packages/cli/src/WorkflowRunnerProcess.ts index 8271bee426240..256016d159605 100644 --- a/packages/cli/src/WorkflowRunnerProcess.ts +++ b/packages/cli/src/WorkflowRunnerProcess.ts @@ -558,8 +558,7 @@ process.on('message', async (message: IProcessMessage) => { stoppedAt: new Date(), }; - // eslint-disable-next-line @typescript-eslint/no-floating-promises - workflowRunner.sendHookToParentProcess('workflowExecuteAfter', [runData]); + await workflowRunner.sendHookToParentProcess('workflowExecuteAfter', [runData]); } await sendToParentProcess(message.type === 'timeout' ? message.type : 'end', { diff --git a/packages/cli/src/commands/executeBatch.ts b/packages/cli/src/commands/executeBatch.ts index 26c9955a07703..c11d5be3f0bf7 100644 --- a/packages/cli/src/commands/executeBatch.ts +++ b/packages/cli/src/commands/executeBatch.ts @@ -122,8 +122,7 @@ export class ExecuteBatch extends Command { ExecuteBatch.cancelled = true; const activeExecutionsInstance = ActiveExecutions.getInstance(); const stopPromises = activeExecutionsInstance.getActiveExecutions().map(async (execution) => { - // eslint-disable-next-line @typescript-eslint/no-floating-promises - activeExecutionsInstance.stopExecution(execution.id); + await activeExecutionsInstance.stopExecution(execution.id); }); await Promise.allSettled(stopPromises); diff --git a/packages/cli/src/commands/start.ts b/packages/cli/src/commands/start.ts index 92e3c71161886..ef705fea52646 100644 --- a/packages/cli/src/commands/start.ts +++ b/packages/cli/src/commands/start.ts @@ -349,7 +349,6 @@ export class Start extends Command { if (dbType === 'sqlite') { const shouldRunVacuum = config.getEnv('database.sqlite.executeVacuumOnStartup'); if (shouldRunVacuum) { - // eslint-disable-next-line @typescript-eslint/no-floating-promises await Db.collections.Execution.query('VACUUM;'); } } @@ -440,8 +439,7 @@ export class Start extends Command { inputText = ''; } else if (key.charCodeAt(0) === 3) { // Ctrl + c got pressed - // eslint-disable-next-line @typescript-eslint/no-floating-promises - Start.stopProcess(); + void Start.stopProcess(); } else { // When anything else got pressed, record it and send it on enter into the child process // eslint-disable-next-line no-lonely-if diff --git a/packages/cli/src/commands/worker.ts b/packages/cli/src/commands/worker.ts index d58420c0c1b99..eec0f000b581d 100644 --- a/packages/cli/src/commands/worker.ts +++ b/packages/cli/src/commands/worker.ts @@ -76,8 +76,8 @@ export class Worker extends Command { LoggerProxy.info(`Stopping n8n...`); // Stop accepting new jobs - // eslint-disable-next-line @typescript-eslint/no-floating-promises - Worker.jobQueue.pause(true); + + await Worker.jobQueue.pause(true); try { const externalHooks = ExternalHooks(); @@ -304,8 +304,10 @@ export class Worker extends Command { const redisConnectionTimeoutLimit = config.getEnv('queue.bull.redis.timeoutThreshold'); Worker.jobQueue = Queue.getInstance().getBullObjectInstance(); - // eslint-disable-next-line @typescript-eslint/no-floating-promises - Worker.jobQueue.process(flags.concurrency, async (job) => this.runJob(job, nodeTypes)); + + await Worker.jobQueue.process(flags.concurrency, async (job) => + this.runJob(job, nodeTypes), + ); const versions = await GenericHelpers.getVersions(); const instanceId = await UserSettings.getInstanceId(); From c340a0ff3875a0716fb535086b194b5251d82e84 Mon Sep 17 00:00:00 2001 From: Michael Kret Date: Fri, 18 Nov 2022 15:44:35 +0200 Subject: [PATCH 2/8] :zap: editor and nodes packages fixes --- packages/editor-ui/.eslintrc.js | 1 - packages/editor-ui/src/App.vue | 14 +-- .../src/components/BreakpointsObserver.vue | 2 +- .../src/components/CredentialCard.vue | 4 +- .../CredentialEdit/CredentialEdit.vue | 12 +-- .../CredentialEdit/CredentialSharing.ee.vue | 2 +- .../src/components/CredentialsSelectModal.vue | 2 +- .../src/components/ExecutionsList.vue | 4 +- .../ExecutionsInfoAccordion.vue | 2 +- .../ExecutionsView/ExecutionsLandingPage.vue | 2 +- .../ExecutionsView/ExecutionsView.vue | 18 ++-- .../src/components/ExpressionEdit.vue | 8 +- .../editor-ui/src/components/GoBackButton.vue | 2 +- .../ExecutionDetails/ExecutionDetails.vue | 2 +- .../src/components/MainHeader/MainHeader.vue | 6 +- .../components/MainHeader/WorkflowDetails.vue | 4 +- .../editor-ui/src/components/MainSidebar.vue | 22 ++--- packages/editor-ui/src/components/Modal.vue | 2 +- .../editor-ui/src/components/ModalDrawer.vue | 2 +- .../src/components/NDVDraggablePanels.vue | 2 +- packages/editor-ui/src/components/Node.vue | 2 +- .../Node/NodeCreator/CategorizedItems.vue | 4 +- .../components/Node/NodeCreator/MainPanel.vue | 6 +- .../components/Node/NodeCreator/SearchBar.vue | 2 +- .../src/components/NodeDetailsView.vue | 6 +- .../src/components/NodeExecuteButton.vue | 6 +- .../editor-ui/src/components/NodeSettings.vue | 6 +- .../src/components/NodeSettingsTabs.vue | 2 +- .../src/components/ParameterInput.vue | 18 ++-- .../src/components/PersonalizationModal.vue | 2 +- .../ResourceLocator/ResourceLocator.vue | 6 +- packages/editor-ui/src/components/RunData.vue | 6 +- .../editor-ui/src/components/RunDataJson.vue | 2 +- .../editor-ui/src/components/RunDataTable.vue | 2 +- .../src/components/SettingsSidebar.vue | 8 +- .../editor-ui/src/components/TagsDropdown.vue | 4 +- .../components/TagsManager/TagsManager.vue | 2 +- .../editor-ui/src/components/Telemetry.vue | 4 +- .../src/components/TemplateDetails.vue | 4 +- .../editor-ui/src/components/WorkflowCard.vue | 2 +- .../src/components/WorkflowSettings.vue | 6 +- .../src/components/WorkflowShareModal.ee.vue | 4 +- .../layouts/ResourcesListLayout.vue | 4 +- .../src/components/mixins/pushConnection.ts | 10 +- .../src/components/mixins/showMessage.ts | 2 +- .../src/components/mixins/workflowActivate.ts | 6 +- .../src/components/mixins/workflowHelpers.ts | 6 +- .../src/components/mixins/workflowRun.ts | 6 +- packages/editor-ui/src/main.ts | 2 +- packages/editor-ui/src/stores/credentials.ts | 4 +- packages/editor-ui/src/stores/nodeTypes.ts | 2 +- packages/editor-ui/src/stores/settings.ts | 6 +- .../editor-ui/src/views/CredentialsView.vue | 2 +- packages/editor-ui/src/views/ErrorView.vue | 2 +- packages/editor-ui/src/views/NodeView.vue | 94 +++++++++---------- .../editor-ui/src/views/SettingsApiView.vue | 4 +- .../src/views/SettingsCommunityNodesView.vue | 2 +- .../editor-ui/src/views/SettingsUsersView.vue | 2 +- packages/editor-ui/src/views/SettingsView.vue | 2 +- packages/editor-ui/src/views/SetupView.vue | 4 +- packages/editor-ui/src/views/SigninView.vue | 4 +- packages/editor-ui/src/views/SignupView.vue | 2 +- .../src/views/TemplatesCollectionView.vue | 4 +- .../src/views/TemplatesSearchView.vue | 16 ++-- .../src/views/TemplatesWorkflowView.vue | 4 +- .../editor-ui/src/views/WorkflowsView.vue | 8 +- packages/nodes-base/.eslintrc.js | 1 - packages/nodes-base/nodes/Asana/Asana.node.ts | 9 +- .../EmailReadImap/v1/EmailReadImapV1.node.ts | 4 +- .../EmailReadImap/v2/EmailReadImapV2.node.ts | 8 +- .../nodes/Kafka/KafkaTrigger.node.ts | 4 +- .../nodes-base/nodes/MQTT/MqttTrigger.node.ts | 2 +- .../nodes-base/nodes/MongoDb/MongoDb.node.ts | 12 ++- .../nodes/MySql/GenericFunctions.ts | 2 +- packages/nodes-base/nodes/MySql/MySql.node.ts | 2 +- .../nodes/RabbitMQ/RabbitMQTrigger.node.ts | 4 +- 76 files changed, 233 insertions(+), 230 deletions(-) diff --git a/packages/editor-ui/.eslintrc.js b/packages/editor-ui/.eslintrc.js index f3aca7a47e80f..e94b30c11caa2 100644 --- a/packages/editor-ui/.eslintrc.js +++ b/packages/editor-ui/.eslintrc.js @@ -27,7 +27,6 @@ module.exports = { '@typescript-eslint/no-duplicate-imports': 'off', '@typescript-eslint/no-empty-interface': 'off', '@typescript-eslint/no-explicit-any': 'off', - '@typescript-eslint/no-floating-promises': 'off', '@typescript-eslint/no-for-in-array': 'off', '@typescript-eslint/no-loop-func': 'off', '@typescript-eslint/no-non-null-assertion': 'off', diff --git a/packages/editor-ui/src/App.vue b/packages/editor-ui/src/App.vue index 626e2624528ff..c5c1f81d23930 100644 --- a/packages/editor-ui/src/App.vue +++ b/packages/editor-ui/src/App.vue @@ -132,7 +132,7 @@ export default mixins( return; } - this.$router.replace({ name: VIEWS.SETUP }); + void this.$router.replace({ name: VIEWS.SETUP }); return; } @@ -146,7 +146,7 @@ export default mixins( const redirect = this.$route.query.redirect || encodeURIComponent(`${window.location.pathname}${window.location.search}`); - this.$router.replace({ name: VIEWS.SIGNIN, query: { redirect } }); + void this.$router.replace({ name: VIEWS.SIGNIN, query: { redirect } }); return; } @@ -154,18 +154,18 @@ export default mixins( if (this.$route.name === VIEWS.SIGNIN && typeof this.$route.query.redirect === 'string') { const redirect = decodeURIComponent(this.$route.query.redirect); if (redirect.startsWith('/')) { // protect against phishing - this.$router.replace(redirect); + void this.$router.replace(redirect); return; } } // if cannot access page and is logged in - this.$router.replace({ name: VIEWS.HOMEPAGE }); + void this.$router.replace({ name: VIEWS.HOMEPAGE }); }, redirectIfNecessary() { const redirect = this.$route.meta && typeof this.$route.meta.getRedirect === 'function' && this.$route.meta.getRedirect(); if (redirect) { - this.$router.replace(redirect); + void this.$router.replace(redirect); } }, setTheme() { @@ -186,7 +186,7 @@ export default mixins( this.trackPage(); // TODO: Un-comment once front-end hooks are updated to work with pinia store - this.$externalHooks().run('app.mount'); + await this.$externalHooks().run('app.mount'); if (this.defaultLocale !== 'en') { await this.nodeTypesStore.getNodeTranslationHeaders(); @@ -200,7 +200,7 @@ export default mixins( this.trackPage(); }, defaultLocale(newLocale) { - loadLanguage(newLocale); + void loadLanguage(newLocale); }, }, }); diff --git a/packages/editor-ui/src/components/BreakpointsObserver.vue b/packages/editor-ui/src/components/BreakpointsObserver.vue index bad6647408951..99707651bf5d2 100644 --- a/packages/editor-ui/src/components/BreakpointsObserver.vue +++ b/packages/editor-ui/src/components/BreakpointsObserver.vue @@ -48,7 +48,7 @@ export default mixins(genericHelpers, debounceHelper).extend({ }, methods: { onResize() { - this.callDebounced("onResizeEnd", { debounceTime: 50 }); + void this.callDebounced("onResizeEnd", { debounceTime: 50 }); }, onResizeEnd() { this.$data.width = window.innerWidth; diff --git a/packages/editor-ui/src/components/CredentialCard.vue b/packages/editor-ui/src/components/CredentialCard.vue index 782c5495824e7..667213247470d 100644 --- a/packages/editor-ui/src/components/CredentialCard.vue +++ b/packages/editor-ui/src/components/CredentialCard.vue @@ -130,7 +130,7 @@ export default mixins( }, async onAction(action: string) { if (action === CREDENTIAL_LIST_ITEM_ACTIONS.OPEN) { - this.onClick(); + await this.onClick(); } else if (action === CREDENTIAL_LIST_ITEM_ACTIONS.DELETE) { const deleteConfirmed = await this.confirmMessage( this.$locale.baseText('credentialEdit.credentialEdit.confirmMessage.deleteCredential.message', { @@ -142,7 +142,7 @@ export default mixins( ); if (deleteConfirmed) { - this.credentialsStore.deleteCredential({ id: this.data.id }); + await this.credentialsStore.deleteCredential({ id: this.data.id }); } } }, diff --git a/packages/editor-ui/src/components/CredentialEdit/CredentialEdit.vue b/packages/editor-ui/src/components/CredentialEdit/CredentialEdit.vue index 07aea62ae6574..8641ff8959d1f 100644 --- a/packages/editor-ui/src/components/CredentialEdit/CredentialEdit.vue +++ b/packages/editor-ui/src/components/CredentialEdit/CredentialEdit.vue @@ -237,7 +237,7 @@ export default mixins(showMessage, nodeHelpers).extend({ } } - this.$externalHooks().run('credentialsEdit.credentialModalOpened', { + await this.$externalHooks().run('credentialsEdit.credentialModalOpened', { credentialType: this.credentialTypeName, isEditingCredential: this.mode === 'edit', activeNode: this.ndvStore.activeNode, @@ -249,7 +249,7 @@ export default mixins(showMessage, nodeHelpers).extend({ this.showValidationWarning = true; } else { - this.retestCredential(); + void this.retestCredential(); } } }, 0); @@ -790,7 +790,7 @@ export default mixins(showMessage, nodeHelpers).extend({ } this.$telemetry.track('User saved credentials', trackProperties); - this.$externalHooks().run('credentialEdit.saveCredential', trackProperties); + await this.$externalHooks().run('credentialEdit.saveCredential', trackProperties); } return credential; @@ -813,7 +813,7 @@ export default mixins(showMessage, nodeHelpers).extend({ return null; } - this.$externalHooks().run('credential.saved', { + await this.$externalHooks().run('credential.saved', { credential_type: credentialDetails.type, credential_id: credential.id, is_new: true, @@ -844,7 +844,7 @@ export default mixins(showMessage, nodeHelpers).extend({ return null; } - this.$externalHooks().run('credential.saved', { + await this.$externalHooks().run('credential.saved', { credential_type: credentialDetails.type, credential_id: credential.id, is_new: false, @@ -877,7 +877,7 @@ export default mixins(showMessage, nodeHelpers).extend({ try { this.isDeleting = true; - this.credentialsStore.deleteCredential({ id: this.credentialId }); + await this.credentialsStore.deleteCredential({ id: this.credentialId }); this.hasUnsavedChanges = false; } catch (error) { this.$showError( diff --git a/packages/editor-ui/src/components/CredentialEdit/CredentialSharing.ee.vue b/packages/editor-ui/src/components/CredentialEdit/CredentialSharing.ee.vue index 123c67a00b00b..5dec34f8284af 100644 --- a/packages/editor-ui/src/components/CredentialEdit/CredentialSharing.ee.vue +++ b/packages/editor-ui/src/components/CredentialEdit/CredentialSharing.ee.vue @@ -100,7 +100,7 @@ export default mixins( }, }, mounted() { - this.loadUsers(); + void this.loadUsers(); }, }); diff --git a/packages/editor-ui/src/components/CredentialsSelectModal.vue b/packages/editor-ui/src/components/CredentialsSelectModal.vue index ad4255967f87a..9b032b2c3c5dd 100644 --- a/packages/editor-ui/src/components/CredentialsSelectModal.vue +++ b/packages/editor-ui/src/components/CredentialsSelectModal.vue @@ -110,7 +110,7 @@ export default mixins(externalHooks).extend({ }; this.$telemetry.track('User opened Credential modal', telemetryPayload); - this.$externalHooks().run('credentialsSelectModal.openCredentialType', telemetryPayload); + void this.$externalHooks().run('credentialsSelectModal.openCredentialType', telemetryPayload); }, }, }); diff --git a/packages/editor-ui/src/components/ExecutionsList.vue b/packages/editor-ui/src/components/ExecutionsList.vue index 65f35aef38ab8..8c33cffd923be 100644 --- a/packages/editor-ui/src/components/ExecutionsList.vue +++ b/packages/editor-ui/src/components/ExecutionsList.vue @@ -251,7 +251,7 @@ export default mixins( await this.refreshData(); this.handleAutoRefreshToggle(); - this.$externalHooks().run('executionsList.openDialog'); + await this.$externalHooks().run('executionsList.openDialog'); this.$telemetry.track('User opened Executions log', { workflow_id: this.workflowsStore.workflowId }); }, beforeDestroy() { @@ -434,7 +434,7 @@ export default mixins( if (currentWorkflowExecutions.length === 0) { this.workflowsStore.activeWorkflowExecution = null; - this.$router.push({ name: VIEWS.EXECUTION_HOME, params: { name: currentWorkflow } }); + await this.$router.push({ name: VIEWS.EXECUTION_HOME, params: { name: currentWorkflow } }); } else if (removedActiveExecution) { this.workflowsStore.activeWorkflowExecution = currentWorkflowExecutions[0]; this.$router.push({ diff --git a/packages/editor-ui/src/components/ExecutionsView/ExecutionsInfoAccordion.vue b/packages/editor-ui/src/components/ExecutionsView/ExecutionsInfoAccordion.vue index 360a11ea7d993..79ca8aabbe196 100644 --- a/packages/editor-ui/src/components/ExecutionsView/ExecutionsInfoAccordion.vue +++ b/packages/editor-ui/src/components/ExecutionsView/ExecutionsInfoAccordion.vue @@ -177,7 +177,7 @@ export default mixins(workflowHelpers).extend({ currentId = this.$route.params.name; } const saved = await this.saveCurrentWorkflow({ id: currentId, name: this.workflowName, tags: this.currentWorkflowTagIds }); - if (saved) this.settingsStore.fetchPromptsData(); + if (saved) await this.settingsStore.fetchPromptsData(); }, }, }); diff --git a/packages/editor-ui/src/components/ExecutionsView/ExecutionsLandingPage.vue b/packages/editor-ui/src/components/ExecutionsView/ExecutionsLandingPage.vue index 5706a733d80ea..da64342d33e08 100644 --- a/packages/editor-ui/src/components/ExecutionsView/ExecutionsLandingPage.vue +++ b/packages/editor-ui/src/components/ExecutionsView/ExecutionsLandingPage.vue @@ -54,7 +54,7 @@ export default Vue.extend({ onSetupFirstStep(event: MouseEvent): void { this.uiStore.addFirstStepOnLoad = true; const workflowRoute = this.getWorkflowRoute(); - this.$router.push(workflowRoute); + void this.$router.push(workflowRoute); }, getWorkflowRoute(): { name: string, params: {}} { const workflowId = this.workflowsStore.workflowId || this.$route.params.name; diff --git a/packages/editor-ui/src/components/ExecutionsView/ExecutionsView.vue b/packages/editor-ui/src/components/ExecutionsView/ExecutionsView.vue index 5804ea36e770b..0a17fda4e26c5 100644 --- a/packages/editor-ui/src/components/ExecutionsView/ExecutionsView.vue +++ b/packages/editor-ui/src/components/ExecutionsView/ExecutionsView.vue @@ -96,7 +96,7 @@ export default mixins(restApi, showMessage, executionHelpers, debounceHelper, wo watch:{ $route (to: Route, from: Route) { const workflowChanged = from.params.name !== to.params.name; - this.initView(workflowChanged); + void this.initView(workflowChanged); if (to.params.executionId) { const execution = this.workflowsStore.getExecutionDataById(to.params.executionId); @@ -123,7 +123,7 @@ export default mixins(restApi, showMessage, executionHelpers, debounceHelper, wo if (confirmModal === MODAL_CONFIRMED) { const saved = await this.saveCurrentWorkflow({}, false); - if (saved) this.settingsStore.fetchPromptsData(); + if (saved) void this.settingsStore.fetchPromptsData(); this.uiStore.stateIsDirty = false; next(); } else if (confirmModal === MODAL_CANCEL) { @@ -157,7 +157,7 @@ export default mixins(restApi, showMessage, executionHelpers, debounceHelper, wo } await this.openWorkflow(this.$route.params.name); this.uiStore.nodeViewInitialized = false; - this.setExecutions(); + await this.setExecutions(); if (this.activeExecution) { this.$router.push({ name: VIEWS.EXECUTION_PREVIEW, @@ -168,7 +168,7 @@ export default mixins(restApi, showMessage, executionHelpers, debounceHelper, wo }, async onLoadMore(): Promise { if (!this.loadingMore) { - this.callDebounced("loadMore", { debounceTime: 1000 }); + await this.callDebounced("loadMore", { debounceTime: 1000 }); } }, async loadMore(): Promise { @@ -228,7 +228,7 @@ export default mixins(restApi, showMessage, executionHelpers, debounceHelper, wo }).catch(()=>{});; } else { // If there are no executions left, show empty state and clear active execution from the store this.workflowsStore.activeWorkflowExecution = null; - this.$router.push({ name: VIEWS.EXECUTION_HOME, params: { name: this.currentWorkflow } }); + await this.$router.push({ name: VIEWS.EXECUTION_HOME, params: { name: this.currentWorkflow } }); } } catch (error) { this.loading = false; @@ -260,7 +260,7 @@ export default mixins(restApi, showMessage, executionHelpers, debounceHelper, wo type: 'success', }); - this.loadAutoRefresh(); + await this.loadAutoRefresh(); } catch (error) { this.$showError( error, @@ -270,7 +270,7 @@ export default mixins(restApi, showMessage, executionHelpers, debounceHelper, wo }, onFilterUpdated(newFilter: { finished: boolean, status: string }): void { this.filter = newFilter; - this.setExecutions(); + void this.setExecutions(); }, async setExecutions(): Promise { const workflowExecutions = await this.loadExecutions(); @@ -409,7 +409,7 @@ export default mixins(restApi, showMessage, executionHelpers, debounceHelper, wo this.tagsStore.upsertTags(tags); - this.$externalHooks().run('workflow.open', { workflowId, workflowName: data.name }); + await this.$externalHooks().run('workflow.open', { workflowId, workflowName: data.name }); this.uiStore.stateIsDirty = false; }, async addNodes(nodes: INodeUi[], connections?: IConnections) { @@ -524,7 +524,7 @@ export default mixins(restApi, showMessage, executionHelpers, debounceHelper, wo duration: 2000, }); await this.retryExecution(payload.execution, loadWorkflow); - this.loadAutoRefresh(); + await this.loadAutoRefresh(); this.$telemetry.track('User clicked retry execution button', { workflow_id: this.workflowsStore.workflowId, diff --git a/packages/editor-ui/src/components/ExpressionEdit.vue b/packages/editor-ui/src/components/ExpressionEdit.vue index 5379eb1a053b4..39778c1ed5658 100644 --- a/packages/editor-ui/src/components/ExpressionEdit.vue +++ b/packages/editor-ui/src/components/ExpressionEdit.vue @@ -95,7 +95,7 @@ export default mixins( this.updateDisplayValue(); this.$emit('valueChanged', this.latestValue); } else { - this.callDebounced('updateDisplayValue', { debounceTime: 500 }); + void this.callDebounced('updateDisplayValue', { debounceTime: 500 }); } }, @@ -115,7 +115,7 @@ export default mixins( itemSelected (eventData: IVariableItemSelected) { (this.$refs.inputFieldExpression as any).itemSelected(eventData); // tslint:disable-line:no-any - this.$externalHooks().run('expressionEdit.itemSelected', { parameter: this.parameter, value: this.value, selectedItem: eventData }); + void this.$externalHooks().run('expressionEdit.itemSelected', { parameter: this.parameter, value: this.value, selectedItem: eventData }); const trackProperties: { event_version: string; @@ -177,7 +177,7 @@ export default mixins( this.latestValue = this.value; const resolvedExpressionValue = this.$refs.expressionResult && (this.$refs.expressionResult as any).getValue() || undefined; // tslint:disable-line:no-any - this.$externalHooks().run('expressionEdit.dialogVisibleChanged', { dialogVisible: newValue, parameter: this.parameter, value: this.value, resolvedExpressionValue }); + void this.$externalHooks().run('expressionEdit.dialogVisibleChanged', { dialogVisible: newValue, parameter: this.parameter, value: this.value, resolvedExpressionValue }); if (!newValue) { const telemetryPayload = { @@ -189,7 +189,7 @@ export default mixins( has_mapping: hasExpressionMapping(this.value), }; this.$telemetry.track('User closed Expression Editor', telemetryPayload); - this.$externalHooks().run('expressionEdit.closeDialog', telemetryPayload); + void this.$externalHooks().run('expressionEdit.closeDialog', telemetryPayload); } }, }, diff --git a/packages/editor-ui/src/components/GoBackButton.vue b/packages/editor-ui/src/components/GoBackButton.vue index 80044c100b66c..1a609b039bd62 100644 --- a/packages/editor-ui/src/components/GoBackButton.vue +++ b/packages/editor-ui/src/components/GoBackButton.vue @@ -19,7 +19,7 @@ export default Vue.extend({ methods: { navigateTo() { if (this.routeHasHistory) this.$router.go(-1); - else this.$router.push({ name: VIEWS.TEMPLATES }); + else void this.$router.push({ name: VIEWS.TEMPLATES }); }, }, mounted() { diff --git a/packages/editor-ui/src/components/MainHeader/ExecutionDetails/ExecutionDetails.vue b/packages/editor-ui/src/components/MainHeader/ExecutionDetails/ExecutionDetails.vue index 12dcb93b039b0..b3ff759ab8521 100644 --- a/packages/editor-ui/src/components/MainHeader/ExecutionDetails/ExecutionDetails.vue +++ b/packages/editor-ui/src/components/MainHeader/ExecutionDetails/ExecutionDetails.vue @@ -86,7 +86,7 @@ export default mixins(titleChange).extend({ async openWorkflow(workflowId: string) { this.$titleSet(this.workflowName, "IDLE"); // Change to other workflow - this.$router.push({ + await this.$router.push({ name: "NodeViewExisting", params: { name: workflowId }, }); diff --git a/packages/editor-ui/src/components/MainHeader/MainHeader.vue b/packages/editor-ui/src/components/MainHeader/MainHeader.vue index bf20c19a8eecc..409bcc7d48165 100644 --- a/packages/editor-ui/src/components/MainHeader/MainHeader.vue +++ b/packages/editor-ui/src/components/MainHeader/MainHeader.vue @@ -105,14 +105,14 @@ export default mixins( case MAIN_HEADER_TABS.WORKFLOW: if (!['', 'new', PLACEHOLDER_EMPTY_WORKFLOW_ID].includes(this.workflowToReturnTo)) { if (this.$route.name !== VIEWS.WORKFLOW) { - this.$router.push({ + void this.$router.push({ name: VIEWS.WORKFLOW, params: { name: this.workflowToReturnTo }, }); } } else { if (this.$route.name !== VIEWS.NEW_WORKFLOW) { - this.$router.push({ name: VIEWS.NEW_WORKFLOW }); + void this.$router.push({ name: VIEWS.NEW_WORKFLOW }); this.uiStore.stateIsDirty = this.dirtyState; } } @@ -128,7 +128,7 @@ export default mixins( params: { name: routeWorkflowId, executionId: this.activeExecution.id }, }).catch(()=>{});; } else { - this.$router.push({ name: VIEWS.EXECUTION_HOME, params: { name: routeWorkflowId } }); + void this.$router.push({ name: VIEWS.EXECUTION_HOME, params: { name: routeWorkflowId } }); } // this.modalBus.$emit('closeAll'); this.activeHeaderTab = MAIN_HEADER_TABS.EXECUTIONS; diff --git a/packages/editor-ui/src/components/MainHeader/WorkflowDetails.vue b/packages/editor-ui/src/components/MainHeader/WorkflowDetails.vue index 7979532acf3d0..1effbf7a40471 100644 --- a/packages/editor-ui/src/components/MainHeader/WorkflowDetails.vue +++ b/packages/editor-ui/src/components/MainHeader/WorkflowDetails.vue @@ -286,7 +286,7 @@ export default mixins(workflowHelpers, titleChange).extend({ if (this.$data.isNameEditEnabled) { if (this.$data.isTagsEditEnabled) { // @ts-ignore - this.onTagsBlur(); + void this.onTagsBlur(); } this.$data.isTagsEditEnabled = false; @@ -444,7 +444,7 @@ export default mixins(workflowHelpers, titleChange).extend({ type: 'success', }); - this.$router.push({ name: VIEWS.NEW_WORKFLOW }); + await this.$router.push({ name: VIEWS.NEW_WORKFLOW }); break; } default: diff --git a/packages/editor-ui/src/components/MainSidebar.vue b/packages/editor-ui/src/components/MainSidebar.vue index efad4f9cc77c1..0c95549f53115 100644 --- a/packages/editor-ui/src/components/MainSidebar.vue +++ b/packages/editor-ui/src/components/MainSidebar.vue @@ -275,7 +275,7 @@ export default mixins( async mounted() { this.basePath = this.rootStore.baseUrl; if (this.$refs.user) { - this.$externalHooks().run('mainSidebar.mounted', { userRef: this.$refs.user }); + await this.$externalHooks().run('mainSidebar.mounted', { userRef: this.$refs.user }); } if (window.innerWidth < 900 || this.uiStore.isNodeView) { this.uiStore.sidebarMenuCollapsed = true; @@ -298,10 +298,10 @@ export default mixins( async onUserActionToggle(action: string) { switch (action) { case 'logout': - this.onLogout(); + await this.onLogout(); break; case 'settings': - this.$router.push({name: VIEWS.PERSONAL_SETTINGS}); + await this.$router.push({name: VIEWS.PERSONAL_SETTINGS}); break; default: break; @@ -334,19 +334,19 @@ export default mixins( switch (key) { case 'workflows': { if (this.$router.currentRoute.name !== VIEWS.WORKFLOWS) { - this.$router.push({name: VIEWS.WORKFLOWS}); + await this.$router.push({name: VIEWS.WORKFLOWS}); } break; } case 'templates': { if (this.$router.currentRoute.name !== VIEWS.TEMPLATES) { - this.$router.push({ name: VIEWS.TEMPLATES }); + await this.$router.push({ name: VIEWS.TEMPLATES }); } break; } case 'credentials': { if (this.$router.currentRoute.name !== VIEWS.CREDENTIALS) { - this.$router.push({name: VIEWS.CREDENTIALS}); + await this.$router.push({name: VIEWS.CREDENTIALS}); } break; } @@ -359,7 +359,7 @@ export default mixins( if (defaultRoute) { const routeProps = this.$router.resolve({ name: defaultRoute }); if (this.$router.currentRoute.name !== defaultRoute) { - this.$router.push(routeProps.route.path); + await this.$router.push(routeProps.route.path); } } break; @@ -396,7 +396,7 @@ export default mixins( if (this.$router.currentRoute.name === VIEWS.NEW_WORKFLOW) { this.$root.$emit('newWorkflow'); } else { - this.$router.push({ name: VIEWS.NEW_WORKFLOW }); + await this.$router.push({ name: VIEWS.NEW_WORKFLOW }); } this.$showMessage({ title: this.$locale.baseText('mainSidebar.showMessage.handleSelect2.title'), @@ -408,7 +408,7 @@ export default mixins( this.$root.$emit('newWorkflow'); } else { this.workflowsStore.setWorkflowId(PLACEHOLDER_EMPTY_WORKFLOW_ID); - this.$router.push({ name: VIEWS.NEW_WORKFLOW }); + await this.$router.push({ name: VIEWS.NEW_WORKFLOW }); } this.$showMessage({ title: this.$locale.baseText('mainSidebar.showMessage.handleSelect2.title'), @@ -420,7 +420,7 @@ export default mixins( } else { if (this.$router.currentRoute.name !== VIEWS.NEW_WORKFLOW) { this.workflowsStore.setWorkflowId(PLACEHOLDER_EMPTY_WORKFLOW_ID); - this.$router.push({ name: VIEWS.NEW_WORKFLOW }); + await this.$router.push({ name: VIEWS.NEW_WORKFLOW }); } this.$showMessage({ title: this.$locale.baseText('mainSidebar.showMessage.handleSelect3.title'), @@ -446,7 +446,7 @@ export default mixins( return defaultSettingsRoute; }, onResize (event: UIEvent) { - this.callDebounced("onResizeEnd", { debounceTime: 100 }, event); + void this.callDebounced("onResizeEnd", { debounceTime: 100 }, event); }, onResizeEnd (event: UIEvent) { const browserWidth = (event.target as Window).outerWidth; diff --git a/packages/editor-ui/src/components/Modal.vue b/packages/editor-ui/src/components/Modal.vue index b3e7bd39a1e1d..e72a70fbe826a 100644 --- a/packages/editor-ui/src/components/Modal.vue +++ b/packages/editor-ui/src/components/Modal.vue @@ -116,7 +116,7 @@ export default Vue.extend({ if (this.$props.eventBus) { this.$props.eventBus.$on('close', () => { - this.closeDialog(); + void this.closeDialog(); }); this.$props.eventBus.$on('closeAll', () => { diff --git a/packages/editor-ui/src/components/ModalDrawer.vue b/packages/editor-ui/src/components/ModalDrawer.vue index af031bf15bc96..af671b90926e1 100644 --- a/packages/editor-ui/src/components/ModalDrawer.vue +++ b/packages/editor-ui/src/components/ModalDrawer.vue @@ -55,7 +55,7 @@ export default Vue.extend({ if (this.$props.eventBus) { this.$props.eventBus.$on('close', () => { - this.close(); + void this.close(); }); } diff --git a/packages/editor-ui/src/components/NDVDraggablePanels.vue b/packages/editor-ui/src/components/NDVDraggablePanels.vue index 4bf9b75242049..8d86ba659c1c4 100644 --- a/packages/editor-ui/src/components/NDVDraggablePanels.vue +++ b/packages/editor-ui/src/components/NDVDraggablePanels.vue @@ -309,7 +309,7 @@ export default mixins(debounceHelper).extend({ }, onResizeDebounced(data: { direction: string, x: number, width: number}) { if (this.initialized) { - this.callDebounced('onResize', { debounceTime: 10, trailing: true }, data); + void this.callDebounced('onResize', { debounceTime: 10, trailing: true }, data); } }, onResize({ direction, x, width }: { direction: string, x: number, width: number}) { diff --git a/packages/editor-ui/src/components/Node.vue b/packages/editor-ui/src/components/Node.vue index 652b9124707ac..876861c5e381e 100644 --- a/packages/editor-ui/src/components/Node.vue +++ b/packages/editor-ui/src/components/Node.vue @@ -451,7 +451,7 @@ export default mixins( }, onClick(event: MouseEvent) { - this.callDebounced('onClickDebounced', { debounceTime: 50, trailing: true }, event); + void this.callDebounced('onClickDebounced', { debounceTime: 50, trailing: true }, event); }, onClickDebounced(event: MouseEvent) { diff --git a/packages/editor-ui/src/components/Node/NodeCreator/CategorizedItems.vue b/packages/editor-ui/src/components/Node/NodeCreator/CategorizedItems.vue index 5dec3bf5d31bc..874cfc5636a3b 100644 --- a/packages/editor-ui/src/components/Node/NodeCreator/CategorizedItems.vue +++ b/packages/editor-ui/src/components/Node/NodeCreator/CategorizedItems.vue @@ -216,7 +216,7 @@ export default mixins(externalHooks, globalLinkActions).extend({ : this.filterOutNodexFromExcludedCategories(returnItems); setTimeout(() => { - this.$externalHooks().run('nodeCreateList.filteredNodeTypesComputed', { + void this.$externalHooks().run('nodeCreateList.filteredNodeTypesComputed', { nodeFilter: this.nodeFilter, result: filteredNodeTypes, selectedType: this.selectedType, @@ -337,7 +337,7 @@ export default mixins(externalHooks, globalLinkActions).extend({ // Reset the index whenver the filter-value changes this.activeIndex = 0; this.activeSubcategoryIndex = 0; - this.$externalHooks().run('nodeCreateList.nodeFilterChanged', { + void this.$externalHooks().run('nodeCreateList.nodeFilterChanged', { oldValue, newValue, selectedType: this.selectedType, diff --git a/packages/editor-ui/src/components/Node/NodeCreator/MainPanel.vue b/packages/editor-ui/src/components/Node/NodeCreator/MainPanel.vue index c9eceb57dea16..9ff77483f1ec3 100644 --- a/packages/editor-ui/src/components/Node/NodeCreator/MainPanel.vue +++ b/packages/editor-ui/src/components/Node/NodeCreator/MainPanel.vue @@ -68,7 +68,7 @@ export default mixins(externalHooks).extend({ }, watch: { selectedType(newValue, oldValue) { - this.$externalHooks().run('nodeCreateList.selectedTypeChanged', { + void this.$externalHooks().run('nodeCreateList.selectedTypeChanged', { oldValue, newValue, }); @@ -80,13 +80,13 @@ export default mixins(externalHooks).extend({ }, }, mounted() { - this.$externalHooks().run('nodeCreateList.mounted'); + void this.$externalHooks().run('nodeCreateList.mounted'); // Make sure tabs are visible on mount this.nodeCreatorStore.showTabs = true; }, destroyed() { this.nodeCreatorStore.selectedType = ALL_NODE_FILTER; - this.$externalHooks().run('nodeCreateList.destroyed'); + void this.$externalHooks().run('nodeCreateList.destroyed'); this.$telemetry.trackNodesPanel('nodeCreateList.destroyed', { workflow_id: this.workflowsStore.workflowId }); }, }); diff --git a/packages/editor-ui/src/components/Node/NodeCreator/SearchBar.vue b/packages/editor-ui/src/components/Node/NodeCreator/SearchBar.vue index 767a102e53817..95641fa913d42 100644 --- a/packages/editor-ui/src/components/Node/NodeCreator/SearchBar.vue +++ b/packages/editor-ui/src/components/Node/NodeCreator/SearchBar.vue @@ -42,7 +42,7 @@ export default mixins(externalHooks).extend({ } setTimeout(this.focus, 0); - this.$externalHooks().run('nodeCreator_searchBar.mount', { inputRef: this.$refs['input'] }); + void this.$externalHooks().run('nodeCreator_searchBar.mount', { inputRef: this.$refs['input'] }); }, methods: { focus() { diff --git a/packages/editor-ui/src/components/NodeDetailsView.vue b/packages/editor-ui/src/components/NodeDetailsView.vue index b71c35bb31a74..216c88f7a8c97 100644 --- a/packages/editor-ui/src/components/NodeDetailsView.vue +++ b/packages/editor-ui/src/components/NodeDetailsView.vue @@ -398,7 +398,7 @@ export default mixins( setTimeout(() => { this.ndvStore.setNDVSessionId; }, 0); - this.$externalHooks().run('dataDisplay.nodeTypeChanged', { + void this.$externalHooks().run('dataDisplay.nodeTypeChanged', { nodeSubtitle: this.getNodeSubtitle(node, this.activeNodeType, this.getCurrentWorkflow()), }); @@ -493,7 +493,7 @@ export default mixins( onWorkflowActivate() { this.ndvStore.activeNodeName = null; setTimeout(() => { - this.activateCurrentWorkflow('ndv'); + void this.activateCurrentWorkflow('ndv'); }, 1000); }, onFeatureRequestClick() { @@ -605,7 +605,7 @@ export default mixins( this.ndvStore.setOutputPanelEditModeEnabled(false); } - this.$externalHooks().run('dataDisplay.nodeEditingFinished'); + await this.$externalHooks().run('dataDisplay.nodeEditingFinished'); this.$telemetry.track('User closed node modal', { node_type: this.activeNodeType ? this.activeNodeType.name : '', session_id: this.sessionId, diff --git a/packages/editor-ui/src/components/NodeExecuteButton.vue b/packages/editor-ui/src/components/NodeExecuteButton.vue index 962a7d6b57ce1..0934195a36e77 100644 --- a/packages/editor-ui/src/components/NodeExecuteButton.vue +++ b/packages/editor-ui/src/components/NodeExecuteButton.vue @@ -176,7 +176,7 @@ export default mixins( async onClick() { if (this.isListeningForEvents) { - this.stopWaitingForWebhook(); + await this.stopWaitingForWebhook(); } else if (this.isListeningForWorkflowEvents) { this.$emit('stopExecution'); } else { @@ -203,9 +203,9 @@ export default mixins( source: this.telemetrySource, }; this.$telemetry.track('User clicked execute node button', telemetryPayload); - this.$externalHooks().run('nodeExecuteButton.onClick', telemetryPayload); + await this.$externalHooks().run('nodeExecuteButton.onClick', telemetryPayload); - this.runWorkflow(this.nodeName, 'RunData.ExecuteNodeButton'); + await this.runWorkflow(this.nodeName, 'RunData.ExecuteNodeButton'); this.$emit('execute'); } } diff --git a/packages/editor-ui/src/components/NodeSettings.vue b/packages/editor-ui/src/components/NodeSettings.vue index ae762d2794a29..9ae991162b0f2 100644 --- a/packages/editor-ui/src/components/NodeSettings.vue +++ b/packages/editor-ui/src/components/NodeSettings.vue @@ -480,7 +480,7 @@ export default mixins(externalHooks, nodeHelpers).extend({ this.updateNodeCredentialIssues(node); } - this.$externalHooks().run('nodeSettings.credentialSelected', { updateInformation }); + void this.$externalHooks().run('nodeSettings.credentialSelected', { updateInformation }); }, nameChanged(name: string) { // @ts-ignore @@ -572,7 +572,7 @@ export default mixins(externalHooks, nodeHelpers).extend({ } } - this.$externalHooks().run('nodeSettings.valueChanged', { + void this.$externalHooks().run('nodeSettings.valueChanged', { parameterPath, newValue, parameters: this.parameters, @@ -680,7 +680,7 @@ export default mixins(externalHooks, nodeHelpers).extend({ this.workflowsStore.setNodeParameters(updateInformation); - this.$externalHooks().run('nodeSettings.valueChanged', { + void this.$externalHooks().run('nodeSettings.valueChanged', { parameterPath, newValue, parameters: this.parameters, diff --git a/packages/editor-ui/src/components/NodeSettingsTabs.vue b/packages/editor-ui/src/components/NodeSettingsTabs.vue index 0034841706ee5..5b03fd64a46ce 100644 --- a/packages/editor-ui/src/components/NodeSettingsTabs.vue +++ b/packages/editor-ui/src/components/NodeSettingsTabs.vue @@ -117,7 +117,7 @@ export default mixins( methods: { onTabSelect(tab: string) { if (tab === 'docs' && this.nodeType) { - this.$externalHooks().run('dataDisplay.onDocumentationUrlClick', { nodeType: this.nodeType as INodeTypeDescription, documentationUrl: this.documentationUrl }); + void this.$externalHooks().run('dataDisplay.onDocumentationUrlClick', { nodeType: this.nodeType as INodeTypeDescription, documentationUrl: this.documentationUrl }); this.$telemetry.track('User clicked ndv link', { node_type: this.activeNode.type, workflow_id: this.workflowsStore.workflowId, diff --git a/packages/editor-ui/src/components/ParameterInput.vue b/packages/editor-ui/src/components/ParameterInput.vue index 8877a2ccdede7..109168b64bc1e 100644 --- a/packages/editor-ui/src/components/ParameterInput.vue +++ b/packages/editor-ui/src/components/ParameterInput.vue @@ -465,7 +465,7 @@ export default mixins( dependentParametersValues () { // Reload the remote parameters whenever a parameter // on which the current field depends on changes - this.loadRemoteParameterOptions(); + void this.loadRemoteParameterOptions(); }, value () { if (this.parameter.type === 'color' && this.getArgument('showAlpha') === true) { @@ -760,7 +760,7 @@ export default mixins( this.updateNodeCredentialIssues(node); } - this.$externalHooks().run('nodeSettings.credentialSelected', { updateInformation }); + void this.$externalHooks().run('nodeSettings.credentialSelected', { updateInformation }); }, /** * Check whether a param value must be skipped when collecting node param issues for validation. @@ -938,7 +938,7 @@ export default mixins( this.$emit('textInput', parameterData); }, valueChangedDebounced (value: NodeParameterValueType | {} | Date) { - this.callDebounced('valueChanged', { debounceTime: 100 }, value); + void this.callDebounced('valueChanged', { debounceTime: 100 }, value); }, valueChanged (value: NodeParameterValueType | {} | Date) { if (this.parameter.name === 'nodeCredentialType') { @@ -1029,7 +1029,7 @@ export default mixins( (resourceLocator as Vue).$emit('refreshList'); } } - this.loadRemoteParameterOptions(); + void this.loadRemoteParameterOptions(); } if (this.node && (command === 'addExpression' || command === 'removeExpression')) { @@ -1043,7 +1043,7 @@ export default mixins( had_parameter: typeof prevValue === 'string' && prevValue.includes('$parameter'), }; this.$telemetry.track('User switched parameter mode', telemetryPayload); - this.$externalHooks().run('parameterInput.modeSwitch', telemetryPayload); + void this.$externalHooks().run('parameterInput.modeSwitch', telemetryPayload); } }, }, @@ -1052,7 +1052,7 @@ export default mixins( const remoteParameterOptions = this.$el.querySelectorAll('.remote-parameter-option'); if (remoteParameterOptions.length > 0) { - this.$externalHooks().run('parameterInput.updated', { remoteParameterOptions }); + void this.$externalHooks().run('parameterInput.updated', { remoteParameterOptions }); } }); }, @@ -1079,7 +1079,7 @@ export default mixins( // Make sure to load the parameter options // directly and whenever the credentials change this.$watch(() => this.node!.credentials, () => { - this.loadRemoteParameterOptions(); + void this.loadRemoteParameterOptions(); }, { deep: true, immediate: true }); // Reload function on change element from @@ -1098,14 +1098,14 @@ export default mixins( return null; } }, () => { - this.loadRemoteParameterOptions(); + void this.loadRemoteParameterOptions(); }, { deep: true, immediate: true }); } } } } - this.$externalHooks().run('parameterInput.mount', { parameter: this.parameter, inputFieldRef: this.$refs['inputField'] }); + void this.$externalHooks().run('parameterInput.mount', { parameter: this.parameter, inputFieldRef: this.$refs['inputField'] }); }, }); diff --git a/packages/editor-ui/src/components/PersonalizationModal.vue b/packages/editor-ui/src/components/PersonalizationModal.vue index beb98f6e90fed..c89b205cea825 100644 --- a/packages/editor-ui/src/components/PersonalizationModal.vue +++ b/packages/editor-ui/src/components/PersonalizationModal.vue @@ -474,7 +474,7 @@ export default mixins(showMessage, workflowHelpers).extend({ personalization_survey_n8n_version: this.rootStore.versionCli, }; - this.$externalHooks().run('personalizationModal.onSubmit', survey); + await this.$externalHooks().run('personalizationModal.onSubmit', survey); await this.usersStore.submitPersonalizationSurvey(survey as IPersonalizationSurveyAnswersV3); diff --git a/packages/editor-ui/src/components/ResourceLocator/ResourceLocator.vue b/packages/editor-ui/src/components/ResourceLocator/ResourceLocator.vue index d9c3b5cbbb347..5dc6e2b16c25b 100644 --- a/packages/editor-ui/src/components/ResourceLocator/ResourceLocator.vue +++ b/packages/editor-ui/src/components/ResourceLocator/ResourceLocator.vue @@ -562,11 +562,11 @@ export default mixins(debounceHelper, workflowHelpers, nodeHelpers).extend({ async loadInitialResources(): Promise { if (!this.currentResponse || (this.currentResponse && this.currentResponse.error)) { this.searchFilter = ''; - this.loadResources(); + await this.loadResources(); } }, loadResourcesDebounced() { - this.callDebounced('loadResources', { debounceTime: 1000, trailing: true }); + void this.callDebounced('loadResources', { debounceTime: 1000, trailing: true }); }, setResponse(paramsKey: string, props: Partial) { this.cachedResponses = { @@ -652,7 +652,7 @@ export default mixins(debounceHelper, workflowHelpers, nodeHelpers).extend({ return; } - this.loadInitialResources(); + void this.loadInitialResources(); this.showResourceDropdown = true; }, switchFromListMode(): void { diff --git a/packages/editor-ui/src/components/RunData.vue b/packages/editor-ui/src/components/RunData.vue index 18bc43912188c..f9670456adc3b 100644 --- a/packages/editor-ui/src/components/RunData.vue +++ b/packages/editor-ui/src/components/RunData.vue @@ -826,7 +826,7 @@ export default mixins( view: this.displayMode, run_index: this.runIndex, }; - this.$externalHooks().run('runData.onDataPinningSuccess', telemetryPayload); + void this.$externalHooks().run('runData.onDataPinningSuccess', telemetryPayload); this.$telemetry.track('Ndv data pinning success', telemetryPayload); }, onDataPinningError( @@ -856,7 +856,7 @@ export default mixins( view: !this.hasNodeRun && !this.hasPinData ? 'none' : this.displayMode, }; - this.$externalHooks().run('runData.onTogglePinData', telemetryPayload); + await this.$externalHooks().run('runData.onTogglePinData', telemetryPayload); this.$telemetry.track('User clicked pin data icon', telemetryPayload); } @@ -967,7 +967,7 @@ export default mixins( } this.closeBinaryDataDisplay(); - this.$externalHooks().run('runData.displayModeChanged', { newValue: displayMode, oldValue: previous }); + void this.$externalHooks().run('runData.displayModeChanged', { newValue: displayMode, oldValue: previous }); if(this.activeNode) { this.$telemetry.track('User changed ndv item view', { previous_view: previous, diff --git a/packages/editor-ui/src/components/RunDataJson.vue b/packages/editor-ui/src/components/RunDataJson.vue index aef5085c068e7..68ec68d1df45b 100644 --- a/packages/editor-ui/src/components/RunDataJson.vue +++ b/packages/editor-ui/src/components/RunDataJson.vue @@ -190,7 +190,7 @@ export default mixins(externalHooks).extend({ ...mappingTelemetry, }; - this.$externalHooks().run('runDataJson.onDragEnd', telemetryPayload); + void this.$externalHooks().run('runDataJson.onDragEnd', telemetryPayload); this.$telemetry.track('User dragged data for mapping', telemetryPayload); }, 1000); // ensure dest data gets set if drop diff --git a/packages/editor-ui/src/components/RunDataTable.vue b/packages/editor-ui/src/components/RunDataTable.vue index 97b0493a68da6..1111f48543caa 100644 --- a/packages/editor-ui/src/components/RunDataTable.vue +++ b/packages/editor-ui/src/components/RunDataTable.vue @@ -409,7 +409,7 @@ export default mixins(externalHooks).extend({ ...mappingTelemetry, }; - this.$externalHooks().run('runDataTable.onDragEnd', telemetryPayload); + void this.$externalHooks().run('runDataTable.onDragEnd', telemetryPayload); this.$telemetry.track('User dragged data for mapping', telemetryPayload); }, 1000); // ensure dest data gets set if drop diff --git a/packages/editor-ui/src/components/SettingsSidebar.vue b/packages/editor-ui/src/components/SettingsSidebar.vue index c6a0fb2e7da16..a6a35cd739a6d 100644 --- a/packages/editor-ui/src/components/SettingsSidebar.vue +++ b/packages/editor-ui/src/components/SettingsSidebar.vue @@ -129,17 +129,17 @@ export default mixins( switch (key) { case 'settings-personal': if (this.$router.currentRoute.name !== VIEWS.PERSONAL_SETTINGS) { - this.$router.push({ name: VIEWS.PERSONAL_SETTINGS }); + await this.$router.push({ name: VIEWS.PERSONAL_SETTINGS }); } break; case 'settings-users': if (this.$router.currentRoute.name !== VIEWS.USERS_SETTINGS) { - this.$router.push({ name: VIEWS.USERS_SETTINGS }); + await this.$router.push({ name: VIEWS.USERS_SETTINGS }); } break; case 'settings-api': if (this.$router.currentRoute.name !== VIEWS.API_SETTINGS) { - this.$router.push({ name: VIEWS.API_SETTINGS }); + await this.$router.push({ name: VIEWS.API_SETTINGS }); } break; case 'environments': @@ -148,7 +148,7 @@ export default mixins( break; case 'settings-community-nodes': if (this.$router.currentRoute.name !== VIEWS.COMMUNITY_NODES) { - this.$router.push({ name: VIEWS.COMMUNITY_NODES }); + await this.$router.push({ name: VIEWS.COMMUNITY_NODES }); } break; default: diff --git a/packages/editor-ui/src/components/TagsDropdown.vue b/packages/editor-ui/src/components/TagsDropdown.vue index 2dd88922fc717..b2d5106458673 100644 --- a/packages/editor-ui/src/components/TagsDropdown.vue +++ b/packages/editor-ui/src/components/TagsDropdown.vue @@ -112,7 +112,7 @@ export default mixins(showMessage).extend({ }); } - this.tagsStore.fetchAll(); + void this.tagsStore.fetchAll(); }, computed: { ...mapStores( @@ -169,7 +169,7 @@ export default mixins(showMessage).extend({ this.$data.filter = ""; this.uiStore.openModal(TAGS_MANAGER_MODAL_KEY); } else if (ops === CREATE_KEY) { - this.onCreate(); + void this.onCreate(); } else { setTimeout(() => { if (!this.$data.preventUpdate) { diff --git a/packages/editor-ui/src/components/TagsManager/TagsManager.vue b/packages/editor-ui/src/components/TagsManager/TagsManager.vue index 0094525dfe6c5..193cb15419e1c 100644 --- a/packages/editor-ui/src/components/TagsManager/TagsManager.vue +++ b/packages/editor-ui/src/components/TagsManager/TagsManager.vue @@ -47,7 +47,7 @@ import { useTagsStore } from "@/stores/tags"; export default mixins(showMessage).extend({ name: "TagsManager", created() { - this.tagsStore.fetchAll({force: true, withUsageCount: true}); + void this.tagsStore.fetchAll({force: true, withUsageCount: true}); }, data() { const tagIds = useTagsStore().allTags.map((tag) => tag.id); diff --git a/packages/editor-ui/src/components/Telemetry.vue b/packages/editor-ui/src/components/Telemetry.vue index b700493b68978..c9179715846a9 100644 --- a/packages/editor-ui/src/components/Telemetry.vue +++ b/packages/editor-ui/src/components/Telemetry.vue @@ -53,7 +53,7 @@ export default mixins(externalHooks).extend({ }, ); - this.$externalHooks().run('telemetry.currentUserIdChanged', { + void this.$externalHooks().run('telemetry.currentUserIdChanged', { instanceId: this.rootStore.instanceId, userId: this.currentUserId, }); @@ -69,7 +69,7 @@ export default mixins(externalHooks).extend({ if (this.isTelemetryEnabled) { this.$telemetry.identify(this.rootStore.instanceId, userId); } - this.$externalHooks().run('telemetry.currentUserIdChanged', { + void this.$externalHooks().run('telemetry.currentUserIdChanged', { instanceId: this.rootStore.instanceId, userId, }); diff --git a/packages/editor-ui/src/components/TemplateDetails.vue b/packages/editor-ui/src/components/TemplateDetails.vue index 292136feda32f..2908ef09200e1 100644 --- a/packages/editor-ui/src/components/TemplateDetails.vue +++ b/packages/editor-ui/src/components/TemplateDetails.vue @@ -81,11 +81,11 @@ export default Vue.extend({ filterTemplateNodes, redirectToCategory(id: string) { this.templatesStore.resetSessionId(); - this.$router.push(`/templates?categories=${id}`); + void this.$router.push(`/templates?categories=${id}`); }, redirectToSearchPage(node: ITemplatesNode) { this.templatesStore.resetSessionId(); - this.$router.push(`/templates?search=${node.displayName}`); + void this.$router.push(`/templates?search=${node.displayName}`); }, }, }); diff --git a/packages/editor-ui/src/components/WorkflowCard.vue b/packages/editor-ui/src/components/WorkflowCard.vue index 8b1e185efa764..01300a7f1d59c 100644 --- a/packages/editor-ui/src/components/WorkflowCard.vue +++ b/packages/editor-ui/src/components/WorkflowCard.vue @@ -161,7 +161,7 @@ export default mixins( } } - this.$router.push({ + await this.$router.push({ name: VIEWS.WORKFLOW, params: { name: this.data.id }, }); diff --git a/packages/editor-ui/src/components/WorkflowSettings.vue b/packages/editor-ui/src/components/WorkflowSettings.vue index 77a0820d373d6..cc554da0dd74e 100644 --- a/packages/editor-ui/src/components/WorkflowSettings.vue +++ b/packages/editor-ui/src/components/WorkflowSettings.vue @@ -370,7 +370,7 @@ export default mixins( this.timeoutHMS = this.convertToHMS(workflowSettings.executionTimeout); this.isLoading = false; - this.$externalHooks().run('workflowSettings.dialogVisibleChanged', { dialogVisible: true }); + await this.$externalHooks().run('workflowSettings.dialogVisibleChanged', { dialogVisible: true }); this.$telemetry.track('User opened workflow settings', { workflow_id: this.workflowsStore.workflowId }); }, methods: { @@ -381,7 +381,7 @@ export default mixins( }, closeDialog () { this.modalBus.$emit('close'); - this.$externalHooks().run('workflowSettings.dialogVisibleChanged', { dialogVisible: false }); + void this.$externalHooks().run('workflowSettings.dialogVisibleChanged', { dialogVisible: false }); }, setTimeout (key: string, value: string) { const time = value ? parseInt(value, 10) : 0; @@ -640,7 +640,7 @@ export default mixins( this.closeDialog(); - this.$externalHooks().run('workflowSettings.saveSettings', { oldSettings }); + await this.$externalHooks().run('workflowSettings.saveSettings', { oldSettings }); this.$telemetry.track('User updated workflow settings', { workflow_id: this.workflowsStore.workflowId }); }, toggleTimeout() { diff --git a/packages/editor-ui/src/components/WorkflowShareModal.ee.vue b/packages/editor-ui/src/components/WorkflowShareModal.ee.vue index 343f4f0665509..f61a1e8fd4743 100644 --- a/packages/editor-ui/src/components/WorkflowShareModal.ee.vue +++ b/packages/editor-ui/src/components/WorkflowShareModal.ee.vue @@ -228,7 +228,7 @@ export default mixins( }, onRoleAction(user: IUser, action: string) { if (action === 'remove') { - this.onRemoveSharee(user.id); + void this.onRemoveSharee(user.id); } }, async loadUsers() { @@ -237,7 +237,7 @@ export default mixins( }, mounted() { if (this.isSharingAvailable) { - this.loadUsers(); + void this.loadUsers(); } }, }); diff --git a/packages/editor-ui/src/components/layouts/ResourcesListLayout.vue b/packages/editor-ui/src/components/layouts/ResourcesListLayout.vue index 75720314ade0f..698411216b8ec 100644 --- a/packages/editor-ui/src/components/layouts/ResourcesListLayout.vue +++ b/packages/editor-ui/src/components/layouts/ResourcesListLayout.vue @@ -346,7 +346,7 @@ export default mixins( }, }, mounted() { - this.onMounted(); + void this.onMounted(); }, watch: { isOwnerSubview() { @@ -362,7 +362,7 @@ export default mixins( this.sendFiltersTelemetry('sharedWith'); }, 'filters.search'() { - this.callDebounced('sendFiltersTelemetry', {debounceTime: 1000, trailing: true}, 'search'); + void this.callDebounced('sendFiltersTelemetry', {debounceTime: 1000, trailing: true}, 'search'); }, sortBy() { this.sendSortingTelemetry(); diff --git a/packages/editor-ui/src/components/mixins/pushConnection.ts b/packages/editor-ui/src/components/mixins/pushConnection.ts index 6cca0ab837a14..a50f275682d63 100644 --- a/packages/editor-ui/src/components/mixins/pushConnection.ts +++ b/packages/editor-ui/src/components/mixins/pushConnection.ts @@ -275,7 +275,7 @@ export const pushConnection = mixins( ) { const error = runDataExecuted.data.resultData.error as ExpressionError; - this.getWorkflowDataToSave().then((workflowData) => { + void this.getWorkflowDataToSave().then((workflowData) => { const eventData: IDataObject = { caused_by_credential: false, error_message: error.description, @@ -389,7 +389,7 @@ export const pushConnection = mixins( itemsCount = runDataExecuted.data.resultData.runData[lastNodeExecuted as string][0].data!.main[0]!.length; } - this.$externalHooks().run('pushConnection.executionFinished', { + void this.$externalHooks().run('pushConnection.executionFinished', { itemsCount, nodeName: runDataExecuted.data.resultData.lastNodeExecuted, errorMessage: runDataExecutedErrorMessage, @@ -438,15 +438,15 @@ export const pushConnection = mixins( this.processWaitingPushMessages(); } else if (receivedData.type === 'reloadNodeType') { - this.nodeTypesStore.getNodeTypes(); - this.nodeTypesStore.getFullNodesProperties([receivedData.data]); + void this.nodeTypesStore.getNodeTypes(); + void this.nodeTypesStore.getFullNodesProperties([receivedData.data]); } else if (receivedData.type === 'removeNodeType') { const pushData = receivedData.data; const nodesToBeRemoved: INodeTypeNameVersion[] = [pushData]; // Force reload of all credential types - this.credentialsStore.fetchCredentialTypes() + void this.credentialsStore.fetchCredentialTypes() .then(() => { this.nodeTypesStore.removeNodeTypes(nodesToBeRemoved); }); diff --git a/packages/editor-ui/src/components/mixins/showMessage.ts b/packages/editor-ui/src/components/mixins/showMessage.ts index e1d59a411dbbc..70f59d240b865 100644 --- a/packages/editor-ui/src/components/mixins/showMessage.ts +++ b/packages/editor-ui/src/components/mixins/showMessage.ts @@ -130,7 +130,7 @@ export const showMessage = mixins(externalHooks).extend({ duration: 0, }, false); - this.$externalHooks().run('showMessage.showError', { + void this.$externalHooks().run('showMessage.showError', { title, message, errorMessage: error.message, diff --git a/packages/editor-ui/src/components/mixins/workflowActivate.ts b/packages/editor-ui/src/components/mixins/workflowActivate.ts index 5133aaee5a478..55a11353d55f3 100644 --- a/packages/editor-ui/src/components/mixins/workflowActivate.ts +++ b/packages/editor-ui/src/components/mixins/workflowActivate.ts @@ -58,7 +58,7 @@ export const workflowActivate = mixins( ndv_input: telemetrySource === 'ndv', }; this.$telemetry.track('User set workflow active status', telemetryPayload); - this.$externalHooks().run('workflowActivate.updateWorkflowActivation', telemetryPayload); + await this.$externalHooks().run('workflowActivate.updateWorkflowActivation', telemetryPayload); try { if (isWorkflowActive && newActiveState) { @@ -97,7 +97,7 @@ export const workflowActivate = mixins( } const activationEventName = isCurrentWorkflow ? 'workflow.activeChangeCurrent' : 'workflow.activeChange'; - this.$externalHooks().run(activationEventName, { workflowId: currWorkflowId, active: newActiveState }); + await this.$externalHooks().run(activationEventName, { workflowId: currWorkflowId, active: newActiveState }); this.$emit('workflowActiveChanged', { id: currWorkflowId, active: newActiveState }); this.updatingWorkflowActivation = false; @@ -107,7 +107,7 @@ export const workflowActivate = mixins( this.uiStore.openModal(WORKFLOW_ACTIVE_MODAL_KEY); } else { - this.settingsStore.fetchPromptsData(); + await this.settingsStore.fetchPromptsData(); } } }, diff --git a/packages/editor-ui/src/components/mixins/workflowHelpers.ts b/packages/editor-ui/src/components/mixins/workflowHelpers.ts index 8ae4973da2395..b48e3e6f5593a 100644 --- a/packages/editor-ui/src/components/mixins/workflowHelpers.ts +++ b/packages/editor-ui/src/components/mixins/workflowHelpers.ts @@ -741,7 +741,7 @@ export const workflowHelpers = mixins( this.uiStore.stateIsDirty = false; this.uiStore.removeActiveAction('workflowSaving'); - this.$externalHooks().run('workflow.afterUpdate', { workflowData }); + await this.$externalHooks().run('workflow.afterUpdate', { workflowData }); return true; } catch (error) { @@ -831,7 +831,7 @@ export const workflowHelpers = mixins( } if (redirect) { - this.$router.replace({ + await this.$router.replace({ name: VIEWS.WORKFLOW, params: { name: workflowData.id as string, action: 'workflowSave' }, }); @@ -839,7 +839,7 @@ export const workflowHelpers = mixins( this.uiStore.removeActiveAction('workflowSaving'); this.uiStore.stateIsDirty = false; - this.$externalHooks().run('workflow.afterUpdate', { workflowData }); + await this.$externalHooks().run('workflow.afterUpdate', { workflowData }); return true; } catch (e) { diff --git a/packages/editor-ui/src/components/mixins/workflowRun.ts b/packages/editor-ui/src/components/mixins/workflowRun.ts index 9275898c37f06..b39297b8485d8 100644 --- a/packages/editor-ui/src/components/mixins/workflowRun.ts +++ b/packages/editor-ui/src/components/mixins/workflowRun.ts @@ -127,9 +127,9 @@ export const workflowRun = mixins( duration: 0, }); this.$titleSet(workflow.name as string, 'ERROR'); - this.$externalHooks().run('workflowRun.runError', { errorMessages, nodeName }); + await this.$externalHooks().run('workflowRun.runError', { errorMessages, nodeName }); - this.getWorkflowDataToSave().then((workflowData) => { + await this.getWorkflowDataToSave().then((workflowData) => { this.$telemetry.track('Workflow execution preflight failed', { workflow_id: workflow.id, workflow_name: workflow.name, @@ -243,7 +243,7 @@ export const workflowRun = mixins( const runWorkflowApiResponse = await this.runWorkflowApi(startRunData); - this.$externalHooks().run('workflowRun.runWorkflow', { nodeName, source }); + await this.$externalHooks().run('workflowRun.runWorkflow', { nodeName, source }); return runWorkflowApiResponse; } catch (error) { diff --git a/packages/editor-ui/src/main.ts b/packages/editor-ui/src/main.ts index 3c3bea0a38029..573f151b6eb89 100644 --- a/packages/editor-ui/src/main.ts +++ b/packages/editor-ui/src/main.ts @@ -42,7 +42,7 @@ new Vue({ }).$mount('#app'); router.afterEach((to, from) => { - runExternalHook('main.routeChange', useWebhooksStore(), { from, to }); + void runExternalHook('main.routeChange', useWebhooksStore(), { from, to }); }); if (import.meta.env.NODE_ENV !== 'production') { diff --git a/packages/editor-ui/src/stores/credentials.ts b/packages/editor-ui/src/stores/credentials.ts index 96410f3dd9937..232eb645d8c71 100644 --- a/packages/editor-ui/src/stores/credentials.ts +++ b/packages/editor-ui/src/stores/credentials.ts @@ -183,7 +183,7 @@ export const useCredentialsStore = defineStore(STORES.CREDENTIALS, { const usersStore = useUsersStore(); if (data.sharedWith && data.ownedBy.id === usersStore.currentUserId) { - this.setCredentialSharedWith({ + await this.setCredentialSharedWith({ credentialId: credential.id, sharedWith: data.sharedWith, }); @@ -211,7 +211,7 @@ export const useCredentialsStore = defineStore(STORES.CREDENTIALS, { const usersStore = useUsersStore(); if (data.sharedWith && data.ownedBy.id === usersStore.currentUserId) { - this.setCredentialSharedWith({ + await this.setCredentialSharedWith({ credentialId: credential.id, sharedWith: data.sharedWith, }); diff --git a/packages/editor-ui/src/stores/nodeTypes.ts b/packages/editor-ui/src/stores/nodeTypes.ts index e3dd396a249fb..35642f2fe0c43 100644 --- a/packages/editor-ui/src/stores/nodeTypes.ts +++ b/packages/editor-ui/src/stores/nodeTypes.ts @@ -116,7 +116,7 @@ export const useNodeTypesStore = defineStore(STORES.NODE_TYPES, { }, async getFullNodesProperties(nodesToBeFetched: INodeTypeNameVersion[]): Promise { const credentialsStore = useCredentialsStore(); - credentialsStore.fetchCredentialTypes(true); + await credentialsStore.fetchCredentialTypes(true); await this.getNodesInformation(nodesToBeFetched); }, async getNodeTypes(): Promise { diff --git a/packages/editor-ui/src/stores/settings.ts b/packages/editor-ui/src/stores/settings.ts index f1d1243fdf89f..2400dabc07f83 100644 --- a/packages/editor-ui/src/stores/settings.ts +++ b/packages/editor-ui/src/stores/settings.ts @@ -168,7 +168,7 @@ export const useSettingsStore = defineStore(STORES.SETTINGS, { }, async fetchPromptsData(): Promise { if (!this.isTelemetryEnabled) { - Promise.resolve(); + await Promise.resolve(); } try { const uiStore = useUIStore(); @@ -182,9 +182,9 @@ export const useSettingsStore = defineStore(STORES.SETTINGS, { } this.setPromptsData(promptsData); - Promise.resolve(); + await Promise.resolve(); } catch (error) { - Promise.reject(error); + await Promise.reject(error); } }, async submitContactInfo(email: string): Promise { diff --git a/packages/editor-ui/src/views/CredentialsView.vue b/packages/editor-ui/src/views/CredentialsView.vue index d8a716348f27d..ebc73c84df887 100644 --- a/packages/editor-ui/src/views/CredentialsView.vue +++ b/packages/editor-ui/src/views/CredentialsView.vue @@ -130,7 +130,7 @@ export default mixins( await Promise.all(loadPromises); - this.usersStore.fetchUsers(); // Can be loaded in the background, used for filtering + await this.usersStore.fetchUsers(); // Can be loaded in the background, used for filtering }, onFilter(resource: ICredentialsResponse, filters: { type: string[]; search: string; }, matches: boolean): boolean { if (filters.type.length > 0) { diff --git a/packages/editor-ui/src/views/ErrorView.vue b/packages/editor-ui/src/views/ErrorView.vue index 62a19fcd9612c..1e8fa9595b591 100644 --- a/packages/editor-ui/src/views/ErrorView.vue +++ b/packages/editor-ui/src/views/ErrorView.vue @@ -42,7 +42,7 @@ export default Vue.extend({ }, methods: { onButtonClick() { - this.$router.push({ name: this.redirectPage }); + void this.$router.push({ name: this.redirectPage }); }, }, }); diff --git a/packages/editor-ui/src/views/NodeView.vue b/packages/editor-ui/src/views/NodeView.vue index 82c7566ed1caf..83c9f5f24b5e1 100644 --- a/packages/editor-ui/src/views/NodeView.vue +++ b/packages/editor-ui/src/views/NodeView.vue @@ -293,10 +293,10 @@ export default mixins( this.startLoading(); if (nodeViewNotInitialized) { const previousDirtyState = this.uiStore.stateIsDirty; - this.resetWorkspace(); + void this.resetWorkspace(); this.uiStore.stateIsDirty = previousDirtyState; } - this.initView().then(() => { + void this.initView().then(() => { this.stopLoading(); if (this.blankRedirect) { this.blankRedirect = false; @@ -320,7 +320,7 @@ export default mixins( containsTrigger(containsTrigger) { // Re-center CanvasAddButton if there's no triggers if (containsTrigger === false) this.canvasStore.setRecenteredCanvasAddButtonPosition(this.getNodeViewOffsetPosition); - else this.tryToAddWelcomeSticky(); + else void this.tryToAddWelcomeSticky(); }, nodeViewScale(newScale) { const element = this.$refs.nodeView as HTMLDivElement; @@ -363,7 +363,7 @@ export default mixins( // We can't use next() here since vue-router // would prevent the navigation with an error - this.$router.push(to as RawLocation); + void this.$router.push(to as RawLocation); }); } else { next(); @@ -539,7 +539,7 @@ export default mixins( }; }, beforeDestroy() { - this.resetWorkspace(); + void this.resetWorkspace(); // Make sure the event listeners get removed again else we // could add up with them registred multiple times document.removeEventListener('keydown', this.keyDown); @@ -558,17 +558,17 @@ export default mixins( source: 'canvas', }; this.$telemetry.track('User clicked execute node button', telemetryPayload); - this.$externalHooks().run('nodeView.onRunNode', telemetryPayload); - this.runWorkflow(nodeName, source); + void this.$externalHooks().run('nodeView.onRunNode', telemetryPayload); + void this.runWorkflow(nodeName, source); }, async onRunWorkflow() { - this.getWorkflowDataToSave().then((workflowData) => { + await this.getWorkflowDataToSave().then((workflowData) => { const telemetryPayload = { workflow_id: this.workflowsStore.workflowId, node_graph_string: JSON.stringify(TelemetryHelpers.generateNodesGraph(workflowData as IWorkflowBase, this.getNodeTypes()).nodeGraph), }; this.$telemetry.track('User clicked execute workflow button', telemetryPayload); - this.$externalHooks().run('nodeView.onRunWorkflow', telemetryPayload); + void this.$externalHooks().run('nodeView.onRunWorkflow', telemetryPayload); }); @@ -680,7 +680,7 @@ export default mixins( }, async openExecution(executionId: string) { this.startLoading(); - this.resetWorkspace(); + await this.resetWorkspace(); let data: IExecutionResponse | undefined; try { data = await this.restApi().getExecution(executionId); @@ -706,7 +706,7 @@ export default mixins( this.canvasStore.zoomToFit(); this.uiStore.stateIsDirty = false; }); - this.$externalHooks().run('execution.open', { workflowId: data.workflowData.id, workflowName: data.workflowData.name, executionId }); + await this.$externalHooks().run('execution.open', { workflowId: data.workflowData.id, workflowName: data.workflowData.name, executionId }); this.$telemetry.track('User opened read-only execution', { workflow_id: data.workflowData.id, execution_mode: data.mode, execution_finished: data.finished }); if (!data.finished && data.data?.resultData?.error) { @@ -746,7 +746,7 @@ export default mixins( if (!data.workflow.nodes || !data.workflow.connections) { throw new Error('Invalid workflow object'); } - this.resetWorkspace(); + await this.resetWorkspace(); data.workflow.nodes = CanvasHelpers.getFixedNodesList(data.workflow.nodes); await this.addNodes(data.workflow.nodes as INodeUi[], data.workflow.connections); @@ -762,14 +762,14 @@ export default mixins( async openWorkflowTemplate(templateId: string) { this.startLoading(); this.setLoadingText(this.$locale.baseText('nodeView.loadingTemplate')); - this.resetWorkspace(); + await this.resetWorkspace(); this.workflowsStore.currentWorkflowExecutions = []; this.workflowsStore.activeWorkflowExecution = null; let data: IWorkflowTemplate | undefined; try { - this.$externalHooks().run('template.requested', { templateId }); + await this.$externalHooks().run('template.requested', { templateId }); data = await this.templatesStore.getWorkflowTemplate(templateId); if (!data) { @@ -782,14 +782,14 @@ export default mixins( } } catch (error) { this.$showError(error, this.$locale.baseText('nodeView.couldntImportWorkflow')); - this.$router.replace({ name: VIEWS.NEW_WORKFLOW }); + await this.$router.replace({ name: VIEWS.NEW_WORKFLOW }); return; } data.workflow.nodes = CanvasHelpers.getFixedNodesList(data.workflow.nodes) as INodeUi[]; this.blankRedirect = true; - this.$router.replace({ name: VIEWS.NEW_WORKFLOW, query: { templateId } }); + await this.$router.replace({ name: VIEWS.NEW_WORKFLOW, query: { templateId } }); await this.addNodes(data.workflow.nodes, data.workflow.connections); this.workflowData = await this.workflowsStore.getNewWorkflowData(data.name) || {}; @@ -798,12 +798,12 @@ export default mixins( this.uiStore.stateIsDirty = true; }); - this.$externalHooks().run('template.open', { templateId, templateName: data.name, workflow: data.workflow }); + await this.$externalHooks().run('template.open', { templateId, templateName: data.name, workflow: data.workflow }); this.stopLoading(); }, async openWorkflow(workflowId: string) { this.startLoading(); - this.resetWorkspace(); + await this.resetWorkspace(); let data: IWorkflowDb | undefined; try { data = await this.restApi().getWorkflow(workflowId); @@ -861,7 +861,7 @@ export default mixins( this.uiStore.stateIsDirty = false; } this.canvasStore.zoomToFit(); - this.$externalHooks().run('workflow.open', { workflowId, workflowName: data.name }); + await this.$externalHooks().run('workflow.open', { workflowId, workflowName: data.name }); this.workflowsStore.activeWorkflowExecution = null; this.stopLoading(); return data; @@ -912,7 +912,7 @@ export default mixins( if (e.key === 'Escape') { this.createNodeActive = false; if (this.activeNode) { - this.$externalHooks().run('dataDisplay.nodeEditingFinished'); + await this.$externalHooks().run('dataDisplay.nodeEditingFinished'); this.ndvStore.activeNodeName = null; } @@ -925,13 +925,13 @@ export default mixins( } if (e.key === 'd') { - this.callDebounced('deactivateSelectedNode', { debounceTime: 350 }); + await this.callDebounced('deactivateSelectedNode', { debounceTime: 350 }); } else if (e.key === 'Delete' || e.key === 'Backspace') { e.stopPropagation(); e.preventDefault(); - this.callDebounced('deleteSelectedNodes', { debounceTime: 500 }); + await this.callDebounced('deleteSelectedNodes', { debounceTime: 500 }); } else if (e.key === 'Tab') { this.onToggleNodeCreator({ source: 'tab', createNodeActive: !this.createNodeActive && !this.isReadOnly }); @@ -940,22 +940,22 @@ export default mixins( } else if (e.key === 'F2' && !this.isReadOnly) { const lastSelectedNode = this.lastSelectedNode; if (lastSelectedNode !== null && lastSelectedNode.type !== STICKY_NODE_TYPE) { - this.callDebounced('renameNodePrompt', { debounceTime: 1500 }, lastSelectedNode.name); + await this.callDebounced('renameNodePrompt', { debounceTime: 1500 }, lastSelectedNode.name); } } else if ((e.key === 'a') && (this.isCtrlKeyPressed(e) === true)) { // Select all nodes e.stopPropagation(); e.preventDefault(); - this.callDebounced('selectAllNodes', { debounceTime: 1000 }); + await this.callDebounced('selectAllNodes', { debounceTime: 1000 }); } else if ((e.key === 'c') && this.isCtrlKeyPressed(e)) { - this.callDebounced('copySelectedNodes', { debounceTime: 1000 }); + await this.callDebounced('copySelectedNodes', { debounceTime: 1000 }); } else if ((e.key === 'x') && this.isCtrlKeyPressed(e)) { // Cut nodes e.stopPropagation(); e.preventDefault(); - this.callDebounced('cutSelectedNodes', { debounceTime: 1000 }); + await this.callDebounced('cutSelectedNodes', { debounceTime: 1000 }); } else if (e.key === 'n' && this.isCtrlKeyPressed(e) && e.altKey) { // Create a new workflow e.stopPropagation(); @@ -967,7 +967,7 @@ export default mixins( if (this.$router.currentRoute.name === VIEWS.NEW_WORKFLOW) { this.$root.$emit('newWorkflow'); } else { - this.$router.push({ name: VIEWS.NEW_WORKFLOW }); + await this.$router.push({ name: VIEWS.NEW_WORKFLOW }); } this.$showMessage({ @@ -983,7 +983,7 @@ export default mixins( return; } - this.callDebounced('onSaveKeyboardShortcut', { debounceTime: 1000 }); + await this.callDebounced('onSaveKeyboardShortcut', { debounceTime: 1000 }); } else if (e.key === 'Enter') { // Activate the last selected node const lastSelectedNode = this.lastSelectedNode; @@ -999,7 +999,7 @@ export default mixins( e.stopPropagation(); e.preventDefault(); - this.callDebounced('selectDownstreamNodes', { debounceTime: 1000 }); + await this.callDebounced('selectDownstreamNodes', { debounceTime: 1000 }); } else if (e.key === 'ArrowRight') { // Set child node active const lastSelectedNode = this.lastSelectedNode; @@ -1013,13 +1013,13 @@ export default mixins( return; } - this.callDebounced('nodeSelectedByName', { debounceTime: 100 }, connections.main[0][0].node, false, true); + await this.callDebounced('nodeSelectedByName', { debounceTime: 100 }, connections.main[0][0].node, false, true); } else if (e.key === 'ArrowLeft' && e.shiftKey) { // Select all downstream nodes e.stopPropagation(); e.preventDefault(); - this.callDebounced('selectUpstreamNodes', { debounceTime: 1000 }); + await this.callDebounced('selectUpstreamNodes', { debounceTime: 1000 }); } else if (e.key === 'ArrowLeft') { // Set parent node active const lastSelectedNode = this.lastSelectedNode; @@ -1039,7 +1039,7 @@ export default mixins( return; } - this.callDebounced('nodeSelectedByName', { debounceTime: 100 }, connections.main[0][0].node, false, true); + await this.callDebounced('nodeSelectedByName', { debounceTime: 100 }, connections.main[0][0].node, false, true); } else if (['ArrowUp', 'ArrowDown'].includes(e.key)) { // Set sibling node as active @@ -1099,7 +1099,7 @@ export default mixins( } if (nextSelectNode !== null) { - this.callDebounced('nodeSelectedByName', { debounceTime: 100 }, nextSelectNode, false, true); + await this.callDebounced('nodeSelectedByName', { debounceTime: 100 }, nextSelectNode, false, true); } } }, @@ -1196,7 +1196,7 @@ export default mixins( }, copySelectedNodes(isCut: boolean) { - this.getSelectedNodesToSave().then((data) => { + void this.getSelectedNodesToSave().then((data) => { const workflowToCopy: IWorkflowToShare = { meta: { instanceId: this.rootStore.instanceId, @@ -1269,7 +1269,7 @@ export default mixins( } this.stopExecutionInProgress = false; - this.getWorkflowDataToSave().then((workflowData) => { + await this.getWorkflowDataToSave().then((workflowData) => { const trackProps = { workflow_id: this.workflowsStore.workflowId, node_graph_string: JSON.stringify(TelemetryHelpers.generateNodesGraph(workflowData as IWorkflowBase, this.getNodeTypes()).nodeGraph), @@ -1486,7 +1486,7 @@ export default mixins( if (nodeTypeName) { const mousePosition = this.getMousePositionWithinNodeView(event); - this.addNode(nodeTypeName, { + void this.addNode(nodeTypeName, { position: [ mousePosition[0] - CanvasHelpers.NODE_SIZE / 2, mousePosition[1] - CanvasHelpers.NODE_SIZE / 2, @@ -1697,7 +1697,7 @@ export default mixins( if (nodeTypeName === STICKY_NODE_TYPE) { this.$telemetry.trackNodesPanel('nodeView.addSticky', { workflow_id: this.workflowsStore.workflowId }); } else { - this.$externalHooks().run('nodeView.addNodeButton', { nodeTypeName }); + void this.$externalHooks().run('nodeView.addNodeButton', { nodeTypeName }); const trackProperties: ITelemetryTrackProperties = { node_type: nodeTypeName, workflow_id: this.workflowsStore.workflowId, @@ -2208,7 +2208,7 @@ export default mixins( if (workflowId !== null) { const workflow = await this.restApi().getWorkflow(workflowId); if (!workflow) { - this.$router.push({ + void this.$router.push({ name: VIEWS.NEW_WORKFLOW, }); this.$showMessage({ @@ -2584,7 +2584,7 @@ export default mixins( }, ); } else { - this.$externalHooks().run('node.deleteNode', { node }); + void this.$externalHooks().run('node.deleteNode', { node }); this.$telemetry.track('User deleted node', { node_type: node.type, workflow_id: this.workflowsStore.workflowId }); } @@ -2645,7 +2645,7 @@ export default mixins( if (parameterData.name === 'name' && parameterData.oldValue) { // The name changed so we have to take care that // the connections get changed. - this.renameNode(parameterData.oldValue as string, parameterData.value as string); + void this.renameNode(parameterData.oldValue as string, parameterData.value as string); } }, async renameNodePrompt(currentName: string) { @@ -2674,7 +2674,7 @@ export default mixins( const promptResponse = await promptResponsePromise as MessageBoxInputData; - this.renameNode(currentName, promptResponse.value); + await this.renameNode(currentName, promptResponse.value); } catch (e) { } }, async renameNode(currentName: string, newName: string) { @@ -3234,11 +3234,11 @@ export default mixins( } this.createNodeActive = createNodeActive; - this.$externalHooks().run('nodeView.createNodeActiveChanged', { source, createNodeActive }); + void this.$externalHooks().run('nodeView.createNodeActiveChanged', { source, createNodeActive }); this.$telemetry.trackNodesPanel('nodeView.createNodeActiveChanged', { source, createNodeActive, workflow_id: this.workflowsStore.workflowId }); }, onAddNode({ nodeTypeName, position }: { nodeTypeName: string; position?: [number, number] }) { - this.addNode(nodeTypeName, { position }); + void this.addNode(nodeTypeName, { position }); }, async saveCurrentWorkflowExternal(callback: () => void) { await this.saveCurrentWorkflow(); @@ -3250,7 +3250,7 @@ export default mixins( window.addEventListener('message', this.onPostMessageReceived); this.startLoading(); - this.resetWorkspace(); + await this.resetWorkspace(); const loadPromises = [ this.loadActiveWorkflows(), @@ -3292,8 +3292,8 @@ export default mixins( this.stopLoading(); setTimeout(() => { - this.usersStore.showPersonalizationSurvey(); - this.checkForNewVersions(); + void this.usersStore.showPersonalizationSurvey(); + void this.checkForNewVersions(); this.addPinDataConnections(this.workflowsStore.getPinData || {} as IPinData); }, 0); }); @@ -3367,7 +3367,7 @@ export default mixins( nodeViewEventBus.$off('saveWorkflow', this.saveCurrentWorkflowExternal); }, destroyed() { - this.resetWorkspace(); + void this.resetWorkspace(); this.uiStore.stateIsDirty = false; window.removeEventListener('message', this.onPostMessageReceived); this.$root.$off('newWorkflow', this.newWorkflow); diff --git a/packages/editor-ui/src/views/SettingsApiView.vue b/packages/editor-ui/src/views/SettingsApiView.vue index b1e7ee3d16e33..33532c695f09c 100644 --- a/packages/editor-ui/src/views/SettingsApiView.vue +++ b/packages/editor-ui/src/views/SettingsApiView.vue @@ -91,7 +91,7 @@ export default mixins( }; }, mounted() { - this.getApiKey(); + void this.getApiKey(); const baseUrl = this.rootStore.baseUrl; const apiPath = this.settingsStore.publicApiPath; const latestVersion = this.settingsStore.publicApiLatestVersion; @@ -117,7 +117,7 @@ export default mixins( this.$locale.baseText('generic.cancel'), ); if (confirmed) { - this.deleteApiKey(); + await this.deleteApiKey(); } }, async getApiKey() { diff --git a/packages/editor-ui/src/views/SettingsCommunityNodesView.vue b/packages/editor-ui/src/views/SettingsCommunityNodesView.vue index 08bcf66197a1a..ff35b38db707e 100644 --- a/packages/editor-ui/src/views/SettingsCommunityNodesView.vue +++ b/packages/editor-ui/src/views/SettingsCommunityNodesView.vue @@ -194,7 +194,7 @@ export default mixins( openInstallModal(event: MouseEvent) { const telemetryPayload = { is_empty_state: this.communityNodesStore.getInstalledPackages.length === 0 }; this.$telemetry.track('user clicked cnr install button', telemetryPayload); - this.$externalHooks().run('settingsCommunityNodesView.openInstallModal', telemetryPayload); + void this.$externalHooks().run('settingsCommunityNodesView.openInstallModal', telemetryPayload); this.uiStore.openModal(COMMUNITY_PACKAGE_INSTALL_MODAL_KEY); }, }, diff --git a/packages/editor-ui/src/views/SettingsUsersView.vue b/packages/editor-ui/src/views/SettingsUsersView.vue index ff0beaa90783d..82bde83fc8af4 100644 --- a/packages/editor-ui/src/views/SettingsUsersView.vue +++ b/packages/editor-ui/src/views/SettingsUsersView.vue @@ -69,7 +69,7 @@ export default mixins(showMessage).extend({ }, methods: { redirectToSetup() { - this.$router.push({name: VIEWS.SETUP}); + void this.$router.push({name: VIEWS.SETUP}); }, onInvite() { this.uiStore.openModal(INVITE_USER_MODAL_KEY); diff --git a/packages/editor-ui/src/views/SettingsView.vue b/packages/editor-ui/src/views/SettingsView.vue index 43002ecc214f3..0f2526c44aed4 100644 --- a/packages/editor-ui/src/views/SettingsView.vue +++ b/packages/editor-ui/src/views/SettingsView.vue @@ -37,7 +37,7 @@ const SettingsView = defineComponent({ }, methods: { onReturn() { - this.$router.push(this.previousRoute ? this.previousRoute.path : { name: VIEWS.HOMEPAGE }); + void this.$router.push(this.previousRoute ? this.previousRoute.path : { name: VIEWS.HOMEPAGE }); }, }, }); diff --git a/packages/editor-ui/src/views/SetupView.vue b/packages/editor-ui/src/views/SetupView.vue index 16fd70131da72..86e12f2a50c28 100644 --- a/packages/editor-ui/src/views/SetupView.vue +++ b/packages/editor-ui/src/views/SetupView.vue @@ -193,8 +193,8 @@ export default mixins( } }, onSkip() { - this.usersStore.skipOwnerSetup(); - this.$router.push({ + void this.usersStore.skipOwnerSetup(); + void this.$router.push({ name: VIEWS.HOMEPAGE, }); }, diff --git a/packages/editor-ui/src/views/SigninView.vue b/packages/editor-ui/src/views/SigninView.vue index 1eb70e058125c..8c5a22f0d2453 100644 --- a/packages/editor-ui/src/views/SigninView.vue +++ b/packages/editor-ui/src/views/SigninView.vue @@ -78,13 +78,13 @@ export default mixins( if (typeof this.$route.query.redirect === 'string') { const redirect = decodeURIComponent(this.$route.query.redirect); if (redirect.startsWith('/')) { // protect against phishing - this.$router.push(redirect); + await this.$router.push(redirect); return; } } - this.$router.push({ name: VIEWS.HOMEPAGE }); + await this.$router.push({ name: VIEWS.HOMEPAGE }); } catch (error) { this.$showError(error, this.$locale.baseText('auth.signin.error')); this.loading = false; diff --git a/packages/editor-ui/src/views/SignupView.vue b/packages/editor-ui/src/views/SignupView.vue index 9f03b39457714..1c30e95b16f1e 100644 --- a/packages/editor-ui/src/views/SignupView.vue +++ b/packages/editor-ui/src/views/SignupView.vue @@ -93,7 +93,7 @@ export default mixins( this.inviter = invite.inviter as {firstName: string, lastName: string}; } catch (e) { this.$showError(e, this.$locale.baseText('auth.signup.tokenValidationError')); - this.$router.replace({name: VIEWS.SIGNIN}); + void this.$router.replace({name: VIEWS.SIGNIN}); } }, computed: { diff --git a/packages/editor-ui/src/views/TemplatesCollectionView.vue b/packages/editor-ui/src/views/TemplatesCollectionView.vue index 2340d93b30f1c..ae71c9761f65b 100644 --- a/packages/editor-ui/src/views/TemplatesCollectionView.vue +++ b/packages/editor-ui/src/views/TemplatesCollectionView.vue @@ -119,7 +119,7 @@ export default mixins(workflowHelpers).extend({ wf_template_repo_session_id: this.workflowsStore.currentSessionId, source: 'collection', }; - this.$externalHooks().run('templatesCollectionView.onUseWorkflow', telemetryPayload); + void this.$externalHooks().run('templatesCollectionView.onUseWorkflow', telemetryPayload); this.$telemetry.track('User inserted workflow template', telemetryPayload); this.navigateTo(event, VIEWS.TEMPLATE_IMPORT, id); @@ -130,7 +130,7 @@ export default mixins(workflowHelpers).extend({ window.open(route.href, '_blank'); return; } else { - this.$router.push({ name: page, params: { id } }); + void this.$router.push({ name: page, params: { id } }); } }, }, diff --git a/packages/editor-ui/src/views/TemplatesSearchView.vue b/packages/editor-ui/src/views/TemplatesSearchView.vue index 95a579b5e7755..7fdaed75431e6 100644 --- a/packages/editor-ui/src/views/TemplatesSearchView.vue +++ b/packages/editor-ui/src/views/TemplatesSearchView.vue @@ -180,12 +180,12 @@ export default mixins(genericHelpers, debounceHelper).extend({ window.open(route.href, '_blank'); return; } else { - this.$router.push({ name: page, params: { id } }); + void this.$router.push({ name: page, params: { id } }); } }, updateSearch() { this.updateQueryParam(this.search, this.categories.join(',')); - this.loadWorkflowsAndCollections(false); + void this.loadWorkflowsAndCollections(false); }, updateSearchTracking(search: string, categories: number[]) { if (!search) { @@ -213,13 +213,13 @@ export default mixins(genericHelpers, debounceHelper).extend({ }, openNewWorkflow() { this.uiStore.nodeViewInitialized = false; - this.$router.push({ name: VIEWS.NEW_WORKFLOW }); + void this.$router.push({ name: VIEWS.NEW_WORKFLOW }); }, onSearchInput(search: string) { this.loadingWorkflows = true; this.loadingCollections = true; this.search = search; - this.callDebounced('updateSearch', { debounceTime: 500, trailing: true }); + void this.callDebounced('updateSearch', { debounceTime: 500, trailing: true }); if (search.length === 0) { this.trackSearch(); @@ -265,7 +265,7 @@ export default mixins(genericHelpers, debounceHelper).extend({ delete query.search; } - this.$router.replace({ query }); + void this.$router.replace({ query }); }, async onLoadMore() { if (this.workflows.length >= this.totalWorkflows) { @@ -360,9 +360,9 @@ export default mixins(genericHelpers, debounceHelper).extend({ }, async mounted() { setPageTitle('n8n - Templates'); - this.loadCategories(); - this.loadWorkflowsAndCollections(true); - this.usersStore.showPersonalizationSurvey(); + void this.loadCategories(); + void this.loadWorkflowsAndCollections(true); + void this.usersStore.showPersonalizationSurvey(); setTimeout(() => { // Check if there is scroll position saved in route and scroll to it diff --git a/packages/editor-ui/src/views/TemplatesWorkflowView.vue b/packages/editor-ui/src/views/TemplatesWorkflowView.vue index 5f391b4041e13..fc3cdcb328b35 100644 --- a/packages/editor-ui/src/views/TemplatesWorkflowView.vue +++ b/packages/editor-ui/src/views/TemplatesWorkflowView.vue @@ -100,7 +100,7 @@ export default mixins(workflowHelpers).extend({ wf_template_repo_session_id: this.templatesStore.currentSessionId, }; - this.$externalHooks().run('templatesWorkflowView.openWorkflow', telemetryPayload); + void this.$externalHooks().run('templatesWorkflowView.openWorkflow', telemetryPayload); this.$telemetry.track('User inserted workflow template', telemetryPayload); if (e.metaKey || e.ctrlKey) { @@ -108,7 +108,7 @@ export default mixins(workflowHelpers).extend({ window.open(route.href, '_blank'); return; } else { - this.$router.push({ name: VIEWS.TEMPLATE_IMPORT, params: { id } }); + void this.$router.push({ name: VIEWS.TEMPLATE_IMPORT, params: { id } }); } }, onHidePreview() { diff --git a/packages/editor-ui/src/views/WorkflowsView.vue b/packages/editor-ui/src/views/WorkflowsView.vue index f7e151d384df1..275266e532512 100644 --- a/packages/editor-ui/src/views/WorkflowsView.vue +++ b/packages/editor-ui/src/views/WorkflowsView.vue @@ -125,17 +125,17 @@ export default mixins( methods: { addWorkflow() { this.uiStore.nodeViewInitialized = false; - this.$router.push({ name: VIEWS.NEW_WORKFLOW }); + void this.$router.push({ name: VIEWS.NEW_WORKFLOW }); this.$telemetry.track('User clicked add workflow button', { source: 'Workflows list', }); }, goToTemplates() { - this.$router.push({ name: VIEWS.TEMPLATES }); + void this.$router.push({ name: VIEWS.TEMPLATES }); }, async initialize() { - this.usersStore.fetchUsers(); // Can be loaded in the background, used for filtering + await this.usersStore.fetchUsers(); // Can be loaded in the background, used for filtering return await Promise.all([ this.workflowsStore.fetchAllWorkflows(), @@ -166,7 +166,7 @@ export default mixins( }, }, mounted() { - this.usersStore.showPersonalizationSurvey(); + void this.usersStore.showPersonalizationSurvey(); }, }); diff --git a/packages/nodes-base/.eslintrc.js b/packages/nodes-base/.eslintrc.js index 59062ee8fa0d5..cbb5edbc4f6e2 100644 --- a/packages/nodes-base/.eslintrc.js +++ b/packages/nodes-base/.eslintrc.js @@ -29,7 +29,6 @@ module.exports = { '@typescript-eslint/no-duplicate-imports': 'off', '@typescript-eslint/no-empty-interface': 'off', '@typescript-eslint/no-explicit-any': 'off', - '@typescript-eslint/no-floating-promises': 'off', '@typescript-eslint/no-for-in-array': 'off', '@typescript-eslint/no-invalid-void-type': 'off', '@typescript-eslint/no-loop-func': 'off', diff --git a/packages/nodes-base/nodes/Asana/Asana.node.ts b/packages/nodes-base/nodes/Asana/Asana.node.ts index be65f8ac6e34d..673a184cb42b2 100644 --- a/packages/nodes-base/nodes/Asana/Asana.node.ts +++ b/packages/nodes-base/nodes/Asana/Asana.node.ts @@ -2315,7 +2315,7 @@ export class Asana implements INodeType { endpoint = `/projects/${projectId}`; - asanaApiRequest.call(this, requestMethod, endpoint, body, qs); + await asanaApiRequest.call(this, requestMethod, endpoint, body, qs); responseData = { success: true }; } @@ -2410,10 +2410,9 @@ export class Asana implements INodeType { } returnData.push( - ...this.helpers.constructExecutionMetaData( - this.helpers.returnJsonArray(responseData), - { itemData: { item: i } }, - ), + ...this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { + itemData: { item: i }, + }), ); } catch (error) { if (this.continueOnFail()) { diff --git a/packages/nodes-base/nodes/EmailReadImap/v1/EmailReadImapV1.node.ts b/packages/nodes-base/nodes/EmailReadImap/v1/EmailReadImapV1.node.ts index a0bdaac4b3246..6c38f1982cdf6 100644 --- a/packages/nodes-base/nodes/EmailReadImap/v1/EmailReadImapV1.node.ts +++ b/packages/nodes-base/nodes/EmailReadImap/v1/EmailReadImapV1.node.ts @@ -463,7 +463,7 @@ export class EmailReadImapV1 implements INodeType { if (postProcessAction === 'read') { const uidList = results.map((e) => e.attributes.uid); if (uidList.length > 0) { - connection.addFlags(uidList, '\\SEEN'); + await connection.addFlags(uidList, '\\SEEN'); } } return newEmails; @@ -520,7 +520,7 @@ export class EmailReadImapV1 implements INodeType { }); // Wait with resolving till the returnedPromise got resolved, else n8n will be unhappy // if it receives an error before the workflow got activated - returnedPromise.promise().then(() => { + await returnedPromise.promise().then(() => { this.emitError(error as Error); }); } diff --git a/packages/nodes-base/nodes/EmailReadImap/v2/EmailReadImapV2.node.ts b/packages/nodes-base/nodes/EmailReadImap/v2/EmailReadImapV2.node.ts index 8554803d3534c..546c3877f5b43 100644 --- a/packages/nodes-base/nodes/EmailReadImap/v2/EmailReadImapV2.node.ts +++ b/packages/nodes-base/nodes/EmailReadImap/v2/EmailReadImapV2.node.ts @@ -470,7 +470,7 @@ export class EmailReadImapV2 implements INodeType { if (postProcessAction === 'read') { const uidList = results.map((e) => e.attributes.uid); if (uidList.length > 0) { - connection.addFlags(uidList, '\\SEEN'); + await connection.addFlags(uidList, '\\SEEN'); } } return newEmails; @@ -527,7 +527,7 @@ export class EmailReadImapV2 implements INodeType { }); // Wait with resolving till the returnedPromise got resolved, else n8n will be unhappy // if it receives an error before the workflow got activated - returnedPromise.promise().then(() => { + await returnedPromise.promise().then(() => { this.emitError(error as Error); }); } @@ -586,7 +586,7 @@ export class EmailReadImapV2 implements INodeType { Logger.verbose(`Forcing reconnect to IMAP server`); try { isCurrentlyReconnecting = true; - if (connection.closeBox) connection.closeBox(false); + if (connection.closeBox) await connection.closeBox(false); connection.end(); connection = await establishConnection(); await connection.openBox(mailbox); @@ -604,7 +604,7 @@ export class EmailReadImapV2 implements INodeType { if (reconnectionInterval) { clearInterval(reconnectionInterval); } - if (connection.closeBox) connection.closeBox(false); + if (connection.closeBox) await connection.closeBox(false); connection.end(); } diff --git a/packages/nodes-base/nodes/Kafka/KafkaTrigger.node.ts b/packages/nodes-base/nodes/Kafka/KafkaTrigger.node.ts index dcde8ca63a059..5bf564b8a50df 100644 --- a/packages/nodes-base/nodes/Kafka/KafkaTrigger.node.ts +++ b/packages/nodes-base/nodes/Kafka/KafkaTrigger.node.ts @@ -271,7 +271,7 @@ export class KafkaTrigger implements INodeType { }); }; - startConsumer(); + await startConsumer(); // The "closeFunction" function gets called by n8n whenever // the workflow gets deactivated and can so clean up. @@ -286,7 +286,7 @@ export class KafkaTrigger implements INodeType { // would trigger by itself so that the user knows what data // to expect. async function manualTriggerFunction() { - startConsumer(); + await startConsumer(); } return { diff --git a/packages/nodes-base/nodes/MQTT/MqttTrigger.node.ts b/packages/nodes-base/nodes/MQTT/MqttTrigger.node.ts index e71fb9ed5f695..4256811110cdc 100644 --- a/packages/nodes-base/nodes/MQTT/MqttTrigger.node.ts +++ b/packages/nodes-base/nodes/MQTT/MqttTrigger.node.ts @@ -171,7 +171,7 @@ export class MqttTrigger implements INodeType { } if (this.getMode() === 'trigger') { - manualTriggerFunction(); + await manualTriggerFunction(); } async function closeFunction() { diff --git a/packages/nodes-base/nodes/MongoDb/MongoDb.node.ts b/packages/nodes-base/nodes/MongoDb/MongoDb.node.ts index 8402e9dfc3a89..5a7d061311d4d 100644 --- a/packages/nodes-base/nodes/MongoDb/MongoDb.node.ts +++ b/packages/nodes-base/nodes/MongoDb/MongoDb.node.ts @@ -16,7 +16,13 @@ import { nodeDescription } from './MongoDbDescription'; import { buildParameterizedConnString, prepareFields, prepareItems } from './GenericFunctions'; -import { FindOneAndReplaceOptions, FindOneAndUpdateOptions, MongoClient, ObjectId, UpdateOptions } from 'mongodb'; +import { + FindOneAndReplaceOptions, + FindOneAndUpdateOptions, + MongoClient, + ObjectId, + UpdateOptions, +} from 'mongodb'; import { validateAndResolveMongoCredentials } from './GenericFunctions'; @@ -53,7 +59,7 @@ export class MongoDb implements INodeType { // eslint-disable-next-line n8n-nodes-base/node-execute-block-wrong-error-thrown throw new Error(`Database "${database}" does not exist`); } - client.close(); + await client.close(); } catch (error) { return { status: 'Error', @@ -329,7 +335,7 @@ export class MongoDb implements INodeType { } } - client.close(); + await client.close(); const executionData = this.helpers.constructExecutionMetaData( this.helpers.returnJsonArray(responseData), diff --git a/packages/nodes-base/nodes/MySql/GenericFunctions.ts b/packages/nodes-base/nodes/MySql/GenericFunctions.ts index 4702c851f6cbb..9f972f41e3206 100644 --- a/packages/nodes-base/nodes/MySql/GenericFunctions.ts +++ b/packages/nodes-base/nodes/MySql/GenericFunctions.ts @@ -70,6 +70,6 @@ export async function searchTables( name: r.TABLE_NAME as string, value: r.TABLE_NAME as string, })); - connection.end(); + await connection.end(); return { results }; } diff --git a/packages/nodes-base/nodes/MySql/MySql.node.ts b/packages/nodes-base/nodes/MySql/MySql.node.ts index f24c62ca45c00..949d39f770ac6 100644 --- a/packages/nodes-base/nodes/MySql/MySql.node.ts +++ b/packages/nodes-base/nodes/MySql/MySql.node.ts @@ -256,7 +256,7 @@ export class MySql implements INodeType { const credentials = credential.data as ICredentialDataDecryptedObject; try { const connection = await createConnection(credentials); - connection.end(); + await connection.end(); } catch (error) { return { status: 'Error', diff --git a/packages/nodes-base/nodes/RabbitMQ/RabbitMQTrigger.node.ts b/packages/nodes-base/nodes/RabbitMQ/RabbitMQTrigger.node.ts index 44e52f3ab7a7e..9dda4784d0110 100644 --- a/packages/nodes-base/nodes/RabbitMQ/RabbitMQTrigger.node.ts +++ b/packages/nodes-base/nodes/RabbitMQ/RabbitMQTrigger.node.ts @@ -183,7 +183,7 @@ export class RabbitMQTrigger implements INodeType { const startConsumer = async () => { if (parallelMessages !== -1) { - channel.prefetch(parallelMessages); + await channel.prefetch(parallelMessages); } channel.on('close', () => { @@ -270,7 +270,7 @@ export class RabbitMQTrigger implements INodeType { consumerTag = consumerInfo.consumerTag; }; - startConsumer(); + await startConsumer(); // The "closeFunction" function gets called by n8n whenever // the workflow gets deactivated and can so clean up. From bd716b211e798d2693c41c43d2726cb267fad742 Mon Sep 17 00:00:00 2001 From: Michael Kret Date: Fri, 18 Nov 2022 16:56:15 +0200 Subject: [PATCH 3/8] :zap: fixes for promise-function-async --- packages/editor-ui/.eslintrc.js | 1 - packages/editor-ui/src/api/api-keys.ts | 6 ++-- packages/editor-ui/src/api/curlHelper.ts | 2 +- packages/editor-ui/src/api/settings.ts | 2 +- packages/editor-ui/src/api/templates.ts | 4 +-- packages/editor-ui/src/api/users.ts | 22 ++++++------ .../src/components/CollectionParameter.vue | 2 +- .../components/FixedCollectionParameter.vue | 2 +- .../src/components/Node/NodeCreation.vue | 2 +- .../src/components/ParameterInputList.vue | 4 +-- packages/editor-ui/src/components/RunData.vue | 4 +-- .../editor-ui/src/components/RunDataJson.vue | 2 +- .../src/components/WorkflowShareModal.ee.vue | 2 +- .../layouts/ResourcesListLayout.vue | 2 +- .../src/components/mixins/restApi.ts | 34 +++++++++---------- .../src/components/mixins/workflowHelpers.ts | 2 +- packages/editor-ui/src/views/NodeView.vue | 10 +++--- packages/nodes-base/.eslintrc.js | 1 - .../nodes/ApiTemplateIo/GenericFunctions.ts | 2 +- .../nodes/Bannerbear/Bannerbear.node.ts | 2 +- .../nodes/Dropbox/GenericFunctions.ts | 2 +- .../nodes/Dropcontact/Dropcontact.node.ts | 2 +- .../EmailReadImap/v1/EmailReadImapV1.node.ts | 18 +++++----- .../EmailReadImap/v2/EmailReadImapV2.node.ts | 18 +++++----- .../ExecuteCommand/ExecuteCommand.node.ts | 2 +- .../ExecuteWorkflowTrigger.node.ts | 4 +-- .../nodes/Google/Ads/CampaignDescription.ts | 2 +- .../nodes/Google/BigQuery/GenericFunctions.ts | 2 +- .../nodes/Google/Books/GenericFunctions.ts | 2 +- .../nodes/Google/Chat/GenericFunctions.ts | 2 +- .../nodes/Google/Docs/GenericFunctions.ts | 2 +- .../nodes/Google/Drive/GenericFunctions.ts | 2 +- .../nodes/Google/Gmail/GenericFunctions.ts | 2 +- .../nodes/Google/Sheet/v1/GenericFunctions.ts | 2 +- .../nodes/Google/Sheet/v2/transport/index.ts | 2 +- .../nodes/Google/Slides/GenericFunctions.ts | 2 +- .../Google/Translate/GenericFunctions.ts | 2 +- .../LocalFileTrigger/LocalFileTrigger.node.ts | 2 +- .../nodes/Microsoft/Sql/GenericFunctions.ts | 12 ++++--- .../nodes/Microsoft/Sql/MicrosoftSql.node.ts | 10 +++--- .../nodes/MySql/GenericFunctions.ts | 2 +- packages/nodes-base/nodes/MySql/MySql.node.ts | 4 +-- packages/nodes-base/nodes/NoOp/NoOp.node.ts | 2 +- packages/nodes-base/nodes/Redis/Redis.node.ts | 2 +- .../nodes-base/nodes/Rundeck/RundeckApi.ts | 4 +-- .../nodes/Salesforce/GenericFunctions.ts | 2 +- packages/nodes-base/nodes/Set/Set.node.ts | 2 +- .../nodes/Snowflake/GenericFunctions.ts | 10 ++++-- .../nodes/Splunk/GenericFunctions.ts | 2 +- packages/nodes-base/nodes/Start/Start.node.ts | 2 +- .../nodes/StickyNote/StickyNote.node.ts | 2 +- .../nodes/StopAndError/StopAndError.node.ts | 2 +- .../Venafi/ProtectCloud/GenericFunctions.ts | 8 ++--- .../nodes-base/nodes/Zoom/GenericFunctions.ts | 2 +- 54 files changed, 126 insertions(+), 120 deletions(-) diff --git a/packages/editor-ui/.eslintrc.js b/packages/editor-ui/.eslintrc.js index e94b30c11caa2..bb17036e55d88 100644 --- a/packages/editor-ui/.eslintrc.js +++ b/packages/editor-ui/.eslintrc.js @@ -45,7 +45,6 @@ module.exports = { '@typescript-eslint/no-var-requires': 'off', '@typescript-eslint/prefer-nullish-coalescing': 'off', '@typescript-eslint/prefer-optional-chain': 'off', - '@typescript-eslint/promise-function-async': 'off', '@typescript-eslint/restrict-plus-operands': 'off', '@typescript-eslint/restrict-template-expressions': 'off', '@typescript-eslint/return-await': 'off', diff --git a/packages/editor-ui/src/api/api-keys.ts b/packages/editor-ui/src/api/api-keys.ts index 27598149be754..bcdfdbdd92076 100644 --- a/packages/editor-ui/src/api/api-keys.ts +++ b/packages/editor-ui/src/api/api-keys.ts @@ -1,14 +1,14 @@ import {IRestApiContext} from "@/Interface"; import {makeRestApiRequest} from "@/api/helpers"; -export function getApiKey(context: IRestApiContext): Promise<{ apiKey: string | null }> { +export async function getApiKey(context: IRestApiContext): Promise<{ apiKey: string | null }> { return makeRestApiRequest(context, 'GET', '/me/api-key'); } -export function createApiKey(context: IRestApiContext): Promise<{ apiKey: string | null }> { +export async function createApiKey(context: IRestApiContext): Promise<{ apiKey: string | null }> { return makeRestApiRequest(context, 'POST', '/me/api-key'); } -export function deleteApiKey(context: IRestApiContext): Promise<{ success: boolean }> { +export async function deleteApiKey(context: IRestApiContext): Promise<{ success: boolean }> { return makeRestApiRequest(context, 'DELETE', '/me/api-key'); } diff --git a/packages/editor-ui/src/api/curlHelper.ts b/packages/editor-ui/src/api/curlHelper.ts index cbdd1ac6c75b4..b9bc2a9ba4277 100644 --- a/packages/editor-ui/src/api/curlHelper.ts +++ b/packages/editor-ui/src/api/curlHelper.ts @@ -1,6 +1,6 @@ import {CurlToJSONResponse, IRestApiContext} from "@/Interface"; import {makeRestApiRequest} from "@/api/helpers"; -export function getCurlToJson(context: IRestApiContext, curlCommand: string): Promise { +export async function getCurlToJson(context: IRestApiContext, curlCommand: string): Promise { return makeRestApiRequest(context, 'POST', '/curl-to-json', { curlCommand }); } diff --git a/packages/editor-ui/src/api/settings.ts b/packages/editor-ui/src/api/settings.ts index f7917ef9e65b6..5076bc06350f4 100644 --- a/packages/editor-ui/src/api/settings.ts +++ b/packages/editor-ui/src/api/settings.ts @@ -2,7 +2,7 @@ import { IRestApiContext, IN8nPrompts, IN8nValueSurveyData, IN8nUISettings, IN8n import { makeRestApiRequest, get, post } from './helpers'; import { N8N_IO_BASE_URL, NPM_COMMUNITY_NODE_SEARCH_API_URL } from '@/constants'; -export function getSettings(context: IRestApiContext): Promise { +export async function getSettings(context: IRestApiContext): Promise { return makeRestApiRequest(context, 'GET', '/settings'); } diff --git a/packages/editor-ui/src/api/templates.ts b/packages/editor-ui/src/api/templates.ts index 15efc8e8d7541..14dad90faeedb 100644 --- a/packages/editor-ui/src/api/templates.ts +++ b/packages/editor-ui/src/api/templates.ts @@ -6,11 +6,11 @@ function stringifyArray(arr: number[]) { return arr.join(','); } -export function testHealthEndpoint(apiEndpoint: string) { +export async function testHealthEndpoint(apiEndpoint: string) { return get(apiEndpoint, '/health'); } -export function getCategories(apiEndpoint: string, headers?: IDataObject): Promise<{categories: ITemplatesCategory[]}> { +export async function getCategories(apiEndpoint: string, headers?: IDataObject): Promise<{categories: ITemplatesCategory[]}> { return get(apiEndpoint, '/templates/categories', undefined, headers); } diff --git a/packages/editor-ui/src/api/users.ts b/packages/editor-ui/src/api/users.ts index e7326ec34091d..d735f3cdd0a81 100644 --- a/packages/editor-ui/src/api/users.ts +++ b/packages/editor-ui/src/api/users.ts @@ -2,15 +2,15 @@ import { IInviteResponse, IPersonalizationLatestVersion, IRestApiContext, IUserR import { IDataObject } from 'n8n-workflow'; import { makeRestApiRequest } from './helpers'; -export function loginCurrentUser(context: IRestApiContext): Promise { +export async function loginCurrentUser(context: IRestApiContext): Promise { return makeRestApiRequest(context, 'GET', '/login'); } -export function getCurrentUser(context: IRestApiContext): Promise { +export async function getCurrentUser(context: IRestApiContext): Promise { return makeRestApiRequest(context, 'GET', '/me'); } -export function login(context: IRestApiContext, params: {email: string, password: string}): Promise { +export async function login(context: IRestApiContext, params: {email: string, password: string}): Promise { return makeRestApiRequest(context, 'POST', '/login', params); } @@ -18,19 +18,19 @@ export async function logout(context: IRestApiContext): Promise { await makeRestApiRequest(context, 'POST', '/logout'); } -export function setupOwner(context: IRestApiContext, params: { firstName: string; lastName: string; email: string; password: string;}): Promise { +export async function setupOwner(context: IRestApiContext, params: { firstName: string; lastName: string; email: string; password: string;}): Promise { return makeRestApiRequest(context, 'POST', '/owner', params as unknown as IDataObject); } -export function skipOwnerSetup(context: IRestApiContext): Promise { +export async function skipOwnerSetup(context: IRestApiContext): Promise { return makeRestApiRequest(context, 'POST', '/owner/skip-setup'); } -export function validateSignupToken(context: IRestApiContext, params: {inviterId: string; inviteeId: string}): Promise<{inviter: {firstName: string, lastName: string}}> { +export async function validateSignupToken(context: IRestApiContext, params: {inviterId: string; inviteeId: string}): Promise<{inviter: {firstName: string, lastName: string}}> { return makeRestApiRequest(context, 'GET', '/resolve-signup-token', params); } -export function signup(context: IRestApiContext, params: {inviterId: string; inviteeId: string; firstName: string; lastName: string; password: string}): Promise { +export async function signup(context: IRestApiContext, params: {inviterId: string; inviteeId: string; firstName: string; lastName: string; password: string}): Promise { const { inviteeId, ...props } = params; return makeRestApiRequest(context, 'POST', `/users/${params.inviteeId}`, props as unknown as IDataObject); } @@ -47,11 +47,11 @@ export async function changePassword(context: IRestApiContext, params: {token: s await makeRestApiRequest(context, 'POST', '/change-password', params); } -export function updateCurrentUser(context: IRestApiContext, params: {id: string, firstName: string, lastName: string, email: string}): Promise { +export async function updateCurrentUser(context: IRestApiContext, params: {id: string, firstName: string, lastName: string, email: string}): Promise { return makeRestApiRequest(context, 'PATCH', `/me`, params as unknown as IDataObject); } -export function updateCurrentUserPassword(context: IRestApiContext, params: {newPassword: string, currentPassword: string}): Promise { +export async function updateCurrentUserPassword(context: IRestApiContext, params: {newPassword: string, currentPassword: string}): Promise { return makeRestApiRequest(context, 'PATCH', `/me/password`, params); } @@ -59,11 +59,11 @@ export async function deleteUser(context: IRestApiContext, {id, transferId}: {id await makeRestApiRequest(context, 'DELETE', `/users/${id}`, transferId ? { transferId } : {}); } -export function getUsers(context: IRestApiContext): Promise { +export async function getUsers(context: IRestApiContext): Promise { return makeRestApiRequest(context, 'GET', '/users'); } -export function inviteUsers(context: IRestApiContext, params: Array<{email: string}>): Promise { +export async function inviteUsers(context: IRestApiContext, params: Array<{email: string}>): Promise { return makeRestApiRequest(context, 'POST', '/users', params as unknown as IDataObject); } diff --git a/packages/editor-ui/src/components/CollectionParameter.vue b/packages/editor-ui/src/components/CollectionParameter.vue index ebc87dcfcf74d..648ac25f3abfc 100644 --- a/packages/editor-ui/src/components/CollectionParameter.vue +++ b/packages/editor-ui/src/components/CollectionParameter.vue @@ -66,7 +66,7 @@ export default mixins( 'isReadOnly', // boolean ], components: { - ParameterInputList: () => import('./ParameterInputList.vue') as Promise, + ParameterInputList: async () => import('./ParameterInputList.vue') as Promise, }, data () { return { diff --git a/packages/editor-ui/src/components/FixedCollectionParameter.vue b/packages/editor-ui/src/components/FixedCollectionParameter.vue index e67f59dda3106..55293b16b20eb 100644 --- a/packages/editor-ui/src/components/FixedCollectionParameter.vue +++ b/packages/editor-ui/src/components/FixedCollectionParameter.vue @@ -151,7 +151,7 @@ export default Vue.extend({ }, }, components: { - ParameterInputList: () => import('./ParameterInputList.vue') as Promise, + ParameterInputList: async () => import('./ParameterInputList.vue') as Promise, }, data() { return { diff --git a/packages/editor-ui/src/components/Node/NodeCreation.vue b/packages/editor-ui/src/components/Node/NodeCreation.vue index 693d25ce14a0e..0537571f7d46f 100644 --- a/packages/editor-ui/src/components/Node/NodeCreation.vue +++ b/packages/editor-ui/src/components/Node/NodeCreation.vue @@ -26,7 +26,7 @@ import { useUIStore } from "@/stores/ui"; export default Vue.extend({ name: 'node-creation', components: { - NodeCreator: () => import('@/components/Node/NodeCreator/NodeCreator.vue'), + NodeCreator: async () => import('@/components/Node/NodeCreator/NodeCreator.vue'), }, props: { nodeViewScale: { diff --git a/packages/editor-ui/src/components/ParameterInputList.vue b/packages/editor-ui/src/components/ParameterInputList.vue index 7d86da2924c1e..3c48350683dc4 100644 --- a/packages/editor-ui/src/components/ParameterInputList.vue +++ b/packages/editor-ui/src/components/ParameterInputList.vue @@ -131,8 +131,8 @@ export default mixins( components: { MultipleParameter, ParameterInputFull, - FixedCollectionParameter: () => import('./FixedCollectionParameter.vue') as Promise, - CollectionParameter: () => import('./CollectionParameter.vue') as Promise, + FixedCollectionParameter: async () => import('./FixedCollectionParameter.vue') as Promise, + CollectionParameter: async () => import('./CollectionParameter.vue') as Promise, ImportParameter, }, props: [ diff --git a/packages/editor-ui/src/components/RunData.vue b/packages/editor-ui/src/components/RunData.vue index f9670456adc3b..63343bd1628fa 100644 --- a/packages/editor-ui/src/components/RunData.vue +++ b/packages/editor-ui/src/components/RunData.vue @@ -377,8 +377,8 @@ import { mapStores } from "pinia"; import { useNDVStore } from "@/stores/ndv"; import { useNodeTypesStore } from "@/stores/nodeTypes"; -const RunDataTable = () => import('@/components/RunDataTable.vue'); -const RunDataJson = () => import('@/components/RunDataJson.vue'); +const RunDataTable = async () => import('@/components/RunDataTable.vue'); +const RunDataJson = async () => import('@/components/RunDataJson.vue'); export type EnterEditModeArgs = { origin: 'editIconButton' | 'insertTestDataLink', diff --git a/packages/editor-ui/src/components/RunDataJson.vue b/packages/editor-ui/src/components/RunDataJson.vue index 68ec68d1df45b..77c08be1e3c9b 100644 --- a/packages/editor-ui/src/components/RunDataJson.vue +++ b/packages/editor-ui/src/components/RunDataJson.vue @@ -69,7 +69,7 @@ import { externalHooks } from "@/components/mixins/externalHooks"; import { mapStores } from "pinia"; import { useNDVStore } from "@/stores/ndv"; -const runDataJsonActions = () => import('@/components/RunDataJsonActions.vue'); +const runDataJsonActions = async () => import('@/components/RunDataJsonActions.vue'); export default mixins(externalHooks).extend({ name: 'run-data-json', diff --git a/packages/editor-ui/src/components/WorkflowShareModal.ee.vue b/packages/editor-ui/src/components/WorkflowShareModal.ee.vue index f61a1e8fd4743..578788ca56123 100644 --- a/packages/editor-ui/src/components/WorkflowShareModal.ee.vue +++ b/packages/editor-ui/src/components/WorkflowShareModal.ee.vue @@ -181,7 +181,7 @@ export default mixins( this.loading = true; - const saveWorkflowPromise = () => { + const saveWorkflowPromise = async () => { return new Promise((resolve) => { if (this.workflow.id === PLACEHOLDER_EMPTY_WORKFLOW_ID) { nodeViewEventBus.$emit('saveWorkflow', () => { diff --git a/packages/editor-ui/src/components/layouts/ResourcesListLayout.vue b/packages/editor-ui/src/components/layouts/ResourcesListLayout.vue index 698411216b8ec..f53550039a818 100644 --- a/packages/editor-ui/src/components/layouts/ResourcesListLayout.vue +++ b/packages/editor-ui/src/components/layouts/ResourcesListLayout.vue @@ -179,7 +179,7 @@ export default mixins( }, initialize: { type: Function as PropType<() => Promise>, - default: () => () => Promise.resolve(), + default: () => async () => Promise.resolve(), }, filters: { type: Object, diff --git a/packages/editor-ui/src/components/mixins/restApi.ts b/packages/editor-ui/src/components/mixins/restApi.ts index cf3ee357f5995..292794aaae33b 100644 --- a/packages/editor-ui/src/components/mixins/restApi.ts +++ b/packages/editor-ui/src/components/mixins/restApi.ts @@ -66,13 +66,13 @@ export const restApi = Vue.extend({ async makeRestApiRequest (method: Method, endpoint: string, data?: IDataObject): Promise { // tslint:disable-line:no-any return makeRestApiRequest(self.rootStore.getRestApiContext, method, endpoint, data); }, - getActiveWorkflows: (): Promise => { + getActiveWorkflows: async (): Promise => { return self.restApi().makeRestApiRequest('GET', `/active`); }, - getActivationError: (id: string): Promise => { + getActivationError: async (id: string): Promise => { return self.restApi().makeRestApiRequest('GET', `/active/error/${id}`); }, - getCurrentExecutions: (filter: object): Promise => { + getCurrentExecutions: async (filter: object): Promise => { let sendData = {}; if (filter) { sendData = { @@ -81,16 +81,16 @@ export const restApi = Vue.extend({ } return self.restApi().makeRestApiRequest('GET', `/executions-current`, sendData); }, - stopCurrentExecution: (executionId: string): Promise => { + stopCurrentExecution: async (executionId: string): Promise => { return self.restApi().makeRestApiRequest('POST', `/executions-current/${executionId}/stop`); }, - getCredentialTranslation: (credentialType): Promise => { + getCredentialTranslation: async (credentialType): Promise => { return self.restApi().makeRestApiRequest('GET', '/credential-translation', { credentialType }); }, // Removes a test webhook - removeTestWebhook: (workflowId: string): Promise => { + removeTestWebhook: async (workflowId: string): Promise => { return self.restApi().makeRestApiRequest('DELETE', `/test-webhook/${workflowId}`); }, @@ -100,27 +100,27 @@ export const restApi = Vue.extend({ }, // Creates a new workflow - createNewWorkflow: (sendData: IWorkflowDataUpdate): Promise => { + createNewWorkflow: async (sendData: IWorkflowDataUpdate): Promise => { return self.restApi().makeRestApiRequest('POST', `/workflows`, sendData); }, // Updates an existing workflow - updateWorkflow: (id: string, data: IWorkflowDataUpdate): Promise => { + updateWorkflow: async (id: string, data: IWorkflowDataUpdate): Promise => { return self.restApi().makeRestApiRequest('PATCH', `/workflows/${id}`, data); }, // Deletes a workflow - deleteWorkflow: (name: string): Promise => { + deleteWorkflow: async (name: string): Promise => { return self.restApi().makeRestApiRequest('DELETE', `/workflows/${name}`); }, // Returns the workflow with the given name - getWorkflow: (id: string): Promise => { + getWorkflow: async (id: string): Promise => { return self.restApi().makeRestApiRequest('GET', `/workflows/${id}`); }, // Returns all saved workflows - getWorkflows: (filter?: object): Promise => { + getWorkflows: async (filter?: object): Promise => { let sendData; if (filter) { sendData = { @@ -131,7 +131,7 @@ export const restApi = Vue.extend({ }, // Returns a workflow from a given URL - getWorkflowFromUrl: (url: string): Promise => { + getWorkflowFromUrl: async (url: string): Promise => { return self.restApi().makeRestApiRequest('GET', `/workflows/from-url`, { url }); }, @@ -142,12 +142,12 @@ export const restApi = Vue.extend({ }, // Deletes executions - deleteExecutions: (sendData: IExecutionDeleteFilter): Promise => { + deleteExecutions: async (sendData: IExecutionDeleteFilter): Promise => { return self.restApi().makeRestApiRequest('POST', `/executions/delete`, sendData); }, // Returns the execution with the given name - retryExecution: (id: string, loadWorkflow?: boolean): Promise => { + retryExecution: async (id: string, loadWorkflow?: boolean): Promise => { let sendData; if (loadWorkflow === true) { sendData = { @@ -159,7 +159,7 @@ export const restApi = Vue.extend({ // Returns all saved executions // TODO: For sure needs some kind of default filter like last day, with max 10 results, ... - getPastExecutions: (filter: object, limit: number, lastId?: string | number, firstId?: string | number): Promise => { + getPastExecutions: async (filter: object, limit: number, lastId?: string | number, firstId?: string | number): Promise => { let sendData = {}; if (filter) { sendData = { @@ -174,12 +174,12 @@ export const restApi = Vue.extend({ }, // Returns all the available timezones - getTimezones: (): Promise => { + getTimezones: async (): Promise => { return self.restApi().makeRestApiRequest('GET', `/options/timezones`); }, // Binary data - getBinaryBufferString: (dataPath: string): Promise => { + getBinaryBufferString: async (dataPath: string): Promise => { return self.restApi().makeRestApiRequest('GET', `/data/${dataPath}`); }, }; diff --git a/packages/editor-ui/src/components/mixins/workflowHelpers.ts b/packages/editor-ui/src/components/mixins/workflowHelpers.ts index b48e3e6f5593a..83c42cb0fb0c5 100644 --- a/packages/editor-ui/src/components/mixins/workflowHelpers.ts +++ b/packages/editor-ui/src/components/mixins/workflowHelpers.ts @@ -392,7 +392,7 @@ export const workflowHelpers = mixins( }, // Returns the currently loaded workflow as JSON. - getWorkflowDataToSave (): Promise { + async getWorkflowDataToSave (): Promise { const workflowNodes = this.workflowsStore.allNodes; const workflowConnections = this.workflowsStore.allConnections; diff --git a/packages/editor-ui/src/views/NodeView.vue b/packages/editor-ui/src/views/NodeView.vue index 83c9f5f24b5e1..f9d2ed05bfe48 100644 --- a/packages/editor-ui/src/views/NodeView.vue +++ b/packages/editor-ui/src/views/NodeView.vue @@ -239,9 +239,9 @@ interface AddNodeOptions { dragAndDrop?: boolean; } -const NodeCreator = () => import('@/components/Node/NodeCreator/NodeCreator.vue'); -const NodeCreation = () => import('@/components/Node/NodeCreation.vue'); -const CanvasControls = () => import('@/components/CanvasControls.vue'); +const NodeCreator = async () => import('@/components/Node/NodeCreator/NodeCreator.vue'); +const NodeCreation = async () => import('@/components/Node/NodeCreation.vue'); +const CanvasControls = async () => import('@/components/CanvasControls.vue'); export default mixins( copyPaste, @@ -3001,7 +3001,7 @@ export default mixins( connections: tempWorkflow.connectionsBySourceNode, }; }, - getSelectedNodesToSave(): Promise { + async getSelectedNodesToSave(): Promise { const data: IWorkflowData = { nodes: [], connections: {}, @@ -3066,7 +3066,7 @@ export default mixins( return Promise.resolve(data); }, - resetWorkspace() { + async resetWorkspace() { this.workflowsStore.resetWorkflow(); // Reset nodes diff --git a/packages/nodes-base/.eslintrc.js b/packages/nodes-base/.eslintrc.js index cbb5edbc4f6e2..320df5185e2ec 100644 --- a/packages/nodes-base/.eslintrc.js +++ b/packages/nodes-base/.eslintrc.js @@ -49,7 +49,6 @@ module.exports = { '@typescript-eslint/no-var-requires': 'off', '@typescript-eslint/prefer-nullish-coalescing': 'off', '@typescript-eslint/prefer-optional-chain': 'off', - '@typescript-eslint/promise-function-async': 'off', '@typescript-eslint/restrict-plus-operands': 'off', '@typescript-eslint/restrict-template-expressions': 'off', '@typescript-eslint/return-await': 'off', diff --git a/packages/nodes-base/nodes/ApiTemplateIo/GenericFunctions.ts b/packages/nodes-base/nodes/ApiTemplateIo/GenericFunctions.ts index fe5ac6291389f..c1d8c76c168b6 100644 --- a/packages/nodes-base/nodes/ApiTemplateIo/GenericFunctions.ts +++ b/packages/nodes-base/nodes/ApiTemplateIo/GenericFunctions.ts @@ -74,7 +74,7 @@ export function validateJSON(json: string | object | undefined): any { return result; } -export function downloadImage(this: IExecuteFunctions, url: string) { +export async function downloadImage(this: IExecuteFunctions, url: string) { return this.helpers.request({ uri: url, method: 'GET', diff --git a/packages/nodes-base/nodes/Bannerbear/Bannerbear.node.ts b/packages/nodes-base/nodes/Bannerbear/Bannerbear.node.ts index 11d9c8fef2476..157ce7f8dff92 100644 --- a/packages/nodes-base/nodes/Bannerbear/Bannerbear.node.ts +++ b/packages/nodes-base/nodes/Bannerbear/Bannerbear.node.ts @@ -143,7 +143,7 @@ export class Bannerbear implements INodeType { if (additionalFields.waitForImage && responseData.status !== 'completed') { let maxTries = (additionalFields.waitForImageMaxTries as number) || 3; - const promise = (uid: string) => { + const promise = async (uid: string) => { let data: IDataObject = {}; return new Promise((resolve, reject) => { const timeout = setInterval(async () => { diff --git a/packages/nodes-base/nodes/Dropbox/GenericFunctions.ts b/packages/nodes-base/nodes/Dropbox/GenericFunctions.ts index d93466c2c8f69..24087122b664a 100644 --- a/packages/nodes-base/nodes/Dropbox/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Dropbox/GenericFunctions.ts @@ -80,7 +80,7 @@ export async function dropboxpiRequestAllItems( return returnData; } -export function getRootDirectory(this: IHookFunctions | IExecuteFunctions) { +export async function getRootDirectory(this: IHookFunctions | IExecuteFunctions) { return dropboxApiRequest.call( this, 'POST', diff --git a/packages/nodes-base/nodes/Dropcontact/Dropcontact.node.ts b/packages/nodes-base/nodes/Dropcontact/Dropcontact.node.ts index 431b55665fec0..db56b3a9c53b7 100644 --- a/packages/nodes-base/nodes/Dropcontact/Dropcontact.node.ts +++ b/packages/nodes-base/nodes/Dropcontact/Dropcontact.node.ts @@ -288,7 +288,7 @@ export class Dropcontact implements INodeType { if (simplify === false) { const waitTime = this.getNodeParameter('options.waitTime', 0, 45) as number; // tslint:disable-next-line: no-any - const delay = (ms: any) => new Promise((res) => setTimeout(res, ms * 1000)); + const delay = async (ms: any) => new Promise((res) => setTimeout(res, ms * 1000)); await delay(waitTime); responseData = await dropcontactApiRequest.call( this, diff --git a/packages/nodes-base/nodes/EmailReadImap/v1/EmailReadImapV1.node.ts b/packages/nodes-base/nodes/EmailReadImap/v1/EmailReadImapV1.node.ts index 6c38f1982cdf6..5f59a7f1a0039 100644 --- a/packages/nodes-base/nodes/EmailReadImap/v1/EmailReadImapV1.node.ts +++ b/packages/nodes-base/nodes/EmailReadImap/v1/EmailReadImapV1.node.ts @@ -288,13 +288,15 @@ export class EmailReadImapV1 implements INodeType { const attachmentPromises = []; let attachmentPromise; for (const attachmentPart of attachmentParts) { - attachmentPromise = connection.getPartData(message, attachmentPart).then((partData) => { - // Return it in the format n8n expects - return this.helpers.prepareBinaryData( - partData, - attachmentPart.disposition.params.filename, - ); - }); + attachmentPromise = connection + .getPartData(message, attachmentPart) + .then(async (partData) => { + // Return it in the format n8n expects + return this.helpers.prepareBinaryData( + partData, + attachmentPart.disposition.params.filename, + ); + }); attachmentPromises.push(attachmentPromise); } @@ -471,7 +473,7 @@ export class EmailReadImapV1 implements INodeType { const returnedPromise: IDeferredPromise | undefined = await createDeferredPromise(); - const establishConnection = (): Promise => { + const establishConnection = async (): Promise => { let searchCriteria = ['UNSEEN'] as Array; if (options.customEmailConfig !== undefined) { try { diff --git a/packages/nodes-base/nodes/EmailReadImap/v2/EmailReadImapV2.node.ts b/packages/nodes-base/nodes/EmailReadImap/v2/EmailReadImapV2.node.ts index 546c3877f5b43..cc117d95b62f3 100644 --- a/packages/nodes-base/nodes/EmailReadImap/v2/EmailReadImapV2.node.ts +++ b/packages/nodes-base/nodes/EmailReadImap/v2/EmailReadImapV2.node.ts @@ -295,13 +295,15 @@ export class EmailReadImapV2 implements INodeType { const attachmentPromises = []; let attachmentPromise; for (const attachmentPart of attachmentParts) { - attachmentPromise = connection.getPartData(message, attachmentPart).then((partData) => { - // Return it in the format n8n expects - return this.helpers.prepareBinaryData( - partData, - attachmentPart.disposition.params.filename, - ); - }); + attachmentPromise = connection + .getPartData(message, attachmentPart) + .then(async (partData) => { + // Return it in the format n8n expects + return this.helpers.prepareBinaryData( + partData, + attachmentPart.disposition.params.filename, + ); + }); attachmentPromises.push(attachmentPromise); } @@ -478,7 +480,7 @@ export class EmailReadImapV2 implements INodeType { const returnedPromise: IDeferredPromise | undefined = await createDeferredPromise(); - const establishConnection = (): Promise => { + const establishConnection = async (): Promise => { let searchCriteria = ['UNSEEN'] as Array; if (options.customEmailConfig !== undefined) { try { diff --git a/packages/nodes-base/nodes/ExecuteCommand/ExecuteCommand.node.ts b/packages/nodes-base/nodes/ExecuteCommand/ExecuteCommand.node.ts index 61566d5b4f7a4..6829c76ffb9ea 100644 --- a/packages/nodes-base/nodes/ExecuteCommand/ExecuteCommand.node.ts +++ b/packages/nodes-base/nodes/ExecuteCommand/ExecuteCommand.node.ts @@ -19,7 +19,7 @@ export interface IExecReturnData { * Promisifiy exec manually to also get the exit code * */ -function execPromise(command: string): Promise { +async function execPromise(command: string): Promise { const returnData: IExecReturnData = { error: undefined, exitCode: 0, diff --git a/packages/nodes-base/nodes/ExecuteWorkflowTrigger/ExecuteWorkflowTrigger.node.ts b/packages/nodes-base/nodes/ExecuteWorkflowTrigger/ExecuteWorkflowTrigger.node.ts index 15b22c52887bc..14efb8b1d774f 100644 --- a/packages/nodes-base/nodes/ExecuteWorkflowTrigger/ExecuteWorkflowTrigger.node.ts +++ b/packages/nodes-base/nodes/ExecuteWorkflowTrigger/ExecuteWorkflowTrigger.node.ts @@ -20,7 +20,7 @@ export class ExecuteWorkflowTrigger implements INodeType { properties: [ { displayName: - 'When an ‘execute workflow’ node calls this workflow, the execution starts here. Any data passed into the \'execute workflow\' node will be output by this node.', + "When an ‘execute workflow’ node calls this workflow, the execution starts here. Any data passed into the 'execute workflow' node will be output by this node.", name: 'notice', type: 'notice', default: '', @@ -28,7 +28,7 @@ export class ExecuteWorkflowTrigger implements INodeType { ], }; - execute(this: IExecuteFunctions): Promise { + async execute(this: IExecuteFunctions): Promise { const items = this.getInputData(); return this.prepareOutputData(items); diff --git a/packages/nodes-base/nodes/Google/Ads/CampaignDescription.ts b/packages/nodes-base/nodes/Google/Ads/CampaignDescription.ts index d8874f8cc88f3..f2e088e67f19e 100644 --- a/packages/nodes-base/nodes/Google/Ads/CampaignDescription.ts +++ b/packages/nodes-base/nodes/Google/Ads/CampaignDescription.ts @@ -263,7 +263,7 @@ export const campaignFields: INodeProperties[] = [ }, ]; -function processCampaignSearchResponse( +async function processCampaignSearchResponse( this: IExecuteSingleFunctions, _inputData: INodeExecutionData[], responseData: IN8nHttpFullResponse, diff --git a/packages/nodes-base/nodes/Google/BigQuery/GenericFunctions.ts b/packages/nodes-base/nodes/Google/BigQuery/GenericFunctions.ts index 5e0683bee7c5d..9c93c8e67bb38 100644 --- a/packages/nodes-base/nodes/Google/BigQuery/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/BigQuery/GenericFunctions.ts @@ -91,7 +91,7 @@ export async function googleApiRequestAllItems( return returnData; } -function getAccessToken( +async function getAccessToken( this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, credentials: IDataObject, ): Promise { diff --git a/packages/nodes-base/nodes/Google/Books/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Books/GenericFunctions.ts index 582db6751f54d..80366cca6ddd9 100644 --- a/packages/nodes-base/nodes/Google/Books/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Books/GenericFunctions.ts @@ -99,7 +99,7 @@ export async function googleApiRequestAllItems( return returnData; } -function getAccessToken( +async function getAccessToken( this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, credentials: IGoogleAuthCredentials, ): Promise { diff --git a/packages/nodes-base/nodes/Google/Chat/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Chat/GenericFunctions.ts index 3038fb4973fe1..8e3905f904583 100644 --- a/packages/nodes-base/nodes/Google/Chat/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Chat/GenericFunctions.ts @@ -106,7 +106,7 @@ export async function googleApiRequestAllItems( return returnData; } -export function getAccessToken( +export async function getAccessToken( this: | IExecuteFunctions | IExecuteSingleFunctions diff --git a/packages/nodes-base/nodes/Google/Docs/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Docs/GenericFunctions.ts index 11bd28c70e16b..231cf84fcf580 100644 --- a/packages/nodes-base/nodes/Google/Docs/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Docs/GenericFunctions.ts @@ -89,7 +89,7 @@ export async function googleApiRequestAllItems( return returnData; } -function getAccessToken( +async function getAccessToken( this: IExecuteFunctions | ILoadOptionsFunctions, credentials: IGoogleAuthCredentials, ): Promise { diff --git a/packages/nodes-base/nodes/Google/Drive/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Drive/GenericFunctions.ts index 52a5680afa095..e431301ca3f5c 100644 --- a/packages/nodes-base/nodes/Google/Drive/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Drive/GenericFunctions.ts @@ -97,7 +97,7 @@ export async function googleApiRequestAllItems( return returnData; } -function getAccessToken( +async function getAccessToken( this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions | IPollFunctions, credentials: IGoogleAuthCredentials, ): Promise { diff --git a/packages/nodes-base/nodes/Google/Gmail/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Gmail/GenericFunctions.ts index c17d7e6d46a1d..065fee80fb9e7 100644 --- a/packages/nodes-base/nodes/Google/Gmail/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Gmail/GenericFunctions.ts @@ -302,7 +302,7 @@ export function extractEmail(s: string) { return s; } -function getAccessToken( +async function getAccessToken( this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions | IPollFunctions, credentials: ICredentialDataDecryptedObject, ): Promise { diff --git a/packages/nodes-base/nodes/Google/Sheet/v1/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Sheet/v1/GenericFunctions.ts index b5f3a755cde0b..779d863856fed 100644 --- a/packages/nodes-base/nodes/Google/Sheet/v1/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Sheet/v1/GenericFunctions.ts @@ -97,7 +97,7 @@ export async function googleApiRequestAllItems( return returnData; } -export function getAccessToken( +export async function getAccessToken( this: | IExecuteFunctions | IExecuteSingleFunctions diff --git a/packages/nodes-base/nodes/Google/Sheet/v2/transport/index.ts b/packages/nodes-base/nodes/Google/Sheet/v2/transport/index.ts index e1a7dea878bbb..878bad1f38300 100644 --- a/packages/nodes-base/nodes/Google/Sheet/v2/transport/index.ts +++ b/packages/nodes-base/nodes/Google/Sheet/v2/transport/index.ts @@ -97,7 +97,7 @@ export async function apiRequestAllItems( return returnData; } -export function getAccessToken( +export async function getAccessToken( this: | IExecuteFunctions | IExecuteSingleFunctions diff --git a/packages/nodes-base/nodes/Google/Slides/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Slides/GenericFunctions.ts index 16e8b60c4a5cb..ac3c6939cad32 100644 --- a/packages/nodes-base/nodes/Google/Slides/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Slides/GenericFunctions.ts @@ -68,7 +68,7 @@ export async function googleApiRequest( } } -function getAccessToken( +async function getAccessToken( this: IExecuteFunctions | ILoadOptionsFunctions, credentials: IGoogleAuthCredentials, ) { diff --git a/packages/nodes-base/nodes/Google/Translate/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Translate/GenericFunctions.ts index 1f56da5402feb..a98c0de3b4e80 100644 --- a/packages/nodes-base/nodes/Google/Translate/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Translate/GenericFunctions.ts @@ -93,7 +93,7 @@ export async function googleApiRequestAllItems( return returnData; } -function getAccessToken( +async function getAccessToken( this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, credentials: IGoogleAuthCredentials, ): Promise { diff --git a/packages/nodes-base/nodes/LocalFileTrigger/LocalFileTrigger.node.ts b/packages/nodes-base/nodes/LocalFileTrigger/LocalFileTrigger.node.ts index 2288bc01e003c..a5edda4999f37 100644 --- a/packages/nodes-base/nodes/LocalFileTrigger/LocalFileTrigger.node.ts +++ b/packages/nodes-base/nodes/LocalFileTrigger/LocalFileTrigger.node.ts @@ -200,7 +200,7 @@ export class LocalFileTrigger implements INodeType { watcher.on(eventName, (path) => executeTrigger(eventName, path)); } - function closeFunction() { + async function closeFunction() { return watcher.close(); } diff --git a/packages/nodes-base/nodes/Microsoft/Sql/GenericFunctions.ts b/packages/nodes-base/nodes/Microsoft/Sql/GenericFunctions.ts index c222c7149d06d..6b62e64336610 100644 --- a/packages/nodes-base/nodes/Microsoft/Sql/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Microsoft/Sql/GenericFunctions.ts @@ -59,11 +59,15 @@ export function createTableStruct( * @param {ITables} tables The ITables to be processed. * @param {function} buildQueryQueue function that builds the queue of promises */ -// tslint:disable-next-line: no-any -export function executeQueryQueue(tables: ITables, buildQueryQueue: Function): Promise { + +export async function executeQueryQueue( + tables: ITables, + buildQueryQueue: Function, + // tslint:disable-next-line: no-any +): Promise { return Promise.all( - Object.keys(tables).map((table) => { - const columnsResults = Object.keys(tables[table]).map((columnString) => { + Object.keys(tables).map(async (table) => { + const columnsResults = Object.keys(tables[table]).map(async (columnString) => { return Promise.all( buildQueryQueue({ table, diff --git a/packages/nodes-base/nodes/Microsoft/Sql/MicrosoftSql.node.ts b/packages/nodes-base/nodes/Microsoft/Sql/MicrosoftSql.node.ts index 4970d71b50340..412fcd8ffe761 100644 --- a/packages/nodes-base/nodes/Microsoft/Sql/MicrosoftSql.node.ts +++ b/packages/nodes-base/nodes/Microsoft/Sql/MicrosoftSql.node.ts @@ -317,7 +317,7 @@ export class MicrosoftSql implements INodeType { columnString: string; items: IDataObject[]; }): Array> => { - return chunk(items, 1000).map((insertValues) => { + return chunk(items, 1000).map(async (insertValues) => { const values = insertValues.map((item: IDataObject) => extractValues(item)).join(','); return pool .request() @@ -352,7 +352,7 @@ export class MicrosoftSql implements INodeType { columnString: string; items: IDataObject[]; }): Array> => { - return items.map((item) => { + return items.map(async (item) => { const columns = columnString.split(',').map((column) => column.trim()); const setValues = extractUpdateSet(item, columns); @@ -383,15 +383,15 @@ export class MicrosoftSql implements INodeType { }, {} as ITables); const queriesResults = await Promise.all( - Object.keys(tables).map((table) => { - const deleteKeyResults = Object.keys(tables[table]).map((deleteKey) => { + Object.keys(tables).map(async (table) => { + const deleteKeyResults = Object.keys(tables[table]).map(async (deleteKey) => { const deleteItemsList = chunk( tables[table][deleteKey].map((item) => copyInputItem(item as INodeExecutionData, [deleteKey]), ), 1000, ); - const queryQueue = deleteItemsList.map((deleteValues) => { + const queryQueue = deleteItemsList.map(async (deleteValues) => { return pool .request() .query( diff --git a/packages/nodes-base/nodes/MySql/GenericFunctions.ts b/packages/nodes-base/nodes/MySql/GenericFunctions.ts index 9f972f41e3206..bf9b4aa634353 100644 --- a/packages/nodes-base/nodes/MySql/GenericFunctions.ts +++ b/packages/nodes-base/nodes/MySql/GenericFunctions.ts @@ -31,7 +31,7 @@ export function copyInputItems(items: INodeExecutionData[], properties: string[] }); } -export function createConnection( +export async function createConnection( credentials: ICredentialDataDecryptedObject, ): Promise { const { ssl, caCertificate, clientCertificate, clientPrivateKey, ...baseCredentials } = diff --git a/packages/nodes-base/nodes/MySql/MySql.node.ts b/packages/nodes-base/nodes/MySql/MySql.node.ts index 949d39f770ac6..04aaaae3b1cd4 100644 --- a/packages/nodes-base/nodes/MySql/MySql.node.ts +++ b/packages/nodes-base/nodes/MySql/MySql.node.ts @@ -287,7 +287,7 @@ export class MySql implements INodeType { // ---------------------------------- try { - const queryQueue = items.map((item, index) => { + const queryQueue = items.map(async (item, index) => { const rawQuery = this.getNodeParameter('query', index) as string; return connection.query(rawQuery); @@ -371,7 +371,7 @@ export class MySql implements INodeType { const updateSQL = `UPDATE ${table} SET ${columns .map((column) => `${column} = ?`) .join(',')} WHERE ${updateKey} = ?;`; - const queryQueue = updateItems.map((item) => + const queryQueue = updateItems.map(async (item) => connection.query(updateSQL, Object.values(item).concat(item[updateKey])), ); const queryResult = await Promise.all(queryQueue); diff --git a/packages/nodes-base/nodes/NoOp/NoOp.node.ts b/packages/nodes-base/nodes/NoOp/NoOp.node.ts index 2835a33781f0a..804531c7e67f9 100644 --- a/packages/nodes-base/nodes/NoOp/NoOp.node.ts +++ b/packages/nodes-base/nodes/NoOp/NoOp.node.ts @@ -18,7 +18,7 @@ export class NoOp implements INodeType { properties: [], }; - execute(this: IExecuteFunctions): Promise { + async execute(this: IExecuteFunctions): Promise { const items = this.getInputData(); return this.prepareOutputData(items); diff --git a/packages/nodes-base/nodes/Redis/Redis.node.ts b/packages/nodes-base/nodes/Redis/Redis.node.ts index 5a7f5ee8044db..4a64429359875 100644 --- a/packages/nodes-base/nodes/Redis/Redis.node.ts +++ b/packages/nodes-base/nodes/Redis/Redis.node.ts @@ -540,7 +540,7 @@ export class Redis implements INodeType { }, }; - execute(this: IExecuteFunctions): Promise { + async execute(this: IExecuteFunctions): Promise { // Parses the given value in a number if it is one else returns a string function getParsedValue(value: string): string | number { if (value.match(/^[\d\.]+$/) === null) { diff --git a/packages/nodes-base/nodes/Rundeck/RundeckApi.ts b/packages/nodes-base/nodes/Rundeck/RundeckApi.ts index 59a47bd8f3566..b31a3955b545a 100644 --- a/packages/nodes-base/nodes/Rundeck/RundeckApi.ts +++ b/packages/nodes-base/nodes/Rundeck/RundeckApi.ts @@ -48,7 +48,7 @@ export class RundeckApi { this.credentials = credentials as unknown as RundeckCredentials; } - executeJob(jobId: string, args: IDataObject[]): Promise { + async executeJob(jobId: string, args: IDataObject[]): Promise { let params = ''; if (args) { @@ -64,7 +64,7 @@ export class RundeckApi { return this.request('POST', `/api/14/job/${jobId}/run`, body, {}); } - getJobMetadata(jobId: string): Promise { + async getJobMetadata(jobId: string): Promise { return this.request('GET', `/api/18/job/${jobId}/info`, {}, {}); } } diff --git a/packages/nodes-base/nodes/Salesforce/GenericFunctions.ts b/packages/nodes-base/nodes/Salesforce/GenericFunctions.ts index 5560ff073eace..f56b43144533a 100644 --- a/packages/nodes-base/nodes/Salesforce/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Salesforce/GenericFunctions.ts @@ -139,7 +139,7 @@ function getOptions( return options; } -function getAccessToken( +async function getAccessToken( this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, credentials: IDataObject, ): Promise { diff --git a/packages/nodes-base/nodes/Set/Set.node.ts b/packages/nodes-base/nodes/Set/Set.node.ts index 87ef394f7d3fd..5c4a350893e64 100644 --- a/packages/nodes-base/nodes/Set/Set.node.ts +++ b/packages/nodes-base/nodes/Set/Set.node.ts @@ -133,7 +133,7 @@ export class Set implements INodeType { ], }; - execute(this: IExecuteFunctions): Promise { + async execute(this: IExecuteFunctions): Promise { const items = this.getInputData(); if (items.length === 0) { diff --git a/packages/nodes-base/nodes/Snowflake/GenericFunctions.ts b/packages/nodes-base/nodes/Snowflake/GenericFunctions.ts index 389187e3bcab4..46fbb4280898a 100644 --- a/packages/nodes-base/nodes/Snowflake/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Snowflake/GenericFunctions.ts @@ -2,7 +2,7 @@ import { deepCopy, IDataObject, INodeExecutionData } from 'n8n-workflow'; import snowflake from 'snowflake-sdk'; -export function connect(conn: snowflake.Connection) { +export async function connect(conn: snowflake.Connection) { return new Promise((resolve, reject) => { conn.connect((err, _conn) => { if (!err) { @@ -15,7 +15,7 @@ export function connect(conn: snowflake.Connection) { }); } -export function destroy(conn: snowflake.Connection) { +export async function destroy(conn: snowflake.Connection) { return new Promise((resolve, reject) => { conn.destroy((err, _conn) => { if (!err) { @@ -28,7 +28,11 @@ export function destroy(conn: snowflake.Connection) { }); } -export function execute(conn: snowflake.Connection, sqlText: string, binds: snowflake.InsertBinds) { +export async function execute( + conn: snowflake.Connection, + sqlText: string, + binds: snowflake.InsertBinds, +) { return new Promise((resolve, reject) => { conn.execute({ sqlText, diff --git a/packages/nodes-base/nodes/Splunk/GenericFunctions.ts b/packages/nodes-base/nodes/Splunk/GenericFunctions.ts index e760bc6889499..36a8cdb6fa3b7 100644 --- a/packages/nodes-base/nodes/Splunk/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Splunk/GenericFunctions.ts @@ -69,7 +69,7 @@ export async function splunkApiRequest( // utils // ---------------------------------------- -export function parseXml(xml: string) { +export async function parseXml(xml: string) { return new Promise((resolve, reject) => { parseString(xml, { explicitArray: false }, (error, result) => { error ? reject(error) : resolve(result); diff --git a/packages/nodes-base/nodes/Start/Start.node.ts b/packages/nodes-base/nodes/Start/Start.node.ts index 73593925ca4b3..b64f5ba04f823 100644 --- a/packages/nodes-base/nodes/Start/Start.node.ts +++ b/packages/nodes-base/nodes/Start/Start.node.ts @@ -29,7 +29,7 @@ export class Start implements INodeType { ], }; - execute(this: IExecuteFunctions): Promise { + async execute(this: IExecuteFunctions): Promise { const items = this.getInputData(); return this.prepareOutputData(items); diff --git a/packages/nodes-base/nodes/StickyNote/StickyNote.node.ts b/packages/nodes-base/nodes/StickyNote/StickyNote.node.ts index 32d0140805d0a..c090afa7f7a56 100644 --- a/packages/nodes-base/nodes/StickyNote/StickyNote.node.ts +++ b/packages/nodes-base/nodes/StickyNote/StickyNote.node.ts @@ -42,7 +42,7 @@ export class StickyNote implements INodeType { ], }; - execute(this: IExecuteFunctions): Promise { + async execute(this: IExecuteFunctions): Promise { const items = this.getInputData(); return this.prepareOutputData(items); } diff --git a/packages/nodes-base/nodes/StopAndError/StopAndError.node.ts b/packages/nodes-base/nodes/StopAndError/StopAndError.node.ts index e04d2d0b09170..50c2e8045dcad 100644 --- a/packages/nodes-base/nodes/StopAndError/StopAndError.node.ts +++ b/packages/nodes-base/nodes/StopAndError/StopAndError.node.ts @@ -82,7 +82,7 @@ export class StopAndError implements INodeType { ], }; - execute(this: IExecuteFunctions): Promise { + async execute(this: IExecuteFunctions): Promise { const errorType = this.getNodeParameter('errorType', 0) as 'errorMessage' | 'errorObject'; const { id: workflowId, name: workflowName } = this.getWorkflow(); diff --git a/packages/nodes-base/nodes/Venafi/ProtectCloud/GenericFunctions.ts b/packages/nodes-base/nodes/Venafi/ProtectCloud/GenericFunctions.ts index 2da5c7e38792f..b926f07fb391f 100644 --- a/packages/nodes-base/nodes/Venafi/ProtectCloud/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Venafi/ProtectCloud/GenericFunctions.ts @@ -1,10 +1,6 @@ import { OptionsWithUri } from 'request'; -import { - IExecuteFunctions, - IExecuteSingleFunctions, - ILoadOptionsFunctions, -} from 'n8n-core'; +import { IExecuteFunctions, IExecuteSingleFunctions, ILoadOptionsFunctions } from 'n8n-core'; import { IDataObject, IHookFunctions, JsonObject, NodeApiError } from 'n8n-workflow'; @@ -118,7 +114,7 @@ export async function encryptPassphrase( let encryptedKeyPass = ''; let encryptedKeyStorePass = ''; - const promise = () => { + const promise = async () => { return new Promise((resolve, reject) => { // tslint:disable-next-line:no-any nacl_factory.instantiate((nacl: any) => { diff --git a/packages/nodes-base/nodes/Zoom/GenericFunctions.ts b/packages/nodes-base/nodes/Zoom/GenericFunctions.ts index 77f588b19a719..9713ac6138f2c 100644 --- a/packages/nodes-base/nodes/Zoom/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Zoom/GenericFunctions.ts @@ -69,7 +69,7 @@ export async function zoomApiRequestAllItems( return returnData; } -function wait() { +async function wait() { return new Promise((resolve, _reject) => { setTimeout(() => { resolve(true); From aca527c78f0e4dd2bf3c76439875aca1be8b7f4b Mon Sep 17 00:00:00 2001 From: Michael Kret Date: Sat, 6 May 2023 05:38:18 +0300 Subject: [PATCH 4/8] :zap: update --- packages/cli/src/ActiveWorkflowRunner.ts | 2 ++ .../editor-ui/src/__tests__/server/index.ts | 2 +- packages/editor-ui/src/__tests__/utils.ts | 4 ++-- packages/editor-ui/src/api/curlHelper.ts | 2 +- packages/editor-ui/src/api/ldap.ts | 10 ++++----- packages/editor-ui/src/api/sso.ts | 12 +++++----- packages/editor-ui/src/api/templates.ts | 2 +- packages/editor-ui/src/api/usage.ts | 6 ++--- packages/editor-ui/src/api/users.ts | 22 ++++++++++--------- packages/editor-ui/src/api/versionControl.ts | 14 +++++++----- .../src/components/CollectionParameter.vue | 2 +- .../components/FixedCollectionParameter.vue | 2 +- .../composables/useKeyboardNavigation.ts | 2 +- .../src/components/ParameterInputList.vue | 2 ++ packages/editor-ui/src/components/RunData.vue | 10 ++++----- .../src/composables/useHistoryHelper.ts | 4 ++-- packages/editor-ui/src/stores/sso.store.ts | 12 +++++----- .../src/views/SettingsCommunityNodesView.vue | 6 ++++- packages/editor-ui/src/views/SettingsView.vue | 4 +++- 19 files changed, 67 insertions(+), 53 deletions(-) diff --git a/packages/cli/src/ActiveWorkflowRunner.ts b/packages/cli/src/ActiveWorkflowRunner.ts index 2fe363b8509e0..5f1f3f390aa79 100644 --- a/packages/cli/src/ActiveWorkflowRunner.ts +++ b/packages/cli/src/ActiveWorkflowRunner.ts @@ -637,6 +637,7 @@ export class ActiveWorkflowRunner { ); if (donePromise) { + // eslint-disable-next-line @typescript-eslint/no-floating-promises executePromise.then((executionId) => { this.activeExecutions .getPostExecutePromise(executionId) @@ -694,6 +695,7 @@ export class ActiveWorkflowRunner { ); if (donePromise) { + // eslint-disable-next-line @typescript-eslint/no-floating-promises executePromise.then((executionId) => { this.activeExecutions .getPostExecutePromise(executionId) diff --git a/packages/editor-ui/src/__tests__/server/index.ts b/packages/editor-ui/src/__tests__/server/index.ts index 7eb78caacad29..f0dea12024c29 100644 --- a/packages/editor-ui/src/__tests__/server/index.ts +++ b/packages/editor-ui/src/__tests__/server/index.ts @@ -24,7 +24,7 @@ export function setupServer() { server.logging = false; // Handle undefined endpoints - server.post('/rest/:any', () => new Promise(() => {})); + server.post('/rest/:any', async () => new Promise(() => {})); // Handle defined endpoints for (const endpointsFn of endpoints) { diff --git a/packages/editor-ui/src/__tests__/utils.ts b/packages/editor-ui/src/__tests__/utils.ts index c6d167f06c3ee..047338fda145e 100644 --- a/packages/editor-ui/src/__tests__/utils.ts +++ b/packages/editor-ui/src/__tests__/utils.ts @@ -3,7 +3,7 @@ import { UserManagementAuthenticationMethod } from '@/Interface'; import { render } from '@testing-library/vue'; import { PiniaVuePlugin } from 'pinia'; -export const retry = (assertion: () => any, { interval = 20, timeout = 200 } = {}) => { +export const retry = async (assertion: () => any, { interval = 20, timeout = 200 } = {}) => { return new Promise((resolve, reject) => { const startTime = Date.now(); @@ -27,7 +27,7 @@ export const renderComponent = (Component: RenderParams[0], renderOptions: Rende vue.use(PiniaVuePlugin); }); -export const waitAllPromises = () => new Promise((resolve) => setTimeout(resolve)); +export const waitAllPromises = async () => new Promise((resolve) => setTimeout(resolve)); export const SETTINGS_STORE_DEFAULT_STATE: ISettingsState = { settings: { diff --git a/packages/editor-ui/src/api/curlHelper.ts b/packages/editor-ui/src/api/curlHelper.ts index 7089201eb2e70..2bb509b985136 100644 --- a/packages/editor-ui/src/api/curlHelper.ts +++ b/packages/editor-ui/src/api/curlHelper.ts @@ -1,7 +1,7 @@ import type { CurlToJSONResponse, IRestApiContext } from '@/Interface'; import { makeRestApiRequest } from '@/utils'; -export function getCurlToJson( +export async function getCurlToJson( context: IRestApiContext, curlCommand: string, ): Promise { diff --git a/packages/editor-ui/src/api/ldap.ts b/packages/editor-ui/src/api/ldap.ts index 2daa45905c782..0df604f297225 100644 --- a/packages/editor-ui/src/api/ldap.ts +++ b/packages/editor-ui/src/api/ldap.ts @@ -2,26 +2,26 @@ import type { ILdapConfig, ILdapSyncData, IRestApiContext } from '@/Interface'; import { makeRestApiRequest } from '@/utils'; import type { IDataObject } from 'n8n-workflow'; -export function getLdapConfig(context: IRestApiContext): Promise { +export async function getLdapConfig(context: IRestApiContext): Promise { return makeRestApiRequest(context, 'GET', '/ldap/config'); } -export function testLdapConnection(context: IRestApiContext): Promise<{}> { +export async function testLdapConnection(context: IRestApiContext): Promise<{}> { return makeRestApiRequest(context, 'POST', '/ldap/test-connection'); } -export function updateLdapConfig( +export async function updateLdapConfig( context: IRestApiContext, adConfig: ILdapConfig, ): Promise { return makeRestApiRequest(context, 'PUT', '/ldap/config', adConfig as unknown as IDataObject); } -export function runLdapSync(context: IRestApiContext, data: IDataObject): Promise<{}> { +export async function runLdapSync(context: IRestApiContext, data: IDataObject): Promise<{}> { return makeRestApiRequest(context, 'POST', '/ldap/sync', data as unknown as IDataObject); } -export function getLdapSynchronizations( +export async function getLdapSynchronizations( context: IRestApiContext, pagination: { page: number }, ): Promise { diff --git a/packages/editor-ui/src/api/sso.ts b/packages/editor-ui/src/api/sso.ts index 867a7799f9a63..fc169f82076b5 100644 --- a/packages/editor-ui/src/api/sso.ts +++ b/packages/editor-ui/src/api/sso.ts @@ -6,34 +6,34 @@ import type { SamlPreferencesExtractedData, } from '@/Interface'; -export const initSSO = (context: IRestApiContext): Promise => { +export const initSSO = async (context: IRestApiContext): Promise => { return makeRestApiRequest(context, 'GET', '/sso/saml/initsso'); }; -export const getSamlMetadata = (context: IRestApiContext): Promise => { +export const getSamlMetadata = async (context: IRestApiContext): Promise => { return makeRestApiRequest(context, 'GET', '/sso/saml/metadata'); }; -export const getSamlConfig = ( +export const getSamlConfig = async ( context: IRestApiContext, ): Promise => { return makeRestApiRequest(context, 'GET', '/sso/saml/config'); }; -export const saveSamlConfig = ( +export const saveSamlConfig = async ( context: IRestApiContext, data: SamlPreferences, ): Promise => { return makeRestApiRequest(context, 'POST', '/sso/saml/config', data); }; -export const toggleSamlConfig = ( +export const toggleSamlConfig = async ( context: IRestApiContext, data: SamlPreferencesLoginEnabled, ): Promise => { return makeRestApiRequest(context, 'POST', '/sso/saml/config/toggle', data); }; -export const testSamlConfig = (context: IRestApiContext): Promise => { +export const testSamlConfig = async (context: IRestApiContext): Promise => { return makeRestApiRequest(context, 'GET', '/sso/saml/config/test'); }; diff --git a/packages/editor-ui/src/api/templates.ts b/packages/editor-ui/src/api/templates.ts index 1ac4a86576162..0fc04a75294bd 100644 --- a/packages/editor-ui/src/api/templates.ts +++ b/packages/editor-ui/src/api/templates.ts @@ -18,7 +18,7 @@ export async function testHealthEndpoint(apiEndpoint: string) { return get(apiEndpoint, '/health'); } -export function getCategories( +export async function getCategories( apiEndpoint: string, headers?: IDataObject, ): Promise<{ categories: ITemplatesCategory[] }> { diff --git a/packages/editor-ui/src/api/usage.ts b/packages/editor-ui/src/api/usage.ts index 8d79f59e7761b..4dabccdb3418f 100644 --- a/packages/editor-ui/src/api/usage.ts +++ b/packages/editor-ui/src/api/usage.ts @@ -1,17 +1,17 @@ import { makeRestApiRequest } from '@/utils'; import type { IRestApiContext, UsageState } from '@/Interface'; -export const getLicense = (context: IRestApiContext): Promise => { +export const getLicense = async (context: IRestApiContext): Promise => { return makeRestApiRequest(context, 'GET', '/license'); }; -export const activateLicenseKey = ( +export const activateLicenseKey = async ( context: IRestApiContext, data: { activationKey: string }, ): Promise => { return makeRestApiRequest(context, 'POST', '/license/activate', data); }; -export const renewLicense = (context: IRestApiContext): Promise => { +export const renewLicense = async (context: IRestApiContext): Promise => { return makeRestApiRequest(context, 'POST', '/license/renew'); }; diff --git a/packages/editor-ui/src/api/users.ts b/packages/editor-ui/src/api/users.ts index f53b5923ee96a..a5350a2ee0522 100644 --- a/packages/editor-ui/src/api/users.ts +++ b/packages/editor-ui/src/api/users.ts @@ -8,11 +8,13 @@ import type { import type { IDataObject } from 'n8n-workflow'; import { makeRestApiRequest } from '@/utils/apiUtils'; -export function loginCurrentUser(context: IRestApiContext): Promise { +export async function loginCurrentUser( + context: IRestApiContext, +): Promise { return makeRestApiRequest(context, 'GET', '/login'); } -export function login( +export async function login( context: IRestApiContext, params: { email: string; password: string }, ): Promise { @@ -23,13 +25,13 @@ export async function logout(context: IRestApiContext): Promise { await makeRestApiRequest(context, 'POST', '/logout'); } -export function preOwnerSetup( +export async function preOwnerSetup( context: IRestApiContext, ): Promise<{ credentials: number; workflows: number }> { return makeRestApiRequest(context, 'GET', '/owner/pre-setup'); } -export function setupOwner( +export async function setupOwner( context: IRestApiContext, params: { firstName: string; lastName: string; email: string; password: string }, ): Promise { @@ -40,14 +42,14 @@ export async function skipOwnerSetup(context: IRestApiContext): Promise { return makeRestApiRequest(context, 'POST', '/owner/skip-setup'); } -export function validateSignupToken( +export async function validateSignupToken( context: IRestApiContext, params: { inviterId: string; inviteeId: string }, ): Promise<{ inviter: { firstName: string; lastName: string } }> { return makeRestApiRequest(context, 'GET', '/resolve-signup-token', params); } -export function signup( +export async function signup( context: IRestApiContext, params: { inviterId: string; @@ -87,7 +89,7 @@ export async function changePassword( await makeRestApiRequest(context, 'POST', '/change-password', params); } -export function updateCurrentUser( +export async function updateCurrentUser( context: IRestApiContext, params: { id?: string; @@ -99,14 +101,14 @@ export function updateCurrentUser( return makeRestApiRequest(context, 'PATCH', '/me', params as unknown as IDataObject); } -export function updateCurrentUserSettings( +export async function updateCurrentUserSettings( context: IRestApiContext, settings: IUserResponse['settings'], ): Promise { return makeRestApiRequest(context, 'PATCH', '/me/settings', settings); } -export function updateCurrentUserPassword( +export async function updateCurrentUserPassword( context: IRestApiContext, params: { newPassword: string; currentPassword: string }, ): Promise { @@ -124,7 +126,7 @@ export async function getUsers(context: IRestApiContext): Promise, ): Promise { diff --git a/packages/editor-ui/src/api/versionControl.ts b/packages/editor-ui/src/api/versionControl.ts index d4b78a5654205..2074c14971ea2 100644 --- a/packages/editor-ui/src/api/versionControl.ts +++ b/packages/editor-ui/src/api/versionControl.ts @@ -4,33 +4,35 @@ import type { IDataObject } from 'n8n-workflow'; const versionControlApiRoot = '/version-control'; -export const initSsh = (context: IRestApiContext, data: IDataObject): Promise => { +export const initSsh = async (context: IRestApiContext, data: IDataObject): Promise => { return makeRestApiRequest(context, 'POST', `${versionControlApiRoot}/init-ssh`, data); }; -export const initRepository = ( +export const initRepository = async ( context: IRestApiContext, ): Promise<{ branches: string[]; currentBranch: string }> => { return makeRestApiRequest(context, 'POST', `${versionControlApiRoot}/init-repository`); }; -export const sync = (context: IRestApiContext, data: IDataObject): Promise => { +export const sync = async (context: IRestApiContext, data: IDataObject): Promise => { return makeRestApiRequest(context, 'POST', `${versionControlApiRoot}/push`, data); }; -export const getConfig = ( +export const getConfig = async ( context: IRestApiContext, ): Promise<{ remoteRepository: string; name: string; email: string; currentBranch: string }> => { return makeRestApiRequest(context, 'GET', `${versionControlApiRoot}/config`); }; -export const setPreferences = ( +export const setPreferences = async ( context: IRestApiContext, preferences: Partial, ): Promise => { return makeRestApiRequest(context, 'POST', `${versionControlApiRoot}/preferences`, preferences); }; -export const getPreferences = (context: IRestApiContext): Promise => { +export const getPreferences = async ( + context: IRestApiContext, +): Promise => { return makeRestApiRequest(context, 'GET', `${versionControlApiRoot}/preferences`); }; diff --git a/packages/editor-ui/src/components/CollectionParameter.vue b/packages/editor-ui/src/components/CollectionParameter.vue index 1e0c7aa7e7065..8fc56e550842d 100644 --- a/packages/editor-ui/src/components/CollectionParameter.vue +++ b/packages/editor-ui/src/components/CollectionParameter.vue @@ -71,7 +71,7 @@ export default mixins(nodeHelpers).extend({ 'isReadOnly', // boolean ], components: { - ParameterInputList: () => import('./ParameterInputList.vue') as Promise, + ParameterInputList: async () => import('./ParameterInputList.vue') as Promise, }, data() { return { diff --git a/packages/editor-ui/src/components/FixedCollectionParameter.vue b/packages/editor-ui/src/components/FixedCollectionParameter.vue index b817034551054..6cc5a6dacc5e8 100644 --- a/packages/editor-ui/src/components/FixedCollectionParameter.vue +++ b/packages/editor-ui/src/components/FixedCollectionParameter.vue @@ -151,7 +151,7 @@ export default defineComponent({ }, }, components: { - ParameterInputList: () => import('./ParameterInputList.vue') as Promise, + ParameterInputList: async () => import('./ParameterInputList.vue') as Promise, }, data() { return { diff --git a/packages/editor-ui/src/components/Node/NodeCreator/composables/useKeyboardNavigation.ts b/packages/editor-ui/src/components/Node/NodeCreator/composables/useKeyboardNavigation.ts index 8e1b81910f7a4..f6e4782427666 100644 --- a/packages/editor-ui/src/components/Node/NodeCreator/composables/useKeyboardNavigation.ts +++ b/packages/editor-ui/src/components/Node/NodeCreator/composables/useKeyboardNavigation.ts @@ -31,7 +31,7 @@ export const useKeyboardNavigation = defineStore('nodeCreatorKeyboardNavigation' function getElementId(element?: Element) { return element?.getAttribute(KEYBOARD_ID_ATTR) || undefined; } - function refreshSelectableItems(): Promise { + async function refreshSelectableItems(): Promise { return new Promise((resolve) => { // Wait for DOM to update cleanupSelectableItems(); diff --git a/packages/editor-ui/src/components/ParameterInputList.vue b/packages/editor-ui/src/components/ParameterInputList.vue index da69b7388ea3d..809f500f2383c 100644 --- a/packages/editor-ui/src/components/ParameterInputList.vue +++ b/packages/editor-ui/src/components/ParameterInputList.vue @@ -140,7 +140,9 @@ export default mixins(workflowHelpers).extend({ components: { MultipleParameter, ParameterInputFull, + // eslint-disable-next-line @typescript-eslint/promise-function-async FixedCollectionParameter: () => import('./FixedCollectionParameter.vue') as Promise, + // eslint-disable-next-line @typescript-eslint/promise-function-async CollectionParameter: () => import('./CollectionParameter.vue') as Promise, ImportParameter, }, diff --git a/packages/editor-ui/src/components/RunData.vue b/packages/editor-ui/src/components/RunData.vue index 0a0b43fa68db1..9d638016a6968 100644 --- a/packages/editor-ui/src/components/RunData.vue +++ b/packages/editor-ui/src/components/RunData.vue @@ -515,10 +515,10 @@ import { mapStores } from 'pinia'; import { useNDVStore } from '@/stores/ndv.store'; import { useNodeTypesStore } from '@/stores/nodeTypes.store'; -const RunDataTable = () => import('@/components/RunDataTable.vue'); -const RunDataJson = () => import('@/components/RunDataJson.vue'); -const RunDataSchema = () => import('@/components/RunDataSchema.vue'); -const RunDataHtml = () => import('@/components/RunDataHtml.vue'); +const RunDataTable = async () => import('@/components/RunDataTable.vue'); +const RunDataJson = async () => import('@/components/RunDataJson.vue'); +const RunDataSchema = async () => import('@/components/RunDataSchema.vue'); +const RunDataHtml = async () => import('@/components/RunDataHtml.vue'); export type EnterEditModeArgs = { origin: 'editIconButton' | 'insertTestDataLink'; @@ -1259,7 +1259,7 @@ export default mixins(externalHooks, genericHelpers, nodeHelpers, pinData).exten return; } else { const bufferString = 'data:' + mimeType + ';base64,' + data; - const blob = await fetch(bufferString).then((d) => d.blob()); + const blob = await fetch(bufferString).then(async (d) => d.blob()); saveAs(blob, fileName); } }, diff --git a/packages/editor-ui/src/composables/useHistoryHelper.ts b/packages/editor-ui/src/composables/useHistoryHelper.ts index 743f2c2242f47..e80e919d8517c 100644 --- a/packages/editor-ui/src/composables/useHistoryHelper.ts +++ b/packages/editor-ui/src/composables/useHistoryHelper.ts @@ -27,7 +27,7 @@ export function useHistoryHelper(activeRoute: Route) { const isNDVOpen = ref(ndvStore.activeNodeName !== null); - const undo = () => + const undo = async () => callDebounced( async () => { const command = historyStore.popUndoableToUndo(); @@ -56,7 +56,7 @@ export function useHistoryHelper(activeRoute: Route) { { debounceTime: UNDO_REDO_DEBOUNCE_INTERVAL }, ); - const redo = () => + const redo = async () => callDebounced( async () => { const command = historyStore.popUndoableToRedo(); diff --git a/packages/editor-ui/src/stores/sso.store.ts b/packages/editor-ui/src/stores/sso.store.ts index b6ce510287f91..20b0a7ae9ec6b 100644 --- a/packages/editor-ui/src/stores/sso.store.ts +++ b/packages/editor-ui/src/stores/sso.store.ts @@ -50,16 +50,16 @@ export const useSSOStore = defineStore('sso', () => { isDefaultAuthenticationSaml.value, ); - const getSSORedirectUrl = () => ssoApi.initSSO(rootStore.getRestApiContext); + const getSSORedirectUrl = async () => ssoApi.initSSO(rootStore.getRestApiContext); - const toggleLoginEnabled = (enabled: boolean) => + const toggleLoginEnabled = async (enabled: boolean) => ssoApi.toggleSamlConfig(rootStore.getRestApiContext, { loginEnabled: enabled }); - const getSamlMetadata = () => ssoApi.getSamlMetadata(rootStore.getRestApiContext); - const getSamlConfig = () => ssoApi.getSamlConfig(rootStore.getRestApiContext); - const saveSamlConfig = (config: SamlPreferences) => + const getSamlMetadata = async () => ssoApi.getSamlMetadata(rootStore.getRestApiContext); + const getSamlConfig = async () => ssoApi.getSamlConfig(rootStore.getRestApiContext); + const saveSamlConfig = async (config: SamlPreferences) => ssoApi.saveSamlConfig(rootStore.getRestApiContext, config); - const testSamlConfig = () => ssoApi.testSamlConfig(rootStore.getRestApiContext); + const testSamlConfig = async () => ssoApi.testSamlConfig(rootStore.getRestApiContext); const updateUser = async (params: { firstName: string; lastName: string }) => updateCurrentUser(rootStore.getRestApiContext, { diff --git a/packages/editor-ui/src/views/SettingsCommunityNodesView.vue b/packages/editor-ui/src/views/SettingsCommunityNodesView.vue index 28bbb455252b0..7bef6d1bfbf33 100644 --- a/packages/editor-ui/src/views/SettingsCommunityNodesView.vue +++ b/packages/editor-ui/src/views/SettingsCommunityNodesView.vue @@ -216,7 +216,11 @@ export default mixins(showMessage, pushConnection).extend({ is_empty_state: this.communityNodesStore.getInstalledPackages.length === 0, }; this.$telemetry.track('user clicked cnr install button', telemetryPayload); - void this.$externalHooks().run('settingsCommunityNodesView.openInstallModal', telemetryPayload); + + void this.$externalHooks().run( + 'settingsCommunityNodesView.openInstallModal', + telemetryPayload, + ); this.uiStore.openModal(COMMUNITY_PACKAGE_INSTALL_MODAL_KEY); }, }, diff --git a/packages/editor-ui/src/views/SettingsView.vue b/packages/editor-ui/src/views/SettingsView.vue index d21afd7ef3758..3330ccaf95e19 100644 --- a/packages/editor-ui/src/views/SettingsView.vue +++ b/packages/editor-ui/src/views/SettingsView.vue @@ -37,7 +37,9 @@ const SettingsView = defineComponent({ }, methods: { onReturn() { - void this.$router.push(this.previousRoute ? this.previousRoute.path : { name: VIEWS.HOMEPAGE }); + void this.$router.push( + this.previousRoute ? this.previousRoute.path : { name: VIEWS.HOMEPAGE }, + ); }, }, }); From 808d59bc2d28d9c6b3eaf999820e907d919a0fa3 Mon Sep 17 00:00:00 2001 From: Michael Kret Date: Sat, 6 May 2023 05:51:15 +0300 Subject: [PATCH 5/8] :zap: reverted changes in cli package --- packages/cli/src/ActiveWorkflowRunner.ts | 5 +++-- packages/cli/src/WaitTracker.ts | 5 +++-- packages/cli/src/WaitingWebhooks.ts | 3 ++- packages/cli/src/WorkflowRunner.ts | 18 ++++++++++-------- packages/cli/src/WorkflowRunnerProcess.ts | 3 ++- packages/cli/src/commands/worker.ts | 4 ++-- 6 files changed, 22 insertions(+), 16 deletions(-) diff --git a/packages/cli/src/ActiveWorkflowRunner.ts b/packages/cli/src/ActiveWorkflowRunner.ts index 5f1f3f390aa79..998086f7a2332 100644 --- a/packages/cli/src/ActiveWorkflowRunner.ts +++ b/packages/cli/src/ActiveWorkflowRunner.ts @@ -2,6 +2,7 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ /* eslint-disable no-param-reassign */ /* eslint-disable no-await-in-loop */ +/* eslint-disable @typescript-eslint/no-floating-promises */ /* eslint-disable no-restricted-syntax */ /* eslint-disable @typescript-eslint/no-shadow */ /* eslint-disable @typescript-eslint/no-unsafe-call */ @@ -626,7 +627,7 @@ export class ActiveWorkflowRunner { ): void => { // eslint-disable-next-line @typescript-eslint/restrict-template-expressions Logger.debug(`Received event to trigger execution for workflow "${workflow.name}"`); - void WorkflowHelpers.saveStaticData(workflow); + WorkflowHelpers.saveStaticData(workflow); const executePromise = this.runWorkflow( workflowData, node, @@ -683,7 +684,7 @@ export class ActiveWorkflowRunner { ): void => { // eslint-disable-next-line @typescript-eslint/restrict-template-expressions Logger.debug(`Received trigger for workflow "${workflow.name}"`); - void WorkflowHelpers.saveStaticData(workflow); + WorkflowHelpers.saveStaticData(workflow); // eslint-disable-next-line id-denylist const executePromise = this.runWorkflow( workflowData, diff --git a/packages/cli/src/WaitTracker.ts b/packages/cli/src/WaitTracker.ts index 0027e4a33e1c5..e04daee126ae5 100644 --- a/packages/cli/src/WaitTracker.ts +++ b/packages/cli/src/WaitTracker.ts @@ -3,6 +3,7 @@ /* eslint-disable @typescript-eslint/naming-convention */ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ /* eslint-disable @typescript-eslint/restrict-template-expressions */ +/* eslint-disable @typescript-eslint/no-floating-promises */ // eslint-disable-next-line @typescript-eslint/no-unused-vars import { ErrorReporterProxy as ErrorReporter, @@ -39,10 +40,10 @@ export class WaitTracker { constructor() { // Poll every 60 seconds a list of upcoming executions this.mainTimer = setInterval(() => { - void this.getWaitingExecutions(); + this.getWaitingExecutions(); }, 60000); - void this.getWaitingExecutions(); + this.getWaitingExecutions(); } // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types diff --git a/packages/cli/src/WaitingWebhooks.ts b/packages/cli/src/WaitingWebhooks.ts index e5f8497b48554..f5e9ac6344e8e 100644 --- a/packages/cli/src/WaitingWebhooks.ts +++ b/packages/cli/src/WaitingWebhooks.ts @@ -130,7 +130,8 @@ export class WaitingWebhooks { return new Promise((resolve, reject) => { const executionMode = 'webhook'; - void WebhookHelpers.executeWebhook( + // eslint-disable-next-line @typescript-eslint/no-floating-promises + WebhookHelpers.executeWebhook( workflow, webhookData, workflowData as IWorkflowDb, diff --git a/packages/cli/src/WorkflowRunner.ts b/packages/cli/src/WorkflowRunner.ts index fc0b3cf9f5213..c785a2fa22160 100644 --- a/packages/cli/src/WorkflowRunner.ts +++ b/packages/cli/src/WorkflowRunner.ts @@ -5,6 +5,7 @@ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ /* eslint-disable @typescript-eslint/restrict-template-expressions */ /* eslint-disable @typescript-eslint/no-shadow */ +/* eslint-disable @typescript-eslint/no-floating-promises */ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ /* eslint-disable @typescript-eslint/prefer-optional-chain */ /* eslint-disable no-param-reassign */ @@ -74,7 +75,8 @@ export class WorkflowRunner { * The process did send a hook message so execute the appropriate hook */ processHookMessage(workflowHooks: WorkflowHooks, hookData: IProcessMessageDataHook) { - void workflowHooks.executeHookFunctions(hookData.hook, hookData.parameters); + // eslint-disable-next-line @typescript-eslint/no-floating-promises + workflowHooks.executeHookFunctions(hookData.hook, hookData.parameters); } /** @@ -303,7 +305,7 @@ export class WorkflowRunner { error, error.node, ); - await additionalData.hooks + additionalData.hooks .executeHookFunctions('workflowExecuteAfter', [failedExecution]) .then(() => { this.activeExecutions.remove(executionId, failedExecution); @@ -380,7 +382,7 @@ export class WorkflowRunner { if (workflowTimeout > 0) { const timeout = Math.min(workflowTimeout, config.getEnv('executions.maxTimeout')) * 1000; // as seconds executionTimeout = setTimeout(() => { - void this.activeExecutions.stopExecution(executionId, 'timeout'); + this.activeExecutions.stopExecution(executionId, 'timeout'); }, timeout); } @@ -394,7 +396,7 @@ export class WorkflowRunner { this.activeExecutions.remove(executionId, fullRunData); }) .catch((error) => { - void this.processError( + this.processError( error, new Date(), data.executionMode, @@ -465,7 +467,7 @@ export class WorkflowRunner { // Normally also workflow should be supplied here but as it only used for sending // data to editor-UI is not needed. - await hooks.executeHookFunctions('workflowExecuteBefore', []); + hooks.executeHookFunctions('workflowExecuteBefore', []); } catch (error) { // We use "getWorkflowHooksWorkerExecuter" as "getWorkflowHooksWorkerMain" does not contain the // "workflowExecuteAfter" which we require. @@ -583,7 +585,7 @@ export class WorkflowRunner { this.activeExecutions.remove(executionId, runData); // Normally also static data should be supplied here but as it only used for sending // data to editor-UI is not needed. - await hooks.executeHookFunctions('workflowExecuteAfter', [runData]); + hooks.executeHookFunctions('workflowExecuteAfter', [runData]); try { // Check if this execution data has to be removed from database // based on workflow settings. @@ -666,7 +668,7 @@ export class WorkflowRunner { let workflowTimeout = workflowSettings.executionTimeout ?? config.getEnv('executions.timeout'); // initialize with default const processTimeoutFunction = (timeout: number) => { - void this.activeExecutions.stopExecution(executionId, 'timeout'); + this.activeExecutions.stopExecution(executionId, 'timeout'); executionTimeout = setTimeout(() => subprocess.kill(), Math.max(timeout * 0.2, 5000)); // minimum 5 seconds }; @@ -730,7 +732,7 @@ export class WorkflowRunner { const timeoutError = new WorkflowOperationError('Workflow execution timed out!'); // No need to add hook here as the subprocess takes care of calling the hooks - await this.processError(timeoutError, startedAt, data.executionMode, executionId); + this.processError(timeoutError, startedAt, data.executionMode, executionId); } else if (message.type === 'startExecution') { const executionId = await this.activeExecutions.add(message.data.runData); childExecutionIds.push(executionId); diff --git a/packages/cli/src/WorkflowRunnerProcess.ts b/packages/cli/src/WorkflowRunnerProcess.ts index 6beba9bcd9c4a..0e4bb08137e13 100644 --- a/packages/cli/src/WorkflowRunnerProcess.ts +++ b/packages/cli/src/WorkflowRunnerProcess.ts @@ -497,7 +497,8 @@ process.on('message', async (message: IProcessMessage) => { status: 'canceled', }; - await workflowRunner.sendHookToParentProcess('workflowExecuteAfter', [runData]); + // eslint-disable-next-line @typescript-eslint/no-floating-promises + workflowRunner.sendHookToParentProcess('workflowExecuteAfter', [runData]); } await sendToParentProcess(message.type === 'timeout' ? message.type : 'end', { diff --git a/packages/cli/src/commands/worker.ts b/packages/cli/src/commands/worker.ts index d1defd30402de..48d2269d0e171 100644 --- a/packages/cli/src/commands/worker.ts +++ b/packages/cli/src/commands/worker.ts @@ -51,8 +51,8 @@ export class Worker extends BaseCommand { LoggerProxy.info('Stopping n8n...'); // Stop accepting new jobs - - await Worker.jobQueue.pause(true); + // eslint-disable-next-line @typescript-eslint/no-floating-promises + Worker.jobQueue.pause(true); try { await this.externalHooks.run('n8n.stop', []); From 84eecdd523ec6cd002830dd2ab6c49c8ec5602f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=95=E0=A4=BE=E0=A4=B0=E0=A4=A4=E0=A5=8B=E0=A4=AB?= =?UTF-8?q?=E0=A5=8D=E0=A4=AB=E0=A5=87=E0=A4=B2=E0=A4=B8=E0=A5=8D=E0=A4=95?= =?UTF-8?q?=E0=A5=8D=E0=A4=B0=E0=A4=BF=E0=A4=AA=E0=A5=8D=E0=A4=9F=E2=84=A2?= Date: Wed, 10 May 2023 14:45:02 +0200 Subject: [PATCH 6/8] remove the promise-function-async exception --- packages/editor-ui/src/components/ParameterInputList.vue | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/editor-ui/src/components/ParameterInputList.vue b/packages/editor-ui/src/components/ParameterInputList.vue index 809f500f2383c..738f2a536d216 100644 --- a/packages/editor-ui/src/components/ParameterInputList.vue +++ b/packages/editor-ui/src/components/ParameterInputList.vue @@ -128,7 +128,7 @@ import ImportParameter from '@/components/ImportParameter.vue'; import { get, set } from 'lodash-es'; import mixins from 'vue-typed-mixins'; -import type { Component, PropType } from 'vue'; +import type { PropType } from 'vue'; import { mapStores } from 'pinia'; import { useNDVStore } from '@/stores/ndv.store'; import { useNodeTypesStore } from '@/stores/nodeTypes.store'; @@ -140,10 +140,8 @@ export default mixins(workflowHelpers).extend({ components: { MultipleParameter, ParameterInputFull, - // eslint-disable-next-line @typescript-eslint/promise-function-async - FixedCollectionParameter: () => import('./FixedCollectionParameter.vue') as Promise, - // eslint-disable-next-line @typescript-eslint/promise-function-async - CollectionParameter: () => import('./CollectionParameter.vue') as Promise, + FixedCollectionParameter: async () => import('./FixedCollectionParameter.vue'), + CollectionParameter: async () => import('./CollectionParameter.vue'), ImportParameter, }, props: { From a26894cf7b554cc2c687a72516d5677d73187d60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=95=E0=A4=BE=E0=A4=B0=E0=A4=A4=E0=A5=8B=E0=A4=AB?= =?UTF-8?q?=E0=A5=8D=E0=A4=AB=E0=A5=87=E0=A4=B2=E0=A4=B8=E0=A5=8D=E0=A4=95?= =?UTF-8?q?=E0=A5=8D=E0=A4=B0=E0=A4=BF=E0=A4=AA=E0=A5=8D=E0=A4=9F=E2=84=A2?= Date: Wed, 10 May 2023 14:46:16 +0200 Subject: [PATCH 7/8] revert changes to the cli package --- packages/cli/src/ActiveWorkflowRunner.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/cli/src/ActiveWorkflowRunner.ts b/packages/cli/src/ActiveWorkflowRunner.ts index 998086f7a2332..ca175b303b715 100644 --- a/packages/cli/src/ActiveWorkflowRunner.ts +++ b/packages/cli/src/ActiveWorkflowRunner.ts @@ -2,8 +2,8 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ /* eslint-disable no-param-reassign */ /* eslint-disable no-await-in-loop */ -/* eslint-disable @typescript-eslint/no-floating-promises */ /* eslint-disable no-restricted-syntax */ +/* eslint-disable @typescript-eslint/no-floating-promises */ /* eslint-disable @typescript-eslint/no-shadow */ /* eslint-disable @typescript-eslint/no-unsafe-call */ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ @@ -254,6 +254,7 @@ export class ActiveWorkflowRunner { } // @ts-ignore + // eslint-disable-next-line no-param-reassign path = webhook.webhookPath; // extracting params from path // @ts-ignore @@ -308,7 +309,8 @@ export class ActiveWorkflowRunner { return new Promise((resolve, reject) => { const executionMode = 'webhook'; - void WebhookHelpers.executeWebhook( + // @ts-ignore + WebhookHelpers.executeWebhook( workflow, webhookData, workflowData, @@ -638,7 +640,6 @@ export class ActiveWorkflowRunner { ); if (donePromise) { - // eslint-disable-next-line @typescript-eslint/no-floating-promises executePromise.then((executionId) => { this.activeExecutions .getPostExecutePromise(executionId) @@ -696,7 +697,6 @@ export class ActiveWorkflowRunner { ); if (donePromise) { - // eslint-disable-next-line @typescript-eslint/no-floating-promises executePromise.then((executionId) => { this.activeExecutions .getPostExecutePromise(executionId) From debd2538651e5d4e69e3d99d1daf5202f11fbc06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=95=E0=A4=BE=E0=A4=B0=E0=A4=A4=E0=A5=8B=E0=A4=AB?= =?UTF-8?q?=E0=A5=8D=E0=A4=AB=E0=A5=87=E0=A4=B2=E0=A4=B8=E0=A5=8D=E0=A4=95?= =?UTF-8?q?=E0=A5=8D=E0=A4=B0=E0=A4=BF=E0=A4=AA=E0=A5=8D=E0=A4=9F=E2=84=A2?= Date: Wed, 10 May 2023 16:28:47 +0200 Subject: [PATCH 8/8] remove all promises related linting exceptions in the editor code --- packages/editor-ui/.eslintrc.js | 2 -- packages/editor-ui/src/App.vue | 4 +-- packages/editor-ui/src/__tests__/utils.ts | 11 ++++++-- packages/editor-ui/src/api/api-keys.ts | 2 +- packages/editor-ui/src/api/communityNodes.ts | 6 ++-- packages/editor-ui/src/api/credentials.ee.ts | 2 +- packages/editor-ui/src/api/credentials.ts | 6 ++-- packages/editor-ui/src/api/curlHelper.ts | 2 +- packages/editor-ui/src/api/environments.ee.ts | 15 ++++------ packages/editor-ui/src/api/ldap.ts | 2 +- packages/editor-ui/src/api/nodeTypes.ts | 2 +- packages/editor-ui/src/api/settings.ts | 8 +++--- packages/editor-ui/src/api/tags.ts | 8 +++--- packages/editor-ui/src/api/templates.ts | 10 +++---- packages/editor-ui/src/api/usage.ts | 2 +- packages/editor-ui/src/api/users.ts | 2 +- packages/editor-ui/src/api/versions.ts | 4 +-- .../editor-ui/src/api/workflow-webhooks.ts | 6 ++-- packages/editor-ui/src/api/workflows.ee.ts | 2 +- packages/editor-ui/src/api/workflows.ts | 14 +++++----- .../src/components/CredentialCard.vue | 2 +- .../CredentialEdit/CredentialEdit.vue | 4 +-- .../CredentialEdit/CredentialSharing.ee.vue | 2 +- .../ExecutionsInfoAccordion.vue | 2 +- .../ExecutionsView/ExecutionsList.vue | 10 +++---- .../src/components/MainHeader/MainHeader.vue | 9 ++++-- .../editor-ui/src/components/MainSidebar.vue | 6 ++-- .../Node/NodeCreator/Modes/ActionsMode.vue | 4 +-- .../Node/NodeCreator/Panel/NodesListPanel.vue | 6 ++-- .../Node/NodeCreator/Panel/SearchBar.vue | 4 ++- .../__tests__/NodesListPanel.test.ts | 8 +++--- .../NodeCreator/composables/useActions.ts | 2 +- .../src/components/ParameterInput.vue | 6 ++-- .../src/components/PersonalizationModal.vue | 2 +- .../src/components/RunDataSchema.vue | 2 +- .../EventDestinationCard.ee.vue | 6 ++-- .../EventDestinationSettingsModal.ee.vue | 16 +++++------ .../EventSelection.ee.vue | 4 +-- .../SettingsLogStreaming/Helpers.ee.ts | 2 +- .../src/components/SettingsSidebar.vue | 10 +++---- .../components/TagsManager/TagsManager.vue | 4 +-- .../components/UserActivationSurveyModal.vue | 2 +- .../src/components/WorkflowActivator.vue | 2 +- .../src/components/WorkflowShareModal.ee.vue | 4 +-- .../__tests__/PersonalizationModal.spec.ts | 4 +-- .../src/composables/useExternalHooks.ts | 2 +- .../src/composables/useHistoryHelper.ts | 4 +-- .../editor-ui/src/composables/useMessage.ts | 12 ++++---- .../editor-ui/src/composables/useToast.ts | 2 +- .../src/composables/useUpgradeLink.ts | 2 +- packages/editor-ui/src/main.ts | 4 +-- .../editor-ui/src/mixins/pushConnection.ts | 10 +++---- .../editor-ui/src/mixins/workflowActivate.ts | 2 +- .../editor-ui/src/mixins/workflowHelpers.ts | 2 +- .../completions/datatype.completions.ts | 3 +- .../luxon.instance.docs.ts | 2 +- .../luxon.static.docs.ts | 2 +- .../editor-ui/src/stores/credentials.store.ts | 14 ++++------ .../editor-ui/src/stores/nodeTypes.store.ts | 2 +- .../editor-ui/src/stores/settings.store.ts | 10 +++---- packages/editor-ui/src/stores/sso.store.ts | 2 +- .../editor-ui/src/stores/templates.store.ts | 2 +- packages/editor-ui/src/stores/ui.store.ts | 8 +++--- packages/editor-ui/src/stores/usage.store.ts | 2 +- packages/editor-ui/src/stores/users.store.ts | 4 +-- .../editor-ui/src/stores/workflows.store.ts | 16 +++++------ packages/editor-ui/src/utils/apiUtils.ts | 4 +-- .../editor-ui/src/utils/nodeTypesUtils.ts | 6 ++-- packages/editor-ui/src/views/NodeView.vue | 28 +++++++++---------- .../editor-ui/src/views/SettingsUsersView.vue | 2 +- .../src/views/SettingsVersionControl.vue | 4 +-- packages/editor-ui/src/views/SetupView.vue | 6 ++-- packages/editor-ui/src/views/SigninView.vue | 2 +- packages/editor-ui/src/views/SignoutView.vue | 4 +-- packages/editor-ui/src/views/SignupView.vue | 2 +- .../editor-ui/src/views/WorkflowsView.vue | 3 +- packages/workflow/src/Extensions/index.ts | 3 +- packages/workflow/src/index.ts | 2 +- 78 files changed, 202 insertions(+), 204 deletions(-) diff --git a/packages/editor-ui/.eslintrc.js b/packages/editor-ui/.eslintrc.js index 9e7745320c8a8..4ac9eccb42b84 100644 --- a/packages/editor-ui/.eslintrc.js +++ b/packages/editor-ui/.eslintrc.js @@ -26,7 +26,6 @@ module.exports = { '@typescript-eslint/naming-convention': 'off', '@typescript-eslint/no-duplicate-imports': 'off', '@typescript-eslint/no-empty-interface': 'off', - '@typescript-eslint/no-floating-promises': 'off', '@typescript-eslint/no-for-in-array': 'off', '@typescript-eslint/no-loop-func': 'off', '@typescript-eslint/no-non-null-assertion': 'off', @@ -47,7 +46,6 @@ module.exports = { '@typescript-eslint/prefer-optional-chain': 'off', '@typescript-eslint/restrict-plus-operands': 'off', '@typescript-eslint/restrict-template-expressions': 'off', - '@typescript-eslint/return-await': 'off', '@typescript-eslint/unbound-method': 'off', '@typescript-eslint/ban-ts-comment': ['warn', { 'ts-ignore': true }], }, diff --git a/packages/editor-ui/src/App.vue b/packages/editor-ui/src/App.vue index 2a717b5b7091f..7bbd5c668a400 100644 --- a/packages/editor-ui/src/App.vue +++ b/packages/editor-ui/src/App.vue @@ -158,7 +158,7 @@ export default mixins(newVersions, showMessage, userHelpers).extend({ const redirect = decodeURIComponent(this.$route.query.redirect); if (redirect.startsWith('/')) { // protect against phishing - this.$router.replace(redirect); + void this.$router.replace(redirect); return; } } @@ -203,7 +203,7 @@ export default mixins(newVersions, showMessage, userHelpers).extend({ this.versionControlStore.isEnterpriseVersionControlEnabled && this.usersStore.isInstanceOwner ) { - this.versionControlStore.getPreferences(); + void this.versionControlStore.getPreferences(); } }, watch: { diff --git a/packages/editor-ui/src/__tests__/utils.ts b/packages/editor-ui/src/__tests__/utils.ts index 047338fda145e..f6f779709072a 100644 --- a/packages/editor-ui/src/__tests__/utils.ts +++ b/packages/editor-ui/src/__tests__/utils.ts @@ -43,8 +43,10 @@ export const SETTINGS_STORE_DEFAULT_STATE: ISettingsState = { ldap: false, saml: false, logStreaming: false, + variables: false, + versionControl: false, }, - executionMode: '', + executionMode: 'regular', executionTimeout: 0, hideUsagePage: false, hiringBannerEnabled: false, @@ -66,8 +68,8 @@ export const SETTINGS_STORE_DEFAULT_STATE: ISettingsState = { }, publicApi: { enabled: false, latestVersion: 0, path: '', swaggerUi: { enabled: false } }, pushBackend: 'sse', - saveDataErrorExecution: '', - saveDataSuccessExecution: '', + saveDataErrorExecution: 'all', + saveDataSuccessExecution: 'all', saveManualExecutions: false, sso: { ldap: { loginEnabled: false, loginLabel: '' }, @@ -94,6 +96,9 @@ export const SETTINGS_STORE_DEFAULT_STATE: ISettingsState = { deployment: { type: 'default', }, + variables: { + limit: 100, + }, }, promptsData: { message: '', diff --git a/packages/editor-ui/src/api/api-keys.ts b/packages/editor-ui/src/api/api-keys.ts index 590f846963dd5..7ba8ff8dcf8d3 100644 --- a/packages/editor-ui/src/api/api-keys.ts +++ b/packages/editor-ui/src/api/api-keys.ts @@ -1,5 +1,5 @@ import type { IRestApiContext } from '@/Interface'; -import { makeRestApiRequest } from '@/utils'; +import { makeRestApiRequest } from '@/utils/apiUtils'; export async function getApiKey(context: IRestApiContext): Promise<{ apiKey: string | null }> { return makeRestApiRequest(context, 'GET', '/me/api-key'); diff --git a/packages/editor-ui/src/api/communityNodes.ts b/packages/editor-ui/src/api/communityNodes.ts index ec8212bff36ba..bb75161b92daf 100644 --- a/packages/editor-ui/src/api/communityNodes.ts +++ b/packages/editor-ui/src/api/communityNodes.ts @@ -13,16 +13,16 @@ export async function installNewPackage( context: IRestApiContext, name: string, ): Promise { - return await post(context.baseUrl, '/nodes', { name }); + return post(context.baseUrl, '/nodes', { name }); } export async function uninstallPackage(context: IRestApiContext, name: string): Promise { - return await makeRestApiRequest(context, 'DELETE', '/nodes', { name }); + return makeRestApiRequest(context, 'DELETE', '/nodes', { name }); } export async function updatePackage( context: IRestApiContext, name: string, ): Promise { - return await makeRestApiRequest(context, 'PATCH', '/nodes', { name }); + return makeRestApiRequest(context, 'PATCH', '/nodes', { name }); } diff --git a/packages/editor-ui/src/api/credentials.ee.ts b/packages/editor-ui/src/api/credentials.ee.ts index 3067b906888d4..5ec8c434d005d 100644 --- a/packages/editor-ui/src/api/credentials.ee.ts +++ b/packages/editor-ui/src/api/credentials.ee.ts @@ -1,5 +1,5 @@ import type { ICredentialsResponse, IRestApiContext, IShareCredentialsPayload } from '@/Interface'; -import { makeRestApiRequest } from '@/utils'; +import { makeRestApiRequest } from '@/utils/apiUtils'; import type { IDataObject } from 'n8n-workflow'; export async function setCredentialSharedWith( diff --git a/packages/editor-ui/src/api/credentials.ts b/packages/editor-ui/src/api/credentials.ts index 3bef8e9e9fe41..7e205dfd3a839 100644 --- a/packages/editor-ui/src/api/credentials.ts +++ b/packages/editor-ui/src/api/credentials.ts @@ -3,7 +3,7 @@ import type { ICredentialsResponse, IRestApiContext, } from '@/Interface'; -import { makeRestApiRequest } from '@/utils'; +import { makeRestApiRequest } from '@/utils/apiUtils'; import type { ICredentialsDecrypted, ICredentialType, @@ -22,11 +22,11 @@ export async function getCredentialsNewName( context: IRestApiContext, name?: string, ): Promise<{ name: string }> { - return await makeRestApiRequest(context, 'GET', '/credentials/new', name ? { name } : {}); + return makeRestApiRequest(context, 'GET', '/credentials/new', name ? { name } : {}); } export async function getAllCredentials(context: IRestApiContext): Promise { - return await makeRestApiRequest(context, 'GET', '/credentials'); + return makeRestApiRequest(context, 'GET', '/credentials'); } export async function createNewCredential( diff --git a/packages/editor-ui/src/api/curlHelper.ts b/packages/editor-ui/src/api/curlHelper.ts index 2bb509b985136..206a40462b424 100644 --- a/packages/editor-ui/src/api/curlHelper.ts +++ b/packages/editor-ui/src/api/curlHelper.ts @@ -1,5 +1,5 @@ import type { CurlToJSONResponse, IRestApiContext } from '@/Interface'; -import { makeRestApiRequest } from '@/utils'; +import { makeRestApiRequest } from '@/utils/apiUtils'; export async function getCurlToJson( context: IRestApiContext, diff --git a/packages/editor-ui/src/api/environments.ee.ts b/packages/editor-ui/src/api/environments.ee.ts index f5a386a059319..09d91d2a5b76c 100644 --- a/packages/editor-ui/src/api/environments.ee.ts +++ b/packages/editor-ui/src/api/environments.ee.ts @@ -3,38 +3,33 @@ import { makeRestApiRequest } from '@/utils'; import type { IDataObject } from 'n8n-workflow'; export async function getVariables(context: IRestApiContext): Promise { - return await makeRestApiRequest(context, 'GET', '/variables'); + return makeRestApiRequest(context, 'GET', '/variables'); } export async function getVariable( context: IRestApiContext, { id }: { id: EnvironmentVariable['id'] }, ): Promise { - return await makeRestApiRequest(context, 'GET', `/variables/${id}`); + return makeRestApiRequest(context, 'GET', `/variables/${id}`); } export async function createVariable( context: IRestApiContext, data: Omit, ) { - return await makeRestApiRequest(context, 'POST', '/variables', data as unknown as IDataObject); + return makeRestApiRequest(context, 'POST', '/variables', data as unknown as IDataObject); } export async function updateVariable( context: IRestApiContext, { id, ...data }: EnvironmentVariable, ) { - return await makeRestApiRequest( - context, - 'PATCH', - `/variables/${id}`, - data as unknown as IDataObject, - ); + return makeRestApiRequest(context, 'PATCH', `/variables/${id}`, data as unknown as IDataObject); } export async function deleteVariable( context: IRestApiContext, { id }: { id: EnvironmentVariable['id'] }, ) { - return await makeRestApiRequest(context, 'DELETE', `/variables/${id}`); + return makeRestApiRequest(context, 'DELETE', `/variables/${id}`); } diff --git a/packages/editor-ui/src/api/ldap.ts b/packages/editor-ui/src/api/ldap.ts index 0df604f297225..0a90ff7abc8fa 100644 --- a/packages/editor-ui/src/api/ldap.ts +++ b/packages/editor-ui/src/api/ldap.ts @@ -1,5 +1,5 @@ import type { ILdapConfig, ILdapSyncData, IRestApiContext } from '@/Interface'; -import { makeRestApiRequest } from '@/utils'; +import { makeRestApiRequest } from '@/utils/apiUtils'; import type { IDataObject } from 'n8n-workflow'; export async function getLdapConfig(context: IRestApiContext): Promise { diff --git a/packages/editor-ui/src/api/nodeTypes.ts b/packages/editor-ui/src/api/nodeTypes.ts index 7c7b97a025d28..feea187bf8d3a 100644 --- a/packages/editor-ui/src/api/nodeTypes.ts +++ b/packages/editor-ui/src/api/nodeTypes.ts @@ -1,4 +1,4 @@ -import { makeRestApiRequest } from '@/utils'; +import { makeRestApiRequest } from '@/utils/apiUtils'; import type { INodeTranslationHeaders, IResourceLocatorReqParams, diff --git a/packages/editor-ui/src/api/settings.ts b/packages/editor-ui/src/api/settings.ts index 4806f66836a2e..1b0903f28f64c 100644 --- a/packages/editor-ui/src/api/settings.ts +++ b/packages/editor-ui/src/api/settings.ts @@ -4,7 +4,7 @@ import type { IN8nValueSurveyData, IN8nPromptResponse, } from '../Interface'; -import { makeRestApiRequest, get, post } from '@/utils'; +import { makeRestApiRequest, get, post } from '@/utils/apiUtils'; import { N8N_IO_BASE_URL, NPM_COMMUNITY_NODE_SEARCH_API_URL } from '@/constants'; import type { IN8nUISettings } from 'n8n-workflow'; @@ -13,7 +13,7 @@ export async function getSettings(context: IRestApiContext): Promise { - return await get( + return get( N8N_IO_BASE_URL, '/prompts', {}, @@ -26,7 +26,7 @@ export async function submitContactInfo( userId: string, email: string, ): Promise { - return await post( + return post( N8N_IO_BASE_URL, '/prompt', { email }, @@ -39,7 +39,7 @@ export async function submitValueSurvey( userId: string, params: IN8nValueSurveyData, ): Promise { - return await post(N8N_IO_BASE_URL, '/value-survey', params, { + return post(N8N_IO_BASE_URL, '/value-survey', params, { 'n8n-instance-id': instanceId, 'n8n-user-id': userId, }); diff --git a/packages/editor-ui/src/api/tags.ts b/packages/editor-ui/src/api/tags.ts index 88937cf2e857a..8ae405518bee6 100644 --- a/packages/editor-ui/src/api/tags.ts +++ b/packages/editor-ui/src/api/tags.ts @@ -2,11 +2,11 @@ import type { IRestApiContext, ITag } from '@/Interface'; import { makeRestApiRequest } from '@/utils'; export async function getTags(context: IRestApiContext, withUsageCount = false): Promise { - return await makeRestApiRequest(context, 'GET', '/tags', { withUsageCount }); + return makeRestApiRequest(context, 'GET', '/tags', { withUsageCount }); } export async function createTag(context: IRestApiContext, params: { name: string }): Promise { - return await makeRestApiRequest(context, 'POST', '/tags', params); + return makeRestApiRequest(context, 'POST', '/tags', params); } export async function updateTag( @@ -14,9 +14,9 @@ export async function updateTag( id: string, params: { name: string }, ): Promise { - return await makeRestApiRequest(context, 'PATCH', `/tags/${id}`, params); + return makeRestApiRequest(context, 'PATCH', `/tags/${id}`, params); } export async function deleteTag(context: IRestApiContext, id: string): Promise { - return await makeRestApiRequest(context, 'DELETE', `/tags/${id}`); + return makeRestApiRequest(context, 'DELETE', `/tags/${id}`); } diff --git a/packages/editor-ui/src/api/templates.ts b/packages/editor-ui/src/api/templates.ts index 0fc04a75294bd..e6b40ed15cc49 100644 --- a/packages/editor-ui/src/api/templates.ts +++ b/packages/editor-ui/src/api/templates.ts @@ -8,7 +8,7 @@ import type { IWorkflowTemplate, } from '@/Interface'; import type { IDataObject } from 'n8n-workflow'; -import { get } from '@/utils'; +import { get } from '@/utils/apiUtils'; function stringifyArray(arr: number[]) { return arr.join(','); @@ -30,7 +30,7 @@ export async function getCollections( query: ITemplatesQuery, headers?: IDataObject, ): Promise<{ collections: ITemplatesCollection[] }> { - return await get( + return get( apiEndpoint, '/templates/collections', { category: stringifyArray(query.categories || []), search: query.search }, @@ -61,7 +61,7 @@ export async function getCollectionById( collectionId: string, headers?: IDataObject, ): Promise<{ collection: ITemplatesCollectionResponse }> { - return await get(apiEndpoint, `/templates/collections/${collectionId}`, undefined, headers); + return get(apiEndpoint, `/templates/collections/${collectionId}`, undefined, headers); } export async function getTemplateById( @@ -69,7 +69,7 @@ export async function getTemplateById( templateId: string, headers?: IDataObject, ): Promise<{ workflow: ITemplatesWorkflowResponse }> { - return await get(apiEndpoint, `/templates/workflows/${templateId}`, undefined, headers); + return get(apiEndpoint, `/templates/workflows/${templateId}`, undefined, headers); } export async function getWorkflowTemplate( @@ -77,5 +77,5 @@ export async function getWorkflowTemplate( templateId: string, headers?: IDataObject, ): Promise { - return await get(apiEndpoint, `/workflows/templates/${templateId}`, undefined, headers); + return get(apiEndpoint, `/workflows/templates/${templateId}`, undefined, headers); } diff --git a/packages/editor-ui/src/api/usage.ts b/packages/editor-ui/src/api/usage.ts index 4dabccdb3418f..139af9b0d8b5c 100644 --- a/packages/editor-ui/src/api/usage.ts +++ b/packages/editor-ui/src/api/usage.ts @@ -1,4 +1,4 @@ -import { makeRestApiRequest } from '@/utils'; +import { makeRestApiRequest } from '@/utils/apiUtils'; import type { IRestApiContext, UsageState } from '@/Interface'; export const getLicense = async (context: IRestApiContext): Promise => { diff --git a/packages/editor-ui/src/api/users.ts b/packages/editor-ui/src/api/users.ts index a5350a2ee0522..5067da18c4bf2 100644 --- a/packages/editor-ui/src/api/users.ts +++ b/packages/editor-ui/src/api/users.ts @@ -141,7 +141,7 @@ export async function getInviteLink( context: IRestApiContext, { id }: { id: string }, ): Promise<{ link: string }> { - return await makeRestApiRequest(context, 'GET', `/users/${id}/invite-link`); + return makeRestApiRequest(context, 'GET', `/users/${id}/invite-link`); } export async function submitPersonalizationSurvey( diff --git a/packages/editor-ui/src/api/versions.ts b/packages/editor-ui/src/api/versions.ts index 4896318bfa283..7ed0f007522cb 100644 --- a/packages/editor-ui/src/api/versions.ts +++ b/packages/editor-ui/src/api/versions.ts @@ -1,6 +1,6 @@ import type { IVersion } from '@/Interface'; import { INSTANCE_ID_HEADER } from '@/constants'; -import { get } from '@/utils'; +import { get } from '@/utils/apiUtils'; export async function getNextVersions( endpoint: string, @@ -8,5 +8,5 @@ export async function getNextVersions( instanceId: string, ): Promise { const headers = { [INSTANCE_ID_HEADER as string]: instanceId }; - return await get(endpoint, version, {}, headers); + return get(endpoint, version, {}, headers); } diff --git a/packages/editor-ui/src/api/workflow-webhooks.ts b/packages/editor-ui/src/api/workflow-webhooks.ts index 601073a7b05c6..30fea1314b16d 100644 --- a/packages/editor-ui/src/api/workflow-webhooks.ts +++ b/packages/editor-ui/src/api/workflow-webhooks.ts @@ -1,5 +1,5 @@ import type { IOnboardingCallPrompt, IUser } from '@/Interface'; -import { get, post } from '@/utils'; +import { get, post } from '@/utils/apiUtils'; const N8N_API_BASE_URL = 'https://api.n8n.io/api'; const ONBOARDING_PROMPTS_ENDPOINT = '/prompts/onboarding'; @@ -9,7 +9,7 @@ export async function fetchNextOnboardingPrompt( instanceId: string, currentUer: IUser, ): Promise { - return await get(N8N_API_BASE_URL, ONBOARDING_PROMPTS_ENDPOINT, { + return get(N8N_API_BASE_URL, ONBOARDING_PROMPTS_ENDPOINT, { instance_id: instanceId, user_id: `${instanceId}#${currentUer.id}`, is_owner: currentUer.isOwner, @@ -40,7 +40,7 @@ export async function submitEmailOnSignup( email: string | undefined, agree: boolean, ): Promise { - return await post(N8N_API_BASE_URL, CONTACT_EMAIL_SUBMISSION_ENDPOINT, { + return post(N8N_API_BASE_URL, CONTACT_EMAIL_SUBMISSION_ENDPOINT, { instance_id: instanceId, user_id: `${instanceId}#${currentUer.id}`, email, diff --git a/packages/editor-ui/src/api/workflows.ee.ts b/packages/editor-ui/src/api/workflows.ee.ts index 1282a8ce86b56..270646f311f4e 100644 --- a/packages/editor-ui/src/api/workflows.ee.ts +++ b/packages/editor-ui/src/api/workflows.ee.ts @@ -1,5 +1,5 @@ import type { IRestApiContext, IShareWorkflowsPayload, IWorkflowsShareResponse } from '@/Interface'; -import { makeRestApiRequest } from '@/utils'; +import { makeRestApiRequest } from '@/utils/apiUtils'; import type { IDataObject } from 'n8n-workflow'; export async function setWorkflowSharedWith( diff --git a/packages/editor-ui/src/api/workflows.ts b/packages/editor-ui/src/api/workflows.ts index 7b2d1133cb664..24f047aeb71e9 100644 --- a/packages/editor-ui/src/api/workflows.ts +++ b/packages/editor-ui/src/api/workflows.ts @@ -1,6 +1,6 @@ import type { IExecutionsCurrentSummaryExtended, IRestApiContext } from '@/Interface'; import type { ExecutionFilters, ExecutionOptions, IDataObject } from 'n8n-workflow'; -import { makeRestApiRequest } from '@/utils'; +import { makeRestApiRequest } from '@/utils/apiUtils'; export async function getNewWorkflow(context: IRestApiContext, name?: string) { const response = await makeRestApiRequest(context, 'GET', '/workflows/new', name ? { name } : {}); @@ -13,21 +13,21 @@ export async function getNewWorkflow(context: IRestApiContext, name?: string) { export async function getWorkflow(context: IRestApiContext, id: string, filter?: object) { const sendData = filter ? { filter } : undefined; - return await makeRestApiRequest(context, 'GET', `/workflows/${id}`, sendData); + return makeRestApiRequest(context, 'GET', `/workflows/${id}`, sendData); } export async function getWorkflows(context: IRestApiContext, filter?: object) { const sendData = filter ? { filter } : undefined; - return await makeRestApiRequest(context, 'GET', '/workflows', sendData); + return makeRestApiRequest(context, 'GET', '/workflows', sendData); } export async function getActiveWorkflows(context: IRestApiContext) { - return await makeRestApiRequest(context, 'GET', '/active'); + return makeRestApiRequest(context, 'GET', '/active'); } export async function getCurrentExecutions(context: IRestApiContext, filter: IDataObject) { - return await makeRestApiRequest(context, 'GET', '/executions-current', { filter }); + return makeRestApiRequest(context, 'GET', '/executions-current', { filter }); } export async function getExecutions( @@ -35,9 +35,9 @@ export async function getExecutions( filter?: ExecutionFilters, options?: ExecutionOptions, ): Promise<{ count: number; results: IExecutionsCurrentSummaryExtended[]; estimated: boolean }> { - return await makeRestApiRequest(context, 'GET', '/executions', { filter, ...options }); + return makeRestApiRequest(context, 'GET', '/executions', { filter, ...options }); } export async function getExecutionData(context: IRestApiContext, executionId: string) { - return await makeRestApiRequest(context, 'GET', `/executions/${executionId}`); + return makeRestApiRequest(context, 'GET', `/executions/${executionId}`); } diff --git a/packages/editor-ui/src/components/CredentialCard.vue b/packages/editor-ui/src/components/CredentialCard.vue index 960dccf501e94..1007a62cce25c 100644 --- a/packages/editor-ui/src/components/CredentialCard.vue +++ b/packages/editor-ui/src/components/CredentialCard.vue @@ -145,7 +145,7 @@ export default mixins(showMessage).extend({ ); if (deleteConfirmed) { - this.credentialsStore.deleteCredential({ id: this.data.id }); + await this.credentialsStore.deleteCredential({ id: this.data.id }); } } }, diff --git a/packages/editor-ui/src/components/CredentialEdit/CredentialEdit.vue b/packages/editor-ui/src/components/CredentialEdit/CredentialEdit.vue index 758f73e646393..e7f47e0062412 100644 --- a/packages/editor-ui/src/components/CredentialEdit/CredentialEdit.vue +++ b/packages/editor-ui/src/components/CredentialEdit/CredentialEdit.vue @@ -254,14 +254,14 @@ export default mixins(showMessage, nodeHelpers).extend({ activeNode: this.ndvStore.activeNode, }); - setTimeout(() => { + setTimeout(async () => { if (this.credentialId) { if (!this.requiredPropertiesFilled && this.credentialPermissions.isOwner === true) { // sharees can't see properties, so this check would always fail for them // if the credential contains required fields. this.showValidationWarning = true; } else { - this.retestCredential(); + await this.retestCredential(); } } }, 0); diff --git a/packages/editor-ui/src/components/CredentialEdit/CredentialSharing.ee.vue b/packages/editor-ui/src/components/CredentialEdit/CredentialSharing.ee.vue index 7d8f43774a871..c45b047d6c806 100644 --- a/packages/editor-ui/src/components/CredentialEdit/CredentialSharing.ee.vue +++ b/packages/editor-ui/src/components/CredentialEdit/CredentialSharing.ee.vue @@ -176,7 +176,7 @@ export default mixins(showMessage).extend({ await this.usersStore.fetchUsers(); }, goToUsersSettings() { - this.$router.push({ name: VIEWS.USERS_SETTINGS }); + void this.$router.push({ name: VIEWS.USERS_SETTINGS }); this.modalBus.emit('close'); }, goToUpgrade() { diff --git a/packages/editor-ui/src/components/ExecutionsView/ExecutionsInfoAccordion.vue b/packages/editor-ui/src/components/ExecutionsView/ExecutionsInfoAccordion.vue index d7272db2495a6..13a27484b0d22 100644 --- a/packages/editor-ui/src/components/ExecutionsView/ExecutionsInfoAccordion.vue +++ b/packages/editor-ui/src/components/ExecutionsView/ExecutionsInfoAccordion.vue @@ -215,7 +215,7 @@ export default mixins(workflowHelpers).extend({ name: this.workflowName, tags: this.currentWorkflowTagIds, }); - if (saved) this.settingsStore.fetchPromptsData(); + if (saved) await this.settingsStore.fetchPromptsData(); }, }, }); diff --git a/packages/editor-ui/src/components/ExecutionsView/ExecutionsList.vue b/packages/editor-ui/src/components/ExecutionsView/ExecutionsList.vue index c8e77f17083a6..4e96b66ba58d9 100644 --- a/packages/editor-ui/src/components/ExecutionsView/ExecutionsList.vue +++ b/packages/editor-ui/src/components/ExecutionsView/ExecutionsList.vue @@ -116,7 +116,7 @@ export default mixins(showMessage, executionHelpers, debounceHelper, workflowHel watch: { $route(to: Route, from: Route) { const workflowChanged = from.params.name !== to.params.name; - this.initView(workflowChanged); + void this.initView(workflowChanged); if (to.params.executionId) { const execution = this.workflowsStore.getExecutionDataById(to.params.executionId); @@ -303,7 +303,7 @@ export default mixins(showMessage, executionHelpers, debounceHelper, workflowHel type: 'success', }); - this.loadAutoRefresh(); + await this.loadAutoRefresh(); } catch (error) { this.$showError( error, @@ -311,9 +311,9 @@ export default mixins(showMessage, executionHelpers, debounceHelper, workflowHel ); } }, - onFilterUpdated(filter: ExecutionFilterType): void { + async onFilterUpdated(filter: ExecutionFilterType): void { this.filter = filter; - this.setExecutions(); + await this.setExecutions(); }, async setExecutions(): Promise { this.workflowsStore.currentWorkflowExecutions = await this.loadExecutions(); @@ -648,7 +648,7 @@ export default mixins(showMessage, executionHelpers, debounceHelper, workflowHel duration: 2000, }); await this.retryExecution(payload.execution, loadWorkflow); - this.loadAutoRefresh(); + await this.loadAutoRefresh(); this.$telemetry.track('User clicked retry execution button', { workflow_id: this.workflowsStore.workflowId, diff --git a/packages/editor-ui/src/components/MainHeader/MainHeader.vue b/packages/editor-ui/src/components/MainHeader/MainHeader.vue index c25d2b868dff0..3ab4c71bd32dd 100644 --- a/packages/editor-ui/src/components/MainHeader/MainHeader.vue +++ b/packages/editor-ui/src/components/MainHeader/MainHeader.vue @@ -110,14 +110,14 @@ export default mixins(pushConnection, workflowHelpers).extend({ case MAIN_HEADER_TABS.WORKFLOW: if (!['', 'new', PLACEHOLDER_EMPTY_WORKFLOW_ID].includes(this.workflowToReturnTo)) { if (this.$route.name !== VIEWS.WORKFLOW) { - this.$router.push({ + void this.$router.push({ name: VIEWS.WORKFLOW, params: { name: this.workflowToReturnTo }, }); } } else { if (this.$route.name !== VIEWS.NEW_WORKFLOW) { - this.$router.push({ name: VIEWS.NEW_WORKFLOW }); + void this.$router.push({ name: VIEWS.NEW_WORKFLOW }); this.uiStore.stateIsDirty = this.dirtyState; } } @@ -136,7 +136,10 @@ export default mixins(pushConnection, workflowHelpers).extend({ }) .catch(() => {}); } else { - this.$router.push({ name: VIEWS.EXECUTION_HOME, params: { name: routeWorkflowId } }); + void this.$router.push({ + name: VIEWS.EXECUTION_HOME, + params: { name: routeWorkflowId }, + }); } // this.modalBus.emit('closeAll'); this.activeHeaderTab = MAIN_HEADER_TABS.EXECUTIONS; diff --git a/packages/editor-ui/src/components/MainSidebar.vue b/packages/editor-ui/src/components/MainSidebar.vue index 85ebbe29c6f59..cf84e3fd66807 100644 --- a/packages/editor-ui/src/components/MainSidebar.vue +++ b/packages/editor-ui/src/components/MainSidebar.vue @@ -359,14 +359,14 @@ export default mixins( this.onLogout(); break; case 'settings': - this.$router.push({ name: VIEWS.PERSONAL_SETTINGS }); + void this.$router.push({ name: VIEWS.PERSONAL_SETTINGS }); break; default: break; } }, onLogout() { - this.$router.push({ name: VIEWS.SIGNOUT }); + void this.$router.push({ name: VIEWS.SIGNOUT }); }, toggleCollapse() { this.uiStore.toggleSidebarMenuCollapse(); @@ -502,7 +502,7 @@ export default mixins( ); if (prompt.value) { - this.versionControlStore.sync({ commitMessage: prompt.value }); + await this.versionControlStore.sync({ commitMessage: prompt.value }); } }, }, diff --git a/packages/editor-ui/src/components/Node/NodeCreator/Modes/ActionsMode.vue b/packages/editor-ui/src/components/Node/NodeCreator/Modes/ActionsMode.vue index dfe2e71ac4faf..ba2e24653686d 100644 --- a/packages/editor-ui/src/components/Node/NodeCreator/Modes/ActionsMode.vue +++ b/packages/editor-ui/src/components/Node/NodeCreator/Modes/ActionsMode.vue @@ -177,7 +177,7 @@ function trackActionsView() { trigger_action_count, }; - runExternalHook('nodeCreateList.onViewActions', useWebhooksStore(), trackingPayload); + void runExternalHook('nodeCreateList.onViewActions', useWebhooksStore(), trackingPayload); telemetry?.trackNodesPanel('nodeCreateList.onViewActions', trackingPayload); } @@ -198,7 +198,7 @@ function addHttpNode() { if (telemetry) setAddedNodeActionParameters(updateData); const app_identifier = actions.value[0].key; - runExternalHook('nodeCreateList.onActionsCustmAPIClicked', useWebhooksStore(), { + void runExternalHook('nodeCreateList.onActionsCustmAPIClicked', useWebhooksStore(), { app_identifier, }); telemetry?.trackNodesPanel('nodeCreateList.onActionsCustmAPIClicked', { app_identifier }); diff --git a/packages/editor-ui/src/components/Node/NodeCreator/Panel/NodesListPanel.vue b/packages/editor-ui/src/components/Node/NodeCreator/Panel/NodesListPanel.vue index adbdb1e92eb5e..c4a4c6ab4248a 100644 --- a/packages/editor-ui/src/components/Node/NodeCreator/Panel/NodesListPanel.vue +++ b/packages/editor-ui/src/components/Node/NodeCreator/Panel/NodesListPanel.vue @@ -36,19 +36,19 @@ const nodeCreatorView = computed(() => useNodeCreatorStore().selectedView); function onSearch(value: string) { if (activeViewStack.value.uuid) { updateCurrentViewStack({ search: value }); - setActiveItemIndex(activeViewStack.value.activeIndex ?? 0); + void setActiveItemIndex(activeViewStack.value.activeIndex ?? 0); } } function onTransitionEnd() { // For actions, set the active focus to the first action, not category const newStackIndex = activeViewStack.value.mode === 'actions' ? 1 : 0; - setActiveItemIndex(activeViewStack.value.activeIndex || 0 || newStackIndex); + void setActiveItemIndex(activeViewStack.value.activeIndex || 0 || newStackIndex); } onMounted(() => { attachKeydownEvent(); - setActiveItemIndex(activeViewStack.value.activeIndex ?? 0); + void setActiveItemIndex(activeViewStack.value.activeIndex ?? 0); }); onUnmounted(() => { diff --git a/packages/editor-ui/src/components/Node/NodeCreator/Panel/SearchBar.vue b/packages/editor-ui/src/components/Node/NodeCreator/Panel/SearchBar.vue index d5cc35f03ea5c..1d69c17eeae50 100644 --- a/packages/editor-ui/src/components/Node/NodeCreator/Panel/SearchBar.vue +++ b/packages/editor-ui/src/components/Node/NodeCreator/Panel/SearchBar.vue @@ -60,7 +60,9 @@ function clear() { } onMounted(() => { - runExternalHook('nodeCreator_searchBar.mount', useWebhooksStore(), { inputRef: state.inputRef }); + void runExternalHook('nodeCreator_searchBar.mount', useWebhooksStore(), { + inputRef: state.inputRef, + }); setTimeout(focus, 0); }); diff --git a/packages/editor-ui/src/components/Node/NodeCreator/__tests__/NodesListPanel.test.ts b/packages/editor-ui/src/components/Node/NodeCreator/__tests__/NodesListPanel.test.ts index 01265d39e087e..e83045e0070b0 100644 --- a/packages/editor-ui/src/components/Node/NodeCreator/__tests__/NodesListPanel.test.ts +++ b/packages/editor-ui/src/components/Node/NodeCreator/__tests__/NodesListPanel.test.ts @@ -94,7 +94,7 @@ describe('NodesListPanel', () => { expect(container.querySelector('.backButton')).toBeInTheDocument(); - fireEvent.click(container.querySelector('.backButton')!); + await fireEvent.click(container.querySelector('.backButton')!); await Vue.nextTick(); expect(screen.queryAllByTestId('item-iterator-item')).toHaveLength(6); @@ -265,20 +265,20 @@ describe('NodesListPanel', () => { screen.getByText('On app event').click(); await Vue.nextTick(); - fireEvent.input(screen.getByTestId('node-creator-search-bar'), { + await fireEvent.input(screen.getByTestId('node-creator-search-bar'), { target: { value: 'Ninth' }, }); await Vue.nextTick(); expect(screen.queryAllByTestId('item-iterator-item')).toHaveLength(1); - fireEvent.input(screen.getByTestId('node-creator-search-bar'), { + await fireEvent.input(screen.getByTestId('node-creator-search-bar'), { target: { value: 'Non sense' }, }); await Vue.nextTick(); expect(screen.queryAllByTestId('item-iterator-item')).toHaveLength(0); expect(screen.queryByText("We didn't make that... yet")).toBeInTheDocument(); - fireEvent.click(container.querySelector('.clear')!); + await fireEvent.click(container.querySelector('.clear')!); await Vue.nextTick(); expect(screen.queryAllByTestId('item-iterator-item')).toHaveLength(9); }); diff --git a/packages/editor-ui/src/components/Node/NodeCreator/composables/useActions.ts b/packages/editor-ui/src/components/Node/NodeCreator/composables/useActions.ts index 5f704310e0c73..1e511c3cbc0d5 100644 --- a/packages/editor-ui/src/components/Node/NodeCreator/composables/useActions.ts +++ b/packages/editor-ui/src/components/Node/NodeCreator/composables/useActions.ts @@ -203,7 +203,7 @@ export const useActions = () => { source_mode: rootView.toLowerCase(), resource: (action.value as INodeParameters).resource || '', }; - runExternalHook('nodeCreateList.addAction', useWebhooksStore(), payload); + void runExternalHook('nodeCreateList.addAction', useWebhooksStore(), payload); telemetry?.trackNodesPanel('nodeCreateList.addAction', payload); } diff --git a/packages/editor-ui/src/components/ParameterInput.vue b/packages/editor-ui/src/components/ParameterInput.vue index cddbda2fd8474..4f640f44d34b0 100644 --- a/packages/editor-ui/src/components/ParameterInput.vue +++ b/packages/editor-ui/src/components/ParameterInput.vue @@ -522,7 +522,7 @@ export default mixins( dependentParametersValues() { // Reload the remote parameters whenever a parameter // on which the current field depends on changes - this.loadRemoteParameterOptions(); + void this.loadRemoteParameterOptions(); }, value() { if (this.parameter.type === 'color' && this.getArgument('showAlpha') === true) { @@ -1116,7 +1116,7 @@ export default mixins( resourceLocatorRef?.$emit('refreshList'); } - this.loadRemoteParameterOptions(); + void this.loadRemoteParameterOptions(); } else if (command === 'formatHtml') { htmlEditorEventBus.emit('format-html'); } @@ -1175,7 +1175,7 @@ export default mixins( this.$watch( () => this.node!.credentials, () => { - this.loadRemoteParameterOptions(); + void this.loadRemoteParameterOptions(); }, { deep: true, immediate: true }, ); diff --git a/packages/editor-ui/src/components/PersonalizationModal.vue b/packages/editor-ui/src/components/PersonalizationModal.vue index bfcce95055d42..3331f296ef326 100644 --- a/packages/editor-ui/src/components/PersonalizationModal.vue +++ b/packages/editor-ui/src/components/PersonalizationModal.vue @@ -610,7 +610,7 @@ export default mixins(showMessage, workflowHelpers).extend({ // In case the redirect to canvas for new users didn't happen // we try again after closing the modal if (this.$route.name !== VIEWS.NEW_WORKFLOW) { - this.$router.replace({ name: VIEWS.NEW_WORKFLOW }); + void this.$router.replace({ name: VIEWS.NEW_WORKFLOW }); } }, onSave() { diff --git a/packages/editor-ui/src/components/RunDataSchema.vue b/packages/editor-ui/src/components/RunDataSchema.vue index f18e6860c1b14..2296f2171e855 100644 --- a/packages/editor-ui/src/components/RunDataSchema.vue +++ b/packages/editor-ui/src/components/RunDataSchema.vue @@ -64,7 +64,7 @@ const onDragEnd = (el: HTMLElement) => { ...mappingTelemetry, }; - runExternalHook('runDataJson.onDragEnd', webhooksStore, telemetryPayload); + void runExternalHook('runDataJson.onDragEnd', webhooksStore, telemetryPayload); telemetry.track('User dragged data for mapping', telemetryPayload); }, 1000); // ensure dest data gets set if drop diff --git a/packages/editor-ui/src/components/SettingsLogStreaming/EventDestinationCard.ee.vue b/packages/editor-ui/src/components/SettingsLogStreaming/EventDestinationCard.ee.vue index 8b5c980b7d1e6..58e7adbc5bd51 100644 --- a/packages/editor-ui/src/components/SettingsLogStreaming/EventDestinationCard.ee.vue +++ b/packages/editor-ui/src/components/SettingsLogStreaming/EventDestinationCard.ee.vue @@ -50,12 +50,12 @@ import mixins from 'vue-typed-mixins'; import { EnterpriseEditionFeature } from '@/constants'; import { showMessage } from '@/mixins/showMessage'; -import { useLogStreamingStore } from '../../stores/logStreaming.store'; +import { useLogStreamingStore } from '@/stores/logStreaming.store'; import type { PropType } from 'vue'; import { mapStores } from 'pinia'; import type { MessageEventBusDestinationOptions } from 'n8n-workflow'; import { deepCopy, defaultMessageEventBusDestinationOptions } from 'n8n-workflow'; -import type { BaseTextKey } from '../../plugins/i18n'; +import type { BaseTextKey } from '@/plugins/i18n'; import type { EventBus } from '@/event-bus'; export const DESTINATION_LIST_ITEM_ACTIONS = { @@ -139,7 +139,7 @@ export default mixins(showMessage).extend({ }, onEnabledSwitched(state: boolean, destinationId: string) { this.nodeParameters.enabled = state; - this.saveDestination(); + void this.saveDestination(); }, async saveDestination() { await this.logStreamingStore.saveDestination(this.nodeParameters); diff --git a/packages/editor-ui/src/components/SettingsLogStreaming/EventDestinationSettingsModal.ee.vue b/packages/editor-ui/src/components/SettingsLogStreaming/EventDestinationSettingsModal.ee.vue index b42ccd770721e..d841827f4825d 100644 --- a/packages/editor-ui/src/components/SettingsLogStreaming/EventDestinationSettingsModal.ee.vue +++ b/packages/editor-ui/src/components/SettingsLogStreaming/EventDestinationSettingsModal.ee.vue @@ -175,12 +175,12 @@ import { get, set, unset } from 'lodash-es'; import { mapStores } from 'pinia'; import mixins from 'vue-typed-mixins'; -import { useLogStreamingStore } from '../../stores/logStreaming.store'; -import { useNDVStore } from '../../stores/ndv.store'; -import { useWorkflowsStore } from '../../stores/workflows.store'; +import { useLogStreamingStore } from '@/stores/logStreaming.store'; +import { useNDVStore } from '@/stores/ndv.store'; +import { useWorkflowsStore } from '@/stores/workflows.store'; import ParameterInputList from '@/components/ParameterInputList.vue'; import NodeCredentials from '@/components/NodeCredentials.vue'; -import type { IMenuItem, INodeUi, ITab, IUpdateInformation } from '../../Interface'; +import type { IMenuItem, INodeUi, ITab, IUpdateInformation } from '@/Interface'; import type { IDataObject, INodeCredentials, @@ -197,18 +197,18 @@ import { } from 'n8n-workflow'; import type { PropType } from 'vue'; import Vue from 'vue'; -import { LOG_STREAM_MODAL_KEY } from '../../constants'; +import { LOG_STREAM_MODAL_KEY } from '@/constants'; import Modal from '@/components/Modal.vue'; import { showMessage } from '@/mixins/showMessage'; -import { useUIStore } from '../../stores/ui.store'; -import { useUsersStore } from '../../stores/users.store'; +import { useUIStore } from '@/stores/ui.store'; +import { useUsersStore } from '@/stores/users.store'; import { destinationToFakeINodeUi } from './Helpers.ee'; import { webhookModalDescription, sentryModalDescription, syslogModalDescription, } from './descriptions.ee'; -import type { BaseTextKey } from '../../plugins/i18n'; +import type { BaseTextKey } from '@/plugins/i18n'; import InlineNameEdit from '../InlineNameEdit.vue'; import SaveButton from '../SaveButton.vue'; import EventSelection from '@/components/SettingsLogStreaming/EventSelection.ee.vue'; diff --git a/packages/editor-ui/src/components/SettingsLogStreaming/EventSelection.ee.vue b/packages/editor-ui/src/components/SettingsLogStreaming/EventSelection.ee.vue index f3bb515ccd92d..70efcc2eafb3f 100644 --- a/packages/editor-ui/src/components/SettingsLogStreaming/EventSelection.ee.vue +++ b/packages/editor-ui/src/components/SettingsLogStreaming/EventSelection.ee.vue @@ -71,8 +71,8 @@ diff --git a/packages/editor-ui/src/views/SignupView.vue b/packages/editor-ui/src/views/SignupView.vue index 37c66fdc93ca9..e281c64db0fe0 100644 --- a/packages/editor-ui/src/views/SignupView.vue +++ b/packages/editor-ui/src/views/SignupView.vue @@ -97,7 +97,7 @@ export default mixins(showMessage).extend({ this.inviter = invite.inviter as { firstName: string; lastName: string }; } catch (e) { this.$showError(e, this.$locale.baseText('auth.signup.tokenValidationError')); - this.$router.replace({ name: VIEWS.SIGNIN }); + void this.$router.replace({ name: VIEWS.SIGNIN }); } }, computed: { diff --git a/packages/editor-ui/src/views/WorkflowsView.vue b/packages/editor-ui/src/views/WorkflowsView.vue index 0180923070d1f..d9d2b52b02d67 100644 --- a/packages/editor-ui/src/views/WorkflowsView.vue +++ b/packages/editor-ui/src/views/WorkflowsView.vue @@ -191,9 +191,8 @@ const WorkflowsView = mixins(showMessage, debounceHelper).extend({ this.usersStore.fetchUsers(), this.workflowsStore.fetchAllWorkflows(), this.workflowsStore.fetchActiveWorkflows(), + this.credentialsStore.fetchAllCredentials(), ]); - - this.credentialsStore.fetchAllCredentials(); }, onClickTag(tagId: string, event: PointerEvent) { if (!this.filters.tags.includes(tagId)) { diff --git a/packages/workflow/src/Extensions/index.ts b/packages/workflow/src/Extensions/index.ts index a0c98d6208f37..1ff8812e4df16 100644 --- a/packages/workflow/src/Extensions/index.ts +++ b/packages/workflow/src/Extensions/index.ts @@ -1,4 +1,3 @@ -// eslint-disable-next-line import/no-cycle export { extend, extendOptional, @@ -8,4 +7,4 @@ export { EXTENSION_OBJECTS as ExpressionExtensions, } from './ExpressionExtension'; -export type { DocMetadata } from './Extensions'; +export type { DocMetadata, NativeDoc } from './Extensions'; diff --git a/packages/workflow/src/index.ts b/packages/workflow/src/index.ts index eee0e5f3431a0..d052aa94a9437 100644 --- a/packages/workflow/src/index.ts +++ b/packages/workflow/src/index.ts @@ -44,7 +44,7 @@ export { export { ExpressionExtensions } from './Extensions'; export { NativeMethods } from './NativeMethods'; -export type { DocMetadata } from './Extensions'; +export type { DocMetadata, NativeDoc } from './Extensions'; declare module 'http' { export interface IncomingMessage {