@segment/action-destinations 3.331.7-staging → 3.331.7-staging.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/absmartly/segment.d.ts +11 -0
- package/dist/destinations/absmartly/segment.js +3 -0
- package/dist/destinations/absmartly/segment.js.map +1 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/utils/index.d.ts +1 -1
- package/dist/destinations/braze/updateUserProfile/__snapshots__/__snapshots__/snapshot.test.js.snap +208 -0
- package/dist/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.d.ts +1 -0
- package/dist/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.js +184 -0
- package/dist/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.js.map +1 -0
- package/dist/destinations/display-video-360/addToAudience/generated-types.d.ts +1 -1
- package/dist/destinations/display-video-360/addToAudience/index.js +2 -3
- package/dist/destinations/display-video-360/addToAudience/index.js.map +1 -1
- package/dist/destinations/display-video-360/index.js +3 -3
- package/dist/destinations/display-video-360/index.js.map +1 -1
- package/dist/destinations/display-video-360/properties.d.ts +1 -1
- package/dist/destinations/display-video-360/properties.js +17 -14
- package/dist/destinations/display-video-360/properties.js.map +1 -1
- package/dist/destinations/display-video-360/removeFromAudience/generated-types.d.ts +1 -1
- package/dist/destinations/display-video-360/removeFromAudience/index.js +2 -3
- package/dist/destinations/display-video-360/removeFromAudience/index.js.map +1 -1
- package/dist/destinations/display-video-360/shared.js +3 -3
- package/dist/destinations/display-video-360/shared.js.map +1 -1
- package/dist/destinations/engage/twilio/sendSms/SmsMessageSender.js +3 -0
- package/dist/destinations/engage/twilio/sendSms/SmsMessageSender.js.map +1 -1
- package/dist/destinations/gleap/generated-types.d.ts +3 -0
- package/dist/destinations/gleap/generated-types.js +3 -0
- package/dist/destinations/gleap/generated-types.js.map +1 -0
- package/dist/destinations/gleap/identifyContact/generated-types.d.ts +18 -0
- package/dist/destinations/gleap/identifyContact/generated-types.js +3 -0
- package/dist/destinations/gleap/identifyContact/generated-types.js.map +1 -0
- package/dist/destinations/gleap/identifyContact/index.d.ts +5 -0
- package/dist/destinations/gleap/identifyContact/index.js +155 -0
- package/dist/destinations/gleap/identifyContact/index.js.map +1 -0
- package/dist/destinations/gleap/index.d.ts +4 -0
- package/dist/destinations/gleap/index.js +52 -0
- package/dist/destinations/gleap/index.js.map +1 -0
- package/dist/destinations/gleap/trackEvent/generated-types.d.ts +10 -0
- package/dist/destinations/gleap/trackEvent/generated-types.js +3 -0
- package/dist/destinations/gleap/trackEvent/generated-types.js.map +1 -0
- package/dist/destinations/gleap/trackEvent/index.d.ts +5 -0
- package/dist/destinations/gleap/trackEvent/index.js +111 -0
- package/dist/destinations/gleap/trackEvent/index.js.map +1 -0
- package/dist/destinations/klaviyo/addProfileToList/generated-types.d.ts +2 -1
- package/dist/destinations/klaviyo/addProfileToList/index.js +7 -0
- package/dist/destinations/klaviyo/addProfileToList/index.js.map +1 -1
- package/dist/destinations/klaviyo/functions.d.ts +8 -0
- package/dist/destinations/klaviyo/functions.js +34 -1
- package/dist/destinations/klaviyo/functions.js.map +1 -1
- package/dist/destinations/klaviyo/properties.d.ts +2 -1
- package/dist/destinations/klaviyo/properties.js +8 -3
- package/dist/destinations/klaviyo/properties.js.map +1 -1
- package/dist/destinations/klaviyo/removeProfileFromList/generated-types.d.ts +1 -1
- package/dist/destinations/klaviyo/removeProfileToList/generated-types.d.ts +4 -0
- package/dist/destinations/klaviyo/removeProfileToList/generated-types.js +3 -0
- package/dist/destinations/klaviyo/removeProfileToList/generated-types.js.map +1 -0
- package/dist/destinations/klaviyo/removeProfileToList/index.d.ts +5 -0
- package/dist/destinations/klaviyo/removeProfileToList/index.js +41 -0
- package/dist/destinations/klaviyo/removeProfileToList/index.js.map +1 -0
- package/dist/destinations/klaviyo/upsertProfile/generated-types.d.ts +1 -0
- package/dist/destinations/klaviyo/upsertProfile/index.js +26 -1
- package/dist/destinations/klaviyo/upsertProfile/index.js.map +1 -1
- package/dist/destinations/linkedin-conversions/api/index.d.ts +1 -1
- package/dist/destinations/linkedin-conversions/api/index.js +1 -1
- package/dist/destinations/linkedin-conversions/streamConversion/index.js +1 -1
- package/dist/destinations/linkedin-conversions/streamConversion/index.js.map +1 -1
- package/dist/destinations/mixpanel/utils.d.ts +13 -0
- package/dist/destinations/mixpanel/utils.js +117 -0
- package/dist/destinations/mixpanel/utils.js.map +1 -0
- package/dist/destinations/tiktok-audiences/properties.js +5 -4
- package/dist/destinations/tiktok-audiences/properties.js.map +1 -1
- package/dist/destinations/tiktok-conversions/index.js +92 -3
- package/dist/destinations/tiktok-conversions/index.js.map +1 -1
- package/dist/destinations/tiktok-conversions/reportWebEvent/formatter.d.ts +3 -3
- package/dist/destinations/tiktok-conversions/reportWebEvent/formatter.js +33 -24
- package/dist/destinations/tiktok-conversions/reportWebEvent/formatter.js.map +1 -1
- package/dist/destinations/tiktok-conversions/reportWebEvent/generated-types.d.ts +12 -4
- package/dist/destinations/tiktok-conversions/reportWebEvent/index.js +113 -40
- package/dist/destinations/tiktok-conversions/reportWebEvent/index.js.map +1 -1
- package/dist/destinations/tiktok-offline-conversions/index.js +199 -48
- package/dist/destinations/tiktok-offline-conversions/index.js.map +1 -1
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/formatter.d.ts +3 -0
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/formatter.js +43 -0
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/formatter.js.map +1 -0
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/generated-types.d.ts +33 -0
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/generated-types.js +3 -0
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/generated-types.js.map +1 -0
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/index.d.ts +5 -0
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/index.js +317 -0
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/index.js.map +1 -0
- package/dist/destinations/trackey/identifyUser/generated-types.d.ts +8 -0
- package/dist/destinations/trackey/identifyUser/generated-types.js +3 -0
- package/dist/destinations/trackey/identifyUser/generated-types.js.map +1 -0
- package/dist/destinations/trackey/identifyUser/index.d.ts +5 -0
- package/dist/destinations/trackey/identifyUser/index.js +52 -0
- package/dist/destinations/trackey/identifyUser/index.js.map +1 -0
- package/dist/destinations/trackey/identifyUser.types.d.ts +8 -0
- package/dist/destinations/trackey/identifyUser.types.js +3 -0
- package/dist/destinations/trackey/identifyUser.types.js.map +1 -0
- package/dist/destinations/trackey/registerCompany/generated-types.d.ts +9 -0
- package/dist/destinations/trackey/registerCompany/generated-types.js +3 -0
- package/dist/destinations/trackey/registerCompany/generated-types.js.map +1 -0
- package/dist/destinations/trackey/registerCompany/index.d.ts +5 -0
- package/dist/destinations/trackey/registerCompany/index.js +60 -0
- package/dist/destinations/trackey/registerCompany/index.js.map +1 -0
- package/dist/destinations/trackey/registerCompany.types.d.ts +9 -0
- package/dist/destinations/trackey/registerCompany.types.js +3 -0
- package/dist/destinations/trackey/registerCompany.types.js.map +1 -0
- package/dist/destinations/trackey/trackEvent/generated-types.d.ts +12 -0
- package/dist/destinations/trackey/trackEvent/generated-types.js +3 -0
- package/dist/destinations/trackey/trackEvent/generated-types.js.map +1 -0
- package/dist/destinations/trackey/trackEvent/index.d.ts +5 -0
- package/dist/destinations/trackey/trackEvent/index.js +68 -0
- package/dist/destinations/trackey/trackEvent/index.js.map +1 -0
- package/dist/destinations/trackey/trackEvent.types.d.ts +12 -0
- package/dist/destinations/trackey/trackEvent.types.js +3 -0
- package/dist/destinations/trackey/trackEvent.types.js.map +1 -0
- package/package.json +1 -1
- package/dist/destinations/display-video-360/listManagement.d.ts +0 -9
- package/dist/destinations/display-video-360/listManagement.js +0 -16
- package/dist/destinations/display-video-360/listManagement.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"segment.js","sourceRoot":"","sources":["../../../src/destinations/absmartly/segment.ts"],"names":[],"mappings":""}
|
|
@@ -9,7 +9,7 @@ export declare const dateStringToFuzzyDate: (dateString: string | number) => fal
|
|
|
9
9
|
y: string;
|
|
10
10
|
};
|
|
11
11
|
export declare const augmentFieldsWithConstituentFields: (fields: Record<string, InputField>) => Record<string, InputField>;
|
|
12
|
-
export declare const splitConstituentPayload: (payload: CreateOrUpdateIndividualConstituentPayload) => (Partial<
|
|
12
|
+
export declare const splitConstituentPayload: (payload: CreateOrUpdateIndividualConstituentPayload) => (Partial<Constituent> | Partial<Address> | Partial<OnlinePresence> | Partial<Phone>)[];
|
|
13
13
|
export declare const buildConstituentPayloadFromPayload: (payload: StringIndexedObject) => Partial<CreateOrUpdateIndividualConstituentPayload>;
|
|
14
14
|
export declare const buildGiftDataFromPayload: (constituentId: string, payload: CreateGiftPayload) => Partial<Gift>;
|
|
15
15
|
export declare const buildConstituentActionDataFromPayload: (constituentId: string, payload: CreateConstituentAction) => Partial<ConstituentAction>;
|
package/dist/destinations/braze/updateUserProfile/__snapshots__/__snapshots__/snapshot.test.js.snap
ADDED
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`Testing snapshot for Braze's updateUserProfile destination action: all fields 1`] = `
|
|
4
|
+
Object {
|
|
5
|
+
"attributes": Array [
|
|
6
|
+
Object {
|
|
7
|
+
"_update_existing_only": false,
|
|
8
|
+
"braze_id": "M8rtOywDKgN((jhUBk9",
|
|
9
|
+
"country": "M8rtOywDKgN((jhUBk9",
|
|
10
|
+
"current_location": Object {
|
|
11
|
+
"latitude": 74322492134522.88,
|
|
12
|
+
"longitude": 74322492134522.88,
|
|
13
|
+
},
|
|
14
|
+
"date_of_first_session": "2021-02-01T00:00:00.000Z",
|
|
15
|
+
"date_of_last_session": "2021-02-01T00:00:00.000Z",
|
|
16
|
+
"dob": "2021-02-01",
|
|
17
|
+
"email": "wifot@vuri.cl",
|
|
18
|
+
"email_click_tracking_disabled": false,
|
|
19
|
+
"email_open_tracking_disabled": false,
|
|
20
|
+
"email_subscribe": "M8rtOywDKgN((jhUBk9",
|
|
21
|
+
"external_id": "M8rtOywDKgN((jhUBk9",
|
|
22
|
+
"facebook": Object {
|
|
23
|
+
"id": "M8rtOywDKgN((jhUBk9",
|
|
24
|
+
"likes": Array [
|
|
25
|
+
"M8rtOywDKgN((jhUBk9",
|
|
26
|
+
],
|
|
27
|
+
"num_friends": 7432249213452288,
|
|
28
|
+
},
|
|
29
|
+
"first_name": "M8rtOywDKgN((jhUBk9",
|
|
30
|
+
"gender": "M8rtOywDKgN((jhUBk9",
|
|
31
|
+
"home_city": "M8rtOywDKgN((jhUBk9",
|
|
32
|
+
"image_url": "http://agekekci.va/dofupo",
|
|
33
|
+
"language": "M8rtOywDKgN((jhUBk9",
|
|
34
|
+
"last_name": "M8rtOywDKgN((jhUBk9",
|
|
35
|
+
"marked_email_as_spam_at": "2021-02-01T00:00:00.000Z",
|
|
36
|
+
"phone": "M8rtOywDKgN((jhUBk9",
|
|
37
|
+
"push_subscribe": "M8rtOywDKgN((jhUBk9",
|
|
38
|
+
"push_tokens": Array [
|
|
39
|
+
Object {
|
|
40
|
+
"app_id": "M8rtOywDKgN((jhUBk9",
|
|
41
|
+
"device_id": "M8rtOywDKgN((jhUBk9",
|
|
42
|
+
"token": "M8rtOywDKgN((jhUBk9",
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
"testType": "M8rtOywDKgN((jhUBk9",
|
|
46
|
+
"time_zone": "M8rtOywDKgN((jhUBk9",
|
|
47
|
+
"twitter": Object {
|
|
48
|
+
"followers_count": 7432249213452288,
|
|
49
|
+
"friends_count": 7432249213452288,
|
|
50
|
+
"id": "M8rtOywDKgN((jhUBk9",
|
|
51
|
+
"screen_name": "M8rtOywDKgN((jhUBk9",
|
|
52
|
+
"statuses_count": 7432249213452288,
|
|
53
|
+
},
|
|
54
|
+
"user_alias": Object {
|
|
55
|
+
"alias_label": "M8rtOywDKgN((jhUBk9",
|
|
56
|
+
"alias_name": "M8rtOywDKgN((jhUBk9",
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
}
|
|
61
|
+
`;
|
|
62
|
+
|
|
63
|
+
exports[`Testing snapshot for Braze's updateUserProfile destination action: it should work with a single batched events 1`] = `
|
|
64
|
+
Headers {
|
|
65
|
+
Symbol(map): Object {
|
|
66
|
+
"authorization": Array [
|
|
67
|
+
"Bearer my-api-key",
|
|
68
|
+
],
|
|
69
|
+
"user-agent": Array [
|
|
70
|
+
"Segment (Actions)",
|
|
71
|
+
],
|
|
72
|
+
},
|
|
73
|
+
}
|
|
74
|
+
`;
|
|
75
|
+
|
|
76
|
+
exports[`Testing snapshot for Braze's updateUserProfile destination action: it should work with a single batched events 2`] = `
|
|
77
|
+
Object {
|
|
78
|
+
"attributes": Array [
|
|
79
|
+
Object {
|
|
80
|
+
"_update_existing_only": true,
|
|
81
|
+
"braze_id": undefined,
|
|
82
|
+
"country": "United States",
|
|
83
|
+
"current_location": Object {
|
|
84
|
+
"latitude": 40.2964197,
|
|
85
|
+
"longitude": -76.9411617,
|
|
86
|
+
},
|
|
87
|
+
"date_of_first_session": undefined,
|
|
88
|
+
"date_of_last_session": undefined,
|
|
89
|
+
"dob": undefined,
|
|
90
|
+
"email": undefined,
|
|
91
|
+
"email_click_tracking_disabled": undefined,
|
|
92
|
+
"email_open_tracking_disabled": undefined,
|
|
93
|
+
"email_subscribe": undefined,
|
|
94
|
+
"external_id": "user1234",
|
|
95
|
+
"facebook": undefined,
|
|
96
|
+
"first_name": undefined,
|
|
97
|
+
"gender": undefined,
|
|
98
|
+
"home_city": undefined,
|
|
99
|
+
"image_url": undefined,
|
|
100
|
+
"language": undefined,
|
|
101
|
+
"last_name": undefined,
|
|
102
|
+
"marked_email_as_spam_at": undefined,
|
|
103
|
+
"phone": undefined,
|
|
104
|
+
"push_subscribe": undefined,
|
|
105
|
+
"push_tokens": undefined,
|
|
106
|
+
"time_zone": undefined,
|
|
107
|
+
"twitter": undefined,
|
|
108
|
+
"user_alias": undefined,
|
|
109
|
+
},
|
|
110
|
+
],
|
|
111
|
+
}
|
|
112
|
+
`;
|
|
113
|
+
|
|
114
|
+
exports[`Testing snapshot for Braze's updateUserProfile destination action: it should work with batched events 1`] = `
|
|
115
|
+
Headers {
|
|
116
|
+
Symbol(map): Object {
|
|
117
|
+
"authorization": Array [
|
|
118
|
+
"Bearer my-api-key",
|
|
119
|
+
],
|
|
120
|
+
"user-agent": Array [
|
|
121
|
+
"Segment (Actions)",
|
|
122
|
+
],
|
|
123
|
+
"x-braze-batch": Array [
|
|
124
|
+
"true",
|
|
125
|
+
],
|
|
126
|
+
},
|
|
127
|
+
}
|
|
128
|
+
`;
|
|
129
|
+
|
|
130
|
+
exports[`Testing snapshot for Braze's updateUserProfile destination action: it should work with batched events 2`] = `
|
|
131
|
+
Object {
|
|
132
|
+
"attributes": Array [
|
|
133
|
+
Object {
|
|
134
|
+
"_update_existing_only": true,
|
|
135
|
+
"braze_id": undefined,
|
|
136
|
+
"country": "United States",
|
|
137
|
+
"current_location": Object {
|
|
138
|
+
"latitude": 40.2964197,
|
|
139
|
+
"longitude": -76.9411617,
|
|
140
|
+
},
|
|
141
|
+
"date_of_first_session": undefined,
|
|
142
|
+
"date_of_last_session": undefined,
|
|
143
|
+
"dob": undefined,
|
|
144
|
+
"email": undefined,
|
|
145
|
+
"email_click_tracking_disabled": undefined,
|
|
146
|
+
"email_open_tracking_disabled": undefined,
|
|
147
|
+
"email_subscribe": undefined,
|
|
148
|
+
"external_id": "user1234",
|
|
149
|
+
"facebook": undefined,
|
|
150
|
+
"first_name": undefined,
|
|
151
|
+
"gender": undefined,
|
|
152
|
+
"home_city": undefined,
|
|
153
|
+
"image_url": undefined,
|
|
154
|
+
"language": undefined,
|
|
155
|
+
"last_name": undefined,
|
|
156
|
+
"marked_email_as_spam_at": undefined,
|
|
157
|
+
"phone": undefined,
|
|
158
|
+
"push_subscribe": undefined,
|
|
159
|
+
"push_tokens": undefined,
|
|
160
|
+
"time_zone": undefined,
|
|
161
|
+
"twitter": undefined,
|
|
162
|
+
"user_alias": undefined,
|
|
163
|
+
},
|
|
164
|
+
Object {
|
|
165
|
+
"_update_existing_only": true,
|
|
166
|
+
"braze_id": undefined,
|
|
167
|
+
"country": "United States",
|
|
168
|
+
"current_location": Object {
|
|
169
|
+
"latitude": 40.2964197,
|
|
170
|
+
"longitude": -76.9411617,
|
|
171
|
+
},
|
|
172
|
+
"date_of_first_session": undefined,
|
|
173
|
+
"date_of_last_session": undefined,
|
|
174
|
+
"dob": undefined,
|
|
175
|
+
"email": undefined,
|
|
176
|
+
"email_click_tracking_disabled": undefined,
|
|
177
|
+
"email_open_tracking_disabled": undefined,
|
|
178
|
+
"email_subscribe": undefined,
|
|
179
|
+
"external_id": "user1234",
|
|
180
|
+
"facebook": undefined,
|
|
181
|
+
"first_name": undefined,
|
|
182
|
+
"gender": undefined,
|
|
183
|
+
"home_city": undefined,
|
|
184
|
+
"image_url": undefined,
|
|
185
|
+
"language": undefined,
|
|
186
|
+
"last_name": undefined,
|
|
187
|
+
"marked_email_as_spam_at": undefined,
|
|
188
|
+
"phone": undefined,
|
|
189
|
+
"push_subscribe": undefined,
|
|
190
|
+
"push_tokens": undefined,
|
|
191
|
+
"time_zone": undefined,
|
|
192
|
+
"twitter": undefined,
|
|
193
|
+
"user_alias": undefined,
|
|
194
|
+
},
|
|
195
|
+
],
|
|
196
|
+
}
|
|
197
|
+
`;
|
|
198
|
+
|
|
199
|
+
exports[`Testing snapshot for Braze's updateUserProfile destination action: required fields 1`] = `
|
|
200
|
+
Object {
|
|
201
|
+
"attributes": Array [
|
|
202
|
+
Object {
|
|
203
|
+
"braze_id": "M8rtOywDKgN((jhUBk9",
|
|
204
|
+
"external_id": "M8rtOywDKgN((jhUBk9",
|
|
205
|
+
},
|
|
206
|
+
],
|
|
207
|
+
}
|
|
208
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,184 @@
|
|
|
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 test_data_1 = require("../../../../lib/test-data");
|
|
8
|
+
const index_1 = __importDefault(require("../../index"));
|
|
9
|
+
const nock_1 = __importDefault(require("nock"));
|
|
10
|
+
const testDestination = actions_core_1.createTestIntegration(index_1.default);
|
|
11
|
+
const actionSlug = 'updateUserProfile';
|
|
12
|
+
const destinationSlug = 'Braze';
|
|
13
|
+
const seedName = `${destinationSlug}#${actionSlug}`;
|
|
14
|
+
const receivedAt = '2021-08-03T17:40:04.055Z';
|
|
15
|
+
const settings = {
|
|
16
|
+
app_id: 'my-app-id',
|
|
17
|
+
api_key: 'my-api-key',
|
|
18
|
+
endpoint: 'https://rest.iad-01.braze.com'
|
|
19
|
+
};
|
|
20
|
+
describe(`Testing snapshot for ${destinationSlug}'s ${actionSlug} destination action:`, () => {
|
|
21
|
+
it('required fields', async () => {
|
|
22
|
+
const action = index_1.default.actions[actionSlug];
|
|
23
|
+
const [eventData, settingsData] = test_data_1.generateTestData(seedName, index_1.default, action, true);
|
|
24
|
+
nock_1.default(/.*/).persist().get(/.*/).reply(200);
|
|
25
|
+
nock_1.default(/.*/).persist().post(/.*/).reply(200);
|
|
26
|
+
nock_1.default(/.*/).persist().put(/.*/).reply(200);
|
|
27
|
+
const event = actions_core_1.createTestEvent({
|
|
28
|
+
properties: eventData
|
|
29
|
+
});
|
|
30
|
+
const responses = await testDestination.testAction(actionSlug, {
|
|
31
|
+
event: event,
|
|
32
|
+
mapping: event.properties,
|
|
33
|
+
settings: settingsData,
|
|
34
|
+
auth: undefined
|
|
35
|
+
});
|
|
36
|
+
const request = responses[0].request;
|
|
37
|
+
const rawBody = await request.text();
|
|
38
|
+
try {
|
|
39
|
+
const json = JSON.parse(rawBody);
|
|
40
|
+
expect(json).toMatchSnapshot();
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
catch (err) {
|
|
44
|
+
expect(rawBody).toMatchSnapshot();
|
|
45
|
+
}
|
|
46
|
+
expect(request.headers).toMatchSnapshot();
|
|
47
|
+
});
|
|
48
|
+
it('all fields', async () => {
|
|
49
|
+
const action = index_1.default.actions[actionSlug];
|
|
50
|
+
const [eventData, settingsData] = test_data_1.generateTestData(seedName, index_1.default, action, false);
|
|
51
|
+
nock_1.default(/.*/).persist().get(/.*/).reply(200);
|
|
52
|
+
nock_1.default(/.*/).persist().post(/.*/).reply(200);
|
|
53
|
+
nock_1.default(/.*/).persist().put(/.*/).reply(200);
|
|
54
|
+
const event = actions_core_1.createTestEvent({
|
|
55
|
+
properties: eventData
|
|
56
|
+
});
|
|
57
|
+
const responses = await testDestination.testAction(actionSlug, {
|
|
58
|
+
event: event,
|
|
59
|
+
mapping: event.properties,
|
|
60
|
+
settings: settingsData,
|
|
61
|
+
auth: undefined
|
|
62
|
+
});
|
|
63
|
+
const request = responses[0].request;
|
|
64
|
+
const rawBody = await request.text();
|
|
65
|
+
try {
|
|
66
|
+
const json = JSON.parse(rawBody);
|
|
67
|
+
expect(json).toMatchSnapshot();
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
catch (err) {
|
|
71
|
+
expect(rawBody).toMatchSnapshot();
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
it('it should work with batched events', async () => {
|
|
75
|
+
nock_1.default('https://rest.iad-01.braze.com').post('/users/track').reply(200, {});
|
|
76
|
+
const events = [
|
|
77
|
+
actions_core_1.createTestEvent({
|
|
78
|
+
event: 'Test Event 1',
|
|
79
|
+
type: 'track',
|
|
80
|
+
receivedAt,
|
|
81
|
+
properties: {}
|
|
82
|
+
}),
|
|
83
|
+
actions_core_1.createTestEvent({
|
|
84
|
+
event: 'Test Event 2',
|
|
85
|
+
type: 'track',
|
|
86
|
+
receivedAt,
|
|
87
|
+
properties: {}
|
|
88
|
+
})
|
|
89
|
+
];
|
|
90
|
+
const responses = await testDestination.testBatchAction(actionSlug, {
|
|
91
|
+
events,
|
|
92
|
+
useDefaultMappings: true,
|
|
93
|
+
mapping: {
|
|
94
|
+
external_id: {
|
|
95
|
+
'@path': '$.userId'
|
|
96
|
+
},
|
|
97
|
+
user_alias: {},
|
|
98
|
+
braze_id: {
|
|
99
|
+
'@path': '$.properties.braze_id'
|
|
100
|
+
},
|
|
101
|
+
name: {
|
|
102
|
+
'@path': '$.event'
|
|
103
|
+
},
|
|
104
|
+
time: {
|
|
105
|
+
'@path': '$.receivedAt'
|
|
106
|
+
},
|
|
107
|
+
properties: {
|
|
108
|
+
'@path': '$.properties'
|
|
109
|
+
},
|
|
110
|
+
products: {
|
|
111
|
+
'@path': '$.properties.products'
|
|
112
|
+
},
|
|
113
|
+
enable_batching: true,
|
|
114
|
+
_update_existing_only: true
|
|
115
|
+
},
|
|
116
|
+
settings: {
|
|
117
|
+
...settings
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
expect(responses.length).toBe(1);
|
|
121
|
+
expect(responses[0].status).toBe(200);
|
|
122
|
+
expect(responses[0].options.headers).toMatchSnapshot();
|
|
123
|
+
expect(responses[0].options.json).toMatchSnapshot();
|
|
124
|
+
});
|
|
125
|
+
it('it should work with a single batched events', async () => {
|
|
126
|
+
nock_1.default('https://rest.iad-01.braze.com').post('/users/track').reply(200, {});
|
|
127
|
+
const events = [
|
|
128
|
+
actions_core_1.createTestEvent({
|
|
129
|
+
event: 'Test Event 1',
|
|
130
|
+
type: 'track',
|
|
131
|
+
receivedAt,
|
|
132
|
+
properties: {
|
|
133
|
+
products: [
|
|
134
|
+
{
|
|
135
|
+
quantity: 1,
|
|
136
|
+
product_id: 'Bowflex Treadmill 10',
|
|
137
|
+
price: 100
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
quantity: 2,
|
|
141
|
+
product_id: 'Bowflex Treadmill 20',
|
|
142
|
+
price: 200
|
|
143
|
+
}
|
|
144
|
+
]
|
|
145
|
+
}
|
|
146
|
+
})
|
|
147
|
+
];
|
|
148
|
+
const responses = await testDestination.testBatchAction(actionSlug, {
|
|
149
|
+
events,
|
|
150
|
+
useDefaultMappings: true,
|
|
151
|
+
mapping: {
|
|
152
|
+
external_id: {
|
|
153
|
+
'@path': '$.userId'
|
|
154
|
+
},
|
|
155
|
+
user_alias: {},
|
|
156
|
+
braze_id: {
|
|
157
|
+
'@path': '$.properties.braze_id'
|
|
158
|
+
},
|
|
159
|
+
name: {
|
|
160
|
+
'@path': '$.event'
|
|
161
|
+
},
|
|
162
|
+
time: {
|
|
163
|
+
'@path': '$.receivedAt'
|
|
164
|
+
},
|
|
165
|
+
properties: {
|
|
166
|
+
'@path': '$.properties'
|
|
167
|
+
},
|
|
168
|
+
products: {
|
|
169
|
+
'@path': '$.properties.products'
|
|
170
|
+
},
|
|
171
|
+
enable_batching: true,
|
|
172
|
+
_update_existing_only: true
|
|
173
|
+
},
|
|
174
|
+
settings: {
|
|
175
|
+
...settings
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
expect(responses.length).toBe(1);
|
|
179
|
+
expect(responses[0].status).toBe(200);
|
|
180
|
+
expect(responses[0].options.headers).toMatchSnapshot();
|
|
181
|
+
expect(responses[0].options.json).toMatchSnapshot();
|
|
182
|
+
});
|
|
183
|
+
});
|
|
184
|
+
//# sourceMappingURL=snapshot.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snapshot.test.js","sourceRoot":"","sources":["../../../../../src/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.ts"],"names":[],"mappings":";;;;;AAAA,wDAA4F;AAC5F,yDAA4D;AAC5D,wDAAqC;AACrC,gDAAuB;AAEvB,MAAM,eAAe,GAAG,oCAAqB,CAAC,eAAW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E,IAAI;YACxB,OAAO,EAAE;gBACP,WAAW,EAAE;oBACX,OAAO,EAAE,UAAU;iBACpB;gBACD,UAAU,EAAE,EAAE;gBACd,QAAQ,EAAE;oBACR,OAAO,EAAE,uBAAuB;iBACjC;gBACD,IAAI,EAAE;oBACJ,OAAO,EAAE,SAAS;iBACnB;gBACD,IAAI,EAAE;oBACJ,OAAO,EAAE,cAAc;iBACxB;gBACD,UAAU,EAAE;oBACV,OAAO,EAAE,cAAc;iBACxB;gBACD,QAAQ,EAAE;oBACR,OAAO,EAAE,uBAAuB;iBACjC;gBACD,eAAe,EAAE,IAAI;gBACrB,qBAAqB,EAAE,IAAI;aAC5B;YACD,QAAQ,EAAE;gBACR,GAAG,QAAQ;aACZ;SACF,CAAC,CAAA;QAEF,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QAChC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QACrC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,eAAe,EAAE,CAAA;QACtD,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,CAAA;IACrD,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -5,13 +5,12 @@ const properties_1 = require("../properties");
|
|
|
5
5
|
const action = {
|
|
6
6
|
title: 'Add to Audience',
|
|
7
7
|
description: 'Add a user to a Display & Video 360 audience.',
|
|
8
|
-
defaultSubscription: 'event = "Audience Entered"',
|
|
9
8
|
fields: {
|
|
10
9
|
enable_batching: { ...properties_1.enable_batching },
|
|
11
10
|
external_audience_id: { ...properties_1.external_audience_id },
|
|
11
|
+
anonymous_id: { ...properties_1.anonymous_id },
|
|
12
12
|
mobile_advertising_id: { ...properties_1.mobile_advertising_id },
|
|
13
|
-
google_gid: { ...properties_1.google_gid }
|
|
14
|
-
partner_provided_id: { ...properties_1.partner_provided_id }
|
|
13
|
+
google_gid: { ...properties_1.google_gid }
|
|
15
14
|
},
|
|
16
15
|
perform: async (request, { payload, statsContext }) => {
|
|
17
16
|
statsContext?.statsClient?.incr('addToAudience', 1, statsContext?.tags);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/display-video-360/addToAudience/index.ts"],"names":[],"mappings":";;AAIA,sCAAwC;AAExC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/display-video-360/addToAudience/index.ts"],"names":[],"mappings":";;AAIA,sCAAwC;AAExC,8CAAsH;AAEtH,MAAM,MAAM,GAA0D;IACpE,KAAK,EAAE,iBAAiB;IACxB,WAAW,EAAE,+CAA+C;IAC5D,MAAM,EAAE;QACN,eAAe,EAAE,EAAE,GAAG,4BAAe,EAAE;QACvC,oBAAoB,EAAE,EAAE,GAAG,iCAAoB,EAAE;QACjD,YAAY,EAAE,EAAE,GAAG,yBAAY,EAAE;QACjC,qBAAqB,EAAE,EAAE,GAAG,kCAAqB,EAAE;QACnD,UAAU,EAAE,EAAE,GAAG,uBAAU,EAAE;KAC9B;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE;QACpD,YAAY,EAAE,WAAW,EAAE,IAAI,CAAC,eAAe,EAAE,CAAC,EAAE,YAAY,EAAE,IAAI,CAAC,CAAA;QACvE,MAAM,qBAAY,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,YAAY,CAAC,CAAA;QAC3D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA;IAC1B,CAAC;IACD,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE;QACzD,YAAY,EAAE,WAAW,EAAE,IAAI,CAAC,qBAAqB,EAAE,CAAC,EAAE,YAAY,EAAE,IAAI,CAAC,CAAA;QAC7E,MAAM,qBAAY,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,CAAC,CAAA;QACzD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA;IAC1B,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -42,9 +42,9 @@ const destination = {
|
|
|
42
42
|
description: 'The type of the advertiser account you have linked to this Display & Video 360 destination.',
|
|
43
43
|
required: true,
|
|
44
44
|
choices: [
|
|
45
|
-
{ label: '
|
|
46
|
-
{ label: '
|
|
47
|
-
{ label: '
|
|
45
|
+
{ label: 'DISPLAY_VIDEO_ADVERTISER', value: 'DISPLAY_VIDEO_ADVERTISER' },
|
|
46
|
+
{ label: 'DISPLAY_VIDEO_PARTNER', value: 'DISPLAY_VIDEO_PARTNER' },
|
|
47
|
+
{ label: 'DFP_BY_GOOGLE or GOOGLE_AD_MANAGER', value: 'GOOGLE_AD_MANAGER' }
|
|
48
48
|
]
|
|
49
49
|
}
|
|
50
50
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/display-video-360/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAAuF;AAKvF,oEAA2C;AAC3C,8EAAqD;AAErD,2CAA8E;AAC9E,qCAAuC;AACvC,qCAA6C;AAE7C,MAAM,WAAW,GAA8D;IAC7E,IAAI,EAAE,iCAAiC;IACvC,IAAI,EAAE,2BAA2B;IACjC,IAAI,EAAE,OAAO;IACb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE,EAAE;QACV,kBAAkB,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;YAC9C,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,OAAO,CAAuB,qBAAS,EAAE;gBAC9D,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,IAAI,eAAe,CAAC;oBACxB,aAAa,EAAE,IAAI,CAAC,YAAY;oBAChC,SAAS,EAAE,IAAI,CAAC,QAAQ;oBACxB,aAAa,EAAE,IAAI,CAAC,YAAY;oBAChC,UAAU,EAAE,eAAe;iBAC5B,CAAC;aACH,CAAC,CAAA;YACF,OAAO,EAAE,WAAW,EAAE,IAAI,CAAC,YAAY,EAAE,CAAA;QAC3C,CAAC;KACF;IACD,cAAc,EAAE;QACd,YAAY,EAAE;YACZ,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,eAAe;YACtB,QAAQ,EAAE,IAAI;YACd,WAAW,EACT,0KAA0K;SAC7K;QACD,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,cAAc;YACrB,WAAW,EAAE,6FAA6F;YAC1G,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,EAAE,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/display-video-360/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAAuF;AAKvF,oEAA2C;AAC3C,8EAAqD;AAErD,2CAA8E;AAC9E,qCAAuC;AACvC,qCAA6C;AAE7C,MAAM,WAAW,GAA8D;IAC7E,IAAI,EAAE,iCAAiC;IACvC,IAAI,EAAE,2BAA2B;IACjC,IAAI,EAAE,OAAO;IACb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE,EAAE;QACV,kBAAkB,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;YAC9C,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,OAAO,CAAuB,qBAAS,EAAE;gBAC9D,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,IAAI,eAAe,CAAC;oBACxB,aAAa,EAAE,IAAI,CAAC,YAAY;oBAChC,SAAS,EAAE,IAAI,CAAC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,CAAC,EAAE,SAAS,CAAC,CAAA;gBACtD,OAAO;oBACL,UAAU,EAAE,UAAU;iBACvB,CAAA;aACF;YAAC,OAAO,KAAK,EAAE;gBACd,WAAW,EAAE,IAAI,CAAC,mBAAmB,EAAE,CAAC,EAAE,SAAS,CAAC,CAAA;gBACpD,MAAM,2BAAkB,CAAC,KAAK,CAAC,CAAA;aAChC;QACH,CAAC;KACF;IACD,OAAO,EAAE;QACP,aAAa,EAAb,uBAAa;QACb,kBAAkB,EAAlB,4BAAkB;KACnB;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { InputField } from '@segment/actions-core/destination-kit/types';
|
|
2
|
+
export declare const anonymous_id: InputField;
|
|
2
3
|
export declare const mobile_advertising_id: InputField;
|
|
3
4
|
export declare const google_gid: InputField;
|
|
4
|
-
export declare const partner_provided_id: InputField;
|
|
5
5
|
export declare const enable_batching: InputField;
|
|
6
6
|
export declare const external_audience_id: InputField;
|
|
@@ -1,32 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.external_audience_id = exports.enable_batching = exports.
|
|
3
|
+
exports.external_audience_id = exports.enable_batching = exports.google_gid = exports.mobile_advertising_id = exports.anonymous_id = void 0;
|
|
4
|
+
exports.anonymous_id = {
|
|
5
|
+
label: 'Anonymous ID',
|
|
6
|
+
description: 'Anonymous ID',
|
|
7
|
+
type: 'string',
|
|
8
|
+
required: false,
|
|
9
|
+
default: {
|
|
10
|
+
'@path': '$.anonymousId'
|
|
11
|
+
},
|
|
12
|
+
readOnly: true
|
|
13
|
+
};
|
|
4
14
|
exports.mobile_advertising_id = {
|
|
5
15
|
label: 'Mobile Advertising ID',
|
|
6
|
-
description: 'Mobile Advertising ID
|
|
16
|
+
description: 'Mobile Advertising ID',
|
|
7
17
|
type: 'string',
|
|
8
18
|
required: false,
|
|
9
19
|
default: {
|
|
10
20
|
'@path': '$.context.device.advertisingId'
|
|
11
|
-
}
|
|
21
|
+
},
|
|
22
|
+
readOnly: true
|
|
12
23
|
};
|
|
13
24
|
exports.google_gid = {
|
|
14
25
|
label: 'Google GID',
|
|
15
|
-
description: 'Google GID
|
|
26
|
+
description: 'Google GID',
|
|
16
27
|
type: 'string',
|
|
17
28
|
required: false,
|
|
18
29
|
default: {
|
|
19
30
|
'@path': '$.context.traits.google_gid'
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
exports.partner_provided_id = {
|
|
23
|
-
label: 'Partner Provided ID',
|
|
24
|
-
description: 'Partner Provided ID. Remove if not needed.',
|
|
25
|
-
type: 'string',
|
|
26
|
-
required: false,
|
|
27
|
-
default: {
|
|
28
|
-
'@path': '$.anonymousId'
|
|
29
|
-
}
|
|
31
|
+
},
|
|
32
|
+
readOnly: true
|
|
30
33
|
};
|
|
31
34
|
exports.enable_batching = {
|
|
32
35
|
label: 'Enable Batching',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"properties.js","sourceRoot":"","sources":["../../../src/destinations/display-video-360/properties.ts"],"names":[],"mappings":";;;AAEa,QAAA,
|
|
1
|
+
{"version":3,"file":"properties.js","sourceRoot":"","sources":["../../../src/destinations/display-video-360/properties.ts"],"names":[],"mappings":";;;AAEa,QAAA,YAAY,GAAe;IACtC,KAAK,EAAE,cAAc;IACrB,WAAW,EAAE,cAAc;IAC3B,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,KAAK;IACf,OAAO,EAAE;QACP,OAAO,EAAE,eAAe;KACzB;IACD,QAAQ,EAAE,IAAI;CACf,CAAA;AAEY,QAAA,qBAAqB,GAAe;IAC/C,KAAK,EAAE,uBAAuB;IAC9B,WAAW,EAAE,uBAAuB;IACpC,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,KAAK;IACf,OAAO,EAAE;QACP,OAAO,EAAE,gCAAgC;KAC1C;IACD,QAAQ,EAAE,IAAI;CACf,CAAA;AAEY,QAAA,UAAU,GAAe;IACpC,KAAK,EAAE,YAAY;IACnB,WAAW,EAAE,YAAY;IACzB,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,KAAK;IACf,OAAO,EAAE;QACP,OAAO,EAAE,6BAA6B;KACvC;IACD,QAAQ,EAAE,IAAI;CACf,CAAA;AAEY,QAAA,eAAe,GAAe;IACzC,KAAK,EAAE,iBAAiB;IACxB,WAAW,EAAE,sDAAsD;IACnE,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE,IAAI;IACd,aAAa,EAAE,IAAI;CACpB,CAAA;AAEY,QAAA,oBAAoB,GAAe;IAC9C,KAAK,EAAE,sBAAsB;IAC7B,WAAW,EAAE,iCAAiC;IAC9C,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,IAAI;IACd,aAAa,EAAE,IAAI;IACnB,OAAO,EAAE;QACP,OAAO,EAAE,yCAAyC;KACnD;CACF,CAAA"}
|
|
@@ -5,13 +5,12 @@ const properties_1 = require("../properties");
|
|
|
5
5
|
const action = {
|
|
6
6
|
title: 'Remove from Audience',
|
|
7
7
|
description: 'Remove users from an audience',
|
|
8
|
-
defaultSubscription: 'event = "Audience Exited"',
|
|
9
8
|
fields: {
|
|
10
9
|
enable_batching: { ...properties_1.enable_batching },
|
|
11
10
|
external_audience_id: { ...properties_1.external_audience_id },
|
|
11
|
+
anonymous_id: { ...properties_1.anonymous_id },
|
|
12
12
|
mobile_advertising_id: { ...properties_1.mobile_advertising_id },
|
|
13
|
-
google_gid: { ...properties_1.google_gid }
|
|
14
|
-
partner_provided_id: { ...properties_1.partner_provided_id }
|
|
13
|
+
google_gid: { ...properties_1.google_gid }
|
|
15
14
|
},
|
|
16
15
|
perform: async (request, { payload, statsContext }) => {
|
|
17
16
|
statsContext?.statsClient?.incr('removeFromAudience', 1, statsContext?.tags);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/display-video-360/removeFromAudience/index.ts"],"names":[],"mappings":";;AAIA,sCAAwC;AAExC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/display-video-360/removeFromAudience/index.ts"],"names":[],"mappings":";;AAIA,sCAAwC;AAExC,8CAAsH;AAEtH,MAAM,MAAM,GAA0D;IACpE,KAAK,EAAE,sBAAsB;IAC7B,WAAW,EAAE,+BAA+B;IAC5C,MAAM,EAAE;QACN,eAAe,EAAE,EAAE,GAAG,4BAAe,EAAE;QACvC,oBAAoB,EAAE,EAAE,GAAG,iCAAoB,EAAE;QACjD,YAAY,EAAE,EAAE,GAAG,yBAAY,EAAE;QACjC,qBAAqB,EAAE,EAAE,GAAG,kCAAqB,EAAE;QACnD,UAAU,EAAE,EAAE,GAAG,uBAAU,EAAE;KAC9B;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE;QACpD,YAAY,EAAE,WAAW,EAAE,IAAI,CAAC,oBAAoB,EAAE,CAAC,EAAE,YAAY,EAAE,IAAI,CAAC,CAAA;QAC5E,MAAM,qBAAY,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAA;QAC9D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA;IAC1B,CAAC;IACD,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE;QACzD,YAAY,EAAE,WAAW,EAAE,IAAI,CAAC,0BAA0B,EAAE,CAAC,EAAE,YAAY,EAAE,IAAI,CAAC,CAAA;QAClF,MAAM,qBAAY,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAA;QAC5D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA;IAC1B,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -9,7 +9,7 @@ const buildHeaders = (audienceSettings, settings) => {
|
|
|
9
9
|
throw new actions_core_1.IntegrationError('Bad Request', 'INVALID_REQUEST_DATA', 400);
|
|
10
10
|
}
|
|
11
11
|
return {
|
|
12
|
-
Authorization: `Bearer ${settings?.oauth?.
|
|
12
|
+
Authorization: `Bearer ${settings?.oauth?.accessToken}`,
|
|
13
13
|
'Content-Type': 'application/json',
|
|
14
14
|
'Login-Customer-Id': `products/${audienceSettings.accountType}/customers/${audienceSettings?.advertiserId}`
|
|
15
15
|
};
|
|
@@ -36,9 +36,9 @@ const assembleRawOps = (payload, operation) => {
|
|
|
36
36
|
Delete: isDelete
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
|
-
if (payload.
|
|
39
|
+
if (payload.anonymous_id) {
|
|
40
40
|
rawOperations.push({
|
|
41
|
-
UserId: payload.
|
|
41
|
+
UserId: payload.anonymous_id,
|
|
42
42
|
UserIdType: protofile_1.UserIdType.PARTNER_PROVIDED_ID,
|
|
43
43
|
UserListId: audienceId,
|
|
44
44
|
Delete: isDelete
|