prebid.js 5.19.0 → 6.2.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 (161) hide show
  1. package/.babelrc.js +1 -10
  2. package/README.md +4 -2
  3. package/browsers.json +13 -37
  4. package/gulpfile.js +1 -0
  5. package/karma.conf.maker.js +1 -1
  6. package/modules/adheseBidAdapter.js +7 -2
  7. package/modules/adkernelBidAdapter.js +1 -0
  8. package/modules/adlivetechBidAdapter.md +61 -0
  9. package/modules/admixerBidAdapter.js +2 -1
  10. package/modules/adnuntiusBidAdapter.js +2 -1
  11. package/modules/adomikAnalyticsAdapter.js +10 -4
  12. package/modules/adplusBidAdapter.js +203 -0
  13. package/modules/adplusBidAdapter.md +39 -0
  14. package/modules/adyoulikeBidAdapter.js +7 -2
  15. package/modules/airgridRtdProvider.js +1 -1
  16. package/modules/appnexusBidAdapter.js +28 -5
  17. package/modules/atsAnalyticsAdapter.js +67 -46
  18. package/modules/atsAnalyticsAdapter.md +1 -0
  19. package/modules/beachfrontBidAdapter.js +14 -17
  20. package/modules/betweenBidAdapter.js +2 -1
  21. package/modules/browsiRtdProvider.js +106 -18
  22. package/modules/cleanioRtdProvider.js +192 -0
  23. package/modules/cleanioRtdProvider.md +59 -0
  24. package/modules/codefuelBidAdapter.js +1 -3
  25. package/modules/codefuelBidAdapter.md +3 -3
  26. package/modules/craftBidAdapter.js +5 -3
  27. package/modules/datablocksBidAdapter.js +3 -3
  28. package/modules/dchain.js +149 -0
  29. package/modules/dchain.md +45 -0
  30. package/modules/deepintentBidAdapter.js +1 -1
  31. package/modules/deltaprojectsBidAdapter.js +252 -0
  32. package/modules/deltaprojectsBidAdapter.md +32 -0
  33. package/modules/emx_digitalBidAdapter.js +9 -1
  34. package/modules/engageyaBidAdapter.js +68 -54
  35. package/modules/freewheel-sspBidAdapter.js +6 -0
  36. package/modules/glimpseBidAdapter.js +31 -16
  37. package/modules/goldbachBidAdapter.js +1176 -0
  38. package/modules/goldbachBidAdapter.md +151 -0
  39. package/modules/gptPreAuction.js +11 -5
  40. package/modules/gridBidAdapter.js +1 -0
  41. package/modules/gumgumBidAdapter.js +5 -1
  42. package/modules/id5IdSystem.md +6 -6
  43. package/modules/imRtdProvider.js +31 -0
  44. package/modules/intersectionRtdProvider.js +114 -0
  45. package/modules/invibesBidAdapter.js +15 -9
  46. package/modules/ipromBidAdapter.js +79 -0
  47. package/modules/ixBidAdapter.js +173 -22
  48. package/modules/jixieBidAdapter.js +8 -2
  49. package/modules/justpremiumBidAdapter.js +6 -1
  50. package/modules/limelightDigitalBidAdapter.js +2 -1
  51. package/modules/livewrappedAnalyticsAdapter.js +5 -0
  52. package/modules/luponmediaBidAdapter.js +570 -0
  53. package/modules/merkleIdSystem.js +5 -0
  54. package/modules/missenaBidAdapter.js +89 -0
  55. package/modules/multibid/index.js +3 -3
  56. package/modules/nativoBidAdapter.js +32 -2
  57. package/modules/oguryBidAdapter.js +2 -1
  58. package/modules/openxBidAdapter.js +7 -2
  59. package/modules/operaadsBidAdapter.js +21 -1
  60. package/modules/otmBidAdapter.js +146 -0
  61. package/modules/otmBidAdapter.md +27 -26
  62. package/modules/outbrainBidAdapter.js +5 -0
  63. package/modules/playwireBidAdapter.md +61 -0
  64. package/modules/prebidServerBidAdapter/index.js +3 -3
  65. package/modules/pubmaticBidAdapter.js +5 -3
  66. package/modules/relaidoBidAdapter.js +86 -65
  67. package/modules/richaudienceBidAdapter.js +1 -1
  68. package/modules/rtdModule/index.js +2 -2
  69. package/modules/saambaaBidAdapter.js +420 -0
  70. package/modules/saambaaBidAdapter.md +65 -68
  71. package/modules/seedtagBidAdapter.js +6 -0
  72. package/modules/smaatoBidAdapter.js +9 -1
  73. package/modules/smartxBidAdapter.js +17 -1
  74. package/modules/sonobiBidAdapter.js +7 -0
  75. package/modules/sortableBidAdapter.js +1 -0
  76. package/modules/sspBCBidAdapter.js +34 -3
  77. package/modules/tappxBidAdapter.js +3 -1
  78. package/modules/teadsBidAdapter.js +3 -0
  79. package/modules/trustxBidAdapter.js +18 -7
  80. package/modules/undertoneBidAdapter.js +8 -1
  81. package/modules/userId/index.js +27 -2
  82. package/modules/ventes.md +71 -0
  83. package/modules/ventesBidAdapter.js +410 -0
  84. package/modules/ventesBidAdapter.md +93 -0
  85. package/modules/vidoomyBidAdapter.js +51 -100
  86. package/modules/visxBidAdapter.js +20 -3
  87. package/modules/visxBidAdapter.md +4 -6
  88. package/modules/yahoosspBidAdapter.js +6 -6
  89. package/modules/yahoosspBidAdapter.md +1 -1
  90. package/modules/yieldlabBidAdapter.js +41 -10
  91. package/modules/yieldlabBidAdapter.md +91 -48
  92. package/modules/yieldoneBidAdapter.js +115 -11
  93. package/package.json +6 -1
  94. package/src/adapterManager.js +14 -8
  95. package/src/auction.js +14 -13
  96. package/src/targeting.js +2 -2
  97. package/src/utils.js +7 -0
  98. package/test/spec/integration/faker/googletag.js +6 -0
  99. package/test/spec/modules/adheseBidAdapter_spec.js +27 -1
  100. package/test/spec/modules/adnuntiusBidAdapter_spec.js +18 -0
  101. package/test/spec/modules/adomikAnalyticsAdapter_spec.js +3 -1
  102. package/test/spec/modules/adplusBidAdapter_spec.js +213 -0
  103. package/test/spec/modules/adyoulikeBidAdapter_spec.js +26 -0
  104. package/test/spec/modules/appnexusBidAdapter_spec.js +65 -2
  105. package/test/spec/modules/atsAnalyticsAdapter_spec.js +42 -9
  106. package/test/spec/modules/beachfrontBidAdapter_spec.js +65 -1
  107. package/test/spec/modules/browsiRtdProvider_spec.js +62 -7
  108. package/test/spec/modules/cleanioRtdProvider_spec.js +188 -0
  109. package/test/spec/modules/codefuelBidAdapter_spec.js +1 -1
  110. package/test/spec/modules/datablocksBidAdapter_spec.js +3 -3
  111. package/test/spec/modules/dchain_spec.js +329 -0
  112. package/test/spec/modules/deltaprojectsBidAdapter_spec.js +399 -0
  113. package/test/spec/modules/emx_digitalBidAdapter_spec.js +10 -0
  114. package/test/spec/modules/engageyaBidAdapter_spec.js +231 -95
  115. package/test/spec/modules/eplanningBidAdapter_spec.js +8 -8
  116. package/test/spec/modules/freewheel-sspBidAdapter_spec.js +19 -0
  117. package/test/spec/modules/glimpseBidAdapter_spec.js +33 -0
  118. package/test/spec/modules/goldbachBidAdapter_spec.js +1359 -0
  119. package/test/spec/modules/gptPreAuction_spec.js +58 -4
  120. package/test/spec/modules/gumgumBidAdapter_spec.js +6 -0
  121. package/test/spec/modules/imRtdProvider_spec.js +25 -0
  122. package/test/spec/modules/intersectionRtdProvider_spec.js +141 -0
  123. package/test/spec/modules/invibesBidAdapter_spec.js +29 -4
  124. package/test/spec/modules/ipromBidAdapter_spec.js +195 -0
  125. package/test/spec/modules/ixBidAdapter_spec.js +288 -5
  126. package/test/spec/modules/jixieBidAdapter_spec.js +13 -11
  127. package/test/spec/modules/justpremiumBidAdapter_spec.js +9 -2
  128. package/test/spec/modules/konduitWrapper_spec.js +0 -1
  129. package/test/spec/modules/limelightDigitalBidAdapter_spec.js +10 -7
  130. package/test/spec/modules/livewrappedAnalyticsAdapter_spec.js +23 -4
  131. package/test/spec/modules/luponmediaBidAdapter_spec.js +412 -0
  132. package/test/spec/modules/merkleIdSystem_spec.js +18 -0
  133. package/test/spec/modules/missenaBidAdapter_spec.js +134 -0
  134. package/test/spec/modules/multibid_spec.js +31 -31
  135. package/test/spec/modules/nativoBidAdapter_spec.js +35 -18
  136. package/test/spec/modules/oguryBidAdapter_spec.js +13 -11
  137. package/test/spec/modules/openxBidAdapter_spec.js +5 -26
  138. package/test/spec/modules/operaadsBidAdapter_spec.js +38 -6
  139. package/test/spec/modules/otmBidAdapter_spec.js +67 -0
  140. package/test/spec/modules/outbrainBidAdapter_spec.js +18 -0
  141. package/test/spec/modules/prebidServerBidAdapter_spec.js +19 -2
  142. package/test/spec/modules/pubmaticBidAdapter_spec.js +1 -1
  143. package/test/spec/modules/relaidoBidAdapter_spec.js +71 -63
  144. package/test/spec/modules/seedtagBidAdapter_spec.js +3 -0
  145. package/test/spec/modules/smaatoBidAdapter_spec.js +61 -0
  146. package/test/spec/modules/smartxBidAdapter_spec.js +9 -0
  147. package/test/spec/modules/sonobiBidAdapter_spec.js +34 -1
  148. package/test/spec/modules/sortableBidAdapter_spec.js +11 -0
  149. package/test/spec/modules/sspBCBidAdapter_spec.js +33 -3
  150. package/test/spec/modules/tappxBidAdapter_spec.js +4 -0
  151. package/test/spec/modules/teadsBidAdapter_spec.js +132 -0
  152. package/test/spec/modules/trustxBidAdapter_spec.js +45 -3
  153. package/test/spec/modules/userId_spec.js +51 -0
  154. package/test/spec/modules/ventesBidAdapter_spec.js +845 -0
  155. package/test/spec/modules/vidoomyBidAdapter_spec.js +32 -13
  156. package/test/spec/modules/visxBidAdapter_spec.js +121 -5
  157. package/test/spec/modules/yieldlabBidAdapter_spec.js +81 -0
  158. package/test/spec/modules/yieldoneBidAdapter_spec.js +299 -53
  159. package/test/spec/unit/core/adapterManager_spec.js +26 -7
  160. package/test/spec/unit/core/targeting_spec.js +44 -0
  161. package/wdio.conf.js +1 -1
