@activepieces/piece-sendinblue 0.0.1 → 0.0.3
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/package.json +7 -5
- package/src/index.d.ts +1 -1
- package/src/index.js +2 -6
- package/src/index.js.map +1 -1
- package/src/lib/actions/create-or-update-contact.d.ts +1 -1
- package/src/lib/actions/create-or-update-contact.js +14 -13
- package/src/lib/actions/create-or-update-contact.js.map +1 -1
- package/src/lib/common/props.d.ts +1 -1
- package/src/lib/common/props.js +2 -2
- package/src/lib/common/props.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activepieces/piece-sendinblue",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@sinclair/typebox": "0.26.
|
|
5
|
+
"@sinclair/typebox": "0.26.8",
|
|
6
6
|
"axios": "1.2.4",
|
|
7
|
+
"lodash": "4.17.21",
|
|
7
8
|
"nanoid": "3.3.4",
|
|
8
|
-
"@activepieces/framework": "0.3.
|
|
9
|
-
"@activepieces/shared": "0.3.
|
|
10
|
-
"
|
|
9
|
+
"@activepieces/pieces-framework": "0.3.27",
|
|
10
|
+
"@activepieces/shared": "0.3.44",
|
|
11
|
+
"@activepieces/pieces-common": "0.0.7",
|
|
12
|
+
"tslib": "2.5.3"
|
|
11
13
|
},
|
|
12
14
|
"main": "./src/index.js",
|
|
13
15
|
"types": "./src/index.d.ts"
|
package/src/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const sendinblue: import("@activepieces/framework").Piece;
|
|
1
|
+
export declare const sendinblue: import("@activepieces/pieces-framework").Piece;
|
package/src/index.js
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.sendinblue = void 0;
|
|
4
|
-
const
|
|
5
|
-
const framework_1 = require("@activepieces/framework");
|
|
6
|
-
const package_json_1 = tslib_1.__importDefault(require("../package.json"));
|
|
4
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
5
|
const create_or_update_contact_1 = require("./lib/actions/create-or-update-contact");
|
|
8
|
-
exports.sendinblue = (0,
|
|
9
|
-
name: "sendinblue",
|
|
6
|
+
exports.sendinblue = (0, pieces_framework_1.createPiece)({
|
|
10
7
|
displayName: "Sendinblue",
|
|
11
8
|
logoUrl: "https://cdn.activepieces.com/pieces/sendinblue.png",
|
|
12
|
-
version: package_json_1.default.version,
|
|
13
9
|
authors: ['kanarelo'],
|
|
14
10
|
actions: [create_or_update_contact_1.createOrUpdateContact],
|
|
15
11
|
triggers: [],
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/pieces/sendinblue/src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/pieces/sendinblue/src/index.ts"],"names":[],"mappings":";;;AACA,qEAA6D;AAC7D,qFAA+E;AAElE,QAAA,UAAU,GAAG,IAAA,8BAAW,EAAC;IACpC,WAAW,EAAE,YAAY;IACzB,OAAO,EAAE,oDAAoD;IAC7D,OAAO,EAAE,CAAC,UAAU,CAAC;IACrB,OAAO,EAAE,CAAC,gDAAqB,CAAC;IAChC,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const createOrUpdateContact: import("@activepieces/framework").Action;
|
|
1
|
+
export declare const createOrUpdateContact: import("@activepieces/pieces-framework").Action;
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createOrUpdateContact = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
6
7
|
const props_1 = require("../common/props");
|
|
7
|
-
exports.createOrUpdateContact = (0,
|
|
8
|
+
exports.createOrUpdateContact = (0, pieces_framework_1.createAction)({
|
|
8
9
|
name: 'create_or_update_contact',
|
|
9
10
|
displayName: 'Create or Update Contact',
|
|
10
11
|
description: 'Create or update an existing contact',
|
|
@@ -32,17 +33,17 @@ exports.createOrUpdateContact = (0, framework_1.createAction)({
|
|
|
32
33
|
},
|
|
33
34
|
props: {
|
|
34
35
|
api_key: props_1.sendInBluePropsContactsProps.api_key,
|
|
35
|
-
email:
|
|
36
|
+
email: pieces_framework_1.Property.ShortText({
|
|
36
37
|
displayName: "Email",
|
|
37
38
|
description: `Email address of the user. Mandatory if "SMS" field is not passed in "attributes" parameter. Mobile Number in SMS field should be passed with proper country code. For example: {"SMS":"+91xxxxxxxxxx"} or {"SMS":"0091xxxxxxxxxx"}`,
|
|
38
39
|
required: true
|
|
39
40
|
}),
|
|
40
|
-
ext_id:
|
|
41
|
+
ext_id: pieces_framework_1.Property.ShortText({
|
|
41
42
|
displayName: "External ID",
|
|
42
43
|
description: `Pass your own Id to create a contact.`,
|
|
43
44
|
required: false
|
|
44
45
|
}),
|
|
45
|
-
attributes:
|
|
46
|
+
attributes: pieces_framework_1.Property.Object({
|
|
46
47
|
displayName: "Attributes",
|
|
47
48
|
description: `Pass the set of attributes and their values. The attribute's parameter should be passed in capital letter while creating a contact. These attributes must be present in your SendinBlue account. For eg:
|
|
48
49
|
{"FNAME":"Elly", "LNAME":"Roger"}`,
|
|
@@ -59,25 +60,25 @@ exports.createOrUpdateContact = (0, framework_1.createAction)({
|
|
|
59
60
|
"AREA": ""
|
|
60
61
|
}
|
|
61
62
|
}),
|
|
62
|
-
email_blacklisted:
|
|
63
|
+
email_blacklisted: pieces_framework_1.Property.Checkbox({
|
|
63
64
|
displayName: "Email Blacklisted?",
|
|
64
65
|
description: `Set this field to blacklist the contact for emails (emailBlacklisted = true)`,
|
|
65
66
|
required: false,
|
|
66
67
|
defaultValue: false
|
|
67
68
|
}),
|
|
68
|
-
sms_blacklisted:
|
|
69
|
+
sms_blacklisted: pieces_framework_1.Property.Checkbox({
|
|
69
70
|
displayName: "SMS Blacklisted?",
|
|
70
71
|
description: `Set this field to blacklist the contact for SMS (smsBlacklisted = true)`,
|
|
71
72
|
required: false,
|
|
72
73
|
defaultValue: false
|
|
73
74
|
}),
|
|
74
|
-
list_ids:
|
|
75
|
+
list_ids: pieces_framework_1.Property.Array({
|
|
75
76
|
displayName: "List IDs",
|
|
76
77
|
description: `Ids of the lists to add the contact to.`,
|
|
77
78
|
required: false,
|
|
78
79
|
defaultValue: []
|
|
79
80
|
}),
|
|
80
|
-
smtp_blacklist_sender:
|
|
81
|
+
smtp_blacklist_sender: pieces_framework_1.Property.Checkbox({
|
|
81
82
|
displayName: "SMTP Blacklist Sender",
|
|
82
83
|
description: `transactional email forbidden sender for contact. Use only for email Contact ( only available if updateEnabled = true )`,
|
|
83
84
|
required: false,
|
|
@@ -101,8 +102,8 @@ exports.createOrUpdateContact = (0, framework_1.createAction)({
|
|
|
101
102
|
// filter out undefined values
|
|
102
103
|
const body = Object.fromEntries(Object.entries(contact).filter(([_, value]) => Boolean(value)));
|
|
103
104
|
console.log("Contact update request " + identifier);
|
|
104
|
-
const updateResponse = yield
|
|
105
|
-
method:
|
|
105
|
+
const updateResponse = yield pieces_common_1.httpClient.sendRequest({
|
|
106
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
106
107
|
url: `https://api.sendinblue.com/v3/contacts`,
|
|
107
108
|
body,
|
|
108
109
|
headers: {
|
|
@@ -110,8 +111,8 @@ exports.createOrUpdateContact = (0, framework_1.createAction)({
|
|
|
110
111
|
}
|
|
111
112
|
});
|
|
112
113
|
console.debug("Contact update response", updateResponse);
|
|
113
|
-
const contactREsponse = yield
|
|
114
|
-
method:
|
|
114
|
+
const contactREsponse = yield pieces_common_1.httpClient.sendRequest({
|
|
115
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
115
116
|
url: `https://api.sendinblue.com/v3/contacts/${encodeURI(identifier)}`,
|
|
116
117
|
headers: {
|
|
117
118
|
'api-key': context.propsValue.api_key
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-or-update-contact.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/sendinblue/src/lib/actions/create-or-update-contact.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"create-or-update-contact.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/sendinblue/src/lib/actions/create-or-update-contact.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAqE;AACrE,2CAA+D;AAElD,QAAA,qBAAqB,GAAG,IAAA,+BAAY,EAAC;IAChD,IAAI,EAAE,0BAA0B;IAChC,WAAW,EAAE,0BAA0B;IACvC,WAAW,EAAE,sCAAsC;IACnD,UAAU,EAAE;QACV,IAAI,EACF,EAAE;QACJ,OAAO,EAAE,wBAAwB;QACjC,kBAAkB,EAAE,KAAK;QACzB,gBAAgB,EAAE,KAAK;QACvB,WAAW,EAAE,sBAAsB;QACnC,YAAY,EAAE,sBAAsB;QACpC,YAAY,EAAE;YACZ,YAAY,EAAE,OAAO;YACrB,WAAW,EAAE,MAAM;YACnB,KAAK,EAAE,eAAe;YACtB,KAAK,EAAE,GAAG;YACV,KAAK,EAAE,YAAY;YACnB,SAAS,EAAE,gBAAgB;YAC3B,UAAU,EAAE,OAAO;YACnB,MAAM,EAAE,UAAU;YAClB,MAAM,EAAE,IAAI;SACb;QACD,SAAS,EAAE;YACT,EAAE;SACH;KACF;IACD,KAAK,EAAE;QACL,OAAO,EAAE,oCAA4B,CAAC,OAAO;QAC7C,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,OAAO;YACpB,WAAW,EAAE,qOAAqO;YAClP,QAAQ,EAAE,IAAI;SACf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O,CAAC,UAAU,CAAC,OAAO;iBACtC;aACF,CAAC,CAAA;YACF,OAAO,eAAe,CAAC,IAAI,CAAC;QAC9B,CAAC;KAAA;CACF,CAAC,CAAC"}
|
package/src/lib/common/props.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.sendInBluePropsContactsProps = void 0;
|
|
4
|
-
const
|
|
4
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
5
5
|
exports.sendInBluePropsContactsProps = {
|
|
6
|
-
api_key:
|
|
6
|
+
api_key: pieces_framework_1.Property.SecretText({
|
|
7
7
|
displayName: "Project API key",
|
|
8
8
|
description: "Your project API key",
|
|
9
9
|
required: true
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/sendinblue/src/lib/common/props.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"props.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/sendinblue/src/lib/common/props.ts"],"names":[],"mappings":";;;AAAA,qEAA0D;AAE7C,QAAA,4BAA4B,GAAG;IAC1C,OAAO,EAAE,2BAAQ,CAAC,UAAU,CAAC;QAC3B,WAAW,EAAE,iBAAiB;QAC9B,WAAW,EAAE,sBAAsB;QACnC,QAAQ,EAAE,IAAI;KACf,CAAC;CACH,CAAA"}
|