@segment/action-destinations 3.94.1-alpha.1 → 3.97.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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/engage-messaging-sendgrid/sendEmail/generated-types.d.ts +0 -5
- package/dist/destinations/engage-messaging-sendgrid/sendEmail/index.js +1 -37
- package/dist/destinations/engage-messaging-sendgrid/sendEmail/index.js.map +1 -1
- package/dist/destinations/engage-messaging-twilio/sendSms/index.js +1 -1
- package/dist/destinations/engage-messaging-twilio/sendSms/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/ga4-functions.js +4 -4
- package/dist/destinations/google-analytics-4/ga4-functions.js.map +1 -1
- package/dist/destinations/google-enhanced-conversions/postConversion/index.js +3 -5
- package/dist/destinations/google-enhanced-conversions/postConversion/index.js.map +1 -1
- package/dist/destinations/index.js +1 -3
- package/dist/destinations/index.js.map +1 -1
- package/dist/destinations/intercom/groupIdentifyContact/generated-types.d.ts +2 -0
- package/dist/destinations/intercom/groupIdentifyContact/index.js +44 -36
- package/dist/destinations/intercom/groupIdentifyContact/index.js.map +1 -1
- package/dist/destinations/intercom/identifyContact/index.js +24 -54
- package/dist/destinations/intercom/identifyContact/index.js.map +1 -1
- package/dist/destinations/intercom/index.d.ts +1 -1
- package/dist/destinations/intercom/index.js +24 -8
- package/dist/destinations/intercom/index.js.map +1 -1
- package/dist/destinations/intercom/trackEvent/generated-types.d.ts +12 -0
- package/dist/destinations/{actions-pardot → intercom/trackEvent}/generated-types.js +0 -0
- package/dist/destinations/intercom/trackEvent/generated-types.js.map +1 -0
- package/dist/destinations/{actions-pardot/prospects → intercom/trackEvent}/index.d.ts +0 -0
- package/dist/destinations/intercom/trackEvent/index.js +111 -0
- package/dist/destinations/intercom/trackEvent/index.js.map +1 -0
- package/dist/destinations/intercom/util.d.ts +11 -0
- package/dist/destinations/intercom/util.js +48 -0
- package/dist/destinations/intercom/util.js.map +1 -0
- package/dist/destinations/mixpanel/alias/index.js +2 -1
- package/dist/destinations/mixpanel/alias/index.js.map +1 -1
- package/dist/destinations/mixpanel/generated-types.d.ts +1 -0
- package/dist/destinations/mixpanel/groupIdentifyUser/index.js +2 -1
- package/dist/destinations/mixpanel/groupIdentifyUser/index.js.map +1 -1
- package/dist/destinations/mixpanel/identifyUser/index.js +4 -2
- package/dist/destinations/mixpanel/identifyUser/index.js.map +1 -1
- package/dist/destinations/mixpanel/index.js +8 -0
- package/dist/destinations/mixpanel/index.js.map +1 -1
- package/dist/destinations/mixpanel/trackEvent/index.js +1 -1
- package/dist/destinations/mixpanel/trackEvent/index.js.map +1 -1
- package/dist/destinations/mixpanel/utils.d.ts +5 -0
- package/dist/destinations/mixpanel/utils.js +13 -1
- package/dist/destinations/mixpanel/utils.js.map +1 -1
- package/dist/destinations/salesforce/lead/index.js +1 -2
- package/dist/destinations/salesforce/lead/index.js.map +1 -1
- package/dist/lib/engage-test-data/create-messaging-test-event.d.ts +2 -0
- package/dist/lib/engage-test-data/create-messaging-test-event.js +48 -0
- package/dist/lib/engage-test-data/create-messaging-test-event.js.map +1 -0
- package/package.json +4 -4
- package/dist/destinations/actions-pardot/generated-types.d.ts +0 -5
- package/dist/destinations/actions-pardot/generated-types.js.map +0 -1
- package/dist/destinations/actions-pardot/index.d.ts +0 -4
- package/dist/destinations/actions-pardot/index.js +0 -62
- package/dist/destinations/actions-pardot/index.js.map +0 -1
- package/dist/destinations/actions-pardot/pa-operations.d.ts +0 -17
- package/dist/destinations/actions-pardot/pa-operations.js +0 -51
- package/dist/destinations/actions-pardot/pa-operations.js.map +0 -1
- package/dist/destinations/actions-pardot/pa-properties.d.ts +0 -2
- package/dist/destinations/actions-pardot/pa-properties.js +0 -13
- package/dist/destinations/actions-pardot/pa-properties.js.map +0 -1
- package/dist/destinations/actions-pardot/pa-type.d.ts +0 -15
- package/dist/destinations/actions-pardot/pa-type.js +0 -3
- package/dist/destinations/actions-pardot/pa-type.js.map +0 -1
- package/dist/destinations/actions-pardot/prospects/generated-types.d.ts +0 -19
- package/dist/destinations/actions-pardot/prospects/generated-types.js +0 -3
- package/dist/destinations/actions-pardot/prospects/generated-types.js.map +0 -1
- package/dist/destinations/actions-pardot/prospects/index.js +0 -204
- package/dist/destinations/actions-pardot/prospects/index.js.map +0 -1
- package/dist/destinations/salesforce-marketing-cloud/contact/generated-types.d.ts +0 -2
- package/dist/destinations/salesforce-marketing-cloud/contact/generated-types.js +0 -3
- package/dist/destinations/salesforce-marketing-cloud/contact/generated-types.js.map +0 -1
- package/dist/destinations/salesforce-marketing-cloud/contact/index.d.ts +0 -5
- package/dist/destinations/salesforce-marketing-cloud/contact/index.js +0 -11
- package/dist/destinations/salesforce-marketing-cloud/contact/index.js.map +0 -1
- package/dist/destinations/salesforce-marketing-cloud/generated-types.d.ts +0 -2
- package/dist/destinations/salesforce-marketing-cloud/generated-types.js +0 -3
- package/dist/destinations/salesforce-marketing-cloud/generated-types.js.map +0 -1
- package/dist/destinations/salesforce-marketing-cloud/index.d.ts +0 -4
- package/dist/destinations/salesforce-marketing-cloud/index.js +0 -27
- package/dist/destinations/salesforce-marketing-cloud/index.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/intercom/groupIdentifyContact/index.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/intercom/groupIdentifyContact/index.ts"],"names":[],"mappings":";;AAEA,kCAAkD;AAOlD,MAAM,MAAM,G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C,mCAAmC,EAAE;QAClD,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,OAAO;KACd,CAAC,CAAA;AACJ,CAAC;AAED,SAAS,8BAA8B,CAAC,OAAsB,EAAE,SAAiB,EAAE,SAAiB;IAClG,OAAO,OAAO,CAAC,oCAAoC,SAAS,YAAY,EAAE;QACxE,MAAM,EAAE,MAAM;QACd,IAAI,EAAE;YACJ,EAAE,EAAE,SAAS;SACd;KACF,CAAC,CAAA;AACJ,CAAC;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1,22 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const actions_core_1 = require("@segment/actions-core");
|
|
4
|
+
const util_1 = require("../util");
|
|
4
5
|
const action = {
|
|
5
6
|
title: 'Identify Contact',
|
|
6
|
-
description: 'Create or
|
|
7
|
+
description: 'Create or update a contact in Intercom',
|
|
7
8
|
defaultSubscription: 'type = "identify"',
|
|
8
|
-
platform: 'web',
|
|
9
9
|
fields: {
|
|
10
10
|
role: {
|
|
11
11
|
type: 'string',
|
|
12
12
|
required: true,
|
|
13
|
-
description: 'The role of the contact. Accepted values are `user` or `lead`.
|
|
13
|
+
description: 'The role of the contact. Accepted values are `user` or `lead`.',
|
|
14
14
|
label: 'Role',
|
|
15
|
-
|
|
15
|
+
choices: [
|
|
16
|
+
{ label: 'Lead', value: 'lead' },
|
|
17
|
+
{ label: 'User', value: 'user' }
|
|
18
|
+
]
|
|
16
19
|
},
|
|
17
20
|
external_id: {
|
|
18
21
|
type: 'string',
|
|
19
|
-
description: 'A unique identifier generated outside Intercom.
|
|
22
|
+
description: 'A unique identifier for the contact generated outside Intercom. External ID is required if the role is `user` and email is blank.',
|
|
20
23
|
label: 'External ID',
|
|
21
24
|
default: {
|
|
22
25
|
'@path': '$.userId'
|
|
@@ -24,8 +27,8 @@ const action = {
|
|
|
24
27
|
},
|
|
25
28
|
email: {
|
|
26
29
|
type: 'string',
|
|
27
|
-
description: "The contact's email.
|
|
28
|
-
label: 'Email',
|
|
30
|
+
description: "The contact's email address. Email is required if the role is `user` and External ID is blank.",
|
|
31
|
+
label: 'Email Address',
|
|
29
32
|
format: 'email',
|
|
30
33
|
default: {
|
|
31
34
|
'@path': '$.traits.email'
|
|
@@ -49,7 +52,7 @@ const action = {
|
|
|
49
52
|
},
|
|
50
53
|
avatar: {
|
|
51
54
|
label: 'Avatar',
|
|
52
|
-
description: 'URL
|
|
55
|
+
description: 'An image URL containing the avatar of a contact.',
|
|
53
56
|
type: 'string',
|
|
54
57
|
format: 'uri',
|
|
55
58
|
default: {
|
|
@@ -57,43 +60,40 @@ const action = {
|
|
|
57
60
|
}
|
|
58
61
|
},
|
|
59
62
|
signed_up_at: {
|
|
60
|
-
label: 'Signed Up
|
|
63
|
+
label: 'Signed Up Timestamp',
|
|
61
64
|
type: 'datetime',
|
|
62
|
-
description: 'The
|
|
63
|
-
default: {
|
|
64
|
-
'@path': '$.createdAt'
|
|
65
|
-
}
|
|
65
|
+
description: 'The time specified for when a contact signed up.'
|
|
66
66
|
},
|
|
67
67
|
last_seen_at: {
|
|
68
|
-
label: 'Timestamp',
|
|
68
|
+
label: 'Last Seen Timestamp',
|
|
69
69
|
type: 'datetime',
|
|
70
|
-
description: 'The
|
|
70
|
+
description: 'The time when the contact was last seen.',
|
|
71
71
|
default: {
|
|
72
72
|
'@path': '$.timestamp'
|
|
73
73
|
}
|
|
74
74
|
},
|
|
75
75
|
owner_id: {
|
|
76
|
-
label: 'Owner
|
|
76
|
+
label: 'Owner ID',
|
|
77
77
|
type: 'number',
|
|
78
|
-
description: 'The
|
|
78
|
+
description: 'The ID of an admin that has been assigned account ownership of the contact.'
|
|
79
79
|
},
|
|
80
80
|
unsubscribed_from_emails: {
|
|
81
81
|
label: 'Unsubscribed From Emails',
|
|
82
82
|
type: 'boolean',
|
|
83
|
-
description:
|
|
83
|
+
description: "The contact's email unsubscribe status."
|
|
84
84
|
},
|
|
85
85
|
custom_attributes: {
|
|
86
86
|
label: 'Custom Attributes',
|
|
87
|
-
description: 'The custom attributes which are set for the contact.
|
|
87
|
+
description: 'The custom attributes which are set for the contact. You can only write to custom attributes that already exist in your Intercom workspace. Please ensure custom attributes are created in Intercom first. See [Intercom documentation](https://developers.intercom.com/intercom-api-reference/reference/create-data-attributes) for more information on creating attributes.',
|
|
88
88
|
type: 'object',
|
|
89
|
-
|
|
90
|
-
'@path': '$.traits.customAttributes'
|
|
91
|
-
}
|
|
89
|
+
defaultObjectUI: 'keyvalue'
|
|
92
90
|
}
|
|
93
91
|
},
|
|
94
92
|
perform: async (request, { payload }) => {
|
|
93
|
+
payload.signed_up_at = util_1.convertValidTimestamp(payload.signed_up_at);
|
|
94
|
+
payload.last_seen_at = util_1.convertValidTimestamp(payload.last_seen_at);
|
|
95
95
|
try {
|
|
96
|
-
const contact = await
|
|
96
|
+
const contact = await util_1.getUniqueIntercomContact(request, payload);
|
|
97
97
|
if (contact) {
|
|
98
98
|
return updateIntercomContact(request, contact.id, payload);
|
|
99
99
|
}
|
|
@@ -113,40 +113,10 @@ async function createIntercomContact(request, payload) {
|
|
|
113
113
|
json: payload
|
|
114
114
|
});
|
|
115
115
|
}
|
|
116
|
-
async function searchIntercomContact(request, payload) {
|
|
117
|
-
const searchFields = {
|
|
118
|
-
email: payload.email,
|
|
119
|
-
external_id: payload.external_id,
|
|
120
|
-
role: payload.role
|
|
121
|
-
};
|
|
122
|
-
const value = [];
|
|
123
|
-
for (const [key, fieldValue] of Object.entries(searchFields)) {
|
|
124
|
-
if (fieldValue) {
|
|
125
|
-
value.push({
|
|
126
|
-
field: key,
|
|
127
|
-
operator: '=',
|
|
128
|
-
value: fieldValue
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
const query = {
|
|
133
|
-
operator: 'AND',
|
|
134
|
-
value
|
|
135
|
-
};
|
|
136
|
-
const response = await request('https://api.intercom.io/contacts/search', {
|
|
137
|
-
method: 'POST',
|
|
138
|
-
json: { query }
|
|
139
|
-
});
|
|
140
|
-
if (response.data.total_count === 1) {
|
|
141
|
-
return response.data.data[0];
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
116
|
async function updateIntercomContact(request, contactId, payload) {
|
|
145
117
|
return request(`https://api.intercom.io/contacts/${contactId}`, {
|
|
146
118
|
method: 'PUT',
|
|
147
|
-
json:
|
|
148
|
-
...payload
|
|
149
|
-
}
|
|
119
|
+
json: payload
|
|
150
120
|
});
|
|
151
121
|
}
|
|
152
122
|
exports.default = action;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/intercom/identifyContact/index.ts"],"names":[],"mappings":";;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/intercom/identifyContact/index.ts"],"names":[],"mappings":";;AAAA,wDAAuF;AAEvF,kCAAyE;AAGzE,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,kBAAkB;IACzB,WAAW,EAAE,wCAAwC;IACrD,mBAAmB,EAAE,mBAAmB;IACxC,MAAM,EAAE;QACN,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,gEAAgE;YAC7E,KAAK,EAAE,MAAM;YACb,OAAO,EAAE;gBACP,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;gBAChC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;aACjC;SACF;QACD,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,mIAAmI;YACrI,KAAK,EAAE,aAAa;YACpB,OAAO,EAAE;gBACP,OAAO,EAAE,UAAU;aACpB;SACF;QACD,KAAK,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,gGAAgG;YAC7G,KAAK,EAAE,eAAe;YACtB,MAAM,EAAE,OAAO;YACf,O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,CAAA;QAClE,OAAO,CAAC,YAAY,GAAG,4BAAqB,CAAC,OAAO,CAAC,YAAY,CAAC,CAAA;QAClE,IAAI;YACF,MAAM,OAAO,GAAG,MAAM,+BAAwB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;YAChE,IAAI,OAAO,EAAE;gBACX,OAAO,qBAAqB,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,EAAE,OAAO,CAAC,CAAA;aAC3D;YACD,OAAO,MAAM,qBAAqB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;SACrD;QAAC,OAAO,KAAK,EAAE;YACd,IAAI,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,GAAG,EAAE;gBAEnC,MAAM,IAAI,6BAAc,CACtB,wHAAwH,CACzH,CAAA;aACF;YACD,MAAM,KAAK,CAAA;SACZ;IACH,CAAC;CACF,CAAA;AAED,KAAK,UAAU,qBAAqB,CAAC,OAAsB,EAAE,OAAgB;IAC3E,OAAO,OAAO,CAAC,kCAAkC,EAAE;QACjD,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,OAAO;KACd,CAAC,CAAA;AACJ,CAAC;AAED,KAAK,UAAU,qBAAqB,CAAC,OAAsB,EAAE,SAAiB,EAAE,OAAgB;IAC9F,OAAO,OAAO,CAAC,oCAAoC,SAAS,EAAE,EAAE;QAC9D,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,OAAO;KACd,CAAC,CAAA;AACJ,CAAC;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { DestinationDefinition } from '@segment/actions-core';
|
|
2
2
|
import type { Settings } from './generated-types';
|
|
3
3
|
declare const destination: DestinationDefinition<Settings>;
|
|
4
4
|
export default destination;
|
|
@@ -3,17 +3,25 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
6
7
|
const identifyContact_1 = __importDefault(require("./identifyContact"));
|
|
7
8
|
const groupIdentifyContact_1 = __importDefault(require("./groupIdentifyContact"));
|
|
9
|
+
const trackEvent_1 = __importDefault(require("./trackEvent"));
|
|
10
|
+
const util_1 = require("./util");
|
|
8
11
|
const destination = {
|
|
9
|
-
name: 'Intercom (Actions)',
|
|
10
|
-
slug: 'actions-intercom',
|
|
12
|
+
name: 'Intercom Cloud Mode (Actions)',
|
|
13
|
+
slug: 'actions-intercom-cloud',
|
|
11
14
|
mode: 'cloud',
|
|
12
15
|
authentication: {
|
|
13
16
|
scheme: 'oauth2',
|
|
14
17
|
fields: {},
|
|
15
|
-
testAuthentication: (request) => {
|
|
16
|
-
|
|
18
|
+
testAuthentication: async (request) => {
|
|
19
|
+
try {
|
|
20
|
+
return await request('https://api.intercom.io/admins');
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
throw new Error('Test authentication failed');
|
|
24
|
+
}
|
|
17
25
|
}
|
|
18
26
|
},
|
|
19
27
|
extendRequest({ auth }) {
|
|
@@ -24,13 +32,21 @@ const destination = {
|
|
|
24
32
|
};
|
|
25
33
|
},
|
|
26
34
|
onDelete: async (request, { payload }) => {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
35
|
+
const external_id = payload.userId;
|
|
36
|
+
const contact = await util_1.getUniqueIntercomContact(request, { external_id });
|
|
37
|
+
if (contact) {
|
|
38
|
+
return request(`https://api.intercom.io/contacts/${payload.userId}`, {
|
|
39
|
+
method: 'DELETE'
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
throw new actions_core_1.IntegrationError('No unique contact found', 'Contact not found', 404);
|
|
44
|
+
}
|
|
30
45
|
},
|
|
31
46
|
actions: {
|
|
32
47
|
identifyContact: identifyContact_1.default,
|
|
33
|
-
groupIdentifyContact: groupIdentifyContact_1.default
|
|
48
|
+
groupIdentifyContact: groupIdentifyContact_1.default,
|
|
49
|
+
trackEvent: trackEvent_1.default
|
|
34
50
|
}
|
|
35
51
|
};
|
|
36
52
|
exports.default = destination;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/intercom/index.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/intercom/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAA+E;AAE/E,wEAA+C;AAC/C,kFAAyD;AACzD,8DAAqC;AACrC,iCAAiD;AAEjD,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,+BAA+B;IACrC,IAAI,EAAE,wBAAwB;IAC9B,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE,EAAE;QACV,kBAAkB,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;YAGpC,IAAI;gBACF,OAAO,MAAM,OAAO,CAAC,gCAAgC,CAAC,CAAA;aACvD;YAAC,OAAO,KAAK,EAAE;gBACd,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAA;aAC9C;QACH,CAAC;KACF;IACD,aAAa,CAAC,EAAE,IAAI,EAAE;QACpB,OAAO;YACL,OAAO,EAAE;gBACP,aAAa,EAAE,UAAU,IAAI,EAAE,WAAW,EAAE;aAC7C;SACF,CAAA;IACH,CAAC;IAMD,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QACvC,MAAM,WAAW,GAAG,OAAO,CAAC,MAAgB,CAAA;QAC5C,MAAM,OAAO,GAAG,MAAM,+BAAwB,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,CAAC,CAAA;QACxE,IAAI,OAAO,EAAE;YACX,OAAO,OAAO,CAAC,oCAAoC,OAAO,CAAC,MAAM,EAAE,EAAE;gBACnE,MAAM,EAAE,QAAQ;aACjB,CAAC,CAAA;SACH;aAAM;YACL,MAAM,IAAI,+BAAgB,CAAC,yBAAyB,EAAE,mBAAmB,EAAE,GAAG,CAAC,CAAA;SAChF;IACH,CAAC;IAED,OAAO,EAAE;QACP,eAAe,EAAf,yBAAe;QACf,oBAAoB,EAApB,8BAAoB;QACpB,UAAU,EAAV,oBAAU;KACX;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/intercom/trackEvent/generated-types.ts"],"names":[],"mappings":""}
|
|
File without changes
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
4
|
+
const util_1 = require("../util");
|
|
5
|
+
const action = {
|
|
6
|
+
title: 'Track Event',
|
|
7
|
+
description: 'Submit an event to Intercom.',
|
|
8
|
+
defaultSubscription: 'type = "track"',
|
|
9
|
+
fields: {
|
|
10
|
+
event_name: {
|
|
11
|
+
type: 'string',
|
|
12
|
+
required: true,
|
|
13
|
+
description: 'The name of the event that occurred. Names are treated as case insensitive. Periods and dollar signs in event names are replaced with hyphens.',
|
|
14
|
+
label: 'Event Name',
|
|
15
|
+
default: {
|
|
16
|
+
'@path': '$.event'
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
created_at: {
|
|
20
|
+
type: 'datetime',
|
|
21
|
+
required: true,
|
|
22
|
+
description: 'The time the event occurred as a UTC Unix timestamp. Segment will convert to Unix if not already converted.',
|
|
23
|
+
label: 'Event Timestamp',
|
|
24
|
+
default: {
|
|
25
|
+
'@path': '$.timestamp'
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
user_id: {
|
|
29
|
+
type: 'string',
|
|
30
|
+
description: 'Your identifier for the user who performed the event. User ID is required if no email or Contact ID is provided.',
|
|
31
|
+
label: 'User ID',
|
|
32
|
+
default: {
|
|
33
|
+
'@path': '$.userId'
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
email: {
|
|
37
|
+
type: 'string',
|
|
38
|
+
description: 'The email address for the user who performed the event. Email is required if no User ID or Contact ID is provided.',
|
|
39
|
+
label: 'Email Address',
|
|
40
|
+
format: 'email',
|
|
41
|
+
default: {
|
|
42
|
+
'@path': '$.properties.email'
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
revenue: {
|
|
46
|
+
label: 'Revenue',
|
|
47
|
+
type: 'number',
|
|
48
|
+
description: 'The amount associated with a purchase. Segment will multiply by 100 as Intercom requires the amount in cents.',
|
|
49
|
+
default: {
|
|
50
|
+
'@path': '$.properties.revenue'
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
currency: {
|
|
54
|
+
label: 'Currency',
|
|
55
|
+
type: 'string',
|
|
56
|
+
description: 'The currency of the purchase amount. Segment will default to USD if revenue is provided without a currency.',
|
|
57
|
+
default: {
|
|
58
|
+
'@path': '$.properties.currency'
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
id: {
|
|
62
|
+
label: 'Contact ID',
|
|
63
|
+
description: "Intercom's unique identifier for the contact. If no Contact ID is provided, Segment will use User ID or Email to find a user or lead.",
|
|
64
|
+
type: 'string'
|
|
65
|
+
},
|
|
66
|
+
metadata: {
|
|
67
|
+
type: 'object',
|
|
68
|
+
description: 'Optional metadata describing the event. Each event can contain up to ten metadata key-value pairs. If you send more than ten keys, Intercom will ignore the rest. Intercom does not support nested JSON structures within metadata.',
|
|
69
|
+
label: 'Event Metadata',
|
|
70
|
+
default: {
|
|
71
|
+
'@path': '$.properties'
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
perform: async (request, { payload }) => {
|
|
76
|
+
payload.created_at = util_1.convertValidTimestamp(payload.created_at);
|
|
77
|
+
delete payload.metadata?.email;
|
|
78
|
+
if (payload.email && !payload.user_id && !payload.id) {
|
|
79
|
+
const contact = await util_1.getUniqueIntercomContact(request, payload);
|
|
80
|
+
if (contact) {
|
|
81
|
+
payload.id = contact.id;
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
throw new actions_core_1.IntegrationError('No unique contact found', 'Contact not found', 404);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
possiblyPopulatePrice(payload);
|
|
88
|
+
return request('https://api.intercom.io/events', {
|
|
89
|
+
method: 'POST',
|
|
90
|
+
json: payload
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
function possiblyPopulatePrice(payload) {
|
|
95
|
+
const { revenue, currency } = payload;
|
|
96
|
+
delete payload.revenue;
|
|
97
|
+
delete payload.currency;
|
|
98
|
+
delete payload.metadata?.revenue;
|
|
99
|
+
delete payload.metadata?.currency;
|
|
100
|
+
if (revenue || revenue === 0) {
|
|
101
|
+
if (!payload.metadata) {
|
|
102
|
+
payload.metadata = {};
|
|
103
|
+
}
|
|
104
|
+
payload.metadata.price = {
|
|
105
|
+
amount: revenue * 100,
|
|
106
|
+
currency: currency || 'USD'
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
exports.default = action;
|
|
111
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/intercom/trackEvent/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAE1E,kCAAyE;AAGzE,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,8BAA8B;IAC3C,mBAAmB,EAAE,gBAAgB;IACrC,MAAM,EAAE;QACN,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EACT,gJAAgJ;YAClJ,KAAK,EAAE,YAAY;YACnB,OAAO,EAAE;gBACP,OAAO,EA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
+
interface SearchPayload {
|
|
6
|
+
external_id?: string;
|
|
7
|
+
email?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function getUniqueIntercomContact(request: RequestClient, payload: SearchPayload): Promise<IntercomContact | undefined>;
|
|
10
|
+
export declare const convertValidTimestamp: <Value = unknown>(value: Value) => number | Value;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
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.convertValidTimestamp = exports.getUniqueIntercomContact = void 0;
|
|
7
|
+
const dayjs_1 = __importDefault(require("../../lib/dayjs"));
|
|
8
|
+
async function getUniqueIntercomContact(request, payload) {
|
|
9
|
+
const { external_id, email } = payload;
|
|
10
|
+
let query;
|
|
11
|
+
if (external_id) {
|
|
12
|
+
query = {
|
|
13
|
+
field: 'external_id',
|
|
14
|
+
operator: '=',
|
|
15
|
+
value: external_id
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
else if (email) {
|
|
19
|
+
query = {
|
|
20
|
+
field: 'email',
|
|
21
|
+
operator: '=',
|
|
22
|
+
value: email
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
const response = await request('https://api.intercom.io/contacts/search', {
|
|
29
|
+
method: 'POST',
|
|
30
|
+
json: { query }
|
|
31
|
+
});
|
|
32
|
+
if (response?.data?.total_count === 1) {
|
|
33
|
+
return response.data.data[0];
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.getUniqueIntercomContact = getUniqueIntercomContact;
|
|
37
|
+
const convertValidTimestamp = (value) => {
|
|
38
|
+
if (typeof value !== 'string' || /^\d+$/.test(value)) {
|
|
39
|
+
return value;
|
|
40
|
+
}
|
|
41
|
+
const maybeDate = dayjs_1.default.utc(value);
|
|
42
|
+
if (maybeDate.isValid()) {
|
|
43
|
+
return maybeDate.unix();
|
|
44
|
+
}
|
|
45
|
+
return value;
|
|
46
|
+
};
|
|
47
|
+
exports.convertValidTimestamp = convertValidTimestamp;
|
|
48
|
+
//# sourceMappingURL=util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../../src/destinations/intercom/util.ts"],"names":[],"mappings":";;;;;;AACA,4DAAmC;AAqB5B,KAAK,UAAU,wBAAwB,CAAC,OAAsB,EAAE,OAAsB;IAC3F,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,OAAO,CAAA;IACtC,IAAI,KAAK,CAAA;IACT,IAAI,WAAW,EAAE;QACf,KAAK,GAAG;YACN,KAAK,EAAE,aAAa;YACpB,QAAQ,EAAE,GAAG;YACb,KAAK,EAAE,WAAW;SACnB,CAAA;KACF;SAAM,IAAI,KAAK,EAAE;QAChB,KAAK,GAAG;YACN,KAAK,EAAE,OAAO;YACd,QAAQ,EAAE,GAAG;YACb,KAAK,EAAE,KAAK;SACb,CAAA;KACF;SAAM;QACL,OAAM;KACP;IAED,MAAM,QAAQ,GAAyC,MAAM,OAAO,CAAC,yCAAyC,EAAE;QAC9G,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,EAAE,KAAK,EAAE;KAChB,CAAC,CAAA;IAEF,IAAI,QAAQ,EAAE,IAAI,EAAE,WAAW,KAAK,CAAC,EAAE;QACrC,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;KAC7B;AACH,CAAC;AA3BD,4DA2BC;AAEM,MAAM,qBAAqB,GAAG,CAAkB,KAAY,EAAkB,EAAE;IAKrF,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;QACpD,OAAO,KAAK,CAAA;KACb;IAED,MAAM,SAAS,GAAG,eAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;IAElC,IAAI,SAAS,CAAC,OAAO,EAAE,EAAE;QACvB,OAAO,SAAS,CAAC,IAAI,EAAE,CAAA;KACxB;IAED,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AAhBY,QAAA,qBAAqB,yBAgBjC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const utils_1 = require("../utils");
|
|
3
4
|
const action = {
|
|
4
5
|
title: 'Alias',
|
|
5
6
|
description: 'Create an alias to a distinct id. This action is primarily supported for the sake of customers using the legacy identity management in their Mixpanel project. For new customers or those who have [migrated](https://help.mixpanel.com/hc/en-us/articles/360039133851-Moving-to-Identity-Merge?source=segment-actions) to the [new identity management](https://help.mixpanel.com/hc/en-us/articles/360041039771-Getting-Started-with-Identity-Management?source=segment-actions) in Mixpanel should use `identify`.',
|
|
@@ -35,7 +36,7 @@ const action = {
|
|
|
35
36
|
token: settings.projectToken
|
|
36
37
|
}
|
|
37
38
|
};
|
|
38
|
-
return request(
|
|
39
|
+
return request(`${utils_1.getApiServerUrl(settings.apiRegion)}/track`, {
|
|
39
40
|
method: 'post',
|
|
40
41
|
body: new URLSearchParams({ data: JSON.stringify(data) })
|
|
41
42
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/mixpanel/alias/index.ts"],"names":[],"mappings":";;AAIA,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,OAAO;IACd,WAAW,EACT,ufAAuf;IACzf,MAAM,EAAE;QACN,KAAK,EAAE;YACL,KAAK,EAAE,OAAO;YACd,IAAI,EAAE,QAAQ;YACd,SAAS,EAAE,IAAI;YACf,WAAW,EACT,2GAA2G;YAC7G,OAAO,EAAE;gBACP,KAAK,EAAE;oBACL,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;oBAC/B,IAAI,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;oBAC7B,IAAI,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE;iBACnC;aACF;SACF;QACD,WAAW,EAAE;YACX,KAAK,EAAE,aAAa;YACpB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,4CAA4C;YACzD,OAAO,EAAE;gBACP,OAAO,EAAE,cAAc;aACxB;SACF;KACF;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;QAChD,MAAM,IAAI,GAAG;YACX,KAAK,EAAE,eAAe;YACtB,UAAU,EAAE;gBACV,WAAW,EAAE,OAAO,CAAC,WAAW;gBAChC,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,KAAK,EAAE,QAAQ,CAAC,YAAY;aAC7B;SACF,CAAA;QAED,OAAO,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/mixpanel/alias/index.ts"],"names":[],"mappings":";;AAIA,oCAA0C;AAE1C,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,OAAO;IACd,WAAW,EACT,ufAAuf;IACzf,MAAM,EAAE;QACN,KAAK,EAAE;YACL,KAAK,EAAE,OAAO;YACd,IAAI,EAAE,QAAQ;YACd,SAAS,EAAE,IAAI;YACf,WAAW,EACT,2GAA2G;YAC7G,OAAO,EAAE;gBACP,KAAK,EAAE;oBACL,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;oBAC/B,IAAI,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;oBAC7B,IAAI,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE;iBACnC;aACF;SACF;QACD,WAAW,EAAE;YACX,KAAK,EAAE,aAAa;YACpB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,4CAA4C;YACzD,OAAO,EAAE;gBACP,OAAO,EAAE,cAAc;aACxB;SACF;KACF;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;QAChD,MAAM,IAAI,GAAG;YACX,KAAK,EAAE,eAAe;YACtB,UAAU,EAAE;gBACV,WAAW,EAAE,OAAO,CAAC,WAAW;gBAChC,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,KAAK,EAAE,QAAQ,CAAC,YAAY;aAC7B;SACF,CAAA;QAED,OAAO,OAAO,CAAC,GAAG,uBAAe,CAAC,QAAQ,CAAC,SAAS,CAAC,QAAQ,EAAE;YAC7D,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,IAAI,eAAe,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;SAC1D,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const actions_core_1 = require("@segment/actions-core");
|
|
4
|
+
const utils_1 = require("../utils");
|
|
4
5
|
const action = {
|
|
5
6
|
title: 'Group Identify User',
|
|
6
7
|
description: 'Updates or adds properties to a group profile. The profile is created if it does not exist. [Learn more about Group Analytics.](https://help.mixpanel.com/hc/en-us/articles/360025333632-Group-Analytics?source=segment-actions)',
|
|
@@ -41,7 +42,7 @@ const action = {
|
|
|
41
42
|
$group_id: group_id,
|
|
42
43
|
$set: payload.traits
|
|
43
44
|
};
|
|
44
|
-
return request(
|
|
45
|
+
return request(`${utils_1.getApiServerUrl(settings.apiRegion)}/groups`, {
|
|
45
46
|
method: 'post',
|
|
46
47
|
body: new URLSearchParams({ data: JSON.stringify(data) })
|
|
47
48
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/mixpanel/groupIdentifyUser/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/mixpanel/groupIdentifyUser/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAE1E,oCAA0C;AAG1C,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,qBAAqB;IAC5B,WAAW,EACT,kOAAkO;IACpO,mBAAmB,EAAE,gBAAgB;IACrC,MAAM,EAAE;QACN,SAAS,EAAE;YACT,KAAK,EAAE,WAAW;YAClB,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,gIAAgI;SACnI;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,UAAU;YACjB,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,kHAAkH;YACpH,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,WAAW;aACrB;SACF;QACD,MAAM,EAAE;YACN,KAAK,EAAE,kBAAkB;YACzB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,6CAA6C;YAC1D,OAAO,EAAE;gBACP,OAAO,EAAE,UAAU;aACpB;SACF;KACF;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC1C,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,WAAW,CAAA;QAClD,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;YACnB,MAAM,IAAI,+BAAgB,CAAC,8BAA8B,EAAE,yBAAyB,EAAE,GAAG,CAAC,CAAA;SAC3F;QAMD,MAAM,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAA;QAE9D,MAAM,IAAI,GAAG;YACX,MAAM,EAAE,QAAQ,CAAC,YAAY;YAC7B,UAAU,EAAE,SAAS;YACrB,SAAS,EAAE,QAAQ;YACnB,IAAI,EAAE,OAAO,CAAC,MAAM;SACrB,CAAA;QAED,OAAO,OAAO,CAAC,GAAG,uBAAe,CAAC,QAAQ,CAAC,SAAS,CAAC,SAAS,EAAE;YAC9D,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,IAAI,eAAe,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;SAC1D,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const actions_core_1 = require("@segment/actions-core");
|
|
4
|
+
const utils_1 = require("../utils");
|
|
4
5
|
const action = {
|
|
5
6
|
title: 'Identify User',
|
|
6
7
|
description: 'Set the user ID for a particular device ID or update user properties. Learn more about [User Profiles](https://help.mixpanel.com/hc/en-us/articles/115004501966?source=segment-actions) and [Identity Management](https://help.mixpanel.com/hc/en-us/articles/360041039771-Getting-Started-with-Identity-Management?source=segment-actions).',
|
|
@@ -37,6 +38,7 @@ const action = {
|
|
|
37
38
|
if (!settings.projectToken) {
|
|
38
39
|
throw new actions_core_1.IntegrationError('Missing project token', 'Missing required field', 400);
|
|
39
40
|
}
|
|
41
|
+
const apiServerUrl = utils_1.getApiServerUrl(settings.apiRegion);
|
|
40
42
|
const responses = [];
|
|
41
43
|
if (payload.anonymous_id) {
|
|
42
44
|
const identifyEvent = {
|
|
@@ -47,7 +49,7 @@ const action = {
|
|
|
47
49
|
token: settings.projectToken
|
|
48
50
|
}
|
|
49
51
|
};
|
|
50
|
-
const identifyResponse = await request(
|
|
52
|
+
const identifyResponse = await request(`${apiServerUrl}/track`, {
|
|
51
53
|
method: 'post',
|
|
52
54
|
body: new URLSearchParams({ data: JSON.stringify(identifyEvent) })
|
|
53
55
|
});
|
|
@@ -59,7 +61,7 @@ const action = {
|
|
|
59
61
|
$distinct_id: payload.user_id,
|
|
60
62
|
$set: payload.traits
|
|
61
63
|
};
|
|
62
|
-
const engageResponse = request(
|
|
64
|
+
const engageResponse = request(`${apiServerUrl}/engage`, {
|
|
63
65
|
method: 'post',
|
|
64
66
|
body: new URLSearchParams({ data: JSON.stringify(data) })
|
|
65
67
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/mixpanel/identifyUser/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAI1E,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,eAAe;IACtB,WAAW,EACT,8UAA8U;IAChV,mBAAmB,EAAE,mBAAmB;IACxC,MAAM,EAAE;QACN,OAAO,EAAE;YACP,KAAK,EAAE,SAAS;YAChB,IAAI,EAAE,QAAQ;YACd,SAAS,EAAE,IAAI;YACf,WAAW,EAAE,uCAAuC;YACpD,OAAO,EAAE;gBACP,OAAO,EAAE,UAAU;aACpB;SACF;QACD,YAAY,EAAE;YACZ,KAAK,EAAE,cAAc;YACrB,IAAI,EAAE,QAAQ;YACd,SAAS,EAAE,IAAI;YACf,WAAW,EAAE,yCAAyC;YACtD,OAAO,EAAE;gBACP,OAAO,EAAE,eAAe;aACzB;SACF;QACD,MAAM,EAAE;YACN,KAAK,EAAE,iBAAiB;YACxB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,uCAAuC;YACpD,OAAO,EAAE;gBACP,OAAO,EAAE,UAAU;aACpB;SACF;KACF;IAED,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;QAChD,IAAI,CAAC,QAAQ,CAAC,YAAY,EAAE;YAC1B,MAAM,IAAI,+BAAgB,CAAC,uBAAuB,EAAE,wBAAwB,EAAE,GAAG,CAAC,CAAA;SACnF;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/mixpanel/identifyUser/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAI1E,oCAA0C;AAE1C,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE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,IAAI,eAAe,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,EAAE,CAAC;aACnE,CAAC,CAAA;YACF,SAAS,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA;SACjC;QAED,IAAI,OAAO,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;YAC5D,MAAM,IAAI,GAAG;gBACX,MAAM,EAAE,QAAQ,CAAC,YAAY;gBAC7B,YAAY,EAAE,OAAO,CAAC,OAAO;gBAC7B,IAAI,EAAE,OAAO,CAAC,MAAM;aACrB,CAAA;YAED,MAAM,cAAc,GAAG,OAAO,CAAC,GAAG,YAAY,SAAS,EAAE;gBACvD,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,IAAI,eAAe,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;aAC1D,CAAC,CAAA;YACF,SAAS,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA;SAC/B;QACD,OAAO,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;IAC/B,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -8,6 +8,7 @@ const trackEvent_1 = __importDefault(require("./trackEvent"));
|
|
|
8
8
|
const identifyUser_1 = __importDefault(require("./identifyUser"));
|
|
9
9
|
const groupIdentifyUser_1 = __importDefault(require("./groupIdentifyUser"));
|
|
10
10
|
const alias_1 = __importDefault(require("./alias"));
|
|
11
|
+
const utils_1 = require("./utils");
|
|
11
12
|
const presets = [
|
|
12
13
|
{
|
|
13
14
|
name: 'Track Calls',
|
|
@@ -68,6 +69,13 @@ const destination = {
|
|
|
68
69
|
description: 'Mixpanel project secret.',
|
|
69
70
|
type: 'string',
|
|
70
71
|
required: true
|
|
72
|
+
},
|
|
73
|
+
apiRegion: {
|
|
74
|
+
label: 'Data Residency',
|
|
75
|
+
description: 'Learn about [EU data residency](https://help.mixpanel.com/hc/en-us/articles/360039135652-Data-Residency-in-EU)',
|
|
76
|
+
type: 'string',
|
|
77
|
+
choices: Object.values(utils_1.ApiRegions).map((apiRegion) => ({ label: apiRegion, value: apiRegion })),
|
|
78
|
+
default: utils_1.ApiRegions.US
|
|
71
79
|
}
|
|
72
80
|
},
|
|
73
81
|
testAuthentication: (request, { settings }) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/mixpanel/index.ts"],"names":[],"mappings":";;;;;AACA,wDAAqD;AACrD,8DAAqC;AAGrC,kEAAyC;AACzC,4EAAmD;AAEnD,oDAA2B;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/mixpanel/index.ts"],"names":[],"mappings":";;;;;AACA,wDAAqD;AACrD,8DAAqC;AAGrC,kEAAyC;AACzC,4EAAmD;AAEnD,oDAA2B;AAC3B,mCAAoC;AAGpC,MAAM,OAAO,GAAqC;IAChD;QACE,IAAI,EAAE,aAAa;QACnB,SAAS,EAAE,gBAAgB;QAC3B,aAAa,EAAE,YAAY;QAC3B,OAAO,EAAE,4BAAa,CAAC,oBAAU,CAAC,MAAM,CAAC;KAC1C;IACD;QACE,IAAI,EAAE,YAAY;QAClB,SAAS,EAAE,eAAe;QAC1B,aAAa,EAAE,YAAY;QAC3B,OAAO,EAAE;YACP,GAAG,4BAAa,CAAC,oBAAU,CAAC,MAAM,CAAC;YACnC,KAAK,EAAE;gBACL,WAAW,EAAE,iBAAiB;aAC/B;SACF;KACF;IACD;QACE,IAAI,EAAE,cAAc;QACpB,SAAS,EAAE,iBAAiB;QAC5B,aAAa,EAAE,YAAY;QAC3B,OAAO,EAAE;YACP,GAAG,4BAAa,CAAC,oBAAU,CAAC,MAAM,CAAC;YACnC,KAAK,EAAE;gBACL,WAAW,EAAE,iBAAiB;aAC/B;SACF;KACF;IACD;QACE,IAAI,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SAAS;oBAC9B,aAAa,EAAE,QAAQ,CAAC,YAAY;iBACrC,CAAC;aACH,CAAC,CAAA;QACJ,CAAC;KACF;IACD,OAAO;IACP,OAAO,EAAE;QACP,UAAU,EAAV,oBAAU;QACV,YAAY,EAAZ,sBAAY;QACZ,iBAAiB,EAAjB,2BAAiB;QACjB,KAAK,EAAL,eAAK;KACN;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -385,7 +385,7 @@ const action = {
|
|
|
385
385
|
if (!settings.apiSecret) {
|
|
386
386
|
throw new actions_core_1.InvalidAuthenticationError('Missing api secret');
|
|
387
387
|
}
|
|
388
|
-
return request(
|
|
388
|
+
return request(`${utils_1.getApiServerUrl(settings.apiRegion)}/import?strict=1`, {
|
|
389
389
|
method: 'post',
|
|
390
390
|
json: [event],
|
|
391
391
|
headers: {
|