refactor: Lint for no unneeded backticks (#5057) (no-changelog)

*  Create rule `no-unneeded-backticks`

* 👕 Enable rule

*  Run rule on `cli`

*  Run rule on `core`

*  Run rule on `workflow`

*  Rule rule on `design-system`

*  Run rule on `node-dev`

*  Run rule on `editor-ui`

*  Run rule on `nodes-base`
This commit is contained in:
Iván Ovejero 2022-12-29 12:20:43 +01:00 committed by GitHub
parent a7868ae77d
commit d9b98fc8be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
239 changed files with 772 additions and 714 deletions

View file

@ -339,6 +339,8 @@ const config = (module.exports = {
'n8n-local-rules/no-json-parse-json-stringify': 'error', 'n8n-local-rules/no-json-parse-json-stringify': 'error',
'n8n-local-rules/no-unneeded-backticks': 'error',
// ****************************************************************** // ******************************************************************
// overrides to base ruleset // overrides to base ruleset
// ****************************************************************** // ******************************************************************

View file

@ -106,6 +106,39 @@ module.exports = {
}; };
}, },
}, },
'no-unneeded-backticks': {
meta: {
type: 'problem',
docs: {
description:
'Template literal backticks may only be used for string interpolation or multiline strings.',
recommended: 'error',
},
messages: {
noUneededBackticks: 'Use single or double quotes, not backticks',
},
fixable: 'code',
},
create(context) {
return {
TemplateLiteral(node) {
if (node.expressions.length > 0) return;
if (node.quasis.every((q) => q.loc.start.line !== q.loc.end.line)) return;
node.quasis.forEach((q) => {
const escaped = q.value.raw.replace(/(?<!\\)'/g, "\\'");
context.report({
messageId: 'noUneededBackticks',
node,
fix: (fixer) => fixer.replaceText(q, `'${escaped}'`),
});
});
},
};
},
},
}; };
const isJsonParseCall = (node) => const isJsonParseCall = (node) =>

View file

@ -62,7 +62,8 @@ import { WorkflowRunner } from '@/WorkflowRunner';
import { ExternalHooks } from '@/ExternalHooks'; import { ExternalHooks } from '@/ExternalHooks';
import { whereClause } from './UserManagement/UserManagementHelper'; import { whereClause } from './UserManagement/UserManagementHelper';
const WEBHOOK_PROD_UNREGISTERED_HINT = `The workflow must be active for a production URL to run successfully. You can activate the workflow using the toggle in the top-right of the editor. Note that unlike test URL calls, production URL calls aren't shown on the canvas (only in the executions list)`; const WEBHOOK_PROD_UNREGISTERED_HINT =
"The workflow must be active for a production URL to run successfully. You can activate the workflow using the toggle in the top-right of the editor. Note that unlike test URL calls, production URL calls aren't shown on the canvas (only in the executions list)";
export class ActiveWorkflowRunner { export class ActiveWorkflowRunner {
private activeWorkflows: ActiveWorkflows | null = null; private activeWorkflows: ActiveWorkflows | null = null;
@ -118,11 +119,11 @@ export class ActiveWorkflowRunner {
workflowName: workflowData.name, workflowName: workflowData.name,
workflowId: workflowData.id, workflowId: workflowData.id,
}); });
console.log(` => Started`); console.log(' => Started');
} catch (error) { } catch (error) {
ErrorReporter.error(error); ErrorReporter.error(error);
console.log( console.log(
` => ERROR: Workflow could not be activated on first try, keep on trying`, ' => ERROR: Workflow could not be activated on first try, keep on trying',
); );
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
console.log(` ${error.message}`); console.log(` ${error.message}`);
@ -773,7 +774,7 @@ export class ActiveWorkflowRunner {
workflowData?: IWorkflowDb, workflowData?: IWorkflowDb,
): Promise<void> { ): Promise<void> {
if (this.activeWorkflows === null) { if (this.activeWorkflows === null) {
throw new Error(`The "activeWorkflows" instance did not get initialized yet.`); throw new Error('The "activeWorkflows" instance did not get initialized yet.');
} }
let workflowInstance: Workflow; let workflowInstance: Workflow;
@ -806,7 +807,7 @@ export class ActiveWorkflowRunner {
if (!canBeActivated) { if (!canBeActivated) {
Logger.error(`Unable to activate workflow "${workflowData.name}"`); Logger.error(`Unable to activate workflow "${workflowData.name}"`);
throw new Error( throw new Error(
`The workflow can not be activated because it does not contain any nodes which could start the workflow. Only workflows which have trigger or webhook nodes can be activated.`, 'The workflow can not be activated because it does not contain any nodes which could start the workflow. Only workflows which have trigger or webhook nodes can be activated.',
); );
} }
@ -1001,7 +1002,7 @@ export class ActiveWorkflowRunner {
return; return;
} }
throw new Error(`The "activeWorkflows" instance did not get initialized yet.`); throw new Error('The "activeWorkflows" instance did not get initialized yet.');
} }
} }

View file

