@segment/action-destinations 3.335.2-staging.1 → 3.335.3-staging-3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/destinations/braze/updateUserProfile/__snapshots__/__snapshots__/snapshot.test.js.snap +208 -0
- package/dist/destinations/kevel/generated-types.d.ts +4 -0
- package/dist/destinations/kevel/generated-types.js +3 -0
- package/dist/destinations/kevel/generated-types.js.map +1 -0
- package/dist/destinations/kevel/index.d.ts +4 -0
- package/dist/destinations/kevel/index.js +45 -0
- package/dist/destinations/kevel/index.js.map +1 -0
- package/dist/destinations/kevel/syncAudience/generated-types.d.ts +8 -0
- package/dist/destinations/kevel/syncAudience/generated-types.js +3 -0
- package/dist/destinations/kevel/syncAudience/generated-types.js.map +1 -0
- package/dist/destinations/kevel/syncAudience/index.d.ts +5 -0
- package/dist/destinations/kevel/syncAudience/index.js +64 -0
- package/dist/destinations/kevel/syncAudience/index.js.map +1 -0
- package/dist/destinations/kevel/syncTraits/generated-types.d.ts +6 -0
- package/dist/destinations/kevel/syncTraits/generated-types.js +3 -0
- package/dist/destinations/kevel/syncTraits/generated-types.js.map +1 -0
- package/dist/destinations/kevel/syncTraits/index.d.ts +5 -0
- package/dist/destinations/kevel/syncTraits/index.js +38 -0
- package/dist/destinations/kevel/syncTraits/index.js.map +1 -0
- package/dist/destinations/klaviyo/removeProfileToList/index.js +2 -4
- package/dist/destinations/klaviyo/removeProfileToList/index.js.map +1 -1
- package/dist/destinations/koala/track/index.js +1 -1
- package/dist/destinations/koala/track/index.js.map +1 -1
- package/dist/destinations/trackey/identifyUser/generated-types.d.ts +8 -0
- package/dist/destinations/trackey/identifyUser/generated-types.js +3 -0
- package/dist/destinations/trackey/identifyUser/generated-types.js.map +1 -0
- package/dist/destinations/trackey/identifyUser/index.d.ts +5 -0
- package/dist/destinations/trackey/identifyUser/index.js +52 -0
- package/dist/destinations/trackey/identifyUser/index.js.map +1 -0
- package/dist/destinations/trackey/identifyUser.types.d.ts +8 -0
- package/dist/destinations/trackey/identifyUser.types.js +3 -0
- package/dist/destinations/trackey/identifyUser.types.js.map +1 -0
- package/dist/destinations/trackey/registerCompany/generated-types.d.ts +9 -0
- package/dist/destinations/trackey/registerCompany/generated-types.js +3 -0
- package/dist/destinations/trackey/registerCompany/generated-types.js.map +1 -0
- package/dist/destinations/trackey/registerCompany/index.d.ts +5 -0
- package/dist/destinations/trackey/registerCompany/index.js +60 -0
- package/dist/destinations/trackey/registerCompany/index.js.map +1 -0
- package/dist/destinations/trackey/registerCompany.types.d.ts +9 -0
- package/dist/destinations/trackey/registerCompany.types.js +3 -0
- package/dist/destinations/trackey/registerCompany.types.js.map +1 -0
- package/dist/destinations/trackey/trackEvent/generated-types.d.ts +12 -0
- package/dist/destinations/trackey/trackEvent/generated-types.js +3 -0
- package/dist/destinations/trackey/trackEvent/generated-types.js.map +1 -0
- package/dist/destinations/trackey/trackEvent/index.d.ts +5 -0
- package/dist/destinations/trackey/trackEvent/index.js +68 -0
- package/dist/destinations/trackey/trackEvent/index.js.map +1 -0
- package/dist/destinations/trackey/trackEvent.types.d.ts +12 -0
- package/dist/destinations/trackey/trackEvent.types.js +3 -0
- package/dist/destinations/trackey/trackEvent.types.js.map +1 -0
- package/package.json +1 -1
package/dist/destinations/braze/updateUserProfile/__snapshots__/__snapshots__/snapshot.test.js.snap
ADDED
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`Testing snapshot for Braze's updateUserProfile destination action: all fields 1`] = `
|
|
4
|
+
Object {
|
|
5
|
+
"attributes": Array [
|
|
6
|
+
Object {
|
|
7
|
+
"_update_existing_only": false,
|
|
8
|
+
"braze_id": "M8rtOywDKgN((jhUBk9",
|
|
9
|
+
"country": "M8rtOywDKgN((jhUBk9",
|
|
10
|
+
"current_location": Object {
|
|
11
|
+
"latitude": 74322492134522.88,
|
|
12
|
+
"longitude": 74322492134522.88,
|
|
13
|
+
},
|
|
14
|
+
"date_of_first_session": "2021-02-01T00:00:00.000Z",
|
|
15
|
+
"date_of_last_session": "2021-02-01T00:00:00.000Z",
|
|
16
|
+
"dob": "2021-02-01",
|
|
17
|
+
"email": "wifot@vuri.cl",
|
|
18
|
+
"email_click_tracking_disabled": false,
|
|
19
|
+
"email_open_tracking_disabled": false,
|
|
20
|
+
"email_subscribe": "M8rtOywDKgN((jhUBk9",
|
|
21
|
+
"external_id": "M8rtOywDKgN((jhUBk9",
|
|
22
|
+
"facebook": Object {
|
|
23
|
+
"id": "M8rtOywDKgN((jhUBk9",
|
|
24
|
+
"likes": Array [
|
|
25
|
+
"M8rtOywDKgN((jhUBk9",
|
|
26
|
+
],
|
|
27
|
+
"num_friends": 7432249213452288,
|
|
28
|
+
},
|
|
29
|
+
"first_name": "M8rtOywDKgN((jhUBk9",
|
|
30
|
+
"gender": "M8rtOywDKgN((jhUBk9",
|
|
31
|
+
"home_city": "M8rtOywDKgN((jhUBk9",
|
|
32
|
+
"image_url": "http://agekekci.va/dofupo",
|
|
33
|
+
"language": "M8rtOywDKgN((jhUBk9",
|
|
34
|
+
"last_name": "M8rtOywDKgN((jhUBk9",
|
|
35
|
+
"marked_email_as_spam_at": "2021-02-01T00:00:00.000Z",
|
|
36
|
+
"phone": "M8rtOywDKgN((jhUBk9",
|
|
37
|
+
"push_subscribe": "M8rtOywDKgN((jhUBk9",
|
|
38
|
+
"push_tokens": Array [
|
|
39
|
+
Object {
|
|
40
|
+
"app_id": "M8rtOywDKgN((jhUBk9",
|
|
41
|
+
"device_id": "M8rtOywDKgN((jhUBk9",
|
|
42
|
+
"token": "M8rtOywDKgN((jhUBk9",
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
"testType": "M8rtOywDKgN((jhUBk9",
|
|
46
|
+
"time_zone": "M8rtOywDKgN((jhUBk9",
|
|
47
|
+
"twitter": Object {
|
|
48
|
+
"followers_count": 7432249213452288,
|
|
49
|
+
"friends_count": 7432249213452288,
|
|
50
|
+
"id": "M8rtOywDKgN((jhUBk9",
|
|
51
|
+
"screen_name": "M8rtOywDKgN((jhUBk9",
|
|
52
|
+
"statuses_count": 7432249213452288,
|
|
53
|
+
},
|
|
54
|
+
"user_alias": Object {
|
|
55
|
+
"alias_label": "M8rtOywDKgN((jhUBk9",
|
|
56
|
+
"alias_name": "M8rtOywDKgN((jhUBk9",
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
}
|
|
61
|
+
`;
|
|
62
|
+
|
|
63
|
+
exports[`Testing snapshot for Braze's updateUserProfile destination action: it should work with a single batched events 1`] = `
|
|
64
|
+
Headers {
|
|
65
|
+
Symbol(map): Object {
|
|
66
|
+
"authorization": Array [
|
|
67
|
+
"Bearer my-api-key",
|
|
68
|
+
],
|
|
69
|
+
"user-agent": Array [
|
|
70
|
+
"Segment (Actions)",
|
|
71
|
+
],
|
|
72
|
+
},
|
|
73
|
+
}
|
|
74
|
+
`;
|
|
75
|
+
|
|
76
|
+
exports[`Testing snapshot for Braze's updateUserProfile destination action: it should work with a single batched events 2`] = `
|
|
77
|
+
Object {
|
|
78
|
+
"attributes": Array [
|
|
79
|
+
Object {
|
|
80
|
+
"_update_existing_only": true,
|
|
81
|
+
"braze_id": undefined,
|
|
82
|
+
"country": "United States",
|
|
83
|
+
"current_location": Object {
|
|
84
|
+
"latitude": 40.2964197,
|
|
85
|
+
"longitude": -76.9411617,
|
|
86
|
+
},
|
|
87
|
+
"date_of_first_session": undefined,
|
|
88
|
+
"date_of_last_session": undefined,
|
|
89
|
+
"dob": undefined,
|
|
90
|
+
"email": undefined,
|
|
91
|
+
"email_click_tracking_disabled": undefined,
|
|
92
|
+
"email_open_tracking_disabled": undefined,
|
|
93
|
+
"email_subscribe": undefined,
|
|
94
|
+
"external_id": "user1234",
|
|
95
|
+
"facebook": undefined,
|
|
96
|
+
"first_name": undefined,
|
|
97
|
+
"gender": undefined,
|
|
98
|
+
"home_city": undefined,
|
|
99
|
+
"image_url": undefined,
|
|
100
|
+
"language": undefined,
|
|
101
|
+
"last_name": undefined,
|
|
102
|
+
"marked_email_as_spam_at": undefined,
|
|
103
|
+
"phone": undefined,
|
|
104
|
+
"push_subscribe": undefined,
|
|
105
|
+
"push_tokens": undefined,
|
|
106
|
+
"time_zone": undefined,
|
|
107
|
+
"twitter": undefined,
|
|
108
|
+
"user_alias": undefined,
|
|
109
|
+
},
|
|
110
|
+
],
|
|
111
|
+
}
|
|
112
|
+
`;
|
|
113
|
+
|
|
114
|
+
exports[`Testing snapshot for Braze's updateUserProfile destination action: it should work with batched events 1`] = `
|
|
115
|
+
Headers {
|
|
116
|
+
Symbol(map): Object {
|
|
117
|
+
"authorization": Array [
|
|
118
|
+
"Bearer my-api-key",
|
|
119
|
+
],
|
|
120
|
+
"user-agent": Array [
|
|
121
|
+
"Segment (Actions)",
|
|
122
|
+
],
|
|
123
|
+
"x-braze-batch": Array [
|
|
124
|
+
"true",
|
|
125
|
+
],
|
|
126
|
+
},
|
|
127
|
+
}
|
|
128
|
+
`;
|
|
129
|
+
|
|
130
|
+
exports[`Testing snapshot for Braze's updateUserProfile destination action: it should work with batched events 2`] = `
|
|
131
|
+
Object {
|
|
132
|
+
"attributes": Array [
|
|
133
|
+
Object {
|
|
134
|
+
"_update_existing_only": true,
|
|
135
|
+
"braze_id": undefined,
|
|
136
|
+
"country": "United States",
|
|
137
|
+
"current_location": Object {
|
|
138
|
+
"latitude": 40.2964197,
|
|
139
|
+
"longitude": -76.9411617,
|
|
140
|
+
},
|
|
141
|
+
"date_of_first_session": undefined,
|
|
142
|
+
"date_of_last_session": undefined,
|
|
143
|
+
"dob": undefined,
|
|
144
|
+
"email": undefined,
|
|
145
|
+
"email_click_tracking_disabled": undefined,
|
|
146
|
+
"email_open_tracking_disabled": undefined,
|
|
147
|
+
"email_subscribe": undefined,
|
|
148
|
+
"external_id": "user1234",
|
|
149
|
+
"facebook": undefined,
|
|
150
|
+
"first_name": undefined,
|
|
151
|
+
"gender": undefined,
|
|
152
|
+
"home_city": undefined,
|
|
153
|
+
"image_url": undefined,
|
|
154
|
+
"language": undefined,
|
|
155
|
+
"last_name": undefined,
|
|
156
|
+
"marked_email_as_spam_at": undefined,
|
|
157
|
+
"phone": undefined,
|
|
158
|
+
"push_subscribe": undefined,
|
|
159
|
+
"push_tokens": undefined,
|
|
160
|
+
"time_zone": undefined,
|
|
161
|
+
"twitter": undefined,
|
|
162
|
+
"user_alias": undefined,
|
|
163
|
+
},
|
|
164
|
+
Object {
|
|
165
|
+
"_update_existing_only": true,
|
|
166
|
+
"braze_id": undefined,
|
|
167
|
+
"country": "United States",
|
|
168
|
+
"current_location": Object {
|
|
169
|
+
"latitude": 40.2964197,
|
|
170
|
+
"longitude": -76.9411617,
|
|
171
|
+
},
|
|
172
|
+
"date_of_first_session": undefined,
|
|
173
|
+
"date_of_last_session": undefined,
|
|
174
|
+
"dob": undefined,
|
|
175
|
+
"email": undefined,
|
|
176
|
+
"email_click_tracking_disabled": undefined,
|
|
177
|
+
"email_open_tracking_disabled": undefined,
|
|
178
|
+
"email_subscribe": undefined,
|
|
179
|
+
"external_id": "user1234",
|
|
180
|
+
"facebook": undefined,
|
|
181
|
+
"first_name": undefined,
|
|
182
|
+
"gender": undefined,
|
|
183
|
+
"home_city": undefined,
|
|
184
|
+
"image_url": undefined,
|
|
185
|
+
"language": undefined,
|
|
186
|
+
"last_name": undefined,
|
|
187
|
+
"marked_email_as_spam_at": undefined,
|
|
188
|
+
"phone": undefined,
|
|
189
|
+
"push_subscribe": undefined,
|
|
190
|
+
"push_tokens": undefined,
|
|
191
|
+
"time_zone": undefined,
|
|
192
|
+
"twitter": undefined,
|
|
193
|
+
"user_alias": undefined,
|
|
194
|
+
},
|
|
195
|
+
],
|
|
196
|
+
}
|
|
197
|
+
`;
|
|
198
|
+
|
|
199
|
+
exports[`Testing snapshot for Braze's updateUserProfile destination action: required fields 1`] = `
|
|
200
|
+
Object {
|
|
201
|
+
"attributes": Array [
|
|
202
|
+
Object {
|
|
203
|
+
"braze_id": "M8rtOywDKgN((jhUBk9",
|
|
204
|
+
"external_id": "M8rtOywDKgN((jhUBk9",
|
|
205
|
+
},
|
|
206
|
+
],
|
|
207
|
+
}
|
|
208
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../src/destinations/kevel/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,45 @@
|
|
|
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 syncAudience_1 = __importDefault(require("./syncAudience"));
|
|
7
|
+
const syncTraits_1 = __importDefault(require("./syncTraits"));
|
|
8
|
+
const destination = {
|
|
9
|
+
name: 'Kevel',
|
|
10
|
+
slug: 'actions-kevel',
|
|
11
|
+
description: 'Send Segment user profiles and Segment Audiences to Kevel. Only users with a Segment userId will be synced.',
|
|
12
|
+
mode: 'cloud',
|
|
13
|
+
authentication: {
|
|
14
|
+
scheme: 'custom',
|
|
15
|
+
fields: {
|
|
16
|
+
networkId: {
|
|
17
|
+
label: 'Kevel Network ID',
|
|
18
|
+
description: 'Your Kevel Network ID',
|
|
19
|
+
type: 'string',
|
|
20
|
+
required: true
|
|
21
|
+
},
|
|
22
|
+
apiKey: {
|
|
23
|
+
label: 'Kevel API Key',
|
|
24
|
+
description: 'Your Kevel API Key',
|
|
25
|
+
type: 'string',
|
|
26
|
+
required: true
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
extendRequest({ settings }) {
|
|
31
|
+
return {
|
|
32
|
+
headers: {
|
|
33
|
+
'X-Adzerk-ApiKey': settings.apiKey,
|
|
34
|
+
'Content-Type': 'application/json',
|
|
35
|
+
'X-Adzerk-Sdk-Version': 'adzerk-segment-integration:v1.0'
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
},
|
|
39
|
+
actions: {
|
|
40
|
+
syncAudience: syncAudience_1.default,
|
|
41
|
+
syncTraits: syncTraits_1.default
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
exports.default = destination;
|
|
45
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/kevel/index.ts"],"names":[],"mappings":";;;;;AAGA,kEAAyC;AAEzC,8DAAqC;AAErC,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,eAAe;IACrB,WAAW,EACT,6GAA6G;IAC/G,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,SAAS,EAAE;gBACT,KAAK,EAAE,kBAAkB;gBACzB,WAAW,EAAE,uBAAuB;gBACpC,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,MAAM,EAAE;gBACN,KAAK,EAAE,eAAe;gBACtB,WAAW,EAAE,oBAAoB;gBACjC,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;SACF;KACF;IACD,aAAa,CAAC,EAAE,QAAQ,EAAE;QACxB,OAAO;YACL,OAAO,EAAE;gBACP,iBAAiB,EAAE,QAAQ,CAAC,MAAM;gBAClC,cAAc,EAAE,kBAAkB;gBAClC,sBAAsB,EAAE,iCAAiC;aAC1D;SACF,CAAA;IACH,CAAC;IACD,OAAO,EAAE;QACP,YAAY,EAAZ,sBAAY;QACZ,UAAU,EAAV,oBAAU;KACX;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/kevel/syncAudience/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const action = {
|
|
4
|
+
title: 'Sync Audience',
|
|
5
|
+
description: 'Sync a Segment Engage Audience to a Kevel Segment. Only users with a Segment userId will be synced.',
|
|
6
|
+
defaultSubscription: 'context.personas.computation_class = "audience"',
|
|
7
|
+
fields: {
|
|
8
|
+
segment_computation_key: {
|
|
9
|
+
label: 'Audience Key',
|
|
10
|
+
description: 'Segment Audience name to which user identifier should be added or removed',
|
|
11
|
+
type: 'string',
|
|
12
|
+
unsafe_hidden: true,
|
|
13
|
+
required: true,
|
|
14
|
+
default: {
|
|
15
|
+
'@path': '$.context.personas.computation_key'
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
segment_computation_action: {
|
|
19
|
+
label: 'Segment Computation Action',
|
|
20
|
+
description: "Segment computation class used to determine if input event is from an Engage Audience'. Value must be = 'audience'.",
|
|
21
|
+
type: 'string',
|
|
22
|
+
unsafe_hidden: true,
|
|
23
|
+
required: true,
|
|
24
|
+
default: {
|
|
25
|
+
'@path': '$.context.personas.computation_class'
|
|
26
|
+
},
|
|
27
|
+
choices: [{ label: 'audience', value: 'audience' }]
|
|
28
|
+
},
|
|
29
|
+
segment_user_id: {
|
|
30
|
+
label: 'User ID',
|
|
31
|
+
description: "The user's unique ID",
|
|
32
|
+
type: 'string',
|
|
33
|
+
unsafe_hidden: true,
|
|
34
|
+
required: true,
|
|
35
|
+
default: { '@path': '$.userId' }
|
|
36
|
+
},
|
|
37
|
+
traits_or_props: {
|
|
38
|
+
label: 'Traits or properties object',
|
|
39
|
+
description: 'A computed object for track and identify events. This field should not need to be edited.',
|
|
40
|
+
type: 'object',
|
|
41
|
+
required: true,
|
|
42
|
+
unsafe_hidden: true,
|
|
43
|
+
default: {
|
|
44
|
+
'@if': {
|
|
45
|
+
exists: { '@path': '$.properties' },
|
|
46
|
+
then: { '@path': '$.properties' },
|
|
47
|
+
else: { '@path': '$.traits' }
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
perform: async (request, data) => {
|
|
53
|
+
const settings = data.settings;
|
|
54
|
+
const baseUrl = `https://e-${settings.networkId}.adzerk.net/udb/${settings.networkId}`;
|
|
55
|
+
const payload = data.payload;
|
|
56
|
+
const audienceValue = payload.traits_or_props[payload.segment_computation_key];
|
|
57
|
+
return request(`${baseUrl}/interests?userKey=${payload.segment_user_id}`, {
|
|
58
|
+
json: [payload.segment_computation_key],
|
|
59
|
+
method: audienceValue ? 'POST' : 'DELETE'
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
exports.default = action;
|
|
64
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/kevel/syncAudience/index.ts"],"names":[],"mappings":";;AAIA,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,eAAe;IACtB,WAAW,EAAE,qGAAqG;IAClH,mBAAmB,EAAE,iDAAiD;IACtE,MAAM,EAAE;QACN,uBAAuB,EAAE;YACvB,KAAK,EAAE,cAAc;YACrB,WAAW,EAAE,2EAA2E;YACxF,IAAI,EAAE,QAAQ;YACd,aAAa,EAAE,IAAI;YACnB,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,oCAAoC;aAC9C;SACF;QACD,0BAA0B,EAAE;YAC1B,KAAK,EAAE,4BAA4B;YACnC,WAAW,EACT,qHAAqH;YACvH,IAAI,EAAE,QAAQ;YACd,aAAa,EAAE,IAAI;YACnB,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,sCAAsC;aAChD;YACD,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;SACpD;QACD,eAAe,EA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],"names":[],"mappings":""}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const action = {
|
|
4
|
+
title: 'Sync Traits',
|
|
5
|
+
description: 'Sync user profile traits from Segment to Kevel',
|
|
6
|
+
fields: {
|
|
7
|
+
segment_user_id: {
|
|
8
|
+
label: 'User ID',
|
|
9
|
+
description: "The user's unique ID",
|
|
10
|
+
type: 'string',
|
|
11
|
+
required: true,
|
|
12
|
+
default: { '@path': '$.userId' }
|
|
13
|
+
},
|
|
14
|
+
traits: {
|
|
15
|
+
label: 'Traits',
|
|
16
|
+
description: "The user's profile traits / attributes",
|
|
17
|
+
type: 'object',
|
|
18
|
+
required: true,
|
|
19
|
+
default: { '@path': '$.traits' }
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
perform: async (request, data) => {
|
|
23
|
+
const settings = data.settings;
|
|
24
|
+
const baseUrl = `https://e-${settings.networkId}.adzerk.net/udb/${settings.networkId}`;
|
|
25
|
+
const payload = data.payload;
|
|
26
|
+
const existingResponse = await request(`${baseUrl}/read?userKey=${payload.segment_user_id}`, {
|
|
27
|
+
method: 'GET'
|
|
28
|
+
});
|
|
29
|
+
const existingRecord = await existingResponse.json();
|
|
30
|
+
const mergedTraits = { ...existingRecord?.custom, ...payload.traits };
|
|
31
|
+
return request(`${baseUrl}/customProperties?userKey=${payload.segment_user_id}`, {
|
|
32
|
+
json: mergedTraits,
|
|
33
|
+
method: 'POST'
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
exports.default = action;
|
|
38
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/kevel/syncTraits/index.ts"],"names":[],"mappings":";;AAIA,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,gDAAgD;IAC7D,MAAM,EAAE;QACN,eAAe,EAAE;YACf,KAAK,EAAE,SAAS;YAChB,WAAW,EAAE,sBAAsB;YACnC,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;SACjC;QACD,MAAM,EAAE;YACN,KAAK,EAAE,QAAQ;YACf,WAAW,EAAE,wCAAwC;YACrD,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;SACjC;KACF;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;QAC/B,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAA;QAE9B,MAAM,OAAO,GAAG,aAAa,QAAQ,CAAC,SAAS,mBAAmB,QAAQ,CAAC,SAAS,EAAE,CAAA;QAEtF,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAA;QAE5B,MAAM,gBAAgB,GAAG,MAAM,OAAO,CAAC,GAAG,OAAO,iBAAiB,OAAO,CAAC,eAAe,EAAE,EAAE;YAC3F,MAAM,EAAE,KAAK;SACd,CAAC,CAAA;QAEF,MAAM,cAAc,GAAG,MAAM,gBAAgB,CAAC,IAAI,EAAE,CAAA;QAEpD,MAAM,YAAY,GAAG,EAAE,GAAG,cAAc,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAA;QAErE,OAAO,OAAO,CAAC,GAAG,OAAO,6BAA6B,OAAO,CAAC,eAAe,EAAE,EAAE;YAC/E,IAAI,EAAE,YAAY;YAClB,MAAM,EAAE,MAAM;SACf,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -18,13 +18,12 @@ const action = {
|
|
|
18
18
|
try {
|
|
19
19
|
const profileData = await functions_1.getProfile(request, email);
|
|
20
20
|
const v = JSON.parse(profileData.content);
|
|
21
|
-
if (
|
|
22
|
-
console.log(v);
|
|
21
|
+
if (!v && v.data[0] != undefined) {
|
|
23
22
|
const listData = {
|
|
24
23
|
data: [
|
|
25
24
|
{
|
|
26
25
|
type: 'profile',
|
|
27
|
-
id: v.
|
|
26
|
+
id: v.id
|
|
28
27
|
}
|
|
29
28
|
]
|
|
30
29
|
};
|
|
@@ -34,7 +33,6 @@ const action = {
|
|
|
34
33
|
return;
|
|
35
34
|
}
|
|
36
35
|
catch (error) {
|
|
37
|
-
console.log(error);
|
|
38
36
|
throw new Error('An error occurred while processing the request');
|
|
39
37
|
}
|
|
40
38
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/klaviyo/removeProfileToList/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAK1E,4CAA6D;AAC7D,8CAAkD;AAElD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,0BAA0B;IACjC,WAAW,EAAE,0BAA0B;IACvC,MAAM,EAAE;QACN,KAAK,EAAE,EAAE,GAAG,kBAAK,EAAE;QACnB,OAAO,EAAE,EAAE,GAAG,wBAAW,EAAE;KAC5B;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QACtC,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,OAAO,CAAA;QAClC,IAAI,CAAC,KAAK,IAAI,CAAC,OAAO,EAAE;YACtB,MAAM,IAAI,+BAAgB,CACxB,sEAAsE,EACtE,yBAAyB,EACzB,GAAG,CACJ,CAAA;SACF;QACD,IAAI;YACF,MAAM,WAAW,GAA2B,MAAM,sBAAU,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;YAC5E,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAA;YACzC,IAAI,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/klaviyo/remov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ib/ajs-detection");
|
|
|
5
5
|
const action = {
|
|
6
6
|
title: 'Track',
|
|
7
7
|
description: 'Send an Event to Koala.',
|
|
8
|
-
defaultSubscription: '
|
|
8
|
+
defaultSubscription: 'context.personas.computation_class = "audience"',
|
|
9
9
|
fields: {
|
|
10
10
|
email: {
|
|
11
11
|
type: 'string',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/koala/track/index.ts"],"names":[],"mappings":";;AACA,0BAA+B;AAG/B,wDAAwE;AAExE,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,yBAAyB;IACtC,mBAAmB,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/koala/track/index.ts"],"names":[],"mappings":";;AACA,0BAA+B;AAG/B,wDAAwE;AAExE,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,yBAAyB;IACtC,mBAAmB,EAAE,iDAAiD;IACtE,MAAM,EAAE;QACN,KAAK,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,OAAO;YACd,WAAW,EAAE,sCAAsC;YACnD,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE;gBACP,KAAK,EAAE;oBACL,MAAM,EAAE,EAAE,OAAO,EAAE,gBAAgB,EAAE;oBACrC,IAAI,EAAE,EAAE,OAAO,EAAE,gBAAgB,EAAE;oBACnC,IAAI,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;iBAC7B;aACF;SACF;QACD,KAAK,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,gBAAgB;YAC7B,KAAK,EAAE,YAAY;YACnB,OAAO,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;SAChC;QACD,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,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AAK,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,KAAK,IAAI,MAAM,CAAC,KAAK,CAAA;QAClF,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,IAAI,IAAI,CAAC,OAAO,CAAC,SAAS,CAAA;QAIhE,IAAI,0BAAU,CAAC,IAAI,CAAC,OAAO,CAAC,OAAgC,CAAC,EAAE;YAC7D,OAAO,OAAO,CAAC,OAAO,EAAE,CAAA;SACzB;QAED,IAAI,CAAC,SAAS,IAAI,CAAC,KAAK,EAAE;YAExB,OAAO,OAAO,CAAC,OAAO,EAAE,CAAA;SACzB;QAED,OAAO,OAAO,CAAC,GAAG,cAAU,IAAI,IAAI,CAAC,QAAQ,CAAC,UAAU,QAAQ,EAAE;YAChE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE;gBACJ,UAAU,EAAE,SAAS;gBACrB,KAAK;gBACL,MAAM;gBACN,EAAE;gBACF,MAAM,EAAE;oBACN;wBACE,IAAI,EAAE,OAAO;wBACb,GAAG,IAAI,CAAC,OAAO;qBAChB;iBACF;aACF;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/trackey/identifyUser/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const constants_1 = require("../constants");
|
|
4
|
+
const action = {
|
|
5
|
+
title: 'Identify User',
|
|
6
|
+
description: 'Identify a user',
|
|
7
|
+
defaultSubscription: 'type = "identify"',
|
|
8
|
+
fields: {
|
|
9
|
+
userId: {
|
|
10
|
+
label: 'User ID',
|
|
11
|
+
type: 'string',
|
|
12
|
+
required: true,
|
|
13
|
+
description: 'The user identifier to associate the event with',
|
|
14
|
+
default: { '@path': '$.userId' }
|
|
15
|
+
},
|
|
16
|
+
messageId: {
|
|
17
|
+
label: 'Message ID',
|
|
18
|
+
type: 'string',
|
|
19
|
+
description: 'A unique value for each event.',
|
|
20
|
+
default: {
|
|
21
|
+
'@path': '$.messageId'
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
timestamp: {
|
|
25
|
+
label: 'Event Timestamp',
|
|
26
|
+
type: 'string',
|
|
27
|
+
required: true,
|
|
28
|
+
description: 'Timestamp that the event took place, in ISO 8601 format. e.g. 2019-06-12T19:11:01.152Z',
|
|
29
|
+
default: { '@path': '$.timestamp' }
|
|
30
|
+
},
|
|
31
|
+
traits: {
|
|
32
|
+
label: 'User Traits',
|
|
33
|
+
type: 'object',
|
|
34
|
+
required: false,
|
|
35
|
+
description: 'User profile information',
|
|
36
|
+
default: { '@path': '$.traits' }
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
perform: (request, { payload }) => {
|
|
40
|
+
return request(constants_1.baseUrl, {
|
|
41
|
+
method: 'POST',
|
|
42
|
+
json: {
|
|
43
|
+
userId: payload.userId,
|
|
44
|
+
messageId: payload.messageId,
|
|
45
|
+
timestamp: payload.timestamp,
|
|
46
|
+
traits: payload.traits
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
exports.default = action;
|
|
52
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/trackey/identifyUser/index.ts"],"names":[],"mappings":";;AAGA,4CAAsC;AAEtC,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,eAAe;IACtB,WAAW,EAAE,iBAAiB;IAC9B,mBAAmB,EAAE,mBAAmB;IACxC,MAAM,EAAE;QACN,MAAM,EAAE;YACN,KAAK,EAAE,SAAS;YAChB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,iDAAiD;YAC9D,OAAO,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;SACjC;QACD,SAAS,EAAE;YACT,KAAK,EAAE,YAAY;YACnB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,gCAAgC;YAC7C,OAAO,EAAE;gBACP,OAAO,EAAE,aAAa;aACvB;SACF;QACD,SAAS,EAAE;YACT,KAAK,EAAE,iBAAiB;YACxB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,wFAAwF;YACrG,OAAO,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE;SACpC;QACD,MAAM,EAAE;YACN,KAAK,EAAE,aAAa;YACpB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,0BAA0B;YACvC,OAAO,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;SACjC;KACF;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QAChC,OAAO,OAAO,CAAC,mBAAO,EAAE;YACtB,MAAM,EAAE,MAAM;YACd,IAAI,EAAE;gBACJ,MAAM,EAAE,OAAO,CAAC,MAAM;gBACtB,SAAS,EAAE,OAAO,CAAC,SAAS;gBAC5B,SAAS,EAAE,OAAO,CAAC,SAAS;gBAC5B,MAAM,EAAE,OAAO,CAAC,MAAM;aACvB;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identifyUser.types.js","sourceRoot":"","sources":["../../../src/destinations/trackey/identifyUser.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/trackey/registerCompany/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const constants_1 = require("../constants");
|
|
4
|
+
const action = {
|
|
5
|
+
title: 'Register Company',
|
|
6
|
+
description: 'Register a user in a company',
|
|
7
|
+
defaultSubscription: 'type = "group"',
|
|
8
|
+
fields: {
|
|
9
|
+
userId: {
|
|
10
|
+
label: 'User ID',
|
|
11
|
+
type: 'string',
|
|
12
|
+
required: true,
|
|
13
|
+
description: 'The user identifier to associate the event with',
|
|
14
|
+
default: { '@path': '$.userId' }
|
|
15
|
+
},
|
|
16
|
+
messageId: {
|
|
17
|
+
label: 'Message ID',
|
|
18
|
+
type: 'string',
|
|
19
|
+
description: 'A unique value for each event.',
|
|
20
|
+
default: {
|
|
21
|
+
'@path': '$.messageId'
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
timestamp: {
|
|
25
|
+
label: 'Event Timestamp',
|
|
26
|
+
type: 'string',
|
|
27
|
+
required: true,
|
|
28
|
+
description: 'Timestamp that the event took place, in ISO 8601 format. e.g. 2019-06-12T19:11:01.152Z',
|
|
29
|
+
default: { '@path': '$.timestamp' }
|
|
30
|
+
},
|
|
31
|
+
traits: {
|
|
32
|
+
label: 'COmpany Traits',
|
|
33
|
+
type: 'object',
|
|
34
|
+
required: false,
|
|
35
|
+
description: 'Company profile information',
|
|
36
|
+
default: { '@path': '$.traits' }
|
|
37
|
+
},
|
|
38
|
+
groupId: {
|
|
39
|
+
label: 'Group ID',
|
|
40
|
+
type: 'string',
|
|
41
|
+
required: true,
|
|
42
|
+
description: 'Company ID associated with the event',
|
|
43
|
+
default: { '@path': '$.groupId' }
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
perform: (request, { payload }) => {
|
|
47
|
+
return request(constants_1.baseUrl, {
|
|
48
|
+
method: 'POST',
|
|
49
|
+
json: {
|
|
50
|
+
userId: payload.userId,
|
|
51
|
+
messageId: payload.messageId,
|
|
52
|
+
timestamp: payload.timestamp,
|
|
53
|
+
traits: payload.traits,
|
|
54
|
+
groupId: payload.groupId
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
exports.default = action;
|
|
60
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/trackey/registerCompany/index.ts"],"names":[],"mappings":";;AAGA,4CAAsC;AAEtC,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,kBAAkB;IACzB,WAAW,EAAE,8BAA8B;IAC3C,mBAAmB,EAAE,gBAAgB;IACrC,MAAM,EAAE;QACN,MAAM,EAAE;YACN,KAAK,EAAE,SAAS;YAChB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,iDAAiD;YAC9D,OAAO,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;SACjC;QACD,SAAS,EAAE;YACT,KAAK,EAAE,YAAY;YACnB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,gCAAgC;YAC7C,OAAO,EAAE;gBACP,OAAO,EAAE,aAAa;aACvB;SACF;QACD,SAAS,EAAE;YACT,KAAK,EAAE,iBAAiB;YACxB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,wFAAwF;YACrG,OAAO,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE;SACpC;QACD,MAAM,EAAE;YACN,KAAK,EAAE,gBAAgB;YACvB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,6BAA6B;YAC1C,OAAO,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;SACjC;QACD,OAAO,EAAE;YACP,KAAK,EAAE,UAAU;YACjB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,sCAAsC;YACnD,OAAO,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE;SAClC;KACF;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QAChC,OAAO,OAAO,CAAC,mBAAO,EAAE;YACtB,MAAM,EAAE,MAAM;YACd,IAAI,EAAE;gBACJ,MAAM,EAAE,OAAO,CAAC,MAAM;gBACtB,SAAS,EAAE,OAAO,CAAC,SAAS;gBAC5B,SAAS,EAAE,OAAO,CAAC,SAAS;gBAC5B,MAAM,EAAE,OAAO,CAAC,MAAM;gBACtB,OAAO,EAAE,OAAO,CAAC,OAAO;aACzB;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registerCompany.types.js","sourceRoot":"","sources":["../../../src/destinations/trackey/registerCompany.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/trackey/trackEvent/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const constants_1 = require("../constants");
|
|
4
|
+
const action = {
|
|
5
|
+
title: 'Track Event',
|
|
6
|
+
description: 'Track an event',
|
|
7
|
+
defaultSubscription: 'type = "track"',
|
|
8
|
+
fields: {
|
|
9
|
+
userId: {
|
|
10
|
+
label: 'User ID',
|
|
11
|
+
type: 'string',
|
|
12
|
+
required: true,
|
|
13
|
+
description: 'The user identifier to associate the event with',
|
|
14
|
+
default: { '@path': '$.userId' }
|
|
15
|
+
},
|
|
16
|
+
event: {
|
|
17
|
+
label: 'Event Name',
|
|
18
|
+
type: 'string',
|
|
19
|
+
required: true,
|
|
20
|
+
description: 'Name of the Segment track() event',
|
|
21
|
+
default: { '@path': '$.event' }
|
|
22
|
+
},
|
|
23
|
+
messageId: {
|
|
24
|
+
label: 'Message ID',
|
|
25
|
+
type: 'string',
|
|
26
|
+
description: 'A unique value for each event.',
|
|
27
|
+
default: {
|
|
28
|
+
'@path': '$.messageId'
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
timestamp: {
|
|
32
|
+
label: 'Event Timestamp',
|
|
33
|
+
type: 'string',
|
|
34
|
+
required: true,
|
|
35
|
+
description: 'Timestamp that the event took place, in ISO 8601 format. e.g. 2019-06-12T19:11:01.152Z',
|
|
36
|
+
default: { '@path': '$.timestamp' }
|
|
37
|
+
},
|
|
38
|
+
properties: {
|
|
39
|
+
label: 'Event Properties',
|
|
40
|
+
type: 'object',
|
|
41
|
+
required: false,
|
|
42
|
+
description: 'Additional information associated with the track() event',
|
|
43
|
+
default: { '@path': '$.properties' }
|
|
44
|
+
},
|
|
45
|
+
groupId: {
|
|
46
|
+
label: 'Group ID',
|
|
47
|
+
type: 'object',
|
|
48
|
+
required: false,
|
|
49
|
+
description: 'Company ID associated with the event',
|
|
50
|
+
default: { '@path': '$.context.group_id' }
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
perform: (request, { payload }) => {
|
|
54
|
+
return request(constants_1.baseUrl, {
|
|
55
|
+
method: 'POST',
|
|
56
|
+
json: {
|
|
57
|
+
userId: payload.userId,
|
|
58
|
+
event: payload.event,
|
|
59
|
+
messageId: payload.messageId,
|
|
60
|
+
timestamp: payload.timestamp,
|
|
61
|
+
properties: payload.properties,
|
|
62
|
+
groupId: payload.groupId
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
exports.default = action;
|
|
68
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/trackey/trackEvent/index.ts"],"names":[],"mappings":";;AAGA,4CAAsC;AAEtC,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,gBAAgB;IAC7B,mBAAmB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E,OAAO,CAAC,KAAK;gBACpB,SAAS,EAAE,OAAO,CAAC,SAAS;gBAC5B,SAAS,EAAE,OAAO,CAAC,SAAS;gBAC5B,UAAU,EAAE,OAAO,CAAC,UAAU;gBAC9B,OAAO,EAAE,OAAO,CAAC,OAAO;aACzB;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trackEvent.types.js","sourceRoot":"","sources":["../../../src/destinations/trackey/trackEvent.types.ts"],"names":[],"mappings":""}
|
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.335.
|
|
4
|
+
"version": "3.335.3-staging-3",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/segmentio/action-destinations",
|