@activepieces/piece-elastic-email 0.2.2 → 0.2.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 -13
- package/src/index.js +20 -51
- package/src/index.d.ts +0 -2
- package/src/index.d.ts.map +0 -1
- package/src/index.js.map +0 -1
- package/src/lib/actions/add-contact.d.ts +0 -12
- package/src/lib/actions/add-contact.d.ts.map +0 -1
- package/src/lib/actions/add-contact.js +0 -100
- package/src/lib/actions/add-contact.js.map +0 -1
- package/src/lib/actions/create-campaign.d.ts +0 -11
- package/src/lib/actions/create-campaign.d.ts.map +0 -1
- package/src/lib/actions/create-campaign.js +0 -84
- package/src/lib/actions/create-campaign.js.map +0 -1
- package/src/lib/actions/create-contact.d.ts +0 -8
- package/src/lib/actions/create-contact.d.ts.map +0 -1
- package/src/lib/actions/create-contact.js +0 -68
- package/src/lib/actions/create-contact.js.map +0 -1
- package/src/lib/actions/create-segment.d.ts +0 -5
- package/src/lib/actions/create-segment.d.ts.map +0 -1
- package/src/lib/actions/create-segment.js +0 -44
- package/src/lib/actions/create-segment.js.map +0 -1
- package/src/lib/actions/list-campaigns.d.ts +0 -6
- package/src/lib/actions/list-campaigns.d.ts.map +0 -1
- package/src/lib/actions/list-campaigns.js +0 -60
- package/src/lib/actions/list-campaigns.js.map +0 -1
- package/src/lib/actions/list-contacts.d.ts +0 -5
- package/src/lib/actions/list-contacts.d.ts.map +0 -1
- package/src/lib/actions/list-contacts.js +0 -52
- package/src/lib/actions/list-contacts.js.map +0 -1
- package/src/lib/actions/send-email.d.ts +0 -17
- package/src/lib/actions/send-email.d.ts.map +0 -1
- package/src/lib/actions/send-email.js +0 -133
- package/src/lib/actions/send-email.js.map +0 -1
- package/src/lib/actions/unsubscribe-contact.d.ts +0 -4
- package/src/lib/actions/unsubscribe-contact.d.ts.map +0 -1
- package/src/lib/actions/unsubscribe-contact.js +0 -39
- package/src/lib/actions/unsubscribe-contact.js.map +0 -1
- package/src/lib/actions/update-campaign.d.ts +0 -12
- package/src/lib/actions/update-campaign.d.ts.map +0 -1
- package/src/lib/actions/update-campaign.js +0 -94
- package/src/lib/actions/update-campaign.js.map +0 -1
- package/src/lib/actions/update-contact.d.ts +0 -7
- package/src/lib/actions/update-contact.d.ts.map +0 -1
- package/src/lib/actions/update-contact.js +0 -52
- package/src/lib/actions/update-contact.js.map +0 -1
- package/src/lib/auth.d.ts +0 -2
- package/src/lib/auth.d.ts.map +0 -1
- package/src/lib/auth.js +0 -59
- package/src/lib/auth.js.map +0 -1
- package/src/lib/common/client.d.ts +0 -9
- package/src/lib/common/client.d.ts.map +0 -1
- package/src/lib/common/client.js +0 -19
- package/src/lib/common/client.js.map +0 -1
- package/src/lib/common/constants.d.ts +0 -8
- package/src/lib/common/constants.d.ts.map +0 -1
- package/src/lib/common/constants.js +0 -47
- package/src/lib/common/constants.js.map +0 -1
- package/src/lib/common/props.d.ts +0 -6
- package/src/lib/common/props.d.ts.map +0 -1
- package/src/lib/common/props.js +0 -165
- package/src/lib/common/props.js.map +0 -1
|
@@ -1,84 +0,0 @@
|
|
|
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
|
-
audience: 'both',
|
|
16
|
-
aiMetadata: {
|
|
17
|
-
description: 'Creates a new email campaign in Elastic Email targeting the given mailing lists and/or segments, with sender, subject, template, and an initial status (e.g. draft or active). Use to set up a bulk campaign send; for one-off transactional messages use Send Email instead. Each call creates a separate campaign, so it is not idempotent.',
|
|
18
|
-
idempotent: false,
|
|
19
|
-
},
|
|
20
|
-
auth: auth_1.elasticEmailAuth,
|
|
21
|
-
props: {
|
|
22
|
-
name: pieces_framework_1.Property.ShortText({
|
|
23
|
-
displayName: 'Campaign Name',
|
|
24
|
-
required: true,
|
|
25
|
-
}),
|
|
26
|
-
from: pieces_framework_1.Property.ShortText({
|
|
27
|
-
displayName: 'From',
|
|
28
|
-
description: 'Sender email with optional name (e.g. `email@domain.com` or `John Doe <email@domain.com>`).',
|
|
29
|
-
required: true,
|
|
30
|
-
}),
|
|
31
|
-
recipientListNames: props_1.listNamesProp,
|
|
32
|
-
recipientSegmentNames: props_1.segmentNamesProp,
|
|
33
|
-
replyTo: pieces_framework_1.Property.ShortText({
|
|
34
|
-
displayName: 'Reply To',
|
|
35
|
-
description: 'Reply-to email address.',
|
|
36
|
-
required: true,
|
|
37
|
-
}),
|
|
38
|
-
status: pieces_framework_1.Property.StaticDropdown({
|
|
39
|
-
displayName: 'Status',
|
|
40
|
-
description: 'Initial campaign status.',
|
|
41
|
-
required: true,
|
|
42
|
-
options: {
|
|
43
|
-
options: constants_1.CAMPAIGN_STATUS_OPTIONS.map((s) => ({ label: s, value: s })),
|
|
44
|
-
},
|
|
45
|
-
}),
|
|
46
|
-
subject: pieces_framework_1.Property.ShortText({
|
|
47
|
-
displayName: 'Subject',
|
|
48
|
-
description: 'Default email subject line.',
|
|
49
|
-
required: false,
|
|
50
|
-
}),
|
|
51
|
-
templateName: props_1.templateNameProp,
|
|
52
|
-
},
|
|
53
|
-
run(_a) {
|
|
54
|
-
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
|
|
55
|
-
var _b, _c;
|
|
56
|
-
return (0, client_1.elasticEmailRequest)({
|
|
57
|
-
apiKey: auth.secret_text,
|
|
58
|
-
method: pieces_common_1.HttpMethod.POST,
|
|
59
|
-
path: '/campaigns',
|
|
60
|
-
body: {
|
|
61
|
-
Name: propsValue.name,
|
|
62
|
-
Recipients: {
|
|
63
|
-
ListNames: propsValue.recipientListNames && propsValue.recipientListNames.length > 0
|
|
64
|
-
? propsValue.recipientListNames
|
|
65
|
-
: undefined,
|
|
66
|
-
SegmentNames: propsValue.recipientSegmentNames && propsValue.recipientSegmentNames.length > 0
|
|
67
|
-
? propsValue.recipientSegmentNames
|
|
68
|
-
: undefined,
|
|
69
|
-
},
|
|
70
|
-
Content: [
|
|
71
|
-
{
|
|
72
|
-
From: propsValue.from,
|
|
73
|
-
ReplyTo: propsValue.replyTo,
|
|
74
|
-
Subject: (_b = propsValue.subject) !== null && _b !== void 0 ? _b : undefined,
|
|
75
|
-
TemplateName: (_c = propsValue.templateName) !== null && _c !== void 0 ? _c : undefined,
|
|
76
|
-
},
|
|
77
|
-
],
|
|
78
|
-
Status: propsValue.status,
|
|
79
|
-
},
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
},
|
|
83
|
-
});
|
|
84
|
-
//# sourceMappingURL=create-campaign.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,+UAA+U;QACjV,UAAU,EAAE,KAAK;KAClB;IACD,IAAI,EAAE,uBAAgB;IACtB,KAAK,EAAE;QACL,IAAI,EAAE,2BAAQ,CAAC,SAAS,CA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BAAkB;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"}
|
|
@@ -1,8 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-contact.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/create-contact.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,mBAAmB;;;;;;EAwD9B,CAAC"}
|
|
@@ -1,68 +0,0 @@
|
|
|
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
|
-
audience: 'both',
|
|
15
|
-
aiMetadata: {
|
|
16
|
-
description: 'Creates a new contact in Elastic Email from an email address, with optional name, status, and custom fields, without attaching it to any mailing list. Use when you only need the contact to exist; use Add Contact to Mailing List when it must also join specific lists. Each call appends the contact, so it is not idempotent.',
|
|
17
|
-
idempotent: false,
|
|
18
|
-
},
|
|
19
|
-
auth: auth_1.elasticEmailAuth,
|
|
20
|
-
props: {
|
|
21
|
-
email: pieces_framework_1.Property.ShortText({
|
|
22
|
-
displayName: 'Email',
|
|
23
|
-
description: 'The email address of the contact.',
|
|
24
|
-
required: true,
|
|
25
|
-
}),
|
|
26
|
-
status: pieces_framework_1.Property.StaticDropdown({
|
|
27
|
-
displayName: 'Status',
|
|
28
|
-
description: 'Initial status of the contact.',
|
|
29
|
-
required: false,
|
|
30
|
-
options: {
|
|
31
|
-
options: constants_1.CONTACT_STATUS_OPTIONS.map((s) => ({ label: s, value: s })),
|
|
32
|
-
},
|
|
33
|
-
}),
|
|
34
|
-
firstName: pieces_framework_1.Property.ShortText({
|
|
35
|
-
displayName: 'First Name',
|
|
36
|
-
required: false,
|
|
37
|
-
}),
|
|
38
|
-
lastName: pieces_framework_1.Property.ShortText({
|
|
39
|
-
displayName: 'Last Name',
|
|
40
|
-
required: false,
|
|
41
|
-
}),
|
|
42
|
-
customFields: pieces_framework_1.Property.Object({
|
|
43
|
-
displayName: 'Custom Fields',
|
|
44
|
-
description: 'Key-value pairs of custom contact fields. Only existing custom fields will be saved.',
|
|
45
|
-
required: false,
|
|
46
|
-
}),
|
|
47
|
-
},
|
|
48
|
-
run(_a) {
|
|
49
|
-
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
|
|
50
|
-
var _b, _c, _d, _e;
|
|
51
|
-
return (0, client_1.elasticEmailRequest)({
|
|
52
|
-
apiKey: auth.secret_text,
|
|
53
|
-
method: pieces_common_1.HttpMethod.POST,
|
|
54
|
-
path: '/contacts',
|
|
55
|
-
body: [
|
|
56
|
-
{
|
|
57
|
-
Email: propsValue.email,
|
|
58
|
-
Status: (_b = propsValue.status) !== null && _b !== void 0 ? _b : undefined,
|
|
59
|
-
FirstName: (_c = propsValue.firstName) !== null && _c !== void 0 ? _c : undefined,
|
|
60
|
-
LastName: (_d = propsValue.lastName) !== null && _d !== void 0 ? _d : undefined,
|
|
61
|
-
CustomFields: (_e = propsValue.customFields) !== null && _e !== void 0 ? _e : undefined,
|
|
62
|
-
},
|
|
63
|
-
],
|
|
64
|
-
});
|
|
65
|
-
});
|
|
66
|
-
},
|
|
67
|
-
});
|
|
68
|
-
//# sourceMappingURL=create-contact.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,oUAAoU;QACtU,UAAU,EAAE,KAAK;KAClB;IACD,IAAI,EAAE,uBAAgB;IACtB,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AE,MAAA,UAAU,CAAC,YAAY,mCAAI,SAAS;qBACnD;iBACF;aACF,CAAC,CAAC;QACL,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-segment.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/create-segment.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,mBAAmB;;;EAmC9B,CAAC"}
|
|
@@ -1,44 +0,0 @@
|
|
|
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
|
-
audience: 'both',
|
|
14
|
-
aiMetadata: {
|
|
15
|
-
description: 'Creates a named contact segment in Elastic Email defined by a SQL-like rule that selects which contacts belong to it. Use to build a reusable audience for campaigns. The rule must follow Elastic Email segment-rule syntax. Each call creates a separate segment, so it is not idempotent.',
|
|
16
|
-
idempotent: false,
|
|
17
|
-
},
|
|
18
|
-
auth: auth_1.elasticEmailAuth,
|
|
19
|
-
props: {
|
|
20
|
-
name: pieces_framework_1.Property.ShortText({
|
|
21
|
-
displayName: 'Segment Name',
|
|
22
|
-
required: true,
|
|
23
|
-
}),
|
|
24
|
-
rule: pieces_framework_1.Property.ShortText({
|
|
25
|
-
displayName: 'Rule',
|
|
26
|
-
description: 'SQL-like rule to determine which contacts belong to this segment. See https://help.elasticemail.com/en/articles/5162182-segment-rules',
|
|
27
|
-
required: true,
|
|
28
|
-
}),
|
|
29
|
-
},
|
|
30
|
-
run(_a) {
|
|
31
|
-
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
|
|
32
|
-
return (0, client_1.elasticEmailRequest)({
|
|
33
|
-
apiKey: auth.secret_text,
|
|
34
|
-
method: pieces_common_1.HttpMethod.POST,
|
|
35
|
-
path: '/segments',
|
|
36
|
-
body: {
|
|
37
|
-
Name: propsValue.name,
|
|
38
|
-
Rule: propsValue.rule,
|
|
39
|
-
},
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
},
|
|
43
|
-
});
|
|
44
|
-
//# sourceMappingURL=create-segment.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,8RAA8R;QAChS,UAAU,EAAE,KAAK;KAClB;IACD,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"}
|
|
@@ -1,6 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"list-campaigns.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/list-campaigns.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,mBAAmB;;;;EAgD9B,CAAC"}
|
|
@@ -1,60 +0,0 @@
|
|
|
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
|
-
audience: 'both',
|
|
15
|
-
aiMetadata: {
|
|
16
|
-
description: 'Retrieves a paginated list of campaigns from Elastic Email; leave the search field empty to return all campaigns, or set it to filter by campaign name. Use to look up campaigns or find a campaign name before updating it. Read-only and idempotent.',
|
|
17
|
-
idempotent: true,
|
|
18
|
-
},
|
|
19
|
-
auth: auth_1.elasticEmailAuth,
|
|
20
|
-
props: {
|
|
21
|
-
search: pieces_framework_1.Property.ShortText({
|
|
22
|
-
displayName: 'Search',
|
|
23
|
-
description: 'Filter campaigns by name.',
|
|
24
|
-
required: false,
|
|
25
|
-
}),
|
|
26
|
-
limit: pieces_framework_1.Property.Number({
|
|
27
|
-
displayName: 'Limit',
|
|
28
|
-
description: 'Maximum number of campaigns to return (max 100).',
|
|
29
|
-
required: false,
|
|
30
|
-
defaultValue: constants_1.DEFAULT_LIMIT,
|
|
31
|
-
}),
|
|
32
|
-
offset: pieces_framework_1.Property.Number({
|
|
33
|
-
displayName: 'Offset',
|
|
34
|
-
description: 'Number of campaigns to skip.',
|
|
35
|
-
required: false,
|
|
36
|
-
defaultValue: 0,
|
|
37
|
-
}),
|
|
38
|
-
},
|
|
39
|
-
run(_a) {
|
|
40
|
-
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
|
|
41
|
-
const queryParams = {};
|
|
42
|
-
if (propsValue.search) {
|
|
43
|
-
queryParams['search'] = propsValue.search;
|
|
44
|
-
}
|
|
45
|
-
if (propsValue.limit !== undefined) {
|
|
46
|
-
queryParams['limit'] = String(propsValue.limit);
|
|
47
|
-
}
|
|
48
|
-
if (propsValue.offset !== undefined) {
|
|
49
|
-
queryParams['offset'] = String(propsValue.offset);
|
|
50
|
-
}
|
|
51
|
-
return (0, client_1.elasticEmailRequest)({
|
|
52
|
-
apiKey: auth.secret_text,
|
|
53
|
-
method: pieces_common_1.HttpMethod.GET,
|
|
54
|
-
path: '/campaigns',
|
|
55
|
-
queryParams,
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
},
|
|
59
|
-
});
|
|
60
|
-
//# sourceMappingURL=list-campaigns.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,wPAAwP;QAC1P,UAAU,EAAE,IAAI;KACjB;IACD,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"}
|
|
@@ -1,5 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"list-contacts.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/list-contacts.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,kBAAkB;;;EAwC7B,CAAC"}
|
|
@@ -1,52 +0,0 @@
|
|
|
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
|
-
audience: 'both',
|
|
15
|
-
aiMetadata: {
|
|
16
|
-
description: 'Retrieves a paginated list of contacts from the Elastic Email account using limit and offset. Use to browse or page through contacts. Read-only and idempotent.',
|
|
17
|
-
idempotent: true,
|
|
18
|
-
},
|
|
19
|
-
auth: auth_1.elasticEmailAuth,
|
|
20
|
-
props: {
|
|
21
|
-
limit: pieces_framework_1.Property.Number({
|
|
22
|
-
displayName: 'Limit',
|
|
23
|
-
description: 'Maximum number of contacts 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 contacts 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.limit !== undefined) {
|
|
38
|
-
queryParams['limit'] = String(propsValue.limit);
|
|
39
|
-
}
|
|
40
|
-
if (propsValue.offset !== undefined) {
|
|
41
|
-
queryParams['offset'] = String(propsValue.offset);
|
|
42
|
-
}
|
|
43
|
-
return (0, client_1.elasticEmailRequest)({
|
|
44
|
-
apiKey: auth.secret_text,
|
|
45
|
-
method: pieces_common_1.HttpMethod.GET,
|
|
46
|
-
path: '/contacts',
|
|
47
|
-
queryParams,
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
},
|
|
51
|
-
});
|
|
52
|
-
//# sourceMappingURL=list-contacts.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,iKAAiK;QACnK,UAAU,EAAE,IAAI;KACjB;IACD,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"}
|
|
@@ -1,17 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"send-email.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/send-email.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;EA8H1B,CAAC"}
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.sendEmailAction = 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.sendEmailAction = (0, pieces_framework_1.createAction)({
|
|
12
|
-
name: 'send_email',
|
|
13
|
-
displayName: 'Send Email',
|
|
14
|
-
description: 'Send an email to one or more recipients via Elastic Email.',
|
|
15
|
-
audience: 'both',
|
|
16
|
-
aiMetadata: {
|
|
17
|
-
description: 'Sends a transactional email to one or more recipients via Elastic Email, with either inline body content or a saved template, plus optional merge fields, tracking, and a scheduled time offset. Use for direct one-off sends; use Create Campaign for bulk list/segment marketing. Each call dispatches a new email, so it is not idempotent.',
|
|
18
|
-
idempotent: false,
|
|
19
|
-
},
|
|
20
|
-
auth: auth_1.elasticEmailAuth,
|
|
21
|
-
props: {
|
|
22
|
-
recipients: pieces_framework_1.Property.Array({
|
|
23
|
-
displayName: 'Recipients',
|
|
24
|
-
description: 'List of recipient email addresses.',
|
|
25
|
-
required: true,
|
|
26
|
-
}),
|
|
27
|
-
from: pieces_framework_1.Property.ShortText({
|
|
28
|
-
displayName: 'From',
|
|
29
|
-
description: 'Sender email with optional name (e.g. `email@domain.com` or `John Doe <email@domain.com>`).',
|
|
30
|
-
required: true,
|
|
31
|
-
}),
|
|
32
|
-
subject: pieces_framework_1.Property.ShortText({
|
|
33
|
-
displayName: 'Subject',
|
|
34
|
-
description: 'Email subject line.',
|
|
35
|
-
required: false,
|
|
36
|
-
}),
|
|
37
|
-
bodyContentType: pieces_framework_1.Property.StaticDropdown({
|
|
38
|
-
displayName: 'Body Content Type',
|
|
39
|
-
description: 'Type of body content.',
|
|
40
|
-
required: false,
|
|
41
|
-
options: {
|
|
42
|
-
options: constants_1.BODY_CONTENT_TYPE_OPTIONS.map((s) => ({ label: s, value: s })),
|
|
43
|
-
},
|
|
44
|
-
}),
|
|
45
|
-
bodyContent: pieces_framework_1.Property.LongText({
|
|
46
|
-
displayName: 'Body Content',
|
|
47
|
-
description: 'The actual body content of the email.',
|
|
48
|
-
required: false,
|
|
49
|
-
}),
|
|
50
|
-
replyTo: pieces_framework_1.Property.ShortText({
|
|
51
|
-
displayName: 'Reply To',
|
|
52
|
-
description: 'Reply-to email address.',
|
|
53
|
-
required: false,
|
|
54
|
-
}),
|
|
55
|
-
templateName: props_1.templateNameProp,
|
|
56
|
-
merge: pieces_framework_1.Property.Object({
|
|
57
|
-
displayName: 'Merge Fields',
|
|
58
|
-
description: 'Key-value merge fields shared between recipients. Use in email body like {firstname}, {lastname}.',
|
|
59
|
-
required: false,
|
|
60
|
-
}),
|
|
61
|
-
timeOffset: pieces_framework_1.Property.Number({
|
|
62
|
-
displayName: 'Time Offset (minutes)',
|
|
63
|
-
description: 'Delay sending by this many minutes. Maximum is 35 days (50400 minutes).',
|
|
64
|
-
required: false,
|
|
65
|
-
}),
|
|
66
|
-
poolName: pieces_framework_1.Property.ShortText({
|
|
67
|
-
displayName: 'Pool Name',
|
|
68
|
-
description: 'Name of custom IP pool for sending.',
|
|
69
|
-
required: false,
|
|
70
|
-
}),
|
|
71
|
-
channelName: pieces_framework_1.Property.ShortText({
|
|
72
|
-
displayName: 'Channel Name',
|
|
73
|
-
description: 'Name of the sending channel.',
|
|
74
|
-
required: false,
|
|
75
|
-
}),
|
|
76
|
-
encoding: pieces_framework_1.Property.StaticDropdown({
|
|
77
|
-
displayName: 'Encoding',
|
|
78
|
-
description: 'Encoding type for email headers.',
|
|
79
|
-
required: false,
|
|
80
|
-
options: {
|
|
81
|
-
options: constants_1.ENCODING_OPTIONS.map((s) => ({ label: s, value: s })),
|
|
82
|
-
},
|
|
83
|
-
}),
|
|
84
|
-
trackOpens: pieces_framework_1.Property.Checkbox({
|
|
85
|
-
displayName: 'Track Opens',
|
|
86
|
-
description: 'Track email opens. If not set, uses account default.',
|
|
87
|
-
required: false,
|
|
88
|
-
}),
|
|
89
|
-
trackClicks: pieces_framework_1.Property.Checkbox({
|
|
90
|
-
displayName: 'Track Clicks',
|
|
91
|
-
description: 'Track link clicks. If not set, uses account default.',
|
|
92
|
-
required: false,
|
|
93
|
-
}),
|
|
94
|
-
},
|
|
95
|
-
run(_a) {
|
|
96
|
-
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
|
|
97
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
98
|
-
const recipientEmails = ((_b = propsValue.recipients) !== null && _b !== void 0 ? _b : []).map(String);
|
|
99
|
-
return (0, client_1.elasticEmailRequest)({
|
|
100
|
-
apiKey: auth.secret_text,
|
|
101
|
-
method: pieces_common_1.HttpMethod.POST,
|
|
102
|
-
path: '/emails',
|
|
103
|
-
body: {
|
|
104
|
-
Recipients: recipientEmails.map((email) => ({ Email: email })),
|
|
105
|
-
Content: {
|
|
106
|
-
From: propsValue.from,
|
|
107
|
-
Subject: (_c = propsValue.subject) !== null && _c !== void 0 ? _c : undefined,
|
|
108
|
-
Body: (propsValue.bodyContentType || propsValue.bodyContent)
|
|
109
|
-
? [
|
|
110
|
-
{
|
|
111
|
-
ContentType: propsValue.bodyContentType || 'HTML',
|
|
112
|
-
Body: propsValue.bodyContent,
|
|
113
|
-
},
|
|
114
|
-
]
|
|
115
|
-
: undefined,
|
|
116
|
-
ReplyTo: (_d = propsValue.replyTo) !== null && _d !== void 0 ? _d : undefined,
|
|
117
|
-
TemplateName: (_e = propsValue.templateName) !== null && _e !== void 0 ? _e : undefined,
|
|
118
|
-
Merge: (_f = propsValue.merge) !== null && _f !== void 0 ? _f : undefined,
|
|
119
|
-
},
|
|
120
|
-
Options: {
|
|
121
|
-
TimeOffset: (_g = propsValue.timeOffset) !== null && _g !== void 0 ? _g : undefined,
|
|
122
|
-
PoolName: (_h = propsValue.poolName) !== null && _h !== void 0 ? _h : undefined,
|
|
123
|
-
ChannelName: (_j = propsValue.channelName) !== null && _j !== void 0 ? _j : undefined,
|
|
124
|
-
Encoding: (_k = propsValue.encoding) !== null && _k !== void 0 ? _k : undefined,
|
|
125
|
-
TrackOpens: (_l = propsValue.trackOpens) !== null && _l !== void 0 ? _l : undefined,
|
|
126
|
-
TrackClicks: (_m = propsValue.trackClicks) !== null && _m !== void 0 ? _m : undefined,
|
|
127
|
-
},
|
|
128
|
-
},
|
|
129
|
-
});
|
|
130
|
-
});
|
|
131
|
-
},
|
|
132
|
-
});
|
|
133
|
-
//# sourceMappingURL=send-email.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"send-email.js","sourceRoot":"","sources":["../../../../src/lib/actions/send-email.ts"],"names":[],"mappings":";;;;AAAA,+DAAyD;AACzD,qEAAwE;AAExE,kCAA2C;AAC3C,6CAAuD;AACvD,mDAG6B;AAC7B,2CAAmD;AAEtC,QAAA,eAAe,GAAG,IAAA,+BAAY,EAAC;IAC1C,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,YAAY;IACzB,WAAW,EAAE,4DAA4D;IACzE,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,gVAAgV;QAClV,UAAU,EAAE,KAAK;KAClB;IACD,IAAI,EAAE,uBAAgB;IACtB,KAAK,EAAE;QACL,UAAU,EAAE,2BAAQ,CAAC,KAAK,CAAC;YACzB,WAAW,EAAE,YAAY;YACzB,WAAW,EAAE,oCA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BACP,IAAI,EAAE,UAAU,CAAC,IAAI;wBACrB,OAAO,EAAE,MAAA,UAAU,CAAC,OAAO,mCAAI,SAAS;wBACxC,IAAI,EACF,CAAC,UAAU,CAAC,eAAe,IAAI,UAAU,CAAC,WAAW,CAAC;4BACpD,CAAC,CAAC;gCACE;oCACE,WAAW,EAAE,UAAU,CAAC,eAAe,IAAI,MAAM;oCACjD,IAAI,EAAE,UAAU,CAAC,WAAW;iCAC7B;6BACF;4BACH,CAAC,CAAC,SAAS;wBACf,OAAO,EAAE,MAAA,UAAU,CAAC,OAAO,mCAAI,SAAS;wBACxC,YAAY,EAAE,MAAA,UAAU,CAAC,YAAY,mCAAI,SAAS;wBAClD,KAAK,EAAE,MAAA,UAAU,CAAC,KAAK,mCAAI,SAAS;qBACrC;oBACD,OAAO,EAAE;wBACP,UAAU,EAAE,MAAA,UAAU,CAAC,UAAU,mCAAI,SAAS;wBAC9C,QAAQ,EAAE,MAAA,UAAU,CAAC,QAAQ,mCAAI,SAAS;wBAC1C,WAAW,EAAE,MAAA,UAAU,CAAC,WAAW,mCAAI,SAAS;wBAChD,QAAQ,EAAE,MAAA,UAAU,CAAC,QAAQ,mCAAI,SAAS;wBAC1C,UAAU,EAAE,MAAA,UAAU,CAAC,UAAU,mCAAI,SAAS;wBAC9C,WAAW,EAAE,MAAA,UAAU,CAAC,WAAW,mCAAI,SAAS;qBACjD;iBACF;aACF,CAAC,CAAC;QACL,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare const unsubscribeContactAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
-
emails: import("@activepieces/pieces-framework").ArrayProperty<true>;
|
|
3
|
-
}>;
|
|
4
|
-
//# sourceMappingURL=unsubscribe-contact.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"unsubscribe-contact.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/unsubscribe-contact.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,wBAAwB;;EA6BnC,CAAC"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.unsubscribeContactAction = 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.unsubscribeContactAction = (0, pieces_framework_1.createAction)({
|
|
10
|
-
name: 'unsubscribe_contact',
|
|
11
|
-
displayName: 'Unsubscribe Contact',
|
|
12
|
-
description: 'Unsubscribe one or more email addresses from future emails in Elastic Email.',
|
|
13
|
-
audience: 'both',
|
|
14
|
-
aiMetadata: {
|
|
15
|
-
description: 'Marks one or more email addresses as unsubscribed in Elastic Email so they no longer receive future emails. Use to honor opt-out or suppression requests. Idempotent: re-running with the same addresses leaves them unsubscribed with no additional effect.',
|
|
16
|
-
idempotent: true,
|
|
17
|
-
},
|
|
18
|
-
auth: auth_1.elasticEmailAuth,
|
|
19
|
-
props: {
|
|
20
|
-
emails: pieces_framework_1.Property.Array({
|
|
21
|
-
displayName: 'Email Addresses',
|
|
22
|
-
description: 'List of email addresses to unsubscribe.',
|
|
23
|
-
required: true,
|
|
24
|
-
}),
|
|
25
|
-
},
|
|
26
|
-
run(_a) {
|
|
27
|
-
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
|
|
28
|
-
var _b;
|
|
29
|
-
const emails = ((_b = propsValue.emails) !== null && _b !== void 0 ? _b : []).map(String);
|
|
30
|
-
return (0, client_1.elasticEmailRequest)({
|
|
31
|
-
apiKey: auth.secret_text,
|
|
32
|
-
method: pieces_common_1.HttpMethod.POST,
|
|
33
|
-
path: '/suppressions/unsubscribes',
|
|
34
|
-
body: emails,
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
|
-
},
|
|
38
|
-
});
|
|
39
|
-
//# sourceMappingURL=unsubscribe-contact.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"unsubscribe-contact.js","sourceRoot":"","sources":["../../../../src/lib/actions/unsubscribe-contact.ts"],"names":[],"mappings":";;;;AAAA,+DAAyD;AACzD,qEAAwE;AAExE,kCAA2C;AAC3C,6CAAuD;AAE1C,QAAA,wBAAwB,GAAG,IAAA,+BAAY,EAAC;IACnD,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,qBAAqB;IAClC,WAAW,EACT,8EAA8E;IAChF,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,8PAA8P;QAChQ,UAAU,EAAE,IAAI;KACjB;IACD,IAAI,EAAE,uBAAgB;IACtB,KAAK,EAAE;QACL,MAAM,EAAE,2BAAQ,CAAC,KAAK,CAAC;YACrB,WAAW,EAAE,iBAAiB;YAC9B,WAAW,EACT,yCAAyC;YAC3C,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;;YAC5B,MAAM,MAAM,GAAG,CAAC,MAAA,UAAU,CAAC,MAAM,mCAAI,EAAE,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;YACrD,OAAO,IAAA,4BAAmB,EAAC;gBACzB,MAAM,EAAE,IAAI,CAAC,WAAW;gBACxB,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,IAAI,EAAE,4BAA4B;gBAClC,IAAI,EAAE,MAAM;aACb,CAAC,CAAC;QACL,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare const updateCampaignAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
-
campaign: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
3
|
-
name: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
4
|
-
from: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
5
|
-
recipientListNames: import("@activepieces/pieces-framework").MultiSelectDropdownProperty<string, false, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
6
|
-
recipientSegmentNames: import("@activepieces/pieces-framework").MultiSelectDropdownProperty<string, false, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
7
|
-
replyTo: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
8
|
-
subject: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
9
|
-
templateName: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
10
|
-
status: import("@activepieces/pieces-framework").StaticDropdownProperty<"Active" | "Deleted" | "Processing" | "Sending" | "Completed" | "Paused" | "Cancelled" | "Draft", false>;
|
|
11
|
-
}>;
|
|
12
|
-
//# sourceMappingURL=update-campaign.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update-campaign.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/update-campaign.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,oBAAoB;;;;;;;;;;EA+F/B,CAAC"}
|