@segment/action-destinations 3.155.1-the-trade-desk → 3.155.1
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/engage-messaging-sendgrid/sendEmail/index.js +7 -2
- package/dist/destinations/engage-messaging-sendgrid/sendEmail/index.js.map +1 -1
- package/dist/destinations/index.js +0 -1
- package/dist/destinations/index.js.map +1 -1
- package/dist/destinations/iterable/generated-types.d.ts +3 -0
- package/dist/destinations/iterable/generated-types.js.map +1 -0
- package/dist/destinations/iterable/index.d.ts +4 -0
- package/dist/destinations/iterable/index.js +71 -0
- package/dist/destinations/iterable/index.js.map +1 -0
- package/dist/destinations/iterable/shared-fields.d.ts +11 -0
- package/dist/destinations/iterable/shared-fields.js +165 -0
- package/dist/destinations/iterable/shared-fields.js.map +1 -0
- package/dist/destinations/iterable/trackEvent/generated-types.d.ts +12 -0
- package/dist/destinations/iterable/trackEvent/generated-types.js +3 -0
- package/dist/destinations/iterable/trackEvent/generated-types.js.map +1 -0
- package/dist/destinations/{the-trade-desk-crm/syncAudience → iterable/trackEvent}/index.d.ts +1 -1
- package/dist/destinations/iterable/trackEvent/index.js +62 -0
- package/dist/destinations/iterable/trackEvent/index.js.map +1 -0
- package/dist/destinations/iterable/trackPurchase/generated-types.d.ts +34 -0
- package/dist/destinations/iterable/trackPurchase/generated-types.js +3 -0
- package/dist/destinations/iterable/trackPurchase/generated-types.js.map +1 -0
- package/dist/destinations/iterable/trackPurchase/index.d.ts +5 -0
- package/dist/destinations/iterable/trackPurchase/index.js +122 -0
- package/dist/destinations/iterable/trackPurchase/index.js.map +1 -0
- package/dist/destinations/iterable/updateCart/generated-types.d.ts +26 -0
- package/dist/destinations/iterable/updateCart/generated-types.js +3 -0
- package/dist/destinations/iterable/updateCart/generated-types.js.map +1 -0
- package/dist/destinations/iterable/updateCart/index.d.ts +5 -0
- package/dist/destinations/iterable/updateCart/index.js +85 -0
- package/dist/destinations/iterable/updateCart/index.js.map +1 -0
- package/dist/destinations/iterable/updateUser/generated-types.d.ts +9 -0
- package/dist/destinations/iterable/updateUser/generated-types.js +3 -0
- package/dist/destinations/iterable/updateUser/generated-types.js.map +1 -0
- package/dist/destinations/iterable/updateUser/index.d.ts +5 -0
- package/dist/destinations/iterable/updateUser/index.js +46 -0
- package/dist/destinations/iterable/updateUser/index.js.map +1 -0
- package/dist/destinations/the-trade-desk-crm/generated-types.d.ts +0 -2
- package/dist/destinations/the-trade-desk-crm/index.js +2 -21
- package/dist/destinations/the-trade-desk-crm/index.js.map +1 -1
- package/package.json +4 -4
- package/dist/destinations/the-trade-desk-crm/functions.d.ts +0 -23
- package/dist/destinations/the-trade-desk-crm/functions.js +0 -113
- package/dist/destinations/the-trade-desk-crm/functions.js.map +0 -1
- package/dist/destinations/the-trade-desk-crm/properties.d.ts +0 -7
- package/dist/destinations/the-trade-desk-crm/properties.js +0 -49
- package/dist/destinations/the-trade-desk-crm/properties.js.map +0 -1
- package/dist/destinations/the-trade-desk-crm/syncAudience/generated-types.d.ts +0 -8
- package/dist/destinations/the-trade-desk-crm/syncAudience/generated-types.js.map +0 -1
- package/dist/destinations/the-trade-desk-crm/syncAudience/index.js +0 -25
- package/dist/destinations/the-trade-desk-crm/syncAudience/index.js.map +0 -1
- /package/dist/destinations/{the-trade-desk-crm/syncAudience → iterable}/generated-types.js +0 -0
|
@@ -0,0 +1,122 @@
|
|
|
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 dayjs_1 = __importDefault(require("../../../lib/dayjs"));
|
|
8
|
+
const shared_fields_1 = require("../shared-fields");
|
|
9
|
+
const action = {
|
|
10
|
+
title: 'Track Purchase',
|
|
11
|
+
description: 'Tracks a purchase to Iterable',
|
|
12
|
+
defaultSubscription: 'type = "track" and event == "Order Completed"',
|
|
13
|
+
fields: {
|
|
14
|
+
id: {
|
|
15
|
+
label: 'Order ID',
|
|
16
|
+
description: 'Similar to `Event ID` in custom events. Iterable recommends mapping `order_id` or `messageId`. If a purchase exists with that id, the purchase will be updated. If none is specified, a new id will automatically be generated by Iterable',
|
|
17
|
+
type: 'string',
|
|
18
|
+
required: false,
|
|
19
|
+
default: {
|
|
20
|
+
'@path': '$.properties.order_id'
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
user: {
|
|
24
|
+
label: 'User Data',
|
|
25
|
+
description: 'Updates user data or adds a user if none exists',
|
|
26
|
+
type: 'object',
|
|
27
|
+
required: true,
|
|
28
|
+
additionalProperties: false,
|
|
29
|
+
default: {
|
|
30
|
+
email: {
|
|
31
|
+
'@if': {
|
|
32
|
+
exists: { '@path': '$.properties.email' },
|
|
33
|
+
then: { '@path': '$.properties.email' },
|
|
34
|
+
else: { '@path': '$.context.traits.email' }
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
userId: { '@path': '$.userId' },
|
|
38
|
+
dataFields: { '@path': '$.context.traits' },
|
|
39
|
+
preferUserId: false,
|
|
40
|
+
mergeNestedObjects: false
|
|
41
|
+
},
|
|
42
|
+
properties: {
|
|
43
|
+
email: {
|
|
44
|
+
...shared_fields_1.EMAIL_FIELD
|
|
45
|
+
},
|
|
46
|
+
userId: {
|
|
47
|
+
...shared_fields_1.USER_ID_FIELD
|
|
48
|
+
},
|
|
49
|
+
dataFields: {
|
|
50
|
+
...shared_fields_1.USER_DATA_FIELDS
|
|
51
|
+
},
|
|
52
|
+
preferUserId: {
|
|
53
|
+
...shared_fields_1.PREFER_USER_ID_FIELD
|
|
54
|
+
},
|
|
55
|
+
mergeNestedObjects: {
|
|
56
|
+
...shared_fields_1.MERGE_NESTED_OBJECTS_FIELD
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
dataFields: {
|
|
61
|
+
...shared_fields_1.EVENT_DATA_FIELDS
|
|
62
|
+
},
|
|
63
|
+
items: {
|
|
64
|
+
...shared_fields_1.ITEMS_FIELD
|
|
65
|
+
},
|
|
66
|
+
total: {
|
|
67
|
+
label: 'Total',
|
|
68
|
+
description: 'Total order dollar amount.',
|
|
69
|
+
type: 'number',
|
|
70
|
+
required: true,
|
|
71
|
+
default: { '@path': '$.properties.total' }
|
|
72
|
+
},
|
|
73
|
+
createdAt: {
|
|
74
|
+
...shared_fields_1.CREATED_AT_FIELD
|
|
75
|
+
},
|
|
76
|
+
campaignId: {
|
|
77
|
+
...shared_fields_1.CAMPAGIN_ID_FIELD
|
|
78
|
+
},
|
|
79
|
+
templateId: {
|
|
80
|
+
...shared_fields_1.TEMPLATE_ID_FIELD
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
perform: (request, { payload }) => {
|
|
84
|
+
const { user, dataFields } = payload;
|
|
85
|
+
if (!user.email && !user.userId) {
|
|
86
|
+
throw new actions_core_1.PayloadValidationError('Must include email or userId.');
|
|
87
|
+
}
|
|
88
|
+
const reservedItemKeys = [
|
|
89
|
+
'product_id',
|
|
90
|
+
'id',
|
|
91
|
+
'sku',
|
|
92
|
+
'name',
|
|
93
|
+
'price',
|
|
94
|
+
'quantity',
|
|
95
|
+
'categories',
|
|
96
|
+
'category',
|
|
97
|
+
'url',
|
|
98
|
+
'image_url'
|
|
99
|
+
];
|
|
100
|
+
function transformItems(items) {
|
|
101
|
+
return items.map(({ dataFields, categories, ...rest }) => ({
|
|
102
|
+
...rest,
|
|
103
|
+
dataFields: actions_core_1.omit(dataFields, reservedItemKeys),
|
|
104
|
+
...(categories && { categories: [categories] })
|
|
105
|
+
}));
|
|
106
|
+
}
|
|
107
|
+
if (dataFields && Object.prototype.hasOwnProperty.call(dataFields, 'products')) {
|
|
108
|
+
delete dataFields.products;
|
|
109
|
+
}
|
|
110
|
+
const trackPurchaseRequest = {
|
|
111
|
+
...payload,
|
|
112
|
+
items: transformItems(payload.items),
|
|
113
|
+
createdAt: dayjs_1.default(payload.createdAt).unix()
|
|
114
|
+
};
|
|
115
|
+
return request('https://api.iterable.com/api/commerce/trackPurchase', {
|
|
116
|
+
method: 'post',
|
|
117
|
+
json: trackPurchaseRequest
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
exports.default = action;
|
|
122
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/iterable/trackPurchase/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAAsF;AAGtF,+DAAsC;AACtC,oDAWyB;AAEzB,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,gBAAgB;IACvB,WAAW,EAAE,+BAA+B;IAC5C,mBAAmB,EAAE,+CAA+C;IACpE,MAAM,EAAE;QACN,EAAE,EAAE;YACF,KAAK,EAAE,UAAU;YACjB,WAAW,EACT,4OAA4O;YAC9O,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE;gBACP,OAAO,EAAE,uBAAuB;aACjC;SACF;QACD,IAAI,EAAE;YACJ,KAAK,EAAE,WAAW;YAClB,WAAW,EAAE,iDAAiD;YAC9D,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,oBAAoB,EAAE,KAAK;YAC3B,OAAO,EAAE;gBACP,KAAK,EAAE;oBACL,KAAK,EAAE;wBACL,MAAM,EAAE,EAAE,OAAO,EAAE,oBAAoB,EAAE;wBACzC,IAAI,EAAE,EAAE,OAAO,EAAE,oBAAoB,EAAE;wBACvC,IAAI,EAAE,EAAE,OAAO,EAAE,wBAAwB,EAAE;qBAC5C;iBACF;gBACD,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;gBAC/B,UAAU,EAAE,EAAE,OAAO,EAAE,kBAAkB,EAAE;gBAC3C,YAAY,EAAE,KAAK;gBACnB,kBAA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,IAAI;gBACP,UAAU,EAAE,mBAAI,CAAC,UAAU,EAAE,gBAAgB,CAAC;gBAC9C,GAAG,CAAC,UAAU,IAAI,EAAE,UAAU,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC;aAChD,CAAC,CAAC,CAAA;QACL,CAAC;QAuCD,IAAI,UAAU,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,EAAE;YAC9E,OAAO,UAAU,CAAC,QAAQ,CAAA;SAC3B;QAED,MAAM,oBAAoB,GAAyB;YACjD,GAAG,OAAO;YACV,KAAK,EAAE,cAAc,CAAC,OAAO,CAAC,KAAK,CAAC;YACpC,SAAS,EAAE,eAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE;SAC3C,CAAA;QAED,OAAO,OAAO,CAAC,qDAAqD,EAAE;YACpE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,oBAAoB;SAC3B,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface Payload {
|
|
2
|
+
user: {
|
|
3
|
+
email?: string;
|
|
4
|
+
userId?: string;
|
|
5
|
+
preferUserId?: boolean;
|
|
6
|
+
mergeNestedObjects?: boolean;
|
|
7
|
+
dataFields?: {
|
|
8
|
+
[k: string]: unknown;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
items: {
|
|
12
|
+
id: string;
|
|
13
|
+
name: string;
|
|
14
|
+
sku?: string;
|
|
15
|
+
quantity: number;
|
|
16
|
+
price: number;
|
|
17
|
+
description?: string;
|
|
18
|
+
categories?: string;
|
|
19
|
+
url?: string;
|
|
20
|
+
imageUrl?: string;
|
|
21
|
+
dataFields?: {
|
|
22
|
+
[k: string]: unknown;
|
|
23
|
+
};
|
|
24
|
+
[k: string]: unknown;
|
|
25
|
+
}[];
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/iterable/updateCart/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
4
|
+
const shared_fields_1 = require("../shared-fields");
|
|
5
|
+
const action = {
|
|
6
|
+
title: 'Update Cart',
|
|
7
|
+
description: 'Updates shoppingCartItems field on the user profile.',
|
|
8
|
+
defaultSubscription: 'type = "track" and event == "Update Cart"',
|
|
9
|
+
fields: {
|
|
10
|
+
user: {
|
|
11
|
+
label: 'User Data',
|
|
12
|
+
description: 'Updates user data or adds a user if none exists',
|
|
13
|
+
type: 'object',
|
|
14
|
+
required: true,
|
|
15
|
+
additionalProperties: false,
|
|
16
|
+
defaultObjectUI: 'keyvalue:only',
|
|
17
|
+
default: {
|
|
18
|
+
email: {
|
|
19
|
+
'@if': {
|
|
20
|
+
exists: { '@path': '$.properties.email' },
|
|
21
|
+
then: { '@path': '$.properties.email' },
|
|
22
|
+
else: { '@path': '$.context.traits.email' }
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
userId: { '@path': '$.userId' },
|
|
26
|
+
dataFields: { '@path': '$.context.traits' }
|
|
27
|
+
},
|
|
28
|
+
properties: {
|
|
29
|
+
email: {
|
|
30
|
+
...shared_fields_1.EMAIL_FIELD
|
|
31
|
+
},
|
|
32
|
+
userId: {
|
|
33
|
+
...shared_fields_1.USER_ID_FIELD
|
|
34
|
+
},
|
|
35
|
+
preferUserId: {
|
|
36
|
+
...shared_fields_1.PREFER_USER_ID_FIELD
|
|
37
|
+
},
|
|
38
|
+
mergeNestedObjects: {
|
|
39
|
+
...shared_fields_1.MERGE_NESTED_OBJECTS_FIELD
|
|
40
|
+
},
|
|
41
|
+
dataFields: {
|
|
42
|
+
...shared_fields_1.USER_DATA_FIELDS
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
items: {
|
|
47
|
+
...shared_fields_1.ITEMS_FIELD
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
perform: (request, { payload }) => {
|
|
51
|
+
const { user, items } = payload;
|
|
52
|
+
if (!user.email && !user.userId) {
|
|
53
|
+
throw new actions_core_1.PayloadValidationError('Must include email or userId.');
|
|
54
|
+
}
|
|
55
|
+
const reservedItemKeys = [
|
|
56
|
+
'product_id',
|
|
57
|
+
'id',
|
|
58
|
+
'sku',
|
|
59
|
+
'name',
|
|
60
|
+
'price',
|
|
61
|
+
'quantity',
|
|
62
|
+
'categories',
|
|
63
|
+
'category',
|
|
64
|
+
'url',
|
|
65
|
+
'image_url'
|
|
66
|
+
];
|
|
67
|
+
function transformItems(items) {
|
|
68
|
+
return items.map(({ dataFields, categories, ...rest }) => ({
|
|
69
|
+
...rest,
|
|
70
|
+
dataFields: actions_core_1.omit(dataFields, reservedItemKeys),
|
|
71
|
+
...(categories && { categories: [categories] })
|
|
72
|
+
}));
|
|
73
|
+
}
|
|
74
|
+
const updateCartRequest = {
|
|
75
|
+
user,
|
|
76
|
+
items: transformItems(items)
|
|
77
|
+
};
|
|
78
|
+
return request('https://api.iterable.com/api/commerce/updateCart', {
|
|
79
|
+
method: 'post',
|
|
80
|
+
json: updateCartRequest
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
exports.default = action;
|
|
85
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/iterable/updateCart/index.ts"],"names":[],"mappings":";;AAAA,wDAAsF;AAGtF,oDAOyB;AAEzB,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,sDAAsD;IACnE,mBAAmB,EAAE,2CAA2C;IAChE,MAAM,EAAE;QACN,IAAI,EAA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C,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;gBACzD,GAAG,IAAI;gBACP,UAAU,EAAE,mBAAI,CAAC,UAAU,EAAE,gBAAgB,CAAC;gBAC9C,GAAG,CAAC,UAAU,IAAI,EAAE,UAAU,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC;aAChD,CAAC,CAAC,CAAA;QACL,CAAC;QA8BD,MAAM,iBAAiB,GAAsB;YAC3C,IAAI;YACJ,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC;SAC7B,CAAA;QAED,OAAO,OAAO,CAAC,kDAAkD,EAAE;YACjE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,iBAAiB;SACxB,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/iterable/updateUser/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
4
|
+
const shared_fields_1 = require("../shared-fields");
|
|
5
|
+
const action = {
|
|
6
|
+
title: 'Update User',
|
|
7
|
+
description: 'Creates or updates a user',
|
|
8
|
+
defaultSubscription: 'type = "identify"',
|
|
9
|
+
fields: {
|
|
10
|
+
email: {
|
|
11
|
+
...shared_fields_1.EMAIL_FIELD,
|
|
12
|
+
default: { '@path': '$.traits.email' }
|
|
13
|
+
},
|
|
14
|
+
userId: {
|
|
15
|
+
...shared_fields_1.USER_ID_FIELD
|
|
16
|
+
},
|
|
17
|
+
dataFields: {
|
|
18
|
+
...shared_fields_1.USER_DATA_FIELDS
|
|
19
|
+
},
|
|
20
|
+
preferUserId: {
|
|
21
|
+
...shared_fields_1.PREFER_USER_ID_FIELD
|
|
22
|
+
},
|
|
23
|
+
mergeNestedObjects: {
|
|
24
|
+
...shared_fields_1.MERGE_NESTED_OBJECTS_FIELD
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
perform: (request, { payload }) => {
|
|
28
|
+
const { email, userId, dataFields } = payload;
|
|
29
|
+
if (!email && !userId) {
|
|
30
|
+
throw new actions_core_1.PayloadValidationError('Must include email or userId.');
|
|
31
|
+
}
|
|
32
|
+
if (dataFields?.phone) {
|
|
33
|
+
dataFields.phoneNumber = dataFields.phone;
|
|
34
|
+
delete dataFields.phone;
|
|
35
|
+
}
|
|
36
|
+
const userUpdateRequest = {
|
|
37
|
+
...payload
|
|
38
|
+
};
|
|
39
|
+
return request('https://api.iterable.com/api/users/update', {
|
|
40
|
+
method: 'post',
|
|
41
|
+
json: userUpdateRequest
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
exports.default = action;
|
|
46
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/iterable/updateUser/index.ts"],"names":[],"mappings":";;AAAA,wDAAgF;AAGhF,oDAMyB;AAEzB,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,2BAA2B;IACxC,mBAAmB,EAAE,mBAAmB;IACxC,MAAM,EAAE;QACN,KAAK,EAAE;YACL,GAAG,2BAAW;YACd,OAAO,EAAE,EAAE,OAAO,EAAE,gBAAgB,EAAE;SACvC;QACD,MAAM,EAAE;YACN,GAAG,6BAAa;SACjB;QACD,UAAU,EAAE;YACV,GAAG,gCAAgB;SACpB;QACD,YAAY,EAAE;YACZ,GAAG,oCAAoB;SACxB;QACD,kBAAkB,EAAE;YAClB,GAAG,0CAA0B;SAC9B;KACF;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QAChC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAA;QAE7C,IAAI,CAAC,KAAK,IAAI,CAAC,MAAM,EAAE;YACrB,MAAM,IAAI,qCAAsB,CAAC,+BAA+B,CAAC,CAAA;SAClE;QAYD,IAAI,UAAU,EAAE,KAAK,EAAE;YACrB,UAAU,CAAC,WAAW,GAAG,UAAU,CAAC,KAAK,CAAA;YACzC,OAAO,UAAU,CAAC,KAAK,CAAA;SACxB;QAED,MAAM,iBAAiB,GAAsB;YAC3C,GAAG,OAAO;SACX,CAAA;QAED,OAAO,OAAO,CAAC,2CAA2C,EAAE;YAC1D,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,iBAAiB;SACxB,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1,33 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const syncAudience_1 = __importDefault(require("./syncAudience"));
|
|
7
3
|
const destination = {
|
|
8
4
|
name: 'The Trade Desk Crm',
|
|
9
5
|
slug: 'actions-the-trade-desk-crm',
|
|
10
6
|
mode: 'cloud',
|
|
11
7
|
authentication: {
|
|
12
8
|
scheme: 'custom',
|
|
13
|
-
fields: {
|
|
14
|
-
auth_token: {
|
|
15
|
-
label: 'Authentication Token',
|
|
16
|
-
description: 'Your long-lived Trade Desk authentication token. Please see The Trade Desk’s [authentication documentation](https://api.thetradedesk.com/v3/portal/api/doc/Authentication) for information on how to generate a long-lived API Token via the Manage API Tokens in the developer Portal.',
|
|
17
|
-
type: 'string',
|
|
18
|
-
required: true
|
|
19
|
-
},
|
|
20
|
-
advertiser_id: {
|
|
21
|
-
label: 'Advertiser ID',
|
|
22
|
-
description: 'The platform ID of the advertiser for which to retrieve the status of the specified CRM data segment.',
|
|
23
|
-
type: 'string',
|
|
24
|
-
required: true
|
|
25
|
-
}
|
|
26
|
-
}
|
|
9
|
+
fields: {}
|
|
27
10
|
},
|
|
28
|
-
actions: {
|
|
29
|
-
syncAudience: syncAudience_1.default
|
|
30
|
-
}
|
|
11
|
+
actions: {}
|
|
31
12
|
};
|
|
32
13
|
exports.default = destination;
|
|
33
14
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/the-trade-desk-crm/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/the-trade-desk-crm/index.ts"],"names":[],"mappings":";;AAGA,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,oBAAoB;IAC1B,IAAI,EAAE,4BAA4B;IAClC,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE,EAAE;KACX;IAED,OAAO,EAAE,EAAE;CACZ,CAAA;AAED,kBAAe,WAAW,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.155.1
|
|
4
|
+
"version": "3.155.1",
|
|
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.62.
|
|
43
|
-
"@segment/actions-shared": "^1.44.
|
|
42
|
+
"@segment/actions-core": "^3.62.1",
|
|
43
|
+
"@segment/actions-shared": "^1.44.1",
|
|
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": "e8974b0f5cb9ef4080f7d02accadfd0fc17fddb4"
|
|
72
72
|
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { RequestClient, ModifiedResponse } from '@segment/actions-core';
|
|
2
|
-
import { Settings } from './generated-types';
|
|
3
|
-
import { Payload } from './syncAudience/generated-types';
|
|
4
|
-
export interface DROP_ENDPOINT_API_RESPONSE {
|
|
5
|
-
ReferenceId: string;
|
|
6
|
-
Url: string;
|
|
7
|
-
}
|
|
8
|
-
export interface GET_CRMS_API_RESPONSE {
|
|
9
|
-
Segments: [
|
|
10
|
-
{
|
|
11
|
-
CrmDataId: string;
|
|
12
|
-
SegmentName: string;
|
|
13
|
-
Region: string;
|
|
14
|
-
FirstPartyDataId: number;
|
|
15
|
-
}
|
|
16
|
-
];
|
|
17
|
-
}
|
|
18
|
-
export interface CREATE_API_RESPONSE {
|
|
19
|
-
CrmDataId: string;
|
|
20
|
-
FirstPartyDataId: number;
|
|
21
|
-
}
|
|
22
|
-
export declare function processPayload(request: RequestClient, settings: Settings, payloads: Payload[]): Promise<ModifiedResponse<unknown>>;
|
|
23
|
-
export declare const hash: (value: string) => string;
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.hash = exports.processPayload = void 0;
|
|
4
|
-
const actions_core_1 = require("@segment/actions-core");
|
|
5
|
-
const crypto_1 = require("crypto");
|
|
6
|
-
const API_VERSION = 'v3';
|
|
7
|
-
const BASE_URL = `https://api.thetradedesk.com/${API_VERSION}`;
|
|
8
|
-
async function processPayload(request, settings, payloads) {
|
|
9
|
-
const crmID = await getCRMID(request, settings, payloads[0]);
|
|
10
|
-
const users = extractUsers(payloads);
|
|
11
|
-
const dataDropEndpoint = await getDropEndpoint(request, settings, payloads[0], crmID);
|
|
12
|
-
return sendCRMData(request, dataDropEndpoint, users);
|
|
13
|
-
}
|
|
14
|
-
exports.processPayload = processPayload;
|
|
15
|
-
async function getCRMID(request, settings, payload) {
|
|
16
|
-
const response = await request(`${BASE_URL}/crmdata/segment/${settings.advertiser_id}`, {
|
|
17
|
-
method: 'GET',
|
|
18
|
-
headers: {
|
|
19
|
-
'Content-Type': 'application/json',
|
|
20
|
-
'TTD-Auth': settings.auth_token
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
let segmentId;
|
|
24
|
-
const segments = response.data.Segments;
|
|
25
|
-
const segmentExists = segments.filter(function (segment) {
|
|
26
|
-
if (segment.SegmentName == payload.name) {
|
|
27
|
-
return segment;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
if (segmentExists.length > 1) {
|
|
31
|
-
throw new actions_core_1.IntegrationError('Multiple audiences found with the same name', 'INVALID_SETTINGS', 400);
|
|
32
|
-
}
|
|
33
|
-
if (segmentExists.length == 1) {
|
|
34
|
-
segmentId = segmentExists[0].CrmDataId;
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
const response = await request(`${BASE_URL}/crmdata/segment`, {
|
|
38
|
-
method: 'POST',
|
|
39
|
-
headers: {
|
|
40
|
-
'Content-Type': 'application/json',
|
|
41
|
-
'TTD-Auth': settings.auth_token
|
|
42
|
-
},
|
|
43
|
-
json: {
|
|
44
|
-
AdvertiserId: settings.advertiser_id,
|
|
45
|
-
SegmentName: payload.name,
|
|
46
|
-
Region: payload.region
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
segmentId = response.data.CrmDataId;
|
|
50
|
-
}
|
|
51
|
-
return segmentId;
|
|
52
|
-
}
|
|
53
|
-
async function getDropEndpoint(request, settings, payload, crmId) {
|
|
54
|
-
const response = await request(`${BASE_URL}/crmdata/segment/${settings.advertiser_id}/${crmId}`, {
|
|
55
|
-
method: 'POST',
|
|
56
|
-
headers: {
|
|
57
|
-
'Content-Type': 'application/json',
|
|
58
|
-
'TTD-Auth': settings.auth_token
|
|
59
|
-
},
|
|
60
|
-
json: {
|
|
61
|
-
PiiType: payload.pii_type,
|
|
62
|
-
MergeMode: 'Replace'
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
return response.data.Url;
|
|
66
|
-
}
|
|
67
|
-
function extractUsers(payloads) {
|
|
68
|
-
let users = '';
|
|
69
|
-
payloads.forEach((payload) => {
|
|
70
|
-
if (!payload.email) {
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
if (payload.pii_type == 'Email') {
|
|
74
|
-
users += `${payload.email}\n`;
|
|
75
|
-
}
|
|
76
|
-
if (payload.pii_type == 'EmailHashedUnifiedId2') {
|
|
77
|
-
const normalizedEmail = normalizeEmail(payload.email);
|
|
78
|
-
const hashedEmail = exports.hash(normalizedEmail);
|
|
79
|
-
users += `${hashedEmail}\n`;
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
return users;
|
|
83
|
-
}
|
|
84
|
-
async function sendCRMData(request, endpoint, users) {
|
|
85
|
-
return await request(endpoint, {
|
|
86
|
-
method: 'PUT',
|
|
87
|
-
headers: {
|
|
88
|
-
'Content-Type': 'text/plain'
|
|
89
|
-
},
|
|
90
|
-
body: users
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
function normalizeEmail(email) {
|
|
94
|
-
email = email.trim().toLowerCase();
|
|
95
|
-
if (email.endsWith('@gmail.com')) {
|
|
96
|
-
const findat = email.indexOf('@');
|
|
97
|
-
let username = email.substring(0, findat);
|
|
98
|
-
const findplus = username.indexOf('+');
|
|
99
|
-
if (findplus !== -1) {
|
|
100
|
-
username = username.substring(0, findplus);
|
|
101
|
-
}
|
|
102
|
-
username = username.replace(/\./g, '');
|
|
103
|
-
email = username + '@gmail.com';
|
|
104
|
-
}
|
|
105
|
-
return email;
|
|
106
|
-
}
|
|
107
|
-
const hash = (value) => {
|
|
108
|
-
const hash = crypto_1.createHash('sha256');
|
|
109
|
-
hash.update(value);
|
|
110
|
-
return hash.digest('base64');
|
|
111
|
-
};
|
|
112
|
-
exports.hash = hash;
|
|
113
|
-
//# sourceMappingURL=functions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"functions.js","sourceRoot":"","sources":["../../../src/destinations/the-trade-desk-crm/functions.ts"],"names":[],"mappings":";;;AAAA,wDAAyF;AAGzF,mCAAmC;AAEnC,MAAM,WAAW,GAAG,IAAI,CAAA;AACxB,MAAM,QAAQ,GAAG,gCAAgC,WAAW,EAAE,CAAA;AAuBvD,KAAK,UAAU,cAAc,CAAC,OAAsB,EAAE,QAAkB,EAAE,QAAmB;IAClG,MAAM,KAAK,GAAG,MAAM,QAAQ,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAA;IAG5D,MAAM,KAAK,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAA;IAGpC,MAAM,gBAAgB,GAAG,MAAM,eAAe,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAA;IAGrF,OAAO,WAAW,CAAC,OAAO,EAAE,gBAAgB,EAAE,KAAK,CAAC,CAAA;AACtD,CAAC;AAXD,wCAWC;AAED,KAAK,UAAU,QAAQ,CAAC,OAAsB,EAAE,QAAkB,EAAE,OAAgB;IAClF,MAAM,QAAQ,GAA4C,MAAM,OAAO,CACrE,GAAG,QAAQ,oBAAoB,QAAQ,CAAC,aAAa,EAAE,EACvD;QACE,MAAM,EAAE,KAAK;QACb,OAAO,EAAE;YACP,cAAc,EAAE,kBAAkB;YAClC,UAAU,EAAE,QAAQ,CAAC,UAAU;SAChC;KACF,CACF,CAAA;IAED,IAAI,SAAS,CAAA;IACb,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AAA;QAEzC,MAAM,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;QACtC,IAAI,QAAQ,KAAK,CAAC,CAAC,EAAE;YACnB,QAAQ,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAA;SAC3C;QAED,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;QAEtC,KAAK,GAAG,QAAQ,GAAG,YAAY,CAAA;KAChC;IACD,OAAO,KAAK,CAAA;AACd,CAAC;AAEM,MAAM,IAAI,GAAG,CAAC,KAAa,EAAU,EAAE;IAC5C,MAAM,IAAI,GAAG,mBAAU,CAAC,QAAQ,CAAC,CAAA;IACjC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IAClB,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;AAC9B,CAAC,CAAA;AAJY,QAAA,IAAI,QAIhB"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { InputField } from '@segment/actions-core/src/destination-kit/types';
|
|
2
|
-
export declare const name: InputField;
|
|
3
|
-
export declare const region: InputField;
|
|
4
|
-
export declare const pii_type: InputField;
|
|
5
|
-
export declare const email: InputField;
|
|
6
|
-
export declare const event_name: InputField;
|
|
7
|
-
export declare const enable_batching: InputField;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.enable_batching = exports.event_name = exports.email = exports.pii_type = exports.region = exports.name = void 0;
|
|
4
|
-
exports.name = {
|
|
5
|
-
label: 'Segment Name',
|
|
6
|
-
description: 'The name of The Trade Desk CRM Data Segment you want to sync. If the audience name does not exist Segment will create one.',
|
|
7
|
-
type: 'string',
|
|
8
|
-
required: true
|
|
9
|
-
};
|
|
10
|
-
exports.region = {
|
|
11
|
-
label: 'Region',
|
|
12
|
-
description: 'The geographical region of the CRM data segment based on the origin of PII.',
|
|
13
|
-
type: 'string',
|
|
14
|
-
required: true,
|
|
15
|
-
default: 'US'
|
|
16
|
-
};
|
|
17
|
-
exports.pii_type = {
|
|
18
|
-
label: 'PII Type',
|
|
19
|
-
description: 'The type of personally identifiable data (PII) sent by the advertiser.',
|
|
20
|
-
type: 'string',
|
|
21
|
-
choices: [
|
|
22
|
-
{ label: 'Email', value: 'Email' },
|
|
23
|
-
{ label: 'Hashed Email', value: 'EmailHashedUnifiedId2' }
|
|
24
|
-
],
|
|
25
|
-
required: true
|
|
26
|
-
};
|
|
27
|
-
exports.email = {
|
|
28
|
-
label: 'User Email',
|
|
29
|
-
description: "The user's email address to send to The Trade Desk.",
|
|
30
|
-
type: 'hidden',
|
|
31
|
-
default: {
|
|
32
|
-
'@path': '$.context.traits.email'
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
exports.event_name = {
|
|
36
|
-
label: 'Event Name',
|
|
37
|
-
description: 'The name of the current Segment event.',
|
|
38
|
-
type: 'hidden',
|
|
39
|
-
default: {
|
|
40
|
-
'@path': '$.event'
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
exports.enable_batching = {
|
|
44
|
-
label: 'Enable Batching',
|
|
45
|
-
description: 'Enable batching of requests to The Trade Desk CRM Segment.',
|
|
46
|
-
type: 'boolean',
|
|
47
|
-
default: true
|
|
48
|
-
};
|
|
49
|
-
//# sourceMappingURL=properties.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"properties.js","sourceRoot":"","sources":["../../../src/destinations/the-trade-desk-crm/properties.ts"],"names":[],"mappings":";;;AAEa,QAAA,IAAI,GAAe;IAC9B,KAAK,EAAE,cAAc;IACrB,WAAW,EACT,4HAA4H;IAC9H,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,IAAI;CACf,CAAA;AAEY,QAAA,MAAM,GAAe;IAChC,KAAK,EAAE,QAAQ;IACf,WAAW,EAAE,6EAA6E;IAC1F,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE,IAAI;CACd,CAAA;AAEY,QAAA,QAAQ,GAAe;IAClC,KAAK,EAAE,UAAU;IACjB,WAAW,EAAE,wEAAwE;IACrF,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE;QACP,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;QAClC,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,uBAAuB,EAAE;KAC1D;IACD,QAAQ,EAAE,IAAI;CACf,CAAA;AAEY,QAAA,KAAK,GAAe;IAC/B,KAAK,EAAE,YAAY;IACnB,WAAW,EAAE,qDAAqD;IAClE,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE;QACP,OAAO,EAAE,wBAAwB;KAClC;CACF,CAAA;AAEY,QAAA,UAAU,GAAe;IACpC,KAAK,EAAE,YAAY;IACnB,WAAW,EAAE,wCAAwC;IACrD,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE;QACP,OAAO,EAAE,SAAS;KACnB;CACF,CAAA;AAEY,QAAA,eAAe,GAAe;IACzC,KAAK,EAAE,iBAAiB;IACxB,WAAW,EAAE,4DAA4D;IACzE,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,IAAI;CACd,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/the-trade-desk-crm/syncAudience/generated-types.ts"],"names":[],"mappings":""}
|