From b4329c823a54b8b30cd1d646415a452ecd48a6d5 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Thu, 12 Dec 2019 20:24:55 -0600 Subject: [PATCH] :zap: Rename and fix lint issue --- .../{MySQL.credentials.ts => MySql.credentials.ts} | 4 ++-- .../nodes/{MySQL => MySql}/GenericFunctions.ts | 0 .../{MySQL/MySQL.node.ts => MySql/MySql.node.ts} | 12 ++++++------ .../nodes-base/nodes/{MySQL => MySql}/mysql.png | Bin packages/nodes-base/package.json | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) rename packages/nodes-base/credentials/{MySQL.credentials.ts => MySql.credentials.ts} (91%) rename packages/nodes-base/nodes/{MySQL => MySql}/GenericFunctions.ts (100%) rename packages/nodes-base/nodes/{MySQL/MySQL.node.ts => MySql/MySql.node.ts} (96%) rename packages/nodes-base/nodes/{MySQL => MySql}/mysql.png (100%) diff --git a/packages/nodes-base/credentials/MySQL.credentials.ts b/packages/nodes-base/credentials/MySql.credentials.ts similarity index 91% rename from packages/nodes-base/credentials/MySQL.credentials.ts rename to packages/nodes-base/credentials/MySql.credentials.ts index de4335a274..df48722ceb 100644 --- a/packages/nodes-base/credentials/MySQL.credentials.ts +++ b/packages/nodes-base/credentials/MySql.credentials.ts @@ -4,8 +4,8 @@ import { } from 'n8n-workflow'; -export class MySQL implements ICredentialType { - name = 'mysql'; +export class MySql implements ICredentialType { + name = 'mySql'; displayName = 'MySQL'; properties = [ { diff --git a/packages/nodes-base/nodes/MySQL/GenericFunctions.ts b/packages/nodes-base/nodes/MySql/GenericFunctions.ts similarity index 100% rename from packages/nodes-base/nodes/MySQL/GenericFunctions.ts rename to packages/nodes-base/nodes/MySql/GenericFunctions.ts diff --git a/packages/nodes-base/nodes/MySQL/MySQL.node.ts b/packages/nodes-base/nodes/MySql/MySql.node.ts similarity index 96% rename from packages/nodes-base/nodes/MySQL/MySQL.node.ts rename to packages/nodes-base/nodes/MySql/MySql.node.ts index c2d54e4c66..04052789d0 100644 --- a/packages/nodes-base/nodes/MySQL/MySQL.node.ts +++ b/packages/nodes-base/nodes/MySql/MySql.node.ts @@ -10,10 +10,10 @@ import * as mysql2 from 'mysql2/promise'; import { copyInputItems } from './GenericFunctions'; -export class MySQL implements INodeType { +export class MySql implements INodeType { description: INodeTypeDescription = { displayName: 'MySQL', - name: 'mysql', + name: 'mySql', icon: 'file:mysql.png', group: ['input'], version: 1, @@ -26,7 +26,7 @@ export class MySQL implements INodeType { outputs: ['main'], credentials: [ { - name: 'mysql', + name: 'mySql', required: true, } ], @@ -169,7 +169,7 @@ export class MySQL implements INodeType { async execute(this: IExecuteFunctions): Promise { - const credentials = this.getCredentials('mysql'); + const credentials = this.getCredentials('mySql'); if (credentials === undefined) { throw new Error('No credentials got returned!'); @@ -194,7 +194,7 @@ export class MySQL implements INodeType { queryResult = queryResult.reduce((collection, result) => { const [rows, fields] = result; - + if (Array.isArray(rows)) { return collection.concat(rows); } @@ -217,7 +217,7 @@ export class MySQL implements INodeType { const insertItems = copyInputItems(items, columns); const insertPlaceholder = `(${columns.map(column => '?').join(',')})`; const insertSQL = `INSERT INTO ${table}(${columnString}) VALUES ${items.map(item => insertPlaceholder).join(',')};`; - const queryItems = insertItems.reduce((collection, item) => collection.concat(Object.values(item as any)), []); + const queryItems = insertItems.reduce((collection, item) => collection.concat(Object.values(item as any)), []); // tslint:disable-line:no-any const queryResult = await connection.query(insertSQL, queryItems); returnItems = this.helpers.returnJsonArray(queryResult[0] as IDataObject); diff --git a/packages/nodes-base/nodes/MySQL/mysql.png b/packages/nodes-base/nodes/MySql/mysql.png similarity index 100% rename from packages/nodes-base/nodes/MySQL/mysql.png rename to packages/nodes-base/nodes/MySql/mysql.png diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index d19b7b2e85..057785d5b0 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -52,7 +52,7 @@ "dist/credentials/MandrillApi.credentials.js", "dist/credentials/MattermostApi.credentials.js", "dist/credentials/MongoDb.credentials.js", - "dist/credentials/MySQL.credentials.js", + "dist/credentials/MySql.credentials.js", "dist/credentials/NextCloudApi.credentials.js", "dist/credentials/OpenWeatherMapApi.credentials.js", "dist/credentials/PipedriveApi.credentials.js", @@ -119,7 +119,7 @@ "dist/nodes/Merge.node.js", "dist/nodes/MoveBinaryData.node.js", "dist/nodes/MongoDb/MongoDb.node.js", - "dist/nodes/MySQL/MySQL.node.js", + "dist/nodes/MySql/MySql.node.js", "dist/nodes/NextCloud/NextCloud.node.js", "dist/nodes/NoOp.node.js", "dist/nodes/OpenWeatherMap.node.js",