From b598036b3d014b7ee0dac1d5e937ccead3d8f481 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Wed, 8 Jul 2020 10:08:00 +0200 Subject: [PATCH] :shirt: Fix some lint issues --- ...entials.ts => MicrosoftSql.credentials.ts} | 6 +++--- .../{SqlServer => Sql}/GenericFunctions.ts | 0 .../MicrosoftSql.node.ts} | 20 +++++++++--------- .../{SqlServer => Sql}/TableInterface.ts | 0 .../Microsoft/{SqlServer => Sql}/mssql.png | Bin packages/nodes-base/package.json | 4 ++-- 6 files changed, 15 insertions(+), 15 deletions(-) rename packages/nodes-base/credentials/{MicrosoftSqlServer.credentials.ts => MicrosoftSql.credentials.ts} (86%) rename packages/nodes-base/nodes/Microsoft/{SqlServer => Sql}/GenericFunctions.ts (100%) rename packages/nodes-base/nodes/Microsoft/{SqlServer/MicrosoftSqlServer.node.ts => Sql/MicrosoftSql.node.ts} (95%) rename packages/nodes-base/nodes/Microsoft/{SqlServer => Sql}/TableInterface.ts (100%) rename packages/nodes-base/nodes/Microsoft/{SqlServer => Sql}/mssql.png (100%) diff --git a/packages/nodes-base/credentials/MicrosoftSqlServer.credentials.ts b/packages/nodes-base/credentials/MicrosoftSql.credentials.ts similarity index 86% rename from packages/nodes-base/credentials/MicrosoftSqlServer.credentials.ts rename to packages/nodes-base/credentials/MicrosoftSql.credentials.ts index b0a14de771..812e9bfdd7 100644 --- a/packages/nodes-base/credentials/MicrosoftSqlServer.credentials.ts +++ b/packages/nodes-base/credentials/MicrosoftSql.credentials.ts @@ -1,8 +1,8 @@ import { ICredentialType, NodePropertyTypes } from 'n8n-workflow'; -export class MicrosoftSqlServer implements ICredentialType { - name = 'microsoftSqlServer'; - displayName = 'Microsoft SQL Server'; +export class MicrosoftSql implements ICredentialType { + name = 'microsoftSql'; + displayName = 'Microsoft SQL'; properties = [ { displayName: 'Server', diff --git a/packages/nodes-base/nodes/Microsoft/SqlServer/GenericFunctions.ts b/packages/nodes-base/nodes/Microsoft/Sql/GenericFunctions.ts similarity index 100% rename from packages/nodes-base/nodes/Microsoft/SqlServer/GenericFunctions.ts rename to packages/nodes-base/nodes/Microsoft/Sql/GenericFunctions.ts diff --git a/packages/nodes-base/nodes/Microsoft/SqlServer/MicrosoftSqlServer.node.ts b/packages/nodes-base/nodes/Microsoft/Sql/MicrosoftSql.node.ts similarity index 95% rename from packages/nodes-base/nodes/Microsoft/SqlServer/MicrosoftSqlServer.node.ts rename to packages/nodes-base/nodes/Microsoft/Sql/MicrosoftSql.node.ts index b24d93b0f5..1d036147f6 100644 --- a/packages/nodes-base/nodes/Microsoft/SqlServer/MicrosoftSqlServer.node.ts +++ b/packages/nodes-base/nodes/Microsoft/Sql/MicrosoftSql.node.ts @@ -22,23 +22,23 @@ import { extractValues, } from './GenericFunctions'; -export class MicrosoftSqlServer implements INodeType { +export class MicrosoftSql implements INodeType { description: INodeTypeDescription = { - displayName: 'Microsoft SQL Server', - name: 'microsoftSqlServer', + displayName: 'Microsoft SQL', + name: 'microsoftSql', icon: 'file:mssql.png', group: ['input'], version: 1, - description: 'Gets, add and update data in Microsoft SQL Server.', + description: 'Gets, add and update data in Microsoft SQL.', defaults: { - name: 'Microsoft SQL Server', + name: 'Microsoft SQL', color: '#1d4bab', }, inputs: ['main'], outputs: ['main'], credentials: [ { - name: 'microsoftSqlServer', + name: 'microsoftSql', required: true, }, ], @@ -204,7 +204,7 @@ export class MicrosoftSqlServer implements INodeType { }; async execute(this: IExecuteFunctions): Promise { - const credentials = this.getCredentials('microsoftSqlServer'); + const credentials = this.getCredentials('microsoftSql'); if (credentials === undefined) { throw new Error('No credentials got returned!'); @@ -222,7 +222,7 @@ export class MicrosoftSqlServer implements INodeType { const pool = new mssql.ConnectionPool(config); await pool.connect(); - let returnItems: any = []; + let returnItems: INodeExecutionData[] = []; const items = this.getInputData(); const operation = this.getNodeParameter('operation', 0) as string; @@ -259,7 +259,7 @@ export class MicrosoftSqlServer implements INodeType { table: string; columnString: string; items: IDataObject[]; - }): Promise[] => { + }): Array> => { return chunk(items, 1000).map(insertValues => { const values = insertValues .map((item: IDataObject) => extractValues(item)) @@ -307,7 +307,7 @@ export class MicrosoftSqlServer implements INodeType { table: string; columnString: string; items: IDataObject[]; - }): Promise[] => { + }): Array> => { return items.map(item => { const columns = columnString .split(',') diff --git a/packages/nodes-base/nodes/Microsoft/SqlServer/TableInterface.ts b/packages/nodes-base/nodes/Microsoft/Sql/TableInterface.ts similarity index 100% rename from packages/nodes-base/nodes/Microsoft/SqlServer/TableInterface.ts rename to packages/nodes-base/nodes/Microsoft/Sql/TableInterface.ts diff --git a/packages/nodes-base/nodes/Microsoft/SqlServer/mssql.png b/packages/nodes-base/nodes/Microsoft/Sql/mssql.png similarity index 100% rename from packages/nodes-base/nodes/Microsoft/SqlServer/mssql.png rename to packages/nodes-base/nodes/Microsoft/Sql/mssql.png diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index 1d196f3eef..3c51466ea3 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -96,7 +96,7 @@ "dist/credentials/MicrosoftExcelOAuth2Api.credentials.js", "dist/credentials/MicrosoftOAuth2Api.credentials.js", "dist/credentials/MicrosoftOneDriveOAuth2Api.credentials.js", - "dist/credentials/MicrosoftSqlServer.credentials.js", + "dist/credentials/MicrosoftSql.credentials.js", "dist/credentials/MoceanApi.credentials.js", "dist/credentials/MondayComApi.credentials.js", "dist/credentials/MongoDb.credentials.js", @@ -242,7 +242,7 @@ "dist/nodes/MessageBird/MessageBird.node.js", "dist/nodes/Microsoft/Excel/MicrosoftExcel.node.js", "dist/nodes/Microsoft/OneDrive/MicrosoftOneDrive.node.js", - "dist/nodes/Microsoft/SqlServer/MicrosoftSqlServer.node.js", + "dist/nodes/Microsoft/Sql/MicrosoftSql.node.js", "dist/nodes/MoveBinaryData.node.js", "dist/nodes/Mocean/Mocean.node.js", "dist/nodes/MondayCom/MondayCom.node.js",