prebid.js 7.30.0 → 7.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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/adkernelBidAdapter.js +1 -1
- package/dist/adrelevantisBidAdapter.js +1 -1
- package/dist/adtrgtmeBidAdapter.js +1 -1
- package/dist/adxcgBidAdapter.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/bidglassBidAdapter.js +1 -1
- package/dist/big-richmediaBidAdapter.js +1 -1
- package/dist/bridgewellBidAdapter.js +1 -1
- package/dist/brightMountainMediaBidAdapter.js +1 -1
- package/dist/carodaBidAdapter.js +1 -1
- package/dist/chtnwBidAdapter.js +1 -1
- package/dist/concertBidAdapter.js +1 -1
- package/dist/confiantRtdProvider.js +1 -0
- package/dist/connectadBidAdapter.js +1 -1
- package/dist/consumableBidAdapter.js +1 -1
- package/dist/conversantBidAdapter.js +1 -1
- package/dist/craftBidAdapter.js +1 -1
- package/dist/criteoBidAdapter.js +1 -1
- package/dist/datawrkzBidAdapter.js +1 -1
- package/dist/dspxBidAdapter.js +1 -1
- package/dist/eplanningBidAdapter.js +1 -1
- package/dist/feedadBidAdapter.js +1 -1
- package/dist/finativeBidAdapter.js +1 -1
- package/dist/glimpseBidAdapter.js +1 -1
- package/dist/gmosspBidAdapter.js +1 -1
- package/dist/goldbachBidAdapter.js +1 -1
- package/dist/gridBidAdapter.js +1 -1
- package/dist/gridNMBidAdapter.js +1 -1
- package/dist/gumgumBidAdapter.js +1 -1
- package/dist/h12mediaBidAdapter.js +1 -1
- package/dist/id5IdSystem.js +1 -1
- package/dist/improvedigitalBidAdapter.js +1 -1
- package/dist/inmarBidAdapter.js +1 -1
- package/dist/insticatorBidAdapter.js +1 -1
- package/dist/ixBidAdapter.js +1 -1
- package/dist/justpremiumBidAdapter.js +1 -1
- package/dist/konduitAnalyticsAdapter.js +1 -1
- package/dist/kueezBidAdapter.js +1 -1
- package/dist/kueezRtbBidAdapter.js +1 -1
- package/dist/lassoBidAdapter.js +1 -1
- package/dist/lifestreetBidAdapter.js +1 -1
- package/dist/liveyieldAnalyticsAdapter.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/mediasquareBidAdapter.js +1 -1
- package/dist/mgidBidAdapter.js +1 -1
- package/dist/minutemediaBidAdapter.js +1 -1
- package/dist/nexx360BidAdapter.js +1 -1
- package/dist/not-for-prod/prebid.js +118 -117
- package/dist/oguryBidAdapter.js +1 -1
- package/dist/onetagBidAdapter.js +1 -1
- package/dist/ooloAnalyticsAdapter.js +1 -1
- package/dist/outbrainBidAdapter.js +1 -1
- package/dist/parrableIdSystem.js +1 -1
- package/dist/pbsExtensions.js +1 -1
- package/dist/pixfutureBidAdapter.js +1 -1
- package/dist/prebid-core.js +1 -1
- package/dist/prebidServerBidAdapter.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/rhythmoneBidAdapter.js +1 -1
- package/dist/riseBidAdapter.js +1 -1
- package/dist/rubiconAnalyticsAdapter.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/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/sublimeBidAdapter.js +1 -1
- package/dist/synacormediaBidAdapter.js +1 -1
- package/dist/targetVideoBidAdapter.js +1 -1
- package/dist/teadsBidAdapter.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/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/pbsExtensions/processors/adUnitCode.js +13 -0
- package/libraries/pbsExtensions/processors/pbs.js +5 -0
- package/modules/.submodules.json +1 -0
- package/modules/adkernelBidAdapter.js +2 -1
- package/modules/confiantRtdProvider.js +128 -0
- package/modules/confiantRtdProvider.md +45 -0
- package/modules/datawrkzBidAdapter.js +24 -4
- package/modules/feedadBidAdapter.js +11 -3
- package/modules/prebidServerBidAdapter/ortbConverter.js +1 -0
- package/package.json +1 -1
- package/src/adloader.js +2 -1
- package/src/prebid.js +7 -8
- package/test/spec/modules/confiantRtdProvider_spec.js +107 -0
- package/test/spec/modules/feedadBidAdapter_spec.js +38 -13
- package/test/spec/ortbConverter/pbsExtensions/adUnitCode_spec.js +23 -0
- package/test/spec/unit/pbjs_api_spec.js +11 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import * as utils from '../../../src/utils.js';
|
|
2
|
+
import * as hook from '../../../src/hook.js'
|
|
3
|
+
import * as events from '../../../src/events.js';
|
|
4
|
+
import CONSTANTS from '../../../src/constants.json';
|
|
5
|
+
|
|
6
|
+
import confiantModule from '../../../modules/confiantRtdProvider.js';
|
|
7
|
+
|
|
8
|
+
const {
|
|
9
|
+
injectConfigScript,
|
|
10
|
+
setupPage,
|
|
11
|
+
subscribeToConfiantCommFrame,
|
|
12
|
+
registerConfiantSubmodule
|
|
13
|
+
} = confiantModule;
|
|
14
|
+
|
|
15
|
+
describe('Confiant RTD module', function () {
|
|
16
|
+
describe('setupPage()', function() {
|
|
17
|
+
it('should return false if propertId is not present in config', function() {
|
|
18
|
+
expect(setupPage({})).to.be.false;
|
|
19
|
+
expect(setupPage({ params: {} })).to.be.false;
|
|
20
|
+
expect(setupPage({ params: { propertyId: '' } })).to.be.false;
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it('should return true if expected parameters are present', function() {
|
|
24
|
+
expect(setupPage({ params: { propertyId: 'clientId' } })).to.be.true;
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
describe('Module initialization', function() {
|
|
29
|
+
let insertElementStub;
|
|
30
|
+
beforeEach(function() {
|
|
31
|
+
insertElementStub = sinon.stub(utils, 'insertElement');
|
|
32
|
+
});
|
|
33
|
+
afterEach(function() {
|
|
34
|
+
utils.insertElement.restore();
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it('should subscribe to rovided Window object', function () {
|
|
38
|
+
const mockWindow = { addEventListener: sinon.spy() };
|
|
39
|
+
|
|
40
|
+
subscribeToConfiantCommFrame(mockWindow);
|
|
41
|
+
|
|
42
|
+
sinon.assert.calledOnce(mockWindow.addEventListener);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it('should fire BillableEvent as a result for message in comm window', function() {
|
|
46
|
+
let listenerCallback;
|
|
47
|
+
const mockWindow = { addEventListener: (a, cb) => (listenerCallback = cb) };
|
|
48
|
+
let billableEventsCounter = 0;
|
|
49
|
+
|
|
50
|
+
events.on(CONSTANTS.EVENTS.BILLABLE_EVENT, (e) => {
|
|
51
|
+
if (e.vendor === 'confiant') {
|
|
52
|
+
billableEventsCounter++;
|
|
53
|
+
expect(e.type).to.equal('impression');
|
|
54
|
+
expect(e.billingId).to.be.a('number');
|
|
55
|
+
expect(e.auctionId).to.equal('auctionId');
|
|
56
|
+
expect(e.transactionId).to.equal('transactionId');
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
subscribeToConfiantCommFrame(mockWindow);
|
|
61
|
+
listenerCallback({
|
|
62
|
+
data: {
|
|
63
|
+
auctionId: 'auctionId',
|
|
64
|
+
transactionId: 'transactionId'
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
listenerCallback({
|
|
68
|
+
data: {
|
|
69
|
+
auctionId: 'auctionId',
|
|
70
|
+
transactionId: 'transactionId'
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
expect(billableEventsCounter).to.equal(2);
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
describe('Sumbodule execution', function() {
|
|
79
|
+
let submoduleStub;
|
|
80
|
+
let insertElementStub;
|
|
81
|
+
beforeEach(function () {
|
|
82
|
+
submoduleStub = sinon.stub(hook, 'submodule');
|
|
83
|
+
insertElementStub = sinon.stub(utils, 'insertElement');
|
|
84
|
+
});
|
|
85
|
+
afterEach(function () {
|
|
86
|
+
utils.insertElement.restore();
|
|
87
|
+
submoduleStub.restore();
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
function initModule() {
|
|
91
|
+
registerConfiantSubmodule();
|
|
92
|
+
|
|
93
|
+
expect(submoduleStub.calledOnceWith('realTimeData')).to.equal(true);
|
|
94
|
+
|
|
95
|
+
const registeredSubmoduleDefinition = submoduleStub.getCall(0).args[1];
|
|
96
|
+
expect(registeredSubmoduleDefinition).to.be.an('object');
|
|
97
|
+
expect(registeredSubmoduleDefinition).to.have.own.property('name', 'confiant');
|
|
98
|
+
expect(registeredSubmoduleDefinition).to.have.own.property('init').that.is.a('function');
|
|
99
|
+
|
|
100
|
+
return registeredSubmoduleDefinition;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
it('should register Confiant submodule', function () {
|
|
104
|
+
initModule();
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
});
|
|
@@ -358,14 +358,20 @@ describe('FeedAdAdapter', function () {
|
|
|
358
358
|
const pixelSync2 = {type: 'image', url: 'the pixel url 2'};
|
|
359
359
|
const iFrameSync1 = {type: 'iframe', url: 'the iFrame url 1'};
|
|
360
360
|
const iFrameSync2 = {type: 'iframe', url: 'the iFrame url 2'};
|
|
361
|
+
const mockServerResponse = (content) => {
|
|
362
|
+
if (!(content instanceof Array)) {
|
|
363
|
+
content = [content];
|
|
364
|
+
}
|
|
365
|
+
return content.map(it => ({body: it}));
|
|
366
|
+
};
|
|
361
367
|
|
|
362
368
|
it('should pass through the syncs out of the extension fields of the server response', function () {
|
|
363
|
-
const serverResponse = [{
|
|
369
|
+
const serverResponse = mockServerResponse([{
|
|
364
370
|
ext: {
|
|
365
371
|
pixels: [pixelSync1, pixelSync2],
|
|
366
372
|
iframes: [iFrameSync1, iFrameSync2],
|
|
367
373
|
}
|
|
368
|
-
}];
|
|
374
|
+
}]);
|
|
369
375
|
const result = spec.getUserSyncs({iframeEnabled: true, pixelEnabled: true}, serverResponse)
|
|
370
376
|
expect(result).to.deep.equal([
|
|
371
377
|
pixelSync1,
|
|
@@ -376,7 +382,7 @@ describe('FeedAdAdapter', function () {
|
|
|
376
382
|
});
|
|
377
383
|
|
|
378
384
|
it('should concat the syncs of all responses', function () {
|
|
379
|
-
const serverResponse = [{
|
|
385
|
+
const serverResponse = mockServerResponse([{
|
|
380
386
|
ext: {
|
|
381
387
|
pixels: [pixelSync1],
|
|
382
388
|
iframes: [iFrameSync2],
|
|
@@ -391,7 +397,7 @@ describe('FeedAdAdapter', function () {
|
|
|
391
397
|
ext: {
|
|
392
398
|
pixels: [pixelSync2],
|
|
393
399
|
}
|
|
394
|
-
}];
|
|
400
|
+
}]);
|
|
395
401
|
const result = spec.getUserSyncs({iframeEnabled: true, pixelEnabled: true}, serverResponse);
|
|
396
402
|
expect(result).to.deep.equal([
|
|
397
403
|
pixelSync1,
|
|
@@ -402,7 +408,7 @@ describe('FeedAdAdapter', function () {
|
|
|
402
408
|
});
|
|
403
409
|
|
|
404
410
|
it('should filter out duplicates', function () {
|
|
405
|
-
const serverResponse = [{
|
|
411
|
+
const serverResponse = mockServerResponse([{
|
|
406
412
|
ext: {
|
|
407
413
|
pixels: [pixelSync1, pixelSync1],
|
|
408
414
|
iframes: [iFrameSync2, iFrameSync2],
|
|
@@ -411,7 +417,7 @@ describe('FeedAdAdapter', function () {
|
|
|
411
417
|
ext: {
|
|
412
418
|
iframes: [iFrameSync2, iFrameSync2],
|
|
413
419
|
}
|
|
414
|
-
}];
|
|
420
|
+
}]);
|
|
415
421
|
const result = spec.getUserSyncs({iframeEnabled: true, pixelEnabled: true}, serverResponse);
|
|
416
422
|
expect(result).to.deep.equal([
|
|
417
423
|
pixelSync1,
|
|
@@ -420,12 +426,12 @@ describe('FeedAdAdapter', function () {
|
|
|
420
426
|
});
|
|
421
427
|
|
|
422
428
|
it('should not include iFrame syncs if the option is disabled', function () {
|
|
423
|
-
const serverResponse = [{
|
|
429
|
+
const serverResponse = mockServerResponse([{
|
|
424
430
|
ext: {
|
|
425
431
|
pixels: [pixelSync1, pixelSync2],
|
|
426
432
|
iframes: [iFrameSync1, iFrameSync2],
|
|
427
433
|
}
|
|
428
|
-
}];
|
|
434
|
+
}]);
|
|
429
435
|
const result = spec.getUserSyncs({iframeEnabled: false, pixelEnabled: true}, serverResponse);
|
|
430
436
|
expect(result).to.deep.equal([
|
|
431
437
|
pixelSync1,
|
|
@@ -434,12 +440,12 @@ describe('FeedAdAdapter', function () {
|
|
|
434
440
|
});
|
|
435
441
|
|
|
436
442
|
it('should not include pixel syncs if the option is disabled', function () {
|
|
437
|
-
const serverResponse = [{
|
|
443
|
+
const serverResponse = mockServerResponse([{
|
|
438
444
|
ext: {
|
|
439
445
|
pixels: [pixelSync1, pixelSync2],
|
|
440
446
|
iframes: [iFrameSync1, iFrameSync2],
|
|
441
447
|
}
|
|
442
|
-
}];
|
|
448
|
+
}]);
|
|
443
449
|
const result = spec.getUserSyncs({iframeEnabled: true, pixelEnabled: false}, serverResponse);
|
|
444
450
|
expect(result).to.deep.equal([
|
|
445
451
|
iFrameSync1,
|
|
@@ -448,15 +454,34 @@ describe('FeedAdAdapter', function () {
|
|
|
448
454
|
});
|
|
449
455
|
|
|
450
456
|
it('should not include any syncs if the sync options are disabled or missing', function () {
|
|
451
|
-
const serverResponse = [{
|
|
457
|
+
const serverResponse = mockServerResponse([{
|
|
452
458
|
ext: {
|
|
453
459
|
pixels: [pixelSync1, pixelSync2],
|
|
454
460
|
iframes: [iFrameSync1, iFrameSync2],
|
|
455
461
|
}
|
|
456
|
-
}];
|
|
462
|
+
}]);
|
|
457
463
|
const result = spec.getUserSyncs({iframeEnabled: false, pixelEnabled: false}, serverResponse);
|
|
458
464
|
expect(result).to.deep.equal([]);
|
|
459
465
|
});
|
|
466
|
+
|
|
467
|
+
it('should handle empty responses', function () {
|
|
468
|
+
const serverResponse = mockServerResponse([]);
|
|
469
|
+
const result = spec.getUserSyncs({iframeEnabled: true, pixelEnabled: true}, serverResponse)
|
|
470
|
+
expect(result).to.deep.equal([]);
|
|
471
|
+
});
|
|
472
|
+
|
|
473
|
+
it('should not throw if the server response is weird', function () {
|
|
474
|
+
const responses = [
|
|
475
|
+
mockServerResponse(null),
|
|
476
|
+
mockServerResponse('null'),
|
|
477
|
+
mockServerResponse(1234),
|
|
478
|
+
mockServerResponse({}),
|
|
479
|
+
mockServerResponse([{}, 123]),
|
|
480
|
+
];
|
|
481
|
+
responses.forEach(it => {
|
|
482
|
+
expect(() => spec.getUserSyncs({iframeEnabled: true, pixelEnabled: true}, it)).not.to.throw;
|
|
483
|
+
});
|
|
484
|
+
});
|
|
460
485
|
});
|
|
461
486
|
|
|
462
487
|
describe('event tracking calls', function () {
|
|
@@ -592,7 +617,7 @@ describe('FeedAdAdapter', function () {
|
|
|
592
617
|
prebid_bid_id: bidId,
|
|
593
618
|
prebid_transaction_id: transactionId,
|
|
594
619
|
referer,
|
|
595
|
-
sdk_version: '1.0.
|
|
620
|
+
sdk_version: '1.0.4'
|
|
596
621
|
};
|
|
597
622
|
subject(data);
|
|
598
623
|
expect(server.requests.length).to.equal(1);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {setImpAdUnitCode} from '../../../../libraries/pbsExtensions/processors/adUnitCode.js';
|
|
2
|
+
|
|
3
|
+
describe('pbjs -> ortb adunit code to imp[].ext.prebid.adunitcode', () => {
|
|
4
|
+
function setImp(bidRequest) {
|
|
5
|
+
const imp = {};
|
|
6
|
+
setImpAdUnitCode(imp, bidRequest);
|
|
7
|
+
return imp;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
it('it sets adunitcode in ext.prebid.adunitcode when adUnitCode is present', () => {
|
|
11
|
+
expect(setImp({bidder: 'mockBidder', adUnitCode: 'mockAdUnit'})).to.eql({
|
|
12
|
+
'ext': {
|
|
13
|
+
'prebid': {
|
|
14
|
+
'adunitcode': 'mockAdUnit'
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
})
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('does not set adunitcode in ext.prebid.adunitcode if adUnit is undefined', () => {
|
|
21
|
+
expect(setImp({bidder: 'mockBidder'})).to.eql({});
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -1810,6 +1810,16 @@ describe('Unit: Prebid Module', function () {
|
|
|
1810
1810
|
})
|
|
1811
1811
|
});
|
|
1812
1812
|
|
|
1813
|
+
it('filtering adUnits by adUnitCodes', () => {
|
|
1814
|
+
$$PREBID_GLOBAL$$.requestBids({
|
|
1815
|
+
adUnits: [{code: 'one'}, {code: 'two'}],
|
|
1816
|
+
adUnitCodes: 'two'
|
|
1817
|
+
});
|
|
1818
|
+
sinon.assert.calledWith(startAuctionStub, sinon.match({
|
|
1819
|
+
adUnits: [{code: 'two'}]
|
|
1820
|
+
}));
|
|
1821
|
+
});
|
|
1822
|
+
|
|
1813
1823
|
it('passing bidder-specific FPD as ortb2Fragments.bidder', () => {
|
|
1814
1824
|
configObj.setBidderConfig({
|
|
1815
1825
|
bidders: ['bidderA', 'bidderC'],
|
|
@@ -1869,6 +1879,7 @@ describe('Unit: Prebid Module', function () {
|
|
|
1869
1879
|
mediaTypes: {banner: {sizes: [[300, 250]]}},
|
|
1870
1880
|
bids: [{bidder: 'bd'}]
|
|
1871
1881
|
}],
|
|
1882
|
+
adUnitCodes: ['au'],
|
|
1872
1883
|
ortb2Fragments
|
|
1873
1884
|
});
|
|
1874
1885
|
sinon.assert.calledWith(newAuctionStub, sinon.match({
|