n8n-3867-progressively-apply-prettier-to-all (#3873)

* 🔨 formatting nodes with prettier
This commit is contained in:
Michael Kret
2022-08-17 18:50:24 +03:00
committed by GitHub
parent f2d326c7f0
commit 91d7e16c81
1072 changed files with 42357 additions and 59109 deletions

View File

@@ -1,6 +1,4 @@
import {
IExecuteFunctions,
} from 'n8n-core';
import { IExecuteFunctions } from 'n8n-core';
import {
IDataObject,
@@ -10,11 +8,7 @@ import {
NodeOperationError,
} from 'n8n-workflow';
import {
pgInsert,
pgQuery,
pgUpdate,
} from '../Postgres/Postgres.node.functions';
import { pgInsert, pgQuery, pgUpdate } from '../Postgres/Postgres.node.functions';
import pgPromise from 'pg-promise';
@@ -84,7 +78,8 @@ export class TimescaleDb implements INodeType {
default: '',
placeholder: 'SELECT id, name FROM product WHERE quantity > $1 AND price <= $2',
required: true,
description: 'The SQL query to execute. You can use n8n expressions or $1 and $2 in conjunction with query parameters.',
description:
'The SQL query to execute. You can use n8n expressions or $1 and $2 in conjunction with query parameters.',
},
// ----------------------------------
@@ -96,9 +91,7 @@ export class TimescaleDb implements INodeType {
type: 'string',
displayOptions: {
show: {
operation: [
'insert',
],
operation: ['insert'],
},
},
default: 'public',
@@ -111,9 +104,7 @@ export class TimescaleDb implements INodeType {
type: 'string',
displayOptions: {
show: {
operation: [
'insert',
],
operation: ['insert'],
},
},
default: '',
@@ -126,14 +117,13 @@ export class TimescaleDb implements INodeType {
type: 'string',
displayOptions: {
show: {
operation: [
'insert',
],
operation: ['insert'],
},
},
default: '',
placeholder: 'id,name,description',
description: 'Comma-separated list of the properties which should used as columns for the new rows',
description:
'Comma-separated list of the properties which should used as columns for the new rows',
},
// ----------------------------------
@@ -145,9 +135,7 @@ export class TimescaleDb implements INodeType {
type: 'string',
displayOptions: {
show: {
operation: [
'update',
],
operation: ['update'],
},
},
default: 'public',
@@ -160,9 +148,7 @@ export class TimescaleDb implements INodeType {
type: 'string',
displayOptions: {
show: {
operation: [
'update',
],
operation: ['update'],
},
},
default: '',
@@ -175,15 +161,14 @@ export class TimescaleDb implements INodeType {
type: 'string',
displayOptions: {
show: {
operation: [
'update',
],
operation: ['update'],
},
},
default: 'id',
required: true,
// eslint-disable-next-line n8n-nodes-base/node-param-description-miscased-id
description: 'Name of the property which decides which rows in the database should be updated. Normally that would be "id".',
description:
'Name of the property which decides which rows in the database should be updated. Normally that would be "id".',
},
{
displayName: 'Columns',
@@ -191,14 +176,13 @@ export class TimescaleDb implements INodeType {
type: 'string',
displayOptions: {
show: {
operation: [
'update',
],
operation: ['update'],
},
},
default: '',
placeholder: 'name,description',
description: 'Comma-separated list of the properties which should used as columns for rows to update',
description:
'Comma-separated list of the properties which should used as columns for rows to update',
},
// ----------------------------------
// insert,update
@@ -247,7 +231,8 @@ export class TimescaleDb implements INodeType {
},
],
default: 'multiple',
description: 'The way queries should be sent to database. Can be used in conjunction with <b>Continue on Fail</b>. See <a href="https://docs.n8n.io/nodes/n8n-nodes-base.timescaleDb/">the docs</a> for more examples',
description:
'The way queries should be sent to database. Can be used in conjunction with <b>Continue on Fail</b>. See <a href="https://docs.n8n.io/nodes/n8n-nodes-base.timescaleDb/">the docs</a> for more examples',
},
{
displayName: 'Query Parameters',
@@ -255,14 +240,13 @@ export class TimescaleDb implements INodeType {
type: 'string',
displayOptions: {
show: {
'/operation': [
'executeQuery',
],
'/operation': ['executeQuery'],
},
},
default: '',
placeholder: 'quantity,price',
description: 'Comma-separated list of properties which should be used as query parameters',
description:
'Comma-separated list of properties which should be used as query parameters',
},
],
},
@@ -296,7 +280,13 @@ export class TimescaleDb implements INodeType {
// executeQuery
// ----------------------------------
const queryResult = await pgQuery(this.getNodeParameter, pgp, db, items, this.continueOnFail());
const queryResult = await pgQuery(
this.getNodeParameter,
pgp,
db,
items,
this.continueOnFail(),
);
returnItems = this.helpers.returnJsonArray(queryResult);
} else if (operation === 'insert') {
@@ -304,7 +294,13 @@ export class TimescaleDb implements INodeType {
// insert
// ----------------------------------
const insertData = await pgInsert(this.getNodeParameter, pgp, db, items, this.continueOnFail());
const insertData = await pgInsert(
this.getNodeParameter,
pgp,
db,
items,
this.continueOnFail(),
);
// Add the id to the data
for (let i = 0; i < insertData.length; i++) {
@@ -317,13 +313,21 @@ export class TimescaleDb implements INodeType {
// update
// ----------------------------------
const updateItems = await pgUpdate(this.getNodeParameter, pgp, db, items, this.continueOnFail());
const updateItems = await pgUpdate(
this.getNodeParameter,
pgp,
db,
items,
this.continueOnFail(),
);
returnItems = this.helpers.returnJsonArray(updateItems);
} else {
await pgp.end();
throw new NodeOperationError(this.getNode(), `The operation "${operation}" is not supported!`);
throw new NodeOperationError(
this.getNode(),
`The operation "${operation}" is not supported!`,
);
}
// Close the connection