@segment/action-destinations 3.424.0 → 3.426.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/cordial-client.js +8 -1
- package/dist/destinations/cordial/cordial-client.js.map +1 -1
- package/dist/destinations/cordial/upsertOrder/generated-types.d.ts +4 -0
- package/dist/destinations/cordial/upsertOrder/index.js +29 -0
- package/dist/destinations/cordial/upsertOrder/index.js.map +1 -1
- package/dist/destinations/index.js +2 -1
- package/dist/destinations/index.js.map +1 -1
- package/dist/destinations/kafka/send/index.js +1 -1
- package/dist/destinations/kafka/send/index.js.map +1 -1
- package/dist/destinations/kafka/utils.d.ts +3 -2
- package/dist/destinations/kafka/utils.js +34 -64
- package/dist/destinations/kafka/utils.js.map +1 -1
- package/dist/destinations/klaviyo/functions.d.ts +3 -3
- package/dist/destinations/klaviyo/functions.js +28 -21
- package/dist/destinations/klaviyo/functions.js.map +1 -1
- package/dist/destinations/klaviyo/types.d.ts +5 -3
- package/dist/destinations/klaviyo/types.js.map +1 -1
- package/dist/destinations/klaviyo/upsertProfile/index.js +25 -32
- package/dist/destinations/klaviyo/upsertProfile/index.js.map +1 -1
- package/dist/destinations/ms-bing-ads-audiences/generated-types.d.ts +2 -0
- package/dist/destinations/ms-bing-ads-audiences/generated-types.js +3 -0
- package/dist/destinations/ms-bing-ads-audiences/generated-types.js.map +1 -0
- package/dist/destinations/ms-bing-ads-audiences/index.d.ts +4 -0
- package/dist/destinations/ms-bing-ads-audiences/index.js +34 -0
- package/dist/destinations/ms-bing-ads-audiences/index.js.map +1 -0
- package/dist/destinations/ms-bing-ads-audiences/syncAudiences/generated-types.d.ts +2 -0
- package/dist/destinations/ms-bing-ads-audiences/syncAudiences/generated-types.js +3 -0
- package/dist/destinations/ms-bing-ads-audiences/syncAudiences/generated-types.js.map +1 -0
- package/dist/destinations/ms-bing-ads-audiences/syncAudiences/index.d.ts +5 -0
- package/dist/destinations/ms-bing-ads-audiences/syncAudiences/index.js +15 -0
- package/dist/destinations/ms-bing-ads-audiences/syncAudiences/index.js.map +1 -0
- package/dist/destinations/ms-bing-capi/constants.d.ts +2 -0
- package/dist/destinations/ms-bing-capi/constants.js +186 -0
- package/dist/destinations/ms-bing-capi/constants.js.map +1 -0
- package/dist/destinations/ms-bing-capi/fields.d.ts +6 -0
- package/dist/destinations/ms-bing-capi/fields.js +336 -0
- package/dist/destinations/ms-bing-capi/fields.js.map +1 -0
- package/dist/destinations/ms-bing-capi/generated-types.d.ts +2 -0
- package/dist/destinations/ms-bing-capi/index.js +37 -2
- package/dist/destinations/ms-bing-capi/index.js.map +1 -1
- package/dist/destinations/ms-bing-capi/pageLoad/generated-types.d.ts +56 -0
- package/dist/destinations/ms-bing-capi/pageLoad/generated-types.js +3 -0
- package/dist/destinations/ms-bing-capi/pageLoad/generated-types.js.map +1 -0
- package/dist/destinations/ms-bing-capi/pageLoad/index.d.ts +5 -0
- package/dist/destinations/ms-bing-capi/pageLoad/index.js +44 -0
- package/dist/destinations/ms-bing-capi/pageLoad/index.js.map +1 -0
- package/dist/destinations/ms-bing-capi/sendEvent/generated-types.d.ts +54 -0
- package/dist/destinations/ms-bing-capi/sendEvent/index.js +35 -3
- package/dist/destinations/ms-bing-capi/sendEvent/index.js.map +1 -1
- package/dist/destinations/ms-bing-capi/sendEvent/types.d.ts +13 -0
- package/dist/destinations/ms-bing-capi/sendEvent/types.js +3 -0
- package/dist/destinations/ms-bing-capi/sendEvent/types.js.map +1 -0
- package/dist/destinations/ms-bing-capi/sendEvent/utils.d.ts +4 -0
- package/dist/destinations/ms-bing-capi/sendEvent/utils.js +8 -0
- package/dist/destinations/ms-bing-capi/sendEvent/utils.js.map +1 -0
- package/dist/destinations/taguchi/syncUserProfile/fields.js +1 -1
- package/dist/destinations/taguchi/syncUserProfile/fields.js.map +1 -1
- package/dist/destinations/twilio-messaging/sendMessage/fields.js +2 -2
- package/dist/destinations/twilio-messaging/sendMessage/fields.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.customData = exports.hotelData = exports.items = exports.data = exports.userData = void 0;
|
|
4
|
+
const utils_1 = require("./sendEvent/utils");
|
|
5
|
+
exports.userData = {
|
|
6
|
+
label: 'User Data',
|
|
7
|
+
description: 'A list of user identifiers associated with the event.',
|
|
8
|
+
type: 'object',
|
|
9
|
+
required: true,
|
|
10
|
+
properties: {
|
|
11
|
+
clientUserAgent: {
|
|
12
|
+
label: 'Client User Agent',
|
|
13
|
+
description: 'User agent string of the client device.',
|
|
14
|
+
type: 'string'
|
|
15
|
+
},
|
|
16
|
+
anonymousId: {
|
|
17
|
+
label: 'Anonymous ID',
|
|
18
|
+
description: 'Guest user anonymous ID.',
|
|
19
|
+
type: 'string'
|
|
20
|
+
},
|
|
21
|
+
externalId: {
|
|
22
|
+
label: 'External ID',
|
|
23
|
+
description: 'Authenticated user id (anonymized) if user is logged in. Also used for ID sync',
|
|
24
|
+
type: 'string'
|
|
25
|
+
},
|
|
26
|
+
em: {
|
|
27
|
+
label: 'Email',
|
|
28
|
+
description: 'Email address of the user. Accepts a clear text or hashed email address. Segment will ensure the email address is hashed before sending to Bing Ads.',
|
|
29
|
+
type: 'string'
|
|
30
|
+
},
|
|
31
|
+
ph: {
|
|
32
|
+
label: 'Phone',
|
|
33
|
+
description: 'Phone number of the user. Accepts a clear text or hashed phone number. Segment will ensure the phone number is hashed before sending to Bing Ads.',
|
|
34
|
+
type: 'string'
|
|
35
|
+
},
|
|
36
|
+
clientIpAddress: {
|
|
37
|
+
label: 'Client IP Address',
|
|
38
|
+
description: 'IP address of the client device.',
|
|
39
|
+
type: 'string'
|
|
40
|
+
},
|
|
41
|
+
msclkid: {
|
|
42
|
+
label: 'MSCLKID',
|
|
43
|
+
description: 'Microsoft Last Click ID.',
|
|
44
|
+
type: 'string'
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
default: {
|
|
48
|
+
clientUserAgent: { '@path': '$.context.userAgent' },
|
|
49
|
+
anonymousId: { '@path': '$.anonymousId' },
|
|
50
|
+
externalId: { '@path': '$.userId' },
|
|
51
|
+
em: {
|
|
52
|
+
'@if': {
|
|
53
|
+
exists: { '@path': '$.context.traits.email' },
|
|
54
|
+
then: { '@path': '$.context.traits.email' },
|
|
55
|
+
else: { '@path': '$.properties.email' }
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
ph: {
|
|
59
|
+
'@if': {
|
|
60
|
+
exists: { '@path': '$.context.traits.phone' },
|
|
61
|
+
then: { '@path': '$.context.traits.phone' },
|
|
62
|
+
else: { '@path': '$.properties.phone' }
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
clientIpAddress: { '@path': '$.context.ip' },
|
|
66
|
+
msclkid: {
|
|
67
|
+
'@if': {
|
|
68
|
+
exists: { '@path': '$.properties.msclkid' },
|
|
69
|
+
then: { '@path': '$.properties.msclkid' },
|
|
70
|
+
else: { '@path': '$.integrations.Ms Bing Capi.msclkid' }
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
exports.data = {
|
|
76
|
+
label: 'Data',
|
|
77
|
+
description: 'TODO - description for this field',
|
|
78
|
+
type: 'object',
|
|
79
|
+
required: true,
|
|
80
|
+
properties: {
|
|
81
|
+
eventType: {
|
|
82
|
+
label: 'Event Type',
|
|
83
|
+
description: 'The type of event being sent to the Bing API.',
|
|
84
|
+
type: 'string',
|
|
85
|
+
required: true,
|
|
86
|
+
choices: [
|
|
87
|
+
{ label: 'Page Load', value: 'pageLoad' },
|
|
88
|
+
{ label: 'Custom', value: 'custom' }
|
|
89
|
+
]
|
|
90
|
+
},
|
|
91
|
+
eventId: {
|
|
92
|
+
label: 'Event ID',
|
|
93
|
+
description: 'EventID for deduplication. Defaults to the Segment messageId.',
|
|
94
|
+
type: 'string'
|
|
95
|
+
},
|
|
96
|
+
eventName: {
|
|
97
|
+
label: 'Event Name',
|
|
98
|
+
description: 'Event action for custom conversion goals, if used.',
|
|
99
|
+
type: 'string'
|
|
100
|
+
},
|
|
101
|
+
eventTime: {
|
|
102
|
+
label: 'Event Time',
|
|
103
|
+
description: 'The time the event occurred.',
|
|
104
|
+
type: 'string',
|
|
105
|
+
required: true
|
|
106
|
+
},
|
|
107
|
+
eventSourceUrl: {
|
|
108
|
+
label: 'Event Source URL',
|
|
109
|
+
description: 'URL of the page, used for example: “destination URL” goals. Required for pageLoad events.',
|
|
110
|
+
type: 'string',
|
|
111
|
+
required: {
|
|
112
|
+
conditions: [{ fieldKey: 'eventDetails.eventType', operator: 'is', value: 'pageLoad' }]
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
pageLoadId: {
|
|
116
|
+
label: 'Page Load ID',
|
|
117
|
+
description: 'Page load id that links to 0+ custom events from the same page. Format as a v4 UUID. ',
|
|
118
|
+
type: 'string'
|
|
119
|
+
},
|
|
120
|
+
referrerUrl: {
|
|
121
|
+
label: 'Referrer URL',
|
|
122
|
+
description: 'Referrer of the page, used for example: "referral" remarketing lists.',
|
|
123
|
+
type: 'string'
|
|
124
|
+
},
|
|
125
|
+
pageTitle: {
|
|
126
|
+
label: 'Page Title',
|
|
127
|
+
description: 'Title of the page.',
|
|
128
|
+
type: 'string'
|
|
129
|
+
},
|
|
130
|
+
keywords: {
|
|
131
|
+
label: 'Keywords',
|
|
132
|
+
description: 'Page keywords - SEO meta keyworls.',
|
|
133
|
+
type: 'string'
|
|
134
|
+
},
|
|
135
|
+
userData: {
|
|
136
|
+
label: 'User Data',
|
|
137
|
+
type: 'object'
|
|
138
|
+
},
|
|
139
|
+
customData: {
|
|
140
|
+
label: 'Custom Data',
|
|
141
|
+
type: 'object'
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
default: {
|
|
145
|
+
eventType: { '@path': '$.properties.event_type' },
|
|
146
|
+
eventId: { '@path': '$.messageId' },
|
|
147
|
+
eventName: { '@path': '$.event' },
|
|
148
|
+
eventSourceUrl: { '@path': '$.context.page.url' },
|
|
149
|
+
pageLoadId: { '@path': '$.properties.page_load_id' },
|
|
150
|
+
referrerUrl: { '@path': '$.context.page.referrer' },
|
|
151
|
+
pageTitle: { '@path': '$.context.page.title' },
|
|
152
|
+
keywords: { '@path': '$.properties.keywords' }
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
exports.items = {
|
|
156
|
+
label: 'Items',
|
|
157
|
+
description: 'The list of items associated with the event. Must contain at least one item.',
|
|
158
|
+
type: 'object',
|
|
159
|
+
multiple: true,
|
|
160
|
+
required: false,
|
|
161
|
+
properties: {
|
|
162
|
+
id: {
|
|
163
|
+
label: 'Item ID',
|
|
164
|
+
description: 'The unique identifier for the item.',
|
|
165
|
+
type: 'string'
|
|
166
|
+
},
|
|
167
|
+
name: {
|
|
168
|
+
label: 'Item Name',
|
|
169
|
+
description: 'The name of the item.',
|
|
170
|
+
type: 'string'
|
|
171
|
+
},
|
|
172
|
+
price: {
|
|
173
|
+
label: 'Item Price',
|
|
174
|
+
description: 'The price of the item, after discounts.',
|
|
175
|
+
type: 'integer'
|
|
176
|
+
},
|
|
177
|
+
quantity: {
|
|
178
|
+
label: 'Item Quantity',
|
|
179
|
+
description: 'The quantity of the item.',
|
|
180
|
+
type: 'integer'
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
default: {
|
|
184
|
+
'@arrayPath': [
|
|
185
|
+
'$.properties.products',
|
|
186
|
+
{
|
|
187
|
+
id: { '@path': '$.id' },
|
|
188
|
+
name: { '@path': '$.name' },
|
|
189
|
+
quantity: { '@path': '$.quantity' },
|
|
190
|
+
item_price: { '@path': '$.price' }
|
|
191
|
+
}
|
|
192
|
+
]
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
exports.hotelData = {
|
|
196
|
+
label: 'Hotel Data',
|
|
197
|
+
description: 'Data specific to hotel events.',
|
|
198
|
+
type: 'object',
|
|
199
|
+
properties: {
|
|
200
|
+
totalPrice: {
|
|
201
|
+
label: 'Total Price',
|
|
202
|
+
description: 'Total price of the booking, including taxes and fees.',
|
|
203
|
+
type: 'integer'
|
|
204
|
+
},
|
|
205
|
+
basePrice: {
|
|
206
|
+
label: 'Base Price',
|
|
207
|
+
description: 'Price of the booking, not including taxes or fees.',
|
|
208
|
+
type: 'integer'
|
|
209
|
+
},
|
|
210
|
+
checkInDate: {
|
|
211
|
+
label: 'Check-In Date',
|
|
212
|
+
description: 'The date of check-in for the hotel booking in the format YYYY-MM-DD',
|
|
213
|
+
type: 'string',
|
|
214
|
+
format: 'date-time'
|
|
215
|
+
},
|
|
216
|
+
checkOutDate: {
|
|
217
|
+
label: 'Check-Out Date',
|
|
218
|
+
description: 'The date of check-out for the hotel booking in the format YYYY-MM-DD',
|
|
219
|
+
type: 'string',
|
|
220
|
+
format: 'date-time'
|
|
221
|
+
},
|
|
222
|
+
lengthOfStay: {
|
|
223
|
+
label: 'Length of Stay',
|
|
224
|
+
description: 'The number of nights the booking is for. Not required if you specify hct_checkout_date.',
|
|
225
|
+
type: 'integer'
|
|
226
|
+
},
|
|
227
|
+
partnerHotelId: {
|
|
228
|
+
label: 'Partner Hotel ID',
|
|
229
|
+
description: 'The ID of the hotel as provided by the partner.',
|
|
230
|
+
type: 'string'
|
|
231
|
+
},
|
|
232
|
+
bookingHref: {
|
|
233
|
+
label: 'Booking Href',
|
|
234
|
+
description: 'Encrypted or obfuscated booking refrence number',
|
|
235
|
+
type: 'string'
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
default: {
|
|
239
|
+
totalPrice: { '@path': '$.properties.hotel_total_price' },
|
|
240
|
+
basePrice: { '@path': '$.properties.hotel_base_price' },
|
|
241
|
+
checkInDate: { '@path': '$.properties.hotel_check_in_date' },
|
|
242
|
+
checkOutDate: { '@path': '$.properties.hotel_check_out_date' },
|
|
243
|
+
lengthOfStay: { '@path': '$.properties.hotel_length_of_stay' },
|
|
244
|
+
partnerHotelId: { '@path': '$.properties.hotel_partner_id' },
|
|
245
|
+
bookingHref: { '@path': '$.properties.hotel_booking_href' }
|
|
246
|
+
}
|
|
247
|
+
};
|
|
248
|
+
exports.customData = {
|
|
249
|
+
label: 'Custom Data',
|
|
250
|
+
description: 'Custom data to be sent to the Bing API. This can include additional properties that are not covered by the standard fields.',
|
|
251
|
+
type: 'object',
|
|
252
|
+
properties: {
|
|
253
|
+
eventCategory: {
|
|
254
|
+
label: 'Event Category',
|
|
255
|
+
description: 'The category for custom conversion goals, if used.',
|
|
256
|
+
type: 'string'
|
|
257
|
+
},
|
|
258
|
+
eventLabel: {
|
|
259
|
+
label: 'Event Label',
|
|
260
|
+
description: 'The label for custom conversion goals.',
|
|
261
|
+
type: 'string'
|
|
262
|
+
},
|
|
263
|
+
eventValue: {
|
|
264
|
+
label: 'Event Value',
|
|
265
|
+
description: 'The event value for custom conversion goals.',
|
|
266
|
+
type: 'number'
|
|
267
|
+
},
|
|
268
|
+
searchTerm: {
|
|
269
|
+
label: 'Search Term',
|
|
270
|
+
description: 'The query used by the user for a search results page.',
|
|
271
|
+
type: 'string'
|
|
272
|
+
},
|
|
273
|
+
transactionId: {
|
|
274
|
+
label: 'Transaction ID',
|
|
275
|
+
description: 'The unique identifier for the transaction. Required for purchase events.',
|
|
276
|
+
type: 'string'
|
|
277
|
+
},
|
|
278
|
+
value: {
|
|
279
|
+
label: 'Value',
|
|
280
|
+
description: 'Revenue value (float) to report variable revenue for goals, if used',
|
|
281
|
+
type: 'number'
|
|
282
|
+
},
|
|
283
|
+
currency: {
|
|
284
|
+
label: 'Currency',
|
|
285
|
+
description: 'The currency of the event value, in ISO 4217 format.',
|
|
286
|
+
type: 'string',
|
|
287
|
+
choices: (0, utils_1.getCurrencyChoices)()
|
|
288
|
+
},
|
|
289
|
+
itemIds: {
|
|
290
|
+
label: 'Item IDs',
|
|
291
|
+
description: 'A comma separated list of product IDs, or an array of IDs.',
|
|
292
|
+
type: 'string',
|
|
293
|
+
multiple: true
|
|
294
|
+
},
|
|
295
|
+
pageType: {
|
|
296
|
+
label: 'Page Type',
|
|
297
|
+
description: 'The type of page where the event occurred.',
|
|
298
|
+
type: 'string',
|
|
299
|
+
choices: [
|
|
300
|
+
{ label: 'Home', value: 'home' },
|
|
301
|
+
{ label: 'Product', value: 'product' },
|
|
302
|
+
{ label: 'Category', value: 'category' },
|
|
303
|
+
{ label: 'Search Results', value: 'searchresults' },
|
|
304
|
+
{ label: 'Cart', value: 'cart' },
|
|
305
|
+
{ label: 'Purchase', value: 'purchase' },
|
|
306
|
+
{ label: 'Other', value: 'other' }
|
|
307
|
+
]
|
|
308
|
+
},
|
|
309
|
+
ecommTotalValue: {
|
|
310
|
+
label: 'Ecomm Total Value',
|
|
311
|
+
description: 'Total value of the cart of purchase.',
|
|
312
|
+
type: 'number'
|
|
313
|
+
},
|
|
314
|
+
ecommCategory: {
|
|
315
|
+
label: 'Ecomm Category',
|
|
316
|
+
description: 'Category ID',
|
|
317
|
+
type: 'string'
|
|
318
|
+
},
|
|
319
|
+
items: exports.items,
|
|
320
|
+
hotelData: exports.hotelData
|
|
321
|
+
},
|
|
322
|
+
default: {
|
|
323
|
+
eventCategory: { '@path': '$.properties.event_category' },
|
|
324
|
+
eventLabel: { '@path': '$.properties.event_label' },
|
|
325
|
+
eventValue: { '@path': '$.properties.value' },
|
|
326
|
+
searchTerm: { '@path': '$.properties.query' },
|
|
327
|
+
transactionId: { '@path': '$.properties.order_id' },
|
|
328
|
+
value: { '@path': '$.properties.value' },
|
|
329
|
+
currency: { '@path': '$.properties.currency' },
|
|
330
|
+
itemIds: { '@path': '$.properties.item_ids' },
|
|
331
|
+
pageType: { '@path': '$.properties.page_type' },
|
|
332
|
+
ecommTotalValue: { '@path': '$.properties.ecomm_total_value' },
|
|
333
|
+
ecommCategory: { '@path': '$.properties.ecomm_category' }
|
|
334
|
+
}
|
|
335
|
+
};
|
|
336
|
+
//# sourceMappingURL=fields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../src/destinations/ms-bing-capi/fields.ts"],"names":[],"mappings":";;;AACA,6CAAsD;AAEzC,QAAA,QAAQ,GAAe;IAClC,KAAK,EAAE,WAAW;IAClB,WAAW,EAAE,uDAAuD;IACpE,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,IAAI;IACd,UAAU,EAAE;QACV,eAAe,EAAE;YACf,KAAK,EAAE,mBAAmB;YAC1B,WAAW,EAAE,yCAAyC;YACtD,IAAI,EAAE,QAAQ;SACf;QACD,WAAW,EAAE;YACX,KAAK,EAAE,cAAc;YACrB,WAAW,EAAE,0BAA0B;YACvC,IAAI,EAAE,QAAQ;SACf;QACD,UAAU,EAAE;YACV,KAAK,EAAE,aAAa;YACpB,WAAW,EAAE,gFAAgF;YAC7F,IAAI,EAAE,QAAQ;SACf;QACD,EAAE,EAAE;YACF,KAAK,EAAE,OAAO;YACd,WAAW,EACT,sJAAsJ;YACxJ,IAAI,EAAE,QAAQ;SACf;QACD,EAAE,EAAE;YACF,KAAK,EAAE,OAAO;YACd,WAAW,EACT,mJAAmJ;YACrJ,IAAI,EAAE,QAAQ;SACf;QACD,eAAe,EAAE;YACf,KAAK,EAAE,mBAAmB;YAC1B,WAAW,EAAE,kCAAkC;YAC/C,IAAI,EAAE,QAAQ;SACf;QACD,OAAO,EAAE;YACP,KAAK,EAAE,SAAS;YAChB,WAAW,EAAE,0BAA0B;YACvC,IAAI,EAAE,QAAQ;SACf;KACF;IACD,OAAO,EAAE;QACP,eAAe,EAAE,EAAE,OAAO,EAAE,qBAAqB,EAAE;QACnD,WAAW,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE;QACzC,UAAU,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;QACnC,EAAE,EAAE;YACF,KAAK,EAAE;gBACL,MAAM,EAAE,EAAE,OAAO,EAAE,wBAAwB,EAAE;gBAC7C,IAAI,EAAE,EAAE,OAAO,EAAE,wBAAwB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ACD,aAAa,EAAE;YACb,KAAK,EAAE,gBAAgB;YACvB,WAAW,EAAE,aAAa;YAC1B,IAAI,EAAE,QAAQ;SACf;QACD,KAAK,EAAE,aAAK;QACZ,SAAS,EAAE,iBAAS;KACrB;IACD,OAAO,EAAE;QACP,aAAa,EAAE,EAAE,OAAO,EAAE,6BAA6B,EAAE;QACzD,UAAU,EAAE,EAAE,OAAO,EAAE,0BAA0B,EAAE;QACnD,UAAU,EAAE,EAAE,OAAO,EAAE,oBAAoB,EAAE;QAC7C,UAAU,EAAE,EAAE,OAAO,EAAE,oBAAoB,EAAE;QAC7C,aAAa,EAAE,EAAE,OAAO,EAAE,uBAAuB,EAAE;QACnD,KAAK,EAAE,EAAE,OAAO,EAAE,oBAAoB,EAAE;QACxC,QAAQ,EAAE,EAAE,OAAO,EAAE,uBAAuB,EAAE;QAC9C,OAAO,EAAE,EAAE,OAAO,EAAE,uBAAuB,EAAE;QAC7C,QAAQ,EAAE,EAAE,OAAO,EAAE,wBAAwB,EAAE;QAC/C,eAAe,EAAE,EAAE,OAAO,EAAE,gCAAgC,EAAE;QAC9D,aAAa,EAAE,EAAE,OAAO,EAAE,6BAA6B,EAAE;KAC1D;CACF,CAAA"}
|
|
@@ -4,12 +4,47 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const sendEvent_1 = __importDefault(require("./sendEvent"));
|
|
7
|
+
const pageLoad_1 = __importDefault(require("./pageLoad"));
|
|
7
8
|
const destination = {
|
|
8
|
-
name: '
|
|
9
|
+
name: 'Microsoft Bing Conversion API',
|
|
9
10
|
slug: 'actions-ms-bing-capi',
|
|
10
11
|
mode: 'cloud',
|
|
12
|
+
authentication: {
|
|
13
|
+
scheme: 'basic',
|
|
14
|
+
fields: {
|
|
15
|
+
UetTag: {
|
|
16
|
+
label: 'Bing UetTag',
|
|
17
|
+
description: 'Your Bing UetTag.',
|
|
18
|
+
type: 'string',
|
|
19
|
+
required: true
|
|
20
|
+
},
|
|
21
|
+
ApiToken: {
|
|
22
|
+
label: 'Bing ApiToken',
|
|
23
|
+
description: 'Your Bing API Token.',
|
|
24
|
+
type: 'string',
|
|
25
|
+
required: true
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
testAuthentication: (_, { settings }) => {
|
|
29
|
+
if (settings.UetTag.length && settings.ApiToken.length) {
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
throw new Error('Invalid AccountID. Please check your AccountID');
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
extendRequest: ({ settings }) => {
|
|
38
|
+
return {
|
|
39
|
+
headers: {
|
|
40
|
+
Authorization: `Bearer ${settings.ApiToken}`,
|
|
41
|
+
'Content-Type': 'application/json'
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
},
|
|
11
45
|
actions: {
|
|
12
|
-
sendEvent: sendEvent_1.default
|
|
46
|
+
sendEvent: sendEvent_1.default,
|
|
47
|
+
pageLoad: pageLoad_1.default
|
|
13
48
|
}
|
|
14
49
|
};
|
|
15
50
|
exports.default = destination;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/ms-bing-capi/index.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/ms-bing-capi/index.ts"],"names":[],"mappings":";;;;;AAEA,4DAAmC;AACnC,0DAAiC;AAEjC,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,+BAA+B;IACrC,IAAI,EAAE,sBAAsB;IAC5B,IAAI,EAAE,OAAO;IACb,cAAc,EAAE;QACd,MAAM,EAAE,OAAO;QACf,MAAM,EAAE;YACN,MAAM,EAAE;gBACN,KAAK,EAAE,aAAa;gBACpB,WAAW,EAAE,mBAAmB;gBAChC,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,QAAQ,EAAE;gBACR,KAAK,EAAE,eAAe;gBACtB,WAAW,EAAE,sBAAsB;gBACnC,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;SACF;QACD,kBAAkB,EAAE,CAAC,CAAC,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;YACtC,IAAI,QAAQ,CAAC,MAAM,CAAC,MAAM,IAAI,QAAQ,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;gBACvD,OAAO,IAAI,CAAA;YACb,CAAC;iBAAM,CAAC;gBACN,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAA;YACnE,CAAC;QACH,CAAC;KACF;IACD,aAAa,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC9B,OAAO;YACL,OAAO,EAAE;gBACP,aAAa,EAAE,UAAU,QAAQ,CAAC,QAAQ,EAAE;gBAC5C,cAAc,EAAE,kBAAkB;aACnC;SACF,CAAA;IACH,CAAC;IACD,OAAO,EAAE;QACP,SAAS,EAAT,mBAAS;QACT,QAAQ,EAAR,kBAAQ;KACT;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export interface Payload {
|
|
2
|
+
data: {
|
|
3
|
+
eventType?: string;
|
|
4
|
+
eventId?: string;
|
|
5
|
+
eventName?: string;
|
|
6
|
+
eventTime?: string;
|
|
7
|
+
eventSourceUrl?: string;
|
|
8
|
+
pageLoadId?: string;
|
|
9
|
+
referrerUrl?: string;
|
|
10
|
+
pageTitle?: string;
|
|
11
|
+
keywords?: string;
|
|
12
|
+
userData?: {
|
|
13
|
+
[k: string]: unknown;
|
|
14
|
+
};
|
|
15
|
+
customData?: {
|
|
16
|
+
[k: string]: unknown;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
userData: {
|
|
20
|
+
clientUserAgent?: string;
|
|
21
|
+
anonymousId?: string;
|
|
22
|
+
externalId?: string;
|
|
23
|
+
em?: string;
|
|
24
|
+
ph?: string;
|
|
25
|
+
clientIpAddress?: string;
|
|
26
|
+
msclkid?: string;
|
|
27
|
+
};
|
|
28
|
+
customData?: {
|
|
29
|
+
eventCategory?: string;
|
|
30
|
+
eventLabel?: string;
|
|
31
|
+
eventValue?: number;
|
|
32
|
+
searchTerm?: string;
|
|
33
|
+
transactionId?: string;
|
|
34
|
+
value?: number;
|
|
35
|
+
currency?: string;
|
|
36
|
+
itemIds?: string[];
|
|
37
|
+
pageType?: string;
|
|
38
|
+
ecommTotalValue?: number;
|
|
39
|
+
ecommCategory?: string;
|
|
40
|
+
items?: {
|
|
41
|
+
id?: string;
|
|
42
|
+
name?: string;
|
|
43
|
+
price?: number;
|
|
44
|
+
quantity?: number;
|
|
45
|
+
}[];
|
|
46
|
+
hotelData?: {
|
|
47
|
+
totalPrice?: number;
|
|
48
|
+
basePrice?: number;
|
|
49
|
+
checkInDate?: string;
|
|
50
|
+
checkOutDate?: string;
|
|
51
|
+
lengthOfStay?: number;
|
|
52
|
+
partnerHotelId?: string;
|
|
53
|
+
bookingHref?: string;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/ms-bing-capi/pageLoad/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const fields_1 = require("../fields");
|
|
4
|
+
const constants_1 = require("../constants");
|
|
5
|
+
const hashing_utils_1 = require("../../../lib/hashing-utils");
|
|
6
|
+
const uuid_1 = require("@lukeed/uuid");
|
|
7
|
+
const action = {
|
|
8
|
+
title: 'Page Load',
|
|
9
|
+
description: 'Send a page load event to Microsoft Bing CAPI.',
|
|
10
|
+
defaultSubscription: 'type = "page"',
|
|
11
|
+
fields: {
|
|
12
|
+
data: fields_1.data,
|
|
13
|
+
userData: fields_1.userData,
|
|
14
|
+
customData: fields_1.customData
|
|
15
|
+
},
|
|
16
|
+
perform: (request, { payload, settings }) => {
|
|
17
|
+
if (payload.data.userData == undefined) {
|
|
18
|
+
payload.data.userData = {
|
|
19
|
+
anonymousId: (0, uuid_1.v4)()
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
if (payload.userData?.em) {
|
|
23
|
+
payload.userData.em = (0, hashing_utils_1.processHashing)(payload.userData.em, 'sha256', 'hex', (value) => value.trim().toLowerCase());
|
|
24
|
+
}
|
|
25
|
+
if (payload.userData?.ph) {
|
|
26
|
+
payload.userData.ph = (0, hashing_utils_1.processHashing)(payload.userData.ph, 'sha256', 'hex', (value) => value.trim().replace(/\D/g, ''));
|
|
27
|
+
}
|
|
28
|
+
if (payload.customData) {
|
|
29
|
+
payload.data.customData = payload.customData;
|
|
30
|
+
}
|
|
31
|
+
if (payload.userData) {
|
|
32
|
+
payload.data.userData = payload.userData;
|
|
33
|
+
}
|
|
34
|
+
const url = `${constants_1.API_URL}${settings.UetTag}/events`;
|
|
35
|
+
return request(url, {
|
|
36
|
+
method: 'post',
|
|
37
|
+
json: {
|
|
38
|
+
data: [payload.data]
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
exports.default = action;
|
|
44
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/ms-bing-capi/pageLoad/index.ts"],"names":[],"mappings":";;AAGA,sCAAuE;AACvE,4CAAsC;AACtC,8DAA2D;AAC3D,uCAA2C;AAE3C,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,WAAW;IAClB,WAAW,EAAE,gDAAgD;IAC7D,mBAAmB,EAAE,eAAe;IACpC,MAAM,EAAE;QACN,IAAI,EAAE,aAAa;QACnB,QAAQ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B,MAAM,EAAE,MAAM;YACd,IAAI,EAAE;gBACJ,IAAI,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;aACrB;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1,2 +1,56 @@
|
|
|
1
1
|
export interface Payload {
|
|
2
|
+
data: {
|
|
3
|
+
eventType?: string;
|
|
4
|
+
eventId?: string;
|
|
5
|
+
eventName?: string;
|
|
6
|
+
eventTime?: string;
|
|
7
|
+
eventSourceUrl?: string;
|
|
8
|
+
pageLoadId?: string;
|
|
9
|
+
referrerUrl?: string;
|
|
10
|
+
pageTitle?: string;
|
|
11
|
+
keywords?: string;
|
|
12
|
+
userData?: {
|
|
13
|
+
[k: string]: unknown;
|
|
14
|
+
};
|
|
15
|
+
customData?: {
|
|
16
|
+
[k: string]: unknown;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
userData: {
|
|
20
|
+
clientUserAgent?: string;
|
|
21
|
+
anonymousId?: string;
|
|
22
|
+
externalId?: string;
|
|
23
|
+
em?: string;
|
|
24
|
+
ph?: string;
|
|
25
|
+
clientIpAddress?: string;
|
|
26
|
+
msclkid?: string;
|
|
27
|
+
};
|
|
28
|
+
customData?: {
|
|
29
|
+
eventCategory?: string;
|
|
30
|
+
eventLabel?: string;
|
|
31
|
+
eventValue?: number;
|
|
32
|
+
searchTerm?: string;
|
|
33
|
+
transactionId?: string;
|
|
34
|
+
value?: number;
|
|
35
|
+
currency?: string;
|
|
36
|
+
itemIds?: string[];
|
|
37
|
+
pageType?: string;
|
|
38
|
+
ecommTotalValue?: number;
|
|
39
|
+
ecommCategory?: string;
|
|
40
|
+
items?: {
|
|
41
|
+
id?: string;
|
|
42
|
+
name?: string;
|
|
43
|
+
price?: number;
|
|
44
|
+
quantity?: number;
|
|
45
|
+
}[];
|
|
46
|
+
hotelData?: {
|
|
47
|
+
totalPrice?: number;
|
|
48
|
+
basePrice?: number;
|
|
49
|
+
checkInDate?: string;
|
|
50
|
+
checkOutDate?: string;
|
|
51
|
+
lengthOfStay?: number;
|
|
52
|
+
partnerHotelId?: string;
|
|
53
|
+
bookingHref?: string;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
2
56
|
}
|
|
@@ -1,10 +1,42 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const fields_1 = require("../fields");
|
|
4
|
+
const constants_1 = require("../constants");
|
|
5
|
+
const hashing_utils_1 = require("../../../lib/hashing-utils");
|
|
6
|
+
const uuid_1 = require("@lukeed/uuid");
|
|
3
7
|
const action = {
|
|
4
8
|
title: 'Send Event',
|
|
5
|
-
description: '',
|
|
6
|
-
|
|
7
|
-
|
|
9
|
+
description: 'Send a track event to Microsoft Bing CAPI.',
|
|
10
|
+
defaultSubscription: 'type = "track"',
|
|
11
|
+
fields: {
|
|
12
|
+
data: fields_1.data,
|
|
13
|
+
userData: fields_1.userData,
|
|
14
|
+
customData: fields_1.customData
|
|
15
|
+
},
|
|
16
|
+
perform: (request, { payload, settings }) => {
|
|
17
|
+
if (payload.userData == undefined) {
|
|
18
|
+
payload.userData = {
|
|
19
|
+
anonymousId: (0, uuid_1.v4)()
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
if (payload.userData?.em) {
|
|
23
|
+
payload.userData.em = (0, hashing_utils_1.processHashing)(payload.userData.em, 'sha256', 'hex', (value) => value.trim().toLowerCase());
|
|
24
|
+
}
|
|
25
|
+
if (payload.userData?.ph) {
|
|
26
|
+
payload.userData.ph = (0, hashing_utils_1.processHashing)(payload.userData.ph, 'sha256', 'hex', (value) => value.trim().replace(/\D/g, ''));
|
|
27
|
+
}
|
|
28
|
+
if (payload.customData) {
|
|
29
|
+
payload.data.customData = payload.customData;
|
|
30
|
+
}
|
|
31
|
+
if (payload.userData) {
|
|
32
|
+
payload.data.userData = payload.userData;
|
|
33
|
+
}
|
|
34
|
+
return request(`${constants_1.API_URL}${settings.UetTag}/events`, {
|
|
35
|
+
method: 'post',
|
|
36
|
+
json: {
|
|
37
|
+
data: [payload.data]
|
|
38
|
+
}
|
|
39
|
+
});
|
|
8
40
|
}
|
|
9
41
|
};
|
|
10
42
|
exports.default = action;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/ms-bing-capi/sendEvent/index.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/ms-bing-capi/sendEvent/index.ts"],"names":[],"mappings":";;AAGA,sCAAsD;AACtD,4CAAsC;AACtC,8DAA2D;AAC3D,uCAA2C;AAE3C,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,YAAY;IACnB,WAAW,EAAE,4CAA4C;IACzD,mBAAmB,EAAE,gBAAgB;IACrC,MAAM,EAAE;QACN,IAAI,EAAE,aAAI;QACV,QAAQ,EAAE,iBAAQ;QAClB,UAAU,EAAE,mBAAU;KACvB;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC1C,IAAI,OAAO,CAAC,QAAQ,IAAI,SAAS,EAAE,CAAC;YAClC,OAAO,CAAC,QAAQ,GAAG;gBACjB,WAAW,EAAE,IAAA,SAAM,GAAE;aACtB,CAAA;QACH,CAAC;QACD,IAAI,OAAO,CAAC,QAAQ,EAAE,EAAE,EAAE,CAAC;YACzB,OAAO,CAAC,QAAQ,CAAC,EAAE,GAAG,IAAA,8BAAc,EAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAA;QACnH,CAAC;QACD,IAAI,OAAO,CAAC,QAAQ,EAAE,EAAE,EAAE,CAAC;YACzB,OAAO,CAAC,QAAQ,CAAC,EAAE,GAAG,IAAA,8BAAc,EAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE,CACnF,KAAK,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAChC,CAAA;QACH,CAAC;QAGD,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;YACvB,OAAO,CAAC,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAA;QAC9C,CAAC;QAED,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;YACrB,OAAO,CAAC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAA;QAC1C,CAAC;QAED,OAAO,OAAO,CAAC,GAAG,mBAAO,GAAG,QAAQ,CAAC,MAAM,SAAS,EAAE;YACpD,MAAM,EAAE,MAAM;YACd,IAAI,EAAE;gBACJ,IAAI,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;aACrB;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface EventJSON {
|
|
2
|
+
data: Array<EventObject>;
|
|
3
|
+
}
|
|
4
|
+
export interface EventObject {
|
|
5
|
+
eventType: string;
|
|
6
|
+
eventId?: string;
|
|
7
|
+
eventName: string;
|
|
8
|
+
customData?: CustomData;
|
|
9
|
+
}
|
|
10
|
+
export interface EventResponse {
|
|
11
|
+
}
|
|
12
|
+
export interface CustomData {
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/destinations/ms-bing-capi/sendEvent/types.ts"],"names":[],"mappings":""}
|