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

View file

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

View file

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

View file

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

View file

@ -1,14 +1,14 @@
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');
}
export function createApiKey(context: IRestApiContext): Promise<{ apiKey: string | null }> {
export async function createApiKey(context: IRestApiContext): Promise<{ apiKey: string | null }> {
return makeRestApiRequest(context, 'POST', '/me/api-key');
}
export function deleteApiKey(context: IRestApiContext): Promise<{ success: boolean }> {
export async function deleteApiKey(context: IRestApiContext): Promise<{ success: boolean }> {
return makeRestApiRequest(context, 'DELETE', '/me/api-key');
}

View file

@ -13,16 +13,16 @@ export async function installNewPackage(
context: IRestApiContext,
name: string,
): 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> {
return await makeRestApiRequest(context, 'DELETE', '/nodes', { name });
return makeRestApiRequest(context, 'DELETE', '/nodes', { name });
}
export async function updatePackage(
context: IRestApiContext,
name: string,
): 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 { makeRestApiRequest } from '@/utils';
import { makeRestApiRequest } from '@/utils/apiUtils';
import type { IDataObject } from 'n8n-workflow';
export async function setCredentialSharedWith(

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -2,11 +2,11 @@ import type { IRestApiContext, ITag } from '@/Interface';
import { makeRestApiRequest } from '@/utils';
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> {
return await makeRestApiRequest(context, 'POST', '/tags', params);
return makeRestApiRequest(context, 'POST', '/tags', params);
}
export async function updateTag(
@ -14,9 +14,9 @@ export async function updateTag(
id: string,
params: { name: string },
): Promise<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> {
return await makeRestApiRequest(context, 'DELETE', `/tags/${id}`);
return makeRestApiRequest(context, 'DELETE', `/tags/${id}`);
}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -122,7 +122,7 @@ export default mixins(externalHooks, genericHelpers, debounceHelper).extend({
this.updateDisplayValue();
this.$emit('valueChanged', this.latestValue);
} 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.$externalHooks().run('expressionEdit.closeDialog', telemetryPayload);
void this.$externalHooks().run('expressionEdit.closeDialog', telemetryPayload);
}
},
},

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -314,7 +314,7 @@ export default mixins(debounceHelper).extend({
},
onResizeDebounced(data: { direction: string; x: number; width: number }) {
if (this.initialized) {
this.callDebounced('onResize', { debounceTime: 10, trailing: true }, data);
void this.callDebounced('onResize', { debounceTime: 10, trailing: true }, data);
}
},
onResize({ direction, x, width }: { direction: string; x: number; width: number }) {

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -180,7 +180,7 @@ export default mixins(workflowRun, pinData).extend({
async onClick() {
if (this.isListeningForEvents) {
this.stopWaitingForWebhook();
await this.stopWaitingForWebhook();
} else if (this.isListeningForWorkflowEvents) {
this.$emit('stopExecution');
} else {
@ -207,9 +207,9 @@ export default mixins(workflowRun, pinData).extend({
source: this.telemetrySource,
};
this.$telemetry.track('User clicked execute node button', telemetryPayload);
this.$externalHooks().run('nodeExecuteButton.onClick', telemetryPayload);
await this.$externalHooks().run('nodeExecuteButton.onClick', telemetryPayload);
this.runWorkflow(this.nodeName, 'RunData.ExecuteNodeButton');
await this.runWorkflow(this.nodeName, 'RunData.ExecuteNodeButton');
this.$emit('execute');
}
}

View file

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

View file

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

View file

@ -128,7 +128,7 @@ import ImportParameter from '@/components/ImportParameter.vue';
import { get, set } from 'lodash-es';
import mixins from 'vue-typed-mixins';
import type { Component, PropType } from 'vue';
import type { PropType } from 'vue';
import { mapStores } from 'pinia';
import { useNDVStore } from '@/stores/ndv.store';
import { useNodeTypesStore } from '@/stores/nodeTypes.store';
@ -140,8 +140,8 @@ export default mixins(workflowHelpers).extend({
components: {
MultipleParameter,
ParameterInputFull,
FixedCollectionParameter: () => import('./FixedCollectionParameter.vue') as Promise<Component>,
CollectionParameter: () => import('./CollectionParameter.vue') as Promise<Component>,
FixedCollectionParameter: async () => import('./FixedCollectionParameter.vue'),
CollectionParameter: async () => import('./CollectionParameter.vue'),
ImportParameter,
},
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
// we try again after closing the modal
if (this.$route.name !== VIEWS.NEW_WORKFLOW) {
this.$router.replace({ name: VIEWS.NEW_WORKFLOW });
void this.$router.replace({ name: VIEWS.NEW_WORKFLOW });
}
},
onSave() {
@ -627,7 +627,7 @@ export default mixins(showMessage, workflowHelpers).extend({
personalization_survey_n8n_version: this.rootStore.versionCli,
};
this.$externalHooks().run('personalizationModal.onSubmit', survey);
await this.$externalHooks().run('personalizationModal.onSubmit', survey);
await this.usersStore.submitPersonalizationSurvey(survey as IPersonalizationLatestVersion);

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -6,7 +6,7 @@ import { runExternalHook } from '@/utils';
export function useExternalHooks(): IExternalHooks {
return {
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 undo = () =>
const undo = async () =>
callDebounced(
async () => {
const command = historyStore.popUndoableToUndo();
@ -56,7 +56,7 @@ export function useHistoryHelper(activeRoute: Route) {
{ debounceTime: UNDO_REDO_DEBOUNCE_INTERVAL },
);
const redo = () =>
const redo = async () =>
callDebounced(
async () => {
const command = historyStore.popUndoableToRedo();
@ -113,9 +113,9 @@ export function useHistoryHelper(activeRoute: Route) {
event.preventDefault();
if (!isNDVOpen.value) {
if (event.shiftKey) {
redo();
void redo();
} else {
undo();
void undo();
}
} else if (!event.shiftKey) {
trackUndoAttempt(event);

View file

@ -14,9 +14,9 @@ export function useMessage() {
};
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(
@ -34,9 +34,9 @@ export function useMessage() {
};
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(
@ -51,9 +51,9 @@ export function useMessage() {
};
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 {

View file

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

View file

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

View file

@ -42,10 +42,10 @@ new Vue({
}).$mount('#app');
router.afterEach((to, from) => {
runExternalHook('main.routeChange', useWebhooksStore(), { from, to });
void runExternalHook('main.routeChange', useWebhooksStore(), { from, to });
const userStore = useUsersStore();
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();
} else if (receivedData.type === 'reloadNodeType') {
this.nodeTypesStore.getNodeTypes();
this.nodeTypesStore.getFullNodesProperties([receivedData.data]);
await this.nodeTypesStore.getNodeTypes();
await this.nodeTypesStore.getFullNodesProperties([receivedData.data]);
} else if (receivedData.type === 'removeNodeType') {
const pushData = receivedData.data;
const nodesToBeRemoved: INodeTypeNameVersion[] = [pushData];
// Force reload of all credential types
this.credentialsStore.fetchCredentialTypes(false).then(() => {
await this.credentialsStore.fetchCredentialTypes(false).then(() => {
this.nodeTypesStore.removeNodeTypes(nodesToBeRemoved);
});
} else if (receivedData.type === 'nodeDescriptionUpdated') {
this.nodeTypesStore.getNodeTypes();
this.credentialsStore.fetchCredentialTypes(true);
await this.nodeTypesStore.getNodeTypes();
await this.credentialsStore.fetchCredentialTypes(true);
}
return true;
},

View file

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

View file

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

View file

@ -875,7 +875,7 @@ export const workflowHelpers = mixins(externalHooks, nodeHelpers, showMessage).e
}
if (redirect) {
this.$router.replace({
void this.$router.replace({
name: VIEWS.WORKFLOW,
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.$externalHooks().run('workflowRun.runError', { errorMessages, nodeName });
this.getWorkflowDataToSave().then((workflowData) => {
await this.getWorkflowDataToSave().then((workflowData) => {
this.$telemetry.track('Workflow execution preflight failed', {
workflow_id: workflow.id,
workflow_name: workflow.name,
@ -234,7 +234,7 @@ export const workflowRun = mixins(externalHooks, workflowHelpers, showMessage).e
const runWorkflowApiResponse = await this.runWorkflowApi(startRunData);
this.$externalHooks().run('workflowRun.runWorkflow', { nodeName, source });
await this.$externalHooks().run('workflowRun.runWorkflow', { nodeName, source });
return runWorkflowApiResponse;
} catch (error) {

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 { DateTime } from 'luxon';
import { i18n } from '@/plugins/i18n';
@ -17,7 +17,6 @@ import {
import type { Completion, CompletionContext, CompletionResult } from '@codemirror/autocomplete';
import type { AutocompleteOptionType, ExtensionTypeName, FnToDoc, Resolved } from './types';
import { sanitizeHtml } from '@/utils';
import type { NativeDoc } from 'n8n-workflow/src/Extensions/Extensions';
import { isFunctionOption } from './typeGuards';
import { luxonInstanceDocs } from './nativesAutocompleteDocs/luxon.instance.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
// 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
// Descriptions are added dynamically so they can be localized

View file

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

View file

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

View file

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

View file

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

View file

@ -304,7 +304,7 @@ export const useTemplatesStore = defineStore(STORES.TEMPLATES, {
const settingsStore = useSettingsStore();
const apiEndpoint: string = settingsStore.templatesHost;
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;
// TODO: current USER
const currentUser = {} as IUser;
return await fetchNextOnboardingPrompt(instanceId, currentUser);
return fetchNextOnboardingPrompt(instanceId, currentUser);
},
async applyForOnboardingCall(email: string): Promise<string> {
const rootStore = useRootStore();
const instanceId = rootStore.instanceId;
// TODO: current USER
const currentUser = {} as IUser;
return await applyForOnboardingCall(instanceId, currentUser, email);
return applyForOnboardingCall(instanceId, currentUser, email);
},
async submitContactEmail(email: string, agree: boolean): Promise<string> {
const rootStore = useRootStore();
const instanceId = rootStore.instanceId;
// TODO: current USER
const currentUser = {} as IUser;
return await submitEmailOnSignup(instanceId, currentUser, email || currentUser.email, agree);
return submitEmailOnSignup(instanceId, currentUser, email || currentUser.email, agree);
},
openCommunityPackageUninstallConfirmModal(packageName: string) {
this.setActiveId(COMMUNITY_PACKAGE_CONFIRM_MODAL_KEY, packageName);
@ -477,7 +477,7 @@ export const useUIStore = defineStore(STORES.UI, {
},
async getCurlToJson(curlCommand: string): Promise<CurlToJSONResponse> {
const rootStore = useRootStore();
return await getCurlToJson(rootStore.getRestApiContext, curlCommand);
return getCurlToJson(rootStore.getRestApiContext, curlCommand);
},
goToUpgrade(source: string, utm_campaign: string): void {
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);
setData(data);
} catch (error) {
getLicenseInfo();
await getLicenseInfo();
}
};

View file

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

View file

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

View file

@ -123,7 +123,7 @@ export async function get(
params?: 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(
@ -132,7 +132,7 @@ export async function post(
params?: 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 { useNodeTypesStore } from '../stores/nodeTypes.store';
import type { INodeCredentialDescription } from './../../../workflow/src/Interfaces';
import { useNodeTypesStore } from '@/stores/nodeTypes.store';
import {
CORE_NODES_CATEGORY,
NON_ACTIVATABLE_TRIGGER_NODE_TYPES,

View file

@ -122,7 +122,7 @@ export default mixins(showMessage, debounceHelper).extend({
await Promise.all(loadPromises);
this.usersStore.fetchUsers(); // Can be loaded in the background, used for filtering
await this.usersStore.fetchUsers(); // Can be loaded in the background, used for filtering
},
onFilter(
resource: ICredentialsResponse,

View file

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

View file

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

View file

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

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