@@ -82,7 +82,7 @@ describe('multibid adapter', function () {
82
82
  'sizes': [[300, 250]]
83
83
  }
84
84
  },
85
- 'adUnitCode': 'test-div',
85
+ 'adUnitCode': 'test.div',
86
86
  'transactionId': 'c153f3da-84f0-4be8-95cb-0647c458bc60',
87
87
  'sizes': [[300, 250]],
88
88
  'bidId': '2408ef83b84c9d',
@@ -106,7 +106,7 @@ describe('multibid adapter', function () {
106
106
  'sizes': [[300, 250]]
107
107
  }
108
108
  },
109
- 'adUnitCode': 'test-div',
109
+ 'adUnitCode': 'test.div',
110
110
  'transactionId': 'c153f3da-84f0-4be8-95cb-0647c458bc60',
111
111
  'sizes': [[300, 250]],
112
112
  'bidId': '2408ef83b84c9d',
@@ -197,14 +197,14 @@ describe('multibid adapter', function () {
197
197
  });
198
198
 
199
199
  it('adds original bids and does not modify', function () {
200
- let adUnitCode = 'test-div';
200
+ let adUnitCode = 'test.div';
201
201
  let bids = [{...bidArray[0]}, {...bidArray[1]}];
202
202
 
203
203
  addBidResponseHook(callbackFn, adUnitCode, {...bids[0]});
204
204
 
205
205
  expect(result).to.not.equal(null);
206
206
  expect(result.adUnitCode).to.not.equal(null);
207
- expect(result.adUnitCode).to.equal('test-div');
207
+ expect(result.adUnitCode).to.equal('test.div');
208
208
  expect(result.bid).to.not.equal(null);
209
209
  expect(result.bid).to.deep.equal(bids[0]);
210
210
 
@@ -214,13 +214,13 @@ describe('multibid adapter', function () {
214
214
 
215
215
  expect(result).to.not.equal(null);
216
216
  expect(result.adUnitCode).to.not.equal(null);
217
- expect(result.adUnitCode).to.equal('test-div');
217
+ expect(result.adUnitCode).to.equal('test.div');
218
218
  expect(result.bid).to.not.equal(null);
219
219
  expect(result.bid).to.deep.equal(bids[1]);
220
220
  });
221
221
 
222
222
  it('modifies and adds both bids based on multibid configuration', function () {
223
- let adUnitCode = 'test-div';
223
+ let adUnitCode = 'test.div';
224
224
  let bids = [{...bidArray[0]}, {...bidArray[1]}];
225
225
 
226
226
  config.setConfig({multibid: [{bidder: 'bidderA', maxBids: 2, targetBiddercodePrefix: 'bidA'}]});
@@ -232,7 +232,7 @@ describe('multibid adapter', function () {
232
232
 
233
233
  expect(result).to.not.equal(null);
234
234
  expect(result.adUnitCode).to.not.equal(null);
235
- expect(result.adUnitCode).to.equal('test-div');
235
+ expect(result.adUnitCode).to.equal('test.div');
236
236
  expect(result.bid).to.not.equal(null);
237
237
  expect(result.bid).to.deep.equal(bids[0]);
238
238
 
@@ -250,13 +250,13 @@ describe('multibid adapter', function () {
250
250
 
251
251
  expect(result).to.not.equal(null);
252
252
  expect(result.adUnitCode).to.not.equal(null);
253
- expect(result.adUnitCode).to.equal('test-div');
253
+ expect(result.adUnitCode).to.equal('test.div');
254
254
  expect(result.bid).to.not.equal(null);
255
255
  expect(result.bid).to.deep.equal(bids[1]);
256
256
  });
257
257
 
258
258
  it('only modifies bids defined in the multibid configuration', function () {
259
- let adUnitCode = 'test-div';
259
+ let adUnitCode = 'test.div';
260
260
  let bids = [{...bidArray[0]}, {...bidArray[1]}];
261
261
 
262
262
  bids.push({
@@ -276,7 +276,7 @@ describe('multibid adapter', function () {
276
276
 
277
277
  expect(result).to.not.equal(null);
278
278
  expect(result.adUnitCode).to.not.equal(null);
279
- expect(result.adUnitCode).to.equal('test-div');
279
+ expect(result.adUnitCode).to.equal('test.div');
280
280
  expect(result.bid).to.not.equal(null);
281
281
  expect(result.bid).to.deep.equal(bids[0]);
282
282
 
@@ -292,7 +292,7 @@ describe('multibid adapter', function () {
292
292
 
293
293
  expect(result).to.not.equal(null);
294
294
  expect(result.adUnitCode).to.not.equal(null);
295
- expect(result.adUnitCode).to.equal('test-div');
295
+ expect(result.adUnitCode).to.equal('test.div');
296
296
  expect(result.bid).to.not.equal(null);
297
297
  expect(result.bid).to.deep.equal(bids[1]);
298
298
 
@@ -302,13 +302,13 @@ describe('multibid adapter', function () {
302
302
 
303
303
  expect(result).to.not.equal(null);
304
304
  expect(result.adUnitCode).to.not.equal(null);
305
- expect(result.adUnitCode).to.equal('test-div');
305
+ expect(result.adUnitCode).to.equal('test.div');
306
306
  expect(result.bid).to.not.equal(null);
307
307
  expect(result.bid).to.deep.equal(bids[2]);
308
308
  });
309
309
 
310
310
  it('only modifies and returns bids under limit for a specifc bidder in the multibid configuration', function () {
311
- let adUnitCode = 'test-div';
311
+ let adUnitCode = 'test.div';
312
312
  let bids = [{...bidArray[0]}, {...bidArray[1]}];
313
313
 
314
314
  bids.push({
@@ -328,7 +328,7 @@ describe('multibid adapter', function () {
328
328
 
329
329
  expect(result).to.not.equal(null);
330
330
  expect(result.adUnitCode).to.not.equal(null);
331
- expect(result.adUnitCode).to.equal('test-div');
331
+ expect(result.adUnitCode).to.equal('test.div');
332
332
  expect(result.bid).to.not.equal(null);
333
333
  expect(result.bid).to.deep.equal(bids[0]);
334
334
 
@@ -344,7 +344,7 @@ describe('multibid adapter', function () {
344
344
 
345
345
  expect(result).to.not.equal(null);
346
346
  expect(result.adUnitCode).to.not.equal(null);
347
- expect(result.adUnitCode).to.equal('test-div');
347
+ expect(result.adUnitCode).to.equal('test.div');
348
348
  expect(result.bid).to.not.equal(null);
349
349
  expect(result.bid).to.deep.equal(bids[1]);
350
350
 
@@ -356,7 +356,7 @@ describe('multibid adapter', function () {
356
356
  });
357
357
 
358
358
  it('if no prefix in multibid configuration, modifies and returns bids under limit without preifx property', function () {
359
- let adUnitCode = 'test-div';
359
+ let adUnitCode = 'test.div';
360
360
  let bids = [{...bidArray[0]}, {...bidArray[1]}];
361
361
 
362
362
  bids.push({
@@ -375,7 +375,7 @@ describe('multibid adapter', function () {
375
375
 
376
376
  expect(result).to.not.equal(null);
377
377
  expect(result.adUnitCode).to.not.equal(null);
378
- expect(result.adUnitCode).to.equal('test-div');
378
+ expect(result.adUnitCode).to.equal('test.div');
379
379
  expect(result.bid).to.not.equal(null);
380
380
  expect(result.bid).to.deep.equal(bids[0]);
381
381
 
@@ -389,7 +389,7 @@ describe('multibid adapter', function () {
389
389
 
390
390
  expect(result).to.not.equal(null);
391
391
  expect(result.adUnitCode).to.not.equal(null);
392
- expect(result.adUnitCode).to.equal('test-div');
392
+ expect(result.adUnitCode).to.equal('test.div');
393
393
  expect(result.bid).to.not.equal(null);
394
394
  expect(result.bid).to.deep.equal(bids[1]);
395
395
 
@@ -401,7 +401,7 @@ describe('multibid adapter', function () {
401
401
  });
402
402
 
403
403
  it('does not include extra bids if cpm is less than floor value', function () {
404
- let adUnitCode = 'test-div';
404
+ let adUnitCode = 'test.div';
405
405
  let bids = [{...bidArrayAlt[1]}, {...bidArrayAlt[0]}, {...bidArrayAlt[2]}, {...bidArrayAlt[3]}];
406
406
 
407
407
  bids.map(bid => {
@@ -418,7 +418,7 @@ describe('multibid adapter', function () {
418
418
  floorRuleValue: 65,
419
419
  floorValue: 65,
420
420
  matchedFields: {
421
- gptSlot: 'test-div',
421
+ gptSlot: 'test.div',
422
422
  mediaType: 'banner'
423
423
  }
424
424
  }
@@ -435,7 +435,7 @@ describe('multibid adapter', function () {
435
435
 
436
436
  expect(result).to.not.equal(null);
437
437
  expect(result.adUnitCode).to.not.equal(null);
438
- expect(result.adUnitCode).to.equal('test-div');
438
+ expect(result.adUnitCode).to.equal('test.div');
439
439
  expect(result.bid).to.not.equal(null);
440
440
  expect(result.bid.bidder).to.equal('bidderA');
441
441
  expect(result.bid.targetingBidder).to.equal(undefined);
@@ -452,7 +452,7 @@ describe('multibid adapter', function () {
452
452
 
453
453
  expect(result).to.not.equal(null);
454
454
  expect(result.adUnitCode).to.not.equal(null);
455
- expect(result.adUnitCode).to.equal('test-div');
455
+ expect(result.adUnitCode).to.equal('test.div');
456
456
  expect(result.bid).to.not.equal(null);
457
457
  expect(result.bid.bidder).to.equal('bidderB');
458
458
  expect(result.bid.targetingBidder).to.equal(undefined);
@@ -463,14 +463,14 @@ describe('multibid adapter', function () {
463
463
 
464
464
  expect(result).to.not.equal(null);
465
465
  expect(result.adUnitCode).to.not.equal(null);
466
- expect(result.adUnitCode).to.equal('test-div');
466
+ expect(result.adUnitCode).to.equal('test.div');
467
467
  expect(result.bid).to.not.equal(null);
468
468
  expect(result.bid.bidder).to.equal('bidderC');
469
469
  expect(result.bid.targetingBidder).to.equal(undefined);
470
470
  });
471
471
 
472
472
  it('does include extra bids if cpm is not less than floor value', function () {
473
- let adUnitCode = 'test-div';
473
+ let adUnitCode = 'test.div';
474
474
  let bids = [{...bidArrayAlt[1]}, {...bidArrayAlt[0]}];
475
475
 
476
476
  bids.map(bid => {
@@ -487,7 +487,7 @@ describe('multibid adapter', function () {
487
487
  floorRuleValue: 25,
488
488
  floorValue: 25,
489
489
  matchedFields: {
490
- gptSlot: 'test-div',
490
+ gptSlot: 'test.div',
491
491
  mediaType: 'banner'
492
492
  }
493
493
  }
@@ -504,7 +504,7 @@ describe('multibid adapter', function () {
504
504
 
505
505
  expect(result).to.not.equal(null);
506
506
  expect(result.adUnitCode).to.not.equal(null);
507
- expect(result.adUnitCode).to.equal('test-div');
507
+ expect(result.adUnitCode).to.equal('test.div');
508
508
  expect(result.bid).to.not.equal(null);
509
509
  expect(result.bid.bidder).to.equal('bidderA');
510
510
  expect(result.bid.targetingBidder).to.equal(undefined);
@@ -518,7 +518,7 @@ describe('multibid adapter', function () {
518
518
 
519
519
  expect(result).to.not.equal(null);
520
520
  expect(result.adUnitCode).to.not.equal(null);
521
- expect(result.adUnitCode).to.equal('test-div');
521
+ expect(result.adUnitCode).to.equal('test.div');
522
522
  expect(result.bid).to.not.equal(null);
523
523
  expect(result.bid.bidder).to.equal('bidderA');
524
524
  expect(result.bid.targetingBidder).to.equal('bidA2');
@@ -578,7 +578,7 @@ describe('multibid adapter', function () {
578
578
 
579
579
  it('it sorts and creates dynamic alias on bidsReceived if multibid configuration found with prefix', function () {
580
580
  let modifiedBids = [{...bidArray[1]}, {...bidArray[0]}].map(bid => {
581
- addBidResponseHook(bidResponseCallback, 'test-div', {...bid});
581
+ addBidResponseHook(bidResponseCallback, 'test.div', {...bid});
582
582
 
583
583
  return bidResult;
584
584
  });
@@ -603,7 +603,7 @@ describe('multibid adapter', function () {
603
603
 
604
604
  it('it sorts by cpm treating dynamic alias as unique bid when no bid limit defined', function () {
605
605
  let modifiedBids = [{...bidArrayAlt[0]}, {...bidArrayAlt[2]}, {...bidArrayAlt[3]}, {...bidArrayAlt[1]}].map(bid => {
606
- addBidResponseHook(bidResponseCallback, 'test-div', {...bid});
606
+ addBidResponseHook(bidResponseCallback, 'test.div', {...bid});
607
607
 
608
608
  return bidResult;
609
609
  });
@@ -636,7 +636,7 @@ describe('multibid adapter', function () {
636
636
 
637
637
  it('it should filter out dynamic bid when bid limit is less than unique bid pool', function () {
638
638
  let modifiedBids = [{...bidArrayAlt[0]}, {...bidArrayAlt[2]}, {...bidArrayAlt[3]}, {...bidArrayAlt[1]}].map(bid => {
639
- addBidResponseHook(bidResponseCallback, 'test-div', {...bid});
639
+ addBidResponseHook(bidResponseCallback, 'test.div', {...bid});
640
640
 
641
641
  return bidResult;
642
642
  });
@@ -662,7 +662,7 @@ describe('multibid adapter', function () {
662
662
  config.setConfig({ multibid: [{bidder: 'bidderA', maxBids: 2, targetBiddercodePrefix: 'bidA'}] });
663
663
 
664
664
  let modifiedBids = [{...bidArrayAlt[0]}, {...bidArrayAlt[2]}, {...bidArrayAlt[3]}, {...bidArrayAlt[1]}].map(bid => {
665
- addBidResponseHook(bidResponseCallback, 'test-div', {...bid});
665
+ addBidResponseHook(bidResponseCallback, 'test.div', {...bid});
666
666
 
667
667
  return bidResult;
668
668
  });
@@ -8,29 +8,46 @@ import { spec } from 'modules/nativoBidAdapter.js'
8
8
  describe('nativoBidAdapterTests', function () {
9
9
  describe('isBidRequestValid', function () {
10
10
  let bid = {
11
- bidder: 'nativo',
12
- params: {
13
- placementId: '10433394',
14
- },
15
- adUnitCode: 'adunit-code',
16
- sizes: [
17
- [300, 250],
18
- [300, 600],
19
- ],
20
- bidId: '27b02036ccfa6e',
21
- bidderRequestId: '1372cd8bd8d6a8',
22
- auctionId: 'cfc467e4-2707-48da-becb-bcaab0b2c114',
11
+ bidder: 'nativo'
23
12
  }
24
13
 
25
- it('should return true when required params found', function () {
14
+ it('should return true if no params found', function () {
15
+ expect(spec.isBidRequestValid(bid)).to.equal(true)
16
+ })
17
+
18
+ it('should return true for valid placementId value', function () {
19
+ bid.params = {
20
+ placementId: '10433394',
21
+ }
22
+ expect(spec.isBidRequestValid(bid)).to.equal(true)
23
+ })
24
+
25
+ it('should return true for valid placementId value', function () {
26
+ bid.params = {
27
+ placementId: 10433394,
28
+ }
29
+ expect(spec.isBidRequestValid(bid)).to.equal(true)
30
+ })
31
+
32
+ it('should return false for invalid placementId value', function () {
33
+ bid.params = {
34
+ placementId: true,
35
+ }
36
+ expect(spec.isBidRequestValid(bid)).to.equal(false)
37
+ })
38
+
39
+ it('should return true for valid placementId value', function () {
40
+ bid.params = {
41
+ url: 'www.test.com',
42
+ }
26
43
  expect(spec.isBidRequestValid(bid)).to.equal(true)
27
44
  })
28
45
 
29
- it('should return true when params are not passed', function () {
30
- let bid2 = Object.assign({}, bid)
31
- delete bid2.params
32
- bid2.params = {}
33
- expect(spec.isBidRequestValid(bid2)).to.equal(true)
46
+ it('should return false for invalid placementId value', function () {
47
+ bid.params = {
48
+ url: 4567890,
49
+ }
50
+ expect(spec.isBidRequestValid(bid)).to.equal(false)
34
51
  })
35
52
  })
36
53
 
@@ -119,7 +119,7 @@ describe('OguryBidAdapter', function () {
119
119
  };
120
120
  });
121
121
 
122
- it('should return sync array with two elements of type image', () => {
122
+ it('should return syncs array with two elements of type image', () => {
123
123
  const userSyncs = spec.getUserSyncs(syncOptions, [], gdprConsent);
124
124
 
125
125
  expect(userSyncs).to.have.lengthOf(2);
@@ -129,7 +129,7 @@ describe('OguryBidAdapter', function () {
129
129
  expect(userSyncs[1].url).to.contain('https://ms-cookie-sync.presage.io/ttd/init-sync');
130
130
  });
131
131
 
132
- it('should set the same source as query param', () => {
132
+ it('should set the source as query param', () => {
133
133
  const userSyncs = spec.getUserSyncs(syncOptions, [], gdprConsent);
134
134
  expect(userSyncs[0].url).to.contain('source=prebid');
135
135
  expect(userSyncs[1].url).to.contain('source=prebid');
@@ -146,7 +146,7 @@ describe('OguryBidAdapter', function () {
146
146
  expect(spec.getUserSyncs(syncOptions, [], gdprConsent)).to.have.lengthOf(0);
147
147
  });
148
148
 
149
- it('should return sync array with two elements of type image when consentString is undefined', () => {
149
+ it('should return syncs array with two elements of type image when consentString is undefined', () => {
150
150
  gdprConsent = {
151
151
  gdprApplies: true,
152
152
  consentString: undefined
@@ -160,7 +160,7 @@ describe('OguryBidAdapter', function () {
160
160
  expect(userSyncs[1].url).to.equal('https://ms-cookie-sync.presage.io/ttd/init-sync?iab_string=&source=prebid')
161
161
  });
162
162
 
163
- it('should return sync array with two elements of type image when consentString is null', () => {
163
+ it('should return syncs array with two elements of type image when consentString is null', () => {
164
164
  gdprConsent = {
165
165
  gdprApplies: true,
166
166
  consentString: null
@@ -174,7 +174,7 @@ describe('OguryBidAdapter', function () {
174
174
  expect(userSyncs[1].url).to.equal('https://ms-cookie-sync.presage.io/ttd/init-sync?iab_string=&source=prebid')
175
175
  });
176
176
 
177
- it('should return sync array with two elements of type image when gdprConsent is undefined', () => {
177
+ it('should return syncs array with two elements of type image when gdprConsent is undefined', () => {
178
178
  gdprConsent = undefined;
179
179
 
180
180
  const userSyncs = spec.getUserSyncs(syncOptions, [], gdprConsent);
@@ -185,7 +185,7 @@ describe('OguryBidAdapter', function () {
185
185
  expect(userSyncs[1].url).to.equal('https://ms-cookie-sync.presage.io/ttd/init-sync?iab_string=&source=prebid')
186
186
  });
187
187
 
188
- it('should return sync array with two elements of type image when gdprConsent is null', () => {
188
+ it('should return syncs array with two elements of type image when gdprConsent is null', () => {
189
189
  gdprConsent = null;
190
190
 
191
191
  const userSyncs = spec.getUserSyncs(syncOptions, [], gdprConsent);
@@ -196,7 +196,7 @@ describe('OguryBidAdapter', function () {
196
196
  expect(userSyncs[1].url).to.equal('https://ms-cookie-sync.presage.io/ttd/init-sync?iab_string=&source=prebid')
197
197
  });
198
198
 
199
- it('should return sync array with two elements of type image when gdprConsent is null and gdprApplies is false', () => {
199
+ it('should return syncs array with two elements of type image when gdprConsent is null and gdprApplies is false', () => {
200
200
  gdprConsent = {
201
201
  gdprApplies: false,
202
202
  consentString: null
@@ -210,7 +210,7 @@ describe('OguryBidAdapter', function () {
210
210
  expect(userSyncs[1].url).to.equal('https://ms-cookie-sync.presage.io/ttd/init-sync?iab_string=&source=prebid')
211
211
  });
212
212
 
213
- it('should return sync array with two elements of type image when gdprConsent is empty string and gdprApplies is false', () => {
213
+ it('should return syncs array with two elements of type image when gdprConsent is empty string and gdprApplies is false', () => {
214
214
  gdprConsent = {
215
215
  gdprApplies: false,
216
216
  consentString: ''
@@ -240,7 +240,8 @@ describe('OguryBidAdapter', function () {
240
240
  w: 300,
241
241
  h: 250
242
242
  }]
243
- }
243
+ },
244
+ ext: bidRequests[0].params
244
245
  }, {
245
246
  id: bidRequests[1].bidId,
246
247
  tagid: bidRequests[1].params.adUnitId,
@@ -250,7 +251,8 @@ describe('OguryBidAdapter', function () {
250
251
  w: 600,
251
252
  h: 500
252
253
  }]
253
- }
254
+ },
255
+ ext: bidRequests[1].params
254
256
  }],
255
257
  regs: {
256
258
  ext: {
@@ -549,7 +551,7 @@ describe('OguryBidAdapter', function () {
549
551
  xhr.restore()
550
552
  })
551
553
 
552
- it('should send notification on bid timeout', function() {
554
+ it('should send on bid timeout notification', function() {
553
555
  const bid = {
554
556
  ad: '<img style="width: 300px; height: 250px;" src="https://assets.afcdn.com/recipe/20190529/93153_w1024h768c1cx2220cy1728cxt0cyt0cxb4441cyb3456.jpg" alt="cookies" />',
555
557
  cpm: 3
@@ -1102,6 +1102,11 @@ describe('OpenxAdapter', function () {
1102
1102
  mwOpenLinkId: '1111-mwopenlinkid',
1103
1103
  dapId: '1111-dapId',
1104
1104
  amxId: '1111-amxid',
1105
+ kpuid: '1111-kpuid',
1106
+ publinkId: '1111-publinkid',
1107
+ naveggId: '1111-naveggid',
1108
+ imuid: '1111-imuid',
1109
+ adtelligentId: '1111-adtelligentid'
1105
1110
  };
1106
1111
 
1107
1112
  // generates the same set of tests for each id provider
@@ -1602,32 +1607,6 @@ describe('OpenxAdapter', function () {
1602
1607
  scsm: 'dmp3/5:foo2|bar2,dmp4:baz2'
1603
1608
  },
1604
1609
  },
1605
- {
1606
- name: 'should not send duplicate proprietary segment data from first party config ',
1607
- config: {
1608
- ortb2: {
1609
- user: {
1610
- data: [
1611
- {name: 'dmp1', ext: {segtax: 4}, segment: [{id: 'foo'}, {id: 'bar'}, {id: 'foo'}]},
1612
- {name: 'dmp1', ext: {segtax: 4}, segment: [{id: 'foo'}, {id: 'bar'}]},
1613
- ]
1614
- },
1615
- site: {
1616
- content: {
1617
- data: [
1618
- {name: 'dmp1', ext: {segtax: 4}, segment: [{id: 'foo'}, {id: 'bar'}]},
1619
- {name: 'dmp3', ext: {segtax: 5}, segment: [{id: 'foo2'}, {id: 'foo2'}, {id: 'bar2'}]},
1620
- {name: 'dmp3', ext: {segtax: 5}, segment: [{id: 'foo2'}, {id: 'bar2'}]},
1621
- ]
1622
- }
1623
- }
1624
- }
1625
- },
1626
- expect: {
1627
- sm: 'dmp1/4:foo|bar',
1628
- scsm: 'dmp1/4:foo|bar,dmp3/5:foo2|bar2'
1629
- },
1630
- },
1631
1610
  {
1632
1611
  name: 'should combine same provider segment data from ortb2.user.data',
1633
1612
  config: {
@@ -369,7 +369,7 @@ describe('Opera Ads Bid Adapter', function () {
369
369
  requestData = JSON.parse(reqs[0].data);
370
370
  }).to.not.throw();
371
371
 
372
- expect(requestData.user.id).to.equal(bidRequests[0].userId.sharedid.id);
372
+ expect(requestData.user.buyeruid).to.equal(bidRequests[0].userId.sharedid.id);
373
373
  });
374
374
 
375
375
  it('pubcid should be used when sharedid is empty', function () {
@@ -406,7 +406,7 @@ describe('Opera Ads Bid Adapter', function () {
406
406
  requestData = JSON.parse(reqs[0].data);
407
407
  }).to.not.throw();
408
408
 
409
- expect(requestData.user.id).to.equal(bidRequests[0].userId.pubcid);
409
+ expect(requestData.user.buyeruid).to.equal(bidRequests[0].userId.pubcid);
410
410
  });
411
411
 
412
412
  it('random uid will be generate when userId is empty', function () {
@@ -433,7 +433,7 @@ describe('Opera Ads Bid Adapter', function () {
433
433
  requestData = JSON.parse(reqs[0].data);
434
434
  }).to.not.throw();
435
435
 
436
- expect(requestData.user.id).to.not.be.empty;
436
+ expect(requestData.user.buyeruid).to.not.be.empty;
437
437
  })
438
438
  });
439
439
 
@@ -679,9 +679,41 @@ describe('Opera Ads Bid Adapter', function () {
679
679
  });
680
680
  });
681
681
 
682
- describe('Test getUserSyncs', function () {
683
- it('getUserSyncs should return empty array', function () {
684
- expect(spec.getUserSyncs()).to.be.an('array').that.is.empty;
682
+ describe('Test getUserSyncs with both iframe and pixel disabled', function () {
683
+ it('getUserSyncs should return an empty array', function () {
684
+ const syncOptions = {};
685
+ expect(spec.getUserSyncs(syncOptions)).to.be.an('array').that.is.empty;
686
+ });
687
+ });
688
+
689
+ describe('Test getUserSyncs with iframe enabled', function () {
690
+ it('getUserSyncs should return array', function () {
691
+ const syncOptions = {
692
+ iframeEnabled: true
693
+ }
694
+ const userSyncPixels = spec.getUserSyncs(syncOptions)
695
+ expect(userSyncPixels).to.have.lengthOf(1);
696
+ expect(userSyncPixels[0].url).to.equal('https://s.adx.opera.com/usersync/page')
697
+ });
698
+ });
699
+
700
+ describe('Test getUserSyncs with pixel enabled', function () {
701
+ it('getUserSyncs should return array', function () {
702
+ const serverResponse = {
703
+ body: {
704
+ 'pixels': [
705
+ 'https://b1.com/usersync',
706
+ 'https://b2.com/usersync'
707
+ ]
708
+ }
709
+ };
710
+ const syncOptions = {
711
+ pixelEnabled: true
712
+ }
713
+ const userSyncPixels = spec.getUserSyncs(syncOptions, [serverResponse])
714
+ expect(userSyncPixels).to.have.lengthOf(2);
715
+ expect(userSyncPixels[0].url).to.equal('https://b1.com/usersync')
716
+ expect(userSyncPixels[1].url).to.equal('https://b2.com/usersync')
685
717
  });
686
718
  });
687
719
 
@@ -0,0 +1,67 @@
1
+ import {expect} from 'chai';
2
+ import {spec} from 'modules/otmBidAdapter';
3
+
4
+ describe('otmBidAdapter', function () {
5
+ it('validate_pub_params', function () {
6
+ expect(spec.isBidRequestValid({
7
+ bidder: 'otm',
8
+ params: {
9
+ tid: '123',
10
+ bidfloor: 20
11
+ }
12
+ })).to.equal(true);
13
+ });
14
+
15
+ it('validate_generated_params', function () {
16
+ let bidRequestData = [{
17
+ bidId: 'bid1234',
18
+ bidder: 'otm',
19
+ params: {
20
+ tid: '123',
21
+ bidfloor: 20
22
+ },
23
+ sizes: [[240, 400]]
24
+ }];
25
+
26
+ let request = spec.buildRequests(bidRequestData);
27
+ let req_data = request[0].data;
28
+
29
+ expect(req_data.bidid).to.equal('bid1234');
30
+ });
31
+
32
+ it('validate_response_params', function () {
33
+ let bidRequestData = {
34
+ data: {
35
+ bidId: 'bid1234'
36
+ }
37
+ };
38
+
39
+ let serverResponse = {
40
+ body: [
41
+ {
42
+ 'auctionid': '3c6f8e22-541b-485c-9214-e974d9fb1b6f',
43
+ 'cpm': 847.097,
44
+ 'ad': '<html><body>test html</body></html>',
45
+ 'w': 240,
46
+ 'h': 400,
47
+ 'currency': 'RUB',
48
+ 'ttl': 300,
49
+ 'creativeid': '1_7869053',
50
+ 'bidid': '101f211def7c99',
51
+ 'transactionid': 'transaction_id_1'
52
+ }
53
+ ]
54
+ };
55
+
56
+ let bids = spec.interpretResponse(serverResponse, bidRequestData);
57
+ expect(bids).to.have.lengthOf(1);
58
+ let bid = bids[0];
59
+ expect(bid.cpm).to.equal(847.097);
60
+ expect(bid.currency).to.equal('RUB');
61
+ expect(bid.width).to.equal(240);
62
+ expect(bid.height).to.equal(400);
63
+ expect(bid.netRevenue).to.equal(true);
64
+ expect(bid.requestId).to.equal('101f211def7c99');
65
+ expect(bid.ad).to.equal('<html><body>test html</body></html>');
66
+ });
67
+ });
@@ -2,6 +2,7 @@ import {expect} from 'chai';
2
2
  import {spec} from 'modules/outbrainBidAdapter.js';
3
3
  import {config} from 'src/config.js';
4
4
  import {server} from 'test/mocks/xhr';
5
+ import { createEidsArray } from 'modules/userId/eids.js';
5
6
 
6
7
  describe('Outbrain Adapter', function () {
7
8
  describe('Bid request and response', function () {
@@ -344,6 +345,23 @@ describe('Outbrain Adapter', function () {
344
345
 
345
346
  config.resetConfig()
346
347
  });
348
+
349
+ it('should pass extended ids', function () {
350
+ let bidRequest = {
351
+ bidId: 'bidId',
352
+ params: {},
353
+ userIdAsEids: createEidsArray({
354
+ idl_env: 'id-value',
355
+ }),
356
+ ...commonBidRequest,
357
+ };
358
+
359
+ let res = spec.buildRequests([bidRequest], commonBidderRequest);
360
+ const resData = JSON.parse(res.data)
361
+ expect(resData.user.ext.eids).to.deep.equal([
362
+ {source: 'liveramp.com', uids: [{id: 'id-value', atype: 3}]}
363
+ ]);
364
+ });
347
365
  })
348
366
 
349
367
  describe('interpretResponse', function () {