mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-11 04:47:29 -08:00
fix(Brevo Node): Rename SendInBlue node to Brevo node (#6521)
* rename sendinblue to brevo * refactor sendinblue node files/folders to brevo * update codex node, documentation urls and api baseUrls * adding comments to original node names
This commit is contained in:
parent
cdd215f642
commit
e63b3982d2
|
@ -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',
|
||||
},
|
||||
};
|
|
@ -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<IHttpRequestOptions> {
|
||||
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);
|
||||
}
|
|
@ -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"]
|
||||
}
|
|
@ -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: [
|
||||
{
|
|
@ -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"]
|
||||
}
|
|
@ -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;
|
||||
}
|
|
@ -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],
|
||||
},
|
||||
},
|
||||
},
|
|
@ -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<string, (ref: IWebhookFunctions) => Promise<string>>([
|
||||
[
|
||||
'apiKey',
|
4
packages/nodes-base/nodes/Brevo/brevo.svg
Normal file
4
packages/nodes-base/nodes/Brevo/brevo.svg
Normal file
|
@ -0,0 +1,4 @@
|
|||
<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="24" cy="24" r="24" fill="#0B996E"/>
|
||||
<path d="M31.5036 21.8092C32.9875 20.3562 33.6829 18.677 33.6829 16.6345C33.6829 12.4146 30.5772 9.59998 25.8963 9.59998H14.4V39.6H23.6705C30.717 39.6 36 35.2887 36 29.5702C36 26.438 34.3782 23.6253 31.5036 21.8092ZM18.572 13.5024H25.4321C27.7492 13.5024 29.2797 14.8184 29.2797 16.8152C29.2797 19.084 27.287 20.8089 23.2082 22.1249C20.4269 22.9863 19.176 23.7128 18.7118 24.5762L18.572 24.5775V13.5024ZM23.2995 35.6976H18.572V31.0688C18.572 29.0263 20.3336 27.0295 22.7906 26.2573C24.9698 25.5309 26.7761 24.8044 28.3067 24.0342C30.346 25.2152 31.5969 27.2558 31.5969 29.3895C31.5969 33.0199 28.0736 35.6976 23.2995 35.6976Z" fill="white"/>
|
||||
</svg>
|
After Width: | Height: | Size: 800 B |
|
@ -1,20 +0,0 @@
|
|||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 94.8 101.7" style="enable-background:new 0 0 94.8 101.7;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill-rule:evenodd;clip-rule:evenodd;fill:#0092FF;}
|
||||
</style>
|
||||
<g>
|
||||
<path class="st0" d="M85.2,72.8c-2.6,4.5-6.9,7.9-11.9,9.3c0.7-2.5,1.1-5,1.1-7.6c0-12.8-8.8-23.4-20.6-26.4c2.4-2.4,5.5-4.1,8.8-5
|
||||
c5.1-1.4,10.6-0.7,15.2,2C87.5,50.8,90.8,63.1,85.2,72.8 M47.4,94.7c-5.2,0-10.2-2.1-13.9-5.7c2.5-0.6,4.8-1.6,7-2.8
|
||||
c11-6.4,15.8-19.4,12.4-31.1c8.4,2.4,14.6,10.2,14.6,19.4C67.5,85.7,58.5,94.7,47.4,94.7 M9.6,72.8c-2.6-4.6-3.3-10-2.1-15
|
||||
c1.8,1.8,3.8,3.4,6,4.7c4.1,2.4,8.7,3.6,13.5,3.6c7.4,0,14.4-3,19.5-8.4c2.1,8.5-1.5,17.8-9.4,22.4c-3,1.8-6.5,2.7-10,2.7
|
||||
C19.9,82.9,13.2,79,9.6,72.8 M9.6,28.9c2.6-4.5,6.9-7.9,11.9-9.3c-0.7,2.5-1.1,5-1.1,7.6c0,12.7,8.8,23.4,20.6,26.4
|
||||
c-6.3,6.1-16.1,7.6-24,3c-4.6-2.7-8-7.1-9.4-12.3C6.2,39.1,6.9,33.5,9.6,28.9 M47.4,7c5.2,0,10.2,2.1,13.9,5.7
|
||||
c-2.5,0.6-4.8,1.6-7,2.8C48.1,19.1,43.6,25,41.7,32c-1.3,4.8-1.2,9.8,0.2,14.6c-8.4-2.4-14.6-10.2-14.6-19.4C27.3,16,36.3,7,47.4,7
|
||||
M85.2,28.9c2.6,4.6,3.3,10,2.1,15c-1.8-1.8-3.8-3.4-6-4.7c-6.2-3.6-13.5-4.6-20.5-2.7c-4.8,1.3-9.1,3.9-12.5,7.5
|
||||
c-0.8-3.3-0.8-6.8,0.1-10.1c1.4-5.2,4.7-9.6,9.4-12.3c4.6-2.7,10.1-3.4,15.2-2C78.2,20.9,82.5,24.2,85.2,28.9 M91.2,25.4
|
||||
c-3.6-6.3-9.4-10.8-16.4-12.7c-1.6-0.4-3.3-0.7-5-0.9C64.8,4.5,56.4,0,47.4,0c-9.3,0-17.5,4.7-22.3,11.9c-8.9,0.7-17,5.7-21.5,13.5
|
||||
C0,31.7-0.9,39,0.9,46c0.4,1.7,1,3.3,1.8,4.8c-3.9,8.1-3.6,17.6,0.9,25.4c4.6,8.1,12.8,12.8,21.4,13.5c5,7.4,13.4,11.9,22.4,11.9
|
||||
c9.3,0,17.5-4.7,22.3-11.9c8.9-0.7,17-5.7,21.5-13.5c4.6-8.1,4.7-17.6,0.9-25.4C96,42.8,95.7,33.2,91.2,25.4">
|
||||
</path>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 1.7 KiB |
|
@ -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",
|
||||
|
|
Loading…
Reference in a new issue