From 6f48593134b75f2e22347a310c40caa8c1e7e961 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Thu, 10 Aug 2023 15:28:03 +0200 Subject: [PATCH] refactor: Enable `cred-class-field-properties-assertion` (no-changelog) (#6908) --- packages/nodes-base/.eslintrc.js | 1 + .../credentials/DropcontactApi.credentials.ts | 7 ++++--- .../nodes-base/credentials/HighLevelApi.credentials.ts | 7 ++++--- .../credentials/KoBoToolboxApi.credentials.ts | 9 +++++---- .../nodes-base/credentials/NetlifyApi.credentials.ts | 7 ++++--- packages/nodes-base/credentials/OdooApi.credentials.ts | 10 +++++----- .../nodes-base/credentials/OnfleetApi.credentials.ts | 7 ++++--- .../VenafiTlsProtectCloudApi.credentials.ts | 7 ++++--- 8 files changed, 31 insertions(+), 24 deletions(-) diff --git a/packages/nodes-base/.eslintrc.js b/packages/nodes-base/.eslintrc.js index 1620e38d14..4fa675ce80 100644 --- a/packages/nodes-base/.eslintrc.js +++ b/packages/nodes-base/.eslintrc.js @@ -50,6 +50,7 @@ module.exports = { 'n8n-nodes-base/cred-class-field-name-missing-oauth2': 'error', 'n8n-nodes-base/cred-class-field-name-unsuffixed': 'error', 'n8n-nodes-base/cred-class-field-name-uppercase-first-char': 'error', + 'n8n-nodes-base/cred-class-field-properties-assertion': 'error', 'n8n-nodes-base/cred-class-field-type-options-password-missing': 'error', 'n8n-nodes-base/cred-class-name-missing-oauth2-suffix': 'error', 'n8n-nodes-base/cred-class-name-unsuffixed': 'error', diff --git a/packages/nodes-base/credentials/DropcontactApi.credentials.ts b/packages/nodes-base/credentials/DropcontactApi.credentials.ts index 71258d8b70..bba3f0fbf7 100644 --- a/packages/nodes-base/credentials/DropcontactApi.credentials.ts +++ b/packages/nodes-base/credentials/DropcontactApi.credentials.ts @@ -2,7 +2,7 @@ import type { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, - NodePropertyTypes, + INodeProperties, } from 'n8n-workflow'; export class DropcontactApi implements ICredentialType { @@ -12,11 +12,12 @@ export class DropcontactApi implements ICredentialType { documentationUrl = 'dropcontact'; - properties = [ + properties: INodeProperties[] = [ { displayName: 'API Key', name: 'apiKey', - type: 'string' as NodePropertyTypes, + type: 'string', + typeOptions: { password: true }, default: '', }, ]; diff --git a/packages/nodes-base/credentials/HighLevelApi.credentials.ts b/packages/nodes-base/credentials/HighLevelApi.credentials.ts index c10b83fc88..08505fbb23 100644 --- a/packages/nodes-base/credentials/HighLevelApi.credentials.ts +++ b/packages/nodes-base/credentials/HighLevelApi.credentials.ts @@ -2,7 +2,7 @@ import type { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, - NodePropertyTypes, + INodeProperties, } from 'n8n-workflow'; export class HighLevelApi implements ICredentialType { @@ -12,11 +12,12 @@ export class HighLevelApi implements ICredentialType { documentationUrl = 'highLevel'; - properties = [ + properties: INodeProperties[] = [ { displayName: 'API Key', name: 'apiKey', - type: 'string' as NodePropertyTypes, + type: 'string', + typeOptions: { password: true }, default: '', }, ]; diff --git a/packages/nodes-base/credentials/KoBoToolboxApi.credentials.ts b/packages/nodes-base/credentials/KoBoToolboxApi.credentials.ts index 894c0acd26..ab02e2821b 100644 --- a/packages/nodes-base/credentials/KoBoToolboxApi.credentials.ts +++ b/packages/nodes-base/credentials/KoBoToolboxApi.credentials.ts @@ -2,7 +2,7 @@ import type { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, - NodePropertyTypes, + INodeProperties, } from 'n8n-workflow'; export class KoBoToolboxApi implements ICredentialType { @@ -13,17 +13,18 @@ export class KoBoToolboxApi implements ICredentialType { // See https://support.kobotoolbox.org/api.html documentationUrl = 'koBoToolbox'; - properties = [ + properties: INodeProperties[] = [ { displayName: 'API Root URL', name: 'URL', - type: 'string' as NodePropertyTypes, + type: 'string', default: 'https://kf.kobotoolbox.org/', }, { displayName: 'API Token', name: 'token', - type: 'string' as NodePropertyTypes, + type: 'string', + typeOptions: { password: true }, default: '', hint: 'You can get your API token at https://[api-root]/token/?format=json (for a logged in user)', }, diff --git a/packages/nodes-base/credentials/NetlifyApi.credentials.ts b/packages/nodes-base/credentials/NetlifyApi.credentials.ts index 4544eb37f4..1c67a6843f 100644 --- a/packages/nodes-base/credentials/NetlifyApi.credentials.ts +++ b/packages/nodes-base/credentials/NetlifyApi.credentials.ts @@ -1,4 +1,4 @@ -import type { ICredentialType, NodePropertyTypes } from 'n8n-workflow'; +import type { ICredentialType, INodeProperties } from 'n8n-workflow'; export class NetlifyApi implements ICredentialType { name = 'netlifyApi'; @@ -7,11 +7,12 @@ export class NetlifyApi implements ICredentialType { documentationUrl = 'netlify'; - properties = [ + properties: INodeProperties[] = [ { displayName: 'Access Token', name: 'accessToken', - type: 'string' as NodePropertyTypes, + type: 'string', + typeOptions: { password: true }, default: '', }, ]; diff --git a/packages/nodes-base/credentials/OdooApi.credentials.ts b/packages/nodes-base/credentials/OdooApi.credentials.ts index ac760a86a5..89c2f7ed91 100644 --- a/packages/nodes-base/credentials/OdooApi.credentials.ts +++ b/packages/nodes-base/credentials/OdooApi.credentials.ts @@ -1,4 +1,4 @@ -import type { ICredentialType, INodeProperties, NodePropertyTypes } from 'n8n-workflow'; +import type { ICredentialType, INodeProperties } from 'n8n-workflow'; export class OdooApi implements ICredentialType { name = 'odooApi'; @@ -11,7 +11,7 @@ export class OdooApi implements ICredentialType { { displayName: 'Site URL', name: 'url', - type: 'string' as NodePropertyTypes, + type: 'string', default: '', placeholder: 'https://my-organization.odoo.com', required: true, @@ -19,7 +19,7 @@ export class OdooApi implements ICredentialType { { displayName: 'Username', name: 'username', - type: 'string' as NodePropertyTypes, + type: 'string', default: '', placeholder: 'user@email.com', required: true, @@ -27,7 +27,7 @@ export class OdooApi implements ICredentialType { { displayName: 'Password or API Key', name: 'password', - type: 'string' as NodePropertyTypes, + type: 'string', default: '', typeOptions: { password: true, @@ -37,7 +37,7 @@ export class OdooApi implements ICredentialType { { displayName: 'Database Name', name: 'db', - type: 'string' as NodePropertyTypes, + type: 'string', default: '', }, ]; diff --git a/packages/nodes-base/credentials/OnfleetApi.credentials.ts b/packages/nodes-base/credentials/OnfleetApi.credentials.ts index 2305fc1bda..944dc358da 100644 --- a/packages/nodes-base/credentials/OnfleetApi.credentials.ts +++ b/packages/nodes-base/credentials/OnfleetApi.credentials.ts @@ -1,4 +1,4 @@ -import type { ICredentialType, NodePropertyTypes } from 'n8n-workflow'; +import type { ICredentialType, INodeProperties } from 'n8n-workflow'; export class OnfleetApi implements ICredentialType { name = 'onfleetApi'; @@ -7,11 +7,12 @@ export class OnfleetApi implements ICredentialType { documentationUrl = 'onfleet'; - properties = [ + properties: INodeProperties[] = [ { displayName: 'API Key', name: 'apiKey', - type: 'string' as NodePropertyTypes, + type: 'string', + typeOptions: { password: true }, default: '', }, ]; diff --git a/packages/nodes-base/credentials/VenafiTlsProtectCloudApi.credentials.ts b/packages/nodes-base/credentials/VenafiTlsProtectCloudApi.credentials.ts index b8a6a48718..0fea551ee4 100644 --- a/packages/nodes-base/credentials/VenafiTlsProtectCloudApi.credentials.ts +++ b/packages/nodes-base/credentials/VenafiTlsProtectCloudApi.credentials.ts @@ -2,7 +2,7 @@ import type { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, - NodePropertyTypes, + INodeProperties, } from 'n8n-workflow'; export class VenafiTlsProtectCloudApi implements ICredentialType { @@ -12,11 +12,12 @@ export class VenafiTlsProtectCloudApi implements ICredentialType { documentationUrl = 'venafitlsprotectcloud'; - properties = [ + properties: INodeProperties[] = [ { displayName: 'API Key', name: 'apiKey', - type: 'string' as NodePropertyTypes, + type: 'string', + typeOptions: { password: true }, default: '', }, ];