From 8406ccff5fda07892e82d5de7d24275e89841beb Mon Sep 17 00:00:00 2001 From: Elias Meire Date: Thu, 14 Sep 2023 18:25:46 +0200 Subject: [PATCH] Rename sms77 to seven, fix credentials test --- .../credentials/Sms77Api.credentials.ts | 20 +++++++++++++++--- .../nodes/Sms77/GenericFunctions.ts | 6 +++--- .../nodes-base/nodes/Sms77/Sms77.node.json | 3 ++- packages/nodes-base/nodes/Sms77/Sms77.node.ts | 11 +++++----- packages/nodes-base/nodes/Sms77/seven.svg | 1 + packages/nodes-base/nodes/Sms77/sms77.png | Bin 1188 -> 0 bytes 6 files changed, 28 insertions(+), 13 deletions(-) create mode 100644 packages/nodes-base/nodes/Sms77/seven.svg delete mode 100644 packages/nodes-base/nodes/Sms77/sms77.png diff --git a/packages/nodes-base/credentials/Sms77Api.credentials.ts b/packages/nodes-base/credentials/Sms77Api.credentials.ts index bdb67885eae74..ceccd56b0186b 100644 --- a/packages/nodes-base/credentials/Sms77Api.credentials.ts +++ b/packages/nodes-base/credentials/Sms77Api.credentials.ts @@ -8,7 +8,8 @@ import type { export class Sms77Api implements ICredentialType { name = 'sms77Api'; - displayName = 'Sms77 API'; + // eslint-disable-next-line n8n-nodes-base/cred-class-field-display-name-miscased + displayName = 'seven API'; documentationUrl = 'sms77'; @@ -33,8 +34,21 @@ export class Sms77Api implements ICredentialType { test: ICredentialTestRequest = { request: { - baseURL: 'https://gateway.sms77.io/api', - url: '/balance', + baseURL: 'https://gateway.seven.io/api', + url: '/hooks', + qs: { + action: 'read', + }, }, + rules: [ + { + type: 'responseSuccessBody', + properties: { + key: 'success', + message: 'Invalid API Key', + value: undefined, + }, + }, + ], }; } diff --git a/packages/nodes-base/nodes/Sms77/GenericFunctions.ts b/packages/nodes-base/nodes/Sms77/GenericFunctions.ts index a4836165f96e9..2a67b32f13a29 100644 --- a/packages/nodes-base/nodes/Sms77/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Sms77/GenericFunctions.ts @@ -1,10 +1,10 @@ -import type { IExecuteFunctions, IHookFunctions, IDataObject, JsonObject } from 'n8n-workflow'; +import type { IDataObject, IExecuteFunctions, IHookFunctions, JsonObject } from 'n8n-workflow'; import { NodeApiError } from 'n8n-workflow'; import type { OptionsWithUri } from 'request'; /** - * Make an API request to Sms77 + * Make an API request to seven * * @param {IHookFunctions | IExecuteFunctions} this * @param {object | undefined} data @@ -21,7 +21,7 @@ export async function sms77ApiRequest( SentWith: 'n8n', }, qs, - uri: `https://gateway.sms77.io/api${endpoint}`, + uri: `https://gateway.seven.io/api${endpoint}`, json: true, method, }; diff --git a/packages/nodes-base/nodes/Sms77/Sms77.node.json b/packages/nodes-base/nodes/Sms77/Sms77.node.json index 2495b864ee589..58d0776f6275f 100644 --- a/packages/nodes-base/nodes/Sms77/Sms77.node.json +++ b/packages/nodes-base/nodes/Sms77/Sms77.node.json @@ -14,5 +14,6 @@ "url": "https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.sms77/" } ] - } + }, + "alias": ["SMS", "Sms77"] } diff --git a/packages/nodes-base/nodes/Sms77/Sms77.node.ts b/packages/nodes-base/nodes/Sms77/Sms77.node.ts index c85617f202b82..f5775eca1f58b 100644 --- a/packages/nodes-base/nodes/Sms77/Sms77.node.ts +++ b/packages/nodes-base/nodes/Sms77/Sms77.node.ts @@ -1,6 +1,6 @@ import type { - IExecuteFunctions, IDataObject, + IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription, @@ -10,16 +10,15 @@ import { sms77ApiRequest } from './GenericFunctions'; export class Sms77 implements INodeType { description: INodeTypeDescription = { - displayName: 'sms77', + displayName: 'seven', name: 'sms77', - // eslint-disable-next-line n8n-nodes-base/node-class-description-icon-not-svg - icon: 'file:sms77.png', + icon: 'file:seven.svg', group: ['transform'], version: 1, subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}', description: 'Send SMS and make text-to-speech calls', defaults: { - name: 'sms77', + name: 'seven', }, inputs: ['main'], outputs: ['main'], @@ -118,7 +117,7 @@ export class Sms77 implements INodeType { }, }, description: - 'The number of your recipient(s) separated by comma. Can be regular numbers or contact/groups from Sms77.', + 'The number of your recipient(s) separated by comma. Can be regular numbers or contact/groups from seven.', }, { displayName: 'Message', diff --git a/packages/nodes-base/nodes/Sms77/seven.svg b/packages/nodes-base/nodes/Sms77/seven.svg new file mode 100644 index 0000000000000..d6024ffc8797e --- /dev/null +++ b/packages/nodes-base/nodes/Sms77/seven.svg @@ -0,0 +1 @@ + diff --git a/packages/nodes-base/nodes/Sms77/sms77.png b/packages/nodes-base/nodes/Sms77/sms77.png deleted file mode 100644 index 500ba005ae607319db55ee5faf60847d2bc4bf87..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1188 zcmV;V1Y7%wP)b?)N%R!`%B)D8`gF6{P!2ta}3jMrS8Zm*nRN) z_SpC5s_)BX;-Mhcco5WY2-0fh`tRHL>CpD#%k|&4@za#+zA@T^_Wk+i`talV?Vaqy zf#|V&=B{?;t7_w`#&q?C@tOqN%sM_Zpu}t(Vs$M?rWk7IPcB&O9xrzuMi*C^KyB5)Eb} zFz ziRXPq+}S?ht?x1qh6>$7Noi>%oe&`?5M|9o?Hd7J z6+r%ri&cb3+?m@Kl6{P0TTQL5vI2^&=`xWoXiiv{VX(_X$-a`_>$xw7?n)J4=bV-L@j2XOF4Is>fmwlGOUz7Dt_ikvbS)=&iDUWxoK%g+zbQMVog30000