prebid.js 5.19.0 → 5.20.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.
Files changed (53) hide show
  1. package/modules/airgridRtdProvider.js +1 -1
  2. package/modules/appnexusBidAdapter.js +5 -3
  3. package/modules/atsAnalyticsAdapter.js +67 -46
  4. package/modules/atsAnalyticsAdapter.md +1 -0
  5. package/modules/betweenBidAdapter.js +2 -1
  6. package/modules/browsiRtdProvider.js +106 -18
  7. package/modules/cleanioRtdProvider.js +192 -0
  8. package/modules/cleanioRtdProvider.md +59 -0
  9. package/modules/deltaprojectsBidAdapter.js +252 -0
  10. package/modules/deltaprojectsBidAdapter.md +32 -0
  11. package/modules/gridBidAdapter.js +1 -0
  12. package/modules/ixBidAdapter.js +7 -1
  13. package/modules/jixieBidAdapter.js +8 -2
  14. package/modules/justpremiumBidAdapter.js +6 -1
  15. package/modules/livewrappedAnalyticsAdapter.js +5 -0
  16. package/modules/multibid/index.js +3 -3
  17. package/modules/nativoBidAdapter.js +5 -1
  18. package/modules/openxBidAdapter.js +1 -1
  19. package/modules/operaadsBidAdapter.js +21 -1
  20. package/modules/otmBidAdapter.js +146 -0
  21. package/modules/otmBidAdapter.md +27 -26
  22. package/modules/outbrainBidAdapter.js +5 -0
  23. package/modules/playwireBidAdapter.md +61 -0
  24. package/modules/rtdModule/index.js +2 -2
  25. package/modules/sonobiBidAdapter.js +7 -0
  26. package/modules/sortableBidAdapter.js +1 -0
  27. package/modules/teadsBidAdapter.js +3 -0
  28. package/modules/trustxBidAdapter.js +8 -6
  29. package/modules/ventesBidAdapter.js +370 -0
  30. package/modules/ventesBidAdapter.md +94 -0
  31. package/modules/yahoosspBidAdapter.js +6 -6
  32. package/package.json +1 -1
  33. package/src/auction.js +11 -11
  34. package/test/spec/modules/appnexusBidAdapter_spec.js +2 -1
  35. package/test/spec/modules/atsAnalyticsAdapter_spec.js +42 -9
  36. package/test/spec/modules/browsiRtdProvider_spec.js +62 -7
  37. package/test/spec/modules/cleanioRtdProvider_spec.js +188 -0
  38. package/test/spec/modules/deltaprojectsBidAdapter_spec.js +399 -0
  39. package/test/spec/modules/ixBidAdapter_spec.js +3 -3
  40. package/test/spec/modules/jixieBidAdapter_spec.js +13 -11
  41. package/test/spec/modules/justpremiumBidAdapter_spec.js +9 -2
  42. package/test/spec/modules/livewrappedAnalyticsAdapter_spec.js +23 -4
  43. package/test/spec/modules/multibid_spec.js +31 -31
  44. package/test/spec/modules/openxBidAdapter_spec.js +0 -26
  45. package/test/spec/modules/operaadsBidAdapter_spec.js +38 -6
  46. package/test/spec/modules/otmBidAdapter_spec.js +67 -0
  47. package/test/spec/modules/outbrainBidAdapter_spec.js +18 -0
  48. package/test/spec/modules/sonobiBidAdapter_spec.js +34 -1
  49. package/test/spec/modules/sortableBidAdapter_spec.js +11 -0
  50. package/test/spec/modules/teadsBidAdapter_spec.js +132 -0
  51. package/test/spec/modules/trustxBidAdapter_spec.js +3 -3
  52. package/test/spec/modules/ventesBidAdapter_spec.js +845 -0
  53. package/test/spec/unit/core/adapterManager_spec.js +2 -1
@@ -582,6 +582,138 @@ describe('teadsBidAdapter', () => {
582
582
  });
583
583
  });
584
584
 
