@segment/action-destinations 3.74.1-alpha.1 → 3.74.1-alpha.2
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/personas-messaging-sendgrid/generated-types.d.ts +8 -0
- package/dist/destinations/personas-messaging-sendgrid/generated-types.js +3 -0
- package/dist/destinations/personas-messaging-sendgrid/generated-types.js.map +1 -0
- package/dist/destinations/personas-messaging-sendgrid/index.d.ts +4 -0
- package/dist/destinations/personas-messaging-sendgrid/index.js +59 -0
- package/dist/destinations/personas-messaging-sendgrid/index.js.map +1 -0
- package/dist/destinations/personas-messaging-sendgrid/sendEmail/generated-types.d.ts +26 -0
- package/dist/destinations/personas-messaging-sendgrid/sendEmail/generated-types.js +3 -0
- package/dist/destinations/personas-messaging-sendgrid/sendEmail/generated-types.js.map +1 -0
- package/dist/destinations/personas-messaging-sendgrid/sendEmail/index.d.ts +5 -0
- package/dist/destinations/personas-messaging-sendgrid/sendEmail/index.js +310 -0
- package/dist/destinations/personas-messaging-sendgrid/sendEmail/index.js.map +1 -0
- package/dist/destinations/personas-messaging-twilio/generated-types.d.ts +11 -0
- package/dist/destinations/personas-messaging-twilio/generated-types.js +3 -0
- package/dist/destinations/personas-messaging-twilio/generated-types.js.map +1 -0
- package/dist/destinations/personas-messaging-twilio/index.d.ts +4 -0
- package/dist/destinations/personas-messaging-twilio/index.js +150 -0
- package/dist/destinations/personas-messaging-twilio/index.js.map +1 -0
- package/dist/destinations/personas-messaging-twilio/sendSms/generated-types.d.ts +16 -0
- package/dist/destinations/personas-messaging-twilio/sendSms/generated-types.js +3 -0
- package/dist/destinations/personas-messaging-twilio/sendSms/generated-types.js.map +1 -0
- package/dist/destinations/personas-messaging-twilio/sendSms/index.d.ts +5 -0
- package/dist/destinations/personas-messaging-twilio/sendSms/index.js +166 -0
- package/dist/destinations/personas-messaging-twilio/sendSms/index.js.map +1 -0
- package/dist/destinations/salesforce/sf-operations.d.ts +1 -0
- package/dist/destinations/salesforce/sf-operations.js +13 -1
- package/dist/destinations/salesforce/sf-operations.js.map +1 -1
- package/dist/destinations/snap-conversions-api/index.js +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../src/destinations/personas-messaging-sendgrid/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,59 @@
|
|
|
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
|
+
const sendEmail_1 = __importDefault(require("./sendEmail"));
|
|
7
|
+
const destination = {
|
|
8
|
+
name: 'Actions Personas Messaging Sendgrid',
|
|
9
|
+
mode: 'cloud',
|
|
10
|
+
description: 'This is a personas specific action to send an email',
|
|
11
|
+
authentication: {
|
|
12
|
+
scheme: 'custom',
|
|
13
|
+
fields: {
|
|
14
|
+
unlayerApiKey: {
|
|
15
|
+
label: 'Unlayer API Key',
|
|
16
|
+
type: 'password',
|
|
17
|
+
description: 'The API key for your Unlayer account'
|
|
18
|
+
},
|
|
19
|
+
sendGridApiKey: {
|
|
20
|
+
label: 'API Key',
|
|
21
|
+
type: 'password',
|
|
22
|
+
description: 'The Api Key for your sendGrid account',
|
|
23
|
+
required: true
|
|
24
|
+
},
|
|
25
|
+
profileApiEnvironment: {
|
|
26
|
+
label: 'Profile API Environment',
|
|
27
|
+
description: 'Profile API Environment',
|
|
28
|
+
type: 'string',
|
|
29
|
+
required: true
|
|
30
|
+
},
|
|
31
|
+
profileApiAccessToken: {
|
|
32
|
+
label: 'Profile API Access Token',
|
|
33
|
+
description: 'Profile API Access Token',
|
|
34
|
+
type: 'password',
|
|
35
|
+
required: true
|
|
36
|
+
},
|
|
37
|
+
spaceId: {
|
|
38
|
+
label: 'Space ID',
|
|
39
|
+
description: 'Space ID',
|
|
40
|
+
type: 'string',
|
|
41
|
+
required: true
|
|
42
|
+
},
|
|
43
|
+
sourceId: {
|
|
44
|
+
label: 'Source ID',
|
|
45
|
+
description: 'Source ID',
|
|
46
|
+
type: 'string',
|
|
47
|
+
required: true
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
testAuthentication: (request) => {
|
|
51
|
+
return request('https://api.sendgrid.com/v3/mail_settings');
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
actions: {
|
|
55
|
+
sendEmail: sendEmail_1.default
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
exports.default = destination;
|
|
59
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/personas-messaging-sendgrid/index.ts"],"names":[],"mappings":";;;;;AAEA,4DAAmC;AAEnC,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,qCAAqC;IAC3C,IAAI,EAAE,OAAO;IACb,WAAW,EAAE,qDAAqD;IAClE,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,aAAa,EAAE;gBACb,KAAK,EAAE,iBAAiB;gBACxB,IAAI,EAAE,UAAU;gBAChB,WAAW,EAAE,sCAAsC;aACpD;YACD,cAAc,EAAE;gBACd,KAAK,EAAE,SAAS;gBAChB,IAAI,EAAE,UAAU;gBAChB,WAAW,EAAE,uCAAuC;gBACpD,QAAQ,EAAE,IAAI;aACf;YACD,qBAAqB,EAAE;gBACrB,KAAK,EAAE,yBAAyB;gBAChC,WAAW,EAAE,yBAAyB;gBACtC,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,qBAAqB,EAAE;gBACrB,KAAK,EAAE,0BAA0B;gBACjC,WAAW,EAAE,0BAA0B;gBACvC,IAAI,EAAE,UAAU;gBAChB,QAAQ,EAAE,IAAI;aACf;YACD,OAAO,EAAE;gBACP,KAAK,EAAE,UAAU;gBACjB,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,QAAQ,EAAE;gBACR,KAAK,EAAE,WAAW;gBAClB,WAAW,EAAE,WAAW;gBACxB,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;SACF;QACD,kBAAkB,EAAE,CAAC,OAAO,EAAE,EAAE;YAC9B,OAAO,OAAO,CAAC,2CAA2C,CAAC,CAAA;QAC7D,CAAC;KACF;IACD,OAAO,EAAE;QACP,SAAS,EAAT,mBAAS;KACV;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface Payload {
|
|
2
|
+
send?: boolean;
|
|
3
|
+
userId: string;
|
|
4
|
+
toEmail?: string;
|
|
5
|
+
fromDomain?: string | null;
|
|
6
|
+
fromEmail: string;
|
|
7
|
+
fromName: string;
|
|
8
|
+
replyToEqualsFrom?: boolean;
|
|
9
|
+
replyToEmail: string;
|
|
10
|
+
replyToName: string;
|
|
11
|
+
bcc: string;
|
|
12
|
+
previewText?: string;
|
|
13
|
+
subject: string;
|
|
14
|
+
body?: string;
|
|
15
|
+
bodyUrl?: string;
|
|
16
|
+
bodyType: string;
|
|
17
|
+
bodyHtml?: string;
|
|
18
|
+
externalIds?: {
|
|
19
|
+
id?: string;
|
|
20
|
+
type?: string;
|
|
21
|
+
subscriptionStatus?: string;
|
|
22
|
+
}[];
|
|
23
|
+
customArgs?: {
|
|
24
|
+
[k: string]: unknown;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/personas-messaging-sendgrid/sendEmail/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,310 @@
|
|
|
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
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
7
|
+
const liquidjs_1 = require("liquidjs");
|
|
8
|
+
const cheerio_1 = __importDefault(require("cheerio"));
|
|
9
|
+
const escape_goat_1 = require("escape-goat");
|
|
10
|
+
const Liquid = new liquidjs_1.Liquid();
|
|
11
|
+
const insertEmailPreviewText = (html, previewText) => {
|
|
12
|
+
const $ = cheerio_1.default.load(html);
|
|
13
|
+
$('body').prepend(`
|
|
14
|
+
<div style='display: none; max-height: 0px; overflow: hidden;'>
|
|
15
|
+
${escape_goat_1.htmlEscape(previewText)}
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
<div style='display: none; max-height: 0px; overflow: hidden;'>
|
|
19
|
+
${' ‌'.repeat(13)}
|
|
20
|
+
</div>
|
|
21
|
+
`);
|
|
22
|
+
return $.html();
|
|
23
|
+
};
|
|
24
|
+
const getProfileApiEndpoint = (environment) => {
|
|
25
|
+
return `https://profiles.segment.${environment === 'production' ? 'com' : 'build'}`;
|
|
26
|
+
};
|
|
27
|
+
const fetchProfileTraits = async (request, settings, profileId) => {
|
|
28
|
+
const endpoint = getProfileApiEndpoint(settings.profileApiEnvironment);
|
|
29
|
+
const response = await request(`${endpoint}/v1/spaces/${settings.spaceId}/collections/users/profiles/user_id:${profileId}/traits?limit=200`, {
|
|
30
|
+
headers: {
|
|
31
|
+
authorization: `Basic ${Buffer.from(settings.profileApiAccessToken + ':').toString('base64')}`,
|
|
32
|
+
'content-type': 'application/json'
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
const body = await response.json();
|
|
36
|
+
return body.traits;
|
|
37
|
+
};
|
|
38
|
+
const isRestrictedDomain = (email) => {
|
|
39
|
+
const restricted = ['gmailx.com', 'yahoox.com', 'aolx.com', 'hotmailx.com'];
|
|
40
|
+
const matches = /^.+@(.+)$/.exec(email.toLowerCase());
|
|
41
|
+
if (!matches) {
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
const domain = matches[1];
|
|
45
|
+
return restricted.includes(domain);
|
|
46
|
+
};
|
|
47
|
+
const generateEmailHtml = async (request, apiKey, design) => {
|
|
48
|
+
const response = await request('https://api.unlayer.com/v2/export/html', {
|
|
49
|
+
method: 'POST',
|
|
50
|
+
headers: {
|
|
51
|
+
authorization: `Basic ${Buffer.from(`${apiKey}:`).toString('base64')}`,
|
|
52
|
+
'content-type': 'application/json'
|
|
53
|
+
},
|
|
54
|
+
body: JSON.stringify({
|
|
55
|
+
displayMode: 'email',
|
|
56
|
+
design: JSON.parse(design)
|
|
57
|
+
})
|
|
58
|
+
});
|
|
59
|
+
const body = await response.json();
|
|
60
|
+
return body.data.html;
|
|
61
|
+
};
|
|
62
|
+
const EXTERNAL_ID_KEY = 'email';
|
|
63
|
+
const action = {
|
|
64
|
+
title: 'Send Email',
|
|
65
|
+
description: 'Sends Email to a user powered by SendGrid',
|
|
66
|
+
defaultSubscription: 'type = "track" and event = "Audience Entered"',
|
|
67
|
+
fields: {
|
|
68
|
+
send: {
|
|
69
|
+
label: 'Send Message',
|
|
70
|
+
description: 'Whether or not the message should actually get sent.',
|
|
71
|
+
type: 'boolean',
|
|
72
|
+
required: false,
|
|
73
|
+
default: false
|
|
74
|
+
},
|
|
75
|
+
userId: {
|
|
76
|
+
label: 'User ID',
|
|
77
|
+
description: 'User ID in Segment',
|
|
78
|
+
type: 'string',
|
|
79
|
+
required: true,
|
|
80
|
+
default: { '@path': '$.userId' }
|
|
81
|
+
},
|
|
82
|
+
toEmail: {
|
|
83
|
+
label: 'Test Email',
|
|
84
|
+
description: 'Email to send to when testing',
|
|
85
|
+
type: 'string'
|
|
86
|
+
},
|
|
87
|
+
fromDomain: {
|
|
88
|
+
label: 'From Domain',
|
|
89
|
+
description: 'Verified domain in Sendgrid',
|
|
90
|
+
type: 'string',
|
|
91
|
+
allowNull: true
|
|
92
|
+
},
|
|
93
|
+
fromEmail: {
|
|
94
|
+
label: 'From Email',
|
|
95
|
+
description: 'From Email',
|
|
96
|
+
type: 'string',
|
|
97
|
+
required: true
|
|
98
|
+
},
|
|
99
|
+
fromName: {
|
|
100
|
+
label: 'From Name',
|
|
101
|
+
description: 'From Name displayed to end user email',
|
|
102
|
+
type: 'string',
|
|
103
|
+
required: true
|
|
104
|
+
},
|
|
105
|
+
replyToEqualsFrom: {
|
|
106
|
+
label: 'Reply To Equals From',
|
|
107
|
+
description: 'Whether "reply to" settings are the same as "from"',
|
|
108
|
+
type: 'boolean'
|
|
109
|
+
},
|
|
110
|
+
replyToEmail: {
|
|
111
|
+
label: 'Reply To Email',
|
|
112
|
+
description: 'The Email used by user to Reply To',
|
|
113
|
+
type: 'string',
|
|
114
|
+
required: true
|
|
115
|
+
},
|
|
116
|
+
replyToName: {
|
|
117
|
+
label: 'Reply To Name',
|
|
118
|
+
description: 'The Name used by user to Reply To',
|
|
119
|
+
type: 'string',
|
|
120
|
+
required: true
|
|
121
|
+
},
|
|
122
|
+
bcc: {
|
|
123
|
+
label: 'BCC',
|
|
124
|
+
description: 'BCC list of emails',
|
|
125
|
+
type: 'string',
|
|
126
|
+
required: true
|
|
127
|
+
},
|
|
128
|
+
previewText: {
|
|
129
|
+
label: 'Preview Text',
|
|
130
|
+
description: 'Preview Text',
|
|
131
|
+
type: 'string'
|
|
132
|
+
},
|
|
133
|
+
subject: {
|
|
134
|
+
label: 'Subject',
|
|
135
|
+
description: 'Subject for the email to be sent',
|
|
136
|
+
type: 'string',
|
|
137
|
+
required: true
|
|
138
|
+
},
|
|
139
|
+
body: {
|
|
140
|
+
label: 'Body',
|
|
141
|
+
description: 'The message body',
|
|
142
|
+
type: 'text'
|
|
143
|
+
},
|
|
144
|
+
bodyUrl: {
|
|
145
|
+
label: 'Body URL',
|
|
146
|
+
description: 'URL to the message body',
|
|
147
|
+
type: 'text'
|
|
148
|
+
},
|
|
149
|
+
bodyType: {
|
|
150
|
+
label: 'Body Type',
|
|
151
|
+
description: 'The type of body which is used generally html | design',
|
|
152
|
+
type: 'string',
|
|
153
|
+
required: true
|
|
154
|
+
},
|
|
155
|
+
bodyHtml: {
|
|
156
|
+
label: 'Body Html',
|
|
157
|
+
description: 'The HTML content of the body',
|
|
158
|
+
type: 'string'
|
|
159
|
+
},
|
|
160
|
+
externalIds: {
|
|
161
|
+
label: 'External IDs',
|
|
162
|
+
description: 'An array of user profile identity information.',
|
|
163
|
+
type: 'object',
|
|
164
|
+
multiple: true,
|
|
165
|
+
properties: {
|
|
166
|
+
id: {
|
|
167
|
+
label: 'ID',
|
|
168
|
+
description: 'A unique identifier for the collection.',
|
|
169
|
+
type: 'string'
|
|
170
|
+
},
|
|
171
|
+
type: {
|
|
172
|
+
label: 'type',
|
|
173
|
+
description: 'The external ID contact type.',
|
|
174
|
+
type: 'string'
|
|
175
|
+
},
|
|
176
|
+
subscriptionStatus: {
|
|
177
|
+
label: 'ID',
|
|
178
|
+
description: 'The subscription status for the identity.',
|
|
179
|
+
type: 'string'
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
default: {
|
|
183
|
+
'@arrayPath': [
|
|
184
|
+
'$.external_ids',
|
|
185
|
+
{
|
|
186
|
+
id: {
|
|
187
|
+
'@path': '$.id'
|
|
188
|
+
},
|
|
189
|
+
type: {
|
|
190
|
+
'@path': '$.type'
|
|
191
|
+
},
|
|
192
|
+
subscriptionStatus: {
|
|
193
|
+
'@path': '$.isSubscribed'
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
]
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
customArgs: {
|
|
200
|
+
label: 'Custom Args',
|
|
201
|
+
description: 'Additional custom args that we be passed back opaquely on webhook events',
|
|
202
|
+
type: 'object',
|
|
203
|
+
required: false
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
perform: async (request, { settings, payload }) => {
|
|
207
|
+
if (!payload.send) {
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
const emailProfile = payload?.externalIds?.find((meta) => meta.type === 'email');
|
|
211
|
+
if (!emailProfile?.subscriptionStatus ||
|
|
212
|
+
['unsubscribed', 'did not subscribed', 'false'].includes(emailProfile.subscriptionStatus)) {
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
else if (['subscribed', 'true'].includes(emailProfile?.subscriptionStatus)) {
|
|
216
|
+
const traits = await fetchProfileTraits(request, settings, payload.userId);
|
|
217
|
+
const profile = {
|
|
218
|
+
email: emailProfile.id,
|
|
219
|
+
traits
|
|
220
|
+
};
|
|
221
|
+
const toEmail = payload.toEmail || profile.email;
|
|
222
|
+
if (!toEmail) {
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
if (isRestrictedDomain(toEmail)) {
|
|
226
|
+
throw new actions_core_1.IntegrationError('Emails with gmailx.com, yahoox.com, aolx.com, and hotmailx.com domains are blocked.', 'Invalid input', 400);
|
|
227
|
+
}
|
|
228
|
+
let name;
|
|
229
|
+
if (traits.first_name && traits.last_name) {
|
|
230
|
+
name = `${traits.first_name} ${traits.last_name}`;
|
|
231
|
+
}
|
|
232
|
+
else if (traits.firstName && traits.lastName) {
|
|
233
|
+
name = `${traits.firstName} ${traits.lastName}`;
|
|
234
|
+
}
|
|
235
|
+
else if (traits.name) {
|
|
236
|
+
name = traits.name;
|
|
237
|
+
}
|
|
238
|
+
else {
|
|
239
|
+
name = traits.first_name || traits.last_name || traits.firstName || traits.lastName || 'User';
|
|
240
|
+
}
|
|
241
|
+
const bcc = JSON.parse(payload.bcc ?? '[]');
|
|
242
|
+
let bodyHtml = payload.bodyHtml ?? '';
|
|
243
|
+
if (payload.bodyUrl && settings.unlayerApiKey) {
|
|
244
|
+
const response = await request(payload.bodyUrl);
|
|
245
|
+
const body = await response.text();
|
|
246
|
+
bodyHtml = payload.bodyType === 'html' ? body : await generateEmailHtml(request, settings.unlayerApiKey, body);
|
|
247
|
+
if (payload.previewText) {
|
|
248
|
+
bodyHtml = insertEmailPreviewText(bodyHtml, payload.previewText);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
const [parsedSubject, parsedBody] = await Promise.all([
|
|
252
|
+
Liquid.parseAndRender(payload.subject, { profile }),
|
|
253
|
+
Liquid.parseAndRender(bodyHtml, { profile })
|
|
254
|
+
]);
|
|
255
|
+
return request('https://api.sendgrid.com/v3/mail/send', {
|
|
256
|
+
method: 'post',
|
|
257
|
+
headers: {
|
|
258
|
+
authorization: `Bearer ${settings.sendGridApiKey}`
|
|
259
|
+
},
|
|
260
|
+
json: {
|
|
261
|
+
personalizations: [
|
|
262
|
+
{
|
|
263
|
+
to: [
|
|
264
|
+
{
|
|
265
|
+
email: toEmail,
|
|
266
|
+
name: name
|
|
267
|
+
}
|
|
268
|
+
],
|
|
269
|
+
bcc: bcc.length > 0 ? bcc : undefined,
|
|
270
|
+
custom_args: {
|
|
271
|
+
...payload.customArgs,
|
|
272
|
+
source_id: settings.sourceId,
|
|
273
|
+
space_id: settings.spaceId,
|
|
274
|
+
user_id: payload.userId,
|
|
275
|
+
__segment_internal_external_id_key__: EXTERNAL_ID_KEY,
|
|
276
|
+
__segment_internal_external_id_value__: profile[EXTERNAL_ID_KEY]
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
],
|
|
280
|
+
from: {
|
|
281
|
+
email: payload.fromEmail,
|
|
282
|
+
name: payload.fromName
|
|
283
|
+
},
|
|
284
|
+
reply_to: {
|
|
285
|
+
email: payload.replyToEmail,
|
|
286
|
+
name: payload.replyToName
|
|
287
|
+
},
|
|
288
|
+
subject: parsedSubject,
|
|
289
|
+
content: [
|
|
290
|
+
{
|
|
291
|
+
type: 'text/html',
|
|
292
|
+
value: parsedBody
|
|
293
|
+
}
|
|
294
|
+
],
|
|
295
|
+
tracking_settings: {
|
|
296
|
+
subscription_tracking: {
|
|
297
|
+
enable: true,
|
|
298
|
+
substitution_tag: '[unsubscribe]'
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
else {
|
|
305
|
+
throw new actions_core_1.IntegrationError(`Failed to process the subscription state: "${emailProfile.subscriptionStatus}"`, 'Invalid subscriptionStatus value', 400);
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
};
|
|
309
|
+
exports.default = action;
|
|
310
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/personas-messaging-sendgrid/sendEmail/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAA0F;AAG1F,uCAA6C;AAC7C,sDAA6B;AAC7B,6CAAwC;AAExC,MAAM,MAAM,GAAG,IAAI,iBAAQ,EAAE,CAAA;AAE7B,MAAM,sBAAsB,GAAG,CAAC,IAAY,EAAE,WAAmB,EAAU,EAAE;IAC3E,MAAM,CAAC,GAAG,iBAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAG5B,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC;;QAEZ,wBAAU,CAAC,WAAW,CAAC;;;;QAIvB,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC;;GAE9B,CAAC,CAAA;IAEF,OAAO,CAAC,CAAC,IAAI,EAAE,CAAA;AACjB,CAAC,CAAA;AAGD,MAAM,qBAAqB,GAAG,CAAC,WAAmB,EAAU,EAAE;IAC5D,OAAO,4BAA4B,WAAW,KAAK,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,CAAA;AACrF,CAAC,CAAA;AAID,MAAM,kBAAkB,GAAG,KAAK,EAC9B,OAAkB,EAClB,QAAkB,EAClB,SAAiB,EACgB,EAAE;IACnC,MAAM,QAAQ,GAAG,qBAAqB,CAAC,QAAQ,CAAC,qBAAqB,CAAC,CAAA;IACtE,MAAM,QAAQ,GAAG,MAAM,OAAO,CAC5B,GAAG,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AAY;wBAC3B,IAAI,EAAE,OAAO,CAAC,WAAW;qBAC1B;oBACD,OAAO,EAAE,aAAa;oBACtB,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,WAAW;4BACjB,KAAK,EAAE,UAAU;yBAClB;qBACF;oBACD,iBAAiB,EAAE;wBACjB,qBAAqB,EAAE;4BACrB,MAAM,EAAE,IAAI;4BACZ,gBAAgB,EAAE,eAAe;yBAClC;qBACF;iBACF;aACF,CAAC,CAAA;SACH;aAAM;YACL,MAAM,IAAI,+BAAgB,CACxB,8CAA8C,YAAY,CAAC,kBAAkB,GAAG,EAChF,kCAAkC,EAClC,GAAG,CACJ,CAAA;SACF;IACH,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface Settings {
|
|
2
|
+
twilioAccountSID: string;
|
|
3
|
+
twilioApiKeySID: string;
|
|
4
|
+
twilioApiKeySecret: string;
|
|
5
|
+
profileApiEnvironment: string;
|
|
6
|
+
profileApiAccessToken: string;
|
|
7
|
+
spaceId: string;
|
|
8
|
+
sourceId: string;
|
|
9
|
+
webhookUrl?: string;
|
|
10
|
+
connectionOverrides?: string;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../src/destinations/personas-messaging-twilio/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,150 @@
|
|
|
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
|
+
const sendSms_1 = __importDefault(require("./sendSms"));
|
|
7
|
+
const getRange = (val) => {
|
|
8
|
+
return Array(val)
|
|
9
|
+
.fill(1)
|
|
10
|
+
.map((x, y) => ({ value: x + y, label: `${x + y}` }));
|
|
11
|
+
};
|
|
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
|
+
}
|
|
76
|
+
};
|
|
77
|
+
const destination = {
|
|
78
|
+
name: 'Personas Messaging Twilio (Actions)',
|
|
79
|
+
mode: 'cloud',
|
|
80
|
+
authentication: {
|
|
81
|
+
scheme: 'custom',
|
|
82
|
+
fields: {
|
|
83
|
+
twilioAccountSID: {
|
|
84
|
+
label: 'Twilio Account SID',
|
|
85
|
+
description: 'Twilio Account SID',
|
|
86
|
+
type: 'string',
|
|
87
|
+
required: true
|
|
88
|
+
},
|
|
89
|
+
twilioApiKeySID: {
|
|
90
|
+
label: 'Twilio API Key SID',
|
|
91
|
+
description: 'Twilio API Key SID',
|
|
92
|
+
type: 'string',
|
|
93
|
+
required: true
|
|
94
|
+
},
|
|
95
|
+
twilioApiKeySecret: {
|
|
96
|
+
label: 'Twilio API Key Secret',
|
|
97
|
+
description: 'Twilio API Key Secret',
|
|
98
|
+
type: 'password',
|
|
99
|
+
required: true
|
|
100
|
+
},
|
|
101
|
+
profileApiEnvironment: {
|
|
102
|
+
label: 'Profile API Environment',
|
|
103
|
+
description: 'Profile API Environment',
|
|
104
|
+
type: 'string',
|
|
105
|
+
required: true
|
|
106
|
+
},
|
|
107
|
+
profileApiAccessToken: {
|
|
108
|
+
label: 'Profile API Access Token',
|
|
109
|
+
description: 'Profile API Access Token',
|
|
110
|
+
type: 'password',
|
|
111
|
+
required: true
|
|
112
|
+
},
|
|
113
|
+
spaceId: {
|
|
114
|
+
label: 'Space ID',
|
|
115
|
+
description: 'Space ID',
|
|
116
|
+
type: 'string',
|
|
117
|
+
required: true
|
|
118
|
+
},
|
|
119
|
+
sourceId: {
|
|
120
|
+
label: 'Source ID',
|
|
121
|
+
description: 'Source ID',
|
|
122
|
+
type: 'string',
|
|
123
|
+
required: true
|
|
124
|
+
},
|
|
125
|
+
webhookUrl: {
|
|
126
|
+
label: 'Webhook URL',
|
|
127
|
+
description: 'Webhook URL that will receive all events for the sent message',
|
|
128
|
+
type: 'string',
|
|
129
|
+
format: 'uri',
|
|
130
|
+
required: false
|
|
131
|
+
},
|
|
132
|
+
connectionOverrides: {
|
|
133
|
+
label: 'Connection Overrides',
|
|
134
|
+
description: 'Connection overrides are configuration supported by twilio webhook services. Must be passed as fragments on the callback url',
|
|
135
|
+
type: 'string',
|
|
136
|
+
required: false,
|
|
137
|
+
default: 'rp=all&rc=5',
|
|
138
|
+
properties: ConnectionOverridesProperties
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
testAuthentication: (request) => {
|
|
142
|
+
return request('https://api.twilio.com/2010-04-01');
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
actions: {
|
|
146
|
+
sendSms: sendSms_1.default
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
exports.default = destination;
|
|
150
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/personas-messaging-twilio/index.ts"],"names":[],"mappings":";;;;;AAEA,wDAA+B;AAE/B,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,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,WAAW,EAAE,+DAA+D;gBAC5E,IAAI,EAAE,QAAQ;gBACd,MAAM,EAAE,KAAK;gBACb,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;SACF;QACD,kBAAkB,EAAE,CAAC,OAAO,EAAE,EAAE;YAC9B,OAAO,OAAO,CAAC,mCAAmC,CAAC,CAAA;QACrD,CAAC;KACF;IASD,OAAO,EAAE;QACP,OAAO,EAAP,iBAAO;KACR;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface Payload {
|
|
2
|
+
userId: string;
|
|
3
|
+
toNumber?: string;
|
|
4
|
+
from: string;
|
|
5
|
+
body: string;
|
|
6
|
+
customArgs?: {
|
|
7
|
+
[k: string]: unknown;
|
|
8
|
+
};
|
|
9
|
+
connectionOverrides?: string;
|
|
10
|
+
send?: boolean;
|
|
11
|
+
externalIds?: {
|
|
12
|
+
id?: string;
|
|
13
|
+
type?: string;
|
|
14
|
+
subscriptionStatus?: string;
|
|
15
|
+
}[];
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/personas-messaging-twilio/sendSms/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const liquidjs_1 = require("liquidjs");
|
|
4
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
5
|
+
const Liquid = new liquidjs_1.Liquid();
|
|
6
|
+
const getProfileApiEndpoint = (environment) => {
|
|
7
|
+
return `https://profiles.segment.${environment === 'production' ? 'com' : 'build'}`;
|
|
8
|
+
};
|
|
9
|
+
const fetchProfileTraits = async (request, settings, profileId) => {
|
|
10
|
+
const endpoint = getProfileApiEndpoint(settings.profileApiEnvironment);
|
|
11
|
+
const response = await request(`${endpoint}/v1/spaces/${settings.spaceId}/collections/users/profiles/user_id:${profileId}/traits?limit=200`, {
|
|
12
|
+
headers: {
|
|
13
|
+
authorization: `Basic ${Buffer.from(settings.profileApiAccessToken + ':').toString('base64')}`,
|
|
14
|
+
'content-type': 'application/json'
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
const body = await response.json();
|
|
18
|
+
return body.traits;
|
|
19
|
+
};
|
|
20
|
+
const EXTERNAL_ID_KEY = 'phone';
|
|
21
|
+
const DEFAULT_CONNECTION_OVERRIDES = 'rp=all&rc=5';
|
|
22
|
+
const action = {
|
|
23
|
+
title: 'Send SMS',
|
|
24
|
+
description: 'Send SMS using Twilio',
|
|
25
|
+
defaultSubscription: 'type = "track" and event = "Audience Entered"',
|
|
26
|
+
fields: {
|
|
27
|
+
userId: {
|
|
28
|
+
label: 'User ID',
|
|
29
|
+
description: 'User ID in Segment',
|
|
30
|
+
type: 'string',
|
|
31
|
+
required: true,
|
|
32
|
+
default: { '@path': '$.userId' }
|
|
33
|
+
},
|
|
34
|
+
toNumber: {
|
|
35
|
+
label: 'Test Number',
|
|
36
|
+
description: 'Number to send SMS to when testing',
|
|
37
|
+
type: 'string'
|
|
38
|
+
},
|
|
39
|
+
from: {
|
|
40
|
+
label: 'From',
|
|
41
|
+
description: 'The Twilio Phone Number, Short Code, or Messaging Service to send SMS from.',
|
|
42
|
+
type: 'string',
|
|
43
|
+
required: true
|
|
44
|
+
},
|
|
45
|
+
body: {
|
|
46
|
+
label: 'Message',
|
|
47
|
+
description: 'Message to send',
|
|
48
|
+
type: 'text',
|
|
49
|
+
required: true
|
|
50
|
+
},
|
|
51
|
+
customArgs: {
|
|
52
|
+
label: 'Custom Arguments',
|
|
53
|
+
description: 'Additional custom arguments that will be opaquely sent back on webhook events',
|
|
54
|
+
type: 'object',
|
|
55
|
+
required: false
|
|
56
|
+
},
|
|
57
|
+
connectionOverrides: {
|
|
58
|
+
label: 'Connection Overrides',
|
|
59
|
+
description: 'Connection overrides are configuration supported by twilio webhook services. Must be passed as fragments on the callback url',
|
|
60
|
+
type: 'string',
|
|
61
|
+
required: false
|
|
62
|
+
},
|
|
63
|
+
send: {
|
|
64
|
+
label: 'Send Message',
|
|
65
|
+
description: 'Whether or not the message should actually get sent.',
|
|
66
|
+
type: 'boolean',
|
|
67
|
+
required: false,
|
|
68
|
+
default: false
|
|
69
|
+
},
|
|
70
|
+
externalIds: {
|
|
71
|
+
label: 'External IDs',
|
|
72
|
+
description: 'An array of user profile identity information.',
|
|
73
|
+
type: 'object',
|
|
74
|
+
multiple: true,
|
|
75
|
+
properties: {
|
|
76
|
+
id: {
|
|
77
|
+
label: 'ID',
|
|
78
|
+
description: 'A unique identifier for the collection.',
|
|
79
|
+
type: 'string'
|
|
80
|
+
},
|
|
81
|
+
type: {
|
|
82
|
+
label: 'type',
|
|
83
|
+
description: 'The external ID contact type.',
|
|
84
|
+
type: 'string'
|
|
85
|
+
},
|
|
86
|
+
subscriptionStatus: {
|
|
87
|
+
label: 'ID',
|
|
88
|
+
description: 'The subscription status for the identity.',
|
|
89
|
+
type: 'string'
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
default: {
|
|
93
|
+
'@arrayPath': [
|
|
94
|
+
'$.external_ids',
|
|
95
|
+
{
|
|
96
|
+
id: {
|
|
97
|
+
'@path': '$.id'
|
|
98
|
+
},
|
|
99
|
+
type: {
|
|
100
|
+
'@path': '$.type'
|
|
101
|
+
},
|
|
102
|
+
subscriptionStatus: {
|
|
103
|
+
'@path': '$.isSubscribed'
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
]
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
perform: async (request, { settings, payload }) => {
|
|
111
|
+
if (!payload.send) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
const externalId = payload.externalIds?.find(({ type }) => type === 'phone');
|
|
115
|
+
if (!externalId?.subscriptionStatus ||
|
|
116
|
+
['unsubscribed', 'did not subscribed', 'false'].includes(externalId.subscriptionStatus)) {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
else if (['subscribed', 'true'].includes(externalId.subscriptionStatus)) {
|
|
120
|
+
const traits = await fetchProfileTraits(request, settings, payload.userId);
|
|
121
|
+
const phone = payload.toNumber || externalId.id;
|
|
122
|
+
if (!phone) {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
const profile = {
|
|
126
|
+
user_id: payload.userId,
|
|
127
|
+
phone,
|
|
128
|
+
traits
|
|
129
|
+
};
|
|
130
|
+
const token = Buffer.from(`${settings.twilioApiKeySID}:${settings.twilioApiKeySecret}`).toString('base64');
|
|
131
|
+
const parsedBody = await Liquid.parseAndRender(payload.body, { profile });
|
|
132
|
+
const body = new URLSearchParams({
|
|
133
|
+
Body: parsedBody,
|
|
134
|
+
From: payload.from,
|
|
135
|
+
To: phone
|
|
136
|
+
});
|
|
137
|
+
const webhookUrl = settings.webhookUrl;
|
|
138
|
+
const connectionOverrides = settings.connectionOverrides;
|
|
139
|
+
const customArgs = {
|
|
140
|
+
...payload.customArgs,
|
|
141
|
+
__segment_internal_external_id_key__: EXTERNAL_ID_KEY,
|
|
142
|
+
__segment_internal_external_id_value__: phone
|
|
143
|
+
};
|
|
144
|
+
if (webhookUrl && customArgs) {
|
|
145
|
+
const webhookUrlWithParams = new URL(webhookUrl);
|
|
146
|
+
for (const key of Object.keys(customArgs)) {
|
|
147
|
+
webhookUrlWithParams.searchParams.append(key, String(customArgs[key]));
|
|
148
|
+
}
|
|
149
|
+
webhookUrlWithParams.hash = connectionOverrides || DEFAULT_CONNECTION_OVERRIDES;
|
|
150
|
+
body.append('StatusCallback', webhookUrlWithParams.toString());
|
|
151
|
+
}
|
|
152
|
+
return request(`https://api.twilio.com/2010-04-01/Accounts/${settings.twilioAccountSID}/Messages.json`, {
|
|
153
|
+
method: 'POST',
|
|
154
|
+
headers: {
|
|
155
|
+
authorization: `Basic ${token}`
|
|
156
|
+
},
|
|
157
|
+
body
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
throw new actions_core_1.IntegrationError(`Failed to recognize the subscriptionStatus in the payload: "${externalId.subscriptionStatus}".`, 'Invalid subscriptionStatus value', 400);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
exports.default = action;
|
|
166
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/personas-messaging-twilio/sendSms/index.ts"],"names":[],"mappings":";;AAAA,uCAA6C;AAK7C,wDAAwD;AAExD,MAAM,MAAM,GAAG,IAAI,iBAAQ,EAAE,CAAA;AAE7B,MAAM,qBAAqB,GAAG,CAAC,WAAmB,EAAU,EAAE;IAC5D,OAAO,4BAA4B,WAAW,KAAK,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,CAAA;AACrF,CAAC,CAAA;AAID,MAAM,kBAAkB,GAAG,KAAK,EAC9B,OAAkB,EAClB,QAAkB,EAClB,SAAiB,EACgB,EAAE;IACnC,MAAM,QAAQ,GAAG,qBAAqB,CAAC,QAAQ,CAAC,qBAAqB,CAAC,CAAA;IACtE,MAAM,QAAQ,GAAG,MAAM,OAAO,CAC5B,GAAG,QAAQ,cAAc,QAAQ,CAAC,OAAO,uCAAuC,SAAS,mBAAmB,EAC5G;QACE,OAAO,EAAE;YACP,aAAa,EAAE,SAAS,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,qBAAqB,GAAG,GAAG,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;YAC9F,cAAc,EAAE,kBAAkB;SACnC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;gBAED,oBAAoB,CAAC,IAAI,GAAG,mBAAmB,IAAI,4BAA4B,CAAA;gBAE/E,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,oBAAoB,CAAC,QAAQ,EAAE,CAAC,CAAA;aAC/D;YAED,OAAO,OAAO,CAAC,8CAA8C,QAAQ,CAAC,gBAAgB,gBAAgB,EAAE;gBACtG,MAAM,EAAE,MAAM;gBACd,OAAO,EAAE;oBACP,aAAa,EAAE,SAAS,KAAK,EAAE;iBAChC;gBACD,IAAI;aACL,CAAC,CAAA;SACH;aAAM;YACL,MAAM,IAAI,+BAAgB,CACxB,+DAA+D,UAAU,CAAC,kBAAkB,IAAI,EAChG,kCAAkC,EAClC,GAAG,CACJ,CAAA;SACF;IACH,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -104,12 +104,24 @@ class Salesforce {
|
|
|
104
104
|
};
|
|
105
105
|
this.escapeQuotes = (value) => value.replace(/'/g, "\\'");
|
|
106
106
|
this.removeInvalidChars = (value) => value.replace(/[^a-zA-Z0-9_]/g, '');
|
|
107
|
+
this.typecast = (value) => {
|
|
108
|
+
switch (typeof value) {
|
|
109
|
+
case 'boolean':
|
|
110
|
+
return value;
|
|
111
|
+
case 'number':
|
|
112
|
+
return value;
|
|
113
|
+
case 'string':
|
|
114
|
+
return `'${this.escapeQuotes(value)}'`;
|
|
115
|
+
default:
|
|
116
|
+
throw new actions_core_1.IntegrationError('Unsupported datatype for record matcher traits - ' + typeof value, 'Unsupported Type', 400);
|
|
117
|
+
}
|
|
118
|
+
};
|
|
107
119
|
this.buildQuery = (traits, sobject) => {
|
|
108
120
|
let soql = `SELECT Id FROM ${sobject} WHERE `;
|
|
109
121
|
const entries = Object.entries(traits);
|
|
110
122
|
let i = 0;
|
|
111
123
|
for (const [key, value] of entries) {
|
|
112
|
-
let token = `${this.removeInvalidChars(key)} =
|
|
124
|
+
let token = `${this.removeInvalidChars(key)} = ${this.typecast(value)}`;
|
|
113
125
|
if (i < entries.length - 1) {
|
|
114
126
|
token += ' OR ';
|
|
115
127
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sf-operations.js","sourceRoot":"","sources":["../../../src/destinations/salesforce/sf-operations.ts"],"names":[],"mappings":";;;AAAA,wDAAuE;AAEvE,6DAAuD;AACvD,yCAAyC;AAE5B,QAAA,WAAW,GAAG,OAAO,CAAA;AAgBlC,MAAqB,UAAU;IAI7B,YAAY,WAAmB,EAAE,OAAsB;QAOvD,iBAAY,GAAG,KAAK,EAAE,OAAuB,EAAE,OAAe,EAAE,EAAE;YAChE,MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;YAEjD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,WAAW,iBAAiB,mBAAW,aAAa,OAAO,EAAE,EAAE;gBACzF,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,IAAI;aACX,CAAC,CAAA;QACJ,CAAC,CAAA;QAED,iBAAY,GAAG,KAAK,EAAE,OAAuB,EAAE,OAAe,EAAE,EAAE;YAChE,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC/D,MAAM,IAAI,+BAAgB,CAAC,8CAA8C,EAAE,kBAAkB,EAAE,GAAG,CAAC,CAAA;aACpG;YAED,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;gBACtE,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAW,EAAE,OAAO,EAAE,OAAO,CAAC,CAAA;aAC/E;YAED,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,GAAG,MAAM,IAAI,CAAC,Y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,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;CAwMF;AAjND,6BAiNC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@segment/action-destinations",
|
|
3
3
|
"description": "Destination Actions engine and definitions.",
|
|
4
|
-
"version": "3.74.1-alpha.
|
|
4
|
+
"version": "3.74.1-alpha.2",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/segmentio/action-destinations",
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"<rootDir>/test/setup-after-env.ts"
|
|
62
62
|
]
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "921ec37e4541f75ec788ffb75b536137b2734051"
|
|
65
65
|
}
|