@segment/action-destinations 3.146.0 → 3.148.1-REPLACEDIRECTIVE.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/README.md +1 -0
- package/dist/destinations/blend-ai/generated-types.d.ts +3 -0
- package/dist/destinations/blend-ai/generated-types.js +3 -0
- package/dist/destinations/blend-ai/generated-types.js.map +1 -0
- package/dist/destinations/blend-ai/index.d.ts +4 -0
- package/dist/destinations/blend-ai/index.js +54 -0
- package/dist/destinations/blend-ai/index.js.map +1 -0
- package/dist/destinations/blend-ai/sendData/generated-types.d.ts +2 -0
- package/dist/destinations/blend-ai/sendData/generated-types.js +3 -0
- package/dist/destinations/blend-ai/sendData/generated-types.js.map +1 -0
- package/dist/destinations/blend-ai/sendData/index.d.ts +5 -0
- package/dist/destinations/blend-ai/sendData/index.js +16 -0
- package/dist/destinations/blend-ai/sendData/index.js.map +1 -0
- package/dist/destinations/encharge/addTag/generated-types.d.ts +6 -0
- package/dist/destinations/encharge/addTag/generated-types.js +3 -0
- package/dist/destinations/encharge/addTag/generated-types.js.map +1 -0
- package/dist/destinations/encharge/addTag/index.d.ts +5 -0
- package/dist/destinations/encharge/addTag/index.js +37 -0
- package/dist/destinations/encharge/addTag/index.js.map +1 -0
- package/dist/destinations/encharge/aliasUser/generated-types.d.ts +6 -0
- package/dist/destinations/encharge/aliasUser/generated-types.js +3 -0
- package/dist/destinations/encharge/aliasUser/generated-types.js.map +1 -0
- package/dist/destinations/encharge/aliasUser/index.d.ts +5 -0
- package/dist/destinations/encharge/aliasUser/index.js +42 -0
- package/dist/destinations/encharge/aliasUser/index.js.map +1 -0
- package/dist/destinations/encharge/common-definitions.d.ts +5 -0
- package/dist/destinations/encharge/common-definitions.js +206 -0
- package/dist/destinations/encharge/common-definitions.js.map +1 -0
- package/dist/destinations/encharge/createUpdateObject/generated-types.d.ts +10 -0
- package/dist/destinations/encharge/createUpdateObject/generated-types.js +3 -0
- package/dist/destinations/encharge/createUpdateObject/generated-types.js.map +1 -0
- package/dist/destinations/encharge/createUpdateObject/getCustomObjects.d.ts +2 -0
- package/dist/destinations/encharge/createUpdateObject/getCustomObjects.js +29 -0
- package/dist/destinations/encharge/createUpdateObject/getCustomObjects.js.map +1 -0
- package/dist/destinations/encharge/createUpdateObject/index.d.ts +5 -0
- package/dist/destinations/encharge/createUpdateObject/index.js +75 -0
- package/dist/destinations/encharge/createUpdateObject/index.js.map +1 -0
- package/dist/destinations/encharge/deleteUser.d.ts +3 -0
- package/dist/destinations/encharge/deleteUser.js +23 -0
- package/dist/destinations/encharge/deleteUser.js.map +1 -0
- package/dist/destinations/encharge/generated-types.d.ts +3 -0
- package/dist/destinations/encharge/generated-types.js +3 -0
- package/dist/destinations/encharge/generated-types.js.map +1 -0
- package/dist/destinations/encharge/identifyUser/generated-types.d.ts +33 -0
- package/dist/destinations/encharge/identifyUser/generated-types.js +3 -0
- package/dist/destinations/encharge/identifyUser/generated-types.js.map +1 -0
- package/dist/destinations/encharge/identifyUser/index.d.ts +5 -0
- package/dist/destinations/encharge/identifyUser/index.js +42 -0
- package/dist/destinations/encharge/identifyUser/index.js.map +1 -0
- package/dist/destinations/encharge/index.d.ts +4 -0
- package/dist/destinations/encharge/index.js +88 -0
- package/dist/destinations/encharge/index.js.map +1 -0
- package/dist/destinations/encharge/removeTag/generated-types.d.ts +6 -0
- package/dist/destinations/encharge/removeTag/generated-types.js +3 -0
- package/dist/destinations/encharge/removeTag/generated-types.js.map +1 -0
- package/dist/destinations/encharge/removeTag/index.d.ts +5 -0
- package/dist/destinations/encharge/removeTag/index.js +37 -0
- package/dist/destinations/encharge/removeTag/index.js.map +1 -0
- package/dist/destinations/encharge/trackEvent/generated-types.d.ts +37 -0
- package/dist/destinations/encharge/trackEvent/generated-types.js +3 -0
- package/dist/destinations/encharge/trackEvent/generated-types.js.map +1 -0
- package/dist/destinations/encharge/trackEvent/index.d.ts +5 -0
- package/dist/destinations/encharge/trackEvent/index.js +44 -0
- package/dist/destinations/encharge/trackEvent/index.js.map +1 -0
- package/dist/destinations/encharge/trackPageView/generated-types.d.ts +36 -0
- package/dist/destinations/encharge/trackPageView/generated-types.js +3 -0
- package/dist/destinations/encharge/trackPageView/generated-types.js.map +1 -0
- package/dist/destinations/encharge/trackPageView/index.d.ts +5 -0
- package/dist/destinations/encharge/trackPageView/index.js +41 -0
- package/dist/destinations/encharge/trackPageView/index.js.map +1 -0
- package/dist/destinations/encharge/utils.d.ts +3 -0
- package/dist/destinations/encharge/utils.js +7 -0
- package/dist/destinations/encharge/utils.js.map +1 -0
- package/dist/destinations/google-enhanced-conversions/uploadClickConversion/index.js +3 -1
- package/dist/destinations/google-enhanced-conversions/uploadClickConversion/index.js.map +1 -1
- package/dist/destinations/index.js +2 -0
- package/dist/destinations/index.js.map +1 -1
- package/dist/destinations/mixpanel/identifyUser/index.js +12 -2
- package/dist/destinations/mixpanel/identifyUser/index.js.map +1 -1
- package/dist/destinations/mixpanel/mixpanel-types.d.ts +17 -0
- package/dist/destinations/pinterest-conversions/constants.d.ts +14 -0
- package/dist/destinations/pinterest-conversions/constants.js +18 -0
- package/dist/destinations/pinterest-conversions/constants.js.map +1 -0
- package/dist/destinations/pinterest-conversions/index.d.ts +1 -1
- package/dist/destinations/pinterest-conversions/index.js +98 -1
- package/dist/destinations/pinterest-conversions/index.js.map +1 -1
- package/dist/destinations/pinterest-conversions/pinterest-capi-custom-data.d.ts +2 -0
- package/dist/destinations/pinterest-conversions/pinterest-capi-custom-data.js +83 -0
- package/dist/destinations/pinterest-conversions/pinterest-capi-custom-data.js.map +1 -0
- package/dist/destinations/pinterest-conversions/pinterset-capi-user-data.d.ts +7 -0
- package/dist/destinations/pinterest-conversions/pinterset-capi-user-data.js +195 -0
- package/dist/destinations/pinterest-conversions/pinterset-capi-user-data.js.map +1 -0
- package/dist/destinations/pinterest-conversions/reportConversionEvent/generated-types.d.ts +45 -0
- package/dist/destinations/pinterest-conversions/reportConversionEvent/index.js +202 -2
- package/dist/destinations/pinterest-conversions/reportConversionEvent/index.js.map +1 -1
- package/dist/destinations/rokt-audiences/constants.d.ts +8 -0
- package/dist/destinations/rokt-audiences/constants.js +12 -0
- package/dist/destinations/rokt-audiences/constants.js.map +1 -0
- package/dist/destinations/rokt-audiences/generated-types.d.ts +3 -0
- package/dist/destinations/rokt-audiences/generated-types.js +3 -0
- package/dist/destinations/rokt-audiences/generated-types.js.map +1 -0
- package/dist/destinations/rokt-audiences/index.d.ts +4 -0
- package/dist/destinations/rokt-audiences/index.js +58 -0
- package/dist/destinations/rokt-audiences/index.js.map +1 -0
- package/dist/destinations/rokt-audiences/upsertCustomAudiences/custom-audience-operations.d.ts +4 -0
- package/dist/destinations/rokt-audiences/upsertCustomAudiences/custom-audience-operations.js +56 -0
- package/dist/destinations/rokt-audiences/upsertCustomAudiences/custom-audience-operations.js.map +1 -0
- package/dist/destinations/rokt-audiences/upsertCustomAudiences/generated-types.d.ts +9 -0
- package/dist/destinations/rokt-audiences/upsertCustomAudiences/generated-types.js +3 -0
- package/dist/destinations/rokt-audiences/upsertCustomAudiences/generated-types.js.map +1 -0
- package/dist/destinations/rokt-audiences/upsertCustomAudiences/index.d.ts +5 -0
- package/dist/destinations/rokt-audiences/upsertCustomAudiences/index.js +69 -0
- package/dist/destinations/rokt-audiences/upsertCustomAudiences/index.js.map +1 -0
- package/package.json +4 -4
|
@@ -1,11 +1,211 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
7
|
+
const constants_1 = require("../constants");
|
|
8
|
+
const pinterest_capi_custom_data_1 = require("../pinterest-capi-custom-data");
|
|
9
|
+
const pinterset_capi_user_data_1 = require("../pinterset-capi-user-data");
|
|
10
|
+
const isEmpty_1 = __importDefault(require("lodash/isEmpty"));
|
|
11
|
+
const dayjs_1 = __importDefault(require("../../../lib/dayjs"));
|
|
3
12
|
const action = {
|
|
4
13
|
title: 'Report Conversion Event',
|
|
5
14
|
description: 'TODO',
|
|
6
|
-
fields: {
|
|
7
|
-
|
|
15
|
+
fields: {
|
|
16
|
+
event_name: {
|
|
17
|
+
label: 'Event Name',
|
|
18
|
+
description: 'The conversion event type. For custom events, you must use the predefined event name "custom". Please refer to the possible event types in [Pinterest API docs](https://developers.pinterest.com/docs/api/v5/#operation/events/create).',
|
|
19
|
+
type: 'string',
|
|
20
|
+
required: true,
|
|
21
|
+
choices: [
|
|
22
|
+
{ label: 'Add to Cart', value: 'add_to_cart' },
|
|
23
|
+
{ label: 'Checkout', value: 'checkout' },
|
|
24
|
+
{ label: 'Lead', value: 'lead' },
|
|
25
|
+
{ label: 'Page Visit', value: 'page_visit' },
|
|
26
|
+
{ label: 'Search', value: 'search' },
|
|
27
|
+
{ label: 'Sign Up', value: 'sign_up' },
|
|
28
|
+
{ label: 'View Category', value: 'view_category' },
|
|
29
|
+
{ label: 'Watch Video', value: 'watch_video' }
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
action_source: {
|
|
33
|
+
label: 'Action Source',
|
|
34
|
+
description: 'The source indicating where the conversion event occurred. This must be app_android, app_ios , web or offline.',
|
|
35
|
+
type: 'string',
|
|
36
|
+
required: true,
|
|
37
|
+
choices: [
|
|
38
|
+
{ label: 'App Android', value: 'app_android' },
|
|
39
|
+
{ label: 'App IOS', value: 'app_ios' },
|
|
40
|
+
{ label: 'Web', value: 'web' },
|
|
41
|
+
{ label: 'Offline', value: 'offline' }
|
|
42
|
+
],
|
|
43
|
+
default: 'web'
|
|
44
|
+
},
|
|
45
|
+
event_time: {
|
|
46
|
+
label: 'Event Timestamp',
|
|
47
|
+
description: 'Device IDs can be used to add and remove only anonymous users to/from a cohort. However, users with an assigned User ID cannot use Device ID to sync to a cohort.',
|
|
48
|
+
type: 'string',
|
|
49
|
+
required: true,
|
|
50
|
+
default: {
|
|
51
|
+
'@path': '$.timestamp'
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
event_id: {
|
|
55
|
+
label: 'Event ID',
|
|
56
|
+
description: 'A unique id string that identifies this event and can be used for deduping between events ingested via both the conversion API and Pinterest tracking.',
|
|
57
|
+
type: 'string',
|
|
58
|
+
required: true,
|
|
59
|
+
default: {
|
|
60
|
+
'@path': '$.messageId'
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
event_source_url: {
|
|
64
|
+
label: 'Event Source URL',
|
|
65
|
+
description: 'URL of the web conversion event.',
|
|
66
|
+
type: 'string',
|
|
67
|
+
default: {
|
|
68
|
+
'@path': '$.context.page.url'
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
opt_out: {
|
|
72
|
+
label: 'Opt Out',
|
|
73
|
+
description: 'When action_source is web or offline, it defines whether the user has opted out of tracking for web conversion events. While when action_source is app_android or app_ios, it defines whether the user has enabled Limit Ad Tracking on their iOS device, or opted out of Ads Personalization on their Android device.',
|
|
74
|
+
type: 'boolean',
|
|
75
|
+
default: true
|
|
76
|
+
},
|
|
77
|
+
user_data: pinterset_capi_user_data_1.user_data_field,
|
|
78
|
+
custom_data: pinterest_capi_custom_data_1.custom_data_field,
|
|
79
|
+
app_id: {
|
|
80
|
+
label: 'App ID',
|
|
81
|
+
description: 'The app store app ID.',
|
|
82
|
+
type: 'string',
|
|
83
|
+
default: {
|
|
84
|
+
'@path': 'context.app.id'
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
app_name: {
|
|
88
|
+
label: 'App Name',
|
|
89
|
+
description: 'Name of the app. ',
|
|
90
|
+
type: 'string',
|
|
91
|
+
required: true,
|
|
92
|
+
default: {
|
|
93
|
+
'@path': '$.context.app.name'
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
app_version: {
|
|
97
|
+
label: 'App Version',
|
|
98
|
+
description: 'Version of the app.',
|
|
99
|
+
type: 'string',
|
|
100
|
+
default: {
|
|
101
|
+
'@path': '$.context.app.version'
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
device_brand: {
|
|
105
|
+
label: 'Device Brand',
|
|
106
|
+
description: 'Brand of the user device.',
|
|
107
|
+
type: 'string',
|
|
108
|
+
default: {
|
|
109
|
+
'@path': '$.context.device.brand'
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
device_carrier: {
|
|
113
|
+
label: 'Device Carrier',
|
|
114
|
+
description: 'User device’s mobile carrier. ',
|
|
115
|
+
type: 'string',
|
|
116
|
+
default: {
|
|
117
|
+
'@path': 'context.device.carrier'
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
device_model: {
|
|
121
|
+
label: 'Device Model',
|
|
122
|
+
description: 'Model of the user device.',
|
|
123
|
+
type: 'string',
|
|
124
|
+
default: {
|
|
125
|
+
'@path': '$.context.device.model'
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
device_type: {
|
|
129
|
+
label: 'Device Type',
|
|
130
|
+
description: 'Type of the user device.',
|
|
131
|
+
type: 'string',
|
|
132
|
+
default: {
|
|
133
|
+
'@path': '$.context.device.type'
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
os_version: {
|
|
137
|
+
label: 'OS Version',
|
|
138
|
+
description: 'Version of the device operating system.',
|
|
139
|
+
type: 'string',
|
|
140
|
+
default: {
|
|
141
|
+
'@path': '$.context.os.version'
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
wifi: {
|
|
145
|
+
label: 'Wifi',
|
|
146
|
+
description: 'Whether the event occurred when the user device was connected to wifi.',
|
|
147
|
+
type: 'boolean',
|
|
148
|
+
default: {
|
|
149
|
+
'@path': '$.context.network.wifi'
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
language: {
|
|
153
|
+
label: 'Language',
|
|
154
|
+
description: "Two-character ISO-639-1 language code indicating the user's language.",
|
|
155
|
+
type: 'string'
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
perform: async (request, { settings, payload }) => {
|
|
159
|
+
return processPayload(request, settings, payload);
|
|
8
160
|
}
|
|
9
161
|
};
|
|
162
|
+
async function processPayload(request, settings, payload) {
|
|
163
|
+
if (isEmpty_1.default(payload.user_data?.email) &&
|
|
164
|
+
isEmpty_1.default(payload.user_data?.hashed_maids) &&
|
|
165
|
+
!(payload.user_data?.client_ip_address && payload.user_data?.client_user_agent)) {
|
|
166
|
+
throw new actions_core_1.IntegrationError(`User data must contain values for Email or Phone Number or Mobile Ad Identifier or both IP Address and User Agent fields`, 'Misconfigured required field', 400);
|
|
167
|
+
}
|
|
168
|
+
const data = createPinterestPayload(payload);
|
|
169
|
+
return request(`https://api.pinterest.com/${constants_1.API_VERSION}/ad_accounts/${settings.ad_account_id}/events`, {
|
|
170
|
+
method: 'POST',
|
|
171
|
+
json: {
|
|
172
|
+
data: data
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
function createPinterestPayload(payload) {
|
|
177
|
+
return [
|
|
178
|
+
{
|
|
179
|
+
event_name: payload.event_name,
|
|
180
|
+
action_source: payload.action_source,
|
|
181
|
+
event_time: dayjs_1.default.utc(payload.event_time).unix(),
|
|
182
|
+
event_id: payload.event_id,
|
|
183
|
+
event_source_url: payload.event_source_url,
|
|
184
|
+
partner_name: constants_1.PARTNER_NAME,
|
|
185
|
+
opt_out: payload.opt_out,
|
|
186
|
+
user_data: pinterset_capi_user_data_1.hash_user_data({ user_data: payload.user_data }),
|
|
187
|
+
custom_data: {
|
|
188
|
+
currency: payload?.custom_data?.currency,
|
|
189
|
+
value: payload?.custom_data?.value,
|
|
190
|
+
content_ids: payload.custom_data?.content_ids,
|
|
191
|
+
contents: payload.custom_data?.contents,
|
|
192
|
+
num_items: payload.custom_data?.num_items,
|
|
193
|
+
order_id: payload.custom_data?.order_id,
|
|
194
|
+
search_string: payload.custom_data?.search_string,
|
|
195
|
+
opt_out_type: payload.custom_data?.opt_out_type
|
|
196
|
+
},
|
|
197
|
+
app_id: payload.app_id,
|
|
198
|
+
app_name: payload.app_name,
|
|
199
|
+
app_version: payload.app_version,
|
|
200
|
+
device_brand: payload.device_brand,
|
|
201
|
+
device_carrier: payload.device_carrier,
|
|
202
|
+
device_model: payload.device_model,
|
|
203
|
+
device_type: payload.device_type,
|
|
204
|
+
os_version: payload.os_version,
|
|
205
|
+
wifi: payload.wifi,
|
|
206
|
+
language: payload.language
|
|
207
|
+
}
|
|
208
|
+
];
|
|
209
|
+
}
|
|
10
210
|
exports.default = action;
|
|
11
211
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/pinterest-conversions/reportConversionEvent/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/pinterest-conversions/reportConversionEvent/index.ts"],"names":[],"mappings":";;;;;AACA,wDAAwD;AACxD,4CAAwD;AAExD,8EAAiE;AACjE,0EAA6E;AAE7E,6DAAoC;AACpC,+DAAsC;AAEtC,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,yBAAyB;IAChC,WAAW,EAAE,MAAM;IACnB,MAAM,EAAE;QACN,UAAU,EAAE;YACV,KAAK,EAAE,YAAY;YACnB,WAAW,EACT,yOAAyO;YAC3O,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,EAAE;gBAC9C,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE;gBACxC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;gBAChC,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE;gBAC5C,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EA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|
+
INCLUDE: 'include',
|
|
6
|
+
EXCLUDE: 'exclude',
|
|
7
|
+
ROKT_API_BASE_URL: 'https://data.stage.rokt.com/api/1.0',
|
|
8
|
+
ROKT_API_CUSTOM_AUDIENCE_ENDPOINT: '/import/suppression',
|
|
9
|
+
ROKT_API_AUTH_ENDPOINT: '/auth-check',
|
|
10
|
+
SUPPORTED_SEGMENT_COMPUTATION_ACTION: 'audience'
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/destinations/rokt-audiences/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,SAAS,GAAG;IAEvB,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,iBAAiB,EAAE,qCAAqC;IACxD,iCAAiC,EAAE,qBAAqB;IACxD,sBAAsB,EAAE,aAAa;IAGrC,oCAAoC,EAAE,UAAU;CACjD,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../src/destinations/rokt-audiences/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,58 @@
|
|
|
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 actions_core_2 = require("@segment/actions-core");
|
|
8
|
+
const upsertCustomAudiences_1 = __importDefault(require("./upsertCustomAudiences"));
|
|
9
|
+
const constants_1 = require("./constants");
|
|
10
|
+
const destination = {
|
|
11
|
+
name: 'Rokt Audiences (Actions)',
|
|
12
|
+
slug: 'actions-rokt-audiences',
|
|
13
|
+
mode: 'cloud',
|
|
14
|
+
description: `
|
|
15
|
+
This destination allows user to engage audiences using Rokt public API.
|
|
16
|
+
User can connect Rokt Audiences (Actions) as a destination to their Engage Audience in segment,
|
|
17
|
+
which will create/update custom audiences in the Rokt data platform.
|
|
18
|
+
`,
|
|
19
|
+
authentication: {
|
|
20
|
+
scheme: 'custom',
|
|
21
|
+
fields: {
|
|
22
|
+
apiKey: {
|
|
23
|
+
label: 'API Key provided by Rokt integration',
|
|
24
|
+
description: 'APIKey used for Rokt API authorization before sending custom audiences data',
|
|
25
|
+
type: 'password',
|
|
26
|
+
required: true
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
testAuthentication: async (request, { settings }) => {
|
|
30
|
+
const res = await request(constants_1.CONSTANTS.ROKT_API_BASE_URL + constants_1.CONSTANTS.ROKT_API_AUTH_ENDPOINT, {
|
|
31
|
+
method: 'GET',
|
|
32
|
+
headers: {
|
|
33
|
+
Authorization: `${settings.apiKey}`
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
if (res.status !== 200)
|
|
37
|
+
throw new actions_core_1.InvalidAuthenticationError('Authentication using Rokt ApiKey failed');
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
extendRequest({ settings }) {
|
|
41
|
+
return {
|
|
42
|
+
headers: { Authorization: `${settings.apiKey}` }
|
|
43
|
+
};
|
|
44
|
+
},
|
|
45
|
+
actions: {
|
|
46
|
+
upsertCustomAudiences: upsertCustomAudiences_1.default
|
|
47
|
+
},
|
|
48
|
+
presets: [
|
|
49
|
+
{
|
|
50
|
+
name: 'Sync Engage Audience to Rokt',
|
|
51
|
+
subscribe: 'type = "track" or type = "identify"',
|
|
52
|
+
partnerAction: 'upsertCustomAudiences',
|
|
53
|
+
mapping: actions_core_2.defaultValues(upsertCustomAudiences_1.default.fields)
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
};
|
|
57
|
+
exports.default = destination;
|
|
58
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":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,kBAAe,WAAW,CAAA"}
|
package/dist/destinations/rokt-audiences/upsertCustomAudiences/custom-audience-operations.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { RequestClient } from '@segment/actions-core';
|
|
2
|
+
import type { Payload } from './generated-types';
|
|
3
|
+
declare function processPayload(request: RequestClient, events: Payload[]): Promise<import("@segment/actions-core").ModifiedResponse<unknown>[]>;
|
|
4
|
+
export { processPayload };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.processPayload = void 0;
|
|
4
|
+
const constants_1 = require("../constants");
|
|
5
|
+
const getCustomAudienceOperations = (payload) => {
|
|
6
|
+
const audience_map = new Map([]);
|
|
7
|
+
for (const p of payload) {
|
|
8
|
+
if (p.segment_computation_action != constants_1.CONSTANTS.SUPPORTED_SEGMENT_COMPUTATION_ACTION) {
|
|
9
|
+
continue;
|
|
10
|
+
}
|
|
11
|
+
let action_map = new Map([
|
|
12
|
+
[constants_1.CONSTANTS.INCLUDE, []],
|
|
13
|
+
[constants_1.CONSTANTS.EXCLUDE, []]
|
|
14
|
+
]);
|
|
15
|
+
const existing_action_map_for_audience = audience_map.get(p.custom_audience_name);
|
|
16
|
+
if (existing_action_map_for_audience !== undefined) {
|
|
17
|
+
action_map = existing_action_map_for_audience;
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
audience_map.set(p.custom_audience_name, action_map);
|
|
21
|
+
}
|
|
22
|
+
if (p.traits_or_props[p.custom_audience_name] === true) {
|
|
23
|
+
action_map.get(constants_1.CONSTANTS.INCLUDE)?.push(p.email);
|
|
24
|
+
}
|
|
25
|
+
else if (p.traits_or_props[p.custom_audience_name] === false) {
|
|
26
|
+
action_map.get(constants_1.CONSTANTS.EXCLUDE)?.push(p.email);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
const custom_audience_ops = [];
|
|
30
|
+
audience_map.forEach((action_map_values, list) => {
|
|
31
|
+
action_map_values.forEach((emails, action) => {
|
|
32
|
+
const custom_audience_op = {
|
|
33
|
+
list: list,
|
|
34
|
+
action: action,
|
|
35
|
+
emails: emails
|
|
36
|
+
};
|
|
37
|
+
custom_audience_ops.push(custom_audience_op);
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
return custom_audience_ops;
|
|
41
|
+
};
|
|
42
|
+
async function processPayload(request, events) {
|
|
43
|
+
const custom_audience_ops = getCustomAudienceOperations(events);
|
|
44
|
+
const promises = [];
|
|
45
|
+
for (const op of custom_audience_ops) {
|
|
46
|
+
if (op.emails.length > 0) {
|
|
47
|
+
promises.push(request(constants_1.CONSTANTS.ROKT_API_BASE_URL + constants_1.CONSTANTS.ROKT_API_CUSTOM_AUDIENCE_ENDPOINT, {
|
|
48
|
+
method: 'POST',
|
|
49
|
+
json: op
|
|
50
|
+
}));
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return await Promise.all(promises);
|
|
54
|
+
}
|
|
55
|
+
exports.processPayload = processPayload;
|
|
56
|
+
//# sourceMappingURL=custom-audience-operations.js.map
|
package/dist/destinations/rokt-audiences/upsertCustomAudiences/custom-audience-operations.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom-audience-operations.js","sourceRoot":"","sources":["../../../../src/destinations/rokt-audiences/upsertCustomAudiences/custom-audience-operations.ts"],"names":[],"mappings":";;;AAGA,4CAAwC;AAmBxC,MAAM,2BAA2B,GAAG,CAAC,OAAkB,EAA6B,EAAE;IAGpF,MAAM,YAAY,GAAG,IAAI,GAAG,CAAgC,EAAE,CAAC,CAAA;IAC/D,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE;QACvB,IAAI,CAAC,CAAC,0BAA0B,IAAI,qBAAS,CAAC,oCAAoC,EAAE;YAElF,SAAQ;SACT;QAED,IAAI,UAAU,GAAG,IAAI,GAAG,CAAmB;YACzC,CAAC,qBAAS,CAAC,OAAO,EA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,2BAA2B,CAAC,MAAM,CAAC,CAAA;IAC1F,MAAM,QAAQ,GAAG,EAAE,CAAA;IAEnB,KAAK,MAAM,EAAE,IAAI,mBAAmB,EAAE;QACpC,IAAI,EAAE,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;YAGxB,QAAQ,CAAC,IAAI,CACX,OAAO,CAAC,qBAAS,CAAC,iBAAiB,GAAG,qBAAS,CAAC,iCAAiC,EAAE;gBACjF,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,EAAE;aACT,CAAC,CACH,CAAA;SACF;KACF;IAED,OAAO,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;AACpC,CAAC;AAEQ,wCAAc"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/rokt-audiences/upsertCustomAudiences/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const custom_audience_operations_1 = require("./custom-audience-operations");
|
|
4
|
+
const action = {
|
|
5
|
+
title: 'Sync Engage Audience to Rokt',
|
|
6
|
+
description: 'Add/Remove users from Rokt custom audience list. Both identify() and track() calls are supported',
|
|
7
|
+
defaultSubscription: 'type = "track" or type = "identify"',
|
|
8
|
+
fields: {
|
|
9
|
+
custom_audience_name: {
|
|
10
|
+
label: 'Custom Audience Name',
|
|
11
|
+
description: 'Name of custom audience list to which emails should added/removed',
|
|
12
|
+
type: 'string',
|
|
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 action is an 'Engage-Audience'",
|
|
21
|
+
type: 'string',
|
|
22
|
+
required: true,
|
|
23
|
+
default: {
|
|
24
|
+
'@path': '$.context.personas.computation_class'
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
email: {
|
|
28
|
+
label: 'Email',
|
|
29
|
+
description: "User's email address for including/excluding from custom audience",
|
|
30
|
+
type: 'string',
|
|
31
|
+
format: 'email',
|
|
32
|
+
required: true,
|
|
33
|
+
default: {
|
|
34
|
+
'@if': {
|
|
35
|
+
exists: { '@path': '$.context.traits.email' },
|
|
36
|
+
then: { '@path': '$.context.traits.email' },
|
|
37
|
+
else: { '@path': '$.traits.email' }
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
traits_or_props: {
|
|
42
|
+
label: 'traits or properties object',
|
|
43
|
+
description: 'Object which will be computed differently for track and identify events',
|
|
44
|
+
type: 'object',
|
|
45
|
+
required: true,
|
|
46
|
+
default: {
|
|
47
|
+
'@if': {
|
|
48
|
+
exists: { '@path': '$.properties' },
|
|
49
|
+
then: { '@path': '$.properties' },
|
|
50
|
+
else: { '@path': '$.traits' }
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
enable_batching: {
|
|
55
|
+
type: 'boolean',
|
|
56
|
+
label: 'enable batching to rokt api',
|
|
57
|
+
description: 'Set as true to ensure Segment infrastructure uses batching when possible.',
|
|
58
|
+
default: true
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
perform: (request, { payload }) => {
|
|
62
|
+
return custom_audience_operations_1.processPayload(request, [payload]);
|
|
63
|
+
},
|
|
64
|
+
performBatch: (request, { payload }) => {
|
|
65
|
+
return custom_audience_operations_1.processPayload(request, payload);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
exports.default = action;
|
|
69
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/rokt-audiences/upsertCustomAudiences/index.ts"],"names":[],"mappings":";;AAIA,6EAA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E,2EAA2E;YACxF,OAAO,EAAE,IAAI;SACd;KACF;IAED,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QAChC,OAAO,2CAAc,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,CAAC,CAAA;IAC3C,CAAC;IAED,YAAY,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QACrC,OAAO,2CAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;IACzC,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.
|
|
4
|
+
"version": "3.148.1-REPLACEDIRECTIVE.3+4bc69d74",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/segmentio/action-destinations",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@amplitude/ua-parser-js": "^0.7.25",
|
|
41
41
|
"@segment/a1-notation": "^2.1.4",
|
|
42
|
-
"@segment/actions-core": "^3.
|
|
43
|
-
"@segment/actions-shared": "^1.
|
|
42
|
+
"@segment/actions-core": "^3.59.1-REPLACEDIRECTIVE.3+4bc69d74",
|
|
43
|
+
"@segment/actions-shared": "^1.41.1-REPLACEDIRECTIVE.3+4bc69d74",
|
|
44
44
|
"@types/node": "^18.11.15",
|
|
45
45
|
"cheerio": "^1.0.0-rc.10",
|
|
46
46
|
"dayjs": "^1.10.7",
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"lcov"
|
|
69
69
|
]
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "4bc69d741417d449491a180ccc24eeeb414a10bb"
|
|
72
72
|
}
|