@ -13,7 +13,7 @@ export class Push {
this.channel.on('disconnect', (channel: string, res: Response) => { this.channel.on('disconnect', (channel: string, res: Response) => {
if (res.req !== undefined) { if (res.req !== undefined) {
const { sessionId } = res.req.query; const { sessionId } = res.req.query;
Logger.debug(`Remove editor-UI session`, { sessionId }); Logger.debug('Remove editor-UI session', { sessionId });
delete this.connections[sessionId as string]; delete this.connections[sessionId as string];
} }
}); });
@ -27,7 +27,7 @@ export class Push {
* @param {Response} res The response * @param {Response} res The response
*/ */
add(sessionId: string, req: Request, res: Response) { add(sessionId: string, req: Request, res: Response) {
Logger.debug(`Add editor-UI session`, { sessionId }); Logger.debug('Add editor-UI session', { sessionId });
if (this.connections[sessionId] !== undefined) { if (this.connections[sessionId] !== undefined) {
// Make sure to remove existing connection with the same session // Make sure to remove existing connection with the same session

View file

@ -1031,7 +1031,7 @@ class App {
const parameters = toHttpNodeParameters(curlCommand); const parameters = toHttpNodeParameters(curlCommand);
return ResponseHelper.flattenObject(parameters, 'parameters'); return ResponseHelper.flattenObject(parameters, 'parameters');
} catch (e) { } catch (e) {
throw new ResponseHelper.BadRequestError(`Invalid cURL command`); throw new ResponseHelper.BadRequestError('Invalid cURL command');
} }
}, },
), ),

View file

@ -18,7 +18,8 @@ import * as Push from '@/Push';
import * as ResponseHelper from '@/ResponseHelper'; import * as ResponseHelper from '@/ResponseHelper';
import * as WebhookHelpers from '@/WebhookHelpers'; import * as WebhookHelpers from '@/WebhookHelpers';
const WEBHOOK_TEST_UNREGISTERED_HINT = `Click the 'Execute workflow' button on the canvas, then try again. (In test mode, the webhook only works for one call after you click this button)`; const WEBHOOK_TEST_UNREGISTERED_HINT =
"Click the 'Execute workflow' button on the canvas, then try again. (In test mode, the webhook only works for one call after you click this button)";
export class TestWebhooks { export class TestWebhooks {
private testWebhookData: { private testWebhookData: {

View file

@ -127,7 +127,7 @@ export function usersNamespace(this: N8nApp): void {
const usersToSetUp = Object.keys(createUsers).filter((email) => createUsers[email] === null); const usersToSetUp = Object.keys(createUsers).filter((email) => createUsers[email] === null);
const total = usersToSetUp.length; const total = usersToSetUp.length;
Logger.debug(total > 1 ? `Creating ${total} user shells...` : `Creating 1 user shell...`); Logger.debug(total > 1 ? `Creating ${total} user shells...` : 'Creating 1 user shell...');
try { try {
await Db.transaction(async (transactionManager) => { await Db.transaction(async (transactionManager) => {
@ -156,7 +156,7 @@ export function usersNamespace(this: N8nApp): void {
} }
Logger.info('Created user shell(s) successfully', { userId: req.user.id }); Logger.info('Created user shell(s) successfully', { userId: req.user.id });
Logger.verbose(total > 1 ? `${total} user shells created` : `1 user shell created`, { Logger.verbose(total > 1 ? `${total} user shells created` : '1 user shell created', {
userShells: createUsers, userShells: createUsers,
}); });
@ -200,7 +200,7 @@ export function usersNamespace(this: N8nApp): void {
domain: baseUrl, domain: baseUrl,
email, email,
}); });
resp.error = `Email could not be sent`; resp.error = 'Email could not be sent';
} }
return resp; return resp;
}), }),
@ -211,7 +211,7 @@ export function usersNamespace(this: N8nApp): void {
Logger.debug( Logger.debug(
usersPendingSetup.length > 1 usersPendingSetup.length > 1
? `Sent ${usersPendingSetup.length} invite emails successfully` ? `Sent ${usersPendingSetup.length} invite emails successfully`
: `Sent 1 invite email successfully`, : 'Sent 1 invite email successfully',
{ userShells: createUsers }, { userShells: createUsers },
); );

View file

@ -137,7 +137,7 @@ export function executeErrorWorkflow(
workflowData.settings.errorWorkflow.toString() === workflowData.id.toString() workflowData.settings.errorWorkflow.toString() === workflowData.id.toString()
) )
) { ) {
Logger.verbose(`Start external error workflow`, { Logger.verbose('Start external error workflow', {
executionId, executionId,
errorWorkflowId: workflowData.settings.errorWorkflow.toString(), errorWorkflowId: workflowData.settings.errorWorkflow.toString(),
workflowId: workflowData.id, workflowId: workflowData.id,
@ -177,7 +177,7 @@ export function executeErrorWorkflow(
workflowData.id !== undefined && workflowData.id !== undefined &&
workflowData.nodes.some((node) => node.type === ERROR_TRIGGER_TYPE) workflowData.nodes.some((node) => node.type === ERROR_TRIGGER_TYPE)
) { ) {
Logger.verbose(`Start internal error workflow`, { executionId, workflowId: workflowData.id }); Logger.verbose('Start internal error workflow', { executionId, workflowId: workflowData.id });
void getWorkflowOwner(workflowData.id).then((user) => { void getWorkflowOwner(workflowData.id).then((user) => {
void WorkflowHelpers.executeErrorWorkflow( void WorkflowHelpers.executeErrorWorkflow(
workflowData.id!.toString(), workflowData.id!.toString(),
@ -293,7 +293,7 @@ function hookFunctionsPush(): IWorkflowExecuteHooks {
], ],
workflowExecuteBefore: [ workflowExecuteBefore: [
async function (this: WorkflowHooks): Promise<void> { async function (this: WorkflowHooks): Promise<void> {
Logger.debug(`Executing hook (hookFunctionsPush)`, { Logger.debug('Executing hook (hookFunctionsPush)', {
executionId: this.executionId, executionId: this.executionId,
sessionId: this.sessionId, sessionId: this.sessionId,
workflowId: this.workflowData.id, workflowId: this.workflowData.id,
@ -324,7 +324,7 @@ function hookFunctionsPush(): IWorkflowExecuteHooks {
fullRunData: IRun, fullRunData: IRun,
newStaticData: IDataObject, newStaticData: IDataObject,
): Promise<void> { ): Promise<void> {
Logger.debug(`Executing hook (hookFunctionsPush)`, { Logger.debug('Executing hook (hookFunctionsPush)', {
executionId: this.executionId, executionId: this.executionId,
sessionId: this.sessionId, sessionId: this.sessionId,
workflowId: this.workflowData.id, workflowId: this.workflowData.id,
@ -490,7 +490,7 @@ function hookFunctionsSave(parentProcessMode?: string): IWorkflowExecuteHooks {
fullRunData: IRun, fullRunData: IRun,
newStaticData: IDataObject, newStaticData: IDataObject,
): Promise<void> { ): Promise<void> {
Logger.debug(`Executing hook (hookFunctionsSave)`, { Logger.debug('Executing hook (hookFunctionsSave)', {
executionId: this.executionId, executionId: this.executionId,
workflowId: this.workflowData.id, workflowId: this.workflowData.id,
}); });
@ -830,7 +830,7 @@ export async function getWorkflowData(
): Promise<IWorkflowBase> { ): Promise<IWorkflowBase> {
if (workflowInfo.id === undefined && workflowInfo.code === undefined) { if (workflowInfo.id === undefined && workflowInfo.code === undefined) {
throw new Error( throw new Error(
`No information about the workflow to execute found. Please provide either the "id" or "code"!`, 'No information about the workflow to execute found. Please provide either the "id" or "code"!',
); );
} }

View file

@ -67,7 +67,7 @@ const setupUserManagement = async () => {
`INSERT INTO user (id, globalRoleId) values ("${uuid()}", ${instanceOwnerRole[0].insertId})`, `INSERT INTO user (id, globalRoleId) values ("${uuid()}", ${instanceOwnerRole[0].insertId})`,
); );
await connection.query( await connection.query(
`INSERT INTO "settings" (key, value, loadOnStartup) values ('userManagement.isInstanceOwnerSetUp', 'false', true), ('userManagement.skipInstanceOwnerSetup', 'false', true)`, "INSERT INTO \"settings\" (key, value, loadOnStartup) values ('userManagement.isInstanceOwnerSetUp', 'false', true), ('userManagement.skipInstanceOwnerSetup', 'false', true)",
); );
}; };

View file

@ -31,7 +31,7 @@ export class DbRevertMigrationCommand extends Command {
connection = Db.collections.Credentials.manager.connection; connection = Db.collections.Credentials.manager.connection;
if (!connection) { if (!connection) {
throw new Error(`No database connection available.`); throw new Error('No database connection available.');
} }
const connectionOptions: ConnectionOptions = Object.assign(connection.options, { const connectionOptions: ConnectionOptions = Object.assign(connection.options, {

View file

@ -26,7 +26,7 @@ import { findCliWorkflowStart } from '@/utils';
export class Execute extends Command { export class Execute extends Command {
static description = '\nExecutes a given workflow'; static description = '\nExecutes a given workflow';
static examples = [`$ n8n execute --id=5`, `$ n8n execute --file=workflow.json`]; static examples = ['$ n8n execute --id=5', '$ n8n execute --file=workflow.json'];
static flags = { static flags = {
help: flags.help({ char: 'h' }), help: flags.help({ char: 'h' }),
@ -59,12 +59,12 @@ export class Execute extends Command {
const loadNodesAndCredentialsPromise = loadNodesAndCredentials.init(); const loadNodesAndCredentialsPromise = loadNodesAndCredentials.init();
if (!flags.id && !flags.file) { if (!flags.id && !flags.file) {
console.info(`Either option "--id" or "--file" have to be set!`); console.info('Either option "--id" or "--file" have to be set!');
return; return;
} }
if (flags.id && flags.file) { if (flags.id && flags.file) {
console.info(`Either "id" or "file" can be set never both!`); console.info('Either "id" or "file" can be set never both!');
return; return;
} }

View file

@ -58,12 +58,12 @@ export class ExecuteBatch extends Command {
static instanceOwner: User; static instanceOwner: User;
static examples = [ static examples = [
`$ n8n executeBatch`, '$ n8n executeBatch',
`$ n8n executeBatch --concurrency=10 --skipList=/data/skipList.txt`, '$ n8n executeBatch --concurrency=10 --skipList=/data/skipList.txt',
`$ n8n executeBatch --debug --output=/data/output.json`, '$ n8n executeBatch --debug --output=/data/output.json',
`$ n8n executeBatch --ids=10,13,15 --shortOutput`, '$ n8n executeBatch --ids=10,13,15 --shortOutput',
`$ n8n executeBatch --snapshot=/data/snapshots --shallow`, '$ n8n executeBatch --snapshot=/data/snapshots --shallow',
`$ n8n executeBatch --compare=/data/previousExecutionData --retries=2`, '$ n8n executeBatch --compare=/data/previousExecutionData --retries=2',
]; ];
static flags = { static flags = {
@ -205,11 +205,11 @@ export class ExecuteBatch extends Command {
if (flags.snapshot !== undefined) { if (flags.snapshot !== undefined) {
if (fs.existsSync(flags.snapshot)) { if (fs.existsSync(flags.snapshot)) {
if (!fs.lstatSync(flags.snapshot).isDirectory()) { if (!fs.lstatSync(flags.snapshot).isDirectory()) {
console.log(`The parameter --snapshot must be an existing directory`); console.log('The parameter --snapshot must be an existing directory');
return; return;
} }
} else { } else {
console.log(`The parameter --snapshot must be an existing directory`); console.log('The parameter --snapshot must be an existing directory');
return; return;
} }
@ -218,11 +218,11 @@ export class ExecuteBatch extends Command {
if (flags.compare !== undefined) { if (flags.compare !== undefined) {
if (fs.existsSync(flags.compare)) { if (fs.existsSync(flags.compare)) {
if (!fs.lstatSync(flags.compare).isDirectory()) { if (!fs.lstatSync(flags.compare).isDirectory()) {
console.log(`The parameter --compare must be an existing directory`); console.log('The parameter --compare must be an existing directory');
return; return;
} }
} else { } else {
console.log(`The parameter --compare must be an existing directory`); console.log('The parameter --compare must be an existing directory');
return; return;
} }
@ -232,7 +232,7 @@ export class ExecuteBatch extends Command {
if (flags.output !== undefined) { if (flags.output !== undefined) {
if (fs.existsSync(flags.output)) { if (fs.existsSync(flags.output)) {
if (fs.lstatSync(flags.output).isDirectory()) { if (fs.lstatSync(flags.output).isDirectory()) {
console.log(`The parameter --output must be a writable file`); console.log('The parameter --output must be a writable file');
return; return;
} }
} }
@ -251,7 +251,7 @@ export class ExecuteBatch extends Command {
if (matchedIds.length === 0) { if (matchedIds.length === 0) {
console.log( console.log(
`The parameter --ids must be a list of numeric IDs separated by a comma or a file with this content.`, 'The parameter --ids must be a list of numeric IDs separated by a comma or a file with this content.',
); );
return; return;
} }
@ -294,11 +294,11 @@ export class ExecuteBatch extends Command {
const query = Db.collections.Workflow.createQueryBuilder('workflows'); const query = Db.collections.Workflow.createQueryBuilder('workflows');
if (ids.length > 0) { if (ids.length > 0) {
query.andWhere(`workflows.id in (:...ids)`, { ids }); query.andWhere('workflows.id in (:...ids)', { ids });
} }
if (skipIds.length > 0) { if (skipIds.length > 0) {
query.andWhere(`workflows.id not in (:...skipIds)`, { skipIds }); query.andWhere('workflows.id not in (:...skipIds)', { skipIds });
} }
// eslint-disable-next-line prefer-const // eslint-disable-next-line prefer-const

View file

@ -18,11 +18,11 @@ export class ExportCredentialsCommand extends Command {
static description = 'Export credentials'; static description = 'Export credentials';
static examples = [ static examples = [
`$ n8n export:credentials --all`, '$ n8n export:credentials --all',
`$ n8n export:credentials --id=5 --output=file.json`, '$ n8n export:credentials --id=5 --output=file.json',
`$ n8n export:credentials --all --output=backups/latest.json`, '$ n8n export:credentials --all --output=backups/latest.json',
`$ n8n export:credentials --backup --output=backups/latest/`, '$ n8n export:credentials --backup --output=backups/latest/',
`$ n8n export:credentials --all --decrypted --output=backups/decrypted.json`, '$ n8n export:credentials --all --decrypted --output=backups/decrypted.json',
]; ];
static flags = { static flags = {
@ -69,25 +69,25 @@ export class ExportCredentialsCommand extends Command {
} }
if (!flags.all && !flags.id) { if (!flags.all && !flags.id) {
console.info(`Either option "--all" or "--id" have to be set!`); console.info('Either option "--all" or "--id" have to be set!');
return; return;
} }
if (flags.all && flags.id) { if (flags.all && flags.id) {
console.info(`You should either use "--all" or "--id" but never both!`); console.info('You should either use "--all" or "--id" but never both!');
return; return;
} }
if (flags.separate) { if (flags.separate) {
try { try {
if (!flags.output) { if (!flags.output) {
console.info(`You must inform an output directory via --output when using --separate`); console.info('You must inform an output directory via --output when using --separate');
return; return;
} }
if (fs.existsSync(flags.output)) { if (fs.existsSync(flags.output)) {
if (!fs.lstatSync(flags.output).isDirectory()) { if (!fs.lstatSync(flags.output).isDirectory()) {
console.info(`The parameter --output must be a directory`); console.info('The parameter --output must be a directory');
return; return;
} }
} else { } else {
@ -106,7 +106,7 @@ export class ExportCredentialsCommand extends Command {
} else if (flags.output) { } else if (flags.output) {
if (fs.existsSync(flags.output)) { if (fs.existsSync(flags.output)) {
if (fs.lstatSync(flags.output).isDirectory()) { if (fs.lstatSync(flags.output).isDirectory()) {
console.info(`The parameter --output must be a writeable file`); console.info('The parameter --output must be a writeable file');
return; return;
} }
} }

View file

@ -14,10 +14,10 @@ export class ExportWorkflowsCommand extends Command {
static description = 'Export workflows'; static description = 'Export workflows';
static examples = [ static examples = [
`$ n8n export:workflow --all`, '$ n8n export:workflow --all',
`$ n8n export:workflow --id=5 --output=file.json`, '$ n8n export:workflow --id=5 --output=file.json',
`$ n8n export:workflow --all --output=backups/latest/`, '$ n8n export:workflow --all --output=backups/latest/',
`$ n8n export:workflow --backup --output=backups/latest/`, '$ n8n export:workflow --backup --output=backups/latest/',
]; ];
static flags = { static flags = {
@ -60,25 +60,25 @@ export class ExportWorkflowsCommand extends Command {
} }
if (!flags.all && !flags.id) { if (!flags.all && !flags.id) {
console.info(`Either option "--all" or "--id" have to be set!`); console.info('Either option "--all" or "--id" have to be set!');
return; return;
} }
if (flags.all && flags.id) { if (flags.all && flags.id) {
console.info(`You should either use "--all" or "--id" but never both!`); console.info('You should either use "--all" or "--id" but never both!');
return; return;
} }
if (flags.separate) { if (flags.separate) {
try { try {
if (!flags.output) { if (!flags.output) {
console.info(`You must inform an output directory via --output when using --separate`); console.info('You must inform an output directory via --output when using --separate');
return; return;
} }
if (fs.existsSync(flags.output)) { if (fs.existsSync(flags.output)) {
if (!fs.lstatSync(flags.output).isDirectory()) { if (!fs.lstatSync(flags.output).isDirectory()) {
console.info(`The parameter --output must be a directory`); console.info('The parameter --output must be a directory');
return; return;
} }
} else { } else {
@ -97,7 +97,7 @@ export class ExportWorkflowsCommand extends Command {
} else if (flags.output) { } else if (flags.output) {
if (fs.existsSync(flags.output)) { if (fs.existsSync(flags.output)) {
if (fs.lstatSync(flags.output).isDirectory()) { if (fs.lstatSync(flags.output).isDirectory()) {
console.info(`The parameter --output must be a writeable file`); console.info('The parameter --output must be a writeable file');
return; return;
} }
} }

View file

@ -10,7 +10,7 @@ import { SETTINGS_LICENSE_CERT_KEY } from '@/constants';
export class ClearLicenseCommand extends Command { export class ClearLicenseCommand extends Command {
static description = 'Clear license'; static description = 'Clear license';
static examples = [`$ n8n clear:license`]; static examples = ['$ n8n clear:license'];
async run() { async run() {
const logger = getLogger(); const logger = getLogger();

View file

@ -55,10 +55,10 @@ export class Start extends Command {
static description = 'Starts n8n. Makes Web-UI available and starts active workflows'; static description = 'Starts n8n. Makes Web-UI available and starts active workflows';
static examples = [ static examples = [
`$ n8n start`, '$ n8n start',
`$ n8n start --tunnel`, '$ n8n start --tunnel',
`$ n8n start -o`, '$ n8n start -o',
`$ n8n start --tunnel -o`, '$ n8n start --tunnel -o',
]; ];
static flags = { static flags = {
@ -117,7 +117,7 @@ export class Start extends Command {
setTimeout(() => { setTimeout(() => {
// In case that something goes wrong with shutdown we // In case that something goes wrong with shutdown we
// kill after max. 30 seconds no matter what // kill after max. 30 seconds no matter what
console.log(`process exited after 30s`); console.log('process exited after 30s');
exit(); exit();
}, 30000); }, 30000);
@ -499,7 +499,7 @@ export class Start extends Command {
if (flags.open) { if (flags.open) {
Start.openBrowser(); Start.openBrowser();
} }
this.log(`\nPress "o" to open in Browser.`); this.log('\nPress "o" to open in Browser.');
process.stdin.on('data', (key: string) => { process.stdin.on('data', (key: string) => {
if (key === 'o') { if (key === 'o') {
Start.openBrowser(); Start.openBrowser();

View file

@ -13,8 +13,8 @@ export class UpdateWorkflowCommand extends Command {
static description = 'Update workflows'; static description = 'Update workflows';
static examples = [ static examples = [
`$ n8n update:workflow --all --active=false`, '$ n8n update:workflow --all --active=false',
`$ n8n update:workflow --id=5 --active=true`, '$ n8n update:workflow --id=5 --active=true',
]; ];
static flags = { static flags = {
@ -39,24 +39,24 @@ export class UpdateWorkflowCommand extends Command {
const { flags } = this.parse(UpdateWorkflowCommand); const { flags } = this.parse(UpdateWorkflowCommand);
if (!flags.all && !flags.id) { if (!flags.all && !flags.id) {
console.info(`Either option "--all" or "--id" have to be set!`); console.info('Either option "--all" or "--id" have to be set!');
return; return;
} }
if (flags.all && flags.id) { if (flags.all && flags.id) {
console.info( console.info(
`Either something else on top should be "--all" or "--id" can be set never both!`, 'Either something else on top should be "--all" or "--id" can be set never both!',
); );
return; return;
} }
const updateQuery: IDataObject = {}; const updateQuery: IDataObject = {};
if (flags.active === undefined) { if (flags.active === undefined) {
console.info(`No update flag like "--active=true" has been set!`); console.info('No update flag like "--active=true" has been set!');
return; return;
} }
if (!['false', 'true'].includes(flags.active)) { if (!['false', 'true'].includes(flags.active)) {
console.info(`Valid values for flag "--active" are only "false" or "true"!`); console.info('Valid values for flag "--active" are only "false" or "true"!');
return; return;
} }
updateQuery.active = flags.active === 'true'; updateQuery.active = flags.active === 'true';

View file

@ -31,7 +31,7 @@ let processExitCode = 0;
export class Webhook extends Command { export class Webhook extends Command {
static description = 'Starts n8n webhook process. Intercepts only production URLs.'; static description = 'Starts n8n webhook process. Intercepts only production URLs.';
static examples = [`$ n8n webhook`]; static examples = ['$ n8n webhook'];
static flags = { static flags = {
help: flags.help({ char: 'h' }), help: flags.help({ char: 'h' }),
@ -44,7 +44,7 @@ export class Webhook extends Command {
*/ */
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
static async stopProcess() { static async stopProcess() {
LoggerProxy.info(`\nStopping n8n...`); LoggerProxy.info('\nStopping n8n...');
const exit = () => { const exit = () => {
CrashJournal.cleanup().finally(() => { CrashJournal.cleanup().finally(() => {

View file

@ -47,7 +47,7 @@ import { generateFailedExecutionFromError } from '@/WorkflowHelpers';
export class Worker extends Command { export class Worker extends Command {
static description = '\nStarts a n8n worker'; static description = '\nStarts a n8n worker';
static examples = [`$ n8n worker --concurrency=5`]; static examples = ['$ n8n worker --concurrency=5'];
static flags = { static flags = {
help: flags.help({ char: 'h' }), help: flags.help({ char: 'h' }),
@ -72,7 +72,7 @@ export class Worker extends Command {
* get removed. * get removed.
*/ */
static async stopProcess() { static async stopProcess() {
LoggerProxy.info(`Stopping n8n...`); LoggerProxy.info('Stopping n8n...');
// Stop accepting new jobs // Stop accepting new jobs
// eslint-disable-next-line @typescript-eslint/no-floating-promises // eslint-disable-next-line @typescript-eslint/no-floating-promises

View file

@ -833,7 +833,7 @@ export const schema = {
env: 'N8N_VERSION_NOTIFICATIONS_ENDPOINT', env: 'N8N_VERSION_NOTIFICATIONS_ENDPOINT',
}, },
infoUrl: { infoUrl: {
doc: `Url in New Versions Panel with more information on updating one's instance.`, doc: "Url in New Versions Panel with more information on updating one's instance.",
format: String, format: String,
default: 'https://docs.n8n.io/getting-started/installation/updating.html', default: 'https://docs.n8n.io/getting-started/installation/updating.html',
env: 'N8N_VERSION_NOTIFICATIONS_INFO_URL', env: 'N8N_VERSION_NOTIFICATIONS_INFO_URL',

View file

@ -60,7 +60,7 @@ EECredentialsController.get(
const includeDecryptedData = req.query.includeData === 'true'; const includeDecryptedData = req.query.includeData === 'true';
if (Number.isNaN(Number(credentialId))) { if (Number.isNaN(Number(credentialId))) {
throw new ResponseHelper.BadRequestError(`Credential ID must be a number.`); throw new ResponseHelper.BadRequestError('Credential ID must be a number.');
} }
let credential = (await EECredentials.get( let credential = (await EECredentials.get(
@ -77,7 +77,7 @@ EECredentialsController.get(
const userSharing = credential.shared?.find((shared) => shared.user.id === req.user.id); const userSharing = credential.shared?.find((shared) => shared.user.id === req.user.id);
if (!userSharing && req.user.globalRole.name !== 'owner') { if (!userSharing && req.user.globalRole.name !== 'owner') {
throw new ResponseHelper.UnauthorizedError(`Forbidden.`); throw new ResponseHelper.UnauthorizedError('Forbidden.');
} }
credential = EECredentials.addOwnerAndSharings(credential); credential = EECredentials.addOwnerAndSharings(credential);
@ -124,7 +124,7 @@ EECredentialsController.post(
const sharing = await EECredentials.getSharing(req.user, credentials.id); const sharing = await EECredentials.getSharing(req.user, credentials.id);
if (!ownsCredential) { if (!ownsCredential) {
if (!sharing) { if (!sharing) {
throw new ResponseHelper.UnauthorizedError(`Forbidden`); throw new ResponseHelper.UnauthorizedError('Forbidden');
} }
const decryptedData = await EECredentials.decrypt(encryptionKey, sharing.credentials); const decryptedData = await EECredentials.decrypt(encryptionKey, sharing.credentials);

View file

@ -75,7 +75,7 @@ credentialsController.get(
const includeDecryptedData = req.query.includeData === 'true'; const includeDecryptedData = req.query.includeData === 'true';
if (Number.isNaN(Number(credentialId))) { if (Number.isNaN(Number(credentialId))) {
throw new ResponseHelper.BadRequestError(`Credential ID must be a number.`); throw new ResponseHelper.BadRequestError('Credential ID must be a number.');
} }
const sharing = await CredentialsService.getSharing(req.user, credentialId, ['credentials']); const sharing = await CredentialsService.getSharing(req.user, credentialId, ['credentials']);

View file

@ -5,7 +5,7 @@ import config from '@/config';
const dbType = config.getEnv('database.type'); const dbType = config.getEnv('database.type');
const timestampSyntax = { const timestampSyntax = {
sqlite: `STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')`, sqlite: "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')",
postgresdb: 'CURRENT_TIMESTAMP(3)', postgresdb: 'CURRENT_TIMESTAMP(3)',
mysqldb: 'CURRENT_TIMESTAMP(3)', mysqldb: 'CURRENT_TIMESTAMP(3)',
mariadb: 'CURRENT_TIMESTAMP(3)', mariadb: 'CURRENT_TIMESTAMP(3)',

View file

@ -155,7 +155,7 @@ export class ExecutionsService {
filter: req.query.filter, filter: req.query.filter,
}); });
throw new ResponseHelper.InternalServerError( throw new ResponseHelper.InternalServerError(
`Parameter "filter" contained invalid JSON string.`, 'Parameter "filter" contained invalid JSON string.',
); );
} }
} }
@ -211,7 +211,7 @@ export class ExecutionsService {
} }
if (executingWorkflowIds.length > 0) { if (executingWorkflowIds.length > 0) {
rangeQuery.push(`id NOT IN (:...executingWorkflowIds)`); rangeQuery.push('id NOT IN (:...executingWorkflowIds)');
rangeQueryParams.executingWorkflowIds = executingWorkflowIds; rangeQueryParams.executingWorkflowIds = executingWorkflowIds;
} }
@ -440,7 +440,7 @@ export class ExecutionsService {
} }
} catch (error) { } catch (error) {
throw new ResponseHelper.InternalServerError( throw new ResponseHelper.InternalServerError(
`Parameter "filter" contained invalid JSON string.`, 'Parameter "filter" contained invalid JSON string.',
); );
} }
} }

View file

@ -125,7 +125,7 @@ workflowsController.get(
* GET /workflows/new * GET /workflows/new
*/ */
workflowsController.get( workflowsController.get(
`/new`, '/new',
ResponseHelper.send(async (req: WorkflowRequest.NewName) => { ResponseHelper.send(async (req: WorkflowRequest.NewName) => {
const requestedName = const requestedName =
req.query.name && req.query.name !== '' req.query.name && req.query.name !== ''
@ -148,14 +148,14 @@ workflowsController.get(
* GET /workflows/from-url * GET /workflows/from-url
*/ */
workflowsController.get( workflowsController.get(
`/from-url`, '/from-url',
ResponseHelper.send(async (req: express.Request): Promise<IWorkflowResponse> => { ResponseHelper.send(async (req: express.Request): Promise<IWorkflowResponse> => {
if (req.query.url === undefined) { if (req.query.url === undefined) {
throw new ResponseHelper.BadRequestError(`The parameter "url" is missing!`); throw new ResponseHelper.BadRequestError('The parameter "url" is missing!');
} }
if (!/^http[s]?:\/\/.*\.json$/i.exec(req.query.url as string)) { if (!/^http[s]?:\/\/.*\.json$/i.exec(req.query.url as string)) {
throw new ResponseHelper.BadRequestError( throw new ResponseHelper.BadRequestError(
`The parameter "url" is not valid! It does not seem to be a URL pointing to a n8n workflow JSON file.`, 'The parameter "url" is not valid! It does not seem to be a URL pointing to a n8n workflow JSON file.',
); );
} }
let workflowData: IWorkflowResponse | undefined; let workflowData: IWorkflowResponse | undefined;
@ -163,7 +163,7 @@ workflowsController.get(
const { data } = await axios.get<IWorkflowResponse>(req.query.url as string); const { data } = await axios.get<IWorkflowResponse>(req.query.url as string);
workflowData = data; workflowData = data;
} catch (error) { } catch (error) {
throw new ResponseHelper.BadRequestError(`The URL does not point to valid JSON file!`); throw new ResponseHelper.BadRequestError('The URL does not point to valid JSON file!');
} }
// Do a very basic check if it is really a n8n-workflow-json // Do a very basic check if it is really a n8n-workflow-json
@ -176,7 +176,7 @@ workflowsController.get(
Array.isArray(workflowData.connections) Array.isArray(workflowData.connections)
) { ) {
throw new ResponseHelper.BadRequestError( throw new ResponseHelper.BadRequestError(
`The data in the file does not seem to be a n8n workflow JSON file!`, 'The data in the file does not seem to be a n8n workflow JSON file!',
); );
} }
@ -227,7 +227,7 @@ workflowsController.get(
* PATCH /workflows/:id * PATCH /workflows/:id
*/ */
workflowsController.patch( workflowsController.patch(
`/:id`, '/:id',
ResponseHelper.send(async (req: WorkflowRequest.Update) => { ResponseHelper.send(async (req: WorkflowRequest.Update) => {
const { id: workflowId } = req.params; const { id: workflowId } = req.params;
@ -253,7 +253,7 @@ workflowsController.patch(
* DELETE /workflows/:id * DELETE /workflows/:id
*/ */
workflowsController.delete( workflowsController.delete(
`/:id`, '/:id',
ResponseHelper.send(async (req: WorkflowRequest.Delete) => { ResponseHelper.send(async (req: WorkflowRequest.Delete) => {
const { id: workflowId } = req.params; const { id: workflowId } = req.params;

View file

@ -151,7 +151,7 @@ export class WorkflowsService {
filter, filter,
}); });
throw new ResponseHelper.InternalServerError( throw new ResponseHelper.InternalServerError(
`Parameter "filter" contained invalid JSON string.`, 'Parameter "filter" contained invalid JSON string.',
); );
} }
} }

View file

@ -78,7 +78,7 @@ export class Credentials extends ICredentials {
const fullData = this.getData(encryptionKey, nodeType); const fullData = this.getData(encryptionKey, nodeType);
if (fullData === null) { if (fullData === null) {
throw new Error(`No data was set.`); throw new Error('No data was set.');
} }
// eslint-disable-next-line no-prototype-builtins // eslint-disable-next-line no-prototype-builtins
@ -94,7 +94,7 @@ export class Credentials extends ICredentials {
*/ */
getDataToSave(): ICredentialsEncrypted { getDataToSave(): ICredentialsEncrypted {
if (this.data === undefined) { if (this.data === undefined) {
throw new Error(`No credentials were set to save.`); throw new Error('No credentials were set to save.');
} }
return { return {

View file

@ -512,7 +512,7 @@ function digestAuthAxiosConfig(
.split(',') .split(',')
.map((v: string) => v.split('=')); .map((v: string) => v.split('='));
if (authDetails) { if (authDetails) {
const nonceCount = `000000001`; const nonceCount = '000000001';
const cnonce = crypto.randomBytes(24).toString('hex'); const cnonce = crypto.randomBytes(24).toString('hex');
const realm: string = authDetails const realm: string = authDetails
.find((el: any) => el[0].toLowerCase().indexOf('realm') > -1)[1] .find((el: any) => el[0].toLowerCase().indexOf('realm') > -1)[1]

View file

@ -1265,7 +1265,7 @@ export class WorkflowExecute {
const fullRunData = this.getFullRunData(startedAt); const fullRunData = this.getFullRunData(startedAt);
if (executionError !== undefined) { if (executionError !== undefined) {
Logger.verbose(`Workflow execution finished with error`, { Logger.verbose('Workflow execution finished with error', {
error: executionError, error: executionError,
workflowId: workflow.id, workflowId: workflow.id,
}); });
@ -1281,7 +1281,7 @@ export class WorkflowExecute {
}); });
fullRunData.waitTill = this.runExecutionData.waitTill; fullRunData.waitTill = this.runExecutionData.waitTill;
} else { } else {
Logger.verbose(`Workflow execution finished successfully`, { workflowId: workflow.id }); Logger.verbose('Workflow execution finished successfully', { workflowId: workflow.id });
fullRunData.finished = true; fullRunData.finished = true;
} }

View file

@ -30,7 +30,7 @@ const template: StoryFn = (args, { argTypes }) => ({
components: { components: {
N8nActionDropdown, N8nActionDropdown,
}, },
template: `<n8n-action-dropdown v-bind="$props" />`, template: '<n8n-action-dropdown v-bind="$props" />',
}); });
export const defaultActionDropdown = template.bind({}); export const defaultActionDropdown = template.bind({});

View file

@ -14,7 +14,7 @@ export const Default: StoryFn = (args, { argTypes }) => ({
components: { components: {
N8nCard, N8nCard,
}, },
template: `<n8n-card v-bind="$props">This is a card.</n8n-card>`, template: '<n8n-card v-bind="$props">This is a card.</n8n-card>',
}); });
export const Hoverable: StoryFn = (args, { argTypes }) => ({ export const Hoverable: StoryFn = (args, { argTypes }) => ({

View file

@ -40,7 +40,8 @@ const Template: StoryFn = (args, { argTypes }) => ({
export const Markdown = Template.bind({}); export const Markdown = Template.bind({});
Markdown.args = { Markdown.args = {
content: `I wanted a system to monitor website content changes and notify me. So I made it using n8n.\n\nEspecially my competitor blogs. I wanted to know how often they are posting new articles. (I used their sitemap.xml file) (The below workflow may vary)\n\nIn the Below example, I used HackerNews for example.\n\nExplanation:\n\n- First HTTP Request node crawls the webpage and grabs the website source code\n- Then wait for x minutes\n- Again, HTTP Node crawls the webpage\n- If Node compares both results are equal if anything is changed. Itll go to the false branch and notify me in telegram.\n\n**Workflow:**\n\n![](fileId:1)\n\n**Sample Response:**\n\n![](https://community.n8n.io/uploads/default/original/2X/d/d21ba41d7ac9ff5cd8148fedb07d0f1ff53b2529.png)\n`, content:
'I wanted a system to monitor website content changes and notify me. So I made it using n8n.\n\nEspecially my competitor blogs. I wanted to know how often they are posting new articles. (I used their sitemap.xml file) (The below workflow may vary)\n\nIn the Below example, I used HackerNews for example.\n\nExplanation:\n\n- First HTTP Request node crawls the webpage and grabs the website source code\n- Then wait for x minutes\n- Again, HTTP Node crawls the webpage\n- If Node compares both results are equal if anything is changed. Itll go to the false branch and notify me in telegram.\n\n**Workflow:**\n\n![](fileId:1)\n\n**Sample Response:**\n\n![](https://community.n8n.io/uploads/default/original/2X/d/d21ba41d7ac9ff5cd8148fedb07d0f1ff53b2529.png)\n',
loading: false, loading: false,
images: [ images: [
{ {

View file

@ -144,7 +144,7 @@ export default Vue.extend({
// Return nothing, means keep the default handling measure // Return nothing, means keep the default handling measure
}, },
onTag(tag, code) { onTag(tag, code) {
if (tag === 'img' && code.includes(`alt="workflow-screenshot"`)) { if (tag === 'img' && code.includes('alt="workflow-screenshot"')) {
return ''; return '';
} }
// return nothing, keep tag // return nothing, keep tag

View file

@ -17,7 +17,8 @@ const SlotTemplate: StoryFn = (args, { argTypes }) => ({
components: { components: {
N8nNotice, N8nNotice,
}, },
template: `<n8n-notice v-bind="$props">This is a notice! Thread carefully from this point forward.</n8n-notice>`, template:
'<n8n-notice v-bind="$props">This is a notice! Thread carefully from this point forward.</n8n-notice>',
}); });
const PropTemplate: StoryFn = (args, { argTypes }) => ({ const PropTemplate: StoryFn = (args, { argTypes }) => ({
@ -25,7 +26,7 @@ const PropTemplate: StoryFn = (args, { argTypes }) => ({
components: { components: {
N8nNotice, N8nNotice,
}, },
template: `<n8n-notice v-bind="$props"/>`, template: '<n8n-notice v-bind="$props"/>',
}); });
export const Warning = SlotTemplate.bind({}); export const Warning = SlotTemplate.bind({});

View file

@ -60,8 +60,10 @@ export const Sticky = Template.bind({});
Sticky.args = { Sticky.args = {
height: 160, height: 160,
width: 150, width: 150,
content: `## I'm a note \n**Double click** to edit me. [Guide](https://docs.n8n.io/workflows/sticky-notes/)`, content:
defaultText: `## I'm a note \n**Double click** to edit me. [Guide](https://docs.n8n.io/workflows/sticky-notes/)`, "## I'm a note \n**Double click** to edit me. [Guide](https://docs.n8n.io/workflows/sticky-notes/)",
defaultText:
"## I'm a note \n**Double click** to edit me. [Guide](https://docs.n8n.io/workflows/sticky-notes/)",
minHeight: 80, minHeight: 80,
minWidth: 150, minWidth: 150,
readOnly: false, readOnly: false,

View file

@ -10,7 +10,7 @@ const Template: StoryFn = (args, { argTypes }) => ({
components: { components: {
SpacingPreview, SpacingPreview,
}, },
template: `<spacing-preview v-bind="$props" />`, template: '<spacing-preview v-bind="$props" />',
}); });
export const Padding = Template.bind({}); export const Padding = Template.bind({});

View file

@ -29,7 +29,7 @@ export async function createNewCredential(
context: IRestApiContext, context: IRestApiContext,
data: ICredentialsDecrypted, data: ICredentialsDecrypted,
): Promise<ICredentialsResponse> { ): Promise<ICredentialsResponse> {
return makeRestApiRequest(context, 'POST', `/credentials`, data as unknown as IDataObject); return makeRestApiRequest(context, 'POST', '/credentials', data as unknown as IDataObject);
} }
export async function deleteCredential(context: IRestApiContext, id: string): Promise<boolean> { export async function deleteCredential(context: IRestApiContext, id: string): Promise<boolean> {
@ -61,7 +61,7 @@ export async function oAuth1CredentialAuthorize(
return makeRestApiRequest( return makeRestApiRequest(
context, context,
'GET', 'GET',
`/oauth1-credential/auth`, '/oauth1-credential/auth',
data as unknown as IDataObject, data as unknown as IDataObject,
); );
} }
@ -74,7 +74,7 @@ export async function oAuth2CredentialAuthorize(
return makeRestApiRequest( return makeRestApiRequest(
context, context,
'GET', 'GET',
`/oauth2-credential/auth`, '/oauth2-credential/auth',
data as unknown as IDataObject, data as unknown as IDataObject,
); );
} }

View file

@ -88,14 +88,14 @@ export function updateCurrentUser(
context: IRestApiContext, context: IRestApiContext,
params: { id: string; firstName: string; lastName: string; email: string }, params: { id: string; firstName: string; lastName: string; email: string },
): Promise<IUserResponse> { ): Promise<IUserResponse> {
return makeRestApiRequest(context, 'PATCH', `/me`, params as unknown as IDataObject); return makeRestApiRequest(context, 'PATCH', '/me', params as unknown as IDataObject);
} }
export function updateCurrentUserPassword( export function updateCurrentUserPassword(
context: IRestApiContext, context: IRestApiContext,
params: { newPassword: string; currentPassword: string }, params: { newPassword: string; currentPassword: string },
): Promise<void> { ): Promise<void> {
return makeRestApiRequest(context, 'PATCH', `/me/password`, params); return makeRestApiRequest(context, 'PATCH', '/me/password', params);
} }
export async function deleteUser( export async function deleteUser(

View file

@ -3,7 +3,7 @@ import { IDataObject } from 'n8n-workflow';
import { makeRestApiRequest } from '@/utils'; import { makeRestApiRequest } from '@/utils';
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 } : {});
return { return {
name: response.name, name: response.name,
onboardingFlowEnabled: response.onboardingFlowEnabled === true, onboardingFlowEnabled: response.onboardingFlowEnabled === true,
@ -13,11 +13,11 @@ export async function getNewWorkflow(context: IRestApiContext, name?: string) {
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 await makeRestApiRequest(context, 'GET', '/workflows', sendData);
} }
export async function getActiveWorkflows(context: IRestApiContext) { export async function getActiveWorkflows(context: IRestApiContext) {
return await makeRestApiRequest(context, 'GET', `/active`); return await makeRestApiRequest(context, 'GET', '/active');
} }
export async function getCurrentExecutions(context: IRestApiContext, filter: IDataObject) { export async function getCurrentExecutions(context: IRestApiContext, filter: IDataObject) {

View file

@ -122,11 +122,11 @@ export default mixins(genericHelpers, workflowHelpers).extend({
const proxy = dataProxy.getDataProxy(); const proxy = dataProxy.getDataProxy();
const autoCompleteItems = [ const autoCompleteItems = [
`function $evaluateExpression(expression: string, itemIndex?: number): any {};`, 'function $evaluateExpression(expression: string, itemIndex?: number): any {};',
`function getNodeParameter(parameterName: string, itemIndex: number, fallbackValue?: any): any {};`, 'function getNodeParameter(parameterName: string, itemIndex: number, fallbackValue?: any): any {};',
`function getWorkflowStaticData(type: string): {};`, 'function getWorkflowStaticData(type: string): {};',
`function $item(itemIndex: number, runIndex?: number): {};`, 'function $item(itemIndex: number, runIndex?: number): {};',
`function $items(nodeName?: string, outputIndex?: number, runIndex?: number): {};`, 'function $items(nodeName?: string, outputIndex?: number, runIndex?: number): {};',
]; ];
const baseKeys = [ const baseKeys = [
@ -194,7 +194,7 @@ export default mixins(genericHelpers, workflowHelpers).extend({
} catch (error) {} } catch (error) {}
} }
autoCompleteItems.push(`const $node = ${JSON.stringify(nodes)}`); autoCompleteItems.push(`const $node = ${JSON.stringify(nodes)}`);
autoCompleteItems.push(`function $jmespath(jsonDoc: object, query: string): {};`); autoCompleteItems.push('function $jmespath(jsonDoc: object, query: string): {};');
if (this.codeAutocomplete === 'function') { if (this.codeAutocomplete === 'function') {
if (connectionInputData) { if (connectionInputData) {
@ -204,13 +204,13 @@ export default mixins(genericHelpers, workflowHelpers).extend({
)}`, )}`,
); );
} else { } else {
autoCompleteItems.push(`const items: {json: {[key: string]: any}}[] = []`); autoCompleteItems.push('const items: {json: {[key: string]: any}}[] = []');
} }
} else if (this.codeAutocomplete === 'functionItem') { } else if (this.codeAutocomplete === 'functionItem') {
if (connectionInputData) { if (connectionInputData) {
autoCompleteItems.push(`const item = $json`); autoCompleteItems.push('const item = $json');
} else { } else {
autoCompleteItems.push(`const item: {[key: string]: any} = {}`); autoCompleteItems.push('const item: {[key: string]: any} = {}');
} }
} }

View file

@ -919,7 +919,8 @@ export default mixins(showMessage, nodeHelpers).extend({
return; return;
} }
const params = `scrollbars=no,resizable=yes,status=no,titlebar=noe,location=no,toolbar=no,menubar=no,width=500,height=700`; const params =
'scrollbars=no,resizable=yes,status=no,titlebar=noe,location=no,toolbar=no,menubar=no,width=500,height=700';
const oauthPopup = window.open(url, 'OAuth2 Authorization', params); const oauthPopup = window.open(url, 'OAuth2 Authorization', params);
Vue.set(this.credentialData, 'oauthTokenData', null); Vue.set(this.credentialData, 'oauthTokenData', null);

View file

@ -339,7 +339,7 @@ export default mixins(
nodeTitle(): string { nodeTitle(): string {
if (this.data.name === 'Start') { if (this.data.name === 'Start') {
return this.$locale.headerText({ return this.$locale.headerText({
key: `headers.start.displayName`, key: 'headers.start.displayName',
fallback: 'Start', fallback: 'Start',
}); });
} }

View file

@ -132,7 +132,7 @@ export default mixins(genericHelpers, nodeHelpers, pinData, copyPaste).extend({
let startPath = `$node["${this.node!.name}"].json`; let startPath = `$node["${this.node!.name}"].json`;
if (this.distanceFromActive === 1) { if (this.distanceFromActive === 1) {
startPath = `$json`; startPath = '$json';
} }
return { path, startPath }; return { path, startPath };

View file

@ -68,9 +68,11 @@ import { mapStores } from 'pinia';
import { useSettingsStore } from '@/stores/settings'; import { useSettingsStore } from '@/stores/settings';
import { useRootStore } from '@/stores/n8nRootStore'; import { useRootStore } from '@/stores/n8nRootStore';
const DEFAULT_TITLE = `How likely are you to recommend n8n to a friend or colleague?`; const DEFAULT_TITLE = 'How likely are you to recommend n8n to a friend or colleague?';
const GREAT_FEEDBACK_TITLE = `Great to hear! Can we reach out to see how we can make n8n even better for you?`; const GREAT_FEEDBACK_TITLE =
const DEFAULT_FEEDBACK_TITLE = `Thanks for your feedback! We'd love to understand how we can improve. Can we reach out?`; 'Great to hear! Can we reach out to see how we can make n8n even better for you?';
const DEFAULT_FEEDBACK_TITLE =
"Thanks for your feedback! We'd love to understand how we can improve. Can we reach out?";
export default mixins(workflowHelpers).extend({ export default mixins(workflowHelpers).extend({
name: 'ValueSurvey', name: 'ValueSurvey',
@ -164,7 +166,8 @@ export default mixins(workflowHelpers).extend({
}); });
this.$showMessage({ this.$showMessage({
title: 'Thanks for your feedback', title: 'Thanks for your feedback',
message: `If youd like to help even more, leave us a <a target="_blank" href="https://www.g2.com/products/n8n/reviews/start">review on G2</a>.`, message:
'If youd like to help even more, leave us a <a target="_blank" href="https://www.g2.com/products/n8n/reviews/start">review on G2</a>.',
type: 'success', type: 'success',
duration: 15000, duration: 15000,
}); });

View file

@ -450,7 +450,7 @@ export default mixins(externalHooks, genericHelpers, restApi, showMessage).exten
if (!this.workflowId || this.workflowId === PLACEHOLDER_EMPTY_WORKFLOW_ID) { if (!this.workflowId || this.workflowId === PLACEHOLDER_EMPTY_WORKFLOW_ID) {
this.$showMessage({ this.$showMessage({
title: 'No workflow active', title: 'No workflow active',
message: `No workflow active to display settings of.`, message: 'No workflow active to display settings of.',
type: 'error', type: 'error',
duration: 0, duration: 0,
}); });

View file

@ -370,7 +370,7 @@ export default mixins(showMessage).extend({
if (!isNewSharee && isLastUserWithAccessToCredentials) { if (!isNewSharee && isLastUserWithAccessToCredentials) {
confirm = await this.confirmMessage( confirm = await this.confirmMessage(
this.$locale.baseText( this.$locale.baseText(
`workflows.shareModal.list.delete.confirm.lastUserWithAccessToCredentials.message`, 'workflows.shareModal.list.delete.confirm.lastUserWithAccessToCredentials.message',
{ {
interpolate: { name: user.fullName as string, workflow: this.workflow.name }, interpolate: { name: user.fullName as string, workflow: this.workflow.name },
}, },

View file

@ -56,15 +56,16 @@ export const BREAKPOINT_MD = 992;
export const BREAKPOINT_LG = 1200; export const BREAKPOINT_LG = 1200;
export const BREAKPOINT_XL = 1920; export const BREAKPOINT_XL = 1920;
export const N8N_IO_BASE_URL = `https://api.n8n.io/api/`; export const N8N_IO_BASE_URL = 'https://api.n8n.io/api/';
export const DOCS_DOMAIN = 'docs.n8n.io'; export const DOCS_DOMAIN = 'docs.n8n.io';
export const BUILTIN_NODES_DOCS_URL = `https://${DOCS_DOMAIN}/integrations/builtin/`; export const BUILTIN_NODES_DOCS_URL = `https://${DOCS_DOMAIN}/integrations/builtin/`;
export const BUILTIN_CREDENTIALS_DOCS_URL = `https://${DOCS_DOMAIN}/integrations/builtin/credentials/`; export const BUILTIN_CREDENTIALS_DOCS_URL = `https://${DOCS_DOMAIN}/integrations/builtin/credentials/`;
export const DATA_PINNING_DOCS_URL = `https://${DOCS_DOMAIN}/data/data-pinning/`; export const DATA_PINNING_DOCS_URL = `https://${DOCS_DOMAIN}/data/data-pinning/`;
export const DATA_EDITING_DOCS_URL = `https://${DOCS_DOMAIN}/data/data-editing/`; export const DATA_EDITING_DOCS_URL = `https://${DOCS_DOMAIN}/data/data-editing/`;
export const NPM_COMMUNITY_NODE_SEARCH_API_URL = `https://api.npms.io/v2/`; export const NPM_COMMUNITY_NODE_SEARCH_API_URL = 'https://api.npms.io/v2/';
export const NPM_PACKAGE_DOCS_BASE_URL = `https://www.npmjs.com/package/`; export const NPM_PACKAGE_DOCS_BASE_URL = 'https://www.npmjs.com/package/';
export const NPM_KEYWORD_SEARCH_URL = `https://www.npmjs.com/search?q=keywords%3An8n-community-node-package`; export const NPM_KEYWORD_SEARCH_URL =
'https://www.npmjs.com/search?q=keywords%3An8n-community-node-package';
export const N8N_QUEUE_MODE_DOCS_URL = `https://${DOCS_DOMAIN}/hosting/scaling/queue-mode/`; export const N8N_QUEUE_MODE_DOCS_URL = `https://${DOCS_DOMAIN}/hosting/scaling/queue-mode/`;
export const COMMUNITY_NODES_INSTALLATION_DOCS_URL = `https://${DOCS_DOMAIN}/integrations/community-nodes/installation/`; export const COMMUNITY_NODES_INSTALLATION_DOCS_URL = `https://${DOCS_DOMAIN}/integrations/community-nodes/installation/`;
export const COMMUNITY_NODES_NPM_INSTALLATION_URL = export const COMMUNITY_NODES_NPM_INSTALLATION_URL =

View file

@ -113,7 +113,7 @@ export const historyHelper = mixins(debounceHelper, deviceSupportHelpers).extend
if (this.isNDVOpen && !event.shiftKey) { if (this.isNDVOpen && !event.shiftKey) {
const activeNode = this.ndvStore.activeNode; const activeNode = this.ndvStore.activeNode;
if (activeNode) { if (activeNode) {
this.$telemetry.track(`User hit undo in NDV`, { node_type: activeNode.type }); this.$telemetry.track('User hit undo in NDV', { node_type: activeNode.type });
} }
} }
}, },

View file

@ -22,7 +22,7 @@ export const newVersions = mixins(showMessage).extend({
const nextVersions = this.versionsStore.nextVersions; const nextVersions = this.versionsStore.nextVersions;
if (currentVersion && currentVersion.hasSecurityIssue && nextVersions.length) { if (currentVersion && currentVersion.hasSecurityIssue && nextVersions.length) {
const fixVersion = currentVersion.securityIssueFixVersion; const fixVersion = currentVersion.securityIssueFixVersion;
let message = `Please update to latest version.`; let message = 'Please update to latest version.';
if (fixVersion) { if (fixVersion) {
message = `Please update to version ${fixVersion} or higher.`; message = `Please update to version ${fixVersion} or higher.`;
} }

View file

@ -70,7 +70,7 @@ export const restApi = Vue.extend({
return makeRestApiRequest(self.rootStore.getRestApiContext, method, endpoint, data); return makeRestApiRequest(self.rootStore.getRestApiContext, method, endpoint, data);
}, },
getActiveWorkflows: (): Promise<string[]> => { getActiveWorkflows: (): Promise<string[]> => {
return self.restApi().makeRestApiRequest('GET', `/active`); return self.restApi().makeRestApiRequest('GET', '/active');
}, },
getActivationError: (id: string): Promise<IActivationError | undefined> => { getActivationError: (id: string): Promise<IActivationError | undefined> => {
return self.restApi().makeRestApiRequest('GET', `/active/error/${id}`); return self.restApi().makeRestApiRequest('GET', `/active/error/${id}`);
@ -82,7 +82,7 @@ export const restApi = Vue.extend({
filter, filter,
}; };
} }
return self.restApi().makeRestApiRequest('GET', `/executions-current`, sendData); return self.restApi().makeRestApiRequest('GET', '/executions-current', sendData);
}, },
stopCurrentExecution: (executionId: string): Promise<IExecutionsStopData> => { stopCurrentExecution: (executionId: string): Promise<IExecutionsStopData> => {
return self return self
@ -103,12 +103,12 @@ export const restApi = Vue.extend({
// Execute a workflow // Execute a workflow
runWorkflow: async (startRunData: IStartRunData): Promise<IExecutionPushResponse> => { runWorkflow: async (startRunData: IStartRunData): Promise<IExecutionPushResponse> => {
return self.restApi().makeRestApiRequest('POST', `/workflows/run`, startRunData); return self.restApi().makeRestApiRequest('POST', '/workflows/run', startRunData);
}, },
// Creates a new workflow // Creates a new workflow
createNewWorkflow: (sendData: IWorkflowDataUpdate): Promise<IWorkflowDb> => { createNewWorkflow: (sendData: IWorkflowDataUpdate): Promise<IWorkflowDb> => {
return self.restApi().makeRestApiRequest('POST', `/workflows`, sendData); return self.restApi().makeRestApiRequest('POST', '/workflows', sendData);
}, },
// Updates an existing workflow // Updates an existing workflow
@ -144,12 +144,12 @@ export const restApi = Vue.extend({
filter, filter,
}; };
} }
return self.restApi().makeRestApiRequest('GET', `/workflows`, sendData); return self.restApi().makeRestApiRequest('GET', '/workflows', sendData);
}, },
// Returns a workflow from a given URL // Returns a workflow from a given URL
getWorkflowFromUrl: (url: string): Promise<IWorkflowDb> => { getWorkflowFromUrl: (url: string): Promise<IWorkflowDb> => {
return self.restApi().makeRestApiRequest('GET', `/workflows/from-url`, { url }); return self.restApi().makeRestApiRequest('GET', '/workflows/from-url', { url });
}, },
// Returns the execution with the given name // Returns the execution with the given name
@ -160,7 +160,7 @@ export const restApi = Vue.extend({
// Deletes executions // Deletes executions
deleteExecutions: (sendData: IExecutionDeleteFilter): Promise<void> => { deleteExecutions: (sendData: IExecutionDeleteFilter): Promise<void> => {
return self.restApi().makeRestApiRequest('POST', `/executions/delete`, sendData); return self.restApi().makeRestApiRequest('POST', '/executions/delete', sendData);
}, },
// Returns the execution with the given name // Returns the execution with the given name
@ -192,12 +192,12 @@ export const restApi = Vue.extend({
}; };
} }
return self.restApi().makeRestApiRequest('GET', `/executions`, sendData); return self.restApi().makeRestApiRequest('GET', '/executions', sendData);
}, },
// Returns all the available timezones // Returns all the available timezones
getTimezones: (): Promise<IDataObject> => { getTimezones: (): Promise<IDataObject> => {
return self.restApi().makeRestApiRequest('GET', `/options/timezones`); return self.restApi().makeRestApiRequest('GET', '/options/timezones');
}, },
// Binary data // Binary data

View file

@ -22,7 +22,7 @@ export const titleChange = Vue.extend({
}, },
$titleReset() { $titleReset() {
document.title = `n8n - Workflow Automation`; document.title = 'n8n - Workflow Automation';
}, },
}, },
}); });

View file

@ -22,7 +22,7 @@ describe('Utils', () => {
[1, false], [1, false],
[false, true], [false, true],
[true, false], [true, false],
])(`for value %s should return %s`, (value, expected) => { ])('for value %s should return %s', (value, expected) => {
expect(isEmpty(value)).toBe(expected); expect(isEmpty(value)).toBe(expected);
}); });
}); });
@ -212,7 +212,7 @@ describe('Utils', () => {
{ overwriteArrays: true }, { overwriteArrays: true },
{ a: 3, b: [{ z: 'c' }], c: '2', d: '3' }, { a: 3, b: [{ z: 'c' }], c: '2', d: '3' },
], ],
])(`case %#. input %j, options %j should return %j`, (sources, options, expected) => { ])('case %#. input %j, options %j should return %j', (sources, options, expected) => {
expect(mergeDeep([...sources], options)).toEqual(expected); expect(mergeDeep([...sources], options)).toEqual(expected);
}); });
}); });

View file

@ -381,11 +381,11 @@ export const showOrHideItemsLabel = (connection: Connection) => {
export const getIcon = (name: string): string => { export const getIcon = (name: string): string => {
if (name === 'trash') { if (name === 'trash') {
return `<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="trash" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" class="svg-inline--fa fa-trash fa-w-14 Icon__medium_ctPPJ"><path data-v-66d5c7e2="" fill="currentColor" d="M432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16zM53.2 467a48 48 0 0 0 47.9 45h245.8a48 48 0 0 0 47.9-45L416 128H32z" class=""></path></svg>`; return '<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="trash" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" class="svg-inline--fa fa-trash fa-w-14 Icon__medium_ctPPJ"><path data-v-66d5c7e2="" fill="currentColor" d="M432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16zM53.2 467a48 48 0 0 0 47.9 45h245.8a48 48 0 0 0 47.9-45L416 128H32z" class=""></path></svg>';
} }
if (name === 'plus') { if (name === 'plus') {
return `<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="plus" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" class="svg-inline--fa fa-plus fa-w-14 Icon__medium_ctPPJ"><path data-v-301ed208="" fill="currentColor" d="M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z" class=""></path></svg>`; return '<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="plus" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" class="svg-inline--fa fa-plus fa-w-14 Icon__medium_ctPPJ"><path data-v-301ed208="" fill="currentColor" d="M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z" class=""></path></svg>';
} }
return ''; return '';

View file

@ -238,7 +238,7 @@ export const getSchema = (input: Optional<Primitives | object>, path = ''): Sche
} }
break; break;
case 'function': case 'function':
schema = { type: 'function', value: ``, path }; schema = { type: 'function', value: '', path };
break; break;
default: default:
schema = { type: typeof input, value: String(input), path }; schema = { type: typeof input, value: String(input), path };

View file

@ -139,7 +139,7 @@ export default mixins(workflowHelpers).extend({
if (collection) { if (collection) {
setPageTitle(`n8n - Template collection: ${collection.name}`); setPageTitle(`n8n - Template collection: ${collection.name}`);
} else { } else {
setPageTitle(`n8n - Templates`); setPageTitle('n8n - Templates');
} }
}, },
}, },

View file

@ -127,7 +127,7 @@ export default mixins(workflowHelpers).extend({
if (template) { if (template) {
setPageTitle(`n8n - Template template: ${template.name}`); setPageTitle(`n8n - Template template: ${template.name}`);
} else { } else {
setPageTitle(`n8n - Templates`); setPageTitle('n8n - Templates');
} }
}, },
}, },

View file

@ -7,9 +7,9 @@ export class Build extends Command {
static description = 'Builds credentials and nodes and copies it to n8n custom extension folder'; static description = 'Builds credentials and nodes and copies it to n8n custom extension folder';
static examples = [ static examples = [
`$ n8n-node-dev build`, '$ n8n-node-dev build',
`$ n8n-node-dev build --destination ~/n8n-nodes`, '$ n8n-node-dev build --destination ~/n8n-nodes',
`$ n8n-node-dev build --watch`, '$ n8n-node-dev build --watch',
]; ];
static flags = { static flags = {

View file

@ -18,7 +18,7 @@ const fsAccess = promisify(fs.access);
export class New extends Command { export class New extends Command {
static description = 'Create new credentials/node'; static description = 'Create new credentials/node';
static examples = [`$ n8n-node-dev new`]; static examples = ['$ n8n-node-dev new'];
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
async run() { async run() {

View file

@ -39,7 +39,7 @@ export class BeeminderApi implements ICredentialType {
test: ICredentialTestRequest = { test: ICredentialTestRequest = {
request: { request: {
baseURL: 'https://www.beeminder.com/api/v1', baseURL: 'https://www.beeminder.com/api/v1',
url: `=/users/{{$credentials.user}}.json`, url: '=/users/{{$credentials.user}}.json',
}, },
}; };
} }

View file

@ -40,7 +40,7 @@ export class GhostAdminApi implements ICredentialType {
keyid: id, keyid: id,
algorithm: 'HS256', algorithm: 'HS256',
expiresIn: '5m', expiresIn: '5m',
audience: `/v2/admin/`, audience: '/v2/admin/',
}); });
requestOptions.headers = { requestOptions.headers = {

View file

@ -48,7 +48,7 @@ export class MailjetEmailApi implements ICredentialType {
test: ICredentialTestRequest = { test: ICredentialTestRequest = {
request: { request: {
baseURL: `https://api.mailjet.com`, baseURL: 'https://api.mailjet.com',
url: '/v3/REST/template', url: '/v3/REST/template',
method: 'GET', method: 'GET',
}, },

View file

@ -32,7 +32,7 @@ export class MailjetSmsApi implements ICredentialType {
test: ICredentialTestRequest = { test: ICredentialTestRequest = {
request: { request: {
baseURL: `https://api.mailjet.com`, baseURL: 'https://api.mailjet.com',
url: '/v4/sms', url: '/v4/sms',
method: 'GET', method: 'GET',
}, },

View file

@ -66,7 +66,7 @@ export class TheHiveApi implements ICredentialType {
test: ICredentialTestRequest = { test: ICredentialTestRequest = {
request: { request: {
baseURL: `={{$credentials?.url}}`, baseURL: '={{$credentials?.url}}',
url: '/api/case', url: '/api/case',
}, },
}; };

View file

@ -402,7 +402,7 @@ export class ActiveCampaign implements INodeType {
dataKey = 'contacts'; dataKey = 'contacts';
} }
endpoint = `/api/3/contacts`; endpoint = '/api/3/contacts';
} else if (operation === 'update') { } else if (operation === 'update') {
// ---------------------------------- // ----------------------------------
// contact:update // contact:update
@ -479,7 +479,7 @@ export class ActiveCampaign implements INodeType {
dataKey = 'accounts'; dataKey = 'accounts';
} }
endpoint = `/api/3/accounts`; endpoint = '/api/3/accounts';
const filters = this.getNodeParameter('filters', i); const filters = this.getNodeParameter('filters', i);
Object.assign(qs, filters); Object.assign(qs, filters);
@ -648,7 +648,7 @@ export class ActiveCampaign implements INodeType {
dataKey = 'lists'; dataKey = 'lists';
} }
endpoint = `/api/3/lists`; endpoint = '/api/3/lists';
} }
} else if (resource === 'tag') { } else if (resource === 'tag') {
if (operation === 'create') { if (operation === 'create') {
@ -704,7 +704,7 @@ export class ActiveCampaign implements INodeType {
dataKey = 'tags'; dataKey = 'tags';
} }
endpoint = `/api/3/tags`; endpoint = '/api/3/tags';
} else if (operation === 'update') { } else if (operation === 'update') {
// ---------------------------------- // ----------------------------------
// tags:update // tags:update
@ -811,7 +811,7 @@ export class ActiveCampaign implements INodeType {
dataKey = 'deals'; dataKey = 'deals';
} }
endpoint = `/api/3/deals`; endpoint = '/api/3/deals';
} else if (operation === 'createNote') { } else if (operation === 'createNote') {
// ---------------------------------- // ----------------------------------
// deal:createNote // deal:createNote
@ -910,7 +910,7 @@ export class ActiveCampaign implements INodeType {
dataKey = 'connections'; dataKey = 'connections';
} }
endpoint = `/api/3/connections`; endpoint = '/api/3/connections';
} else { } else {
throw new NodeOperationError( throw new NodeOperationError(
this.getNode(), this.getNode(),
@ -1010,7 +1010,7 @@ export class ActiveCampaign implements INodeType {
dataKey = 'ecomOrders'; dataKey = 'ecomOrders';
} }
endpoint = `/api/3/ecomOrders`; endpoint = '/api/3/ecomOrders';
} else { } else {
throw new NodeOperationError( throw new NodeOperationError(
this.getNode(), this.getNode(),
@ -1099,7 +1099,7 @@ export class ActiveCampaign implements INodeType {
dataKey = 'ecomCustomers'; dataKey = 'ecomCustomers';
} }
endpoint = `/api/3/ecomCustomers`; endpoint = '/api/3/ecomCustomers';
} else { } else {
throw new NodeOperationError( throw new NodeOperationError(
this.getNode(), this.getNode(),
@ -1145,7 +1145,7 @@ export class ActiveCampaign implements INodeType {
dataKey = 'ecomOrderProducts'; dataKey = 'ecomOrderProducts';
} }
endpoint = `/api/3/ecomOrderProducts`; endpoint = '/api/3/ecomOrderProducts';
} else { } else {
throw new NodeOperationError( throw new NodeOperationError(
this.getNode(), this.getNode(),

View file

@ -132,7 +132,7 @@ export class Affinity implements INodeType {
// select them easily // select them easily
async getLists(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> { async getLists(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
const returnData: INodePropertyOptions[] = []; const returnData: INodePropertyOptions[] = [];
const lists = await affinityApiRequest.call(this, 'GET', `/lists`); const lists = await affinityApiRequest.call(this, 'GET', '/lists');
for (const list of lists) { for (const list of lists) {
returnData.push({ returnData.push({
name: list.name, name: list.name,
@ -163,7 +163,7 @@ export class Affinity implements INodeType {
//https://api-docs.affinity.co/#get-all-lists //https://api-docs.affinity.co/#get-all-lists
if (operation === 'getAll') { if (operation === 'getAll') {
const returnAll = this.getNodeParameter('returnAll', i); const returnAll = this.getNodeParameter('returnAll', i);
responseData = await affinityApiRequest.call(this, 'GET', `/lists`, {}, qs); responseData = await affinityApiRequest.call(this, 'GET', '/lists', {}, qs);
if (!returnAll) { if (!returnAll) {
const limit = this.getNodeParameter('limit', i); const limit = this.getNodeParameter('limit', i);
responseData = responseData.splice(0, limit); responseData = responseData.splice(0, limit);

View file

@ -172,7 +172,7 @@ export class AgileCrm implements INodeType {
responseData = await agileCrmApiRequestAllItems.call( responseData = await agileCrmApiRequestAllItems.call(
this, this,
'POST', 'POST',
`api/filters/filter/dynamic-filter`, 'api/filters/filter/dynamic-filter',
body, body,
undefined, undefined,
undefined, undefined,
@ -183,7 +183,7 @@ export class AgileCrm implements INodeType {
responseData = await agileCrmApiRequest.call( responseData = await agileCrmApiRequest.call(
this, this,
'POST', 'POST',
`api/filters/filter/dynamic-filter`, 'api/filters/filter/dynamic-filter',
body, body,
undefined, undefined,
undefined, undefined,

View file

@ -188,7 +188,8 @@ export class ApiTemplateIo implements INodeType {
jsonParameters: [true], jsonParameters: [true],
}, },
}, },
placeholder: `[ {"name": "text_1", "text": "hello world", "textBackgroundColor": "rgba(246, 243, 243, 0)" } ]`, placeholder:
'[ {"name": "text_1", "text": "hello world", "textBackgroundColor": "rgba(246, 243, 243, 0)" } ]',
}, },
{ {
displayName: 'Properties (JSON)', displayName: 'Properties (JSON)',
@ -202,7 +203,7 @@ export class ApiTemplateIo implements INodeType {
jsonParameters: [true], jsonParameters: [true],
}, },
}, },
placeholder: `{ "name": "text_1" }`, placeholder: '{ "name": "text_1" }',
}, },
{ {
displayName: 'Overrides', displayName: 'Overrides',

View file

@ -1860,7 +1860,7 @@ export class Asana implements INodeType {
// Get all users to display them to user so that they can be selected easily // Get all users to display them to user so that they can be selected easily
// See: https://developers.asana.com/docs/get-multiple-users // See: https://developers.asana.com/docs/get-multiple-users
async getUsers(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> { async getUsers(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
const endpoint = `/users`; const endpoint = '/users';
const responseData = await asanaApiRequest.call(this, 'GET', endpoint, {}); const responseData = await asanaApiRequest.call(this, 'GET', endpoint, {});
if (responseData.data === undefined) { if (responseData.data === undefined) {
@ -2026,7 +2026,7 @@ export class Asana implements INodeType {
const returnAll = this.getNodeParameter('returnAll', i); const returnAll = this.getNodeParameter('returnAll', i);
requestMethod = 'GET'; requestMethod = 'GET';
endpoint = `/tasks`; endpoint = '/tasks';
Object.assign(qs, filters); Object.assign(qs, filters);
@ -2335,7 +2335,7 @@ export class Asana implements INodeType {
const returnAll = this.getNodeParameter('returnAll', i); const returnAll = this.getNodeParameter('returnAll', i);
requestMethod = 'GET'; requestMethod = 'GET';
endpoint = `/projects`; endpoint = '/projects';
if (additionalFields.team) { if (additionalFields.team) {
qs.team = additionalFields.team; qs.team = additionalFields.team;

View file

@ -152,7 +152,7 @@ export class AsanaTrigger implements INodeType {
const resource = this.getNodeParameter('resource') as string; const resource = this.getNodeParameter('resource') as string;
const endpoint = `/webhooks`; const endpoint = '/webhooks';
const body = { const body = {
resource, resource,

View file

@ -74,7 +74,7 @@ export class Automizy implements INodeType {
this, this,
'smartLists', 'smartLists',
'GET', 'GET',
`/smart-lists`, '/smart-lists',
); );
for (const list of lists) { for (const list of lists) {
returnData.push({ returnData.push({
@ -272,7 +272,7 @@ export class Automizy implements INodeType {
name, name,
}; };
responseData = await automizyApiRequest.call(this, 'POST', `/smart-lists`, body); responseData = await automizyApiRequest.call(this, 'POST', '/smart-lists', body);
responseData = this.helpers.constructExecutionMetaData( responseData = this.helpers.constructExecutionMetaData(
this.helpers.returnJsonArray(responseData), this.helpers.returnJsonArray(responseData),
{ itemData: { item: i } }, { itemData: { item: i } },
@ -319,14 +319,14 @@ export class Automizy implements INodeType {
this, this,
'smartLists', 'smartLists',
'GET', 'GET',
`/smart-lists`, '/smart-lists',
{}, {},
qs, qs,
); );
} else { } else {
qs.limit = this.getNodeParameter('limit', i); qs.limit = this.getNodeParameter('limit', i);
responseData = await automizyApiRequest.call(this, 'GET', `/smart-lists`, {}, qs); responseData = await automizyApiRequest.call(this, 'GET', '/smart-lists', {}, qs);
responseData = responseData.smartLists; responseData = responseData.smartLists;
} }

View file

@ -169,7 +169,7 @@ export class Autopilot implements INodeType {
delete body.newEmail; delete body.newEmail;
} }
responseData = await autopilotApiRequest.call(this, 'POST', `/contact`, { responseData = await autopilotApiRequest.call(this, 'POST', '/contact', {
contact: body, contact: body,
}); });
} }
@ -198,7 +198,7 @@ export class Autopilot implements INodeType {
this, this,
'contacts', 'contacts',
'GET', 'GET',
`/contacts`, '/contacts',
{}, {},
qs, qs,
); );
@ -280,7 +280,7 @@ export class Autopilot implements INodeType {
name, name,
}; };
responseData = await autopilotApiRequest.call(this, 'POST', `/list`, body); responseData = await autopilotApiRequest.call(this, 'POST', '/list', body);
} }
if (operation === 'getAll') { if (operation === 'getAll') {

View file

@ -18,7 +18,7 @@ import { get } from 'lodash';
export class AwsSnsTrigger implements INodeType { export class AwsSnsTrigger implements INodeType {
description: INodeTypeDescription = { description: INodeTypeDescription = {
displayName: 'AWS SNS Trigger', displayName: 'AWS SNS Trigger',
subtitle: `={{$parameter["topic"].split(':')[5]}}`, subtitle: '={{$parameter["topic"].split(\':\')[5]}}',
name: 'awsSnsTrigger', name: 'awsSnsTrigger',
icon: 'file:sns.svg', icon: 'file:sns.svg',
group: ['trigger'], group: ['trigger'],

View file

@ -66,7 +66,7 @@ export class AwsCertificateManager implements INodeType {
responseData = await awsApiRequestREST.call( responseData = await awsApiRequestREST.call(
this, this,
`acm`, 'acm',
'POST', 'POST',
'', '',
JSON.stringify(body), JSON.stringify(body),
@ -90,7 +90,7 @@ export class AwsCertificateManager implements INodeType {
responseData = await awsApiRequestREST.call( responseData = await awsApiRequestREST.call(
this, this,
`acm`, 'acm',
'POST', 'POST',
'', '',
JSON.stringify(body), JSON.stringify(body),
@ -148,7 +148,7 @@ export class AwsCertificateManager implements INodeType {
body.MaxItems = this.getNodeParameter('limit', 0); body.MaxItems = this.getNodeParameter('limit', 0);
responseData = await awsApiRequestREST.call( responseData = await awsApiRequestREST.call(
this, this,
`acm`, 'acm',
'POST', 'POST',
'', '',
JSON.stringify(body), JSON.stringify(body),
@ -172,7 +172,7 @@ export class AwsCertificateManager implements INodeType {
responseData = await awsApiRequestREST.call( responseData = await awsApiRequestREST.call(
this, this,
`acm`, 'acm',
'POST', 'POST',
'', '',
JSON.stringify(body), JSON.stringify(body),
@ -196,7 +196,7 @@ export class AwsCertificateManager implements INodeType {
responseData = await awsApiRequestREST.call( responseData = await awsApiRequestREST.call(
this, this,
`acm`, 'acm',
'POST', 'POST',
'', '',
JSON.stringify(body), JSON.stringify(body),

View file

@ -845,7 +845,7 @@ export class AwsSes implements INodeType {
const templateSubject = this.getNodeParameter('templateSubject', i) as string; const templateSubject = this.getNodeParameter('templateSubject', i) as string;
const params = [ const params = [
`Action=CreateCustomVerificationEmailTemplate`, 'Action=CreateCustomVerificationEmailTemplate',
`FailureRedirectionURL=${failureRedirectionURL}`, `FailureRedirectionURL=${failureRedirectionURL}`,
`FromEmailAddress=${email}`, `FromEmailAddress=${email}`,
`SuccessRedirectionURL=${successRedirectionURL}`, `SuccessRedirectionURL=${successRedirectionURL}`,
@ -869,7 +869,7 @@ export class AwsSes implements INodeType {
const templateName = this.getNodeParameter('templateName', i) as string; const templateName = this.getNodeParameter('templateName', i) as string;
const params = [ const params = [
`Action=DeleteCustomVerificationEmailTemplate`, 'Action=DeleteCustomVerificationEmailTemplate',
`TemplateName=${templateName}`, `TemplateName=${templateName}`,
]; ];
@ -935,7 +935,7 @@ export class AwsSes implements INodeType {
const additionalFields = this.getNodeParameter('additionalFields', i); const additionalFields = this.getNodeParameter('additionalFields', i);
const params = [ const params = [
`Action=SendCustomVerificationEmail`, 'Action=SendCustomVerificationEmail',
`TemplateName=${templateName}`, `TemplateName=${templateName}`,
`EmailAddress=${email}`, `EmailAddress=${email}`,
]; ];
@ -961,7 +961,7 @@ export class AwsSes implements INodeType {
const updateFields = this.getNodeParameter('updateFields', i); const updateFields = this.getNodeParameter('updateFields', i);
const params = [ const params = [
`Action=UpdateCustomVerificationEmailTemplate`, 'Action=UpdateCustomVerificationEmailTemplate',
`TemplateName=${templateName}`, `TemplateName=${templateName}`,
]; ];
@ -1018,7 +1018,7 @@ export class AwsSes implements INodeType {
if (isBodyHtml) { if (isBodyHtml) {
params.push(`Message.Body.Html.Data=${encodeURIComponent(message)}`); params.push(`Message.Body.Html.Data=${encodeURIComponent(message)}`);
params.push(`Message.Body.Html.Charset=UTF-8`); params.push('Message.Body.Html.Charset=UTF-8');
} else { } else {
params.push(`Message.Body.Text.Data=${encodeURIComponent(message)}`); params.push(`Message.Body.Text.Data=${encodeURIComponent(message)}`);
} }

View file

@ -25,7 +25,7 @@ export class AwsSqs implements INodeType {
icon: 'file:sqs.svg', icon: 'file:sqs.svg',
group: ['output'], group: ['output'],
version: 1, version: 1,
subtitle: `={{$parameter["operation"]}}`, subtitle: '={{$parameter["operation"]}}',
description: 'Sends messages to AWS SQS', description: 'Sends messages to AWS SQS',
defaults: { defaults: {
name: 'AWS SQS', name: 'AWS SQS',
@ -249,7 +249,7 @@ export class AwsSqs implements INodeType {
loadOptions: { loadOptions: {
// Get all the available queues to display them to user so that it can be selected easily // Get all the available queues to display them to user so that it can be selected easily
async getQueues(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> { async getQueues(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
const params = ['Version=2012-11-05', `Action=ListQueues`]; const params = ['Version=2012-11-05', 'Action=ListQueues'];
let data; let data;
try { try {

View file

@ -147,7 +147,7 @@ export async function validateCredentials(
// Concatenate path and instantiate URL object so it parses correctly query strings // Concatenate path and instantiate URL object so it parses correctly query strings
const endpoint = new URL( const endpoint = new URL(
getEndpointForService(service, credentials) + `?Action=GetCallerIdentity&Version=2011-06-15`, getEndpointForService(service, credentials) + '?Action=GetCallerIdentity&Version=2011-06-15',
); );
// Sign AWS API request with the user credentials // Sign AWS API request with the user credentials

View file

@ -56,7 +56,7 @@ export async function upload(this: IExecuteFunctions, index: number) {
} }
//endpoint //endpoint
const endpoint = `files`; const endpoint = 'files';
const { headers } = await apiRequest.call(this, requestMethod, endpoint, {}, {}, body); const { headers } = await apiRequest.call(this, requestMethod, endpoint, {}, {}, body);
return this.helpers.returnJsonArray({ fileId: headers.location.split('/').pop() }); return this.helpers.returnJsonArray({ fileId: headers.location.split('/').pop() });
} }

View file

@ -235,7 +235,7 @@ export class BitbucketTrigger implements INodeType {
this, this,
'values', 'values',
'GET', 'GET',
`/workspaces`, '/workspaces',
); );
for (const workspace of workspaces) { for (const workspace of workspaces) {
returnData.push({ returnData.push({

View file

@ -210,13 +210,13 @@ export class Box implements INodeType {
this, this,
'entries', 'entries',
'GET', 'GET',
`/search`, '/search',
{}, {},
qs, qs,
); );
} else { } else {
qs.limit = this.getNodeParameter('limit', i); qs.limit = this.getNodeParameter('limit', i);
responseData = await boxApiRequest.call(this, 'GET', `/search`, {}, qs); responseData = await boxApiRequest.call(this, 'GET', '/search', {}, qs);
responseData = responseData.entries; responseData = responseData.entries;
} }
} }
@ -262,7 +262,7 @@ export class Box implements INodeType {
body.accessible_by.id = this.getNodeParameter('groupId', i) as string; body.accessible_by.id = this.getNodeParameter('groupId', i) as string;
} }
responseData = await boxApiRequest.call(this, 'POST', `/collaborations`, body, qs); responseData = await boxApiRequest.call(this, 'POST', '/collaborations', body, qs);
} }
// https://developer.box.com/reference/post-files-content // https://developer.box.com/reference/post-files-content
if (operation === 'upload') { if (operation === 'upload') {
@ -444,13 +444,13 @@ export class Box implements INodeType {
this, this,
'entries', 'entries',
'GET', 'GET',
`/search`, '/search',
{}, {},
qs, qs,
); );
} else { } else {
qs.limit = this.getNodeParameter('limit', i); qs.limit = this.getNodeParameter('limit', i);
responseData = await boxApiRequest.call(this, 'GET', `/search`, {}, qs); responseData = await boxApiRequest.call(this, 'GET', '/search', {}, qs);
responseData = responseData.entries; responseData = responseData.entries;
} }
} }
@ -496,7 +496,7 @@ export class Box implements INodeType {
body.accessible_by.id = this.getNodeParameter('groupId', i) as string; body.accessible_by.id = this.getNodeParameter('groupId', i) as string;
} }
responseData = await boxApiRequest.call(this, 'POST', `/collaborations`, body, qs); responseData = await boxApiRequest.call(this, 'POST', '/collaborations', body, qs);
} }
//https://developer.box.com/guides/folders/single/move/ //https://developer.box.com/guides/folders/single/move/
if (operation === 'update') { if (operation === 'update') {

View file

@ -157,7 +157,7 @@ export class Brandfetch implements INodeType {
domain, domain,
}; };
const response = await brandfetchApiRequest.call(this, 'POST', `/logo`, body); const response = await brandfetchApiRequest.call(this, 'POST', '/logo', body);
if (download) { if (download) {
const imageTypes = this.getNodeParameter('imageTypes', i) as string[]; const imageTypes = this.getNodeParameter('imageTypes', i) as string[];
@ -219,7 +219,7 @@ export class Brandfetch implements INodeType {
domain, domain,
}; };
const response = await brandfetchApiRequest.call(this, 'POST', `/color`, body); const response = await brandfetchApiRequest.call(this, 'POST', '/color', body);
const executionData = this.helpers.constructExecutionMetaData( const executionData = this.helpers.constructExecutionMetaData(
this.helpers.returnJsonArray(response), this.helpers.returnJsonArray(response),
{ itemData: { item: i } }, { itemData: { item: i } },
@ -233,7 +233,7 @@ export class Brandfetch implements INodeType {
domain, domain,
}; };
const response = await brandfetchApiRequest.call(this, 'POST', `/font`, body); const response = await brandfetchApiRequest.call(this, 'POST', '/font', body);
const executionData = this.helpers.constructExecutionMetaData( const executionData = this.helpers.constructExecutionMetaData(
this.helpers.returnJsonArray(response), this.helpers.returnJsonArray(response),
{ itemData: { item: i } }, { itemData: { item: i } },
@ -247,7 +247,7 @@ export class Brandfetch implements INodeType {
domain, domain,
}; };
const response = await brandfetchApiRequest.call(this, 'POST', `/company`, body); const response = await brandfetchApiRequest.call(this, 'POST', '/company', body);
const executionData = this.helpers.constructExecutionMetaData( const executionData = this.helpers.constructExecutionMetaData(
this.helpers.returnJsonArray(response), this.helpers.returnJsonArray(response),
{ itemData: { item: i } }, { itemData: { item: i } },
@ -261,7 +261,7 @@ export class Brandfetch implements INodeType {
domain, domain,
}; };
const response = await brandfetchApiRequest.call(this, 'POST', `/industry`, body); const response = await brandfetchApiRequest.call(this, 'POST', '/industry', body);
const executionData = this.helpers.constructExecutionMetaData( const executionData = this.helpers.constructExecutionMetaData(
this.helpers.returnJsonArray(response), this.helpers.returnJsonArray(response),

View file

@ -422,7 +422,8 @@ export const objectFields: INodeProperties[] = [
'/jsonParameters': [true], '/jsonParameters': [true],
}, },
}, },
placeholder: `[ { "key": "name", "constraint_type": "text contains", "value": "cafe" } , { "key": "address", "constraint_type": "geographic_search", "value": { "range":10, "origin_address":"New York" } } ]`, placeholder:
'[ { "key": "name", "constraint_type": "text contains", "value": "cafe" } , { "key": "address", "constraint_type": "geographic_search", "value": { "range":10, "origin_address":"New York" } } ]',
description: description:
'Refine the list that is returned by the Data API with search constraints, exactly as you define a search in Bubble. See <a href="https://manual.bubble.io/core-resources/api/data-api#search-constraints">link</a>.', 'Refine the list that is returned by the Data API with search constraints, exactly as you define a search in Bubble. See <a href="https://manual.bubble.io/core-resources/api/data-api#search-constraints">link</a>.',
}, },

View file

@ -493,7 +493,7 @@ export class Chargebee implements INodeType {
} }
} }
endpoint = `customers`; endpoint = 'customers';
} else { } else {
throw new NodeOperationError( throw new NodeOperationError(
this.getNode(), this.getNode(),

View file

@ -72,7 +72,7 @@ export class CitrixAdc implements INodeType {
const fileLocation = this.getNodeParameter('fileLocation', i) as string; const fileLocation = this.getNodeParameter('fileLocation', i) as string;
const binaryProperty = this.getNodeParameter('binaryProperty', i); const binaryProperty = this.getNodeParameter('binaryProperty', i);
const options = this.getNodeParameter('options', i); const options = this.getNodeParameter('options', i);
const endpoint = `/config/systemfile`; const endpoint = '/config/systemfile';
const item = items[i]; const item = items[i];
@ -197,7 +197,7 @@ export class CitrixAdc implements INodeType {
}; };
} }
const endpoint = `/config/sslcert?action=create`; const endpoint = '/config/sslcert?action=create';
await citrixADCApiRequest.call(this, 'POST', endpoint, { sslcert: body }); await citrixADCApiRequest.call(this, 'POST', endpoint, { sslcert: body });
@ -237,7 +237,7 @@ export class CitrixAdc implements INodeType {
}); });
} }
const endpoint = `/config/sslcertkey`; const endpoint = '/config/sslcertkey';
await citrixADCApiRequest.call(this, 'POST', endpoint, { sslcertkey: body }); await citrixADCApiRequest.call(this, 'POST', endpoint, { sslcertkey: body });

View file

@ -82,5 +82,5 @@ export async function getAllCollectionEntries(
export async function getAllCollectionNames( export async function getAllCollectionNames(
this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,
): Promise<string[]> { ): Promise<string[]> {
return cockpitApiRequest.call(this, 'GET', `/collections/listCollections`, {}); return cockpitApiRequest.call(this, 'GET', '/collections/listCollections', {});
} }

View file

@ -11,5 +11,5 @@ export async function getSingleton(
export async function getAllSingletonNames( export async function getAllSingletonNames(
this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,
): Promise<string[]> { ): Promise<string[]> {
return cockpitApiRequest.call(this, 'GET', `/singletons/listSingletons`, {}); return cockpitApiRequest.call(this, 'GET', '/singletons/listSingletons', {});
} }

View file

@ -83,7 +83,7 @@ export class Coda implements INodeType {
async getDocs(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> { async getDocs(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
const returnData: INodePropertyOptions[] = []; const returnData: INodePropertyOptions[] = [];
const qs = {}; const qs = {};
const docs = await codaApiRequestAllItems.call(this, 'items', 'GET', `/docs`, {}, qs); const docs = await codaApiRequestAllItems.call(this, 'items', 'GET', '/docs', {}, qs);
for (const doc of docs) { for (const doc of docs) {
const docName = doc.name; const docName = doc.name;
const docId = doc.id; const docId = doc.id;

View file

@ -222,7 +222,7 @@ export class CoinGecko implements INodeType {
this, this,
'', '',
'GET', 'GET',
`/coins/markets`, '/coins/markets',
{}, {},
qs, qs,
); );
@ -231,7 +231,7 @@ export class CoinGecko implements INodeType {
qs.per_page = limit; qs.per_page = limit;
responseData = await coinGeckoApiRequest.call(this, 'GET', `/coins/markets`, {}, qs); responseData = await coinGeckoApiRequest.call(this, 'GET', '/coins/markets', {}, qs);
} }
} }

View file

@ -189,7 +189,7 @@ export class ConvertKit implements INodeType {
if (operation === 'getAll') { if (operation === 'getAll') {
const returnAll = this.getNodeParameter('returnAll', i); const returnAll = this.getNodeParameter('returnAll', i);
responseData = await convertKitApiRequest.call(this, 'GET', `/custom_fields`); responseData = await convertKitApiRequest.call(this, 'GET', '/custom_fields');
responseData = responseData.custom_fields; responseData = responseData.custom_fields;
@ -256,7 +256,7 @@ export class ConvertKit implements INodeType {
if (operation === 'getAll') { if (operation === 'getAll') {
const returnAll = this.getNodeParameter('returnAll', i); const returnAll = this.getNodeParameter('returnAll', i);
responseData = await convertKitApiRequest.call(this, 'GET', `/forms`); responseData = await convertKitApiRequest.call(this, 'GET', '/forms');
responseData = responseData.forms; responseData = responseData.forms;
@ -339,7 +339,7 @@ export class ConvertKit implements INodeType {
if (operation === 'getAll') { if (operation === 'getAll') {
const returnAll = this.getNodeParameter('returnAll', i); const returnAll = this.getNodeParameter('returnAll', i);
responseData = await convertKitApiRequest.call(this, 'GET', `/sequences`); responseData = await convertKitApiRequest.call(this, 'GET', '/sequences');
responseData = responseData.courses; responseData = responseData.courses;
@ -394,7 +394,7 @@ export class ConvertKit implements INodeType {
if (operation === 'getAll') { if (operation === 'getAll') {
const returnAll = this.getNodeParameter('returnAll', i); const returnAll = this.getNodeParameter('returnAll', i);
responseData = await convertKitApiRequest.call(this, 'GET', `/tags`); responseData = await convertKitApiRequest.call(this, 'GET', '/tags');
responseData = responseData.tags; responseData = responseData.tags;

View file

@ -88,7 +88,7 @@ export class Cortex implements INodeType {
const requestResult = await cortexApiRequest.call( const requestResult = await cortexApiRequest.call(
this, this,
'POST', 'POST',
`/analyzer/_search?range=all`, '/analyzer/_search?range=all',
); );
const returnData: INodePropertyOptions[] = []; const returnData: INodePropertyOptions[] = [];
@ -106,7 +106,7 @@ export class Cortex implements INodeType {
async loadActiveResponders(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> { async loadActiveResponders(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
// request the enabled responders from instance // request the enabled responders from instance
const requestResult = await cortexApiRequest.call(this, 'GET', `/responder`); const requestResult = await cortexApiRequest.call(this, 'GET', '/responder');
const returnData: INodePropertyOptions[] = []; const returnData: INodePropertyOptions[] = [];
for (const responder of requestResult) { for (const responder of requestResult) {

View file

@ -93,7 +93,7 @@ export class CustomerIo implements INodeType {
} }
if (operation === 'getAll') { if (operation === 'getAll') {
const endpoint = `/campaigns`; const endpoint = '/campaigns';
responseData = await customerIoApiRequest.call(this, 'GET', endpoint, body, 'beta'); responseData = await customerIoApiRequest.call(this, 'GET', endpoint, body, 'beta');
responseData = responseData.campaigns; responseData = responseData.campaigns;
@ -298,7 +298,7 @@ export class CustomerIo implements INodeType {
body.data = data; body.data = data;
} }
const endpoint = `/events`; const endpoint = '/events';
await customerIoApiRequest.call(this, 'POST', endpoint, body, 'tracking'); await customerIoApiRequest.call(this, 'POST', endpoint, body, 'tracking');
responseData = { responseData = {

View file

@ -68,7 +68,7 @@ export class Demio implements INodeType {
// select them easily // select them easily
async getEvents(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> { async getEvents(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
const returnData: INodePropertyOptions[] = []; const returnData: INodePropertyOptions[] = [];
const events = await demioApiRequest.call(this, 'GET', `/events`, {}, { type: 'upcoming' }); const events = await demioApiRequest.call(this, 'GET', '/events', {}, { type: 'upcoming' });
for (const event of events) { for (const event of events) {
returnData.push({ returnData.push({
name: event.name, name: event.name,
@ -136,7 +136,7 @@ export class Demio implements INodeType {
Object.assign(qs, filters); Object.assign(qs, filters);
responseData = await demioApiRequest.call(this, 'GET', `/events`, {}, qs); responseData = await demioApiRequest.call(this, 'GET', '/events', {}, qs);
if (!returnAll) { if (!returnAll) {
const limit = this.getNodeParameter('limit', i); const limit = this.getNodeParameter('limit', i);
@ -169,7 +169,7 @@ export class Demio implements INodeType {
delete additionalFields.customFields; delete additionalFields.customFields;
} }
responseData = await demioApiRequest.call(this, 'PUT', `/event/register`, body); responseData = await demioApiRequest.call(this, 'PUT', '/event/register', body);
} }
} }
if (resource === 'report') { if (resource === 'report') {

View file

@ -82,7 +82,7 @@ export class Dhl implements INodeType {
default: {}, default: {},
options: [ options: [
{ {
displayName: `Recipient's Postal Code`, displayName: "Recipient's Postal Code",
name: 'recipientPostalCode', name: 'recipientPostalCode',
type: 'string', type: 'string',
default: '', default: '',
@ -140,7 +140,7 @@ export class Dhl implements INodeType {
Object.assign(qs, options); Object.assign(qs, options);
responseData = await dhlApiRequest.call(this, 'GET', `/track/shipments`, {}, qs); responseData = await dhlApiRequest.call(this, 'GET', '/track/shipments', {}, qs);
returnData.push(...responseData.shipments); returnData.push(...responseData.shipments);
} }

View file

@ -66,7 +66,7 @@ export async function validateCredentials(
trackingNumber: 123, trackingNumber: 123,
}, },
method: 'GET', method: 'GET',
uri: `https://api-eu.dhl.com/track/shipments`, uri: 'https://api-eu.dhl.com/track/shipments',
json: true, json: true,
}; };

View file

@ -96,7 +96,7 @@ export class Discourse implements INodeType {
// select them easily // select them easily
async getCategories(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> { async getCategories(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
const returnData: INodePropertyOptions[] = []; const returnData: INodePropertyOptions[] = [];
const { category_list } = await discourseApiRequest.call(this, 'GET', `/categories.json`); const { category_list } = await discourseApiRequest.call(this, 'GET', '/categories.json');
for (const category of category_list.categories) { for (const category of category_list.categories) {
returnData.push({ returnData.push({
name: category.name, name: category.name,
@ -131,7 +131,7 @@ export class Discourse implements INodeType {
text_color: textColor, text_color: textColor,
}; };
responseData = await discourseApiRequest.call(this, 'POST', `/categories.json`, body); responseData = await discourseApiRequest.call(this, 'POST', '/categories.json', body);
responseData = responseData.category; responseData = responseData.category;
} }
@ -139,7 +139,7 @@ export class Discourse implements INodeType {
if (operation === 'getAll') { if (operation === 'getAll') {
const returnAll = this.getNodeParameter('returnAll', i); const returnAll = this.getNodeParameter('returnAll', i);
responseData = await discourseApiRequest.call(this, 'GET', `/categories.json`, {}, qs); responseData = await discourseApiRequest.call(this, 'GET', '/categories.json', {}, qs);
responseData = responseData.category_list.categories; responseData = responseData.category_list.categories;
@ -181,7 +181,7 @@ export class Discourse implements INodeType {
name, name,
}; };
responseData = await discourseApiRequest.call(this, 'POST', `/admin/groups.json`, { responseData = await discourseApiRequest.call(this, 'POST', '/admin/groups.json', {
group: body, group: body,
}); });
@ -199,7 +199,7 @@ export class Discourse implements INodeType {
if (operation === 'getAll') { if (operation === 'getAll') {
const returnAll = this.getNodeParameter('returnAll', i); const returnAll = this.getNodeParameter('returnAll', i);
responseData = await discourseApiRequest.call(this, 'GET', `/groups.json`, {}, qs); responseData = await discourseApiRequest.call(this, 'GET', '/groups.json', {}, qs);
responseData = responseData.groups; responseData = responseData.groups;
@ -237,7 +237,7 @@ export class Discourse implements INodeType {
Object.assign(body, additionalFields); Object.assign(body, additionalFields);
responseData = await discourseApiRequest.call(this, 'POST', `/posts.json`, body); responseData = await discourseApiRequest.call(this, 'POST', '/posts.json', body);
} }
//https://docs.discourse.org/#tag/Posts/paths/~1posts~1{id}.json/get //https://docs.discourse.org/#tag/Posts/paths/~1posts~1{id}.json/get
if (operation === 'get') { if (operation === 'get') {
@ -250,7 +250,7 @@ export class Discourse implements INodeType {
const returnAll = this.getNodeParameter('returnAll', i); const returnAll = this.getNodeParameter('returnAll', i);
const limit = this.getNodeParameter('limit', i, 0); const limit = this.getNodeParameter('limit', i, 0);
responseData = await discourseApiRequest.call(this, 'GET', `/posts.json`, {}, qs); responseData = await discourseApiRequest.call(this, 'GET', '/posts.json', {}, qs);
responseData = responseData.latest_posts; responseData = responseData.latest_posts;
//Getting all posts relying on https://github.com/discourse/discourse_api/blob/main/spec/discourse_api/api/posts_spec.rb //Getting all posts relying on https://github.com/discourse/discourse_api/blob/main/spec/discourse_api/api/posts_spec.rb
@ -352,7 +352,7 @@ export class Discourse implements INodeType {
Object.assign(body, additionalFields); Object.assign(body, additionalFields);
responseData = await discourseApiRequest.call(this, 'POST', `/users.json`, body); responseData = await discourseApiRequest.call(this, 'POST', '/users.json', body);
} }
//https://docs.discourse.org/#tag/Users/paths/~1users~1{username}.json/get //https://docs.discourse.org/#tag/Users/paths/~1users~1{username}.json/get
if (operation === 'get') { if (operation === 'get') {

View file

@ -68,7 +68,7 @@ export async function elasticsearchApiRequestAllItems(
track_total_hits: false, //Disable the tracking of total hits to speed up pagination track_total_hits: false, //Disable the tracking of total hits to speed up pagination
}; };
responseData = await elasticsearchApiRequest.call(this, 'GET', `/_search`, requestBody, qs); responseData = await elasticsearchApiRequest.call(this, 'GET', '/_search', requestBody, qs);
if (responseData?.hits?.hits) { if (responseData?.hits?.hits) {
returnData = returnData.concat(responseData.hits.hits); returnData = returnData.concat(responseData.hits.hits);
const lastHitIndex = responseData.hits.hits.length - 1; const lastHitIndex = responseData.hits.hits.length - 1;
@ -84,7 +84,7 @@ export async function elasticsearchApiRequestAllItems(
requestBody.search_after = searchAfter; requestBody.search_after = searchAfter;
requestBody.pit = { id: pit, keep_alive: '1m' }; requestBody.pit = { id: pit, keep_alive: '1m' };
responseData = await elasticsearchApiRequest.call(this, 'GET', `/_search`, requestBody, qs); responseData = await elasticsearchApiRequest.call(this, 'GET', '/_search', requestBody, qs);
if (responseData?.hits?.hits?.length) { if (responseData?.hits?.hits?.length) {
returnData = returnData.concat(responseData.hits.hits); returnData = returnData.concat(responseData.hits.hits);
@ -96,7 +96,7 @@ export async function elasticsearchApiRequestAllItems(
} }
} }
await elasticsearchApiRequest.call(this, 'DELETE', `/_pit`, { id: pit }); await elasticsearchApiRequest.call(this, 'DELETE', '/_pit', { id: pit });
return returnData; return returnData;
} catch (error) { } catch (error) {

View file

@ -479,7 +479,7 @@ export class EmailReadImapV1 implements INodeType {
try { try {
searchCriteria = JSON.parse(options.customEmailConfig as string); searchCriteria = JSON.parse(options.customEmailConfig as string);
} catch (error) { } catch (error) {
throw new NodeOperationError(this.getNode(), `Custom email config is not valid JSON.`); throw new NodeOperationError(this.getNode(), 'Custom email config is not valid JSON.');
} }
} }

View file

@ -239,7 +239,7 @@ export class EmailReadImapV2 implements INodeType {
const credentialsObject = await this.getCredentials('imap'); const credentialsObject = await this.getCredentials('imap');
const credentials = isCredentialsDataImap(credentialsObject) ? credentialsObject : undefined; const credentials = isCredentialsDataImap(credentialsObject) ? credentialsObject : undefined;
if (!credentials) { if (!credentials) {
throw new NodeOperationError(this.getNode(), `Credentials are not valid for imap node.`); throw new NodeOperationError(this.getNode(), 'Credentials are not valid for imap node.');
} }
const mailbox = this.getNodeParameter('mailbox') as string; const mailbox = this.getNodeParameter('mailbox') as string;
const postProcessAction = this.getNodeParameter('postProcessAction') as string; const postProcessAction = this.getNodeParameter('postProcessAction') as string;
@ -487,7 +487,7 @@ export class EmailReadImapV2 implements INodeType {
try { try {
searchCriteria = JSON.parse(options.customEmailConfig as string); searchCriteria = JSON.parse(options.customEmailConfig as string);
} catch (error) { } catch (error) {
throw new NodeOperationError(this.getNode(), `Custom email config is not valid JSON.`); throw new NodeOperationError(this.getNode(), 'Custom email config is not valid JSON.');
} }
} }
@ -560,11 +560,11 @@ export class EmailReadImapV2 implements INodeType {
return imapConnect(config).then(async (conn) => { return imapConnect(config).then(async (conn) => {
conn.on('close', async (_hadError: boolean) => { conn.on('close', async (_hadError: boolean) => {
if (isCurrentlyReconnecting) { if (isCurrentlyReconnecting) {
Logger.debug(`Email Read Imap: Connected closed for forced reconnecting`); Logger.debug('Email Read Imap: Connected closed for forced reconnecting');
} else if (closeFunctionWasCalled) { } else if (closeFunctionWasCalled) {
Logger.debug(`Email Read Imap: Shutting down workflow - connected closed`); Logger.debug('Email Read Imap: Shutting down workflow - connected closed');
} else { } else {
Logger.error(`Email Read Imap: Connected closed unexpectedly`); Logger.error('Email Read Imap: Connected closed unexpectedly');
this.emitError(new Error('Imap connection closed unexpectedly')); this.emitError(new Error('Imap connection closed unexpectedly'));
} }
}); });
@ -586,7 +586,7 @@ export class EmailReadImapV2 implements INodeType {
if (options.forceReconnect !== undefined) { if (options.forceReconnect !== undefined) {
reconnectionInterval = setInterval(async () => { reconnectionInterval = setInterval(async () => {
Logger.verbose(`Forcing reconnect to IMAP server`); Logger.verbose('Forcing reconnect to IMAP server');
try { try {
isCurrentlyReconnecting = true; isCurrentlyReconnecting = true;
if (connection.closeBox) await connection.closeBox(false); if (connection.closeBox) await connection.closeBox(false);

View file

@ -124,7 +124,7 @@ export async function emeliaApiTest(
}, },
method: 'POST', method: 'POST',
body, body,
uri: `https://graphql.emelia.io/graphql`, uri: 'https://graphql.emelia.io/graphql',
json: true, json: true,
}; };

View file

@ -69,166 +69,169 @@ export function getFields(object: string) {
page: [ page: [
{ {
value: 'affiliation', value: 'affiliation',
description: `Describes changes to a page's Affliation profile field`, description: "Describes changes to a page's Affliation profile field",
}, },
{ {
value: 'attire', value: 'attire',
description: `Describes changes to a page's Attire profile field`, description: "Describes changes to a page's Attire profile field",
}, },
{ {
value: 'awards', value: 'awards',
description: `Describes changes to a page's Awards profile field`, description: "Describes changes to a page's Awards profile field",
}, },
{ {
value: 'bio', value: 'bio',
description: `Describes changes to a page's Biography profile field`, description: "Describes changes to a page's Biography profile field",
}, },
{ {
value: 'birthday', value: 'birthday',
description: `Describes changes to a page's Birthday profile field`, description: "Describes changes to a page's Birthday profile field",
}, },
{ {
value: 'category', value: 'category',
description: `Describes changes to a page's Birthday profile field`, description: "Describes changes to a page's Birthday profile field",
}, },
{ {
value: 'company_overview', value: 'company_overview',
description: `Describes changes to a page's Company Overview profile field`, description: "Describes changes to a page's Company Overview profile field",
}, },
{ {
value: 'culinary_team', value: 'culinary_team',
description: `Describes changes to a page's Culinary Team profile field`, description: "Describes changes to a page's Culinary Team profile field",
}, },
{ {
value: 'current_location', value: 'current_location',
description: `Describes changes to a page's Current Location profile field`, description: "Describes changes to a page's Current Location profile field",
}, },
{ {
value: 'description', value: 'description',
description: `Describes changes to a page's Story Description profile field`, description: "Describes changes to a page's Story Description profile field",
}, },
{ {
value: 'email', value: 'email',
description: `Describes changes to a page's Email profile field`, description: "Describes changes to a page's Email profile field",
}, },
{ {
value: 'feed', value: 'feed',
description: `Describes nearly all changes to a Page's feed, such as Posts, shares, likes, etc`, description:
"Describes nearly all changes to a Page's feed, such as Posts, shares, likes, etc",
}, },
{ {
value: 'founded', value: 'founded',
description: `Describes changes to a page's Founded profile field. This is different from the Start Date field`, description:
"Describes changes to a page's Founded profile field. This is different from the Start Date field",
}, },
{ {
value: 'general_info', value: 'general_info',
description: `Describes changes to a page's General Information profile field`, description: "Describes changes to a page's General Information profile field",
}, },
{ {
value: 'general_manager', value: 'general_manager',
description: `Describes changes to a page's General Information profile field`, description: "Describes changes to a page's General Information profile field",
}, },
{ {
value: 'hometown', value: 'hometown',
description: `Describes changes to a page's Homewtown profile field`, description: "Describes changes to a page's Homewtown profile field",
}, },
{ {
value: 'hours', value: 'hours',
description: `Describes changes to a page's Hours profile field`, description: "Describes changes to a page's Hours profile field",
}, },
{ {
value: 'leadgen', value: 'leadgen',
description: `Describes changes to a page's leadgen settings`, description: "Describes changes to a page's leadgen settings",
}, },
{ {
value: 'live_videos', value: 'live_videos',
description: `Describes changes to a page's live video status`, description: "Describes changes to a page's live video status",
}, },
{ {
value: 'location', value: 'location',
description: `Describes changes to a page's Location profile field`, description: "Describes changes to a page's Location profile field",
}, },
{ {
value: 'members', value: 'members',
description: `Describes changes to a page's Members profile field`, description: "Describes changes to a page's Members profile field",
}, },
{ {
value: 'mention', value: 'mention',
description: `Describes new mentions of a page, including mentions in comments, posts, etc`, description: 'Describes new mentions of a page, including mentions in comments, posts, etc',
}, },
{ {
value: 'merchant_review', value: 'merchant_review',
description: `Describes changes to a page's merchant review settings`, description: "Describes changes to a page's merchant review settings",
}, },
{ {
value: 'mission', value: 'mission',
description: `Describes changes to a page's Mission profile field`, description: "Describes changes to a page's Mission profile field",
}, },
{ {
value: 'name', value: 'name',
description: `Describes changes to a page's Name profile field.`, description: "Describes changes to a page's Name profile field.",
}, },
{ {
value: 'page_about_story', value: 'page_about_story',
}, },
{ {
value: 'page_change_proposal', value: 'page_change_proposal',
description: `Data for page change proposal.`, description: 'Data for page change proposal.',
}, },
{ {
value: 'page_upcoming_change', value: 'page_upcoming_change',
description: `Webhooks data for page upcoming changes`, description: 'Webhooks data for page upcoming changes',
}, },
{ {
value: 'parking', value: 'parking',
description: `Describes changes to a page's Parking profile field`, description: "Describes changes to a page's Parking profile field",
}, },
{ {
value: 'payment_options', value: 'payment_options',
description: `Describes change to a page's Payment profile field`, description: "Describes change to a page's Payment profile field",
}, },
{ {
value: 'personal_info', value: 'personal_info',
description: `Describes changes to a page's Personal Information profile field.`, description: "Describes changes to a page's Personal Information profile field.",
}, },
{ {
value: 'personal_interests', value: 'personal_interests',
description: `Describes changes to a page's Personal Interests profile field.`, description: "Describes changes to a page's Personal Interests profile field.",
}, },
{ {
value: 'phone', value: 'phone',
description: `Describes changes to a page's Phone profile field`, description: "Describes changes to a page's Phone profile field",
}, },
{ {
value: 'picture', value: 'picture',
description: `Describes changes to a page's profile picture`, description: "Describes changes to a page's profile picture",
}, },
{ {
value: 'price_range', value: 'price_range',
description: `Describes changes to a page's Price Range profile field`, description: "Describes changes to a page's Price Range profile field",
}, },
{ {
value: 'product_review', value: 'product_review',
description: `Describes changes to a page's product review settings`, description: "Describes changes to a page's product review settings",
}, },
{ {
value: 'products', value: 'products',
description: `Describes changes to a page's Products profile field`, description: "Describes changes to a page's Products profile field",
}, },
{ {
value: 'public_transit', value: 'public_transit',
description: `Describes changes to a page's Public Transit profile field`, description: "Describes changes to a page's Public Transit profile field",
}, },
{ {
value: 'ratings', value: 'ratings',
description: `Describes changes to a page's ratings, including new ratings or a user's comments or reactions on a rating`, description:
"Describes changes to a page's ratings, including new ratings or a user's comments or reactions on a rating",
}, },
{ {
value: 'videos', value: 'videos',
description: `Describes changes to the encoding status of a video on a page`, description: 'Describes changes to the encoding status of a video on a page',
}, },
{ {
value: 'website', value: 'website',
description: `Describes changes to a page's Website profile field`, description: "Describes changes to a page's Website profile field",
}, },
], ],
application: [ application: [

View file

@ -102,7 +102,7 @@ export class FlowTrigger implements INodeType {
return false; return false;
} }
qs.organization_id = credentials.organizationId as number; qs.organization_id = credentials.organizationId as number;
const endpoint = `/integration_webhooks`; const endpoint = '/integration_webhooks';
try { try {
webhooks = await flowApiRequest.call(this, 'GET', endpoint, {}, qs); webhooks = await flowApiRequest.call(this, 'GET', endpoint, {}, qs);
webhooks = webhooks.integration_webhooks; webhooks = webhooks.integration_webhooks;
@ -126,7 +126,7 @@ export class FlowTrigger implements INodeType {
const webhookUrl = this.getNodeWebhookUrl('default'); const webhookUrl = this.getNodeWebhookUrl('default');
const webhookData = this.getWorkflowStaticData('node'); const webhookData = this.getWorkflowStaticData('node');
const resource = this.getNodeParameter('resource') as string; const resource = this.getNodeParameter('resource') as string;
const endpoint = `/integration_webhooks`; const endpoint = '/integration_webhooks';
if (resource === 'list') { if (resource === 'list') {
resourceIds = (this.getNodeParameter('listIds') as string).split(','); resourceIds = (this.getNodeParameter('listIds') as string).split(',');
} }

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