prebid.js 8.1.0 → 8.3.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/.devcontainer/devcontainer.json +3 -1
- package/dist/33acrossBidAdapter.js +1 -1
- package/dist/33acrossIdSystem.js +1 -1
- package/dist/adagioBidAdapter.js +1 -1
- package/dist/adbookpspBidAdapter.js +1 -1
- package/dist/adgenerationBidAdapter.js +1 -1
- package/dist/admanBidAdapter.js +1 -1
- package/dist/adqueryBidAdapter.js +1 -1
- package/dist/adrelevantisBidAdapter.js +1 -1
- package/dist/adtelligentBidAdapter.js +1 -1
- package/dist/adtrgtmeBidAdapter.js +1 -1
- package/dist/adxcgBidAdapter.js +1 -1
- package/dist/adyoulikeBidAdapter.js +1 -1
- package/dist/ajaBidAdapter.js +1 -1
- package/dist/amxBidAdapter.js +1 -1
- package/dist/amxIdSystem.js +1 -1
- package/dist/appierAnalyticsAdapter.js +1 -1
- package/dist/appnexusBidAdapter.js +1 -1
- package/dist/asoBidAdapter.js +1 -1
- package/dist/axonixBidAdapter.js +1 -1
- package/dist/beopBidAdapter.js +1 -1
- package/dist/bidglassBidAdapter.js +1 -1
- package/dist/big-richmediaBidAdapter.js +1 -1
- package/dist/bridBidAdapter.js +1 -0
- package/dist/bridgewellBidAdapter.js +1 -1
- package/dist/brightMountainMediaBidAdapter.js +1 -1
- package/dist/carodaBidAdapter.js +1 -1
- package/dist/categoryTranslation.js +1 -1
- package/dist/chtnwBidAdapter.js +1 -1
- package/dist/cmp.js +1 -0
- package/dist/concertBidAdapter.js +1 -1
- package/dist/connectadBidAdapter.js +1 -1
- package/dist/consentManagement.js +1 -1
- package/dist/consentManagementGpp.js +1 -1
- package/dist/consentManagementUsp.js +1 -1
- package/dist/consumableBidAdapter.js +1 -1
- package/dist/conversantAnalyticsAdapter.js +1 -1
- package/dist/conversantBidAdapter.js +1 -1
- package/dist/craftBidAdapter.js +1 -1
- package/dist/criteoBidAdapter.js +1 -1
- package/dist/cwireBidAdapter.js +1 -1
- package/dist/dependencies.json +15 -0
- package/dist/discoveryBidAdapter.js +1 -1
- package/dist/dspxBidAdapter.js +1 -1
- package/dist/eplanningBidAdapter.js +1 -1
- package/dist/euidIdSystem.js +1 -1
- package/dist/feedadBidAdapter.js +1 -1
- package/dist/finativeBidAdapter.js +1 -1
- package/dist/freewheel-sspBidAdapter.js +1 -1
- package/dist/gmosspBidAdapter.js +1 -1
- package/dist/goldbachBidAdapter.js +1 -1
- package/dist/gppControl_usnat.js +1 -0
- package/dist/greenbidsAnalyticsAdapter.js +1 -1
- package/dist/greenbidsRtdProvider.js +1 -1
- package/dist/gridBidAdapter.js +1 -1
- package/dist/gumgumBidAdapter.js +1 -1
- package/dist/h12mediaBidAdapter.js +1 -1
- package/dist/holidBidAdapter.js +1 -1
- package/dist/hypelabBidAdapter.js +1 -1
- package/dist/id5IdSystem.js +1 -1
- package/dist/imdsBidAdapter.js +1 -1
- package/dist/improvedigitalBidAdapter.js +1 -1
- package/dist/insticatorBidAdapter.js +1 -1
- package/dist/intentIqIdSystem.js +1 -1
- package/dist/ixBidAdapter.js +1 -1
- package/dist/justpremiumBidAdapter.js +1 -1
- package/dist/kargoBidAdapter.js +1 -1
- package/dist/konduitAnalyticsAdapter.js +1 -1
- package/dist/kueezBidAdapter.js +1 -1
- package/dist/kueezRtbBidAdapter.js +1 -1
- package/dist/kulturemediaBidAdapter.js +1 -1
- package/dist/lassoBidAdapter.js +1 -1
- package/dist/lifestreetBidAdapter.js +1 -1
- package/dist/liveIntentIdSystem.js +1 -1
- package/dist/livewrappedAnalyticsAdapter.js +1 -1
- package/dist/logicadBidAdapter.js +1 -1
- package/dist/loglyliftBidAdapter.js +1 -1
- package/dist/magniteAnalyticsAdapter.js +1 -1
- package/dist/malltvAnalyticsAdapter.js +1 -1
- package/dist/marsmediaBidAdapter.js +1 -1
- package/dist/mediafuseBidAdapter.js +1 -1
- package/dist/mediagoBidAdapter.js +1 -1
- package/dist/mediasquareBidAdapter.js +1 -1
- package/dist/mgidBidAdapter.js +1 -1
- package/dist/minutemediaBidAdapter.js +1 -1
- package/dist/minutemediaplusBidAdapter.js +1 -1
- package/dist/mspa.js +1 -0
- package/dist/nexx360BidAdapter.js +1 -1
- package/dist/not-for-prod/prebid.js +144 -140
- package/dist/oguryBidAdapter.js +1 -1
- package/dist/onetagBidAdapter.js +1 -1
- package/dist/ooloAnalyticsAdapter.js +1 -1
- package/dist/optidigitalBidAdapter.js +1 -1
- package/dist/outbrainBidAdapter.js +1 -1
- package/dist/oxxionRtdProvider.js +1 -1
- package/dist/parrableIdSystem.js +1 -1
- package/dist/pixfutureBidAdapter.js +1 -1
- package/dist/prebid-core.js +1 -1
- package/dist/publinkIdSystem.js +1 -1
- package/dist/pubmaticBidAdapter.js +1 -1
- package/dist/pubwiseAnalyticsAdapter.js +1 -1
- package/dist/pxyzBidAdapter.js +1 -1
- package/dist/quantcastBidAdapter.js +1 -1
- package/dist/readpeakBidAdapter.js +1 -1
- package/dist/relaidoBidAdapter.js +1 -1
- package/dist/retailspotBidAdapter.js +1 -1
- package/dist/rhythmoneBidAdapter.js +1 -1
- package/dist/riseBidAdapter.js +1 -1
- package/dist/rubiconBidAdapter.js +1 -1
- package/dist/seedingAllianceBidAdapter.js +1 -1
- package/dist/seedtagBidAdapter.js +1 -1
- package/dist/sharethroughAnalyticsAdapter.js +1 -1
- package/dist/sharethroughBidAdapter.js +1 -1
- package/dist/shinezBidAdapter.js +1 -1
- package/dist/smaatoBidAdapter.js +1 -1
- package/dist/smartadserverBidAdapter.js +1 -1
- package/dist/smartxBidAdapter.js +1 -1
- package/dist/smartyadsBidAdapter.js +1 -1
- package/dist/smilewantedBidAdapter.js +1 -1
- package/dist/sonobiBidAdapter.js +1 -1
- package/dist/sovrnAnalyticsAdapter.js +1 -1
- package/dist/sovrnBidAdapter.js +1 -1
- package/dist/sspBCBidAdapter.js +1 -1
- package/dist/stvBidAdapter.js +1 -1
- package/dist/sublimeBidAdapter.js +1 -1
- package/dist/targetVideoBidAdapter.js +1 -1
- package/dist/teadsBidAdapter.js +1 -1
- package/dist/trafficgateBidAdapter.js +1 -1
- package/dist/trionBidAdapter.js +1 -1
- package/dist/tripleliftBidAdapter.js +1 -1
- package/dist/ttdBidAdapter.js +1 -1
- package/dist/ucfunnelAnalyticsAdapter.js +1 -1
- package/dist/uid2IdSystem.js +1 -1
- package/dist/underdogmediaBidAdapter.js +1 -1
- package/dist/undertoneBidAdapter.js +1 -1
- package/dist/userId.js +1 -1
- package/dist/vidazooBidAdapter.js +1 -1
- package/dist/videobyteBidAdapter.js +1 -1
- package/dist/visxBidAdapter.js +1 -1
- package/dist/vuukleBidAdapter.js +1 -1
- package/dist/widespaceBidAdapter.js +1 -1
- package/dist/winrBidAdapter.js +1 -1
- package/dist/yahoosspBidAdapter.js +1 -1
- package/dist/yieldmoBidAdapter.js +1 -1
- package/dist/yieldoneAnalyticsAdapter.js +1 -1
- package/libraries/cmp/cmpClient.js +139 -0
- package/libraries/mspa/activityControls.js +91 -0
- package/modules/adagioBidAdapter.js +2 -1
- package/modules/admanBidAdapter.js +5 -0
- package/modules/adtelligentBidAdapter.js +8 -0
- package/modules/beopBidAdapter.js +6 -6
- package/modules/beopBidAdapter.md +35 -1
- package/modules/bridBidAdapter.js +223 -0
- package/modules/cadentApertureMXBidAdapter.md +2 -2
- package/modules/categoryTranslation.js +3 -2
- package/modules/consentManagement.js +12 -86
- package/modules/consentManagementGpp.js +47 -126
- package/modules/consentManagementUsp.js +19 -97
- package/modules/discoveryBidAdapter.js +1 -1
- package/modules/gppControl_usnat.js +11 -0
- package/modules/holidBidAdapter.js +49 -30
- package/modules/intentIqIdSystem.js +6 -5
- package/modules/ixBidAdapter.js +2 -1
- package/modules/liveIntentIdSystem.js +8 -3
- package/modules/livewrappedAnalyticsAdapter.js +33 -33
- package/modules/mediagoBidAdapter.js +1 -0
- package/modules/mediasquareBidAdapter.js +19 -23
- package/modules/oxxionRtdProvider.js +124 -11
- package/modules/oxxionRtdProvider.md +19 -4
- package/modules/smartyadsBidAdapter.js +6 -3
- package/modules/sovrnBidAdapter.js +5 -0
- package/modules/trafficgateBidAdapter.js +126 -72
- package/modules/tripleliftBidAdapter.js +21 -1
- package/modules/userId/eids.js +29 -0
- package/modules/userId/eids.md +19 -2
- package/modules/userId/index.js +78 -29
- package/modules/userId/userId.md +3 -0
- package/modules/vidazooBidAdapter.js +68 -16
- package/package.json +1 -1
- package/src/activities/params.js +4 -1
- package/test/spec/libraries/cmp/cmpClient_spec.js +233 -0
- package/test/spec/libraries/mspa/activityControls_spec.js +315 -0
- package/test/spec/modules/adagioBidAdapter_spec.js +2 -1
- package/test/spec/modules/admanBidAdapter_spec.js +8 -2
- package/test/spec/modules/adqueryBidAdapter_spec.js +5 -1
- package/test/spec/modules/adtelligentBidAdapter_spec.js +8 -0
- package/test/spec/modules/beopBidAdapter_spec.js +18 -2
- package/test/spec/modules/bridBidAdapter_spec.js +129 -0
- package/test/spec/modules/byDataAnalyticsAdapter_spec.js +9 -7
- package/test/spec/modules/cadentApertureMXBidAdapter_spec.js +1 -1
- package/test/spec/modules/chtnwBidAdapter_spec.js +4 -1
- package/test/spec/modules/consentManagementGpp_spec.js +84 -7
- package/test/spec/modules/consentManagement_spec.js +8 -18
- package/test/spec/modules/datablocksBidAdapter_spec.js +7 -3
- package/test/spec/modules/eids_spec.js +87 -0
- package/test/spec/modules/holidBidAdapter_spec.js +26 -6
- package/test/spec/modules/insticatorBidAdapter_spec.js +6 -2
- package/test/spec/modules/intentIqIdSystem_spec.js +36 -2
- package/test/spec/modules/ixBidAdapter_spec.js +52 -18
- package/test/spec/modules/lassoBidAdapter_spec.js +6 -4
- package/test/spec/modules/liveIntentIdMinimalSystem_spec.js +17 -2
- package/test/spec/modules/liveIntentIdSystem_spec.js +11 -6
- package/test/spec/modules/mediasquareBidAdapter_spec.js +3 -0
- package/test/spec/modules/onetagBidAdapter_spec.js +81 -75
- package/test/spec/modules/orbidderBidAdapter_spec.js +6 -3
- package/test/spec/modules/oxxionRtdProvider_spec.js +113 -1
- package/test/spec/modules/relaidoBidAdapter_spec.js +4 -3
- package/test/spec/modules/smartyadsBidAdapter_spec.js +1 -1
- package/test/spec/modules/sovrnBidAdapter_spec.js +34 -0
- package/test/spec/modules/trafficgateBidAdapter_spec.js +1349 -199
- package/test/spec/modules/tripleliftBidAdapter_spec.js +20 -1
- package/test/spec/modules/ucfunnelBidAdapter_spec.js +37 -16
- package/test/spec/modules/userId_spec.js +393 -6
- package/test/spec/modules/vidazooBidAdapter_spec.js +131 -0
|
@@ -8,6 +8,7 @@ import * as utils from 'src/utils.js';
|
|
|
8
8
|
|
|
9
9
|
const ENDPOINT = 'https://tlx.3lift.com/header/auction?';
|
|
10
10
|
const GDPR_CONSENT_STR = 'BOONm0NOONm0NABABAENAa-AAAARh7______b9_3__7_9uz_Kv_K7Vf7nnG072lPVA9LTOQ6gEaY';
|
|
11
|
+
const GPP_CONSENT_STR = 'DBACNYA~CPXxRfAPXxRfAAfKABENB-CgAAAAAAAAAAYgAAAAAAAA~1YNN'
|
|
11
12
|
|
|
12
13
|
describe('triplelift adapter', function () {
|
|
13
14
|
const adapter = newBidder(tripleliftAdapterSpec);
|
|
@@ -1039,6 +1040,12 @@ describe('triplelift adapter', function () {
|
|
|
1039
1040
|
const url = request.url;
|
|
1040
1041
|
expect(url).to.match(/(\?|&)us_privacy=1YYY/);
|
|
1041
1042
|
});
|
|
1043
|
+
it('should pass fledge signal when Triplelift is eligible for fledge', function() {
|
|
1044
|
+
bidderRequest.fledgeEnabled = true;
|
|
1045
|
+
const request = tripleliftAdapterSpec.buildRequests(bidRequests, bidderRequest);
|
|
1046
|
+
const url = request.url;
|
|
1047
|
+
expect(url).to.match(/(\?|&)fledge=true/);
|
|
1048
|
+
});
|
|
1042
1049
|
it('should return coppa param when COPPA config is set to true', function() {
|
|
1043
1050
|
sinon.stub(config, 'getConfig').withArgs('coppa').returns(true);
|
|
1044
1051
|
const request = tripleliftAdapterSpec.buildRequests(bidRequests, bidderRequest);
|
|
@@ -1506,6 +1513,7 @@ describe('triplelift adapter', function () {
|
|
|
1506
1513
|
describe('getUserSyncs', function() {
|
|
1507
1514
|
let expectedIframeSyncUrl = 'https://eb2.3lift.com/sync?gdpr=true&cmp_cs=' + GDPR_CONSENT_STR + '&';
|
|
1508
1515
|
let expectedImageSyncUrl = 'https://eb2.3lift.com/sync?px=1&src=prebid&gdpr=true&cmp_cs=' + GDPR_CONSENT_STR + '&';
|
|
1516
|
+
let expectedGppSyncUrl = 'https://eb2.3lift.com/sync?gdpr=true&cmp_cs=' + GDPR_CONSENT_STR + '&gpp=' + GPP_CONSENT_STR + '&gpp_sid=2%2C8' + '&';
|
|
1509
1517
|
|
|
1510
1518
|
it('returns undefined when syncing is not enabled', function() {
|
|
1511
1519
|
expect(tripleliftAdapterSpec.getUserSyncs({})).to.equal(undefined);
|
|
@@ -1543,8 +1551,19 @@ describe('triplelift adapter', function () {
|
|
|
1543
1551
|
let syncOptions = {
|
|
1544
1552
|
iframeEnabled: true
|
|
1545
1553
|
};
|
|
1546
|
-
let result = tripleliftAdapterSpec.getUserSyncs(syncOptions, null, null, '1YYY');
|
|
1554
|
+
let result = tripleliftAdapterSpec.getUserSyncs(syncOptions, null, null, '1YYY', null);
|
|
1547
1555
|
expect(result[0].url).to.match(/(\?|&)us_privacy=1YYY/);
|
|
1548
1556
|
});
|
|
1557
|
+
it('returns a user sync pixel with GPP signals when available', function() {
|
|
1558
|
+
let syncOptions = {
|
|
1559
|
+
iframeEnabled: true
|
|
1560
|
+
};
|
|
1561
|
+
let gppConsent = {
|
|
1562
|
+
'applicableSections': [2, 8],
|
|
1563
|
+
'gppString': 'DBACNYA~CPXxRfAPXxRfAAfKABENB-CgAAAAAAAAAAYgAAAAAAAA~1YNN'
|
|
1564
|
+
}
|
|
1565
|
+
let result = tripleliftAdapterSpec.getUserSyncs(syncOptions, null, null, null, gppConsent);
|
|
1566
|
+
expect(result[0].url).to.equal(expectedGppSyncUrl);
|
|
1567
|
+
});
|
|
1549
1568
|
});
|
|
1550
1569
|
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { expect } from 'chai';
|
|
2
2
|
import { spec } from 'modules/ucfunnelBidAdapter.js';
|
|
3
3
|
import {BANNER, VIDEO, NATIVE} from 'src/mediaTypes.js';
|
|
4
|
+
import {deepClone} from '../../../src/utils.js';
|
|
4
5
|
const URL = 'https://hb.aralego.com/header';
|
|
5
6
|
const BIDDER_CODE = 'ucfunnel';
|
|
6
7
|
|
|
@@ -150,7 +151,10 @@ describe('ucfunnel Adapter', function () {
|
|
|
150
151
|
});
|
|
151
152
|
});
|
|
152
153
|
describe('build request', function () {
|
|
153
|
-
|
|
154
|
+
let request;
|
|
155
|
+
before(() => {
|
|
156
|
+
request = spec.buildRequests([validBannerBidReq], bidderRequest);
|
|
157
|
+
})
|
|
154
158
|
it('should create a POST request for every bid', function () {
|
|
155
159
|
expect(request[0].method).to.equal('GET');
|
|
156
160
|
expect(request[0].url).to.equal(spec.ENDPOINT);
|
|
@@ -179,15 +183,16 @@ describe('ucfunnel Adapter', function () {
|
|
|
179
183
|
it('must parse bid size from a nested array', function () {
|
|
180
184
|
const width = 640;
|
|
181
185
|
const height = 480;
|
|
182
|
-
|
|
183
|
-
|
|
186
|
+
const bid = deepClone(validBannerBidReq);
|
|
187
|
+
bid.sizes = [[ width, height ]];
|
|
188
|
+
const requests = spec.buildRequests([ bid ], bidderRequest);
|
|
184
189
|
const data = requests[0].data;
|
|
185
190
|
expect(data.w).to.equal(width);
|
|
186
191
|
expect(data.h).to.equal(height);
|
|
187
192
|
});
|
|
188
193
|
|
|
189
194
|
it('should set bidfloor if configured', function() {
|
|
190
|
-
let bid =
|
|
195
|
+
let bid = deepClone(validBannerBidReq);
|
|
191
196
|
bid.getFloor = function() {
|
|
192
197
|
return {
|
|
193
198
|
currency: 'USD',
|
|
@@ -200,7 +205,7 @@ describe('ucfunnel Adapter', function () {
|
|
|
200
205
|
});
|
|
201
206
|
|
|
202
207
|
it('should set bidfloor if configured', function() {
|
|
203
|
-
let bid =
|
|
208
|
+
let bid = deepClone(validBannerBidReq);
|
|
204
209
|
bid.params.bidfloor = 2.01;
|
|
205
210
|
const requests = spec.buildRequests([ bid ], bidderRequest);
|
|
206
211
|
const data = requests[0].data;
|
|
@@ -208,7 +213,7 @@ describe('ucfunnel Adapter', function () {
|
|
|
208
213
|
});
|
|
209
214
|
|
|
210
215
|
it('should set bidfloor if configured', function() {
|
|
211
|
-
let bid =
|
|
216
|
+
let bid = deepClone(validBannerBidReq);
|
|
212
217
|
bid.getFloor = function() {
|
|
213
218
|
return {
|
|
214
219
|
currency: 'USD',
|
|
@@ -224,8 +229,12 @@ describe('ucfunnel Adapter', function () {
|
|
|
224
229
|
|
|
225
230
|
describe('interpretResponse', function () {
|
|
226
231
|
describe('should support banner', function () {
|
|
227
|
-
|
|
228
|
-
|
|
232
|
+
let request, result;
|
|
233
|
+
before(() => {
|
|
234
|
+
request = spec.buildRequests([ validBannerBidReq ], bidderRequest);
|
|
235
|
+
result = spec.interpretResponse({body: validBannerBidRes}, request[0]);
|
|
236
|
+
});
|
|
237
|
+
|
|
229
238
|
it('should build bid array for banner', function () {
|
|
230
239
|
expect(result.length).to.equal(1);
|
|
231
240
|
});
|
|
@@ -243,8 +252,11 @@ describe('ucfunnel Adapter', function () {
|
|
|
243
252
|
});
|
|
244
253
|
|
|
245
254
|
describe('handle banner no ad', function () {
|
|
246
|
-
|
|
247
|
-
|
|
255
|
+
let request, result;
|
|
256
|
+
before(() => {
|
|
257
|
+
request = spec.buildRequests([ validBannerBidReq ], bidderRequest);
|
|
258
|
+
result = spec.interpretResponse({body: invalidBannerBidRes}, request[0]);
|
|
259
|
+
})
|
|
248
260
|
it('should build bid array for banner', function () {
|
|
249
261
|
expect(result.length).to.equal(1);
|
|
250
262
|
});
|
|
@@ -261,8 +273,11 @@ describe('ucfunnel Adapter', function () {
|
|
|
261
273
|
});
|
|
262
274
|
|
|
263
275
|
describe('handle banner cpm under bidfloor', function () {
|
|
264
|
-
|
|
265
|
-
|
|
276
|
+
let request, result;
|
|
277
|
+
before(() => {
|
|
278
|
+
request = spec.buildRequests([ validBannerBidReq ], bidderRequest);
|
|
279
|
+
result = spec.interpretResponse({body: invalidBannerBidRes}, request[0]);
|
|
280
|
+
})
|
|
266
281
|
it('should build bid array for banner', function () {
|
|
267
282
|
expect(result.length).to.equal(1);
|
|
268
283
|
});
|
|
@@ -279,8 +294,11 @@ describe('ucfunnel Adapter', function () {
|
|
|
279
294
|
});
|
|
280
295
|
|
|
281
296
|
describe('should support video', function () {
|
|
282
|
-
|
|
283
|
-
|
|
297
|
+
let request, result;
|
|
298
|
+
before(() => {
|
|
299
|
+
request = spec.buildRequests([ validVideoBidReq ], bidderRequest);
|
|
300
|
+
result = spec.interpretResponse({body: validVideoBidRes}, request[0]);
|
|
301
|
+
})
|
|
284
302
|
it('should build bid array', function () {
|
|
285
303
|
expect(result.length).to.equal(1);
|
|
286
304
|
});
|
|
@@ -299,8 +317,11 @@ describe('ucfunnel Adapter', function () {
|
|
|
299
317
|
});
|
|
300
318
|
|
|
301
319
|
describe('should support native', function () {
|
|
302
|
-
|
|
303
|
-
|
|
320
|
+
let request, result;
|
|
321
|
+
before(() => {
|
|
322
|
+
request = spec.buildRequests([ validNativeBidReq ], bidderRequest);
|
|
323
|
+
result = spec.interpretResponse({body: validNativeBidRes}, request[0]);
|
|
324
|
+
})
|
|
304
325
|
it('should build bid array', function () {
|
|
305
326
|
expect(result.length).to.equal(1);
|
|
306
327
|
});
|
|
@@ -86,6 +86,19 @@ describe('User ID', function () {
|
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
+
function createMockIdSubmodule(name, value, aliasName) {
|
|
90
|
+
return {
|
|
91
|
+
name,
|
|
92
|
+
getId() {
|
|
93
|
+
return value;
|
|
94
|
+
},
|
|
95
|
+
decode(v) {
|
|
96
|
+
return v;
|
|
97
|
+
},
|
|
98
|
+
aliasName
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
89
102
|
function getAdUnitMock(code = 'adUnit-code') {
|
|
90
103
|
return {
|
|
91
104
|
code,
|
|
@@ -109,12 +122,6 @@ describe('User ID', function () {
|
|
|
109
122
|
return cfg;
|
|
110
123
|
}
|
|
111
124
|
|
|
112
|
-
function findEid(eids, source) {
|
|
113
|
-
return find(eids, (eid) => {
|
|
114
|
-
if (eid.source === source) { return true; }
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
|
|
118
125
|
let sandbox, consentData, startDelay, callbackDelay;
|
|
119
126
|
|
|
120
127
|
function clearStack() {
|
|
@@ -397,6 +404,139 @@ describe('User ID', function () {
|
|
|
397
404
|
})
|
|
398
405
|
});
|
|
399
406
|
|
|
407
|
+
it('pbjs.getUserIds(Async) should prioritize user ids according to config available to core', () => {
|
|
408
|
+
init(config);
|
|
409
|
+
|
|
410
|
+
setSubmoduleRegistry([
|
|
411
|
+
createMockIdSubmodule('mockId1Module', {id: {mockId1: 'mockId1_value'}}),
|
|
412
|
+
createMockIdSubmodule('mockId2Module', {id: {mockId2: 'mockId2_value', mockId3: 'mockId3_value_from_mockId2Module'}}),
|
|
413
|
+
createMockIdSubmodule('mockId3Module', {id: {mockId1: 'mockId1_value_from_mockId3Module', mockId2: 'mockId2_value_from_mockId3Module', mockId3: 'mockId3_value', mockId4: 'mockId4_value_from_mockId3Module'}}),
|
|
414
|
+
createMockIdSubmodule('mockId4Module', {id: {mockId4: 'mockId4_value'}})
|
|
415
|
+
]);
|
|
416
|
+
|
|
417
|
+
config.setConfig({
|
|
418
|
+
userSync: {
|
|
419
|
+
idPriority: {
|
|
420
|
+
mockId1: ['mockId3Module', 'mockId1Module'],
|
|
421
|
+
mockId4: ['mockId4Module', 'mockId3Module']
|
|
422
|
+
},
|
|
423
|
+
auctionDelay: 10, // with auctionDelay > 0, no auction is needed to complete init
|
|
424
|
+
userIds: [
|
|
425
|
+
{ name: 'mockId1Module' },
|
|
426
|
+
{ name: 'mockId2Module' },
|
|
427
|
+
{ name: 'mockId3Module' },
|
|
428
|
+
{ name: 'mockId4Module' }
|
|
429
|
+
]
|
|
430
|
+
}
|
|
431
|
+
});
|
|
432
|
+
|
|
433
|
+
return getGlobal().getUserIdsAsync().then((uids) => {
|
|
434
|
+
expect(uids['mockId1']).to.deep.equal('mockId1_value_from_mockId3Module');
|
|
435
|
+
expect(uids['mockId2']).to.deep.equal('mockId2_value');
|
|
436
|
+
expect(uids['mockId3']).to.deep.equal('mockId3_value_from_mockId2Module');
|
|
437
|
+
expect(uids['mockId4']).to.deep.equal('mockId4_value');
|
|
438
|
+
});
|
|
439
|
+
});
|
|
440
|
+
|
|
441
|
+
it('pbjs.getUserIds(Async) should prioritize user ids according to config available to core when config uses aliases', () => {
|
|
442
|
+
init(config);
|
|
443
|
+
|
|
444
|
+
setSubmoduleRegistry([
|
|
445
|
+
createMockIdSubmodule('mockId1Module', {id: {mockId1: 'mockId1_value'}}),
|
|
446
|
+
createMockIdSubmodule('mockId2Module', {id: {mockId2: 'mockId2_value', mockId3: 'mockId3_value_from_mockId2Module'}}, 'mockId2Module_alias'),
|
|
447
|
+
createMockIdSubmodule('mockId3Module', {id: {mockId1: 'mockId1_value_from_mockId3Module', mockId2: 'mockId2_value_from_mockId3Module', mockId3: 'mockId3_value', mockId4: 'mockId4_value_from_mockId3Module'}}, 'mockId3Module_alias'),
|
|
448
|
+
createMockIdSubmodule('mockId4Module', {id: {mockId4: 'mockId4_value'}})
|
|
449
|
+
]);
|
|
450
|
+
|
|
451
|
+
config.setConfig({
|
|
452
|
+
userSync: {
|
|
453
|
+
idPriority: {
|
|
454
|
+
mockId1: ['mockId3Module_alias', 'mockId1Module'],
|
|
455
|
+
mockId4: ['mockId4Module', 'mockId3Module']
|
|
456
|
+
},
|
|
457
|
+
auctionDelay: 10, // with auctionDelay > 0, no auction is needed to complete init
|
|
458
|
+
userIds: [
|
|
459
|
+
{ name: 'mockId1Module' },
|
|
460
|
+
{ name: 'mockId2Module' },
|
|
461
|
+
{ name: 'mockId3Module' },
|
|
462
|
+
{ name: 'mockId4Module' }
|
|
463
|
+
]
|
|
464
|
+
}
|
|
465
|
+
});
|
|
466
|
+
|
|
467
|
+
return getGlobal().getUserIdsAsync().then((uids) => {
|
|
468
|
+
expect(uids['mockId1']).to.deep.equal('mockId1_value_from_mockId3Module');
|
|
469
|
+
expect(uids['mockId2']).to.deep.equal('mockId2_value');
|
|
470
|
+
expect(uids['mockId3']).to.deep.equal('mockId3_value_from_mockId2Module');
|
|
471
|
+
expect(uids['mockId4']).to.deep.equal('mockId4_value');
|
|
472
|
+
});
|
|
473
|
+
});
|
|
474
|
+
|
|
475
|
+
it('pbjs.getUserIds(Async) should prioritize user ids according to config available to core when called multiple times', () => {
|
|
476
|
+
init(config);
|
|
477
|
+
|
|
478
|
+
setSubmoduleRegistry([
|
|
479
|
+
createMockIdSubmodule('mockId1Module', {id: {mockId1: 'mockId1_value', mockId2: 'mockId2_value_from_mockId1Module'}}),
|
|
480
|
+
createMockIdSubmodule('mockId2Module', {id: {mockId1: 'mockId1_value_from_mockId2Module', mockId2: 'mockId2_value'}}),
|
|
481
|
+
]);
|
|
482
|
+
|
|
483
|
+
config.setConfig({
|
|
484
|
+
userSync: {
|
|
485
|
+
idPriority: {
|
|
486
|
+
mockId1: ['mockId2Module', 'mockId1Module'],
|
|
487
|
+
mockId2: ['mockId1Module', 'mockId2Module']
|
|
488
|
+
},
|
|
489
|
+
auctionDelay: 10, // with auctionDelay > 0, no auction is needed to complete init
|
|
490
|
+
userIds: [
|
|
491
|
+
{ name: 'mockId1Module' },
|
|
492
|
+
{ name: 'mockId2Module' }
|
|
493
|
+
]
|
|
494
|
+
}
|
|
495
|
+
});
|
|
496
|
+
|
|
497
|
+
return getGlobal().getUserIdsAsync().then((uidsFirstRequest) => {
|
|
498
|
+
getGlobal().getUserIdsAsync().then((uidsSecondRequest) => {
|
|
499
|
+
expect(uidsFirstRequest['mockId1']).to.deep.equal('mockId1_value_from_mockId2Module');
|
|
500
|
+
expect(uidsFirstRequest['mockId2']).to.deep.equal('mockId2_value_from_mockId1Module');
|
|
501
|
+
expect(uidsFirstRequest).to.deep.equal(uidsSecondRequest);
|
|
502
|
+
})
|
|
503
|
+
});
|
|
504
|
+
});
|
|
505
|
+
|
|
506
|
+
it('pbjs.getUserIds(Async) with priority config but no collision', () => {
|
|
507
|
+
init(config);
|
|
508
|
+
|
|
509
|
+
setSubmoduleRegistry([
|
|
510
|
+
createMockIdSubmodule('mockId1Module', {id: {mockId1: 'mockId1_value'}}),
|
|
511
|
+
createMockIdSubmodule('mockId2Module', {id: {mockId2: 'mockId2_value'}}),
|
|
512
|
+
createMockIdSubmodule('mockId3Module', {id: undefined}),
|
|
513
|
+
createMockIdSubmodule('mockId4Module', {id: {mockId4: 'mockId4_value'}})
|
|
514
|
+
]);
|
|
515
|
+
|
|
516
|
+
config.setConfig({
|
|
517
|
+
userSync: {
|
|
518
|
+
idPriority: {
|
|
519
|
+
mockId1: ['mockId3Module', 'mockId1Module'],
|
|
520
|
+
mockId4: ['mockId2Module', 'mockId4Module']
|
|
521
|
+
},
|
|
522
|
+
auctionDelay: 10, // with auctionDelay > 0, no auction is needed to complete init
|
|
523
|
+
userIds: [
|
|
524
|
+
{ name: 'mockId1Module' },
|
|
525
|
+
{ name: 'mockId2Module' },
|
|
526
|
+
{ name: 'mockId3Module' },
|
|
527
|
+
{ name: 'mockId4Module' }
|
|
528
|
+
]
|
|
529
|
+
}
|
|
530
|
+
});
|
|
531
|
+
|
|
532
|
+
return getGlobal().getUserIdsAsync().then((uids) => {
|
|
533
|
+
expect(uids['mockId1']).to.deep.equal('mockId1_value');
|
|
534
|
+
expect(uids['mockId2']).to.deep.equal('mockId2_value');
|
|
535
|
+
expect(uids['mockId3']).to.be.undefined;
|
|
536
|
+
expect(uids['mockId4']).to.deep.equal('mockId4_value');
|
|
537
|
+
});
|
|
538
|
+
});
|
|
539
|
+
|
|
400
540
|
it('pbjs.getUserIdsAsEids', function (done) {
|
|
401
541
|
init(config);
|
|
402
542
|
setSubmoduleRegistry([sharedIdSystemSubmodule]);
|
|
@@ -416,6 +556,44 @@ describe('User ID', function () {
|
|
|
416
556
|
});
|
|
417
557
|
});
|
|
418
558
|
|
|
559
|
+
it('pbjs.getUserIdsAsEids should prioritize user ids according to config available to core', () => {
|
|
560
|
+
init(config);
|
|
561
|
+
setSubmoduleRegistry([
|
|
562
|
+
createMockIdSubmodule('mockId1Module', {id: {uid2: {id: 'uid2_value'}}}),
|
|
563
|
+
createMockIdSubmodule('mockId2Module', {id: {pubcid: 'pubcid_value', lipb: {lipbid: 'lipbid_value_from_mockId2Module'}}}),
|
|
564
|
+
createMockIdSubmodule('mockId3Module', {id: {uid2: {id: 'uid2_value_from_mockId3Module'}, pubcid: 'pubcid_value_from_mockId3Module', lipb: {lipbid: 'lipbid_value'}, merkleId: {id: 'merkleId_value_from_mockId3Module'}}}),
|
|
565
|
+
createMockIdSubmodule('mockId4Module', {id: {merkleId: {id: 'merkleId_value'}}})
|
|
566
|
+
]);
|
|
567
|
+
config.setConfig({
|
|
568
|
+
userSync: {
|
|
569
|
+
idPriority: {
|
|
570
|
+
uid2: ['mockId3Module', 'mockId1Module'],
|
|
571
|
+
merkleId: ['mockId4Module', 'mockId3Module']
|
|
572
|
+
},
|
|
573
|
+
auctionDelay: 10, // with auctionDelay > 0, no auction is needed to complete init
|
|
574
|
+
userIds: [
|
|
575
|
+
{ name: 'mockId1Module' },
|
|
576
|
+
{ name: 'mockId2Module' },
|
|
577
|
+
{ name: 'mockId3Module' },
|
|
578
|
+
{ name: 'mockId4Module' }
|
|
579
|
+
]
|
|
580
|
+
}
|
|
581
|
+
});
|
|
582
|
+
|
|
583
|
+
const ids = {
|
|
584
|
+
'uid2': { id: 'uid2_value_from_mockId3Module' },
|
|
585
|
+
'pubcid': 'pubcid_value',
|
|
586
|
+
'lipb': { lipbid: 'lipbid_value_from_mockId2Module' },
|
|
587
|
+
'merkleId': { id: 'merkleId_value' }
|
|
588
|
+
};
|
|
589
|
+
|
|
590
|
+
return getGlobal().getUserIdsAsync().then(() => {
|
|
591
|
+
const eids = getGlobal().getUserIdsAsEids();
|
|
592
|
+
const expected = createEidsArray(ids);
|
|
593
|
+
expect(eids).to.deep.equal(expected);
|
|
594
|
+
});
|
|
595
|
+
});
|
|
596
|
+
|
|
419
597
|
it('should set googletag ppid correctly', function () {
|
|
420
598
|
let adUnits = [getAdUnitMock()];
|
|
421
599
|
init(config);
|
|
@@ -441,6 +619,41 @@ describe('User ID', function () {
|
|
|
441
619
|
});
|
|
442
620
|
});
|
|
443
621
|
|
|
622
|
+
it('should set googletag ppid correctly when prioritized according to config available to core', () => {
|
|
623
|
+
let adUnits = [getAdUnitMock()];
|
|
624
|
+
init(config);
|
|
625
|
+
setSubmoduleRegistry([
|
|
626
|
+
// some of the ids are padded to have length >= 32 characters
|
|
627
|
+
createMockIdSubmodule('mockId1Module', {id: {uid2: {id: 'uid2_value_7ac66c0f148de9519b8bd264312c4d64'}}}),
|
|
628
|
+
createMockIdSubmodule('mockId2Module', {id: {pubcid: 'pubcid_value_7ac66c0f148de9519b8bd264312c4d64', lipb: {lipbid: 'lipbid_value_from_mockId2Module_7ac66c0f148de9519b8bd264312c4d64'}}}),
|
|
629
|
+
createMockIdSubmodule('mockId3Module', {id: {uid2: {id: 'uid2_value_from_mockId3Module_7ac66c0f148de9519b8bd264312c4d64'}, pubcid: 'pubcid_value_from_mockId3Module_7ac66c0f148de9519b8bd264312c4d64', lipb: {lipbid: 'lipbid_value_7ac66c0f148de9519b8bd264312c4d64'}, merkleId: {id: 'merkleId_value_from_mockId3Module_7ac66c0f148de9519b8bd264312c4d64'}}}),
|
|
630
|
+
createMockIdSubmodule('mockId4Module', {id: {merkleId: {id: 'merkleId_value_7ac66c0f148de9519b8bd264312c4d64'}}})
|
|
631
|
+
]);
|
|
632
|
+
|
|
633
|
+
// before ppid should not be set
|
|
634
|
+
expect(window.googletag._ppid).to.equal(undefined);
|
|
635
|
+
|
|
636
|
+
config.setConfig({
|
|
637
|
+
userSync: {
|
|
638
|
+
ppid: 'uidapi.com',
|
|
639
|
+
idPriority: {
|
|
640
|
+
uid2: ['mockId3Module', 'mockId1Module'],
|
|
641
|
+
merkleId: ['mockId4Module', 'mockId3Module']
|
|
642
|
+
},
|
|
643
|
+
userIds: [
|
|
644
|
+
{ name: 'mockId1Module' },
|
|
645
|
+
{ name: 'mockId2Module' },
|
|
646
|
+
{ name: 'mockId3Module' },
|
|
647
|
+
{ name: 'mockId4Module' }
|
|
648
|
+
]
|
|
649
|
+
}
|
|
650
|
+
});
|
|
651
|
+
|
|
652
|
+
return expectImmediateBidHook(() => {}, {adUnits}).then(() => {
|
|
653
|
+
expect(window.googletag._ppid).to.equal('uid2valuefrommockId3Module7ac66c0f148de9519b8bd264312c4d64');
|
|
654
|
+
});
|
|
655
|
+
});
|
|
656
|
+
|
|
444
657
|
describe('submodule callback', () => {
|
|
445
658
|
const TEST_KEY = 'testKey';
|
|
446
659
|
|
|
@@ -589,6 +802,40 @@ describe('User ID', function () {
|
|
|
589
802
|
})
|
|
590
803
|
});
|
|
591
804
|
|
|
805
|
+
it('should make PPID available to core and respect priority', () => {
|
|
806
|
+
init(config);
|
|
807
|
+
setSubmoduleRegistry([
|
|
808
|
+
// some of the ids are padded to have length >= 32 characters
|
|
809
|
+
createMockIdSubmodule('mockId1Module', {id: {uid2: {id: 'uid2_value_7ac66c0f148de9519b8bd264312c4d64'}}}),
|
|
810
|
+
createMockIdSubmodule('mockId2Module', {id: {pubcid: 'pubcid_value_7ac66c0f148de9519b8bd264312c4d64', lipb: {lipbid: 'lipbid_value_from_mockId2Module_7ac66c0f148de9519b8bd264312c4d64'}}}),
|
|
811
|
+
createMockIdSubmodule('mockId3Module', {id: {uid2: {id: 'uid2_value_from_mockId3Module_7ac66c0f148de9519b8bd264312c4d64'}, pubcid: 'pubcid_value_from_mockId3Module_7ac66c0f148de9519b8bd264312c4d64', lipb: {lipbid: 'lipbid_value_7ac66c0f148de9519b8bd264312c4d64'}, merkleId: {id: 'merkleId_value_from_mockId3Module_7ac66c0f148de9519b8bd264312c4d64'}}}),
|
|
812
|
+
createMockIdSubmodule('mockId4Module', {id: {merkleId: {id: 'merkleId_value_7ac66c0f148de9519b8bd264312c4d64'}}})
|
|
813
|
+
]);
|
|
814
|
+
|
|
815
|
+
// before ppid should not be set
|
|
816
|
+
expect(window.googletag._ppid).to.equal(undefined);
|
|
817
|
+
|
|
818
|
+
config.setConfig({
|
|
819
|
+
userSync: {
|
|
820
|
+
ppid: 'uidapi.com',
|
|
821
|
+
idPriority: {
|
|
822
|
+
uid2: ['mockId3Module', 'mockId1Module'],
|
|
823
|
+
merkleId: ['mockId4Module', 'mockId3Module']
|
|
824
|
+
},
|
|
825
|
+
userIds: [
|
|
826
|
+
{ name: 'mockId1Module' },
|
|
827
|
+
{ name: 'mockId2Module' },
|
|
828
|
+
{ name: 'mockId3Module' },
|
|
829
|
+
{ name: 'mockId4Module' }
|
|
830
|
+
]
|
|
831
|
+
}
|
|
832
|
+
});
|
|
833
|
+
|
|
834
|
+
return getGlobal().refreshUserIds().then(() => {
|
|
835
|
+
expect(getPPID()).to.eql('uid2valuefrommockId3Module7ac66c0f148de9519b8bd264312c4d64');
|
|
836
|
+
})
|
|
837
|
+
});
|
|
838
|
+
|
|
592
839
|
describe('refreshing before init is complete', () => {
|
|
593
840
|
const MOCK_ID = {'MOCKID': '1111'};
|
|
594
841
|
let mockIdCallback;
|
|
@@ -763,6 +1010,63 @@ describe('User ID', function () {
|
|
|
763
1010
|
});
|
|
764
1011
|
});
|
|
765
1012
|
|
|
1013
|
+
it('pbjs.refreshUserIds updates priority config', () => {
|
|
1014
|
+
init(config);
|
|
1015
|
+
|
|
1016
|
+
setSubmoduleRegistry([
|
|
1017
|
+
createMockIdSubmodule('mockId1Module', {id: {mockId1: 'mockId1_value'}}),
|
|
1018
|
+
createMockIdSubmodule('mockId2Module', {id: {mockId2: 'mockId2_value', mockId3: 'mockId3_value_from_mockId2Module'}}),
|
|
1019
|
+
createMockIdSubmodule('mockId3Module', {id: {mockId1: 'mockId1_value_from_mockId3Module', mockId2: 'mockId2_value_from_mockId3Module', mockId3: 'mockId3_value', mockId4: 'mockId4_value_from_mockId3Module'}}),
|
|
1020
|
+
createMockIdSubmodule('mockId4Module', {id: {mockId4: 'mockId4_value'}})
|
|
1021
|
+
]);
|
|
1022
|
+
|
|
1023
|
+
config.setConfig({
|
|
1024
|
+
userSync: {
|
|
1025
|
+
idPriority: {
|
|
1026
|
+
mockId1: ['mockId3Module', 'mockId1Module'],
|
|
1027
|
+
mockId4: ['mockId4Module', 'mockId3Module']
|
|
1028
|
+
},
|
|
1029
|
+
auctionDelay: 10, // with auctionDelay > 0, no auction is needed to complete init
|
|
1030
|
+
userIds: [
|
|
1031
|
+
{ name: 'mockId1Module' },
|
|
1032
|
+
{ name: 'mockId2Module' },
|
|
1033
|
+
{ name: 'mockId3Module' },
|
|
1034
|
+
{ name: 'mockId4Module' }
|
|
1035
|
+
]
|
|
1036
|
+
}
|
|
1037
|
+
});
|
|
1038
|
+
|
|
1039
|
+
return getGlobal().getUserIdsAsync().then((uids) => {
|
|
1040
|
+
expect(uids['mockId1']).to.deep.equal('mockId1_value_from_mockId3Module');
|
|
1041
|
+
expect(uids['mockId2']).to.deep.equal('mockId2_value');
|
|
1042
|
+
expect(uids['mockId3']).to.deep.equal('mockId3_value_from_mockId2Module');
|
|
1043
|
+
expect(uids['mockId4']).to.deep.equal('mockId4_value');
|
|
1044
|
+
|
|
1045
|
+
config.setConfig({
|
|
1046
|
+
userSync: {
|
|
1047
|
+
idPriority: {
|
|
1048
|
+
mockId1: ['mockId1Module', 'mockId3Module'],
|
|
1049
|
+
mockId4: ['mockId3Module', 'mockId4Module']
|
|
1050
|
+
},
|
|
1051
|
+
auctionDelay: 10, // with auctionDelay > 0, no auction is needed to complete init
|
|
1052
|
+
userIds: [
|
|
1053
|
+
{ name: 'mockId1Module' },
|
|
1054
|
+
{ name: 'mockId2Module' },
|
|
1055
|
+
{ name: 'mockId3Module' },
|
|
1056
|
+
{ name: 'mockId4Module' }
|
|
1057
|
+
]
|
|
1058
|
+
}
|
|
1059
|
+
});
|
|
1060
|
+
|
|
1061
|
+
return getGlobal().getUserIdsAsync().then((uids) => {
|
|
1062
|
+
expect(uids['mockId1']).to.deep.equal('mockId1_value');
|
|
1063
|
+
expect(uids['mockId2']).to.deep.equal('mockId2_value');
|
|
1064
|
+
expect(uids['mockId3']).to.deep.equal('mockId3_value_from_mockId2Module');
|
|
1065
|
+
expect(uids['mockId4']).to.deep.equal('mockId4_value_from_mockId3Module');
|
|
1066
|
+
});
|
|
1067
|
+
});
|
|
1068
|
+
});
|
|
1069
|
+
|
|
766
1070
|
it('pbjs.refreshUserIds refreshes single', function() {
|
|
767
1071
|
coreStorage.setCookie('MOCKID', '', EXPIRED_COOKIE_DATE);
|
|
768
1072
|
coreStorage.setCookie('REFRESH', '', EXPIRED_COOKIE_DATE);
|
|
@@ -2950,6 +3254,50 @@ describe('User ID', function () {
|
|
|
2950
3254
|
}).catch(done);
|
|
2951
3255
|
});
|
|
2952
3256
|
|
|
3257
|
+
it('pbjs.getEncryptedEidsForSource should return prioritized id as non-encrypted string', (done) => {
|
|
3258
|
+
init(config);
|
|
3259
|
+
setSubmoduleRegistry([
|
|
3260
|
+
createMockIdSubmodule('mockId1Module', {id: {uid2: {id: 'uid2_value'}}}),
|
|
3261
|
+
createMockIdSubmodule('mockId2Module', {id: {pubcid: 'pubcid_value', lipb: {lipbid: 'lipbid_value_from_mockId2Module'}}}),
|
|
3262
|
+
createMockIdSubmodule('mockId3Module', {id: {uid2: {id: 'uid2_value_from_mockId3Module'}, pubcid: 'pubcid_value_from_mockId3Module', lipb: {lipbid: 'lipbid_value'}, merkleId: {id: 'merkleId_value_from_mockId3Module'}}}),
|
|
3263
|
+
createMockIdSubmodule('mockId4Module', {id: {merkleId: {id: 'merkleId_value'}}})
|
|
3264
|
+
]);
|
|
3265
|
+
config.setConfig({
|
|
3266
|
+
userSync: {
|
|
3267
|
+
idPriority: {
|
|
3268
|
+
uid2: ['mockId3Module', 'mockId1Module'],
|
|
3269
|
+
merkleId: ['mockId4Module', 'mockId3Module']
|
|
3270
|
+
},
|
|
3271
|
+
auctionDelay: 10, // with auctionDelay > 0, no auction is needed to complete init
|
|
3272
|
+
userIds: [
|
|
3273
|
+
{ name: 'mockId1Module' },
|
|
3274
|
+
{ name: 'mockId2Module' },
|
|
3275
|
+
{ name: 'mockId3Module' },
|
|
3276
|
+
{ name: 'mockId4Module' }
|
|
3277
|
+
]
|
|
3278
|
+
}
|
|
3279
|
+
});
|
|
3280
|
+
|
|
3281
|
+
const expctedIds = [
|
|
3282
|
+
'pubcid_value',
|
|
3283
|
+
'uid2_value_from_mockId3Module',
|
|
3284
|
+
'merkleId_value',
|
|
3285
|
+
'lipbid_value_from_mockId2Module'
|
|
3286
|
+
];
|
|
3287
|
+
|
|
3288
|
+
const encrypt = false;
|
|
3289
|
+
|
|
3290
|
+
Promise.all([
|
|
3291
|
+
getGlobal().getEncryptedEidsForSource('pubcid.org', encrypt),
|
|
3292
|
+
getGlobal().getEncryptedEidsForSource('uidapi.com', encrypt),
|
|
3293
|
+
getGlobal().getEncryptedEidsForSource('merkleinc.com', encrypt),
|
|
3294
|
+
getGlobal().getEncryptedEidsForSource('liveintent.com', encrypt)
|
|
3295
|
+
]).then((result) => {
|
|
3296
|
+
expect(result).to.deep.equal(expctedIds);
|
|
3297
|
+
done();
|
|
3298
|
+
})
|
|
3299
|
+
});
|
|
3300
|
+
|
|
2953
3301
|
describe('pbjs.getEncryptedEidsForSource', () => {
|
|
2954
3302
|
beforeEach(() => {
|
|
2955
3303
|
init(config);
|
|
@@ -3013,6 +3361,45 @@ describe('User ID', function () {
|
|
|
3013
3361
|
done();
|
|
3014
3362
|
});
|
|
3015
3363
|
});
|
|
3364
|
+
|
|
3365
|
+
it('pbjs.getUserIdsAsEidBySource with priority config available to core', () => {
|
|
3366
|
+
init(config);
|
|
3367
|
+
setSubmoduleRegistry([
|
|
3368
|
+
createMockIdSubmodule('mockId1Module', {id: {uid2: {id: 'uid2_value'}}}),
|
|
3369
|
+
createMockIdSubmodule('mockId2Module', {id: {pubcid: 'pubcid_value', lipb: {lipbid: 'lipbid_value_from_mockId2Module'}}}),
|
|
3370
|
+
createMockIdSubmodule('mockId3Module', {id: {uid2: {id: 'uid2_value_from_mockId3Module'}, pubcid: 'pubcid_value_from_mockId3Module', lipb: {lipbid: 'lipbid_value'}, merkleId: {id: 'merkleId_value_from_mockId3Module'}}}),
|
|
3371
|
+
createMockIdSubmodule('mockId4Module', {id: {merkleId: {id: 'merkleId_value'}}})
|
|
3372
|
+
]);
|
|
3373
|
+
config.setConfig({
|
|
3374
|
+
userSync: {
|
|
3375
|
+
idPriority: {
|
|
3376
|
+
uid2: ['mockId3Module', 'mockId1Module'],
|
|
3377
|
+
merkleId: ['mockId4Module', 'mockId3Module']
|
|
3378
|
+
},
|
|
3379
|
+
auctionDelay: 10, // with auctionDelay > 0, no auction is needed to complete init
|
|
3380
|
+
userIds: [
|
|
3381
|
+
{ name: 'mockId1Module' },
|
|
3382
|
+
{ name: 'mockId2Module' },
|
|
3383
|
+
{ name: 'mockId3Module' },
|
|
3384
|
+
{ name: 'mockId4Module' }
|
|
3385
|
+
]
|
|
3386
|
+
}
|
|
3387
|
+
});
|
|
3388
|
+
|
|
3389
|
+
const ids = {
|
|
3390
|
+
'uidapi.com': {'uid2': {id: 'uid2_value_from_mockId3Module'}},
|
|
3391
|
+
'pubcid.org': {'pubcid': 'pubcid_value'},
|
|
3392
|
+
'liveintent.com': {'lipb': {lipbid: 'lipbid_value_from_mockId2Module'}},
|
|
3393
|
+
'merkleinc.com': {'merkleId': {id: 'merkleId_value'}}
|
|
3394
|
+
};
|
|
3395
|
+
|
|
3396
|
+
return getGlobal().getUserIdsAsync().then(() => {
|
|
3397
|
+
expect(getGlobal().getUserIdsAsEidBySource('pubcid.org')).to.deep.equal(createEidsArray(ids['pubcid.org'])[0]);
|
|
3398
|
+
expect(getGlobal().getUserIdsAsEidBySource('uidapi.com')).to.deep.equal(createEidsArray(ids['uidapi.com'])[0]);
|
|
3399
|
+
expect(getGlobal().getUserIdsAsEidBySource('merkleinc.com')).to.deep.equal(createEidsArray(ids['merkleinc.com'])[0]);
|
|
3400
|
+
expect(getGlobal().getUserIdsAsEidBySource('liveintent.com')).to.deep.equal(createEidsArray(ids['liveintent.com'])[0]);
|
|
3401
|
+
});
|
|
3402
|
+
});
|
|
3016
3403
|
})
|
|
3017
3404
|
});
|
|
3018
3405
|
});
|