refactor(editor): Stricter linting for promises and async functions (no-changelog) (#4642)

This commit is contained in:
Michael Kret 2023-05-10 18:10:03 +03:00 committed by GitHub
parent 1b1dc0e655
commit ed3bc154b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
114 changed files with 351 additions and 344 deletions

View file

@ -26,7 +26,6 @@ module.exports = {
'@typescript-eslint/naming-convention': 'off', '@typescript-eslint/naming-convention': 'off',
'@typescript-eslint/no-duplicate-imports': 'off', '@typescript-eslint/no-duplicate-imports': 'off',
'@typescript-eslint/no-empty-interface': 'off', '@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/no-for-in-array': 'off', '@typescript-eslint/no-for-in-array': 'off',
'@typescript-eslint/no-loop-func': 'off', '@typescript-eslint/no-loop-func': 'off',
'@typescript-eslint/no-non-null-assertion': 'off', '@typescript-eslint/no-non-null-assertion': 'off',
@ -45,10 +44,8 @@ module.exports = {
'@typescript-eslint/no-var-requires': 'off', '@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/prefer-nullish-coalescing': 'off', '@typescript-eslint/prefer-nullish-coalescing': 'off',
'@typescript-eslint/prefer-optional-chain': 'off', '@typescript-eslint/prefer-optional-chain': 'off',
'@typescript-eslint/promise-function-async': 'off',
'@typescript-eslint/restrict-plus-operands': 'off', '@typescript-eslint/restrict-plus-operands': 'off',
'@typescript-eslint/restrict-template-expressions': 'off', '@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/return-await': 'off',
'@typescript-eslint/unbound-method': 'off', '@typescript-eslint/unbound-method': 'off',
'@typescript-eslint/ban-ts-comment': ['warn', { 'ts-ignore': true }], '@typescript-eslint/ban-ts-comment': ['warn', { 'ts-ignore': true }],
}, },

View file

@ -135,7 +135,7 @@ export default mixins(newVersions, showMessage, userHelpers).extend({
return; return;
} }
this.$router.replace({ name: VIEWS.SETUP }); void this.$router.replace({ name: VIEWS.SETUP });
return; return;
} }
@ -149,7 +149,7 @@ export default mixins(newVersions, showMessage, userHelpers).extend({
const redirect = const redirect =
this.$route.query.redirect || this.$route.query.redirect ||
encodeURIComponent(`${window.location.pathname}${window.location.search}`); 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; return;
} }
@ -158,13 +158,13 @@ export default mixins(newVersions, showMessage, userHelpers).extend({
const redirect = decodeURIComponent(this.$route.query.redirect); const redirect = decodeURIComponent(this.$route.query.redirect);
if (redirect.startsWith('/')) { if (redirect.startsWith('/')) {
// protect against phishing // protect against phishing
this.$router.replace(redirect); void this.$router.replace(redirect);
return; return;
} }
} }
// if cannot access page and is logged in // if cannot access page and is logged in
this.$router.replace({ name: VIEWS.HOMEPAGE }); void this.$router.replace({ name: VIEWS.HOMEPAGE });
}, },
redirectIfNecessary() { redirectIfNecessary() {
const redirect = const redirect =
@ -172,7 +172,7 @@ export default mixins(newVersions, showMessage, userHelpers).extend({
typeof this.$route.meta.getRedirect === 'function' && typeof this.$route.meta.getRedirect === 'function' &&
this.$route.meta.getRedirect(); this.$route.meta.getRedirect();
if (redirect) { if (redirect) {
this.$router.replace(redirect); void this.$router.replace(redirect);
} }
}, },
setTheme() { setTheme() {
@ -203,7 +203,7 @@ export default mixins(newVersions, showMessage, userHelpers).extend({
this.versionControlStore.isEnterpriseVersionControlEnabled && this.versionControlStore.isEnterpriseVersionControlEnabled &&
this.usersStore.isInstanceOwner this.usersStore.isInstanceOwner
) { ) {
this.versionControlStore.getPreferences(); void this.versionControlStore.getPreferences();
} }
}, },
watch: { watch: {
@ -214,7 +214,7 @@ export default mixins(newVersions, showMessage, userHelpers).extend({
this.trackPage(); this.trackPage();
}, },
defaultLocale(newLocale) { defaultLocale(newLocale) {
loadLanguage(newLocale); void loadLanguage(newLocale);
}, },
}, },
}); });

View file