585
+ describe('Global Placement Id', function () {
586
+ let bidRequests = [
587
+ {
588
+ 'bidder': 'teads',
589
+ 'params': {
590
+ 'placementId': 10433394,
591
+ 'pageId': 1234
592
+ },
593
+ 'adUnitCode': 'adunit-code-1',
594
+ 'sizes': [[300, 250], [300, 600]],
595
+ 'bidId': '30b31c1838de1e',
596
+ 'bidderRequestId': '22edbae2733bf6',
597
+ 'auctionId': '1d1a030790a475',
598
+ 'creativeId': 'er2ee',
599
+ 'deviceWidth': 1680
600
+ },
601
+ {
602
+ 'bidder': 'teads',
603
+ 'params': {
604
+ 'placementId': 10433395,
605
+ 'pageId': 1234
606
+ },
607
+ 'adUnitCode': 'adunit-code-2',
608
+ 'sizes': [[300, 250], [300, 600]],
609
+ 'bidId': '30b31c1838de1f',
610
+ 'bidderRequestId': '22edbae2733bf6',
611
+ 'auctionId': '1d1a030790a475',
612
+ 'creativeId': 'er2ef',
613
+ 'deviceWidth': 1680
614
+ }
615
+ ];
616
+
617
+ it('should add gpid if ortb2Imp.ext.data.pbadslot is present and is non empty (and ortb2Imp.ext.data.adserver.adslot is not present)', function () {
618
+ const updatedBidRequests = bidRequests.map(function(bidRequest, index) {
619
+ return {
620
+ ...bidRequest,
621
+ ortb2Imp: {
622
+ ext: {
623
+ data: {
624
+ pbadslot: '1111/home-left-' + index
625
+ }
626
+ }
627
+ }
628
+ };
629
+ }
630
+ );
631
+ const request = spec.buildRequests(updatedBidRequests, bidderResquestDefault);
632
+ const payload = JSON.parse(request.data);
633
+
634
+ expect(payload.data[0].gpid).to.equal('1111/home-left-0');
635
+ expect(payload.data[1].gpid).to.equal('1111/home-left-1');
636
+ });
637
+
638
+ it('should add gpid if ortb2Imp.ext.data.pbadslot is present and is non empty (even if ortb2Imp.ext.data.adserver.adslot is present and is non empty too)', function () {
639
+ const updatedBidRequests = bidRequests.map(function(bidRequest, index) {
640
+ return {
641
+ ...bidRequest,
642
+ ortb2Imp: {
643
+ ext: {
644
+ data: {
645
+ pbadslot: '1111/home-left-' + index,
646
+ adserver: {
647
+ adslot: '1111/home-left/div-' + index
648
+ }
649
+ }
650
+ }
651
+ }
652
+ };
653
+ }
654
+ );
655
+ const request = spec.buildRequests(updatedBidRequests, bidderResquestDefault);
656
+ const payload = JSON.parse(request.data);
657
+
658
+ expect(payload.data[0].gpid).to.equal('1111/home-left-0');
659
+ expect(payload.data[1].gpid).to.equal('1111/home-left-1');
660
+ });
661
+
662
+ it('should not add gpid if both ortb2Imp.ext.data.pbadslot and ortb2Imp.ext.data.adserver.adslot are present but empty', function () {
663
+ const updatedBidRequests = bidRequests.map(bidRequest => ({
664
+ ...bidRequest,
665
+ ortb2Imp: {
666
+ ext: {
667
+ data: {
668
+ pbadslot: '',
669
+ adserver: {
670
+ adslot: ''
671
+ }
672
+ }
673
+ }
674
+ }
675
+ }));
676
+
677
+ const request = spec.buildRequests(updatedBidRequests, bidderResquestDefault);
678
+ const payload = JSON.parse(request.data);
679
+
680
+ return payload.data.forEach(bid => {
681
+ expect(bid).not.to.have.property('gpid');
682
+ });
683
+ });
684
+
685
+ it('should not add gpid if both ortb2Imp.ext.data.pbadslot and ortb2Imp.ext.data.adserver.adslot are not present', function () {
686
+ const request = spec.buildRequests(bidRequests, bidderResquestDefault);
687
+ const payload = JSON.parse(request.data);
688
+
689
+ return payload.data.forEach(bid => {
690
+ expect(bid).not.to.have.property('gpid');
691
+ });
692
+ });
693
+
694
+ it('should add gpid if ortb2Imp.ext.data.pbadslot is not present but ortb2Imp.ext.data.adserver.adslot is present and is non empty', function () {
695
+ const updatedBidRequests = bidRequests.map(function(bidRequest, index) {
696
+ return {
697
+ ...bidRequest,
698
+ ortb2Imp: {
699
+ ext: {
700
+ data: {
701
+ adserver: {
702
+ adslot: '1111/home-left-' + index
703
+ }
704
+ }
705
+ }
706
+ }
707
+ };
708
+ });
709
+ const request = spec.buildRequests(updatedBidRequests, bidderResquestDefault);
710
+ const payload = JSON.parse(request.data);
711
+
712
+ expect(payload.data[0].gpid).to.equal('1111/home-left-0');
713
+ expect(payload.data[1].gpid).to.equal('1111/home-left-1');
714
+ });
715
+ });
716
+
585
717
  function checkMediaTypesSizes(mediaTypes, expectedSizes) {
586
718
  const bidRequestWithBannerSizes = Object.assign(bidRequests[0], mediaTypes);
587
719
  const requestWithBannerSizes = spec.buildRequests([bidRequestWithBannerSizes], bidderResquestDefault);
@@ -402,7 +402,7 @@ describe('TrustXAdapter', function () {
402
402
  });
403
403
 
404
404
  it('if segment is present in permutive targeting, payload must have right params', function () {
405
- const permSegments = ['test_perm_1', 'test_perm_2'];
405
+ const permSegments = [{id: 'test_perm_1'}, {id: 'test_perm_2'}];
406
406
  const bidRequestsWithPermutiveTargeting = bidRequests.map((bid) => {
407
407
  return Object.assign({
408
408
  rtd: {
@@ -421,8 +421,8 @@ describe('TrustXAdapter', function () {
421
421
  expect(payload.user.data).to.deep.equal([{
422
422
  name: 'permutive',
423
423
  segment: [
424
- {name: 'p_standard', value: permSegments[0]},
425
- {name: 'p_standard', value: permSegments[1]}
424
+ {name: 'p_standard', value: permSegments[0].id},
425
+ {name: 'p_standard', value: permSegments[1].id}
426
426
  ]
427
427
  }]);
428
428
  });