diff --git a/packages/nodes-base/credentials/SendInBlueApi.credentials.ts b/packages/nodes-base/credentials/BrevoApi.credentials.ts similarity index 73% rename from packages/nodes-base/credentials/SendInBlueApi.credentials.ts rename to packages/nodes-base/credentials/BrevoApi.credentials.ts index f4fed2a413..2690f3207d 100644 --- a/packages/nodes-base/credentials/SendInBlueApi.credentials.ts +++ b/packages/nodes-base/credentials/BrevoApi.credentials.ts @@ -5,12 +5,13 @@ import type { INodeProperties, } from 'n8n-workflow'; -export class SendInBlueApi implements ICredentialType { +export class BrevoApi implements ICredentialType { + // keep sendinblue name for backward compatibility name = 'sendInBlueApi'; - displayName = 'SendInBlue'; + displayName = 'Brevo'; - documentationUrl = 'sendinblue'; + documentationUrl = 'brevo'; properties: INodeProperties[] = [ { @@ -33,7 +34,7 @@ export class SendInBlueApi implements ICredentialType { test: ICredentialTestRequest = { request: { - baseURL: 'https://api.sendinblue.com/v3', + baseURL: 'https://api.brevo.com/v3', url: '/account', }, }; diff --git a/packages/nodes-base/nodes/SendInBlue/AttributeDescription.ts b/packages/nodes-base/nodes/Brevo/AttributeDescription.ts similarity index 98% rename from packages/nodes-base/nodes/SendInBlue/AttributeDescription.ts rename to packages/nodes-base/nodes/Brevo/AttributeDescription.ts index 5944ba8fe2..f51efa0579 100644 --- a/packages/nodes-base/nodes/SendInBlue/AttributeDescription.ts +++ b/packages/nodes-base/nodes/Brevo/AttributeDescription.ts @@ -4,7 +4,7 @@ import type { INodeProperties, JsonObject, } from 'n8n-workflow'; -import { SendInBlueNode } from './GenericFunctions'; +import { BrevoNode } from './GenericFunctions'; export const attributeOperations: INodeProperties[] = [ { @@ -43,7 +43,7 @@ export const attributeOperations: INodeProperties[] = [ requestOptions: IHttpRequestOptions, ): Promise { const selectedCategory = this.getNodeParameter('attributeCategory') as string; - const override = SendInBlueNode.INTERCEPTORS.get(selectedCategory); + const override = BrevoNode.INTERCEPTORS.get(selectedCategory); if (override) { override.call(this, requestOptions.body! as JsonObject); } diff --git a/packages/nodes-base/nodes/SendInBlue/SendInBlue.node.json b/packages/nodes-base/nodes/Brevo/Brevo.node.json similarity index 67% rename from packages/nodes-base/nodes/SendInBlue/SendInBlue.node.json rename to packages/nodes-base/nodes/Brevo/Brevo.node.json index abf2d926f1..931dd09b63 100644 --- a/packages/nodes-base/nodes/SendInBlue/SendInBlue.node.json +++ b/packages/nodes-base/nodes/Brevo/Brevo.node.json @@ -1,18 +1,19 @@ { - "node": "n8n-nodes-base.sendInBlue", + "node": "n8n-nodes-base.brevo", "nodeVersion": "1.0", "codexVersion": "1.0", "categories": ["Marketing & Content", "Communication"], "resources": { "credentialDocumentation": [ { - "url": "https://docs.n8n.io/credentials/sendInBlue" + "url": "https://docs.n8n.io/credentials/brevo" } ], "primaryDocumentation": [ { - "url": "https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.sendinblue/" + "url": "https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.brevo/" } ] - } + }, + "alias": ["sendinblue"] } diff --git a/packages/nodes-base/nodes/SendInBlue/SendInBlue.node.ts b/packages/nodes-base/nodes/Brevo/Brevo.node.ts similarity index 85% rename from packages/nodes-base/nodes/SendInBlue/SendInBlue.node.ts rename to packages/nodes-base/nodes/Brevo/Brevo.node.ts index 19c9ba5a63..f4519c0651 100644 --- a/packages/nodes-base/nodes/SendInBlue/SendInBlue.node.ts +++ b/packages/nodes-base/nodes/Brevo/Brevo.node.ts @@ -5,17 +5,18 @@ import { contactFields, contactOperations } from './ContactDescription'; import { emailFields, emailOperations } from './EmailDescription'; import { senderFields, senderOperations } from './SenderDescrition'; -export class SendInBlue implements INodeType { +export class Brevo implements INodeType { description: INodeTypeDescription = { - displayName: 'SendInBlue', + displayName: 'Brevo', + // keep sendinblue name for backward compatibility name: 'sendInBlue', - icon: 'file:sendinblue.svg', + icon: 'file:brevo.svg', group: ['transform'], version: 1, subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}', - description: 'Consume Sendinblue API', + description: 'Consume Brevo API', defaults: { - name: 'SendInBlue', + name: 'Brevo', }, inputs: ['main'], outputs: ['main'], @@ -26,7 +27,7 @@ export class SendInBlue implements INodeType { }, ], requestDefaults: { - baseURL: 'https://api.sendinblue.com', + baseURL: 'https://api.brevo.com', }, properties: [ { diff --git a/packages/nodes-base/nodes/SendInBlue/SendInBlueTrigger.node.json b/packages/nodes-base/nodes/Brevo/BrevoTrigger.node.json similarity index 65% rename from packages/nodes-base/nodes/SendInBlue/SendInBlueTrigger.node.json rename to packages/nodes-base/nodes/Brevo/BrevoTrigger.node.json index f553e8d39f..81df05bd70 100644 --- a/packages/nodes-base/nodes/SendInBlue/SendInBlueTrigger.node.json +++ b/packages/nodes-base/nodes/Brevo/BrevoTrigger.node.json @@ -1,19 +1,20 @@ { - "node": "n8n-nodes-base.sendInBlueTrigger", + "node": "n8n-nodes-base.brevoTrigger", "nodeVersion": "1.0", "codexVersion": "1.0", "categories": ["Marketing & Content", "Communication"], "resources": { "credentialDocumentation": [ { - "url": "https://docs.n8n.io/credentials/sendInBlue" + "url": "https://docs.n8n.io/credentials/brevo" } ], "primaryDocumentation": [ { - "url": "https://docs.n8n.io/integrations/builtin/trigger-nodes/n8n-nodes-base.sendinbluetrigger/" + "url": "https://docs.n8n.io/integrations/builtin/trigger-nodes/n8n-nodes-base.brevotrigger/" } ], "generic": [] - } + }, + "alias": ["sendinblue"] } diff --git a/packages/nodes-base/nodes/SendInBlue/SendInBlueTrigger.node.ts b/packages/nodes-base/nodes/Brevo/BrevoTrigger.node.ts similarity index 92% rename from packages/nodes-base/nodes/SendInBlue/SendInBlueTrigger.node.ts rename to packages/nodes-base/nodes/Brevo/BrevoTrigger.node.ts index dc9bb30370..b0988a9e84 100644 --- a/packages/nodes-base/nodes/SendInBlue/SendInBlueTrigger.node.ts +++ b/packages/nodes-base/nodes/Brevo/BrevoTrigger.node.ts @@ -6,9 +6,9 @@ import type { IWebhookFunctions, IWebhookResponseData, } from 'n8n-workflow'; -import { SendInBlueWebhookApi } from './GenericFunctions'; +import { BrevoWebhookApi } from './GenericFunctions'; -export class SendInBlueTrigger implements INodeType { +export class BrevoTrigger implements INodeType { description: INodeTypeDescription = { credentials: [ { @@ -16,14 +16,15 @@ export class SendInBlueTrigger implements INodeType { required: true, }, ], - displayName: 'SendInBlue Trigger', + displayName: 'Brevo Trigger', defaults: { - name: 'SendInBlue Trigger', + name: 'Brevo Trigger', }, - description: 'Starts the workflow when SendInBlue events occur', + description: 'Starts the workflow when Brevo events occur', group: ['trigger'], - icon: 'file:sendinblue.svg', + icon: 'file:brevo.svg', inputs: [], + // keep sendinblue name for backward compatibility name: 'sendInBlueTrigger', outputs: ['main'], version: 1, @@ -213,7 +214,7 @@ export class SendInBlueTrigger implements INodeType { const events = this.getNodeParameter('events') as string[]; try { - const { webhooks } = await SendInBlueWebhookApi.fetchWebhooks(this, type); + const { webhooks } = await BrevoWebhookApi.fetchWebhooks(this, type); for (const webhook of webhooks) { if ( @@ -240,12 +241,7 @@ export class SendInBlueTrigger implements INodeType { const events = this.getNodeParameter('events') as string[]; - const responseData = await SendInBlueWebhookApi.createWebHook( - this, - type, - events, - webhookUrl, - ); + const responseData = await BrevoWebhookApi.createWebHook(this, type, events, webhookUrl); if (responseData === undefined || responseData.id === undefined) { // Required data is missing so was not successful @@ -261,7 +257,7 @@ export class SendInBlueTrigger implements INodeType { if (webhookData.webhookId !== undefined) { try { - await SendInBlueWebhookApi.deleteWebhook(this, webhookData.webhookId as string); + await BrevoWebhookApi.deleteWebhook(this, webhookData.webhookId as string); } catch (error) { return false; } diff --git a/packages/nodes-base/nodes/SendInBlue/ContactDescription.ts b/packages/nodes-base/nodes/Brevo/ContactDescription.ts similarity index 100% rename from packages/nodes-base/nodes/SendInBlue/ContactDescription.ts rename to packages/nodes-base/nodes/Brevo/ContactDescription.ts diff --git a/packages/nodes-base/nodes/SendInBlue/EmailDescription.ts b/packages/nodes-base/nodes/Brevo/EmailDescription.ts similarity index 90% rename from packages/nodes-base/nodes/SendInBlue/EmailDescription.ts rename to packages/nodes-base/nodes/Brevo/EmailDescription.ts index 8a1cc400ea..63fda3ab10 100644 --- a/packages/nodes-base/nodes/SendInBlue/EmailDescription.ts +++ b/packages/nodes-base/nodes/Brevo/EmailDescription.ts @@ -1,5 +1,5 @@ import type { INodeProperties } from 'n8n-workflow'; -import { SendInBlueNode } from './GenericFunctions'; +import { BrevoNode } from './GenericFunctions'; export const emailOperations: INodeProperties[] = [ { @@ -120,7 +120,7 @@ const sendHtmlEmailFields: INodeProperties[] = [ required: true, routing: { send: { - preSend: [SendInBlueNode.Validators.validateAndCompileSenderEmail], + preSend: [BrevoNode.Validators.validateAndCompileSenderEmail], }, }, }, @@ -138,7 +138,7 @@ const sendHtmlEmailFields: INodeProperties[] = [ required: true, routing: { send: { - preSend: [SendInBlueNode.Validators.validateAndCompileReceipientEmails], + preSend: [BrevoNode.Validators.validateAndCompileReceipientEmails], }, }, }, @@ -180,7 +180,7 @@ const sendHtmlEmailFields: INodeProperties[] = [ ], routing: { send: { - preSend: [SendInBlueNode.Validators.validateAndCompileAttachmentsData], + preSend: [BrevoNode.Validators.validateAndCompileAttachmentsData], }, }, }, @@ -206,7 +206,7 @@ const sendHtmlEmailFields: INodeProperties[] = [ ], routing: { send: { - preSend: [SendInBlueNode.Validators.validateAndCompileBCCEmails], + preSend: [BrevoNode.Validators.validateAndCompileBCCEmails], }, }, }, @@ -232,7 +232,7 @@ const sendHtmlEmailFields: INodeProperties[] = [ ], routing: { send: { - preSend: [SendInBlueNode.Validators.validateAndCompileCCEmails], + preSend: [BrevoNode.Validators.validateAndCompileCCEmails], }, }, }, @@ -259,7 +259,7 @@ const sendHtmlEmailFields: INodeProperties[] = [ ], routing: { send: { - preSend: [SendInBlueNode.Validators.validateAndCompileTags], + preSend: [BrevoNode.Validators.validateAndCompileTags], }, }, }, @@ -339,7 +339,7 @@ const sendHtmlTemplateEmailFields: INodeProperties[] = [ required: true, routing: { send: { - preSend: [SendInBlueNode.Validators.validateAndCompileReceipientEmails], + preSend: [BrevoNode.Validators.validateAndCompileReceipientEmails], }, }, }, @@ -381,7 +381,7 @@ const sendHtmlTemplateEmailFields: INodeProperties[] = [ ], routing: { send: { - preSend: [SendInBlueNode.Validators.validateAndCompileAttachmentsData], + preSend: [BrevoNode.Validators.validateAndCompileAttachmentsData], }, }, }, @@ -408,7 +408,7 @@ const sendHtmlTemplateEmailFields: INodeProperties[] = [ ], routing: { send: { - preSend: [SendInBlueNode.Validators.validateAndCompileTags], + preSend: [BrevoNode.Validators.validateAndCompileTags], }, }, }, @@ -437,7 +437,7 @@ const sendHtmlTemplateEmailFields: INodeProperties[] = [ ], routing: { send: { - preSend: [SendInBlueNode.Validators.validateAndCompileTemplateParameters], + preSend: [BrevoNode.Validators.validateAndCompileTemplateParameters], }, }, }, diff --git a/packages/nodes-base/nodes/SendInBlue/GenericFunctions.ts b/packages/nodes-base/nodes/Brevo/GenericFunctions.ts similarity index 98% rename from packages/nodes-base/nodes/SendInBlue/GenericFunctions.ts rename to packages/nodes-base/nodes/Brevo/GenericFunctions.ts index 7fa7a6e4bd..bed24ef97e 100644 --- a/packages/nodes-base/nodes/SendInBlue/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Brevo/GenericFunctions.ts @@ -8,7 +8,7 @@ import type { import { jsonParse, NodeOperationError } from 'n8n-workflow'; import type { OptionsWithUri } from 'request'; import MailComposer from 'nodemailer/lib/mail-composer'; -export namespace SendInBlueNode { +export namespace BrevoNode { type ValidEmailFields = { to: string } | { sender: string } | { cc: string } | { bcc: string }; type Address = { address: string; name?: string }; type Email = { email: string; name?: string }; @@ -277,7 +277,7 @@ export namespace SendInBlueNode { } } -export namespace SendInBlueWebhookApi { +export namespace BrevoWebhookApi { interface WebhookDetails { url: string; id: number; @@ -297,7 +297,7 @@ export namespace SendInBlueWebhookApi { } const credentialsName = 'sendInBlueApi'; - const baseURL = 'https://api.sendinblue.com/v3'; + const baseURL = 'https://api.brevo.com/v3'; export const supportedAuthMap = new Map Promise>([ [ 'apiKey', diff --git a/packages/nodes-base/nodes/SendInBlue/SenderDescrition.ts b/packages/nodes-base/nodes/Brevo/SenderDescrition.ts similarity index 100% rename from packages/nodes-base/nodes/SendInBlue/SenderDescrition.ts rename to packages/nodes-base/nodes/Brevo/SenderDescrition.ts diff --git a/packages/nodes-base/nodes/Brevo/brevo.svg b/packages/nodes-base/nodes/Brevo/brevo.svg new file mode 100644 index 0000000000..4b097f196f --- /dev/null +++ b/packages/nodes-base/nodes/Brevo/brevo.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/packages/nodes-base/nodes/SendInBlue/sendinblue.svg b/packages/nodes-base/nodes/SendInBlue/sendinblue.svg deleted file mode 100644 index 7525b9036e..0000000000 --- a/packages/nodes-base/nodes/SendInBlue/sendinblue.svg +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index c9cab8c02c..05a52f8deb 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -271,7 +271,7 @@ "dist/credentials/SecurityScorecardApi.credentials.js", "dist/credentials/SegmentApi.credentials.js", "dist/credentials/SendGridApi.credentials.js", - "dist/credentials/SendInBlueApi.credentials.js", + "dist/credentials/BrevoApi.credentials.js", "dist/credentials/SendyApi.credentials.js", "dist/credentials/SentryIoApi.credentials.js", "dist/credentials/SentryIoOAuth2Api.credentials.js", @@ -599,8 +599,8 @@ "dist/nodes/Netlify/NetlifyTrigger.node.js", "dist/nodes/NextCloud/NextCloud.node.js", "dist/nodes/NocoDB/NocoDB.node.js", - "dist/nodes/SendInBlue/SendInBlue.node.js", - "dist/nodes/SendInBlue/SendInBlueTrigger.node.js", + "dist/nodes/Brevo/Brevo.node.js", + "dist/nodes/Brevo/BrevoTrigger.node.js", "dist/nodes/StickyNote/StickyNote.node.js", "dist/nodes/NoOp/NoOp.node.js", "dist/nodes/Onfleet/Onfleet.node.js",