@segment/action-destinations 3.267.0 → 3.267.1-staging-56c8f3280
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/dist/destinations/amazon-ads/generated-types.d.ts +9 -0
- package/dist/destinations/amazon-ads/index.d.ts +2 -2
- package/dist/destinations/amazon-ads/index.js +164 -6
- package/dist/destinations/amazon-ads/index.js.map +1 -1
- package/dist/destinations/amazon-ads/syncAudiences/generated-types.d.ts +13 -0
- package/dist/destinations/amazon-ads/syncAudiences/index.js +201 -7
- package/dist/destinations/amazon-ads/syncAudiences/index.js.map +1 -1
- package/dist/destinations/amazon-ads/types.d.ts +25 -0
- package/dist/destinations/amazon-ads/utils.d.ts +31 -0
- package/dist/destinations/amazon-ads/utils.js +18 -0
- package/dist/destinations/amazon-ads/utils.js.map +1 -0
- package/dist/destinations/engage/utils/track.d.ts +17 -17
- package/dist/destinations/engage-messaging-sendgrid/index.d.ts +4 -3
- package/dist/destinations/engage-messaging-sendgrid/index.js +68 -16
- package/dist/destinations/engage-messaging-sendgrid/index.js.map +1 -1
- package/dist/destinations/engage-messaging-sendgrid/previewApiLookup/apiLookups.d.ts +22 -0
- package/dist/destinations/engage-messaging-sendgrid/previewApiLookup/apiLookups.js +189 -0
- package/dist/destinations/engage-messaging-sendgrid/previewApiLookup/apiLookups.js.map +1 -0
- package/dist/destinations/engage-messaging-sendgrid/previewApiLookup/generated-types.d.ts +16 -0
- package/dist/destinations/engage-messaging-sendgrid/previewApiLookup/generated-types.js +3 -0
- package/dist/destinations/engage-messaging-sendgrid/previewApiLookup/generated-types.js.map +1 -0
- package/dist/destinations/engage-messaging-sendgrid/previewApiLookup/index.d.ts +5 -0
- package/dist/destinations/engage-messaging-sendgrid/previewApiLookup/index.js +29 -0
- package/dist/destinations/engage-messaging-sendgrid/previewApiLookup/index.js.map +1 -0
- package/dist/destinations/engage-messaging-sendgrid/sendEmail/SendEmailPerformer.d.ts +43 -0
- package/dist/destinations/engage-messaging-sendgrid/sendEmail/SendEmailPerformer.js +419 -0
- package/dist/destinations/engage-messaging-sendgrid/sendEmail/SendEmailPerformer.js.map +1 -0
- package/dist/destinations/engage-messaging-sendgrid/sendEmail/UnlayerResponse.d.ts +12 -0
- package/dist/destinations/engage-messaging-sendgrid/sendEmail/UnlayerResponse.js +3 -0
- package/dist/destinations/engage-messaging-sendgrid/sendEmail/UnlayerResponse.js.map +1 -0
- package/dist/destinations/engage-messaging-sendgrid/sendEmail/generated-types.d.ts +56 -0
- package/dist/destinations/engage-messaging-sendgrid/sendEmail/generated-types.js +3 -0
- package/dist/destinations/engage-messaging-sendgrid/sendEmail/generated-types.js.map +1 -0
- package/dist/destinations/engage-messaging-sendgrid/sendEmail/index.d.ts +5 -0
- package/dist/destinations/engage-messaging-sendgrid/sendEmail/index.js +258 -0
- package/dist/destinations/engage-messaging-sendgrid/sendEmail/index.js.map +1 -0
- package/dist/destinations/engage-messaging-sendgrid/sendEmail/insertEmailPreviewText.d.ts +1 -0
- package/dist/destinations/engage-messaging-sendgrid/sendEmail/insertEmailPreviewText.js +23 -0
- package/dist/destinations/engage-messaging-sendgrid/sendEmail/insertEmailPreviewText.js.map +1 -0
- package/dist/destinations/engage-messaging-sendgrid/sendEmail/isRestrictedDomain.d.ts +1 -0
- package/dist/destinations/engage-messaging-sendgrid/sendEmail/isRestrictedDomain.js +14 -0
- package/dist/destinations/engage-messaging-sendgrid/sendEmail/isRestrictedDomain.js.map +1 -0
- package/dist/destinations/engage-messaging-twilio/index.d.ts +4 -3
- package/dist/destinations/engage-messaging-twilio/index.js +169 -15
- package/dist/destinations/engage-messaging-twilio/index.js.map +1 -1
- package/dist/destinations/engage-messaging-twilio/sendMobilePush/PushSender.d.ts +29 -0
- package/dist/destinations/engage-messaging-twilio/sendMobilePush/PushSender.js +169 -0
- package/dist/destinations/engage-messaging-twilio/sendMobilePush/PushSender.js.map +1 -0
- package/dist/destinations/engage-messaging-twilio/sendMobilePush/generated-types.d.ts +39 -0
- package/dist/destinations/engage-messaging-twilio/sendMobilePush/generated-types.js +3 -0
- package/dist/destinations/engage-messaging-twilio/sendMobilePush/generated-types.js.map +1 -0
- package/dist/destinations/engage-messaging-twilio/sendMobilePush/index.d.ts +5 -0
- package/dist/destinations/engage-messaging-twilio/sendMobilePush/index.js +251 -0
- package/dist/destinations/engage-messaging-twilio/sendMobilePush/index.js.map +1 -0
- package/dist/destinations/engage-messaging-twilio/sendSms/SmsMessageSender.d.ts +9 -0
- package/dist/destinations/engage-messaging-twilio/sendSms/SmsMessageSender.js +72 -0
- package/dist/destinations/engage-messaging-twilio/sendSms/SmsMessageSender.js.map +1 -0
- package/dist/destinations/engage-messaging-twilio/sendSms/generated-types.d.ts +27 -0
- package/dist/destinations/engage-messaging-twilio/sendSms/generated-types.js +3 -0
- package/dist/destinations/engage-messaging-twilio/sendSms/generated-types.js.map +1 -0
- package/dist/destinations/engage-messaging-twilio/sendSms/index.d.ts +5 -0
- package/dist/destinations/engage-messaging-twilio/sendSms/index.js +163 -0
- package/dist/destinations/engage-messaging-twilio/sendSms/index.js.map +1 -0
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp/WhatsAppMessageSender.d.ts +9 -0
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp/WhatsAppMessageSender.js +89 -0
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp/WhatsAppMessageSender.js.map +1 -0
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp/generated-types.d.ts +25 -0
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp/generated-types.js +3 -0
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp/generated-types.js.map +1 -0
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp/index.d.ts +5 -0
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp/index.js +137 -0
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp/index.js.map +1 -0
- package/dist/destinations/engage-messaging-twilio/utils/PhoneMessageSender.d.ts +16 -0
- package/dist/destinations/engage-messaging-twilio/utils/PhoneMessageSender.js +71 -0
- package/dist/destinations/engage-messaging-twilio/utils/PhoneMessageSender.js.map +1 -0
- package/dist/destinations/engage-messaging-twilio/utils/TwilioMessageSender.d.ts +16 -0
- package/dist/destinations/engage-messaging-twilio/utils/TwilioMessageSender.js +115 -0
- package/dist/destinations/engage-messaging-twilio/utils/TwilioMessageSender.js.map +1 -0
- package/dist/destinations/engage-messaging-twilio/utils/index.d.ts +2 -0
- package/dist/destinations/engage-messaging-twilio/utils/index.js +15 -0
- package/dist/destinations/engage-messaging-twilio/utils/index.js.map +1 -0
- package/dist/destinations/engage-messaging-twilio/utils/types.d.ts +23 -0
- package/dist/destinations/engage-messaging-twilio/utils/types.js +3 -0
- package/dist/destinations/engage-messaging-twilio/utils/types.js.map +1 -0
- package/dist/destinations/index.js.map +1 -1
- package/dist/destinations/moloco-rmp/common/convert.js +29 -17
- package/dist/destinations/moloco-rmp/common/convert.js.map +1 -1
- package/dist/destinations/xtremepush/identify/index.js +2 -2
- package/dist/destinations/xtremepush/identify/index.js.map +1 -1
- package/dist/destinations/xtremepush/index.js.map +1 -1
- package/dist/destinations/xtremepush/track/index.js +2 -2
- package/dist/destinations/xtremepush/track/index.js.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.actionDefinition = void 0;
|
|
4
|
+
const apiLookups_1 = require("../previewApiLookup/apiLookups");
|
|
5
|
+
const SendEmailPerformer_1 = require("./SendEmailPerformer");
|
|
6
|
+
exports.actionDefinition = {
|
|
7
|
+
title: 'Send Email',
|
|
8
|
+
description: 'Sends Email to a user powered by SendGrid',
|
|
9
|
+
defaultSubscription: 'type = "track" and event = "Audience Entered"',
|
|
10
|
+
fields: {
|
|
11
|
+
send: {
|
|
12
|
+
label: 'Send Message',
|
|
13
|
+
description: 'Whether or not the message should actually get sent.',
|
|
14
|
+
type: 'boolean',
|
|
15
|
+
required: false,
|
|
16
|
+
default: false
|
|
17
|
+
},
|
|
18
|
+
traitEnrichment: {
|
|
19
|
+
label: 'Trait Enrich',
|
|
20
|
+
description: 'Whether or not trait enrich from event (i.e without profile api call)',
|
|
21
|
+
type: 'boolean',
|
|
22
|
+
required: false,
|
|
23
|
+
default: true
|
|
24
|
+
},
|
|
25
|
+
userId: {
|
|
26
|
+
label: 'User ID',
|
|
27
|
+
description: 'User ID in Segment',
|
|
28
|
+
type: 'string',
|
|
29
|
+
required: false,
|
|
30
|
+
default: { '@path': '$.userId' }
|
|
31
|
+
},
|
|
32
|
+
toEmail: {
|
|
33
|
+
label: 'Test Email',
|
|
34
|
+
description: 'Email to send to when testing',
|
|
35
|
+
type: 'string'
|
|
36
|
+
},
|
|
37
|
+
fromDomain: {
|
|
38
|
+
label: 'From Domain',
|
|
39
|
+
description: 'Verified domain in Sendgrid',
|
|
40
|
+
type: 'string',
|
|
41
|
+
allowNull: true
|
|
42
|
+
},
|
|
43
|
+
fromEmail: {
|
|
44
|
+
label: 'From Email',
|
|
45
|
+
description: 'From Email',
|
|
46
|
+
type: 'string',
|
|
47
|
+
required: true
|
|
48
|
+
},
|
|
49
|
+
fromName: {
|
|
50
|
+
label: 'From Name',
|
|
51
|
+
description: 'From Name displayed to end user email',
|
|
52
|
+
type: 'string',
|
|
53
|
+
required: true
|
|
54
|
+
},
|
|
55
|
+
replyToEqualsFrom: {
|
|
56
|
+
label: 'Reply To Equals From',
|
|
57
|
+
description: 'Whether "reply to" settings are the same as "from"',
|
|
58
|
+
type: 'boolean'
|
|
59
|
+
},
|
|
60
|
+
replyToEmail: {
|
|
61
|
+
label: 'Reply To Email',
|
|
62
|
+
description: 'The Email used by user to Reply To',
|
|
63
|
+
type: 'string',
|
|
64
|
+
required: true
|
|
65
|
+
},
|
|
66
|
+
replyToName: {
|
|
67
|
+
label: 'Reply To Name',
|
|
68
|
+
description: 'The Name used by user to Reply To',
|
|
69
|
+
type: 'string',
|
|
70
|
+
required: true
|
|
71
|
+
},
|
|
72
|
+
bcc: {
|
|
73
|
+
label: 'BCC',
|
|
74
|
+
description: 'BCC list of emails',
|
|
75
|
+
type: 'string',
|
|
76
|
+
required: true
|
|
77
|
+
},
|
|
78
|
+
previewText: {
|
|
79
|
+
label: 'Preview Text',
|
|
80
|
+
description: 'Preview Text',
|
|
81
|
+
type: 'string'
|
|
82
|
+
},
|
|
83
|
+
subject: {
|
|
84
|
+
label: 'Subject',
|
|
85
|
+
description: 'Subject for the email to be sent',
|
|
86
|
+
type: 'string',
|
|
87
|
+
required: true
|
|
88
|
+
},
|
|
89
|
+
body: {
|
|
90
|
+
label: 'Body',
|
|
91
|
+
description: 'The message body',
|
|
92
|
+
type: 'text'
|
|
93
|
+
},
|
|
94
|
+
bodyUrl: {
|
|
95
|
+
label: 'Body URL',
|
|
96
|
+
description: 'URL to the message body',
|
|
97
|
+
type: 'text'
|
|
98
|
+
},
|
|
99
|
+
bodyType: {
|
|
100
|
+
label: 'Body Type',
|
|
101
|
+
description: 'The type of body which is used generally html | design',
|
|
102
|
+
type: 'string',
|
|
103
|
+
required: true
|
|
104
|
+
},
|
|
105
|
+
bodyHtml: {
|
|
106
|
+
label: 'Body Html',
|
|
107
|
+
description: 'The HTML content of the body',
|
|
108
|
+
type: 'string'
|
|
109
|
+
},
|
|
110
|
+
groupId: {
|
|
111
|
+
label: 'Group ID',
|
|
112
|
+
description: 'Subscription group ID',
|
|
113
|
+
type: 'string'
|
|
114
|
+
},
|
|
115
|
+
byPassSubscription: {
|
|
116
|
+
label: 'By Pass Subscription',
|
|
117
|
+
description: 'Send email without subscription check',
|
|
118
|
+
type: 'boolean',
|
|
119
|
+
default: false
|
|
120
|
+
},
|
|
121
|
+
ipPool: {
|
|
122
|
+
label: 'IP Pool',
|
|
123
|
+
description: 'Send email with an ip pool',
|
|
124
|
+
type: 'string',
|
|
125
|
+
default: ''
|
|
126
|
+
},
|
|
127
|
+
sendBasedOnOptOut: {
|
|
128
|
+
label: 'Send OptOut',
|
|
129
|
+
description: 'Send to any subscription status other than unsubscribed',
|
|
130
|
+
type: 'boolean',
|
|
131
|
+
default: false
|
|
132
|
+
},
|
|
133
|
+
apiLookups: {
|
|
134
|
+
label: 'API Lookups',
|
|
135
|
+
description: 'Any API lookup configs that are needed to send the template',
|
|
136
|
+
type: 'object',
|
|
137
|
+
multiple: true,
|
|
138
|
+
properties: apiLookups_1.apiLookupActionFields
|
|
139
|
+
},
|
|
140
|
+
segmentComputationId: {
|
|
141
|
+
label: 'Segment Computation ID',
|
|
142
|
+
description: 'Segment computation ID',
|
|
143
|
+
type: 'string',
|
|
144
|
+
required: false,
|
|
145
|
+
default: {
|
|
146
|
+
'@path': '$.context.personas.computation_id'
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
externalIds: {
|
|
150
|
+
label: 'External IDs',
|
|
151
|
+
description: 'An array of user profile identity information.',
|
|
152
|
+
type: 'object',
|
|
153
|
+
multiple: true,
|
|
154
|
+
properties: {
|
|
155
|
+
id: {
|
|
156
|
+
label: 'ID',
|
|
157
|
+
description: 'A unique identifier for the collection.',
|
|
158
|
+
type: 'string'
|
|
159
|
+
},
|
|
160
|
+
type: {
|
|
161
|
+
label: 'type',
|
|
162
|
+
description: 'The external ID contact type.',
|
|
163
|
+
type: 'string'
|
|
164
|
+
},
|
|
165
|
+
subscriptionStatus: {
|
|
166
|
+
label: 'subscriptionStatus',
|
|
167
|
+
description: 'The subscription status for the identity.',
|
|
168
|
+
type: 'string'
|
|
169
|
+
},
|
|
170
|
+
unsubscribeLink: {
|
|
171
|
+
label: 'unsubscribeLink',
|
|
172
|
+
description: 'Unsubscribe link for the end user',
|
|
173
|
+
type: 'string'
|
|
174
|
+
},
|
|
175
|
+
preferencesLink: {
|
|
176
|
+
label: 'preferencesLink',
|
|
177
|
+
description: 'Preferences link for the end user',
|
|
178
|
+
type: 'string'
|
|
179
|
+
},
|
|
180
|
+
groups: {
|
|
181
|
+
label: 'Subscription Groups',
|
|
182
|
+
description: 'Subscription groups and their statuses for this id.',
|
|
183
|
+
type: 'object',
|
|
184
|
+
multiple: true,
|
|
185
|
+
properties: {
|
|
186
|
+
id: {
|
|
187
|
+
label: 'Subscription group id',
|
|
188
|
+
type: 'string'
|
|
189
|
+
},
|
|
190
|
+
isSubscribed: {
|
|
191
|
+
label: 'status',
|
|
192
|
+
description: 'Group subscription status true is subscribed, false is unsubscribed or did-not-subscribe',
|
|
193
|
+
type: 'boolean'
|
|
194
|
+
},
|
|
195
|
+
groupUnsubscribeLink: {
|
|
196
|
+
label: 'groupUnsubscribeLink',
|
|
197
|
+
description: 'Group unsubscribe link for the end user',
|
|
198
|
+
type: 'string'
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
default: {
|
|
204
|
+
'@arrayPath': [
|
|
205
|
+
'$.external_ids',
|
|
206
|
+
{
|
|
207
|
+
id: {
|
|
208
|
+
'@path': '$.id'
|
|
209
|
+
},
|
|
210
|
+
type: {
|
|
211
|
+
'@path': '$.type'
|
|
212
|
+
},
|
|
213
|
+
subscriptionStatus: {
|
|
214
|
+
'@path': '$.isSubscribed'
|
|
215
|
+
},
|
|
216
|
+
unsubscribeLink: {
|
|
217
|
+
'@path': '$.unsubscribeLink'
|
|
218
|
+
},
|
|
219
|
+
preferencesLink: {
|
|
220
|
+
'@path': '$.preferencesLink'
|
|
221
|
+
},
|
|
222
|
+
groups: {
|
|
223
|
+
'@path': '$.groups'
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
]
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
customArgs: {
|
|
230
|
+
label: 'Custom Args',
|
|
231
|
+
description: 'Additional custom args that we be passed back opaquely on webhook events',
|
|
232
|
+
type: 'object',
|
|
233
|
+
required: false
|
|
234
|
+
},
|
|
235
|
+
traits: {
|
|
236
|
+
label: 'Traits',
|
|
237
|
+
description: "A user profile's traits",
|
|
238
|
+
type: 'object',
|
|
239
|
+
required: false,
|
|
240
|
+
default: { '@path': '$.properties' }
|
|
241
|
+
},
|
|
242
|
+
eventOccurredTS: {
|
|
243
|
+
label: 'Event Timestamp',
|
|
244
|
+
description: 'Time of when the actual event happened.',
|
|
245
|
+
type: 'string',
|
|
246
|
+
required: false,
|
|
247
|
+
default: {
|
|
248
|
+
'@path': '$.timestamp'
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
perform: async (request, executeInput) => {
|
|
253
|
+
const performer = new SendEmailPerformer_1.SendEmailPerformer(request, executeInput);
|
|
254
|
+
return performer.perform();
|
|
255
|
+
}
|
|
256
|
+
};
|
|
257
|
+
exports.default = exports.actionDefinition;
|
|
258
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/engage-messaging-sendgrid/sendEmail/index.ts"],"names":[],"mappings":";;;AAGA,+DAAsE;AACtE,6DAAyD;AAE5C,QAAA,gBAAgB,GAAwC;IACnE,KAAK,EAAE,YAAY;IACnB,WAAW,EAAE,2CAA2C;IACxD,mBAAmB,EAAE,+CAA+C;IACpE,MAAM,EAAE;QACN,IAAI,EAAE;YACJ,KAAK,EAAE,cAAc;YACrB,WAAW,EAAE,sDAAsD;YACnE,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,KAAK;SACf;QACD,eAAe,EAAE;YACf,KAAK,EAAE,cAAc;YACrB,WAAW,EAAE,uEAAuE;YACpF,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,IAAI;SACd;QACD,MAAM,EAAE;YACN,KAAK,EAAE,SAAS;YAChB,WAAW,EAAE,oBAAoB;YACjC,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;SACjC;QACD,OAAO,EAAE;YACP,KAAK,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ACD,eAAe,EAAE;4BACf,OAAO,EAAE,mBAAmB;yBAC7B;wBACD,MAAM,EAAE;4BACN,OAAO,EAAE,UAAU;yBACpB;qBACF;iBACF;aACF;SACF;QACD,UAAU,EAAE;YACV,KAAK,EAAE,aAAa;YACpB,WAAW,EAAE,0EAA0E;YACvF,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;SAChB;QACD,MAAM,EAAE;YACN,KAAK,EAAE,QAAQ;YACf,WAAW,EAAE,yBAAyB;YACtC,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,EAAE,OAAO,EAAE,cAAc,EAAE;SACrC;QACD,eAAe,EAAE;YACf,KAAK,EAAE,iBAAiB;YACxB,WAAW,EAAE,yCAAyC;YACtD,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE;gBACP,OAAO,EAAE,aAAa;aACvB;SACF;KACF;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE;QACvC,MAAM,SAAS,GAAG,IAAI,uCAAkB,CAAC,OAAO,EAAE,YAAY,CAAC,CAAA;QAC/D,OAAO,SAAS,CAAC,OAAO,EAAE,CAAA;IAC5B,CAAC;CACF,CAAA;AAED,kBAAe,wBAAgB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function insertEmailPreviewText(html: string, previewText: string): string;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.insertEmailPreviewText = void 0;
|
|
7
|
+
const cheerio_1 = __importDefault(require("cheerio"));
|
|
8
|
+
const escape_goat_1 = require("escape-goat");
|
|
9
|
+
function insertEmailPreviewText(html, previewText) {
|
|
10
|
+
const $ = cheerio_1.default.load(html);
|
|
11
|
+
$('body').prepend(`
|
|
12
|
+
<div style='display: none; max-height: 0px; overflow: hidden;'>
|
|
13
|
+
${escape_goat_1.htmlEscape(previewText)}
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
<div style="display: none; max-height: 0px; overflow: hidden;">
|
|
17
|
+
͏ ‌   ­ ͏ ‌   ­ ͏ ‌   ­ ͏ ‌   ­ ͏ ‌   ­ ͏ ‌   ­ ͏ ‌   ­ ͏ ‌   ­
|
|
18
|
+
</div>
|
|
19
|
+
`);
|
|
20
|
+
return $.html();
|
|
21
|
+
}
|
|
22
|
+
exports.insertEmailPreviewText = insertEmailPreviewText;
|
|
23
|
+
//# sourceMappingURL=insertEmailPreviewText.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"insertEmailPreviewText.js","sourceRoot":"","sources":["../../../../src/destinations/engage-messaging-sendgrid/sendEmail/insertEmailPreviewText.ts"],"names":[],"mappings":";;;;;;AAAA,sDAA6B;AAC7B,6CAAwC;AAExC,SAAgB,sBAAsB,CAAC,IAAY,EAAE,WAAmB;IACtE,MAAM,CAAC,GAAG,iBAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAG5B,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC;;QAEZ,wBAAU,CAAC,WAAW,CAAC;;;;;;GAM5B,CAAC,CAAA;IAEF,OAAO,CAAC,CAAC,IAAI,EAAE,CAAA;AACjB,CAAC;AAfD,wDAeC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isRestrictedDomain: (email: string) => boolean;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isRestrictedDomain = void 0;
|
|
4
|
+
const isRestrictedDomain = (email) => {
|
|
5
|
+
const restricted = ['gmailx.com', 'yahoox.com', 'aolx.com', 'hotmailx.com'];
|
|
6
|
+
const matches = /^.+@(.+)$/.exec(email.toLowerCase());
|
|
7
|
+
if (!matches) {
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
const domain = matches[1];
|
|
11
|
+
return restricted.includes(domain);
|
|
12
|
+
};
|
|
13
|
+
exports.isRestrictedDomain = isRestrictedDomain;
|
|
14
|
+
//# sourceMappingURL=isRestrictedDomain.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isRestrictedDomain.js","sourceRoot":"","sources":["../../../../src/destinations/engage-messaging-sendgrid/sendEmail/isRestrictedDomain.ts"],"names":[],"mappings":";;;AAAO,MAAM,kBAAkB,GAAG,CAAC,KAAa,EAAW,EAAE;IAC3D,MAAM,UAAU,GAAG,CAAC,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,cAAc,CAAC,CAAA;IAC3E,MAAM,OAAO,GAAG,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAA;IAErD,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO,KAAK,CAAA;KACb;IAED,MAAM,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;IACzB,OAAO,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;AACpC,CAAC,CAAA;AAVY,QAAA,kBAAkB,sBAU9B"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
export
|
|
1
|
+
import type { DestinationDefinition } from '@segment/actions-core';
|
|
2
|
+
import type { Settings } from './generated-types';
|
|
3
|
+
export declare const destinationDefinition: DestinationDefinition<Settings>;
|
|
4
|
+
export default destinationDefinition;
|
|
@@ -1,19 +1,173 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.destinationDefinition = void 0;
|
|
4
|
+
const sendSms_1 = require("./sendSms");
|
|
5
|
+
const sendWhatsApp_1 = require("./sendWhatsApp");
|
|
6
|
+
const sendMobilePush_1 = require("./sendMobilePush");
|
|
7
|
+
const getRange = (val) => {
|
|
8
|
+
return Array(val)
|
|
9
|
+
.fill(1)
|
|
10
|
+
.map((x, y) => ({ value: x + y, label: `${x + y}` }));
|
|
11
11
|
};
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
const ConnectionOverridesProperties = {
|
|
13
|
+
ct: {
|
|
14
|
+
label: 'Connection timeout',
|
|
15
|
+
description: 'The timeout in milliseconds Twilio will wait to establish its TCP connection to your webserver',
|
|
16
|
+
type: 'number',
|
|
17
|
+
default: 5000,
|
|
18
|
+
choices: getRange(10000)
|
|
19
|
+
},
|
|
20
|
+
rt: {
|
|
21
|
+
label: 'Read timeout',
|
|
22
|
+
description: 'The amount of time in milliseconds after sending your webhook an HTTP request that Twilio will wait for the initial HTTP response packet',
|
|
23
|
+
type: 'number',
|
|
24
|
+
default: 15000,
|
|
25
|
+
choices: getRange(15000)
|
|
26
|
+
},
|
|
27
|
+
tt: {
|
|
28
|
+
label: 'Total timeout',
|
|
29
|
+
description: 'The total time allowed for all timeouts including retries',
|
|
30
|
+
type: 'number',
|
|
31
|
+
default: 15000,
|
|
32
|
+
choices: getRange(15000)
|
|
33
|
+
},
|
|
34
|
+
rc: {
|
|
35
|
+
label: 'Retry count',
|
|
36
|
+
description: 'The number of retry attempts Twilio will make if its connection to your webhook fails',
|
|
37
|
+
type: 'number',
|
|
38
|
+
default: 1,
|
|
39
|
+
choices: getRange(5)
|
|
40
|
+
},
|
|
41
|
+
rp: {
|
|
42
|
+
label: 'Retry policy',
|
|
43
|
+
description: 'The type of failure to retry on',
|
|
44
|
+
type: 'string',
|
|
45
|
+
default: 'ct',
|
|
46
|
+
choices: ['ct', '4xx', '5xx', 'rt', 'all']
|
|
47
|
+
},
|
|
48
|
+
sni: {
|
|
49
|
+
label: 'SNI',
|
|
50
|
+
description: 'The type of failure to retry on',
|
|
51
|
+
type: 'string',
|
|
52
|
+
default: 'unset',
|
|
53
|
+
choices: ['y', 'n', 'unser']
|
|
54
|
+
},
|
|
55
|
+
e: {
|
|
56
|
+
label: 'Edge location',
|
|
57
|
+
description: 'The Twilio edge location where webhooks egress. This can be a list and we rotate through the list as retries happen.',
|
|
58
|
+
type: 'string',
|
|
59
|
+
default: 'ashburn',
|
|
60
|
+
choices: [
|
|
61
|
+
'ashburn',
|
|
62
|
+
'ashburn-ix',
|
|
63
|
+
'dublin',
|
|
64
|
+
'frankfurt',
|
|
65
|
+
'frankfurt-ix',
|
|
66
|
+
'sao-paulo',
|
|
67
|
+
'singapore',
|
|
68
|
+
'sydney',
|
|
69
|
+
'tokyo',
|
|
70
|
+
'umatilla',
|
|
71
|
+
'london-ix',
|
|
72
|
+
'san-jose-ix',
|
|
73
|
+
'singapore-ix'
|
|
74
|
+
]
|
|
75
|
+
}
|
|
14
76
|
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
77
|
+
exports.destinationDefinition = {
|
|
78
|
+
name: 'Engage Messaging Twilio',
|
|
79
|
+
slug: 'actions-personas-messaging-twilio',
|
|
80
|
+
mode: 'cloud',
|
|
81
|
+
description: 'This is an Engage specific action to send an SMS and Whatsapp messages using Twilio API',
|
|
82
|
+
authentication: {
|
|
83
|
+
scheme: 'custom',
|
|
84
|
+
fields: {
|
|
85
|
+
twilioAccountSID: {
|
|
86
|
+
label: 'Twilio Account SID',
|
|
87
|
+
description: 'Twilio Account SID',
|
|
88
|
+
type: 'string',
|
|
89
|
+
required: true
|
|
90
|
+
},
|
|
91
|
+
twilioApiKeySID: {
|
|
92
|
+
label: 'Twilio API Key SID',
|
|
93
|
+
description: 'Twilio API Key SID',
|
|
94
|
+
type: 'string',
|
|
95
|
+
required: true
|
|
96
|
+
},
|
|
97
|
+
twilioApiKeySecret: {
|
|
98
|
+
label: 'Twilio API Key Secret',
|
|
99
|
+
description: 'Twilio API Key Secret',
|
|
100
|
+
type: 'password',
|
|
101
|
+
required: true
|
|
102
|
+
},
|
|
103
|
+
profileApiEnvironment: {
|
|
104
|
+
label: 'Profile API Environment',
|
|
105
|
+
description: 'Profile API Environment',
|
|
106
|
+
type: 'string',
|
|
107
|
+
required: true
|
|
108
|
+
},
|
|
109
|
+
profileApiAccessToken: {
|
|
110
|
+
label: 'Profile API Access Token',
|
|
111
|
+
description: 'Profile API Access Token',
|
|
112
|
+
type: 'password',
|
|
113
|
+
required: true
|
|
114
|
+
},
|
|
115
|
+
spaceId: {
|
|
116
|
+
label: 'Space ID',
|
|
117
|
+
description: 'Space ID',
|
|
118
|
+
type: 'string',
|
|
119
|
+
required: true
|
|
120
|
+
},
|
|
121
|
+
sourceId: {
|
|
122
|
+
label: 'Source ID',
|
|
123
|
+
description: 'Source ID',
|
|
124
|
+
type: 'string',
|
|
125
|
+
required: true
|
|
126
|
+
},
|
|
127
|
+
webhookUrl: {
|
|
128
|
+
label: 'Webhook URL',
|
|
129
|
+
description: 'Webhook URL that will receive all events for the sent message',
|
|
130
|
+
type: 'string',
|
|
131
|
+
format: 'uri',
|
|
132
|
+
required: false
|
|
133
|
+
},
|
|
134
|
+
twilioHostname: {
|
|
135
|
+
label: 'Twilio host name',
|
|
136
|
+
description: 'Overrides the default Twilio host name used mainly for testing without having to send real messages.',
|
|
137
|
+
type: 'string',
|
|
138
|
+
default: 'api.twilio.com',
|
|
139
|
+
required: false
|
|
140
|
+
},
|
|
141
|
+
connectionOverrides: {
|
|
142
|
+
label: 'Connection Overrides',
|
|
143
|
+
description: 'Connection overrides are configuration supported by twilio webhook services. Must be passed as fragments on the callback url',
|
|
144
|
+
type: 'string',
|
|
145
|
+
required: false,
|
|
146
|
+
default: 'rp=all&rc=5',
|
|
147
|
+
properties: ConnectionOverridesProperties
|
|
148
|
+
},
|
|
149
|
+
region: {
|
|
150
|
+
label: 'Region',
|
|
151
|
+
description: 'The region where the message is originating from',
|
|
152
|
+
type: 'string',
|
|
153
|
+
choices: [
|
|
154
|
+
{ value: 'us-west-2', label: 'US West 2' },
|
|
155
|
+
{ value: 'eu-west-1', label: 'EU West 1' }
|
|
156
|
+
],
|
|
157
|
+
default: 'us-west-2',
|
|
158
|
+
required: false
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
testAuthentication: (request, options) => {
|
|
162
|
+
const hostName = options.settings.twilioHostname ?? 'api.twilio.com';
|
|
163
|
+
return request(`https://${hostName}/2010-04-01`);
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
actions: {
|
|
167
|
+
sendSms: sendSms_1.actionDefinition,
|
|
168
|
+
sendWhatsApp: sendWhatsApp_1.actionDefinition,
|
|
169
|
+
sendMobilePush: sendMobilePush_1.actionDefinition
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
exports.default = exports.destinationDefinition;
|
|
19
173
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/engage-messaging-twilio/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/engage-messaging-twilio/index.ts"],"names":[],"mappings":";;;AAEA,uCAAuD;AACvD,iDAAiE;AACjE,qDAAqE;AAErE,MAAM,QAAQ,GAAG,CAAC,GAAW,EAAsC,EAAE;IACnE,OAAO,KAAK,CAAC,GAAG,CAAC;SACd,IAAI,CAAC,CAAC,CAAC;SACP,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;AACzD,CAAC,CAAA;AAED,MAAM,6BAA6B,GAA+B;IAChE,EAAE,EAAE;QACF,KAAK,EAAE,oBAAoB;QAC3B,W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I,EAAE,QAAQ;gBACd,MAAM,EAAE,KAAK;gBACb,QAAQ,EAAE,KAAK;aAChB;YACD,cAAc,EAAE;gBACd,KAAK,EAAE,kBAAkB;gBACzB,WAAW,EACT,sGAAsG;gBACxG,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,gBAAgB;gBACzB,QAAQ,EAAE,KAAK;aAChB;YACD,mBAAmB,EAAE;gBACnB,KAAK,EAAE,sBAAsB;gBAC7B,WAAW,EACT,8HAA8H;gBAChI,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,KAAK;gBACf,OAAO,EAAE,aAAa;gBACtB,UAAU,EAAE,6BAA6B;aAC1C;YACD,MAAM,EAAE;gBACN,KAAK,EAAE,QAAQ;gBACf,WAAW,EAAE,kDAAkD;gBAC/D,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE;oBACP,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE;oBAC1C,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE;iBAC3C;gBACD,OAAO,EAAE,WAAW;gBACpB,QAAQ,EAAE,KAAK;aAChB;SACF;QACD,kBAAkB,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE;YACvC,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,cAAc,IAAI,gBAAgB,CAAA;YACpE,OAAO,OAAO,CAAC,WAAW,QAAQ,aAAa,CAAC,CAAA;QAClD,CAAC;KACF;IASD,OAAO,EAAE;QACP,OAAO,EAAP,0BAAO;QACP,YAAY,EAAZ,+BAAY;QACZ,cAAc,EAAd,iCAAc;KACf;CACF,CAAA;AAED,kBAAe,6BAAqB,CAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { TwilioMessageSender } from '../utils';
|
|
2
|
+
import { ExtId } from '@segment/actions-shared';
|
|
3
|
+
import type { Payload as PushPayload } from './generated-types';
|
|
4
|
+
interface BodyCustomDataBundle {
|
|
5
|
+
requestBody: URLSearchParams;
|
|
6
|
+
customData: object;
|
|
7
|
+
}
|
|
8
|
+
declare type Recepient = ExtId<PushPayload>;
|
|
9
|
+
export declare enum MobilePushExtIdTypes {
|
|
10
|
+
IOS = "ios.push_token",
|
|
11
|
+
ANDROID = "android.push_token"
|
|
12
|
+
}
|
|
13
|
+
export declare class PushSender extends TwilioMessageSender<PushPayload> {
|
|
14
|
+
static readonly externalIdTypes: MobilePushExtIdTypes[];
|
|
15
|
+
getChannelType(): string;
|
|
16
|
+
isSupportedExternalId(externalId: ExtId<PushPayload>): boolean;
|
|
17
|
+
readonly supportedTemplateTypes: string[];
|
|
18
|
+
private DEFAULT_HOSTNAME;
|
|
19
|
+
get twilioHostname(): string;
|
|
20
|
+
get twilioToken(): string;
|
|
21
|
+
beforeSend(recepients: Recepient[]): Promise<void>;
|
|
22
|
+
bodyCustomDataBundle: BodyCustomDataBundle;
|
|
23
|
+
sendToRecepient(recipientDevice: Recepient): Promise<import("@segment/actions-core").ModifiedResponse<unknown>>;
|
|
24
|
+
getBody(): Promise<BodyCustomDataBundle>;
|
|
25
|
+
private getFcmNotificationOverrides;
|
|
26
|
+
private getTapActionPreset;
|
|
27
|
+
private removeEmpties;
|
|
28
|
+
}
|
|
29
|
+
export {};
|