@pipedream/brevo 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/actions/add-or-update-contact/add-or-update-contact.mjs +20 -16
- package/actions/send-transactional-email/send-transactional-email.mjs +6 -1
- package/brevo.app.mjs +11 -1
- package/package.json +2 -2
- package/sources/marketing-webhook/marketing-webhook.mjs +1 -1
- package/sources/transactional-webhook/transactional-webhook.mjs +1 -1
|
@@ -4,7 +4,12 @@ export default {
|
|
|
4
4
|
key: "brevo-add-or-update-contact",
|
|
5
5
|
name: "Add or Update a contact",
|
|
6
6
|
description: "Add or Update a contact",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.6",
|
|
8
|
+
annotations: {
|
|
9
|
+
destructiveHint: true,
|
|
10
|
+
openWorldHint: true,
|
|
11
|
+
readOnlyHint: false,
|
|
12
|
+
},
|
|
8
13
|
type: "action",
|
|
9
14
|
props: {
|
|
10
15
|
brevo,
|
|
@@ -23,6 +28,12 @@ export default {
|
|
|
23
28
|
label: "Email",
|
|
24
29
|
description: "To either be inserted or updated",
|
|
25
30
|
},
|
|
31
|
+
listIds: {
|
|
32
|
+
propDefinition: [
|
|
33
|
+
brevo,
|
|
34
|
+
"listIds",
|
|
35
|
+
],
|
|
36
|
+
},
|
|
26
37
|
},
|
|
27
38
|
async additionalProps() {
|
|
28
39
|
const attributesList = await this.brevo.getContactAttributes(this);
|
|
@@ -37,22 +48,13 @@ export default {
|
|
|
37
48
|
};
|
|
38
49
|
return acc;
|
|
39
50
|
}, {});
|
|
40
|
-
|
|
41
|
-
...attributesFields,
|
|
42
|
-
listIds: {
|
|
43
|
-
type: "string[]",
|
|
44
|
-
label: "Lists",
|
|
45
|
-
description: "Array with ids of each list to be either inserted or updated,\n\n**On update the contact will be removed from previous lists**",
|
|
46
|
-
options: async ({ prevContext }) => {
|
|
47
|
-
return this.brevo.getListsPaginated(prevContext);
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
};
|
|
51
|
-
return dynamicProps;
|
|
51
|
+
return attributesFields;
|
|
52
52
|
},
|
|
53
53
|
async run({ $ }) {
|
|
54
|
-
let identifier = this.providedIdentifier;
|
|
55
|
-
const listIds =
|
|
54
|
+
let identifier = this.providedIdentifier || this.email;
|
|
55
|
+
const listIds = this.listIds
|
|
56
|
+
? Object.keys(this.listIds).map((key) => parseInt(this.listIds[key], 10))
|
|
57
|
+
: undefined;
|
|
56
58
|
let contact = null;
|
|
57
59
|
if (identifier) {
|
|
58
60
|
try {
|
|
@@ -77,7 +79,9 @@ export default {
|
|
|
77
79
|
if (contact) {
|
|
78
80
|
try {
|
|
79
81
|
identifier = contact.id;
|
|
80
|
-
const unlinkListIds =
|
|
82
|
+
const unlinkListIds = listIds
|
|
83
|
+
? contact.listIds.filter((el) => !listIds.includes(el))
|
|
84
|
+
: contact.listIds;
|
|
81
85
|
await this.brevo.updateContact(
|
|
82
86
|
$,
|
|
83
87
|
identifier,
|
|
@@ -4,7 +4,12 @@ export default {
|
|
|
4
4
|
key: "brevo-send-transactional-email",
|
|
5
5
|
name: "Send Transactional Email",
|
|
6
6
|
description: "Send transactional email. [See the docs](https://developers.brevo.com/reference/sendtransacemail) for more information.",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.3",
|
|
8
|
+
annotations: {
|
|
9
|
+
destructiveHint: false,
|
|
10
|
+
openWorldHint: true,
|
|
11
|
+
readOnlyHint: false,
|
|
12
|
+
},
|
|
8
13
|
type: "action",
|
|
9
14
|
props: {
|
|
10
15
|
brevo,
|
package/brevo.app.mjs
CHANGED
|
@@ -3,7 +3,17 @@ import { axios } from "@pipedream/platform";
|
|
|
3
3
|
export default {
|
|
4
4
|
type: "app",
|
|
5
5
|
app: "brevo",
|
|
6
|
-
propDefinitions: {
|
|
6
|
+
propDefinitions: {
|
|
7
|
+
listIds: {
|
|
8
|
+
type: "string[]",
|
|
9
|
+
label: "List IDs",
|
|
10
|
+
description: "Array with the IDs of one or more lists to be either inserted or updated,\n\n**On update the contact will be removed from previous lists**",
|
|
11
|
+
optional: true,
|
|
12
|
+
async options({ prevContext }) {
|
|
13
|
+
return this.getListsPaginated(prevContext);
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
},
|
|
7
17
|
methods: {
|
|
8
18
|
_getBaseUrl() {
|
|
9
19
|
return "https://api.brevo.com/v3";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pipedream/brevo",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Pipedream Brevo Components",
|
|
5
5
|
"main": "brevo.app.mjs",
|
|
6
6
|
"keywords": [
|
|
@@ -13,6 +13,6 @@
|
|
|
13
13
|
"access": "public"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@pipedream/platform": "^3.
|
|
16
|
+
"@pipedream/platform": "^3.1.1"
|
|
17
17
|
}
|
|
18
18
|
}
|
|
@@ -7,7 +7,7 @@ export default {
|
|
|
7
7
|
key: "brevo-transactional-webhook",
|
|
8
8
|
name: "New Transactional Webhook (Instant)",
|
|
9
9
|
description: "Emit new event when triggered by a transactional event",
|
|
10
|
-
version: "0.0.
|
|
10
|
+
version: "0.0.2",
|
|
11
11
|
type: "source",
|
|
12
12
|
dedupe: "unique",
|
|
13
13
|
props: {
|