@segment/action-destinations 3.89.1-alpha.4 → 3.89.1-alpha.6
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/cordial/addProductToCart/index.js +1 -1
- package/dist/destinations/cordial/addProductToCart/index.js.map +1 -1
- package/dist/destinations/cordial/index.js +1 -1
- package/dist/destinations/cordial/index.js.map +1 -1
- package/dist/destinations/cordial/removeProductFromCart/index.js.map +1 -1
- package/dist/destinations/cordial/upsertOrder/index.js +8 -8
- package/dist/destinations/cordial/upsertOrder/index.js.map +1 -1
- package/dist/destinations/customerio/trackEvent/index.js.map +1 -1
- package/dist/destinations/google-enhanced-conversions/postConversion/index.js +3 -2
- package/dist/destinations/google-enhanced-conversions/postConversion/index.js.map +1 -1
- package/dist/destinations/index.js +2 -0
- package/dist/destinations/index.js.map +1 -1
- package/dist/destinations/intercom/generated-types.d.ts +2 -0
- package/dist/destinations/intercom/generated-types.js +3 -0
- package/dist/destinations/intercom/generated-types.js.map +1 -0
- package/dist/destinations/intercom/groupIdentifyContact/generated-types.d.ts +14 -0
- package/dist/destinations/intercom/groupIdentifyContact/generated-types.js +3 -0
- package/dist/destinations/intercom/groupIdentifyContact/generated-types.js.map +1 -0
- package/dist/destinations/intercom/groupIdentifyContact/index.d.ts +5 -0
- package/dist/destinations/intercom/groupIdentifyContact/index.js +122 -0
- package/dist/destinations/intercom/groupIdentifyContact/index.js.map +1 -0
- package/dist/destinations/intercom/identifyContact/generated-types.d.ts +15 -0
- package/dist/destinations/intercom/identifyContact/generated-types.js +3 -0
- package/dist/destinations/intercom/identifyContact/generated-types.js.map +1 -0
- package/dist/destinations/intercom/identifyContact/index.d.ts +5 -0
- package/dist/destinations/intercom/identifyContact/index.js +153 -0
- package/dist/destinations/intercom/identifyContact/index.js.map +1 -0
- package/dist/destinations/intercom/index.d.ts +4 -0
- package/dist/destinations/intercom/index.js +37 -0
- package/dist/destinations/intercom/index.js.map +1 -0
- package/dist/destinations/pardot/generated-types.d.ts +5 -0
- package/dist/destinations/pardot/generated-types.js +3 -0
- package/dist/destinations/pardot/generated-types.js.map +1 -0
- package/dist/destinations/pardot/index.d.ts +4 -0
- package/dist/destinations/pardot/index.js +62 -0
- package/dist/destinations/pardot/index.js.map +1 -0
- package/dist/destinations/pardot/pa-operations.d.ts +17 -0
- package/dist/destinations/pardot/pa-operations.js +51 -0
- package/dist/destinations/pardot/pa-operations.js.map +1 -0
- package/dist/destinations/pardot/pa-properties.d.ts +2 -0
- package/dist/destinations/pardot/pa-properties.js +13 -0
- package/dist/destinations/pardot/pa-properties.js.map +1 -0
- package/dist/destinations/pardot/pa-type.d.ts +15 -0
- package/dist/destinations/pardot/pa-type.js +3 -0
- package/dist/destinations/pardot/pa-type.js.map +1 -0
- package/dist/destinations/pardot/prospects/generated-types.d.ts +19 -0
- package/dist/destinations/pardot/prospects/generated-types.js +3 -0
- package/dist/destinations/pardot/prospects/generated-types.js.map +1 -0
- package/dist/destinations/pardot/prospects/index.d.ts +5 -0
- package/dist/destinations/pardot/prospects/index.js +204 -0
- package/dist/destinations/pardot/prospects/index.js.map +1 -0
- package/dist/destinations/personas-messaging-sendgrid/sendEmail/index.js +18 -4
- package/dist/destinations/personas-messaging-sendgrid/sendEmail/index.js.map +1 -1
- package/dist/destinations/personas-messaging-twilio/sendSms/index.js +17 -4
- package/dist/destinations/personas-messaging-twilio/sendSms/index.js.map +1 -1
- package/package.json +4 -4
|
@@ -6,7 +6,7 @@ const Liquid = new liquidjs_1.Liquid();
|
|
|
6
6
|
const getProfileApiEndpoint = (environment) => {
|
|
7
7
|
return `https://profiles.segment.${environment === 'production' ? 'com' : 'build'}`;
|
|
8
8
|
};
|
|
9
|
-
const fetchProfileTraits = async (request, settings, profileId) => {
|
|
9
|
+
const fetchProfileTraits = async (request, settings, profileId, statsClient, tags) => {
|
|
10
10
|
try {
|
|
11
11
|
const endpoint = getProfileApiEndpoint(settings.profileApiEnvironment);
|
|
12
12
|
const response = await request(`${endpoint}/v1/spaces/${settings.spaceId}/collections/users/profiles/user_id:${profileId}/traits?limit=200`, {
|
|
@@ -15,10 +15,13 @@ const fetchProfileTraits = async (request, settings, profileId) => {
|
|
|
15
15
|
'content-type': 'application/json'
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
+
tags?.push(`profile-status-${response.status}`);
|
|
19
|
+
statsClient?.incr('actions-personas-messaging-twilio.profile_invoked', 1, tags);
|
|
18
20
|
const body = await response.json();
|
|
19
21
|
return body.traits;
|
|
20
22
|
}
|
|
21
23
|
catch (error) {
|
|
24
|
+
statsClient?.incr('actions-personas-messaging-twilio.profile_error', 1, tags);
|
|
22
25
|
throw new actions_core_1.IntegrationError('Unable to get profile traits for SMS message', 'SMS trait fetch failure', 500);
|
|
23
26
|
}
|
|
24
27
|
};
|
|
@@ -113,17 +116,23 @@ const action = {
|
|
|
113
116
|
}
|
|
114
117
|
}
|
|
115
118
|
},
|
|
116
|
-
perform: async (request, { settings, payload }) => {
|
|
119
|
+
perform: async (request, { settings, payload, statsContext }) => {
|
|
120
|
+
const statsClient = statsContext?.statsClient;
|
|
121
|
+
const tags = statsContext?.tags;
|
|
122
|
+
tags?.push(settings.spaceId);
|
|
117
123
|
if (!payload.send) {
|
|
124
|
+
statsClient?.incr('actions-personas-messaging-twilio.send-disabled', 1, tags);
|
|
118
125
|
return;
|
|
119
126
|
}
|
|
120
127
|
const externalId = payload.externalIds?.find(({ type }) => type === 'phone');
|
|
121
128
|
if (!externalId?.subscriptionStatus ||
|
|
122
129
|
['unsubscribed', 'did not subscribed', 'false'].includes(externalId.subscriptionStatus)) {
|
|
130
|
+
statsClient?.incr('actions-personas-messaging-twilio.notsubscribed', 1, tags);
|
|
123
131
|
return;
|
|
124
132
|
}
|
|
125
133
|
else if (['subscribed', 'true'].includes(externalId.subscriptionStatus)) {
|
|
126
|
-
|
|
134
|
+
statsClient?.incr('actions-personas-messaging-twilio.subscribed', 1, tags);
|
|
135
|
+
const traits = await fetchProfileTraits(request, settings, payload.userId, statsClient, tags);
|
|
127
136
|
const phone = payload.toNumber || externalId.id;
|
|
128
137
|
if (!phone) {
|
|
129
138
|
return;
|
|
@@ -162,15 +171,19 @@ const action = {
|
|
|
162
171
|
body.append('StatusCallback', webhookUrlWithParams.toString());
|
|
163
172
|
}
|
|
164
173
|
const hostname = settings.twilioHostname ?? DEFAULT_HOSTNAME;
|
|
165
|
-
|
|
174
|
+
const response = await request(`https://${hostname}/2010-04-01/Accounts/${settings.twilioAccountSID}/Messages.json`, {
|
|
166
175
|
method: 'POST',
|
|
167
176
|
headers: {
|
|
168
177
|
authorization: `Basic ${token}`
|
|
169
178
|
},
|
|
170
179
|
body
|
|
171
180
|
});
|
|
181
|
+
tags?.push(`code-${response.status}`);
|
|
182
|
+
statsClient?.incr('actions-personas-messaging-twilio.response', 1, tags);
|
|
183
|
+
return response;
|
|
172
184
|
}
|
|
173
185
|
else {
|
|
186
|
+
statsClient?.incr('actions-personas-messaging-twilio.twilio-error', 1, tags);
|
|
174
187
|
throw new actions_core_1.IntegrationError(`Failed to recognize the subscriptionStatus in the payload: "${externalId.subscriptionStatus}".`, 'Invalid subscriptionStatus value', 400);
|
|
175
188
|
}
|
|
176
189
|
}
|
|
@@ -1 +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,
|
|
1
|
+
{"version":3,"file":"index.js","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AAM,IAAI,+BAAgB,CACxB,+DAA+D,UAAU,CAAC,kBAAkB,IAAI,EAChG,kCAAkC,EAClC,GAAG,CACJ,CAAA;SACF;IACH,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
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.89.1-alpha.
|
|
4
|
+
"version": "3.89.1-alpha.6",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/segmentio/action-destinations",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@amplitude/ua-parser-js": "^0.7.25",
|
|
40
40
|
"@segment/a1-notation": "^2.1.4",
|
|
41
|
-
"@segment/actions-core": "^3.31.
|
|
42
|
-
"@segment/actions-shared": "^1.14.
|
|
41
|
+
"@segment/actions-core": "^3.31.1-alpha.3",
|
|
42
|
+
"@segment/actions-shared": "^1.14.1-alpha.10",
|
|
43
43
|
"cheerio": "^1.0.0-rc.10",
|
|
44
44
|
"dayjs": "^1.10.7",
|
|
45
45
|
"escape-goat": "^3",
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"lcov"
|
|
66
66
|
]
|
|
67
67
|
},
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "85702d46e3f9f2d6c7010ee3c1b2030aa0bb87d3"
|
|
69
69
|
}
|