@activepieces/piece-elastic-email 0.2.0
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 +17 -0
- package/src/index.d.ts +2 -0
- package/src/index.d.ts.map +1 -0
- package/src/index.js +51 -0
- package/src/index.js.map +1 -0
- package/src/lib/actions/add-contact.d.ts +12 -0
- package/src/lib/actions/add-contact.d.ts.map +1 -0
- package/src/lib/actions/add-contact.js +95 -0
- package/src/lib/actions/add-contact.js.map +1 -0
- package/src/lib/actions/create-campaign.d.ts +11 -0
- package/src/lib/actions/create-campaign.d.ts.map +1 -0
- package/src/lib/actions/create-campaign.js +79 -0
- package/src/lib/actions/create-campaign.js.map +1 -0
- package/src/lib/actions/create-contact.d.ts +8 -0
- package/src/lib/actions/create-contact.d.ts.map +1 -0
- package/src/lib/actions/create-contact.js +63 -0
- package/src/lib/actions/create-contact.js.map +1 -0
- package/src/lib/actions/create-segment.d.ts +5 -0
- package/src/lib/actions/create-segment.d.ts.map +1 -0
- package/src/lib/actions/create-segment.js +39 -0
- package/src/lib/actions/create-segment.js.map +1 -0
- package/src/lib/actions/list-campaigns.d.ts +6 -0
- package/src/lib/actions/list-campaigns.d.ts.map +1 -0
- package/src/lib/actions/list-campaigns.js +55 -0
- package/src/lib/actions/list-campaigns.js.map +1 -0
- package/src/lib/actions/list-contacts.d.ts +5 -0
- package/src/lib/actions/list-contacts.d.ts.map +1 -0
- package/src/lib/actions/list-contacts.js +47 -0
- package/src/lib/actions/list-contacts.js.map +1 -0
- package/src/lib/actions/send-email.d.ts +17 -0
- package/src/lib/actions/send-email.d.ts.map +1 -0
- package/src/lib/actions/send-email.js +128 -0
- package/src/lib/actions/send-email.js.map +1 -0
- package/src/lib/actions/unsubscribe-contact.d.ts +4 -0
- package/src/lib/actions/unsubscribe-contact.d.ts.map +1 -0
- package/src/lib/actions/unsubscribe-contact.js +34 -0
- package/src/lib/actions/unsubscribe-contact.js.map +1 -0
- package/src/lib/actions/update-campaign.d.ts +12 -0
- package/src/lib/actions/update-campaign.d.ts.map +1 -0
- package/src/lib/actions/update-campaign.js +89 -0
- package/src/lib/actions/update-campaign.js.map +1 -0
- package/src/lib/actions/update-contact.d.ts +7 -0
- package/src/lib/actions/update-contact.d.ts.map +1 -0
- package/src/lib/actions/update-contact.js +47 -0
- package/src/lib/actions/update-contact.js.map +1 -0
- package/src/lib/auth.d.ts +2 -0
- package/src/lib/auth.d.ts.map +1 -0
- package/src/lib/auth.js +59 -0
- package/src/lib/auth.js.map +1 -0
- package/src/lib/common/client.d.ts +9 -0
- package/src/lib/common/client.d.ts.map +1 -0
- package/src/lib/common/client.js +19 -0
- package/src/lib/common/client.js.map +1 -0
- package/src/lib/common/constants.d.ts +8 -0
- package/src/lib/common/constants.d.ts.map +1 -0
- package/src/lib/common/constants.js +47 -0
- package/src/lib/common/constants.js.map +1 -0
- package/src/lib/common/props.d.ts +6 -0
- package/src/lib/common/props.d.ts.map +1 -0
- package/src/lib/common/props.js +165 -0
- package/src/lib/common/props.js.map +1 -0
package/package.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@activepieces/piece-elastic-email",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"main": "./src/index.js",
|
|
5
|
+
"types": "./src/index.d.ts",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "tsc -p tsconfig.lib.json && cp package.json dist/",
|
|
8
|
+
"lint": "eslint 'src/**/*.ts'"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"@activepieces/pieces-common": "0.12.0",
|
|
12
|
+
"@activepieces/pieces-framework": "0.26.0",
|
|
13
|
+
"@activepieces/shared": "0.51.0",
|
|
14
|
+
"zod": "4.3.6",
|
|
15
|
+
"tslib": "2.6.2"
|
|
16
|
+
}
|
|
17
|
+
}
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,YAAY,mHA6BvB,CAAC"}
|
package/src/index.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.elasticEmail = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
6
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
|
+
const shared_1 = require("@activepieces/shared");
|
|
8
|
+
const auth_1 = require("./lib/auth");
|
|
9
|
+
const constants_1 = require("./lib/common/constants");
|
|
10
|
+
const add_contact_1 = require("./lib/actions/add-contact");
|
|
11
|
+
const create_campaign_1 = require("./lib/actions/create-campaign");
|
|
12
|
+
const create_contact_1 = require("./lib/actions/create-contact");
|
|
13
|
+
const create_segment_1 = require("./lib/actions/create-segment");
|
|
14
|
+
const list_campaigns_1 = require("./lib/actions/list-campaigns");
|
|
15
|
+
const list_contacts_1 = require("./lib/actions/list-contacts");
|
|
16
|
+
const send_email_1 = require("./lib/actions/send-email");
|
|
17
|
+
const unsubscribe_contact_1 = require("./lib/actions/unsubscribe-contact");
|
|
18
|
+
const update_campaign_1 = require("./lib/actions/update-campaign");
|
|
19
|
+
const update_contact_1 = require("./lib/actions/update-contact");
|
|
20
|
+
exports.elasticEmail = (0, pieces_framework_1.createPiece)({
|
|
21
|
+
displayName: 'Elastic Email',
|
|
22
|
+
description: 'Email delivery and marketing platform for sending emails, managing contacts, campaigns, and segments.',
|
|
23
|
+
auth: auth_1.elasticEmailAuth,
|
|
24
|
+
minimumSupportedRelease: '0.36.1',
|
|
25
|
+
logoUrl: 'https://cdn.activepieces.com/pieces/elastic-email.png',
|
|
26
|
+
authors: ['Harmatta'],
|
|
27
|
+
categories: [shared_1.PieceCategory.MARKETING],
|
|
28
|
+
actions: [
|
|
29
|
+
add_contact_1.addContactAction,
|
|
30
|
+
create_campaign_1.createCampaignAction,
|
|
31
|
+
create_contact_1.createContactAction,
|
|
32
|
+
create_segment_1.createSegmentAction,
|
|
33
|
+
list_campaigns_1.listCampaignsAction,
|
|
34
|
+
list_contacts_1.listContactsAction,
|
|
35
|
+
send_email_1.sendEmailAction,
|
|
36
|
+
unsubscribe_contact_1.unsubscribeContactAction,
|
|
37
|
+
update_campaign_1.updateCampaignAction,
|
|
38
|
+
update_contact_1.updateContactAction,
|
|
39
|
+
(0, pieces_common_1.createCustomApiCallAction)({
|
|
40
|
+
baseUrl: () => constants_1.ELASTIC_EMAIL_API_BASE,
|
|
41
|
+
auth: auth_1.elasticEmailAuth,
|
|
42
|
+
authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
43
|
+
return ({
|
|
44
|
+
'X-ElasticEmail-ApiKey': auth.secret_text,
|
|
45
|
+
});
|
|
46
|
+
}),
|
|
47
|
+
}),
|
|
48
|
+
],
|
|
49
|
+
triggers: [],
|
|
50
|
+
});
|
|
51
|
+
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,+DAAwE;AACxE,qEAA6D;AAC7D,iDAAqD;AAErD,qCAA8C;AAC9C,sDAAgE;AAChE,2DAA6D;AAC7D,mEAAqE;AACrE,iEAAmE;AACnE,iEAAmE;AACnE,iEAAmE;AACnE,+DAAiE;AACjE,yDAA2D;AAC3D,2EAA6E;AAC7E,mEAAqE;AACrE,iEAAmE;AAEtD,QAAA,YAAY,GAAG,IAAA,8BAAW,EAAC;IACtC,WAAW,EAAE,eAAe;IAC5B,WAAW,EACT,uGAAuG;IACzG,IAAI,EAAE,uBAAgB;IACtB,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,uDAAuD;IAChE,OAAO,EAAE,CAAC,UAAU,CAAC;IACrB,UAAU,EAAE,CAAC,sBAAa,CAAC,SAAS,CAAC;IACrC,OAAO,EAAE;QACP,8BAAgB;QAChB,sCAAoB;QACpB,oCAAmB;QACnB,oCAAmB;QACnB,oCAAmB;QACnB,kCAAkB;QAClB,4BAAe;QACf,8CAAwB;QACxB,sCAAoB;QACpB,oCAAmB;QACnB,IAAA,yCAAyB,EAAC;YACxB,OAAO,EAAE,GAAG,EAAE,CAAC,kCAAsB;YACrC,IAAI,EAAE,uBAAgB;YACtB,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAAC,OAAA,CAAC;oBAC5B,uBAAuB,EAAE,IAAI,CAAC,WAAW;iBAC1C,CAAC,CAAA;cAAA;SACH,CAAC;KACH;IACD,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const addContactAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
+
email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
+
listNames: import("@activepieces/pieces-framework").MultiSelectDropdownProperty<string, false, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
4
|
+
status: import("@activepieces/pieces-framework").StaticDropdownProperty<"Transactional" | "Engaged" | "Active" | "Bounced" | "Unsubscribed" | "Abuse" | "Inactive" | "Stale" | "NotConfirmed", false>;
|
|
5
|
+
firstName: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
6
|
+
lastName: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
7
|
+
customFields: import("@activepieces/pieces-framework").ObjectProperty<false>;
|
|
8
|
+
consentIP: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
9
|
+
consentDate: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
10
|
+
consentTracking: import("@activepieces/pieces-framework").StaticDropdownProperty<"Unknown" | "Allow" | "Deny", false>;
|
|
11
|
+
}>;
|
|
12
|
+
//# sourceMappingURL=add-contact.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-contact.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/add-contact.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,gBAAgB;;;;;;;;;;EAqF3B,CAAC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addContactAction = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
6
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
|
+
const auth_1 = require("../auth");
|
|
8
|
+
const client_1 = require("../common/client");
|
|
9
|
+
const constants_1 = require("../common/constants");
|
|
10
|
+
const props_1 = require("../common/props");
|
|
11
|
+
exports.addContactAction = (0, pieces_framework_1.createAction)({
|
|
12
|
+
name: 'add_contact',
|
|
13
|
+
displayName: 'Add Contact to Mailing List',
|
|
14
|
+
description: 'Add a new contact to one or more mailing lists in Elastic Email.',
|
|
15
|
+
auth: auth_1.elasticEmailAuth,
|
|
16
|
+
props: {
|
|
17
|
+
email: pieces_framework_1.Property.ShortText({
|
|
18
|
+
displayName: 'Email',
|
|
19
|
+
description: 'The email address of the contact.',
|
|
20
|
+
required: true,
|
|
21
|
+
}),
|
|
22
|
+
listNames: props_1.listNamesProp,
|
|
23
|
+
status: pieces_framework_1.Property.StaticDropdown({
|
|
24
|
+
displayName: 'Status',
|
|
25
|
+
description: 'Initial status of the contact.',
|
|
26
|
+
required: false,
|
|
27
|
+
options: {
|
|
28
|
+
options: constants_1.CONTACT_STATUS_OPTIONS.map((s) => ({ label: s, value: s })),
|
|
29
|
+
},
|
|
30
|
+
}),
|
|
31
|
+
firstName: pieces_framework_1.Property.ShortText({
|
|
32
|
+
displayName: 'First Name',
|
|
33
|
+
required: false,
|
|
34
|
+
}),
|
|
35
|
+
lastName: pieces_framework_1.Property.ShortText({
|
|
36
|
+
displayName: 'Last Name',
|
|
37
|
+
required: false,
|
|
38
|
+
}),
|
|
39
|
+
customFields: pieces_framework_1.Property.Object({
|
|
40
|
+
displayName: 'Custom Fields',
|
|
41
|
+
description: 'Key-value pairs of custom contact fields. Only existing custom fields will be saved.',
|
|
42
|
+
required: false,
|
|
43
|
+
}),
|
|
44
|
+
consentIP: pieces_framework_1.Property.ShortText({
|
|
45
|
+
displayName: 'Consent IP',
|
|
46
|
+
description: 'IP address of consent. If not provided, your current public IP is used.',
|
|
47
|
+
required: false,
|
|
48
|
+
}),
|
|
49
|
+
consentDate: pieces_framework_1.Property.ShortText({
|
|
50
|
+
displayName: 'Consent Date',
|
|
51
|
+
description: 'ISO 8601 date of consent. If not provided, current date is used.',
|
|
52
|
+
required: false,
|
|
53
|
+
}),
|
|
54
|
+
consentTracking: pieces_framework_1.Property.StaticDropdown({
|
|
55
|
+
displayName: 'Consent Tracking',
|
|
56
|
+
description: 'Consent tracking level. Defaults to "Unknown".',
|
|
57
|
+
required: false,
|
|
58
|
+
options: {
|
|
59
|
+
options: constants_1.CONSENT_TRACKING_OPTIONS.map((s) => ({ label: s, value: s })),
|
|
60
|
+
},
|
|
61
|
+
}),
|
|
62
|
+
},
|
|
63
|
+
run(_a) {
|
|
64
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
|
|
65
|
+
var _b, _c, _d, _e, _f, _g, _h;
|
|
66
|
+
const queryParams = {};
|
|
67
|
+
if (propsValue.listNames) {
|
|
68
|
+
queryParams['listnames'] = Array.isArray(propsValue.listNames)
|
|
69
|
+
? propsValue.listNames.join(',')
|
|
70
|
+
: String(propsValue.listNames);
|
|
71
|
+
}
|
|
72
|
+
return (0, client_1.elasticEmailRequest)({
|
|
73
|
+
apiKey: auth.secret_text,
|
|
74
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
75
|
+
path: '/contacts',
|
|
76
|
+
queryParams: Object.keys(queryParams).length > 0 ? queryParams : undefined,
|
|
77
|
+
body: [
|
|
78
|
+
{
|
|
79
|
+
Email: propsValue.email,
|
|
80
|
+
Status: (_b = propsValue.status) !== null && _b !== void 0 ? _b : undefined,
|
|
81
|
+
FirstName: (_c = propsValue.firstName) !== null && _c !== void 0 ? _c : undefined,
|
|
82
|
+
LastName: (_d = propsValue.lastName) !== null && _d !== void 0 ? _d : undefined,
|
|
83
|
+
CustomFields: (_e = propsValue.customFields) !== null && _e !== void 0 ? _e : undefined,
|
|
84
|
+
Consent: {
|
|
85
|
+
ConsentIP: (_f = propsValue.consentIP) !== null && _f !== void 0 ? _f : undefined,
|
|
86
|
+
ConsentDate: (_g = propsValue.consentDate) !== null && _g !== void 0 ? _g : undefined,
|
|
87
|
+
ConsentTracking: (_h = propsValue.consentTracking) !== null && _h !== void 0 ? _h : undefined,
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
},
|
|
94
|
+
});
|
|
95
|
+
//# sourceMappingURL=add-contact.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-contact.js","sourceRoot":"","sources":["../../../../src/lib/actions/add-contact.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const createCampaignAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
+
name: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
+
from: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
recipientListNames: import("@activepieces/pieces-framework").MultiSelectDropdownProperty<string, false, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
5
|
+
recipientSegmentNames: import("@activepieces/pieces-framework").MultiSelectDropdownProperty<string, false, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
6
|
+
replyTo: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
7
|
+
status: import("@activepieces/pieces-framework").StaticDropdownProperty<"Active" | "Deleted" | "Processing" | "Sending" | "Completed" | "Paused" | "Cancelled" | "Draft", true>;
|
|
8
|
+
subject: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
9
|
+
templateName: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
10
|
+
}>;
|
|
11
|
+
//# sourceMappingURL=create-campaign.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-campaign.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/create-campaign.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,oBAAoB;;;;;;;;;EAiE/B,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createCampaignAction = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
6
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
|
+
const auth_1 = require("../auth");
|
|
8
|
+
const client_1 = require("../common/client");
|
|
9
|
+
const constants_1 = require("../common/constants");
|
|
10
|
+
const props_1 = require("../common/props");
|
|
11
|
+
exports.createCampaignAction = (0, pieces_framework_1.createAction)({
|
|
12
|
+
name: 'create_campaign',
|
|
13
|
+
displayName: 'Create Campaign',
|
|
14
|
+
description: 'Create a new email campaign in Elastic Email.',
|
|
15
|
+
auth: auth_1.elasticEmailAuth,
|
|
16
|
+
props: {
|
|
17
|
+
name: pieces_framework_1.Property.ShortText({
|
|
18
|
+
displayName: 'Campaign Name',
|
|
19
|
+
required: true,
|
|
20
|
+
}),
|
|
21
|
+
from: pieces_framework_1.Property.ShortText({
|
|
22
|
+
displayName: 'From',
|
|
23
|
+
description: 'Sender email with optional name (e.g. `email@domain.com` or `John Doe <email@domain.com>`).',
|
|
24
|
+
required: true,
|
|
25
|
+
}),
|
|
26
|
+
recipientListNames: props_1.listNamesProp,
|
|
27
|
+
recipientSegmentNames: props_1.segmentNamesProp,
|
|
28
|
+
replyTo: pieces_framework_1.Property.ShortText({
|
|
29
|
+
displayName: 'Reply To',
|
|
30
|
+
description: 'Reply-to email address.',
|
|
31
|
+
required: true,
|
|
32
|
+
}),
|
|
33
|
+
status: pieces_framework_1.Property.StaticDropdown({
|
|
34
|
+
displayName: 'Status',
|
|
35
|
+
description: 'Initial campaign status.',
|
|
36
|
+
required: true,
|
|
37
|
+
options: {
|
|
38
|
+
options: constants_1.CAMPAIGN_STATUS_OPTIONS.map((s) => ({ label: s, value: s })),
|
|
39
|
+
},
|
|
40
|
+
}),
|
|
41
|
+
subject: pieces_framework_1.Property.ShortText({
|
|
42
|
+
displayName: 'Subject',
|
|
43
|
+
description: 'Default email subject line.',
|
|
44
|
+
required: false,
|
|
45
|
+
}),
|
|
46
|
+
templateName: props_1.templateNameProp,
|
|
47
|
+
},
|
|
48
|
+
run(_a) {
|
|
49
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
|
|
50
|
+
var _b, _c;
|
|
51
|
+
return (0, client_1.elasticEmailRequest)({
|
|
52
|
+
apiKey: auth.secret_text,
|
|
53
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
54
|
+
path: '/campaigns',
|
|
55
|
+
body: {
|
|
56
|
+
Name: propsValue.name,
|
|
57
|
+
Recipients: {
|
|
58
|
+
ListNames: propsValue.recipientListNames && propsValue.recipientListNames.length > 0
|
|
59
|
+
? propsValue.recipientListNames
|
|
60
|
+
: undefined,
|
|
61
|
+
SegmentNames: propsValue.recipientSegmentNames && propsValue.recipientSegmentNames.length > 0
|
|
62
|
+
? propsValue.recipientSegmentNames
|
|
63
|
+
: undefined,
|
|
64
|
+
},
|
|
65
|
+
Content: [
|
|
66
|
+
{
|
|
67
|
+
From: propsValue.from,
|
|
68
|
+
ReplyTo: propsValue.replyTo,
|
|
69
|
+
Subject: (_b = propsValue.subject) !== null && _b !== void 0 ? _b : undefined,
|
|
70
|
+
TemplateName: (_c = propsValue.templateName) !== null && _c !== void 0 ? _c : undefined,
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
Status: propsValue.status,
|
|
74
|
+
},
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
//# sourceMappingURL=create-campaign.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-campaign.js","sourceRoot":"","sources":["../../../../src/lib/actions/create-campaign.ts"],"names":[],"mappings":";;;;AAAA,+DAAyD;AACzD,qEAAwE;AAExE,kCAA2C;AAC3C,6CAAuD;AACvD,mDAA8D;AAC9D,2CAIyB;AAEZ,QAAA,oBAAoB,GAAG,IAAA,+BAAY,EAAC;IAC/C,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,iBAAiB;IAC9B,WAAW,EAAE,+CAA+C;IAC5D,IAAI,EAAE,uBAAgB;IACtB,KAAK,EAAE;QACL,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACvB,WAAW,EAAE,eAAe;YAC5B,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACvB,WAAW,EAAE,MAAM;YACnB,WAAW,EACT,6FAA6F;YAC/F,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,kBAAkB,EAAE,qBAAa;QACjC,qBAAqB,EAAE,wBAAgB;QACvC,OAAO,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC1B,WAAW,EAAE,UAAU;YACvB,WAAW,EAAE,yBAAyB;YACtC,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,MAAM,EAAE,2BAAQ,CAAC,cAAc,CAAC;YAC9B,WAAW,EAAE,QAAQ;YACrB,WAAW,EAAE,0BAA0B;YACvC,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,mCAAuB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;aACtE;SACF,CAAC;QACF,OAAO,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC1B,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,6BAA6B;YAC1C,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,YAAY,EAAE,wBAAgB;KAC/B;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;;YAC5B,OAAO,IAAA,4BAAmB,EAAC;gBACzB,MAAM,EAAE,IAAI,CAAC,WAAW;gBACxB,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,IAAI,EAAE,YAAY;gBAClB,IAAI,EAAE;oBACJ,IAAI,EAAE,UAAU,CAAC,IAAI;oBACrB,UAAU,EAAE;wBACV,SAAS,EAAE,UAAU,CAAC,kBAAkB,IAAI,UAAU,CAAC,kBAAkB,CAAC,MAAM,GAAG,CAAC;4BAClF,CAAC,CAAC,UAAU,CAAC,kBAAkB;4BAC/B,CAAC,CAAC,SAAS;wBACb,YAAY,EAAE,UAAU,CAAC,qBAAqB,IAAI,UAAU,CAAC,qBAAqB,CAAC,MAAM,GAAG,CAAC;4BAC3F,CAAC,CAAC,UAAU,CAAC,qBAAqB;4BAClC,CAAC,CAAC,SAAS;qBACd;oBACD,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,UAAU,CAAC,IAAI;4BACrB,OAAO,EAAE,UAAU,CAAC,OAAO;4BAC3B,OAAO,EAAE,MAAA,UAAU,CAAC,OAAO,mCAAI,SAAS;4BACxC,YAAY,EAAE,MAAA,UAAU,CAAC,YAAY,mCAAI,SAAS;yBACnD;qBACF;oBACD,MAAM,EAAE,UAAU,CAAC,MAAM;iBAC1B;aACF,CAAC,CAAC;QACL,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const createContactAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
+
email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
+
status: import("@activepieces/pieces-framework").StaticDropdownProperty<"Transactional" | "Engaged" | "Active" | "Bounced" | "Unsubscribed" | "Abuse" | "Inactive" | "Stale" | "NotConfirmed", false>;
|
|
4
|
+
firstName: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
5
|
+
lastName: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
6
|
+
customFields: import("@activepieces/pieces-framework").ObjectProperty<false>;
|
|
7
|
+
}>;
|
|
8
|
+
//# sourceMappingURL=create-contact.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-contact.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/create-contact.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,mBAAmB;;;;;;EAkD9B,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createContactAction = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
6
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
|
+
const auth_1 = require("../auth");
|
|
8
|
+
const client_1 = require("../common/client");
|
|
9
|
+
const constants_1 = require("../common/constants");
|
|
10
|
+
exports.createContactAction = (0, pieces_framework_1.createAction)({
|
|
11
|
+
name: 'create_contact',
|
|
12
|
+
displayName: 'Create Contact',
|
|
13
|
+
description: 'Create a new contact in Elastic Email.',
|
|
14
|
+
auth: auth_1.elasticEmailAuth,
|
|
15
|
+
props: {
|
|
16
|
+
email: pieces_framework_1.Property.ShortText({
|
|
17
|
+
displayName: 'Email',
|
|
18
|
+
description: 'The email address of the contact.',
|
|
19
|
+
required: true,
|
|
20
|
+
}),
|
|
21
|
+
status: pieces_framework_1.Property.StaticDropdown({
|
|
22
|
+
displayName: 'Status',
|
|
23
|
+
description: 'Initial status of the contact.',
|
|
24
|
+
required: false,
|
|
25
|
+
options: {
|
|
26
|
+
options: constants_1.CONTACT_STATUS_OPTIONS.map((s) => ({ label: s, value: s })),
|
|
27
|
+
},
|
|
28
|
+
}),
|
|
29
|
+
firstName: pieces_framework_1.Property.ShortText({
|
|
30
|
+
displayName: 'First Name',
|
|
31
|
+
required: false,
|
|
32
|
+
}),
|
|
33
|
+
lastName: pieces_framework_1.Property.ShortText({
|
|
34
|
+
displayName: 'Last Name',
|
|
35
|
+
required: false,
|
|
36
|
+
}),
|
|
37
|
+
customFields: pieces_framework_1.Property.Object({
|
|
38
|
+
displayName: 'Custom Fields',
|
|
39
|
+
description: 'Key-value pairs of custom contact fields. Only existing custom fields will be saved.',
|
|
40
|
+
required: false,
|
|
41
|
+
}),
|
|
42
|
+
},
|
|
43
|
+
run(_a) {
|
|
44
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
|
|
45
|
+
var _b, _c, _d, _e;
|
|
46
|
+
return (0, client_1.elasticEmailRequest)({
|
|
47
|
+
apiKey: auth.secret_text,
|
|
48
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
49
|
+
path: '/contacts',
|
|
50
|
+
body: [
|
|
51
|
+
{
|
|
52
|
+
Email: propsValue.email,
|
|
53
|
+
Status: (_b = propsValue.status) !== null && _b !== void 0 ? _b : undefined,
|
|
54
|
+
FirstName: (_c = propsValue.firstName) !== null && _c !== void 0 ? _c : undefined,
|
|
55
|
+
LastName: (_d = propsValue.lastName) !== null && _d !== void 0 ? _d : undefined,
|
|
56
|
+
CustomFields: (_e = propsValue.customFields) !== null && _e !== void 0 ? _e : undefined,
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
//# sourceMappingURL=create-contact.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-contact.js","sourceRoot":"","sources":["../../../../src/lib/actions/create-contact.ts"],"names":[],"mappings":";;;;AAAA,+DAAyD;AACzD,qEAAwE;AAExE,kCAA2C;AAC3C,6CAAuD;AACvD,mDAA6D;AAEhD,QAAA,mBAAmB,GAAG,IAAA,+BAAY,EAAC;IAC9C,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,wCAAwC;IACrD,IAAI,EAAE,uBAAgB;IACtB,KAAK,EAAE;QACL,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,OAAO;YACpB,WAAW,EAAE,mCAAmC;YAChD,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,MAAM,EAAE,2BAAQ,CAAC,cAAc,CAAC;YAC9B,WAAW,EAAE,QAAQ;YACrB,WAAW,EAAE,gCAAgC;YAC7C,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE;gBACP,OAAO,EAAE,kCAAsB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;aACrE;SACF,CAAC;QACF,SAAS,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC5B,WAAW,EAAE,YAAY;YACzB,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,QAAQ,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC3B,WAAW,EAAE,WAAW;YACxB,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,YAAY,EAAE,2BAAQ,CAAC,MAAM,CAAC;YAC5B,WAAW,EAAE,eAAe;YAC5B,WAAW,EACT,sFAAsF;YACxF,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;;YAC5B,OAAO,IAAA,4BAAmB,EAAC;gBACzB,MAAM,EAAE,IAAI,CAAC,WAAW;gBACxB,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE;oBACJ;wBACE,KAAK,EAAE,UAAU,CAAC,KAAK;wBACvB,MAAM,EAAE,MAAA,UAAU,CAAC,MAAM,mCAAI,SAAS;wBACtC,SAAS,EAAE,MAAA,UAAU,CAAC,SAAS,mCAAI,SAAS;wBAC5C,QAAQ,EAAE,MAAA,UAAU,CAAC,QAAQ,mCAAI,SAAS;wBAC1C,YAAY,EAAE,MAAA,UAAU,CAAC,YAAY,mCAAI,SAAS;qBACnD;iBACF;aACF,CAAC,CAAC;QACL,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const createSegmentAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
+
name: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
+
rule: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
}>;
|
|
5
|
+
//# sourceMappingURL=create-segment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-segment.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/create-segment.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,mBAAmB;;;EA6B9B,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createSegmentAction = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
6
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
|
+
const auth_1 = require("../auth");
|
|
8
|
+
const client_1 = require("../common/client");
|
|
9
|
+
exports.createSegmentAction = (0, pieces_framework_1.createAction)({
|
|
10
|
+
name: 'create_segment',
|
|
11
|
+
displayName: 'Create Segment',
|
|
12
|
+
description: 'Create a new contact segment in Elastic Email using a SQL-like rule.',
|
|
13
|
+
auth: auth_1.elasticEmailAuth,
|
|
14
|
+
props: {
|
|
15
|
+
name: pieces_framework_1.Property.ShortText({
|
|
16
|
+
displayName: 'Segment Name',
|
|
17
|
+
required: true,
|
|
18
|
+
}),
|
|
19
|
+
rule: pieces_framework_1.Property.ShortText({
|
|
20
|
+
displayName: 'Rule',
|
|
21
|
+
description: 'SQL-like rule to determine which contacts belong to this segment. See https://help.elasticemail.com/en/articles/5162182-segment-rules',
|
|
22
|
+
required: true,
|
|
23
|
+
}),
|
|
24
|
+
},
|
|
25
|
+
run(_a) {
|
|
26
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
|
|
27
|
+
return (0, client_1.elasticEmailRequest)({
|
|
28
|
+
apiKey: auth.secret_text,
|
|
29
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
30
|
+
path: '/segments',
|
|
31
|
+
body: {
|
|
32
|
+
Name: propsValue.name,
|
|
33
|
+
Rule: propsValue.rule,
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
//# sourceMappingURL=create-segment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-segment.js","sourceRoot":"","sources":["../../../../src/lib/actions/create-segment.ts"],"names":[],"mappings":";;;;AAAA,+DAAyD;AACzD,qEAAwE;AAExE,kCAA2C;AAC3C,6CAAuD;AAE1C,QAAA,mBAAmB,GAAG,IAAA,+BAAY,EAAC;IAC9C,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EACT,sEAAsE;IACxE,IAAI,EAAE,uBAAgB;IACtB,KAAK,EAAE;QACL,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACvB,WAAW,EAAE,cAAc;YAC3B,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACvB,WAAW,EAAE,MAAM;YACnB,WAAW,EACT,uIAAuI;YACzI,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;YAC5B,OAAO,IAAA,4BAAmB,EAAC;gBACzB,MAAM,EAAE,IAAI,CAAC,WAAW;gBACxB,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE;oBACJ,IAAI,EAAE,UAAU,CAAC,IAAI;oBACrB,IAAI,EAAE,UAAU,CAAC,IAAI;iBACtB;aACF,CAAC,CAAC;QACL,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const listCampaignsAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
+
search: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
3
|
+
limit: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
4
|
+
offset: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
5
|
+
}>;
|
|
6
|
+
//# sourceMappingURL=list-campaigns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-campaigns.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/list-campaigns.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,mBAAmB;;;;EA0C9B,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.listCampaignsAction = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
6
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
|
+
const auth_1 = require("../auth");
|
|
8
|
+
const client_1 = require("../common/client");
|
|
9
|
+
const constants_1 = require("../common/constants");
|
|
10
|
+
exports.listCampaignsAction = (0, pieces_framework_1.createAction)({
|
|
11
|
+
name: 'list_campaigns',
|
|
12
|
+
displayName: 'List Campaigns',
|
|
13
|
+
description: 'Fetch a paginated list of campaigns from Elastic Email.',
|
|
14
|
+
auth: auth_1.elasticEmailAuth,
|
|
15
|
+
props: {
|
|
16
|
+
search: pieces_framework_1.Property.ShortText({
|
|
17
|
+
displayName: 'Search',
|
|
18
|
+
description: 'Filter campaigns by name.',
|
|
19
|
+
required: false,
|
|
20
|
+
}),
|
|
21
|
+
limit: pieces_framework_1.Property.Number({
|
|
22
|
+
displayName: 'Limit',
|
|
23
|
+
description: 'Maximum number of campaigns to return (max 100).',
|
|
24
|
+
required: false,
|
|
25
|
+
defaultValue: constants_1.DEFAULT_LIMIT,
|
|
26
|
+
}),
|
|
27
|
+
offset: pieces_framework_1.Property.Number({
|
|
28
|
+
displayName: 'Offset',
|
|
29
|
+
description: 'Number of campaigns to skip.',
|
|
30
|
+
required: false,
|
|
31
|
+
defaultValue: 0,
|
|
32
|
+
}),
|
|
33
|
+
},
|
|
34
|
+
run(_a) {
|
|
35
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
|
|
36
|
+
const queryParams = {};
|
|
37
|
+
if (propsValue.search) {
|
|
38
|
+
queryParams['search'] = propsValue.search;
|
|
39
|
+
}
|
|
40
|
+
if (propsValue.limit !== undefined) {
|
|
41
|
+
queryParams['limit'] = String(propsValue.limit);
|
|
42
|
+
}
|
|
43
|
+
if (propsValue.offset !== undefined) {
|
|
44
|
+
queryParams['offset'] = String(propsValue.offset);
|
|
45
|
+
}
|
|
46
|
+
return (0, client_1.elasticEmailRequest)({
|
|
47
|
+
apiKey: auth.secret_text,
|
|
48
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
49
|
+
path: '/campaigns',
|
|
50
|
+
queryParams,
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
//# sourceMappingURL=list-campaigns.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-campaigns.js","sourceRoot":"","sources":["../../../../src/lib/actions/list-campaigns.ts"],"names":[],"mappings":";;;;AAAA,+DAAyD;AACzD,qEAAwE;AAExE,kCAA2C;AAC3C,6CAAuD;AACvD,mDAAoD;AAEvC,QAAA,mBAAmB,GAAG,IAAA,+BAAY,EAAC;IAC9C,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,yDAAyD;IACtE,IAAI,EAAE,uBAAgB;IACtB,KAAK,EAAE;QACL,MAAM,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACzB,WAAW,EAAE,QAAQ;YACrB,WAAW,EAAE,2BAA2B;YACxC,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,KAAK,EAAE,2BAAQ,CAAC,MAAM,CAAC;YACrB,WAAW,EAAE,OAAO;YACpB,WAAW,EAAE,kDAAkD;YAC/D,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,yBAAa;SAC5B,CAAC;QACF,MAAM,EAAE,2BAAQ,CAAC,MAAM,CAAC;YACtB,WAAW,EAAE,QAAQ;YACrB,WAAW,EAAE,8BAA8B;YAC3C,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,CAAC;SAChB,CAAC;KACH;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;YAC5B,MAAM,WAAW,GAA2B,EAAE,CAAC;YAC/C,IAAI,UAAU,CAAC,MAAM,EAAE,CAAC;gBACtB,WAAW,CAAC,QAAQ,CAAC,GAAG,UAAU,CAAC,MAAM,CAAC;YAC5C,CAAC;YACD,IAAI,UAAU,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;gBACnC,WAAW,CAAC,OAAO,CAAC,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;YAClD,CAAC;YACD,IAAI,UAAU,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;gBACpC,WAAW,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;YACpD,CAAC;YACD,OAAO,IAAA,4BAAmB,EAAC;gBACzB,MAAM,EAAE,IAAI,CAAC,WAAW;gBACxB,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,IAAI,EAAE,YAAY;gBAClB,WAAW;aACZ,CAAC,CAAC;QACL,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const listContactsAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
+
limit: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
3
|
+
offset: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
4
|
+
}>;
|
|
5
|
+
//# sourceMappingURL=list-contacts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-contacts.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/list-contacts.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,kBAAkB;;;EAkC7B,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.listContactsAction = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
6
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
|
+
const auth_1 = require("../auth");
|
|
8
|
+
const client_1 = require("../common/client");
|
|
9
|
+
const constants_1 = require("../common/constants");
|
|
10
|
+
exports.listContactsAction = (0, pieces_framework_1.createAction)({
|
|
11
|
+
name: 'list_contacts',
|
|
12
|
+
displayName: 'List Contacts',
|
|
13
|
+
description: 'Fetch a paginated list of contacts from Elastic Email.',
|
|
14
|
+
auth: auth_1.elasticEmailAuth,
|
|
15
|
+
props: {
|
|
16
|
+
limit: pieces_framework_1.Property.Number({
|
|
17
|
+
displayName: 'Limit',
|
|
18
|
+
description: 'Maximum number of contacts to return (max 100).',
|
|
19
|
+
required: false,
|
|
20
|
+
defaultValue: constants_1.DEFAULT_LIMIT,
|
|
21
|
+
}),
|
|
22
|
+
offset: pieces_framework_1.Property.Number({
|
|
23
|
+
displayName: 'Offset',
|
|
24
|
+
description: 'Number of contacts to skip.',
|
|
25
|
+
required: false,
|
|
26
|
+
defaultValue: 0,
|
|
27
|
+
}),
|
|
28
|
+
},
|
|
29
|
+
run(_a) {
|
|
30
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
|
|
31
|
+
const queryParams = {};
|
|
32
|
+
if (propsValue.limit !== undefined) {
|
|
33
|
+
queryParams['limit'] = String(propsValue.limit);
|
|
34
|
+
}
|
|
35
|
+
if (propsValue.offset !== undefined) {
|
|
36
|
+
queryParams['offset'] = String(propsValue.offset);
|
|
37
|
+
}
|
|
38
|
+
return (0, client_1.elasticEmailRequest)({
|
|
39
|
+
apiKey: auth.secret_text,
|
|
40
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
41
|
+
path: '/contacts',
|
|
42
|
+
queryParams,
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
//# sourceMappingURL=list-contacts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-contacts.js","sourceRoot":"","sources":["../../../../src/lib/actions/list-contacts.ts"],"names":[],"mappings":";;;;AAAA,+DAAyD;AACzD,qEAAwE;AAExE,kCAA2C;AAC3C,6CAAuD;AACvD,mDAAoD;AAEvC,QAAA,kBAAkB,GAAG,IAAA,+BAAY,EAAC;IAC7C,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE,wDAAwD;IACrE,IAAI,EAAE,uBAAgB;IACtB,KAAK,EAAE;QACL,KAAK,EAAE,2BAAQ,CAAC,MAAM,CAAC;YACrB,WAAW,EAAE,OAAO;YACpB,WAAW,EAAE,iDAAiD;YAC9D,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,yBAAa;SAC5B,CAAC;QACF,MAAM,EAAE,2BAAQ,CAAC,MAAM,CAAC;YACtB,WAAW,EAAE,QAAQ;YACrB,WAAW,EAAE,6BAA6B;YAC1C,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,CAAC;SAChB,CAAC;KACH;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;YAC5B,MAAM,WAAW,GAA2B,EAAE,CAAC;YAC/C,IAAI,UAAU,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;gBACnC,WAAW,CAAC,OAAO,CAAC,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;YAClD,CAAC;YACD,IAAI,UAAU,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;gBACpC,WAAW,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;YACpD,CAAC;YACD,OAAO,IAAA,4BAAmB,EAAC;gBACzB,MAAM,EAAE,IAAI,CAAC,WAAW;gBACxB,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,IAAI,EAAE,WAAW;gBACjB,WAAW;aACZ,CAAC,CAAC;QACL,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const sendEmailAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
+
recipients: import("@activepieces/pieces-framework").ArrayProperty<true>;
|
|
3
|
+
from: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
subject: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
5
|
+
bodyContentType: import("@activepieces/pieces-framework").StaticDropdownProperty<"HTML" | "PlainText" | "AMP" | "CSS", false>;
|
|
6
|
+
bodyContent: import("@activepieces/pieces-framework").LongTextProperty<false>;
|
|
7
|
+
replyTo: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
8
|
+
templateName: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
9
|
+
merge: import("@activepieces/pieces-framework").ObjectProperty<false>;
|
|
10
|
+
timeOffset: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
11
|
+
poolName: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
12
|
+
channelName: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
13
|
+
encoding: import("@activepieces/pieces-framework").StaticDropdownProperty<"UserProvided" | "None" | "Raw7bit" | "Raw8bit" | "QuotedPrintable" | "Base64" | "Uue", false>;
|
|
14
|
+
trackOpens: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
15
|
+
trackClicks: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
16
|
+
}>;
|
|
17
|
+
//# sourceMappingURL=send-email.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"send-email.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/send-email.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;EAwH1B,CAAC"}
|