@ -24,7 +24,7 @@ export function setupServer() {
server.logging = false; server.logging = false;
// Handle undefined endpoints // Handle undefined endpoints
server.post('/rest/:any', () => new Promise(() => {})); server.post('/rest/:any', async () => new Promise(() => {}));
// Handle defined endpoints // Handle defined endpoints
for (const endpointsFn of endpoints) { for (const endpointsFn of endpoints) {

View file

@ -3,7 +3,7 @@ import { UserManagementAuthenticationMethod } from '@/Interface';
import { render } from '@testing-library/vue'; import { render } from '@testing-library/vue';
import { PiniaVuePlugin } from 'pinia'; 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) => { return new Promise((resolve, reject) => {
const startTime = Date.now(); const startTime = Date.now();
@ -27,7 +27,7 @@ export const renderComponent = (Component: RenderParams[0], renderOptions: Rende
vue.use(PiniaVuePlugin); 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 = { export const SETTINGS_STORE_DEFAULT_STATE: ISettingsState = {
settings: { settings: {
@ -43,8 +43,10 @@ export const SETTINGS_STORE_DEFAULT_STATE: ISettingsState = {
ldap: false, ldap: false,
saml: false, saml: false,
logStreaming: false, logStreaming: false,
variables: false,
versionControl: false,
}, },
executionMode: '', executionMode: 'regular',
executionTimeout: 0, executionTimeout: 0,
hideUsagePage: false, hideUsagePage: false,
hiringBannerEnabled: false, hiringBannerEnabled: false,
@ -66,8 +68,8 @@ export const SETTINGS_STORE_DEFAULT_STATE: ISettingsState = {
}, },
publicApi: { enabled: false, latestVersion: 0, path: '', swaggerUi: { enabled: false } }, publicApi: { enabled: false, latestVersion: 0, path: '', swaggerUi: { enabled: false } },
pushBackend: 'sse', pushBackend: 'sse',
saveDataErrorExecution: '', saveDataErrorExecution: 'all',
saveDataSuccessExecution: '', saveDataSuccessExecution: 'all',
saveManualExecutions: false, saveManualExecutions: false,
sso: { sso: {
ldap: { loginEnabled: false, loginLabel: '' }, ldap: { loginEnabled: false, loginLabel: '' },
@ -94,6 +96,9 @@ export const SETTINGS_STORE_DEFAULT_STATE: ISettingsState = {
deployment: { deployment: {
type: 'default', type: 'default',
}, },
variables: {
limit: 100,
},
}, },
promptsData: { promptsData: {
message: '', message: '',

View file

@ -1,14 +1,14 @@
import type { IRestApiContext } from '@/Interface'; import type { IRestApiContext } from '@/Interface';
import { makeRestApiRequest } from '@/utils'; import { makeRestApiRequest } from '@/utils/apiUtils';
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'); 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'); 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'); return makeRestApiRequest(context, 'DELETE', '/me/api-key');
} }

View file

@ -13,16 +13,16 @@ export async function installNewPackage(
context: IRestApiContext, context: IRestApiContext,
name: string, name: string,
): Promise<PublicInstalledPackage> { ): Promise<PublicInstalledPackage> {
return await post(context.baseUrl, '/nodes', { name }); return post(context.baseUrl, '/nodes', { name });
} }
export async function uninstallPackage(context: IRestApiContext, name: string): Promise<void> { export async function uninstallPackage(context: IRestApiContext, name: string): Promise<void> {
return await makeRestApiRequest(context, 'DELETE', '/nodes', { name }); return makeRestApiRequest(context, 'DELETE', '/nodes', { name });
} }
export async function updatePackage( export async function updatePackage(
context: IRestApiContext, context: IRestApiContext,
name: string, name: string,
): Promise<PublicInstalledPackage> { ): Promise<PublicInstalledPackage> {
return await makeRestApiRequest(context, 'PATCH', '/nodes', { name }); return makeRestApiRequest(context, 'PATCH', '/nodes', { name });
} }

View file

@ -1,5 +1,5 @@
import type { ICredentialsResponse, IRestApiContext, IShareCredentialsPayload } from '@/Interface'; import type { ICredentialsResponse, IRestApiContext, IShareCredentialsPayload } from '@/Interface';
import { makeRestApiRequest } from '@/utils'; import { makeRestApiRequest } from '@/utils/apiUtils';
import type { IDataObject } from 'n8n-workflow'; import type { IDataObject } from 'n8n-workflow';
export async function setCredentialSharedWith( export async function setCredentialSharedWith(

View file

@ -3,7 +3,7 @@ import type {
ICredentialsResponse, ICredentialsResponse,
IRestApiContext, IRestApiContext,
} from '@/Interface'; } from '@/Interface';
import { makeRestApiRequest } from '@/utils'; import { makeRestApiRequest } from '@/utils/apiUtils';
import type { import type {
ICredentialsDecrypted, ICredentialsDecrypted,
ICredentialType, ICredentialType,
@ -22,11 +22,11 @@ export async function getCredentialsNewName(
context: IRestApiContext, context: IRestApiContext,
name?: string, name?: string,
): Promise<{ 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<ICredentialsResponse[]> { export async function getAllCredentials(context: IRestApiContext): Promise<ICredentialsResponse[]> {
return await makeRestApiRequest(context, 'GET', '/credentials'); return makeRestApiRequest(context, 'GET', '/credentials');
} }
export async function createNewCredential( export async function createNewCredential(

View file

@ -1,7 +1,7 @@
import type { CurlToJSONResponse, IRestApiContext } from '@/Interface'; import type { CurlToJSONResponse, IRestApiContext } from '@/Interface';
import { makeRestApiRequest } from '@/utils'; import { makeRestApiRequest } from '@/utils/apiUtils';
export function getCurlToJson( export async function getCurlToJson(
context: IRestApiContext, context: IRestApiContext,
curlCommand: string, curlCommand: string,
): Promise<CurlToJSONResponse> { ): Promise<CurlToJSONResponse> {

View file

@ -3,38 +3,33 @@ import { makeRestApiRequest } from '@/utils';
import type { IDataObject } from 'n8n-workflow'; import type { IDataObject } from 'n8n-workflow';
export async function getVariables(context: IRestApiContext): Promise<EnvironmentVariable[]> { export async function getVariables(context: IRestApiContext): Promise<EnvironmentVariable[]> {
return await makeRestApiRequest(context, 'GET', '/variables'); return makeRestApiRequest(context, 'GET', '/variables');
} }
export async function getVariable( export async function getVariable(
context: IRestApiContext, context: IRestApiContext,
{ id }: { id: EnvironmentVariable['id'] }, { id }: { id: EnvironmentVariable['id'] },
): Promise<EnvironmentVariable> { ): Promise<EnvironmentVariable> {
return await makeRestApiRequest(context, 'GET', `/variables/${id}`); return makeRestApiRequest(context, 'GET', `/variables/${id}`);
} }
export async function createVariable( export async function createVariable(
context: IRestApiContext, context: IRestApiContext,
data: Omit<EnvironmentVariable, 'id'>, data: Omit<EnvironmentVariable, 'id'>,
) { ) {
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( export async function updateVariable(
context: IRestApiContext, context: IRestApiContext,
{ id, ...data }: EnvironmentVariable, { id, ...data }: EnvironmentVariable,
) { ) {
return await makeRestApiRequest( return makeRestApiRequest(context, 'PATCH', `/variables/${id}`, data as unknown as IDataObject);
context,
'PATCH',
`/variables/${id}`,
data as unknown as IDataObject,
);
} }
export async function deleteVariable( export async function deleteVariable(
context: IRestApiContext, context: IRestApiContext,
{ id }: { id: EnvironmentVariable['id'] }, { id }: { id: EnvironmentVariable['id'] },
) { ) {
return await makeRestApiRequest(context, 'DELETE', `/variables/${id}`); return makeRestApiRequest(context, 'DELETE', `/variables/${id}`);
} }

View file

@ -1,27 +1,27 @@
import type { ILdapConfig, ILdapSyncData, IRestApiContext } from '@/Interface'; import type { ILdapConfig, ILdapSyncData, IRestApiContext } from '@/Interface';
import { makeRestApiRequest } from '@/utils'; import { makeRestApiRequest } from '@/utils/apiUtils';
import type { IDataObject } from 'n8n-workflow'; import type { IDataObject } from 'n8n-workflow';
export function getLdapConfig(context: IRestApiContext): Promise<ILdapConfig> { export async function getLdapConfig(context: IRestApiContext): Promise<ILdapConfig> {
return makeRestApiRequest(context, 'GET', '/ldap/config'); 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'); return makeRestApiRequest(context, 'POST', '/ldap/test-connection');
} }
export function updateLdapConfig( export async function updateLdapConfig(
context: IRestApiContext, context: IRestApiContext,
adConfig: ILdapConfig, adConfig: ILdapConfig,
): Promise<ILdapConfig> { ): Promise<ILdapConfig> {
return makeRestApiRequest(context, 'PUT', '/ldap/config', adConfig as unknown as IDataObject); 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); return makeRestApiRequest(context, 'POST', '/ldap/sync', data as unknown as IDataObject);
} }
export function getLdapSynchronizations( export async function getLdapSynchronizations(
context: IRestApiContext, context: IRestApiContext,
pagination: { page: number }, pagination: { page: number },
): Promise<ILdapSyncData[]> { ): Promise<ILdapSyncData[]> {

View file

@ -1,4 +1,4 @@
import { makeRestApiRequest } from '@/utils'; import { makeRestApiRequest } from '@/utils/apiUtils';
import type { import type {
INodeTranslationHeaders, INodeTranslationHeaders,
IResourceLocatorReqParams, IResourceLocatorReqParams,

View file

@ -4,16 +4,16 @@ import type {
IN8nValueSurveyData, IN8nValueSurveyData,
IN8nPromptResponse, IN8nPromptResponse,
} from '../Interface'; } 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 { N8N_IO_BASE_URL, NPM_COMMUNITY_NODE_SEARCH_API_URL } from '@/constants';
import type { IN8nUISettings } from 'n8n-workflow'; import type { IN8nUISettings } from 'n8n-workflow';
export function getSettings(context: IRestApiContext): Promise<IN8nUISettings> { export async function getSettings(context: IRestApiContext): Promise<IN8nUISettings> {
return makeRestApiRequest(context, 'GET', '/settings'); return makeRestApiRequest(context, 'GET', '/settings');
} }
export async function getPromptsData(instanceId: string, userId: string): Promise<IN8nPrompts> { export async function getPromptsData(instanceId: string, userId: string): Promise<IN8nPrompts> {
return await get( return get(
N8N_IO_BASE_URL, N8N_IO_BASE_URL,
'/prompts', '/prompts',
{}, {},
@ -26,7 +26,7 @@ export async function submitContactInfo(
userId: string, userId: string,
email: string, email: string,
): Promise<IN8nPromptResponse> { ): Promise<IN8nPromptResponse> {
return await post( return post(
N8N_IO_BASE_URL, N8N_IO_BASE_URL,
'/prompt', '/prompt',
{ email }, { email },
@ -39,7 +39,7 @@ export async function submitValueSurvey(
userId: string, userId: string,
params: IN8nValueSurveyData, params: IN8nValueSurveyData,
): Promise<IN8nPromptResponse> { ): Promise<IN8nPromptResponse> {
return await post(N8N_IO_BASE_URL, '/value-survey', params, { return post(N8N_IO_BASE_URL, '/value-survey', params, {
'n8n-instance-id': instanceId, 'n8n-instance-id': instanceId,
'n8n-user-id': userId, 'n8n-user-id': userId,
}); });

View file

@ -6,34 +6,34 @@ import type {
SamlPreferencesExtractedData, SamlPreferencesExtractedData,
} from '@/Interface'; } from '@/Interface';
export const initSSO = (context: IRestApiContext): Promise<string> => { export const initSSO = async (context: IRestApiContext): Promise<string> => {
return makeRestApiRequest(context, 'GET', '/sso/saml/initsso'); return makeRestApiRequest(context, 'GET', '/sso/saml/initsso');
}; };
export const getSamlMetadata = (context: IRestApiContext): Promise<SamlPreferences> => { export const getSamlMetadata = async (context: IRestApiContext): Promise<SamlPreferences> => {
return makeRestApiRequest(context, 'GET', '/sso/saml/metadata'); return makeRestApiRequest(context, 'GET', '/sso/saml/metadata');
}; };
export const getSamlConfig = ( export const getSamlConfig = async (
context: IRestApiContext, context: IRestApiContext,
): Promise<SamlPreferences & SamlPreferencesExtractedData> => { ): Promise<SamlPreferences & SamlPreferencesExtractedData> => {
return makeRestApiRequest(context, 'GET', '/sso/saml/config'); return makeRestApiRequest(context, 'GET', '/sso/saml/config');
}; };
export const saveSamlConfig = ( export const saveSamlConfig = async (
context: IRestApiContext, context: IRestApiContext,
data: SamlPreferences, data: SamlPreferences,
): Promise<SamlPreferences | undefined> => { ): Promise<SamlPreferences | undefined> => {
return makeRestApiRequest(context, 'POST', '/sso/saml/config', data); return makeRestApiRequest(context, 'POST', '/sso/saml/config', data);
}; };
export const toggleSamlConfig = ( export const toggleSamlConfig = async (
context: IRestApiContext, context: IRestApiContext,
data: SamlPreferencesLoginEnabled, data: SamlPreferencesLoginEnabled,
): Promise<void> => { ): Promise<void> => {
return makeRestApiRequest(context, 'POST', '/sso/saml/config/toggle', data); return makeRestApiRequest(context, 'POST', '/sso/saml/config/toggle', data);
}; };
export const testSamlConfig = (context: IRestApiContext): Promise<string> => { export const testSamlConfig = async (context: IRestApiContext): Promise<string> => {
return makeRestApiRequest(context, 'GET', '/sso/saml/config/test'); return makeRestApiRequest(context, 'GET', '/sso/saml/config/test');
}; };

View file

@ -2,11 +2,11 @@ import type { IRestApiContext, ITag } from '@/Interface';
import { makeRestApiRequest } from '@/utils'; import { makeRestApiRequest } from '@/utils';
export async function getTags(context: IRestApiContext, withUsageCount = false): Promise<ITag[]> { export async function getTags(context: IRestApiContext, withUsageCount = false): Promise<ITag[]> {
return await makeRestApiRequest(context, 'GET', '/tags', { withUsageCount }); return makeRestApiRequest(context, 'GET', '/tags', { withUsageCount });
} }
export async function createTag(context: IRestApiContext, params: { name: string }): Promise<ITag> { export async function createTag(context: IRestApiContext, params: { name: string }): Promise<ITag> {
return await makeRestApiRequest(context, 'POST', '/tags', params); return makeRestApiRequest(context, 'POST', '/tags', params);
} }
export async function updateTag( export async function updateTag(
@ -14,9 +14,9 @@ export async function updateTag(
id: string, id: string,
params: { name: string }, params: { name: string },
): Promise<ITag> { ): Promise<ITag> {
return await makeRestApiRequest(context, 'PATCH', `/tags/${id}`, params); return makeRestApiRequest(context, 'PATCH', `/tags/${id}`, params);
} }
export async function deleteTag(context: IRestApiContext, id: string): Promise<boolean> { export async function deleteTag(context: IRestApiContext, id: string): Promise<boolean> {
return await makeRestApiRequest(context, 'DELETE', `/tags/${id}`); return makeRestApiRequest(context, 'DELETE', `/tags/${id}`);
} }

View file

@ -8,17 +8,17 @@ import type {
IWorkflowTemplate, IWorkflowTemplate,
} from '@/Interface'; } from '@/Interface';
import type { IDataObject } from 'n8n-workflow'; import type { IDataObject } from 'n8n-workflow';
import { get } from '@/utils'; import { get } from '@/utils/apiUtils';
function stringifyArray(arr: number[]) { function stringifyArray(arr: number[]) {
return arr.join(','); return arr.join(',');
} }
export function testHealthEndpoint(apiEndpoint: string) { export async function testHealthEndpoint(apiEndpoint: string) {
return get(apiEndpoint, '/health'); return get(apiEndpoint, '/health');
} }
export function getCategories( export async function getCategories(
apiEndpoint: string, apiEndpoint: string,
headers?: IDataObject, headers?: IDataObject,
): Promise<{ categories: ITemplatesCategory[] }> { ): Promise<{ categories: ITemplatesCategory[] }> {
@ -30,7 +30,7 @@ export async function getCollections(
query: ITemplatesQuery, query: ITemplatesQuery,
headers?: IDataObject, headers?: IDataObject,
): Promise<{ collections: ITemplatesCollection[] }> { ): Promise<{ collections: ITemplatesCollection[] }> {
return await get( return get(
apiEndpoint, apiEndpoint,
'/templates/collections', '/templates/collections',
{ category: stringifyArray(query.categories || []), search: query.search }, { category: stringifyArray(query.categories || []), search: query.search },
@ -61,7 +61,7 @@ export async function getCollectionById(
collectionId: string, collectionId: string,
headers?: IDataObject, headers?: IDataObject,
): Promise<{ collection: ITemplatesCollectionResponse }> { ): Promise<{ collection: ITemplatesCollectionResponse }> {
return await get(apiEndpoint, `/templates/collections/${collectionId}`, undefined, headers); return get(apiEndpoint, `/templates/collections/${collectionId}`, undefined, headers);
} }
export async function getTemplateById( export async function getTemplateById(
@ -69,7 +69,7 @@ export async function getTemplateById(
templateId: string, templateId: string,
headers?: IDataObject, headers?: IDataObject,
): Promise<{ workflow: ITemplatesWorkflowResponse }> { ): Promise<{ workflow: ITemplatesWorkflowResponse }> {
return await get(apiEndpoint, `/templates/workflows/${templateId}`, undefined, headers); return get(apiEndpoint, `/templates/workflows/${templateId}`, undefined, headers);
} }
export async function getWorkflowTemplate( export async function getWorkflowTemplate(
@ -77,5 +77,5 @@ export async function getWorkflowTemplate(
templateId: string, templateId: string,
headers?: IDataObject, headers?: IDataObject,
): Promise<IWorkflowTemplate> { ): Promise<IWorkflowTemplate> {
return await get(apiEndpoint, `/workflows/templates/${templateId}`, undefined, headers); return get(apiEndpoint, `/workflows/templates/${templateId}`, undefined, headers);
} }

View file

@ -1,17 +1,17 @@
import { makeRestApiRequest } from '@/utils'; import { makeRestApiRequest } from '@/utils/apiUtils';
import type { IRestApiContext, UsageState } from '@/Interface'; import type { IRestApiContext, UsageState } from '@/Interface';
export const getLicense = (context: IRestApiContext): Promise<UsageState['data']> => { export const getLicense = async (context: IRestApiContext): Promise<UsageState['data']> => {
return makeRestApiRequest(context, 'GET', '/license'); return makeRestApiRequest(context, 'GET', '/license');
}; };
export const activateLicenseKey = ( export const activateLicenseKey = async (
context: IRestApiContext, context: IRestApiContext,
data: { activationKey: string }, data: { activationKey: string },
): Promise<UsageState['data']> => { ): Promise<UsageState['data']> => {
return makeRestApiRequest(context, 'POST', '/license/activate', data); return makeRestApiRequest(context, 'POST', '/license/activate', data);
}; };
export const renewLicense = (context: IRestApiContext): Promise<UsageState['data']> => { export const renewLicense = async (context: IRestApiContext): Promise<UsageState['data']> => {
return makeRestApiRequest(context, 'POST', '/license/renew'); return makeRestApiRequest(context, 'POST', '/license/renew');
}; };

View file

@ -8,11 +8,13 @@ import type {
import type { IDataObject } from 'n8n-workflow'; import type { IDataObject } from 'n8n-workflow';
import { makeRestApiRequest } from '@/utils/apiUtils'; import { makeRestApiRequest } from '@/utils/apiUtils';
export function loginCurrentUser(context: IRestApiContext): Promise<CurrentUserResponse | null> { export async function loginCurrentUser(
context: IRestApiContext,
): Promise<CurrentUserResponse | null> {
return makeRestApiRequest(context, 'GET', '/login'); return makeRestApiRequest(context, 'GET', '/login');
} }
export function login( export async function login(
context: IRestApiContext, context: IRestApiContext,
params: { email: string; password: string }, params: { email: string; password: string },
): Promise<CurrentUserResponse> { ): Promise<CurrentUserResponse> {
@ -23,31 +25,31 @@ export async function logout(context: IRestApiContext): Promise<void> {
await makeRestApiRequest(context, 'POST', '/logout'); await makeRestApiRequest(context, 'POST', '/logout');
} }
export function preOwnerSetup( export async function preOwnerSetup(
context: IRestApiContext, context: IRestApiContext,
): Promise<{ credentials: number; workflows: number }> { ): Promise<{ credentials: number; workflows: number }> {
return makeRestApiRequest(context, 'GET', '/owner/pre-setup'); return makeRestApiRequest(context, 'GET', '/owner/pre-setup');
} }
export function setupOwner( export async function setupOwner(
context: IRestApiContext, context: IRestApiContext,
params: { firstName: string; lastName: string; email: string; password: string }, params: { firstName: string; lastName: string; email: string; password: string },
): Promise<IUserResponse> { ): Promise<IUserResponse> {
return makeRestApiRequest(context, 'POST', '/owner/setup', params as unknown as IDataObject); return makeRestApiRequest(context, 'POST', '/owner/setup', params as unknown as IDataObject);
} }
export function skipOwnerSetup(context: IRestApiContext): Promise<void> { export async function skipOwnerSetup(context: IRestApiContext): Promise<void> {
return makeRestApiRequest(context, 'POST', '/owner/skip-setup'); return makeRestApiRequest(context, 'POST', '/owner/skip-setup');
} }
export function validateSignupToken( export async function validateSignupToken(
context: IRestApiContext, context: IRestApiContext,
params: { inviterId: string; inviteeId: string }, params: { inviterId: string; inviteeId: string },
): Promise<{ inviter: { firstName: string; lastName: string } }> { ): Promise<{ inviter: { firstName: string; lastName: string } }> {
return makeRestApiRequest(context, 'GET', '/resolve-signup-token', params); return makeRestApiRequest(context, 'GET', '/resolve-signup-token', params);
} }
export function signup( export async function signup(
context: IRestApiContext, context: IRestApiContext,
params: { params: {
inviterId: string; inviterId: string;
@ -87,7 +89,7 @@ export async function changePassword(
await makeRestApiRequest(context, 'POST', '/change-password', params); await makeRestApiRequest(context, 'POST', '/change-password', params);
} }
export function updateCurrentUser( export async function updateCurrentUser(
context: IRestApiContext, context: IRestApiContext,
params: { params: {
id?: string; id?: string;
@ -99,14 +101,14 @@ export function updateCurrentUser(
return makeRestApiRequest(context, 'PATCH', '/me', params as unknown as IDataObject); return makeRestApiRequest(context, 'PATCH', '/me', params as unknown as IDataObject);
} }
export function updateCurrentUserSettings( export async function updateCurrentUserSettings(
context: IRestApiContext, context: IRestApiContext,
settings: IUserResponse['settings'], settings: IUserResponse['settings'],
): Promise<IUserResponse['settings']> { ): Promise<IUserResponse['settings']> {
return makeRestApiRequest(context, 'PATCH', '/me/settings', settings); return makeRestApiRequest(context, 'PATCH', '/me/settings', settings);
} }
export function updateCurrentUserPassword( export async function updateCurrentUserPassword(
context: IRestApiContext, context: IRestApiContext,
params: { newPassword: string; currentPassword: string }, params: { newPassword: string; currentPassword: string },
): Promise<void> { ): Promise<void> {
@ -120,11 +122,11 @@ export async function deleteUser(
await makeRestApiRequest(context, 'DELETE', `/users/${id}`, transferId ? { transferId } : {}); await makeRestApiRequest(context, 'DELETE', `/users/${id}`, transferId ? { transferId } : {});
} }
export function getUsers(context: IRestApiContext): Promise<IUserResponse[]> { export async function getUsers(context: IRestApiContext): Promise<IUserResponse[]> {
return makeRestApiRequest(context, 'GET', '/users'); return makeRestApiRequest(context, 'GET', '/users');
} }
export function inviteUsers( export async function inviteUsers(
context: IRestApiContext, context: IRestApiContext,
params: Array<{ email: string }>, params: Array<{ email: string }>,
): Promise<IInviteResponse[]> { ): Promise<IInviteResponse[]> {
@ -139,7 +141,7 @@ export async function getInviteLink(
context: IRestApiContext, context: IRestApiContext,
{ id }: { id: string }, { id }: { id: string },
): Promise<{ link: 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( export async function submitPersonalizationSurvey(

View file

@ -4,33 +4,35 @@ import type { IDataObject } from 'n8n-workflow';
const versionControlApiRoot = '/version-control'; const versionControlApiRoot = '/version-control';
export const initSsh = (context: IRestApiContext, data: IDataObject): Promise<string> => { export const initSsh = async (context: IRestApiContext, data: IDataObject): Promise<string> => {
return makeRestApiRequest(context, 'POST', `${versionControlApiRoot}/init-ssh`, data); return makeRestApiRequest(context, 'POST', `${versionControlApiRoot}/init-ssh`, data);
}; };
export const initRepository = ( export const initRepository = async (
context: IRestApiContext, context: IRestApiContext,
): Promise<{ branches: string[]; currentBranch: string }> => { ): Promise<{ branches: string[]; currentBranch: string }> => {
return makeRestApiRequest(context, 'POST', `${versionControlApiRoot}/init-repository`); return makeRestApiRequest(context, 'POST', `${versionControlApiRoot}/init-repository`);
}; };
export const sync = (context: IRestApiContext, data: IDataObject): Promise<void> => { export const sync = async (context: IRestApiContext, data: IDataObject): Promise<void> => {
return makeRestApiRequest(context, 'POST', `${versionControlApiRoot}/push`, data); return makeRestApiRequest(context, 'POST', `${versionControlApiRoot}/push`, data);
}; };
export const getConfig = ( export const getConfig = async (
context: IRestApiContext, context: IRestApiContext,
): Promise<{ remoteRepository: string; name: string; email: string; currentBranch: string }> => { ): Promise<{ remoteRepository: string; name: string; email: string; currentBranch: string }> => {
return makeRestApiRequest(context, 'GET', `${versionControlApiRoot}/config`); return makeRestApiRequest(context, 'GET', `${versionControlApiRoot}/config`);
}; };
export const setPreferences = ( export const setPreferences = async (
context: IRestApiContext, context: IRestApiContext,
preferences: Partial<VersionControlPreferences>, preferences: Partial<VersionControlPreferences>,
): Promise<VersionControlPreferences> => { ): Promise<VersionControlPreferences> => {
return makeRestApiRequest(context, 'POST', `${versionControlApiRoot}/preferences`, preferences); return makeRestApiRequest(context, 'POST', `${versionControlApiRoot}/preferences`, preferences);
}; };
export const getPreferences = (context: IRestApiContext): Promise<VersionControlPreferences> => { export const getPreferences = async (
context: IRestApiContext,
): Promise<VersionControlPreferences> => {
return makeRestApiRequest(context, 'GET', `${versionControlApiRoot}/preferences`); return makeRestApiRequest(context, 'GET', `${versionControlApiRoot}/preferences`);
}; };

View file

@ -1,6 +1,6 @@
import type { IVersion } from '@/Interface'; import type { IVersion } from '@/Interface';
import { INSTANCE_ID_HEADER } from '@/constants'; import { INSTANCE_ID_HEADER } from '@/constants';
import { get } from '@/utils'; import { get } from '@/utils/apiUtils';
export async function getNextVersions( export async function getNextVersions(
endpoint: string, endpoint: string,
@ -8,5 +8,5 @@ export async function getNextVersions(
instanceId: string, instanceId: string,
): Promise<IVersion[]> { ): Promise<IVersion[]> {
const headers = { [INSTANCE_ID_HEADER as string]: instanceId }; const headers = { [INSTANCE_ID_HEADER as string]: instanceId };
return await get(endpoint, version, {}, headers); return get(endpoint, version, {}, headers);
} }

View file

@ -1,5 +1,5 @@
import type { IOnboardingCallPrompt, IUser } from '@/Interface'; 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 N8N_API_BASE_URL = 'https://api.n8n.io/api';
const ONBOARDING_PROMPTS_ENDPOINT = '/prompts/onboarding'; const ONBOARDING_PROMPTS_ENDPOINT = '/prompts/onboarding';
@ -9,7 +9,7 @@ export async function fetchNextOnboardingPrompt(
instanceId: string, instanceId: string,
currentUer: IUser, currentUer: IUser,
): Promise<IOnboardingCallPrompt> { ): Promise<IOnboardingCallPrompt> {
return await get(N8N_API_BASE_URL, ONBOARDING_PROMPTS_ENDPOINT, { return get(N8N_API_BASE_URL, ONBOARDING_PROMPTS_ENDPOINT, {
instance_id: instanceId, instance_id: instanceId,
user_id: `${instanceId}#${currentUer.id}`, user_id: `${instanceId}#${currentUer.id}`,
is_owner: currentUer.isOwner, is_owner: currentUer.isOwner,
@ -40,7 +40,7 @@ export async function submitEmailOnSignup(
email: string | undefined, email: string | undefined,
agree: boolean, agree: boolean,
): Promise<string> { ): Promise<string> {
return await post(N8N_API_BASE_URL, CONTACT_EMAIL_SUBMISSION_ENDPOINT, { return post(N8N_API_BASE_URL, CONTACT_EMAIL_SUBMISSION_ENDPOINT, {
instance_id: instanceId, instance_id: instanceId,
user_id: `${instanceId}#${currentUer.id}`, user_id: `${instanceId}#${currentUer.id}`,
email, email,

View file

@ -1,5 +1,5 @@
import type { IRestApiContext, IShareWorkflowsPayload, IWorkflowsShareResponse } from '@/Interface'; import type { IRestApiContext, IShareWorkflowsPayload, IWorkflowsShareResponse } from '@/Interface';
import { makeRestApiRequest } from '@/utils'; import { makeRestApiRequest } from '@/utils/apiUtils';
import type { IDataObject } from 'n8n-workflow'; import type { IDataObject } from 'n8n-workflow';
export async function setWorkflowSharedWith( export async function setWorkflowSharedWith(

View file

@ -1,6 +1,6 @@
import type { IExecutionsCurrentSummaryExtended, IRestApiContext } from '@/Interface'; import type { IExecutionsCurrentSummaryExtended, IRestApiContext } from '@/Interface';
import type { ExecutionFilters, ExecutionOptions, IDataObject } from 'n8n-workflow'; 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) { export async function getNewWorkflow(context: IRestApiContext, name?: string) {
const response = await makeRestApiRequest(context, 'GET', '/workflows/new', name ? { name } : {}); 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) { export async function getWorkflow(context: IRestApiContext, id: string, filter?: object) {
const sendData = filter ? { filter } : undefined; 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) { export async function getWorkflows(context: IRestApiContext, filter?: object) {
const sendData = filter ? { filter } : undefined; const sendData = filter ? { filter } : undefined;
return await makeRestApiRequest(context, 'GET', '/workflows', sendData); return makeRestApiRequest(context, 'GET', '/workflows', sendData);
} }
export async function getActiveWorkflows(context: IRestApiContext) { 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) { 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( export async function getExecutions(
@ -35,9 +35,9 @@ export async function getExecutions(
filter?: ExecutionFilters, filter?: ExecutionFilters,
options?: ExecutionOptions, options?: ExecutionOptions,
): Promise<{ count: number; results: IExecutionsCurrentSummaryExtended[]; estimated: boolean }> { ): 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) { export async function getExecutionData(context: IRestApiContext, executionId: string) {
return await makeRestApiRequest(context, 'GET', `/executions/${executionId}`); return makeRestApiRequest(context, 'GET', `/executions/${executionId}`);
} }

View file

@ -71,7 +71,7 @@ export default mixins(nodeHelpers).extend({
'isReadOnly', // boolean 'isReadOnly', // boolean
], ],
components: { components: {
ParameterInputList: () => import('./ParameterInputList.vue') as Promise<Component>, ParameterInputList: async () => import('./ParameterInputList.vue') as Promise<Component>,
}, },
data() { data() {
return { return {

View file

@ -126,7 +126,7 @@ export default mixins(showMessage).extend({
}, },
async onAction(action: string) { async onAction(action: string) {
if (action === CREDENTIAL_LIST_ITEM_ACTIONS.OPEN) { if (action === CREDENTIAL_LIST_ITEM_ACTIONS.OPEN) {
this.onClick(); await this.onClick();
} else if (action === CREDENTIAL_LIST_ITEM_ACTIONS.DELETE) { } else if (action === CREDENTIAL_LIST_ITEM_ACTIONS.DELETE) {
const deleteConfirmed = await this.confirmMessage( const deleteConfirmed = await this.confirmMessage(
this.$locale.baseText( this.$locale.baseText(
@ -145,7 +145,7 @@ export default mixins(showMessage).extend({
); );
if (deleteConfirmed) { if (deleteConfirmed) {
this.credentialsStore.deleteCredential({ id: this.data.id }); await this.credentialsStore.deleteCredential({ id: this.data.id });
} }
} }
}, },

View file

@ -248,20 +248,20 @@ export default mixins(showMessage, nodeHelpers).extend({
} }
} }
this.$externalHooks().run('credentialsEdit.credentialModalOpened', { await this.$externalHooks().run('credentialsEdit.credentialModalOpened', {
credentialType: this.credentialTypeName, credentialType: this.credentialTypeName,
isEditingCredential: this.mode === 'edit', isEditingCredential: this.mode === 'edit',
activeNode: this.ndvStore.activeNode, activeNode: this.ndvStore.activeNode,
}); });
setTimeout(() => { setTimeout(async () => {
if (this.credentialId) { if (this.credentialId) {
if (!this.requiredPropertiesFilled && this.credentialPermissions.isOwner === true) { if (!this.requiredPropertiesFilled && this.credentialPermissions.isOwner === true) {
// sharees can't see properties, so this check would always fail for them // sharees can't see properties, so this check would always fail for them
// if the credential contains required fields. // if the credential contains required fields.
this.showValidationWarning = true; this.showValidationWarning = true;
} else { } else {
this.retestCredential(); await this.retestCredential();
} }
} }
}, 0); }, 0);
@ -825,7 +825,7 @@ export default mixins(showMessage, nodeHelpers).extend({
} }
this.$telemetry.track('User saved credentials', trackProperties); this.$telemetry.track('User saved credentials', trackProperties);
this.$externalHooks().run('credentialEdit.saveCredential', trackProperties); await this.$externalHooks().run('credentialEdit.saveCredential', trackProperties);
} }
return credential; return credential;
@ -848,7 +848,7 @@ export default mixins(showMessage, nodeHelpers).extend({
return null; return null;
} }
this.$externalHooks().run('credential.saved', { await this.$externalHooks().run('credential.saved', {
credential_type: credentialDetails.type, credential_type: credentialDetails.type,
credential_id: credential.id, credential_id: credential.id,
is_new: true, is_new: true,
@ -882,7 +882,7 @@ export default mixins(showMessage, nodeHelpers).extend({
return null; return null;
} }
this.$externalHooks().run('credential.saved', { await this.$externalHooks().run('credential.saved', {
credential_type: credentialDetails.type, credential_type: credentialDetails.type,
credential_id: credential.id, credential_id: credential.id,
is_new: false, is_new: false,
@ -922,7 +922,7 @@ export default mixins(showMessage, nodeHelpers).extend({
try { try {
this.isDeleting = true; this.isDeleting = true;
this.credentialsStore.deleteCredential({ id: this.credentialId }); await this.credentialsStore.deleteCredential({ id: this.credentialId });
this.hasUnsavedChanges = false; this.hasUnsavedChanges = false;
} catch (error) { } catch (error) {
this.$showError( this.$showError(

View file

@ -176,7 +176,7 @@ export default mixins(showMessage).extend({
await this.usersStore.fetchUsers(); await this.usersStore.fetchUsers();
}, },
goToUsersSettings() { goToUsersSettings() {
this.$router.push({ name: VIEWS.USERS_SETTINGS }); void this.$router.push({ name: VIEWS.USERS_SETTINGS });
this.modalBus.emit('close'); this.modalBus.emit('close');
}, },
goToUpgrade() { goToUpgrade() {
@ -184,7 +184,7 @@ export default mixins(showMessage).extend({
}, },
}, },
mounted() { mounted() {
this.loadUsers(); void this.loadUsers();
}, },
}); });
</script> </script>

View file

@ -113,7 +113,7 @@ export default mixins(externalHooks).extend({
}; };
this.$telemetry.track('User opened Credential modal', telemetryPayload); this.$telemetry.track('User opened Credential modal', telemetryPayload);
this.$externalHooks().run('credentialsSelectModal.openCredentialType', telemetryPayload); void this.$externalHooks().run('credentialsSelectModal.openCredentialType', telemetryPayload);
}, },
}, },
}); });

View file

@ -215,7 +215,7 @@ export default mixins(workflowHelpers).extend({
name: this.workflowName, name: this.workflowName,
tags: this.currentWorkflowTagIds, tags: this.currentWorkflowTagIds,
}); });
if (saved) this.settingsStore.fetchPromptsData(); if (saved) await this.settingsStore.fetchPromptsData();
}, },
}, },
}); });

View file

@ -48,7 +48,7 @@ export default defineComponent({
onSetupFirstStep(event: MouseEvent): void { onSetupFirstStep(event: MouseEvent): void {
this.uiStore.addFirstStepOnLoad = true; this.uiStore.addFirstStepOnLoad = true;
const workflowRoute = this.getWorkflowRoute(); const workflowRoute = this.getWorkflowRoute();
this.$router.push(workflowRoute); void this.$router.push(workflowRoute);
}, },
getWorkflowRoute(): { name: string; params: {} } { getWorkflowRoute(): { name: string; params: {} } {
const workflowId = this.workflowsStore.workflowId || this.$route.params.name; const workflowId = this.workflowsStore.workflowId || this.$route.params.name;

View file

@ -116,7 +116,7 @@ export default mixins(showMessage, executionHelpers, debounceHelper, workflowHel
watch: { watch: {
$route(to: Route, from: Route) { $route(to: Route, from: Route) {
const workflowChanged = from.params.name !== to.params.name; const workflowChanged = from.params.name !== to.params.name;
this.initView(workflowChanged); void this.initView(workflowChanged);
if (to.params.executionId) { if (to.params.executionId) {
const execution = this.workflowsStore.getExecutionDataById(to.params.executionId); const execution = this.workflowsStore.getExecutionDataById(to.params.executionId);
@ -303,7 +303,7 @@ export default mixins(showMessage, executionHelpers, debounceHelper, workflowHel
type: 'success', type: 'success',
}); });
this.loadAutoRefresh(); await this.loadAutoRefresh();
} catch (error) { } catch (error) {
this.$showError( this.$showError(
error, 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.filter = filter;
this.setExecutions(); await this.setExecutions();
}, },
async setExecutions(): Promise<void> { async setExecutions(): Promise<void> {
this.workflowsStore.currentWorkflowExecutions = await this.loadExecutions(); this.workflowsStore.currentWorkflowExecutions = await this.loadExecutions();
@ -648,7 +648,7 @@ export default mixins(showMessage, executionHelpers, debounceHelper, workflowHel
duration: 2000, duration: 2000,
}); });
await this.retryExecution(payload.execution, loadWorkflow); await this.retryExecution(payload.execution, loadWorkflow);
this.loadAutoRefresh(); await this.loadAutoRefresh();
this.$telemetry.track('User clicked retry execution button', { this.$telemetry.track('User clicked retry execution button', {
workflow_id: this.workflowsStore.workflowId, workflow_id: this.workflowsStore.workflowId,

View file

@ -122,7 +122,7 @@ export default mixins(externalHooks, genericHelpers, debounceHelper).extend({
this.updateDisplayValue(); this.updateDisplayValue();
this.$emit('valueChanged', this.latestValue); this.$emit('valueChanged', this.latestValue);
} else { } else {
this.callDebounced('updateDisplayValue', { debounceTime: 500 }); void this.callDebounced('updateDisplayValue', { debounceTime: 500 });
} }
}, },
@ -238,7 +238,7 @@ export default mixins(externalHooks, genericHelpers, debounceHelper).extend({
); );
this.$telemetry.track('User closed Expression Editor', telemetryPayload); this.$telemetry.track('User closed Expression Editor', telemetryPayload);
this.$externalHooks().run('expressionEdit.closeDialog', telemetryPayload); void this.$externalHooks().run('expressionEdit.closeDialog', telemetryPayload);
} }
}, },
}, },

View file

@ -151,7 +151,7 @@ export default defineComponent({
}, },
}, },
components: { components: {
ParameterInputList: () => import('./ParameterInputList.vue') as Promise<Component>, ParameterInputList: async () => import('./ParameterInputList.vue') as Promise<Component>,
}, },
data() { data() {
return { return {

View file

@ -19,7 +19,7 @@ export default defineComponent({
methods: { methods: {
navigateTo() { navigateTo() {
if (this.routeHasHistory) this.$router.go(-1); if (this.routeHasHistory) this.$router.go(-1);
else this.$router.push({ name: VIEWS.TEMPLATES }); else void this.$router.push({ name: VIEWS.TEMPLATES });
}, },
}, },
mounted() { mounted() {

View file

@ -110,14 +110,14 @@ export default mixins(pushConnection, workflowHelpers).extend({
case MAIN_HEADER_TABS.WORKFLOW: case MAIN_HEADER_TABS.WORKFLOW:
if (!['', 'new', PLACEHOLDER_EMPTY_WORKFLOW_ID].includes(this.workflowToReturnTo)) { if (!['', 'new', PLACEHOLDER_EMPTY_WORKFLOW_ID].includes(this.workflowToReturnTo)) {
if (this.$route.name !== VIEWS.WORKFLOW) { if (this.$route.name !== VIEWS.WORKFLOW) {
this.$router.push({ void this.$router.push({
name: VIEWS.WORKFLOW, name: VIEWS.WORKFLOW,
params: { name: this.workflowToReturnTo }, params: { name: this.workflowToReturnTo },
}); });
} }
} else { } else {
if (this.$route.name !== VIEWS.NEW_WORKFLOW) { 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; this.uiStore.stateIsDirty = this.dirtyState;
} }
} }
@ -136,7 +136,10 @@ export default mixins(pushConnection, workflowHelpers).extend({
}) })
.catch(() => {}); .catch(() => {});
} else { } 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.modalBus.emit('closeAll');
this.activeHeaderTab = MAIN_HEADER_TABS.EXECUTIONS; this.activeHeaderTab = MAIN_HEADER_TABS.EXECUTIONS;

View file

@ -372,7 +372,7 @@ export default mixins(workflowHelpers).extend({
if (this.$data.isNameEditEnabled) { if (this.$data.isNameEditEnabled) {
if (this.$data.isTagsEditEnabled) { if (this.$data.isTagsEditEnabled) {
// @ts-ignore // @ts-ignore
this.onTagsBlur(); void this.onTagsBlur();
} }
this.$data.isTagsEditEnabled = false; this.$data.isTagsEditEnabled = false;
@ -522,7 +522,7 @@ export default mixins(workflowHelpers).extend({
type: 'success', type: 'success',
}); });
this.$router.push({ name: VIEWS.NEW_WORKFLOW }); await this.$router.push({ name: VIEWS.NEW_WORKFLOW });
break; break;
} }
default: default:

View file

@ -359,14 +359,14 @@ export default mixins(
this.onLogout(); this.onLogout();
break; break;
case 'settings': case 'settings':
this.$router.push({ name: VIEWS.PERSONAL_SETTINGS }); void this.$router.push({ name: VIEWS.PERSONAL_SETTINGS });
break; break;
default: default:
break; break;
} }
}, },
onLogout() { onLogout() {
this.$router.push({ name: VIEWS.SIGNOUT }); void this.$router.push({ name: VIEWS.SIGNOUT });
}, },
toggleCollapse() { toggleCollapse() {
this.uiStore.toggleSidebarMenuCollapse(); this.uiStore.toggleSidebarMenuCollapse();
@ -502,7 +502,7 @@ export default mixins(
); );
if (prompt.value) { if (prompt.value) {
this.versionControlStore.sync({ commitMessage: prompt.value }); await this.versionControlStore.sync({ commitMessage: prompt.value });
} }
}, },
}, },

View file

@ -314,7 +314,7 @@ export default mixins(debounceHelper).extend({
}, },
onResizeDebounced(data: { direction: string; x: number; width: number }) { onResizeDebounced(data: { direction: string; x: number; width: number }) {
if (this.initialized) { 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 }) { onResize({ direction, x, width }: { direction: string; x: number; width: number }) {

View file

@ -600,7 +600,7 @@ export default mixins(
}, },
onClick(event: MouseEvent) { onClick(event: MouseEvent) {
this.callDebounced('onClickDebounced', { debounceTime: 50, trailing: true }, event); void this.callDebounced('onClickDebounced', { debounceTime: 50, trailing: true }, event);
}, },
onClickDebounced(event: MouseEvent) { onClickDebounced(event: MouseEvent) {

View file

@ -51,7 +51,7 @@ import { useUIStore } from '@/stores/ui.store';
export default defineComponent({ export default defineComponent({
name: 'node-creation', name: 'node-creation',
components: { components: {
NodeCreator: () => import('@/components/Node/NodeCreator/NodeCreator.vue'), NodeCreator: async () => import('@/components/Node/NodeCreator/NodeCreator.vue'),
}, },
props: { props: {
nodeViewScale: { nodeViewScale: {

View file

@ -177,7 +177,7 @@ function trackActionsView() {
trigger_action_count, trigger_action_count,
}; };
runExternalHook('nodeCreateList.onViewActions', useWebhooksStore(), trackingPayload); void runExternalHook('nodeCreateList.onViewActions', useWebhooksStore(), trackingPayload);
telemetry?.trackNodesPanel('nodeCreateList.onViewActions', trackingPayload); telemetry?.trackNodesPanel('nodeCreateList.onViewActions', trackingPayload);
} }
@ -198,7 +198,7 @@ function addHttpNode() {
if (telemetry) setAddedNodeActionParameters(updateData); if (telemetry) setAddedNodeActionParameters(updateData);
const app_identifier = actions.value[0].key; const app_identifier = actions.value[0].key;
runExternalHook('nodeCreateList.onActionsCustmAPIClicked', useWebhooksStore(), { void runExternalHook('nodeCreateList.onActionsCustmAPIClicked', useWebhooksStore(), {
app_identifier, app_identifier,
}); });
telemetry?.trackNodesPanel('nodeCreateList.onActionsCustmAPIClicked', { app_identifier }); telemetry?.trackNodesPanel('nodeCreateList.onActionsCustmAPIClicked', { app_identifier });

View file

@ -36,19 +36,19 @@ const nodeCreatorView = computed(() => useNodeCreatorStore().selectedView);
function onSearch(value: string) { function onSearch(value: string) {
if (activeViewStack.value.uuid) { if (activeViewStack.value.uuid) {
updateCurrentViewStack({ search: value }); updateCurrentViewStack({ search: value });
setActiveItemIndex(activeViewStack.value.activeIndex ?? 0); void setActiveItemIndex(activeViewStack.value.activeIndex ?? 0);
} }
} }
function onTransitionEnd() { function onTransitionEnd() {
// For actions, set the active focus to the first action, not category // For actions, set the active focus to the first action, not category
const newStackIndex = activeViewStack.value.mode === 'actions' ? 1 : 0; const newStackIndex = activeViewStack.value.mode === 'actions' ? 1 : 0;
setActiveItemIndex(activeViewStack.value.activeIndex || 0 || newStackIndex); void setActiveItemIndex(activeViewStack.value.activeIndex || 0 || newStackIndex);
} }
onMounted(() => { onMounted(() => {
attachKeydownEvent(); attachKeydownEvent();
setActiveItemIndex(activeViewStack.value.activeIndex ?? 0); void setActiveItemIndex(activeViewStack.value.activeIndex ?? 0);
}); });
onUnmounted(() => { onUnmounted(() => {

View file

@ -60,7 +60,9 @@ function clear() {
} }
onMounted(() => { onMounted(() => {
runExternalHook('nodeCreator_searchBar.mount', useWebhooksStore(), { inputRef: state.inputRef }); void runExternalHook('nodeCreator_searchBar.mount', useWebhooksStore(), {
inputRef: state.inputRef,
});
setTimeout(focus, 0); setTimeout(focus, 0);
}); });

View file

@ -94,7 +94,7 @@ describe('NodesListPanel', () => {
expect(container.querySelector('.backButton')).toBeInTheDocument(); expect(container.querySelector('.backButton')).toBeInTheDocument();
fireEvent.click(container.querySelector('.backButton')!); await fireEvent.click(container.querySelector('.backButton')!);
await Vue.nextTick(); await Vue.nextTick();
expect(screen.queryAllByTestId('item-iterator-item')).toHaveLength(6); expect(screen.queryAllByTestId('item-iterator-item')).toHaveLength(6);
@ -265,20 +265,20 @@ describe('NodesListPanel', () => {
screen.getByText('On app event').click(); screen.getByText('On app event').click();
await Vue.nextTick(); await Vue.nextTick();
fireEvent.input(screen.getByTestId('node-creator-search-bar'), { await fireEvent.input(screen.getByTestId('node-creator-search-bar'), {
target: { value: 'Ninth' }, target: { value: 'Ninth' },
}); });
await Vue.nextTick(); await Vue.nextTick();
expect(screen.queryAllByTestId('item-iterator-item')).toHaveLength(1); 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' }, target: { value: 'Non sense' },
}); });
await Vue.nextTick(); await Vue.nextTick();
expect(screen.queryAllByTestId('item-iterator-item')).toHaveLength(0); expect(screen.queryAllByTestId('item-iterator-item')).toHaveLength(0);
expect(screen.queryByText("We didn't make that... yet")).toBeInTheDocument(); expect(screen.queryByText("We didn't make that... yet")).toBeInTheDocument();
fireEvent.click(container.querySelector('.clear')!); await fireEvent.click(container.querySelector('.clear')!);
await Vue.nextTick(); await Vue.nextTick();
expect(screen.queryAllByTestId('item-iterator-item')).toHaveLength(9); expect(screen.queryAllByTestId('item-iterator-item')).toHaveLength(9);
}); });

View file

@ -203,7 +203,7 @@ export const useActions = () => {
source_mode: rootView.toLowerCase(), source_mode: rootView.toLowerCase(),
resource: (action.value as INodeParameters).resource || '', resource: (action.value as INodeParameters).resource || '',
}; };
runExternalHook('nodeCreateList.addAction', useWebhooksStore(), payload); void runExternalHook('nodeCreateList.addAction', useWebhooksStore(), payload);
telemetry?.trackNodesPanel('nodeCreateList.addAction', payload); telemetry?.trackNodesPanel('nodeCreateList.addAction', payload);
} }

View file

@ -31,7 +31,7 @@ export const useKeyboardNavigation = defineStore('nodeCreatorKeyboardNavigation'
function getElementId(element?: Element) { function getElementId(element?: Element) {
return element?.getAttribute(KEYBOARD_ID_ATTR) || undefined; return element?.getAttribute(KEYBOARD_ID_ATTR) || undefined;
} }
function refreshSelectableItems(): Promise<void> { async function refreshSelectableItems(): Promise<void> {
return new Promise((resolve) => { return new Promise((resolve) => {
// Wait for DOM to update // Wait for DOM to update
cleanupSelectableItems(); cleanupSelectableItems();

View file

@ -529,7 +529,7 @@ export default mixins(
onWorkflowActivate() { onWorkflowActivate() {
this.ndvStore.activeNodeName = null; this.ndvStore.activeNodeName = null;
setTimeout(() => { setTimeout(() => {
this.activateCurrentWorkflow('ndv'); void this.activateCurrentWorkflow('ndv');
}, 1000); }, 1000);
}, },
onFeatureRequestClick() { onFeatureRequestClick() {
@ -643,7 +643,7 @@ export default mixins(
this.ndvStore.setOutputPanelEditModeEnabled(false); this.ndvStore.setOutputPanelEditModeEnabled(false);
} }
this.$externalHooks().run('dataDisplay.nodeEditingFinished'); await this.$externalHooks().run('dataDisplay.nodeEditingFinished');
this.$telemetry.track('User closed node modal', { this.$telemetry.track('User closed node modal', {
node_type: this.activeNodeType ? this.activeNodeType.name : '', node_type: this.activeNodeType ? this.activeNodeType.name : '',
session_id: this.sessionId, session_id: this.sessionId,

View file

@ -180,7 +180,7 @@ export default mixins(workflowRun, pinData).extend({
async onClick() { async onClick() {
if (this.isListeningForEvents) { if (this.isListeningForEvents) {
this.stopWaitingForWebhook(); await this.stopWaitingForWebhook();
} else if (this.isListeningForWorkflowEvents) { } else if (this.isListeningForWorkflowEvents) {
this.$emit('stopExecution'); this.$emit('stopExecution');
} else { } else {
@ -207,9 +207,9 @@ export default mixins(workflowRun, pinData).extend({
source: this.telemetrySource, source: this.telemetrySource,
}; };
this.$telemetry.track('User clicked execute node button', telemetryPayload); 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'); this.$emit('execute');
} }
} }

View file

@ -578,7 +578,7 @@ export default mixins(externalHooks, nodeHelpers).extend({
this.updateNodeCredentialIssues(node); this.updateNodeCredentialIssues(node);
} }
this.$externalHooks().run('nodeSettings.credentialSelected', { updateInformation }); void this.$externalHooks().run('nodeSettings.credentialSelected', { updateInformation });
}, },
nameChanged(name: string) { nameChanged(name: string) {
if (this.node) { if (this.node) {
@ -672,7 +672,7 @@ export default mixins(externalHooks, nodeHelpers).extend({
} }
} }
this.$externalHooks().run('nodeSettings.valueChanged', { void this.$externalHooks().run('nodeSettings.valueChanged', {
parameterPath, parameterPath,
newValue, newValue,
parameters: this.parameters, parameters: this.parameters,
@ -780,7 +780,7 @@ export default mixins(externalHooks, nodeHelpers).extend({
this.workflowsStore.setNodeParameters(updateInformation); this.workflowsStore.setNodeParameters(updateInformation);
this.$externalHooks().run('nodeSettings.valueChanged', { void this.$externalHooks().run('nodeSettings.valueChanged', {
parameterPath, parameterPath,
newValue, newValue,
parameters: this.parameters, parameters: this.parameters,

View file

@ -522,7 +522,7 @@ export default mixins(
dependentParametersValues() { dependentParametersValues() {
// Reload the remote parameters whenever a parameter // Reload the remote parameters whenever a parameter
// on which the current field depends on changes // on which the current field depends on changes
this.loadRemoteParameterOptions(); void this.loadRemoteParameterOptions();
}, },
value() { value() {
if (this.parameter.type === 'color' && this.getArgument('showAlpha') === true) { if (this.parameter.type === 'color' && this.getArgument('showAlpha') === true) {
@ -1116,7 +1116,7 @@ export default mixins(
resourceLocatorRef?.$emit('refreshList'); resourceLocatorRef?.$emit('refreshList');
} }
this.loadRemoteParameterOptions(); void this.loadRemoteParameterOptions();
} else if (command === 'formatHtml') { } else if (command === 'formatHtml') {
htmlEditorEventBus.emit('format-html'); htmlEditorEventBus.emit('format-html');
} }
@ -1175,7 +1175,7 @@ export default mixins(
this.$watch( this.$watch(
() => this.node!.credentials, () => this.node!.credentials,
() => { () => {
this.loadRemoteParameterOptions(); void this.loadRemoteParameterOptions();
}, },
{ deep: true, immediate: true }, { deep: true, immediate: true },
); );

View file

@ -128,7 +128,7 @@ import ImportParameter from '@/components/ImportParameter.vue';
import { get, set } from 'lodash-es'; import { get, set } from 'lodash-es';
import mixins from 'vue-typed-mixins'; import mixins from 'vue-typed-mixins';
import type { Component, PropType } from 'vue'; import type { PropType } from 'vue';
import { mapStores } from 'pinia'; import { mapStores } from 'pinia';
import { useNDVStore } from '@/stores/ndv.store'; import { useNDVStore } from '@/stores/ndv.store';
import { useNodeTypesStore } from '@/stores/nodeTypes.store'; import { useNodeTypesStore } from '@/stores/nodeTypes.store';
@ -140,8 +140,8 @@ export default mixins(workflowHelpers).extend({
components: { components: {
MultipleParameter, MultipleParameter,
ParameterInputFull, ParameterInputFull,
FixedCollectionParameter: () => import('./FixedCollectionParameter.vue') as Promise<Component>, FixedCollectionParameter: async () => import('./FixedCollectionParameter.vue'),
CollectionParameter: () => import('./CollectionParameter.vue') as Promise<Component>, CollectionParameter: async () => import('./CollectionParameter.vue'),
ImportParameter, ImportParameter,
}, },
props: { props: {

View file

@ -610,7 +610,7 @@ export default mixins(showMessage, workflowHelpers).extend({
// In case the redirect to canvas for new users didn't happen // In case the redirect to canvas for new users didn't happen
// we try again after closing the modal // we try again after closing the modal
if (this.$route.name !== VIEWS.NEW_WORKFLOW) { if (this.$route.name !== VIEWS.NEW_WORKFLOW) {
this.$router.replace({ name: VIEWS.NEW_WORKFLOW }); void this.$router.replace({ name: VIEWS.NEW_WORKFLOW });
} }
}, },
onSave() { onSave() {
@ -627,7 +627,7 @@ export default mixins(showMessage, workflowHelpers).extend({
personalization_survey_n8n_version: this.rootStore.versionCli, 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 IPersonalizationLatestVersion); await this.usersStore.submitPersonalizationSurvey(survey as IPersonalizationLatestVersion);

View file

@ -617,11 +617,11 @@ export default mixins(debounceHelper, workflowHelpers, nodeHelpers).extend({
async loadInitialResources(): Promise<void> { async loadInitialResources(): Promise<void> {
if (!this.currentResponse || (this.currentResponse && this.currentResponse.error)) { if (!this.currentResponse || (this.currentResponse && this.currentResponse.error)) {
this.searchFilter = ''; this.searchFilter = '';
this.loadResources(); await this.loadResources();
} }
}, },
loadResourcesDebounced() { loadResourcesDebounced() {
this.callDebounced('loadResources', { debounceTime: 1000, trailing: true }); void this.callDebounced('loadResources', { debounceTime: 1000, trailing: true });
}, },
setResponse(paramsKey: string, props: Partial<IResourceLocatorQuery>) { setResponse(paramsKey: string, props: Partial<IResourceLocatorQuery>) {
this.cachedResponses = { this.cachedResponses = {
@ -707,7 +707,7 @@ export default mixins(debounceHelper, workflowHelpers, nodeHelpers).extend({
return; return;
} }
this.loadInitialResources(); void this.loadInitialResources();
this.showResourceDropdown = true; this.showResourceDropdown = true;
}, },
switchFromListMode(): void { switchFromListMode(): void {

View file

@ -515,10 +515,10 @@ import { mapStores } from 'pinia';
import { useNDVStore } from '@/stores/ndv.store'; import { useNDVStore } from '@/stores/ndv.store';
import { useNodeTypesStore } from '@/stores/nodeTypes.store'; import { useNodeTypesStore } from '@/stores/nodeTypes.store';
const RunDataTable = () => import('@/components/RunDataTable.vue'); const RunDataTable = async () => import('@/components/RunDataTable.vue');
const RunDataJson = () => import('@/components/RunDataJson.vue'); const RunDataJson = async () => import('@/components/RunDataJson.vue');
const RunDataSchema = () => import('@/components/RunDataSchema.vue'); const RunDataSchema = async () => import('@/components/RunDataSchema.vue');
const RunDataHtml = () => import('@/components/RunDataHtml.vue'); const RunDataHtml = async () => import('@/components/RunDataHtml.vue');
export type EnterEditModeArgs = { export type EnterEditModeArgs = {
origin: 'editIconButton' | 'insertTestDataLink'; origin: 'editIconButton' | 'insertTestDataLink';
@ -1259,7 +1259,7 @@ export default mixins(externalHooks, genericHelpers, nodeHelpers, pinData).exten
return; return;
} else { } else {
const bufferString = 'data:' + mimeType + ';base64,' + data; 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); saveAs(blob, fileName);
} }
}, },

View file

@ -85,7 +85,7 @@ import { getMappedExpression } from '@/utils/mappingUtils';
import { useWorkflowsStore } from '@/stores/workflows.store'; import { useWorkflowsStore } from '@/stores/workflows.store';
import { nonExistingJsonPath } from '@/components/RunDataJsonActions.vue'; import { nonExistingJsonPath } from '@/components/RunDataJsonActions.vue';
const runDataJsonActions = () => import('@/components/RunDataJsonActions.vue'); const runDataJsonActions = async () => import('@/components/RunDataJsonActions.vue');
export default mixins(externalHooks).extend({ export default mixins(externalHooks).extend({
name: 'run-data-json', name: 'run-data-json',
@ -179,7 +179,7 @@ export default mixins(externalHooks).extend({
...mappingTelemetry, ...mappingTelemetry,
}; };
this.$externalHooks().run('runDataJson.onDragEnd', telemetryPayload); void this.$externalHooks().run('runDataJson.onDragEnd', telemetryPayload);
this.$telemetry.track('User dragged data for mapping', telemetryPayload); this.$telemetry.track('User dragged data for mapping', telemetryPayload);
}, 1000); // ensure dest data gets set if drop }, 1000); // ensure dest data gets set if drop

View file

@ -64,7 +64,7 @@ const onDragEnd = (el: HTMLElement) => {
...mappingTelemetry, ...mappingTelemetry,
}; };
runExternalHook('runDataJson.onDragEnd', webhooksStore, telemetryPayload); void runExternalHook('runDataJson.onDragEnd', webhooksStore, telemetryPayload);
telemetry.track('User dragged data for mapping', telemetryPayload); telemetry.track('User dragged data for mapping', telemetryPayload);
}, 1000); // ensure dest data gets set if drop }, 1000); // ensure dest data gets set if drop

View file

@ -423,7 +423,7 @@ export default mixins(externalHooks).extend({
...mappingTelemetry, ...mappingTelemetry,
}; };
this.$externalHooks().run('runDataTable.onDragEnd', telemetryPayload); void this.$externalHooks().run('runDataTable.onDragEnd', telemetryPayload);
this.$telemetry.track('User dragged data for mapping', telemetryPayload); this.$telemetry.track('User dragged data for mapping', telemetryPayload);
}, 1000); // ensure dest data gets set if drop }, 1000); // ensure dest data gets set if drop

View file

@ -50,12 +50,12 @@
import mixins from 'vue-typed-mixins'; import mixins from 'vue-typed-mixins';
import { EnterpriseEditionFeature } from '@/constants'; import { EnterpriseEditionFeature } from '@/constants';
import { showMessage } from '@/mixins/showMessage'; import { showMessage } from '@/mixins/showMessage';
import { useLogStreamingStore } from '../../stores/logStreaming.store'; import { useLogStreamingStore } from '@/stores/logStreaming.store';
import type { PropType } from 'vue'; import type { PropType } from 'vue';
import { mapStores } from 'pinia'; import { mapStores } from 'pinia';
import type { MessageEventBusDestinationOptions } from 'n8n-workflow'; import type { MessageEventBusDestinationOptions } from 'n8n-workflow';
import { deepCopy, defaultMessageEventBusDestinationOptions } 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'; import type { EventBus } from '@/event-bus';
export const DESTINATION_LIST_ITEM_ACTIONS = { export const DESTINATION_LIST_ITEM_ACTIONS = {
@ -139,7 +139,7 @@ export default mixins(showMessage).extend({
}, },
onEnabledSwitched(state: boolean, destinationId: string) { onEnabledSwitched(state: boolean, destinationId: string) {
this.nodeParameters.enabled = state; this.nodeParameters.enabled = state;
this.saveDestination(); void this.saveDestination();
}, },
async saveDestination() { async saveDestination() {
await this.logStreamingStore.saveDestination(this.nodeParameters); await this.logStreamingStore.saveDestination(this.nodeParameters);

View file

@ -175,12 +175,12 @@
import { get, set, unset } from 'lodash-es'; import { get, set, unset } from 'lodash-es';
import { mapStores } from 'pinia'; import { mapStores } from 'pinia';
import mixins from 'vue-typed-mixins'; import mixins from 'vue-typed-mixins';
import { useLogStreamingStore } from '../../stores/logStreaming.store'; import { useLogStreamingStore } from '@/stores/logStreaming.store';
import { useNDVStore } from '../../stores/ndv.store'; import { useNDVStore } from '@/stores/ndv.store';
import { useWorkflowsStore } from '../../stores/workflows.store'; import { useWorkflowsStore } from '@/stores/workflows.store';
import ParameterInputList from '@/components/ParameterInputList.vue'; import ParameterInputList from '@/components/ParameterInputList.vue';
import NodeCredentials from '@/components/NodeCredentials.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 { import type {
IDataObject, IDataObject,
INodeCredentials, INodeCredentials,
@ -197,18 +197,18 @@ import {
} from 'n8n-workflow'; } from 'n8n-workflow';
import type { PropType } from 'vue'; import type { PropType } from 'vue';
import Vue 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 Modal from '@/components/Modal.vue';
import { showMessage } from '@/mixins/showMessage'; import { showMessage } from '@/mixins/showMessage';
import { useUIStore } from '../../stores/ui.store'; import { useUIStore } from '@/stores/ui.store';
import { useUsersStore } from '../../stores/users.store'; import { useUsersStore } from '@/stores/users.store';
import { destinationToFakeINodeUi } from './Helpers.ee'; import { destinationToFakeINodeUi } from './Helpers.ee';
import { import {
webhookModalDescription, webhookModalDescription,
sentryModalDescription, sentryModalDescription,
syslogModalDescription, syslogModalDescription,
} from './descriptions.ee'; } from './descriptions.ee';
import type { BaseTextKey } from '../../plugins/i18n'; import type { BaseTextKey } from '@/plugins/i18n';
import InlineNameEdit from '../InlineNameEdit.vue'; import InlineNameEdit from '../InlineNameEdit.vue';
import SaveButton from '../SaveButton.vue'; import SaveButton from '../SaveButton.vue';
import EventSelection from '@/components/SettingsLogStreaming/EventSelection.ee.vue'; import EventSelection from '@/components/SettingsLogStreaming/EventSelection.ee.vue';

View file

@ -71,8 +71,8 @@
<script lang="ts"> <script lang="ts">
import { Checkbox } from 'element-ui'; import { Checkbox } from 'element-ui';
import { mapStores } from 'pinia'; import { mapStores } from 'pinia';
import type { BaseTextKey } from '../../plugins/i18n'; import type { BaseTextKey } from '@/plugins/i18n';
import { useLogStreamingStore } from '../../stores/logStreaming.store'; import { useLogStreamingStore } from '@/stores/logStreaming.store';
export default { export default {
name: 'event-selection', name: 'event-selection',

View file

@ -3,7 +3,7 @@ import type {
INodeParameters, INodeParameters,
MessageEventBusDestinationOptions, MessageEventBusDestinationOptions,
} from 'n8n-workflow'; } from 'n8n-workflow';
import type { INodeUi } from '../../Interface'; import type { INodeUi } from '@/Interface';
export function destinationToFakeINodeUi( export function destinationToFakeINodeUi(
destination: MessageEventBusDestinationOptions, destination: MessageEventBusDestinationOptions,

View file

@ -171,27 +171,27 @@ export default mixins(userHelpers).extend({
switch (key) { switch (key) {
case 'settings-personal': case 'settings-personal':
if (this.$router.currentRoute.name !== VIEWS.PERSONAL_SETTINGS) { if (this.$router.currentRoute.name !== VIEWS.PERSONAL_SETTINGS) {
this.$router.push({ name: VIEWS.PERSONAL_SETTINGS }); await this.$router.push({ name: VIEWS.PERSONAL_SETTINGS });
} }
break; break;
case 'settings-users': case 'settings-users':
if (this.$router.currentRoute.name !== VIEWS.USERS_SETTINGS) { if (this.$router.currentRoute.name !== VIEWS.USERS_SETTINGS) {
this.$router.push({ name: VIEWS.USERS_SETTINGS }); await this.$router.push({ name: VIEWS.USERS_SETTINGS });
} }
break; break;
case 'settings-api': case 'settings-api':
if (this.$router.currentRoute.name !== VIEWS.API_SETTINGS) { if (this.$router.currentRoute.name !== VIEWS.API_SETTINGS) {
this.$router.push({ name: VIEWS.API_SETTINGS }); await this.$router.push({ name: VIEWS.API_SETTINGS });
} }
break; break;
case 'settings-ldap': case 'settings-ldap':
if (this.$router.currentRoute.name !== VIEWS.LDAP_SETTINGS) { if (this.$router.currentRoute.name !== VIEWS.LDAP_SETTINGS) {
this.$router.push({ name: VIEWS.LDAP_SETTINGS }); void this.$router.push({ name: VIEWS.LDAP_SETTINGS });
} }
break; break;
case 'settings-log-streaming': case 'settings-log-streaming':
if (this.$router.currentRoute.name !== VIEWS.LOG_STREAMING_SETTINGS) { if (this.$router.currentRoute.name !== VIEWS.LOG_STREAMING_SETTINGS) {
this.$router.push({ name: VIEWS.LOG_STREAMING_SETTINGS }); void this.$router.push({ name: VIEWS.LOG_STREAMING_SETTINGS });
} }
break; break;
case 'users': // Fakedoor feature added via hooks when user management is disabled on cloud case 'users': // Fakedoor feature added via hooks when user management is disabled on cloud
@ -201,22 +201,22 @@ export default mixins(userHelpers).extend({
break; break;
case 'settings-community-nodes': case 'settings-community-nodes':
if (this.$router.currentRoute.name !== VIEWS.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; break;
case 'settings-usage-and-plan': case 'settings-usage-and-plan':
if (this.$router.currentRoute.name !== VIEWS.USAGE) { if (this.$router.currentRoute.name !== VIEWS.USAGE) {
this.$router.push({ name: VIEWS.USAGE }); void this.$router.push({ name: VIEWS.USAGE });
} }
break; break;
case 'settings-sso': case 'settings-sso':
if (this.$router.currentRoute.name !== VIEWS.SSO_SETTINGS) { if (this.$router.currentRoute.name !== VIEWS.SSO_SETTINGS) {
this.$router.push({ name: VIEWS.SSO_SETTINGS }); void this.$router.push({ name: VIEWS.SSO_SETTINGS });
} }
break; break;
case 'settings-version-control': case 'settings-version-control':
if (this.$router.currentRoute.name !== VIEWS.VERSION_CONTROL) { if (this.$router.currentRoute.name !== VIEWS.VERSION_CONTROL) {
this.$router.push({ name: VIEWS.VERSION_CONTROL }); void this.$router.push({ name: VIEWS.VERSION_CONTROL });
} }
break; break;
default: default:

View file

@ -123,7 +123,7 @@ export default mixins(showMessage).extend({
this.eventBus?.on('focus', this.onBusFocus); this.eventBus?.on('focus', this.onBusFocus);
this.tagsStore.fetchAll(); void this.tagsStore.fetchAll();
}, },
destroyed() { destroyed() {
this.eventBus?.off('focus', this.onBusFocus); this.eventBus?.off('focus', this.onBusFocus);
@ -176,7 +176,7 @@ export default mixins(showMessage).extend({
this.$data.filter = ''; this.$data.filter = '';
this.uiStore.openModal(TAGS_MANAGER_MODAL_KEY); this.uiStore.openModal(TAGS_MANAGER_MODAL_KEY);
} else if (ops === CREATE_KEY) { } else if (ops === CREATE_KEY) {
this.onCreate(); void this.onCreate();
} else { } else {
setTimeout(() => { setTimeout(() => {
if (!this.$data.preventUpdate) { if (!this.$data.preventUpdate) {

View file

@ -36,7 +36,7 @@ import { showMessage } from '@/mixins/showMessage';
import TagsView from '@/components/TagsManager/TagsView/TagsView.vue'; import TagsView from '@/components/TagsManager/TagsView/TagsView.vue';
import NoTagsView from '@/components/TagsManager/NoTagsView.vue'; import NoTagsView from '@/components/TagsManager/NoTagsView.vue';
import Modal from '@/components/Modal.vue'; import Modal from '@/components/Modal.vue';
import { TAGS_MANAGER_MODAL_KEY } from '../../constants'; import { TAGS_MANAGER_MODAL_KEY } from '@/constants';
import { mapStores } from 'pinia'; import { mapStores } from 'pinia';
import { useTagsStore } from '@/stores/tags.store'; import { useTagsStore } from '@/stores/tags.store';
import { createEventBus } from '@/event-bus'; import { createEventBus } from '@/event-bus';
@ -44,7 +44,7 @@ import { createEventBus } from '@/event-bus';
export default mixins(showMessage).extend({ export default mixins(showMessage).extend({
name: 'TagsManager', name: 'TagsManager',
created() { created() {
this.tagsStore.fetchAll({ force: true, withUsageCount: true }); void this.tagsStore.fetchAll({ force: true, withUsageCount: true });
}, },
data() { data() {
const tagIds = useTagsStore().allTags.map((tag) => tag.id); const tagIds = useTagsStore().allTags.map((tag) => tag.id);

View file

@ -81,11 +81,11 @@ export default defineComponent({
filterTemplateNodes, filterTemplateNodes,
redirectToCategory(id: string) { redirectToCategory(id: string) {
this.templatesStore.resetSessionId(); this.templatesStore.resetSessionId();
this.$router.push(`/templates?categories=${id}`); void this.$router.push(`/templates?categories=${id}`);
}, },
redirectToSearchPage(node: ITemplatesNode) { redirectToSearchPage(node: ITemplatesNode) {
this.templatesStore.resetSessionId(); this.templatesStore.resetSessionId();
this.$router.push(`/templates?search=${node.displayName}`); void this.$router.push(`/templates?search=${node.displayName}`);
}, },
}, },
}); });

View file

@ -153,7 +153,7 @@ const showSharedFeedbackError = () => {
}; };
const showConfetti = () => { const showConfetti = () => {
confetti({ void confetti({
particleCount: 200, particleCount: 200,
spread: 100, spread: 100,
origin: { y: 0.6 }, origin: { y: 0.6 },

View file

@ -100,7 +100,7 @@ export default mixins(showMessage, workflowActivate).extend({
}, },
methods: { methods: {
async activeChanged(newActiveState: boolean) { async activeChanged(newActiveState: boolean) {
return await this.updateWorkflowActivation(this.workflowId, newActiveState); return this.updateWorkflowActivation(this.workflowId, newActiveState);
}, },
async displayActivationError() { async displayActivationError() {
let errorMessage: string; let errorMessage: string;

View file

@ -181,7 +181,7 @@ export default mixins(showMessage).extend({
} }
} }
this.$router.push({ await this.$router.push({
name: VIEWS.WORKFLOW, name: VIEWS.WORKFLOW,
params: { name: this.data.id }, params: { name: this.data.id },
}); });

View file

@ -259,7 +259,7 @@ export default mixins(showMessage).extend({
this.loading = true; this.loading = true;
const saveWorkflowPromise = () => { const saveWorkflowPromise = async () => {
return new Promise<string>((resolve) => { return new Promise<string>((resolve) => {
if (this.workflow.id === PLACEHOLDER_EMPTY_WORKFLOW_ID) { if (this.workflow.id === PLACEHOLDER_EMPTY_WORKFLOW_ID) {
nodeViewEventBus.emit('saveWorkflow', () => { nodeViewEventBus.emit('saveWorkflow', () => {
@ -399,7 +399,7 @@ export default mixins(showMessage).extend({
}, },
onRoleAction(user: IUser, action: string) { onRoleAction(user: IUser, action: string) {
if (action === 'remove') { if (action === 'remove') {
this.onRemoveSharee(user.id); void this.onRemoveSharee(user.id);
} }
}, },
async onCloseModal() { async onCloseModal() {
@ -413,7 +413,7 @@ export default mixins(showMessage).extend({
); );
if (shouldSave) { if (shouldSave) {
return await this.onSave(); return this.onSave();
} }
} }
@ -457,7 +457,7 @@ export default mixins(showMessage).extend({
}, },
}, },
mounted() { mounted() {
this.initialize(); void this.initialize();
}, },
watch: { watch: {
workflow(workflow) { workflow(workflow) {

View file

@ -46,8 +46,8 @@ describe('PersonalizationModal.vue', () => {
await retry(() => expect(wrapper.find('.modal-content').exists()).toBe(true)); await retry(() => expect(wrapper.find('.modal-content').exists()).toBe(true));
for (const index of [3, 4, 5, 6]) { for (const index of [3, 4, 5, 6]) {
wrapper.find('.n8n-select[name="role"]').trigger('click'); await wrapper.find('.n8n-select[name="role"]').trigger('click');
wrapper await wrapper
.find('.n8n-select[name="role"]') .find('.n8n-select[name="role"]')
.findAll('.el-select-dropdown__item') .findAll('.el-select-dropdown__item')
.at(index) .at(index)

View file

@ -486,7 +486,7 @@ export default mixins(showMessage, debounceHelper).extend({
}, },
}, },
mounted() { mounted() {
this.onMounted(); void this.onMounted();
}, },
watch: { watch: {
isOwnerSubview() { isOwnerSubview() {

View file

@ -6,7 +6,7 @@ import { runExternalHook } from '@/utils';
export function useExternalHooks(): IExternalHooks { export function useExternalHooks(): IExternalHooks {
return { return {
async run(eventName: string, metadata?: IDataObject): Promise<void> { async run(eventName: string, metadata?: IDataObject): Promise<void> {
return await runExternalHook(eventName, useWebhooksStore(), metadata); return runExternalHook(eventName, useWebhooksStore(), metadata);
}, },
}; };
} }

View file

@ -27,7 +27,7 @@ export function useHistoryHelper(activeRoute: Route) {
const isNDVOpen = ref<boolean>(ndvStore.activeNodeName !== null); const isNDVOpen = ref<boolean>(ndvStore.activeNodeName !== null);
const undo = () => const undo = async () =>
callDebounced( callDebounced(
async () => { async () => {
const command = historyStore.popUndoableToUndo(); const command = historyStore.popUndoableToUndo();
@ -56,7 +56,7 @@ export function useHistoryHelper(activeRoute: Route) {
{ debounceTime: UNDO_REDO_DEBOUNCE_INTERVAL }, { debounceTime: UNDO_REDO_DEBOUNCE_INTERVAL },
); );
const redo = () => const redo = async () =>
callDebounced( callDebounced(
async () => { async () => {
const command = historyStore.popUndoableToRedo(); const command = historyStore.popUndoableToRedo();
@ -113,9 +113,9 @@ export function useHistoryHelper(activeRoute: Route) {
event.preventDefault(); event.preventDefault();
if (!isNDVOpen.value) { if (!isNDVOpen.value) {
if (event.shiftKey) { if (event.shiftKey) {
redo(); void redo();
} else { } else {
undo(); void undo();
} }
} else if (!event.shiftKey) { } else if (!event.shiftKey) {
trackUndoAttempt(event); trackUndoAttempt(event);

View file

@ -14,9 +14,9 @@ export function useMessage() {
}; };
if (typeof configOrTitle === 'string') { if (typeof configOrTitle === 'string') {
return await MessageBox.alert(message, configOrTitle, resolvedConfig); return MessageBox.alert(message, configOrTitle, resolvedConfig);
} }
return await MessageBox.alert(message, resolvedConfig); return MessageBox.alert(message, resolvedConfig);
} }
async function confirm( async function confirm(
@ -34,9 +34,9 @@ export function useMessage() {
}; };
if (typeof configOrTitle === 'string') { if (typeof configOrTitle === 'string') {
return await MessageBox.confirm(message, configOrTitle, resolvedConfig); return MessageBox.confirm(message, configOrTitle, resolvedConfig);
} }
return await MessageBox.confirm(message, resolvedConfig); return MessageBox.confirm(message, resolvedConfig);
} }
async function prompt( async function prompt(
@ -51,9 +51,9 @@ export function useMessage() {
}; };
if (typeof configOrTitle === 'string') { if (typeof configOrTitle === 'string') {
return await MessageBox.prompt(message, configOrTitle, resolvedConfig); return MessageBox.prompt(message, configOrTitle, resolvedConfig);
} }
return await MessageBox.prompt(message, resolvedConfig); return MessageBox.prompt(message, resolvedConfig);
} }
return { return {

View file

@ -120,7 +120,7 @@ export function useToast() {
false, false,
); );
externalHooks.run('showMessage.showError', { void externalHooks.run('showMessage.showError', {
title, title,
message, message,
errorMessage: error.message, errorMessage: error.message,

View file

@ -1,6 +1,6 @@
import type { BaseTextKey } from '@/plugins/i18n'; import type { BaseTextKey } from '@/plugins/i18n';
import { useUIStore, useUsageStore } from '@/stores'; import { useUIStore, useUsageStore } from '@/stores';
import { useI18n } from '@/composables'; import { useI18n } from './useI18n';
import { computed } from 'vue'; import { computed } from 'vue';
export function useUpgradeLink(queryParams = { default: '', desktop: '' }) { export function useUpgradeLink(queryParams = { default: '', desktop: '' }) {

View file

@ -42,10 +42,10 @@ new Vue({
}).$mount('#app'); }).$mount('#app');
router.afterEach((to, from) => { router.afterEach((to, from) => {
runExternalHook('main.routeChange', useWebhooksStore(), { from, to }); void runExternalHook('main.routeChange', useWebhooksStore(), { from, to });
const userStore = useUsersStore(); const userStore = useUsersStore();
if (userStore.currentUser && to.name && to.name !== VIEWS.SIGNOUT && !to.name.includes('Modal')) { if (userStore.currentUser && to.name && to.name !== VIEWS.SIGNOUT && !to.name.includes('Modal')) {
userStore.showUserActivationSurveyModal(); void userStore.showUserActivationSurveyModal();
} }
}); });

View file

@ -565,20 +565,20 @@ export const pushConnection = mixins(
this.processWaitingPushMessages(); this.processWaitingPushMessages();
} else if (receivedData.type === 'reloadNodeType') { } else if (receivedData.type === 'reloadNodeType') {
this.nodeTypesStore.getNodeTypes(); await this.nodeTypesStore.getNodeTypes();
this.nodeTypesStore.getFullNodesProperties([receivedData.data]); await this.nodeTypesStore.getFullNodesProperties([receivedData.data]);
} else if (receivedData.type === 'removeNodeType') { } else if (receivedData.type === 'removeNodeType') {
const pushData = receivedData.data; const pushData = receivedData.data;
const nodesToBeRemoved: INodeTypeNameVersion[] = [pushData]; const nodesToBeRemoved: INodeTypeNameVersion[] = [pushData];
// Force reload of all credential types // Force reload of all credential types
this.credentialsStore.fetchCredentialTypes(false).then(() => { await this.credentialsStore.fetchCredentialTypes(false).then(() => {
this.nodeTypesStore.removeNodeTypes(nodesToBeRemoved); this.nodeTypesStore.removeNodeTypes(nodesToBeRemoved);
}); });
} else if (receivedData.type === 'nodeDescriptionUpdated') { } else if (receivedData.type === 'nodeDescriptionUpdated') {
this.nodeTypesStore.getNodeTypes(); await this.nodeTypesStore.getNodeTypes();
this.credentialsStore.fetchCredentialTypes(true); await this.credentialsStore.fetchCredentialTypes(true);
} }
return true; return true;
}, },

View file

@ -129,7 +129,7 @@ export const showMessage = mixins(externalHooks).extend({
false, false,
); );
this.$externalHooks().run('showMessage.showError', { void this.$externalHooks().run('showMessage.showError', {
title, title,
message, message,
errorMessage: error.message, errorMessage: error.message,

View file

@ -115,7 +115,7 @@ export const workflowActivate = mixins(externalHooks, workflowHelpers, showMessa
) { ) {
this.uiStore.openModal(WORKFLOW_ACTIVE_MODAL_KEY); this.uiStore.openModal(WORKFLOW_ACTIVE_MODAL_KEY);
} else { } else {
this.settingsStore.fetchPromptsData(); await this.settingsStore.fetchPromptsData();
} }
} }
}, },

View file

@ -875,7 +875,7 @@ export const workflowHelpers = mixins(externalHooks, nodeHelpers, showMessage).e
} }
if (redirect) { if (redirect) {
this.$router.replace({ void this.$router.replace({
name: VIEWS.WORKFLOW, name: VIEWS.WORKFLOW,
params: { name: workflowData.id as string, action: 'workflowSave' }, params: { name: workflowData.id as string, action: 'workflowSave' },
}); });

View file

@ -115,7 +115,7 @@ export const workflowRun = mixins(externalHooks, workflowHelpers, showMessage).e
this.titleSet(workflow.name as string, 'ERROR'); this.titleSet(workflow.name as string, 'ERROR');
this.$externalHooks().run('workflowRun.runError', { errorMessages, nodeName }); this.$externalHooks().run('workflowRun.runError', { errorMessages, nodeName });
this.getWorkflowDataToSave().then((workflowData) => { await this.getWorkflowDataToSave().then((workflowData) => {
this.$telemetry.track('Workflow execution preflight failed', { this.$telemetry.track('Workflow execution preflight failed', {
workflow_id: workflow.id, workflow_id: workflow.id,
workflow_name: workflow.name, workflow_name: workflow.name,
@ -234,7 +234,7 @@ export const workflowRun = mixins(externalHooks, workflowHelpers, showMessage).e
const runWorkflowApiResponse = await this.runWorkflowApi(startRunData); const runWorkflowApiResponse = await this.runWorkflowApi(startRunData);
this.$externalHooks().run('workflowRun.runWorkflow', { nodeName, source }); await this.$externalHooks().run('workflowRun.runWorkflow', { nodeName, source });
return runWorkflowApiResponse; return runWorkflowApiResponse;
} catch (error) { } catch (error) {

View file

@ -1,4 +1,4 @@
import type { IDataObject, DocMetadata } from 'n8n-workflow'; import type { IDataObject, DocMetadata, NativeDoc } from 'n8n-workflow';
import { ExpressionExtensions, NativeMethods } from 'n8n-workflow'; import { ExpressionExtensions, NativeMethods } from 'n8n-workflow';
import { DateTime } from 'luxon'; import { DateTime } from 'luxon';
import { i18n } from '@/plugins/i18n'; import { i18n } from '@/plugins/i18n';
@ -17,7 +17,6 @@ import {
import type { Completion, CompletionContext, CompletionResult } from '@codemirror/autocomplete'; import type { Completion, CompletionContext, CompletionResult } from '@codemirror/autocomplete';
import type { AutocompleteOptionType, ExtensionTypeName, FnToDoc, Resolved } from './types'; import type { AutocompleteOptionType, ExtensionTypeName, FnToDoc, Resolved } from './types';
import { sanitizeHtml } from '@/utils'; import { sanitizeHtml } from '@/utils';
import type { NativeDoc } from 'n8n-workflow/src/Extensions/Extensions';
import { isFunctionOption } from './typeGuards'; import { isFunctionOption } from './typeGuards';
import { luxonInstanceDocs } from './nativesAutocompleteDocs/luxon.instance.docs'; import { luxonInstanceDocs } from './nativesAutocompleteDocs/luxon.instance.docs';
import { luxonStaticDocs } from './nativesAutocompleteDocs/luxon.static.docs'; import { luxonStaticDocs } from './nativesAutocompleteDocs/luxon.static.docs';

View file

@ -1,4 +1,4 @@
import type { NativeDoc } from 'n8n-workflow/src/Extensions/Extensions'; import type { NativeDoc } from 'n8n-workflow';
// Autocomplete documentation definition for DateTime instance props and methods // Autocomplete documentation definition for DateTime instance props and methods
// Descriptions are added dynamically so they can be localized // Descriptions are added dynamically so they can be localized

View file

@ -1,4 +1,4 @@
import type { NativeDoc } from 'n8n-workflow/src/Extensions/Extensions'; import type { NativeDoc } from 'n8n-workflow';
// Autocomplete documentation definition for DateTime class static props and methods // Autocomplete documentation definition for DateTime class static props and methods
// Descriptions are added dynamically so they can be localized // Descriptions are added dynamically so they can be localized

View file

@ -12,7 +12,8 @@ import {
updateCredential, updateCredential,
} from '@/api/credentials'; } from '@/api/credentials';
import { setCredentialSharedWith } from '@/api/credentials.ee'; import { setCredentialSharedWith } from '@/api/credentials.ee';
import { getAppNameFromCredType, makeRestApiRequest } from '@/utils'; import { makeRestApiRequest } from '@/utils/apiUtils';
import { getAppNameFromCredType } from '@/utils/nodeTypesUtils';
import { EnterpriseEditionFeature, STORES } from '@/constants'; import { EnterpriseEditionFeature, STORES } from '@/constants';
import type { import type {
ICredentialMap, ICredentialMap,
@ -248,7 +249,7 @@ export const useCredentialsStore = defineStore(STORES.CREDENTIALS, {
id: string; id: string;
}): Promise<ICredentialsResponse | ICredentialsDecryptedResponse | undefined> { }): Promise<ICredentialsResponse | ICredentialsDecryptedResponse | undefined> {
const rootStore = useRootStore(); const rootStore = useRootStore();
return await getCredentialData(rootStore.getRestApiContext, id); return getCredentialData(rootStore.getRestApiContext, id);
}, },
async createNewCredential(data: ICredentialsDecrypted): Promise<ICredentialsResponse> { async createNewCredential(data: ICredentialsDecrypted): Promise<ICredentialsResponse> {
const rootStore = useRootStore(); const rootStore = useRootStore();
@ -266,7 +267,7 @@ export const useCredentialsStore = defineStore(STORES.CREDENTIALS, {
const usersStore = useUsersStore(); const usersStore = useUsersStore();
if (data.sharedWith && data.ownedBy.id === usersStore.currentUserId) { if (data.sharedWith && data.ownedBy.id === usersStore.currentUserId) {
this.setCredentialSharedWith({ await this.setCredentialSharedWith({
credentialId: credential.id, credentialId: credential.id,
sharedWith: data.sharedWith, sharedWith: data.sharedWith,
}); });
@ -297,7 +298,7 @@ export const useCredentialsStore = defineStore(STORES.CREDENTIALS, {
const usersStore = useUsersStore(); const usersStore = useUsersStore();
if (data.sharedWith && data.ownedBy.id === usersStore.currentUserId) { if (data.sharedWith && data.ownedBy.id === usersStore.currentUserId) {
this.setCredentialSharedWith({ await this.setCredentialSharedWith({
credentialId: credential.id, credentialId: credential.id,
sharedWith: data.sharedWith, sharedWith: data.sharedWith,
}); });
@ -379,12 +380,9 @@ export const useCredentialsStore = defineStore(STORES.CREDENTIALS, {
async getCredentialTranslation(credentialType: string): Promise<object> { async getCredentialTranslation(credentialType: string): Promise<object> {
const rootStore = useRootStore(); const rootStore = useRootStore();
return await makeRestApiRequest( return makeRestApiRequest(rootStore.getRestApiContext, 'GET', '/credential-translation', {
rootStore.getRestApiContext, credentialType,
'GET', });
'/credential-translation',
{ credentialType },
);
}, },
}, },
}); });

View file

@ -142,7 +142,7 @@ export const useNodeTypesStore = defineStore(STORES.NODE_TYPES, {
}, },
async getFullNodesProperties(nodesToBeFetched: INodeTypeNameVersion[]): Promise<void> { async getFullNodesProperties(nodesToBeFetched: INodeTypeNameVersion[]): Promise<void> {
const credentialsStore = useCredentialsStore(); const credentialsStore = useCredentialsStore();
credentialsStore.fetchCredentialTypes(true); await credentialsStore.fetchCredentialTypes(true);
await this.getNodesInformation(nodesToBeFetched); await this.getNodesInformation(nodesToBeFetched);
}, },
async getNodeTypes(): Promise<void> { async getNodeTypes(): Promise<void> {

View file

@ -303,23 +303,23 @@ export const useSettingsStore = defineStore(STORES.SETTINGS, {
}, },
async getLdapConfig() { async getLdapConfig() {
const rootStore = useRootStore(); const rootStore = useRootStore();
return await getLdapConfig(rootStore.getRestApiContext); return getLdapConfig(rootStore.getRestApiContext);
}, },
async getLdapSynchronizations(pagination: { page: number }) { async getLdapSynchronizations(pagination: { page: number }) {
const rootStore = useRootStore(); const rootStore = useRootStore();
return await getLdapSynchronizations(rootStore.getRestApiContext, pagination); return getLdapSynchronizations(rootStore.getRestApiContext, pagination);
}, },
async testLdapConnection() { async testLdapConnection() {
const rootStore = useRootStore(); const rootStore = useRootStore();
return await testLdapConnection(rootStore.getRestApiContext); return testLdapConnection(rootStore.getRestApiContext);
}, },
async updateLdapConfig(ldapConfig: ILdapConfig) { async updateLdapConfig(ldapConfig: ILdapConfig) {
const rootStore = useRootStore(); const rootStore = useRootStore();
return await updateLdapConfig(rootStore.getRestApiContext, ldapConfig); return updateLdapConfig(rootStore.getRestApiContext, ldapConfig);
}, },
async runLdapSync(data: IDataObject) { async runLdapSync(data: IDataObject) {
const rootStore = useRootStore(); const rootStore = useRootStore();
return await runLdapSync(rootStore.getRestApiContext, data); return runLdapSync(rootStore.getRestApiContext, data);
}, },
setSaveDataErrorExecution(newValue: string) { setSaveDataErrorExecution(newValue: string) {
Vue.set(this, 'saveDataErrorExecution', newValue); Vue.set(this, 'saveDataErrorExecution', newValue);

View file

@ -36,7 +36,7 @@ export const useSSOStore = defineStore('sso', () => {
}, },
}, },
}); });
toggleLoginEnabled(value); void toggleLoginEnabled(value);
}, },
}); });
const isEnterpriseSamlEnabled = computed(() => const isEnterpriseSamlEnabled = computed(() =>
@ -50,16 +50,16 @@ export const useSSOStore = defineStore('sso', () => {
isDefaultAuthenticationSaml.value, 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 }); ssoApi.toggleSamlConfig(rootStore.getRestApiContext, { loginEnabled: enabled });
const getSamlMetadata = () => ssoApi.getSamlMetadata(rootStore.getRestApiContext); const getSamlMetadata = async () => ssoApi.getSamlMetadata(rootStore.getRestApiContext);
const getSamlConfig = () => ssoApi.getSamlConfig(rootStore.getRestApiContext); const getSamlConfig = async () => ssoApi.getSamlConfig(rootStore.getRestApiContext);
const saveSamlConfig = (config: SamlPreferences) => const saveSamlConfig = async (config: SamlPreferences) =>
ssoApi.saveSamlConfig(rootStore.getRestApiContext, config); 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 }) => const updateUser = async (params: { firstName: string; lastName: string }) =>
updateCurrentUser(rootStore.getRestApiContext, { updateCurrentUser(rootStore.getRestApiContext, {

View file

@ -304,7 +304,7 @@ export const useTemplatesStore = defineStore(STORES.TEMPLATES, {
const settingsStore = useSettingsStore(); const settingsStore = useSettingsStore();
const apiEndpoint: string = settingsStore.templatesHost; const apiEndpoint: string = settingsStore.templatesHost;
const versionCli: string = settingsStore.versionCli; const versionCli: string = settingsStore.versionCli;
return await getWorkflowTemplate(apiEndpoint, templateId, { 'n8n-version': versionCli }); return getWorkflowTemplate(apiEndpoint, templateId, { 'n8n-version': versionCli });
}, },
}, },
}); });

View file

@ -410,21 +410,21 @@ export const useUIStore = defineStore(STORES.UI, {
const instanceId = rootStore.instanceId; const instanceId = rootStore.instanceId;
// TODO: current USER // TODO: current USER
const currentUser = {} as IUser; const currentUser = {} as IUser;
return await fetchNextOnboardingPrompt(instanceId, currentUser); return fetchNextOnboardingPrompt(instanceId, currentUser);
}, },
async applyForOnboardingCall(email: string): Promise<string> { async applyForOnboardingCall(email: string): Promise<string> {
const rootStore = useRootStore(); const rootStore = useRootStore();
const instanceId = rootStore.instanceId; const instanceId = rootStore.instanceId;
// TODO: current USER // TODO: current USER
const currentUser = {} as IUser; const currentUser = {} as IUser;
return await applyForOnboardingCall(instanceId, currentUser, email); return applyForOnboardingCall(instanceId, currentUser, email);
}, },
async submitContactEmail(email: string, agree: boolean): Promise<string> { async submitContactEmail(email: string, agree: boolean): Promise<string> {
const rootStore = useRootStore(); const rootStore = useRootStore();
const instanceId = rootStore.instanceId; const instanceId = rootStore.instanceId;
// TODO: current USER // TODO: current USER
const currentUser = {} as IUser; const currentUser = {} as IUser;
return await submitEmailOnSignup(instanceId, currentUser, email || currentUser.email, agree); return submitEmailOnSignup(instanceId, currentUser, email || currentUser.email, agree);
}, },
openCommunityPackageUninstallConfirmModal(packageName: string) { openCommunityPackageUninstallConfirmModal(packageName: string) {
this.setActiveId(COMMUNITY_PACKAGE_CONFIRM_MODAL_KEY, packageName); this.setActiveId(COMMUNITY_PACKAGE_CONFIRM_MODAL_KEY, packageName);
@ -477,7 +477,7 @@ export const useUIStore = defineStore(STORES.UI, {
}, },
async getCurlToJson(curlCommand: string): Promise<CurlToJSONResponse> { async getCurlToJson(curlCommand: string): Promise<CurlToJSONResponse> {
const rootStore = useRootStore(); const rootStore = useRootStore();
return await getCurlToJson(rootStore.getRestApiContext, curlCommand); return getCurlToJson(rootStore.getRestApiContext, curlCommand);
}, },
goToUpgrade(source: string, utm_campaign: string): void { goToUpgrade(source: string, utm_campaign: string): void {
window.open(this.upgradeLinkUrl(source, utm_campaign), '_blank'); window.open(this.upgradeLinkUrl(source, utm_campaign), '_blank');

View file

@ -80,7 +80,7 @@ export const useUsageStore = defineStore('usage', () => {
const data = await renewLicense(rootStore.getRestApiContext); const data = await renewLicense(rootStore.getRestApiContext);
setData(data); setData(data);
} catch (error) { } catch (error) {
getLicenseInfo(); await getLicenseInfo();
} }
}; };

View file

@ -196,7 +196,7 @@ export const useUsersStore = defineStore(STORES.USERS, {
inviterId: string; inviterId: string;
}): Promise<{ inviter: { firstName: string; lastName: string } }> { }): Promise<{ inviter: { firstName: string; lastName: string } }> {
const rootStore = useRootStore(); const rootStore = useRootStore();
return await validateSignupToken(rootStore.getRestApiContext, params); return validateSignupToken(rootStore.getRestApiContext, params);
}, },
async signup(params: { async signup(params: {
inviteeId: string; inviteeId: string;
@ -286,7 +286,7 @@ export const useUsersStore = defineStore(STORES.USERS, {
}, },
async getUserInviteLink(params: { id: string }): Promise<{ link: string }> { async getUserInviteLink(params: { id: string }): Promise<{ link: string }> {
const rootStore = useRootStore(); const rootStore = useRootStore();
return await getInviteLink(rootStore.getRestApiContext, params); return getInviteLink(rootStore.getRestApiContext, params);
}, },
async submitPersonalizationSurvey(results: IPersonalizationLatestVersion): Promise<void> { async submitPersonalizationSurvey(results: IPersonalizationLatestVersion): Promise<void> {
const rootStore = useRootStore(); const rootStore = useRootStore();

View file

@ -362,7 +362,7 @@ export const useWorkflowsStore = defineStore(STORES.WORKFLOWS, {
// Returns a workflow from a given URL // Returns a workflow from a given URL
async getWorkflowFromUrl(url: string): Promise<IWorkflowDb> { async getWorkflowFromUrl(url: string): Promise<IWorkflowDb> {
const rootStore = useRootStore(); const rootStore = useRootStore();
return await makeRestApiRequest(rootStore.getRestApiContext, 'GET', '/workflows/from-url', { return makeRestApiRequest(rootStore.getRestApiContext, 'GET', '/workflows/from-url', {
url, url,
}); });
}, },
@ -1062,7 +1062,7 @@ export const useWorkflowsStore = defineStore(STORES.WORKFLOWS, {
}; };
} }
const rootStore = useRootStore(); const rootStore = useRootStore();
return await makeRestApiRequest( return makeRestApiRequest(
rootStore.getRestApiContext, rootStore.getRestApiContext,
'POST', 'POST',
`/executions/${id}/retry`, `/executions/${id}/retry`,
@ -1073,7 +1073,7 @@ export const useWorkflowsStore = defineStore(STORES.WORKFLOWS, {
// Deletes executions // Deletes executions
async deleteExecutions(sendData: IExecutionDeleteFilter): Promise<void> { async deleteExecutions(sendData: IExecutionDeleteFilter): Promise<void> {
const rootStore = useRootStore(); const rootStore = useRootStore();
return await makeRestApiRequest( return makeRestApiRequest(
rootStore.getRestApiContext, rootStore.getRestApiContext,
'POST', 'POST',
'/executions/delete', '/executions/delete',
@ -1109,7 +1109,7 @@ export const useWorkflowsStore = defineStore(STORES.WORKFLOWS, {
}; };
} }
const rootStore = useRootStore(); const rootStore = useRootStore();
return await makeRestApiRequest( return makeRestApiRequest(
rootStore.getRestApiContext, rootStore.getRestApiContext,
'GET', 'GET',
'/executions-current', '/executions-current',
@ -1155,7 +1155,7 @@ export const useWorkflowsStore = defineStore(STORES.WORKFLOWS, {
async runWorkflow(startRunData: IStartRunData): Promise<IExecutionPushResponse> { async runWorkflow(startRunData: IStartRunData): Promise<IExecutionPushResponse> {
const rootStore = useRootStore(); const rootStore = useRootStore();
return await makeRestApiRequest( return makeRestApiRequest(
rootStore.getRestApiContext, rootStore.getRestApiContext,
'POST', 'POST',
'/workflows/run', '/workflows/run',
@ -1165,7 +1165,7 @@ export const useWorkflowsStore = defineStore(STORES.WORKFLOWS, {
async removeTestWebhook(workflowId: string): Promise<boolean> { async removeTestWebhook(workflowId: string): Promise<boolean> {
const rootStore = useRootStore(); const rootStore = useRootStore();
return await makeRestApiRequest( return makeRestApiRequest(
rootStore.getRestApiContext, rootStore.getRestApiContext,
'DELETE', 'DELETE',
`/test-webhook/${workflowId}`, `/test-webhook/${workflowId}`,
@ -1174,7 +1174,7 @@ export const useWorkflowsStore = defineStore(STORES.WORKFLOWS, {
async stopCurrentExecution(executionId: string): Promise<IExecutionsStopData> { async stopCurrentExecution(executionId: string): Promise<IExecutionsStopData> {
const rootStore = useRootStore(); const rootStore = useRootStore();
return await makeRestApiRequest( return makeRestApiRequest(
rootStore.getRestApiContext, rootStore.getRestApiContext,
'POST', 'POST',
`/executions-current/${executionId}/stop`, `/executions-current/${executionId}/stop`,
@ -1206,7 +1206,7 @@ export const useWorkflowsStore = defineStore(STORES.WORKFLOWS, {
async fetchExecutionDataById(executionId: string): Promise<IExecutionResponse | null> { async fetchExecutionDataById(executionId: string): Promise<IExecutionResponse | null> {
const rootStore = useRootStore(); const rootStore = useRootStore();
return await getExecutionData(rootStore.getRestApiContext, executionId); return getExecutionData(rootStore.getRestApiContext, executionId);
}, },
deleteExecution(execution: IExecutionsSummary): void { deleteExecution(execution: IExecutionsSummary): void {

View file

@ -123,7 +123,7 @@ export async function get(
params?: IDataObject, params?: IDataObject,
headers?: IDataObject, headers?: IDataObject,
) { ) {
return await request({ method: 'GET', baseURL, endpoint, headers, data: params }); return request({ method: 'GET', baseURL, endpoint, headers, data: params });
} }
export async function post( export async function post(
@ -132,7 +132,7 @@ export async function post(
params?: IDataObject, params?: IDataObject,
headers?: IDataObject, headers?: IDataObject,
) { ) {
return await request({ method: 'POST', baseURL, endpoint, headers, data: params }); return request({ method: 'POST', baseURL, endpoint, headers, data: params });
} }
/** /**

View file

@ -1,7 +1,7 @@
import { MAIN_AUTH_FIELD_NAME } from './../constants'; import type { INodeCredentialDescription } from 'n8n-workflow';
import { MAIN_AUTH_FIELD_NAME } from '@/constants';
import { useWorkflowsStore } from '@/stores/workflows.store'; import { useWorkflowsStore } from '@/stores/workflows.store';
import { useNodeTypesStore } from '../stores/nodeTypes.store'; import { useNodeTypesStore } from '@/stores/nodeTypes.store';
import type { INodeCredentialDescription } from './../../../workflow/src/Interfaces';
import { import {
CORE_NODES_CATEGORY, CORE_NODES_CATEGORY,
NON_ACTIVATABLE_TRIGGER_NODE_TYPES, NON_ACTIVATABLE_TRIGGER_NODE_TYPES,

View file

@ -122,7 +122,7 @@ export default mixins(showMessage, debounceHelper).extend({
await Promise.all(loadPromises); 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( onFilter(
resource: ICredentialsResponse, resource: ICredentialsResponse,

View file

@ -39,7 +39,7 @@ export default defineComponent({
}, },
methods: { methods: {
onButtonClick() { onButtonClick() {
this.$router.push({ name: this.redirectPage }); void this.$router.push({ name: this.redirectPage });
}, },
}, },
}); });

View file

@ -313,9 +313,9 @@ interface AddNodeOptions {
dragAndDrop?: boolean; dragAndDrop?: boolean;
} }
const NodeCreator = () => import('@/components/Node/NodeCreator/NodeCreator.vue'); const NodeCreator = async () => import('@/components/Node/NodeCreator/NodeCreator.vue');
const NodeCreation = () => import('@/components/Node/NodeCreation.vue'); const NodeCreation = async () => import('@/components/Node/NodeCreation.vue');
const CanvasControls = () => import('@/components/CanvasControls.vue'); const CanvasControls = async () => import('@/components/CanvasControls.vue');
export default mixins( export default mixins(
copyPaste, copyPaste,
@ -373,8 +373,8 @@ export default mixins(
this.resetWorkspace(); this.resetWorkspace();
this.uiStore.stateIsDirty = previousDirtyState; this.uiStore.stateIsDirty = previousDirtyState;
} }
this.loadCredentials(); void this.loadCredentials();
this.initView().then(() => { void this.initView().then(() => {
this.stopLoading(); this.stopLoading();
if (this.blankRedirect) { if (this.blankRedirect) {
this.blankRedirect = false; this.blankRedirect = false;
@ -440,7 +440,7 @@ export default mixins(
() => { () => {
// We can't use next() here since vue-router // We can't use next() here since vue-router
// would prevent the navigation with an error // would prevent the navigation with an error
this.$router.push(to as RawLocation); void this.$router.push(to as RawLocation);
}, },
); );
} else { } else {
@ -820,14 +820,14 @@ export default mixins(
} }
} catch (error) { } catch (error) {
this.$showError(error, this.$locale.baseText('nodeView.couldntImportWorkflow')); this.$showError(error, this.$locale.baseText('nodeView.couldntImportWorkflow'));
this.$router.replace({ name: VIEWS.NEW_WORKFLOW }); void this.$router.replace({ name: VIEWS.NEW_WORKFLOW });
return; return;
} }
data.workflow.nodes = NodeViewUtils.getFixedNodesList(data.workflow.nodes) as INodeUi[]; data.workflow.nodes = NodeViewUtils.getFixedNodesList(data.workflow.nodes) as INodeUi[];
this.blankRedirect = true; this.blankRedirect = true;
this.$router.replace({ name: VIEWS.NEW_WORKFLOW, query: { templateId } }); void this.$router.replace({ name: VIEWS.NEW_WORKFLOW, query: { templateId } });
await this.addNodes(data.workflow.nodes, data.workflow.connections); await this.addNodes(data.workflow.nodes, data.workflow.connections);
this.workflowData = (await this.workflowsStore.getNewWorkflowData(data.name)) || {}; this.workflowData = (await this.workflowsStore.getNewWorkflowData(data.name)) || {};
@ -1027,7 +1027,7 @@ export default mixins(
if (this.$router.currentRoute.name === VIEWS.NEW_WORKFLOW) { if (this.$router.currentRoute.name === VIEWS.NEW_WORKFLOW) {
this.$root.$emit('newWorkflow'); this.$root.$emit('newWorkflow');
} else { } else {
this.$router.push({ name: VIEWS.NEW_WORKFLOW }); void this.$router.push({ name: VIEWS.NEW_WORKFLOW });
} }
this.$showMessage({ this.$showMessage({
@ -1287,7 +1287,7 @@ export default mixins(
}, },
copySelectedNodes(isCut: boolean) { copySelectedNodes(isCut: boolean) {
this.getSelectedNodesToSave().then((data) => { void this.getSelectedNodesToSave().then((data) => {
const workflowToCopy: IWorkflowToShare = { const workflowToCopy: IWorkflowToShare = {
meta: { meta: {
instanceId: this.rootStore.instanceId, instanceId: this.rootStore.instanceId,
@ -2465,7 +2465,7 @@ export default mixins(
this.uiStore.stateIsDirty = false; this.uiStore.stateIsDirty = false;
this.canvasStore.setZoomLevel(1, [0, 0]); this.canvasStore.setZoomLevel(1, [0, 0]);
this.tryToAddWelcomeSticky(); await this.tryToAddWelcomeSticky();
this.uiStore.nodeViewInitialized = true; this.uiStore.nodeViewInitialized = true;
this.historyStore.reset(); this.historyStore.reset();
this.workflowsStore.activeWorkflowExecution = null; this.workflowsStore.activeWorkflowExecution = null;
@ -2517,7 +2517,7 @@ export default mixins(
} catch (error) { } catch (error) {
this.$showError(error, this.$locale.baseText('openWorkflow.workflowNotFoundError')); this.$showError(error, this.$locale.baseText('openWorkflow.workflowNotFoundError'));
this.$router.push({ void this.$router.push({
name: VIEWS.NEW_WORKFLOW, name: VIEWS.NEW_WORKFLOW,
}); });
} }
@ -2994,7 +2994,7 @@ export default mixins(
if (parameterData.name === 'name' && parameterData.oldValue) { if (parameterData.name === 'name' && parameterData.oldValue) {
// The name changed so we have to take care that // The name changed so we have to take care that
// the connections get changed. // 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) { async renameNodePrompt(currentName: string) {
@ -3025,7 +3025,7 @@ export default mixins(
const promptResponse = (await promptResponsePromise) as MessageBoxInputData; const promptResponse = (await promptResponsePromise) as MessageBoxInputData;
this.renameNode(currentName, promptResponse.value, true); await this.renameNode(currentName, promptResponse.value, true);
} catch (e) {} } catch (e) {}
}, },
async renameNode(currentName: string, newName: string, trackHistory = false) { async renameNode(currentName: string, newName: string, trackHistory = false) {
@ -3675,7 +3675,7 @@ export default mixins(
nodeTypes.forEach(({ nodeTypeName, position }, index) => { nodeTypes.forEach(({ nodeTypeName, position }, index) => {
const isManualTrigger = nodeTypeName === MANUAL_TRIGGER_NODE_TYPE; const isManualTrigger = nodeTypeName === MANUAL_TRIGGER_NODE_TYPE;
const openNDV = !isManualTrigger && (nodeTypes.length === 1 || index > 0); const openNDV = !isManualTrigger && (nodeTypes.length === 1 || index > 0);
this.addNode( void this.addNode(
nodeTypeName, nodeTypeName,
{ position, dragAndDrop }, { position, dragAndDrop },
openNDV, openNDV,
@ -3770,8 +3770,8 @@ export default mixins(
this.loadActiveWorkflows(), this.loadActiveWorkflows(),
this.loadCredentials(), this.loadCredentials(),
this.loadCredentialTypes(), this.loadCredentialTypes(),
this.loadVariables(),
]; ];
this.loadVariables();
if (this.nodeTypesStore.allNodeTypes.length === 0) { if (this.nodeTypesStore.allNodeTypes.length === 0) {
loadPromises.push(this.loadNodeTypes()); loadPromises.push(this.loadNodeTypes());
@ -3809,7 +3809,7 @@ export default mixins(
this.stopLoading(); this.stopLoading();
setTimeout(() => { setTimeout(() => {
this.usersStore.showPersonalizationSurvey(); void this.usersStore.showPersonalizationSurvey();
this.addPinDataConnections(this.workflowsStore.getPinData || ({} as IPinData)); this.addPinDataConnections(this.workflowsStore.getPinData || ({} as IPinData));
}, 0); }, 0);
}); });

View file

@ -101,7 +101,7 @@ export default mixins(showMessage).extend({
}; };
}, },
mounted() { mounted() {
this.getApiKey(); void this.getApiKey();
const baseUrl = this.rootStore.baseUrl; const baseUrl = this.rootStore.baseUrl;
const apiPath = this.settingsStore.publicApiPath; const apiPath = this.settingsStore.publicApiPath;
const latestVersion = this.settingsStore.publicApiLatestVersion; const latestVersion = this.settingsStore.publicApiLatestVersion;
@ -126,7 +126,7 @@ export default mixins(showMessage).extend({
this.$locale.baseText('generic.cancel'), this.$locale.baseText('generic.cancel'),
); );
if (confirmed) { if (confirmed) {
this.deleteApiKey(); await this.deleteApiKey();
} }
}, },
async getApiKey() { async getApiKey() {

Some files were not shown because too many files have changed in this diff Show more