prebid.js 7.3.0 → 7.6.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 (225) hide show
  1. package/.circleci/config.yml +11 -6
  2. package/dist/33acrossBidAdapter.js +1 -1
  3. package/dist/adagioBidAdapter.js +1 -1
  4. package/dist/adbookpspBidAdapter.js +1 -1
  5. package/dist/adgenerationBidAdapter.js +1 -1
  6. package/dist/adnuntiusBidAdapter.js +1 -1
  7. package/dist/adotBidAdapter.js +1 -1
  8. package/dist/adpod.js +1 -1
  9. package/dist/adrelevantisBidAdapter.js +1 -1
  10. package/dist/adrinoBidAdapter.js +1 -1
  11. package/dist/adtelligentBidAdapter.js +1 -1
  12. package/dist/adxcgBidAdapter.js +1 -1
  13. package/dist/ajaBidAdapter.js +1 -1
  14. package/dist/amxBidAdapter.js +1 -1
  15. package/dist/amxIdSystem.js +1 -1
  16. package/dist/appierAnalyticsAdapter.js +1 -1
  17. package/dist/appnexusBidAdapter.js +1 -1
  18. package/dist/asoBidAdapter.js +1 -1
  19. package/dist/atsAnalyticsAdapter.js +1 -1
  20. package/dist/axonixBidAdapter.js +1 -1
  21. package/dist/bidglassBidAdapter.js +1 -1
  22. package/dist/big-richmediaBidAdapter.js +1 -1
  23. package/dist/bridgewellBidAdapter.js +1 -1
  24. package/dist/brightMountainMediaBidAdapter.js +1 -1
  25. package/dist/byDataAnalyticsAdapter.js +1 -1
  26. package/dist/concertBidAdapter.js +1 -1
  27. package/dist/connectadBidAdapter.js +1 -1
  28. package/dist/consumableBidAdapter.js +1 -1
  29. package/dist/conversantBidAdapter.js +1 -1
  30. package/dist/craftBidAdapter.js +1 -1
  31. package/dist/criteoBidAdapter.js +1 -1
  32. package/dist/debugging-standalone.js +1 -1
  33. package/dist/debugging.js +1 -1
  34. package/dist/dspxBidAdapter.js +1 -1
  35. package/dist/eplanningBidAdapter.js +1 -1
  36. package/dist/finativeBidAdapter.js +1 -1
  37. package/dist/gdprEnforcement.js +1 -1
  38. package/dist/glimpseBidAdapter.js +1 -1
  39. package/dist/gmosspBidAdapter.js +1 -1
  40. package/dist/goldbachBidAdapter.js +1 -1
  41. package/dist/gridBidAdapter.js +1 -1
  42. package/dist/gridNMBidAdapter.js +1 -1
  43. package/dist/gumgumBidAdapter.js +1 -1
  44. package/dist/h12mediaBidAdapter.js +1 -1
  45. package/dist/hadronIdSystem.js +1 -1
  46. package/dist/hadronRtdProvider.js +1 -1
  47. package/dist/id5IdSystem.js +1 -1
  48. package/dist/imRtdProvider.js +1 -1
  49. package/dist/improvedigitalBidAdapter.js +1 -1
  50. package/dist/inmarBidAdapter.js +1 -1
  51. package/dist/insticatorBidAdapter.js +1 -1
  52. package/dist/ixBidAdapter.js +1 -1
  53. package/dist/justpremiumBidAdapter.js +1 -1
  54. package/dist/kargoAnalyticsAdapter.js +1 -1
  55. package/dist/kargoBidAdapter.js +1 -1
  56. package/dist/konduitAnalyticsAdapter.js +1 -1
  57. package/dist/kueezBidAdapter.js +1 -1
  58. package/dist/lassoBidAdapter.js +1 -1
  59. package/dist/liveyieldAnalyticsAdapter.js +1 -1
  60. package/dist/logicadBidAdapter.js +1 -1
  61. package/dist/loglyliftBidAdapter.js +1 -1
  62. package/dist/malltvAnalyticsAdapter.js +1 -1
  63. package/dist/marsmediaBidAdapter.js +1 -1
  64. package/dist/mediafuseBidAdapter.js +1 -1
  65. package/dist/mediasquareBidAdapter.js +1 -1
  66. package/dist/mgidBidAdapter.js +1 -1
  67. package/dist/minutemediaBidAdapter.js +1 -1
  68. package/dist/missenaBidAdapter.js +1 -1
  69. package/dist/newspassidBidAdapter.js +1 -0
  70. package/dist/nextMillenniumBidAdapter.js +1 -1
  71. package/dist/not-for-prod/prebid.js +131 -127
  72. package/dist/oguryBidAdapter.js +1 -1
  73. package/dist/onetagBidAdapter.js +1 -1
  74. package/dist/ooloAnalyticsAdapter.js +1 -1
  75. package/dist/openxOrtbBidAdapter.js +1 -0
  76. package/dist/outbrainBidAdapter.js +1 -1
  77. package/dist/parrableIdSystem.js +1 -1
  78. package/dist/pixfutureBidAdapter.js +1 -1
  79. package/dist/prebid-core.js +2 -2
  80. package/dist/priceFloors.js +1 -1
  81. package/dist/pubCommonId.js +1 -1
  82. package/dist/publinkIdSystem.js +1 -1
  83. package/dist/pubmaticBidAdapter.js +1 -1
  84. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  85. package/dist/pubxaiAnalyticsAdapter.js +1 -1
  86. package/dist/pxyzBidAdapter.js +1 -1
  87. package/dist/quantcastBidAdapter.js +1 -1
  88. package/dist/rasBidAdapter.js +1 -0
  89. package/dist/readpeakBidAdapter.js +1 -1
  90. package/dist/relaidoBidAdapter.js +1 -1
  91. package/dist/rhythmoneBidAdapter.js +1 -1
  92. package/dist/riseBidAdapter.js +1 -1
  93. package/dist/rubiconAnalyticsAdapter.js +1 -1
  94. package/dist/rubiconBidAdapter.js +1 -1
  95. package/dist/seedingAllianceBidAdapter.js +1 -1
  96. package/dist/seedtagBidAdapter.js +1 -1
  97. package/dist/sharedIdSystem.js +1 -1
  98. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  99. package/dist/sharethroughBidAdapter.js +1 -1
  100. package/dist/shinezBidAdapter.js +1 -0
  101. package/dist/sizeMappingV2.js +1 -1
  102. package/dist/smaatoBidAdapter.js +1 -1
  103. package/dist/smartadserverBidAdapter.js +1 -1
  104. package/dist/smartxBidAdapter.js +1 -1
  105. package/dist/smilewantedBidAdapter.js +1 -1
  106. package/dist/sonobiBidAdapter.js +1 -1
  107. package/dist/sovrnAnalyticsAdapter.js +1 -1
  108. package/dist/sovrnBidAdapter.js +1 -1
  109. package/dist/sspBCBidAdapter.js +1 -1
  110. package/dist/sublimeBidAdapter.js +1 -1
  111. package/dist/synacormediaBidAdapter.js +1 -1
  112. package/dist/taboolaBidAdapter.js +1 -1
  113. package/dist/targetVideoBidAdapter.js +1 -1
  114. package/dist/teadsBidAdapter.js +1 -1
  115. package/dist/trionBidAdapter.js +1 -1
  116. package/dist/tripleliftBidAdapter.js +1 -1
  117. package/dist/ttdBidAdapter.js +1 -1
  118. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  119. package/dist/underdogmediaBidAdapter.js +1 -1
  120. package/dist/undertoneBidAdapter.js +1 -1
  121. package/dist/ventesBidAdapter.js +1 -1
  122. package/dist/vidazooBidAdapter.js +1 -1
  123. package/dist/videobyteBidAdapter.js +1 -1
  124. package/dist/visxBidAdapter.js +1 -1
  125. package/dist/vrtcalBidAdapter.js +1 -1
  126. package/dist/vuukleBidAdapter.js +1 -1
  127. package/dist/widespaceBidAdapter.js +1 -1
  128. package/dist/winrBidAdapter.js +1 -1
  129. package/dist/yahoosspBidAdapter.js +1 -1
  130. package/dist/yieldmoBidAdapter.js +1 -1
  131. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  132. package/gulpfile.js +1 -1
  133. package/karma.conf.maker.js +3 -1
  134. package/modules/adgenerationBidAdapter.js +24 -1
  135. package/modules/adnuntiusBidAdapter.js +26 -8
  136. package/modules/adotBidAdapter.js +13 -4
  137. package/modules/adrinoBidAdapter.js +10 -2
  138. package/modules/adrinoBidAdapter.md +6 -0
  139. package/modules/adtelligentBidAdapter.js +2 -1
  140. package/modules/appnexusBidAdapter.js +3 -3
  141. package/modules/atsAnalyticsAdapter.js +4 -5
  142. package/modules/byDataAnalyticsAdapter.js +172 -74
  143. package/modules/byDataAnalyticsAdapter.md +5 -6
  144. package/modules/consumableBidAdapter.js +12 -1
  145. package/modules/criteoBidAdapter.js +7 -1
  146. package/modules/cwireBidAdapter.md +1 -1
  147. package/modules/debugging/bidInterceptor.js +1 -1
  148. package/modules/debugging/index.js +2 -1
  149. package/modules/eplanningBidAdapter.js +82 -97
  150. package/modules/gdprEnforcement.js +8 -14
  151. package/modules/gridNMBidAdapter.js +45 -4
  152. package/modules/hadronAnalyticsAdapter.md +5 -5
  153. package/modules/hadronIdSystem.js +18 -5
  154. package/modules/hadronIdSystem.md +15 -11
  155. package/modules/hadronRtdProvider.js +14 -1
  156. package/modules/hadronRtdProvider.md +17 -13
  157. package/modules/imRtdProvider.js +0 -8
  158. package/modules/insticatorBidAdapter.js +9 -0
  159. package/modules/ixBidAdapter.js +462 -58
  160. package/modules/ixBidAdapter.md +95 -5
  161. package/modules/kargoAnalyticsAdapter.js +88 -6
  162. package/modules/kargoAnalyticsAdapter.md +33 -0
  163. package/modules/kargoBidAdapter.js +1 -2
  164. package/modules/minutemediaBidAdapter.js +1 -0
  165. package/modules/missenaBidAdapter.js +20 -2
  166. package/modules/newspassidBidAdapter.js +649 -0
  167. package/modules/nextMillenniumBidAdapter.js +17 -1
  168. package/modules/oguryBidAdapter.js +2 -0
  169. package/modules/openxBidAdapter.md +3 -1
  170. package/modules/openxOrtbBidAdapter.js +349 -0
  171. package/modules/openxOrtbBidAdapter.md +105 -0
  172. package/modules/priceFloors.js +1 -1
  173. package/modules/pubCommonId.js +1 -2
  174. package/modules/pubxaiAnalyticsAdapter.js +6 -1
  175. package/modules/rasBidAdapter.js +149 -0
  176. package/modules/rasBidAdapter.md +50 -0
  177. package/modules/readpeakBidAdapter.js +15 -6
  178. package/modules/relaidoBidAdapter.js +19 -4
  179. package/modules/seedtagBidAdapter.js +37 -1
  180. package/modules/sharedIdSystem.js +11 -5
  181. package/modules/sharethroughBidAdapter.js +9 -24
  182. package/modules/shinezBidAdapter.js +435 -0
  183. package/modules/shinezBidAdapter.md +76 -0
  184. package/modules/taboolaBidAdapter.js +1 -1
  185. package/modules/taboolaBidAdapter.md +3 -3
  186. package/modules/ventesBidAdapter.js +1 -1
  187. package/modules/ventesBidAdapter.md +1 -1
  188. package/modules/vrtcalBidAdapter.js +35 -0
  189. package/package.json +1 -1
  190. package/plugins/pbjsGlobals.js +2 -1
  191. package/src/storageManager.js +4 -5
  192. package/test/spec/modules/adgenerationBidAdapter_spec.js +52 -4
  193. package/test/spec/modules/adnuntiusBidAdapter_spec.js +126 -14
  194. package/test/spec/modules/adotBidAdapter_spec.js +12 -9
  195. package/test/spec/modules/adrinoBidAdapter_spec.js +22 -0
  196. package/test/spec/modules/appnexusBidAdapter_spec.js +165 -156
  197. package/test/spec/modules/byDataAnalyticsAdapter_spec.js +74 -24
  198. package/test/spec/modules/consumableBidAdapter_spec.js +75 -0
  199. package/test/spec/modules/criteoBidAdapter_spec.js +15 -5
  200. package/test/spec/modules/debugging_mod_spec.js +7 -0
  201. package/test/spec/modules/eplanningBidAdapter_spec.js +58 -18
  202. package/test/spec/modules/gdprEnforcement_spec.js +53 -100
  203. package/test/spec/modules/gridNMBidAdapter_spec.js +32 -0
  204. package/test/spec/modules/hadronIdSystem_spec.js +2 -2
  205. package/test/spec/modules/imRtdProvider_spec.js +0 -1
  206. package/test/spec/modules/insticatorBidAdapter_spec.js +22 -1
  207. package/test/spec/modules/ixBidAdapter_spec.js +470 -10
  208. package/test/spec/modules/kargoAnalyticsAdapter_spec.js +42 -0
  209. package/test/spec/modules/kargoBidAdapter_spec.js +1 -0
  210. package/test/spec/modules/minutemediaBidAdapter_spec.js +3 -0
  211. package/test/spec/modules/missenaBidAdapter_spec.js +36 -14
  212. package/test/spec/modules/newspassidBidAdapter_spec.js +1793 -0
  213. package/test/spec/modules/nextMillenniumBidAdapter_spec.js +20 -0
  214. package/test/spec/modules/openxOrtbBidAdapter_spec.js +1303 -0
  215. package/test/spec/modules/pubxaiAnalyticsAdapter_spec.js +5 -0
  216. package/test/spec/modules/rasBidAdapter_spec.js +190 -0
  217. package/test/spec/modules/readpeakBidAdapter_spec.js +1 -0
  218. package/test/spec/modules/relaidoBidAdapter_spec.js +29 -2
  219. package/test/spec/modules/seedtagBidAdapter_spec.js +29 -0
  220. package/test/spec/modules/sharethroughBidAdapter_spec.js +4 -4
  221. package/test/spec/modules/shinezBidAdapter_spec.js +479 -0
  222. package/test/spec/modules/taboolaBidAdapter_spec.js +1 -1
  223. package/test/spec/modules/ventesBidAdapter_spec.js +2 -2
  224. package/test/spec/modules/vrtcalBidAdapter_spec.js +17 -0
  225. package/webpack.conf.js +1 -1
@@ -72,13 +72,13 @@ describe('AppNexusAdapter', function () {
72
72
  }
73
73
  ];
74
74
 
75
- beforeEach(function() {
76
- getAdUnitsStub = sinon.stub(auctionManager, 'getAdUnits').callsFake(function() {
75
+ beforeEach(function () {
76
+ getAdUnitsStub = sinon.stub(auctionManager, 'getAdUnits').callsFake(function () {
77
77
  return [];
78
78
  });
79
79
  });
80
80
 
81
- afterEach(function() {
81
+ afterEach(function () {
82
82
  getAdUnitsStub.restore();
83
83
  });
84
84
 
@@ -97,10 +97,10 @@ describe('AppNexusAdapter', function () {
97
97
  const payload = JSON.parse(request.data);
98
98
 
99
99
  expect(payload.tags[0].private_sizes).to.exist;
100
- expect(payload.tags[0].private_sizes).to.deep.equal([{width: 300, height: 250}]);
100
+ expect(payload.tags[0].private_sizes).to.deep.equal([{ width: 300, height: 250 }]);
101
101
  });
102
102
 
103
- it('should add position in request', function() {
103
+ it('should add position in request', function () {
104
104
  // set from bid.params
105
105
  let bidRequest = deepClone(bidRequests[0]);
106
106
  bidRequest.params.position = 'above';
@@ -149,7 +149,7 @@ describe('AppNexusAdapter', function () {
149
149
  expect(payload4.tags[0].position).to.deep.equal(1);
150
150
  });
151
151
 
152
- it('should add publisher_id in request', function() {
152
+ it('should add publisher_id in request', function () {
153
153
  let bidRequest = Object.assign({},
154
154
  bidRequests[0],
155
155
  {
@@ -194,8 +194,13 @@ describe('AppNexusAdapter', function () {
194
194
  transactionId: '04f2659e-c005-4eb1-a57c-fa93145e3843'
195
195
  }];
196
196
 
197
- ['banner', 'video', 'native'].forEach(type => {
198
- getAdUnitsStub.callsFake(function(...args) {
197
+ let types = ['banner', 'video'];
198
+ if (FEATURES.NATIVE) {
199
+ types.push('native');
200
+ }
201
+
202
+ types.forEach(type => {
203
+ getAdUnitsStub.callsFake(function (...args) {
199
204
  return adUnits;
200
205
  });
201
206
 
@@ -214,7 +219,7 @@ describe('AppNexusAdapter', function () {
214
219
  });
215
220
  });
216
221
 
217
- it('should not populate the ad_types array when adUnit.mediaTypes is undefined', function() {
222
+ it('should not populate the ad_types array when adUnit.mediaTypes is undefined', function () {
218
223
  const bidRequest = Object.assign({}, bidRequests[0]);
219
224
  const request = spec.buildRequests([bidRequest]);
220
225
  const payload = JSON.parse(request.data);
@@ -225,7 +230,7 @@ describe('AppNexusAdapter', function () {
225
230
  it('should populate the ad_types array on outstream requests', function () {
226
231
  const bidRequest = Object.assign({}, bidRequests[0]);
227
232
  bidRequest.mediaTypes = {};
228
- bidRequest.mediaTypes.video = {context: 'outstream'};
233
+ bidRequest.mediaTypes.video = { context: 'outstream' };
229
234
 
230
235
  const request = spec.buildRequests([bidRequest]);
231
236
  const payload = JSON.parse(request.data);
@@ -264,7 +269,7 @@ describe('AppNexusAdapter', function () {
264
269
  expect(payload.tags[0].hb_source).to.deep.equal(1);
265
270
  });
266
271
 
267
- it('should include ORTB video values when video params were not set', function() {
272
+ it('should include ORTB video values when video params were not set', function () {
268
273
  let bidRequest = deepClone(bidRequests[0]);
269
274
  bidRequest.params = {
270
275
  placementId: '1234235',
@@ -319,7 +324,7 @@ describe('AppNexusAdapter', function () {
319
324
  bidRequest1 = Object.assign({}, bidRequest1, videoData, {
320
325
  renderer: {
321
326
  url: 'https://test.renderer.url',
322
- render: function () {}
327
+ render: function () { }
323
328
  }
324
329
  });
325
330
 
@@ -361,7 +366,7 @@ describe('AppNexusAdapter', function () {
361
366
  expect(payload.user).to.exist;
362
367
  expect(payload.user).to.deep.equal({
363
368
  external_uid: '123',
364
- segments: [{id: 123}, {id: 987, value: 876}]
369
+ segments: [{ id: 123 }, { id: 987, value: 876 }]
365
370
  });
366
371
  });
367
372
 
@@ -395,7 +400,7 @@ describe('AppNexusAdapter', function () {
395
400
  expect(payload.tags[0].reserve).to.exist.and.to.equal(3);
396
401
  });
397
402
 
398
- it('should duplicate adpod placements into batches and set correct maxduration', function() {
403
+ it('should duplicate adpod placements into batches and set correct maxduration', function () {
399
404
  let bidRequest = Object.assign({},
400
405
  bidRequests[0],
401
406
  {
@@ -428,7 +433,7 @@ describe('AppNexusAdapter', function () {
428
433
  expect(payload2.tags[0].video.maxduration).to.equal(30);
429
434
  });
430
435
 
431
- it('should round down adpod placements when numbers are uneven', function() {
436
+ it('should round down adpod placements when numbers are uneven', function () {
432
437
  let bidRequest = Object.assign({},
433
438
  bidRequests[0],
434
439
  {
@@ -451,7 +456,7 @@ describe('AppNexusAdapter', function () {
451
456
  expect(payload.tags.length).to.equal(2);
452
457
  });
453
458
 
454
- it('should duplicate adpod placements when requireExactDuration is set', function() {
459
+ it('should duplicate adpod placements when requireExactDuration is set', function () {
455
460
  let bidRequest = Object.assign({},
456
461
  bidRequests[0],
457
462
  {
@@ -493,7 +498,7 @@ describe('AppNexusAdapter', function () {
493
498
  expect(payload2tagsWith30.length).to.equal(5);
494
499
  });
495
500
 
496
- it('should set durations for placements when requireExactDuration is set and numbers are uneven', function() {
501
+ it('should set durations for placements when requireExactDuration is set and numbers are uneven', function () {
497
502
  let bidRequest = Object.assign({},
498
503
  bidRequests[0],
499
504
  {
@@ -524,7 +529,7 @@ describe('AppNexusAdapter', function () {
524
529
  expect(tagsWith60.length).to.equal(1);
525
530
  });
526
531
 
527
- it('should break adpod request into batches', function() {
532
+ it('should break adpod request into batches', function () {
528
533
  let bidRequest = Object.assign({},
529
534
  bidRequests[0],
530
535
  {
@@ -552,7 +557,7 @@ describe('AppNexusAdapter', function () {
552
557
  expect(payload3.tags.length).to.equal(15);
553
558
  });
554
559
 
555
- it('should contain hb_source value for adpod', function() {
560
+ it('should contain hb_source value for adpod', function () {
556
561
  let bidRequest = Object.assign({},
557
562
  bidRequests[0],
558
563
  {
@@ -574,7 +579,7 @@ describe('AppNexusAdapter', function () {
574
579
  expect(payload.tags[0].hb_source).to.deep.equal(7);
575
580
  });
576
581
 
577
- it('should contain hb_source value for other media', function() {
582
+ it('should contain hb_source value for other media', function () {
578
583
  let bidRequest = Object.assign({},
579
584
  bidRequests[0],
580
585
  {
@@ -590,7 +595,7 @@ describe('AppNexusAdapter', function () {
590
595
  expect(payload.tags[0].hb_source).to.deep.equal(1);
591
596
  });
592
597
 
593
- it('adds brand_category_exclusion to request when set', function() {
598
+ it('adds brand_category_exclusion to request when set', function () {
594
599
  let bidRequest = Object.assign({}, bidRequests[0]);
595
600
  sinon
596
601
  .stub(config, 'getConfig')
@@ -605,7 +610,7 @@ describe('AppNexusAdapter', function () {
605
610
  config.getConfig.restore();
606
611
  });
607
612
 
608
- it('adds auction level keywords to request when set', function() {
613
+ it('adds auction level keywords to request when set', function () {
609
614
  let bidRequest = Object.assign({}, bidRequests[0]);
610
615
  sinon
611
616
  .stub(config, 'getConfig')
@@ -632,80 +637,82 @@ describe('AppNexusAdapter', function () {
632
637
  config.getConfig.restore();
633
638
  });
634
639
 
635
- it('should attach native params to the request', function () {
636
- let bidRequest = Object.assign({},
637
- bidRequests[0],
638
- {
639
- mediaType: 'native',
640
- nativeParams: {
641
- title: {required: true},
642
- body: {required: true},
643
- body2: {required: true},
644
- image: {required: true, sizes: [100, 100]},
645
- icon: {required: true},
646
- cta: {required: false},
647
- rating: {required: true},
648
- sponsoredBy: {required: true},
649
- privacyLink: {required: true},
650
- displayUrl: {required: true},
651
- address: {required: true},
652
- downloads: {required: true},
653
- likes: {required: true},
654
- phone: {required: true},
655
- price: {required: true},
656
- salePrice: {required: true}
640
+ if (FEATURES.NATIVE) {
641
+ it('should attach native params to the request', function () {
642
+ let bidRequest = Object.assign({},
643
+ bidRequests[0],
644
+ {
645
+ mediaType: 'native',
646
+ nativeParams: {
647
+ title: { required: true },
648
+ body: { required: true },
649
+ body2: { required: true },
650
+ image: { required: true, sizes: [100, 100] },
651
+ icon: { required: true },
652
+ cta: { required: false },
653
+ rating: { required: true },
654
+ sponsoredBy: { required: true },
655
+ privacyLink: { required: true },
656
+ displayUrl: { required: true },
657
+ address: { required: true },
658
+ downloads: { required: true },
659
+ likes: { required: true },
660
+ phone: { required: true },
661
+ price: { required: true },
662
+ salePrice: { required: true }
663
+ }
657
664
  }
658
- }
659
- );
665
+ );
660
666
 
661
- const request = spec.buildRequests([bidRequest]);
662
- const payload = JSON.parse(request.data);
667
+ const request = spec.buildRequests([bidRequest]);
668
+ const payload = JSON.parse(request.data);
663
669
 
664
- expect(payload.tags[0].native.layouts[0]).to.deep.equal({
665
- title: {required: true},
666
- description: {required: true},
667
- desc2: {required: true},
668
- main_image: {required: true, sizes: [{ width: 100, height: 100 }]},
669
- icon: {required: true},
670
- ctatext: {required: false},
671
- rating: {required: true},
672
- sponsored_by: {required: true},
673
- privacy_link: {required: true},
674
- displayurl: {required: true},
675
- address: {required: true},
676
- downloads: {required: true},
677
- likes: {required: true},
678
- phone: {required: true},
679
- price: {required: true},
680
- saleprice: {required: true},
681
- privacy_supported: true
670
+ expect(payload.tags[0].native.layouts[0]).to.deep.equal({
671
+ title: { required: true },
672
+ description: { required: true },
673
+ desc2: { required: true },
674
+ main_image: { required: true, sizes: [{ width: 100, height: 100 }] },
675
+ icon: { required: true },
676
+ ctatext: { required: false },
677
+ rating: { required: true },
678
+ sponsored_by: { required: true },
679
+ privacy_link: { required: true },
680
+ displayurl: { required: true },
681
+ address: { required: true },
682
+ downloads: { required: true },
683
+ likes: { required: true },
684
+ phone: { required: true },
685
+ price: { required: true },
686
+ saleprice: { required: true },
687
+ privacy_supported: true
688
+ });
689
+ expect(payload.tags[0].hb_source).to.equal(1);
682
690
  });
683
- expect(payload.tags[0].hb_source).to.equal(1);
684
- });
685
691
 
686
- it('should always populated tags[].sizes with 1,1 for native if otherwise not defined', function () {
687
- let bidRequest = Object.assign({},
688
- bidRequests[0],
689
- {
690
- mediaType: 'native',
691
- nativeParams: {
692
- image: { required: true }
692
+ it('should always populated tags[].sizes with 1,1 for native if otherwise not defined', function () {
693
+ let bidRequest = Object.assign({},
694
+ bidRequests[0],
695
+ {
696
+ mediaType: 'native',
697
+ nativeParams: {
698
+ image: { required: true }
699
+ }
693
700
  }
694
- }
695
- );
696
- bidRequest.sizes = [[150, 100], [300, 250]];
701
+ );
702
+ bidRequest.sizes = [[150, 100], [300, 250]];
697
703
 
698
- let request = spec.buildRequests([bidRequest]);
699
- let payload = JSON.parse(request.data);
700
- expect(payload.tags[0].sizes).to.deep.equal([{width: 150, height: 100}, {width: 300, height: 250}]);
704
+ let request = spec.buildRequests([bidRequest]);
705
+ let payload = JSON.parse(request.data);
706
+ expect(payload.tags[0].sizes).to.deep.equal([{ width: 150, height: 100 }, { width: 300, height: 250 }]);
701
707
 
702
- delete bidRequest.sizes;
708
+ delete bidRequest.sizes;
703
709
 
704
- request = spec.buildRequests([bidRequest]);
705
- payload = JSON.parse(request.data);
710
+ request = spec.buildRequests([bidRequest]);
711
+ payload = JSON.parse(request.data);
706
712
 
707
- expect(payload.tags[0].sizes).to.deep.equal([{width: 1, height: 1}]);
708
- });
713
+ expect(payload.tags[0].sizes).to.deep.equal([{ width: 1, height: 1 }]);
714
+ });
715
+ }
709
716
 
710
717
  it('should convert keyword params to proper form and attaches to request', function () {
711
718
  let bidRequest = Object.assign({},
@@ -721,7 +728,7 @@ describe('AppNexusAdapter', function () {
721
728
  singleValNum: 123,
722
729
  emptyStr: '',
723
730
  emptyArr: [''],
724
- badValue: {'foo': 'bar'} // should be dropped
731
+ badValue: { 'foo': 'bar' } // should be dropped
725
732
  }
726
733
  }
727
734
  }
@@ -796,7 +803,7 @@ describe('AppNexusAdapter', function () {
796
803
  bidderRequest.bids = bidRequests;
797
804
 
798
805
  const request = spec.buildRequests(bidRequests, bidderRequest);
799
- expect(request.options).to.deep.equal({withCredentials: true});
806
+ expect(request.options).to.deep.equal({ withCredentials: true });
800
807
  const payload = JSON.parse(request.data);
801
808
 
802
809
  expect(payload.gdpr_consent).to.exist;
@@ -805,7 +812,7 @@ describe('AppNexusAdapter', function () {
805
812
  expect(payload.gdpr_consent.addtl_consent).to.exist.and.to.deep.equal([7, 12, 35, 62, 66, 70, 89, 93, 108]);
806
813
  });
807
814
 
808
- it('should add us privacy string to payload', function() {
815
+ it('should add us privacy string to payload', function () {
809
816
  let consentString = '1YA-';
810
817
  let bidderRequest = {
811
818
  'bidderCode': 'appnexus',
@@ -973,7 +980,7 @@ describe('AppNexusAdapter', function () {
973
980
  .returns(true);
974
981
 
975
982
  const request = spec.buildRequests([bidRequest]);
976
- expect(request.options.customHeaders).to.deep.equal({'X-Is-Test': 1});
983
+ expect(request.options.customHeaders).to.deep.equal({ 'X-Is-Test': 1 });
977
984
 
978
985
  config.getConfig.restore();
979
986
  });
@@ -1127,12 +1134,12 @@ describe('AppNexusAdapter', function () {
1127
1134
  let bfStub;
1128
1135
  let bidderSettingsStorage;
1129
1136
 
1130
- before(function() {
1137
+ before(function () {
1131
1138
  bfStub = sinon.stub(bidderFactory, 'getIabSubCategory');
1132
1139
  bidderSettingsStorage = $$PREBID_GLOBAL$$.bidderSettings;
1133
1140
  });
1134
1141
 
1135
- after(function() {
1142
+ after(function () {
1136
1143
  bfStub.restore();
1137
1144
  $$PREBID_GLOBAL$$.bidderSettings = bidderSettingsStorage;
1138
1145
  });
@@ -1220,7 +1227,7 @@ describe('AppNexusAdapter', function () {
1220
1227
  adUnitCode: 'code'
1221
1228
  }]
1222
1229
  };
1223
- let result = spec.interpretResponse({ body: response }, {bidderRequest});
1230
+ let result = spec.interpretResponse({ body: response }, { bidderRequest });
1224
1231
  expect(Object.keys(result[0])).to.have.members(Object.keys(expectedResponse[0]));
1225
1232
  });
1226
1233
 
@@ -1271,7 +1278,7 @@ describe('AppNexusAdapter', function () {
1271
1278
  };
1272
1279
  let bidderRequest;
1273
1280
 
1274
- let result = spec.interpretResponse({ body: response }, {bidderRequest});
1281
+ let result = spec.interpretResponse({ body: response }, { bidderRequest });
1275
1282
  expect(result.length).to.equal(0);
1276
1283
  });
1277
1284
 
@@ -1304,7 +1311,7 @@ describe('AppNexusAdapter', function () {
1304
1311
  }]
1305
1312
  }
1306
1313
 
1307
- let result = spec.interpretResponse({ body: response }, {bidderRequest});
1314
+ let result = spec.interpretResponse({ body: response }, { bidderRequest });
1308
1315
  expect(result[0]).to.have.property('vastXml');
1309
1316
  expect(result[0]).to.have.property('vastImpUrl');
1310
1317
  expect(result[0]).to.have.property('mediaType', 'video');
@@ -1339,7 +1346,7 @@ describe('AppNexusAdapter', function () {
1339
1346
  }]
1340
1347
  }
1341
1348
 
1342
- let result = spec.interpretResponse({ body: response }, {bidderRequest});
1349
+ let result = spec.interpretResponse({ body: response }, { bidderRequest });
1343
1350
  expect(result[0]).to.have.property('vastUrl');
1344
1351
  expect(result[0]).to.have.property('vastImpUrl');
1345
1352
  expect(result[0]).to.have.property('mediaType', 'video');
@@ -1380,61 +1387,63 @@ describe('AppNexusAdapter', function () {
1380
1387
  };
1381
1388
  bfStub.returns('1');
1382
1389
 
1383
- let result = spec.interpretResponse({ body: response }, {bidderRequest});
1390
+ let result = spec.interpretResponse({ body: response }, { bidderRequest });
1384
1391
  expect(result[0]).to.have.property('vastUrl');
1385
1392
  expect(result[0].video.context).to.equal('adpod');
1386
1393
  expect(result[0].video.durationSeconds).to.equal(30);
1387
1394
  });
1388
1395
 
1389
- it('handles native responses', function () {
1390
- let response1 = deepClone(response);
1391
- response1.tags[0].ads[0].ad_type = 'native';
1392
- response1.tags[0].ads[0].rtb.native = {
1393
- 'title': 'Native Creative',
1394
- 'desc': 'Cool description great stuff',
1395
- 'desc2': 'Additional body text',
1396
- 'ctatext': 'Do it',
1397
- 'sponsored': 'AppNexus',
1398
- 'icon': {
1399
- 'width': 0,
1400
- 'height': 0,
1401
- 'url': 'https://cdn.adnxs.com/icon.png'
1402
- },
1403
- 'main_img': {
1404
- 'width': 2352,
1405
- 'height': 1516,
1406
- 'url': 'https://cdn.adnxs.com/img.png'
1407
- },
1408
- 'link': {
1409
- 'url': 'https://www.appnexus.com',
1410
- 'fallback_url': '',
1411
- 'click_trackers': ['https://nym1-ib.adnxs.com/click']
1412
- },
1413
- 'impression_trackers': ['https://example.com'],
1414
- 'rating': '5',
1415
- 'displayurl': 'https://AppNexus.com/?url=display_url',
1416
- 'likes': '38908320',
1417
- 'downloads': '874983',
1418
- 'price': '9.99',
1419
- 'saleprice': 'FREE',
1420
- 'phone': '1234567890',
1421
- 'address': '28 W 23rd St, New York, NY 10010',
1422
- 'privacy_link': 'https://appnexus.com/?url=privacy_url',
1423
- 'javascriptTrackers': '<script type=\'text/javascript\' async=\'true\' src=\'https://cdn.adnxs.com/v/s/152/trk.js#v;vk=appnexus.com-omid;tv=native1-18h;dom_id=;css_selector=.pb-click;st=0;d=1x1;vc=iab;vid_ccr=1;tag_id=13232354;cb=https%3A%2F%2Fams1-ib.adnxs.com%2Fvevent%3Freferrer%3Dhttps253A%252F%252Ftestpages-pmahe.tp.adnxs.net%252F01_basic_single%26e%3DwqT_3QLNB6DNAwAAAwDWAAUBCLfl_-MFEMStk8u3lPTjRxih88aF0fq_2QsqNgkAAAECCCRAEQEHEAAAJEAZEQkAIREJACkRCQAxEQmoMOLRpwY47UhA7UhIAlCDy74uWJzxW2AAaM26dXjzjwWAAQGKAQNVU0SSAQEG8FCYAQGgAQGoAQGwAQC4AQHAAQTIAQLQAQDYAQDgAQDwAQCKAjt1ZignYScsIDI1Mjk4ODUsIDE1NTE4ODkwNzkpO3VmKCdyJywgOTc0OTQ0MDM2HgDwjZIC8QEha0RXaXBnajgtTHdLRUlQTHZpNFlBQ0NjOFZzd0FEZ0FRQVJJN1VoUTR0R25CbGdBWU1rR2FBQndMSGlrTDRBQlVvZ0JwQy1RQVFHWUFRR2dBUUdvQVFPd0FRQzVBZk90YXFRQUFDUkF3UUh6cldxa0FBQWtRTWtCbWo4dDA1ZU84VF9aQVFBQUEBAyRQQV80QUVBOVFFAQ4sQW1BSUFvQUlBdFFJBRAAdg0IeHdBSUF5QUlBNEFJQTZBSUEtQUlBZ0FNQm1BTUJxQVAFzIh1Z01KUVUxVE1UbzBNekl3NEFPVENBLi6aAmEhUXcxdGNRagUoEfQkblBGYklBUW9BRAl8AEEBqAREbzJEABRRSk1JU1EBGwRBQQGsAFURDAxBQUFXHQzwWNgCAOACrZhI6gIzaHR0cDovL3Rlc3RwYWdlcy1wbWFoZS50cC5hZG54cy5uZXQvMDFfYmFzaWNfc2luZ2xl8gITCg9DVVNUT01fTU9ERUxfSUQSAPICGgoWMhYAPExFQUZfTkFNRRIA8gIeCho2HQAIQVNUAT7wnElGSUVEEgCAAwCIAwGQAwCYAxegAwGqAwDAA-CoAcgDANgD8ao-4AMA6AMA-AMBgAQAkgQNL3V0L3YzL3ByZWJpZJgEAKIECjEwLjIuMTIuMzioBIqpB7IEDggAEAEYACAAKAAwADgCuAQAwAQAyAQA0gQOOTMyNSNBTVMxOjQzMjDaBAIIAeAEAfAEg8u-LogFAZgFAKAF______8BAxgBwAUAyQUABQEU8D_SBQkJBQt8AAAA2AUB4AUB8AWZ9CH6BQQIABAAkAYBmAYAuAYAwQYBITAAAPA_yAYA2gYWChAAOgEAGBAAGADgBgw.%26s%3D971dce9d49b6bee447c8a58774fb30b40fe98171;ts=1551889079;cet=0;cecb=\'></script>'
1424
- };
1425
- let bidderRequest = {
1426
- bids: [{
1427
- bidId: '3db3773286ee59',
1428
- adUnitCode: 'code'
1429
- }]
1430
- }
1396
+ if (FEATURES.NATIVE) {
1397
+ it('handles native responses', function () {
1398
+ let response1 = deepClone(response);
1399
+ response1.tags[0].ads[0].ad_type = 'native';
1400
+ response1.tags[0].ads[0].rtb.native = {
1401
+ 'title': 'Native Creative',
1402
+ 'desc': 'Cool description great stuff',
1403
+ 'desc2': 'Additional body text',
1404
+ 'ctatext': 'Do it',
1405
+ 'sponsored': 'AppNexus',
1406
+ 'icon': {
1407
+ 'width': 0,
1408
+ 'height': 0,
1409
+ 'url': 'https://cdn.adnxs.com/icon.png'
1410
+ },
1411
+ 'main_img': {
1412
+ 'width': 2352,
1413
+ 'height': 1516,
1414
+ 'url': 'https://cdn.adnxs.com/img.png'
1415
+ },
1416
+ 'link': {
1417
+ 'url': 'https://www.appnexus.com',
1418
+ 'fallback_url': '',
1419
+ 'click_trackers': ['https://nym1-ib.adnxs.com/click']
1420
+ },
1421
+ 'impression_trackers': ['https://example.com'],
1422
+ 'rating': '5',
1423
+ 'displayurl': 'https://AppNexus.com/?url=display_url',
1424
+ 'likes': '38908320',
1425
+ 'downloads': '874983',
1426
+ 'price': '9.99',
1427
+ 'saleprice': 'FREE',
1428
+ 'phone': '1234567890',
1429
+ 'address': '28 W 23rd St, New York, NY 10010',
1430
+ 'privacy_link': 'https://appnexus.com/?url=privacy_url',
1431
+ 'javascriptTrackers': '<script type=\'text/javascript\' async=\'true\' src=\'https://cdn.adnxs.com/v/s/152/trk.js#v;vk=appnexus.com-omid;tv=native1-18h;dom_id=;css_selector=.pb-click;st=0;d=1x1;vc=iab;vid_ccr=1;tag_id=13232354;cb=https%3A%2F%2Fams1-ib.adnxs.com%2Fvevent%3Freferrer%3Dhttps253A%252F%252Ftestpages-pmahe.tp.adnxs.net%252F01_basic_single%26e%3DwqT_3QLNB6DNAwAAAwDWAAUBCLfl_-MFEMStk8u3lPTjRxih88aF0fq_2QsqNgkAAAECCCRAEQEHEAAAJEAZEQkAIREJACkRCQAxEQmoMOLRpwY47UhA7UhIAlCDy74uWJzxW2AAaM26dXjzjwWAAQGKAQNVU0SSAQEG8FCYAQGgAQGoAQGwAQC4AQHAAQTIAQLQAQDYAQDgAQDwAQCKAjt1ZignYScsIDI1Mjk4ODUsIDE1NTE4ODkwNzkpO3VmKCdyJywgOTc0OTQ0MDM2HgDwjZIC8QEha0RXaXBnajgtTHdLRUlQTHZpNFlBQ0NjOFZzd0FEZ0FRQVJJN1VoUTR0R25CbGdBWU1rR2FBQndMSGlrTDRBQlVvZ0JwQy1RQVFHWUFRR2dBUUdvQVFPd0FRQzVBZk90YXFRQUFDUkF3UUh6cldxa0FBQWtRTWtCbWo4dDA1ZU84VF9aQVFBQUEBAyRQQV80QUVBOVFFAQ4sQW1BSUFvQUlBdFFJBRAAdg0IeHdBSUF5QUlBNEFJQTZBSUEtQUlBZ0FNQm1BTUJxQVAFzIh1Z01KUVUxVE1UbzBNekl3NEFPVENBLi6aAmEhUXcxdGNRagUoEfQkblBGYklBUW9BRAl8AEEBqAREbzJEABRRSk1JU1EBGwRBQQGsAFURDAxBQUFXHQzwWNgCAOACrZhI6gIzaHR0cDovL3Rlc3RwYWdlcy1wbWFoZS50cC5hZG54cy5uZXQvMDFfYmFzaWNfc2luZ2xl8gITCg9DVVNUT01fTU9ERUxfSUQSAPICGgoWMhYAPExFQUZfTkFNRRIA8gIeCho2HQAIQVNUAT7wnElGSUVEEgCAAwCIAwGQAwCYAxegAwGqAwDAA-CoAcgDANgD8ao-4AMA6AMA-AMBgAQAkgQNL3V0L3YzL3ByZWJpZJgEAKIECjEwLjIuMTIuMzioBIqpB7IEDggAEAEYACAAKAAwADgCuAQAwAQAyAQA0gQOOTMyNSNBTVMxOjQzMjDaBAIIAeAEAfAEg8u-LogFAZgFAKAF______8BAxgBwAUAyQUABQEU8D_SBQkJBQt8AAAA2AUB4AUB8AWZ9CH6BQQIABAAkAYBmAYAuAYAwQYBITAAAPA_yAYA2gYWChAAOgEAGBAAGADgBgw.%26s%3D971dce9d49b6bee447c8a58774fb30b40fe98171;ts=1551889079;cet=0;cecb=\'></script>'
1432
+ };
1433
+ let bidderRequest = {
1434
+ bids: [{
1435
+ bidId: '3db3773286ee59',
1436
+ adUnitCode: 'code'
1437
+ }]
1438
+ }
1431
1439
 
1432
- let result = spec.interpretResponse({ body: response1 }, {bidderRequest});
1433
- expect(result[0].native.title).to.equal('Native Creative');
1434
- expect(result[0].native.body).to.equal('Cool description great stuff');
1435
- expect(result[0].native.cta).to.equal('Do it');
1436
- expect(result[0].native.image.url).to.equal('https://cdn.adnxs.com/img.png');
1437
- });
1440
+ let result = spec.interpretResponse({ body: response1 }, { bidderRequest });
1441
+ expect(result[0].native.title).to.equal('Native Creative');
1442
+ expect(result[0].native.body).to.equal('Cool description great stuff');
1443
+ expect(result[0].native.cta).to.equal('Do it');
1444
+ expect(result[0].native.image.url).to.equal('https://cdn.adnxs.com/img.png');
1445
+ });
1446
+ }
1438
1447
 
1439
1448
  it('supports configuring outstream renderers', function () {
1440
1449
  const outstreamResponse = deepClone(response);
@@ -1457,13 +1466,13 @@ describe('AppNexusAdapter', function () {
1457
1466
  }]
1458
1467
  };
1459
1468
 
1460
- const result = spec.interpretResponse({ body: outstreamResponse }, {bidderRequest});
1469
+ const result = spec.interpretResponse({ body: outstreamResponse }, { bidderRequest });
1461
1470
  expect(result[0].renderer.config).to.deep.equal(
1462
1471
  bidderRequest.bids[0].renderer.options
1463
1472
  );
1464
1473
  });
1465
1474
 
1466
- it('should add deal_priority and deal_code', function() {
1475
+ it('should add deal_priority and deal_code', function () {
1467
1476
  let responseWithDeal = deepClone(response);
1468
1477
  responseWithDeal.tags[0].ads[0].ad_type = 'video';
1469
1478
  responseWithDeal.tags[0].ads[0].deal_priority = 5;
@@ -1485,12 +1494,12 @@ describe('AppNexusAdapter', function () {
1485
1494
  }
1486
1495
  }]
1487
1496
  }
1488
- let result = spec.interpretResponse({ body: responseWithDeal }, {bidderRequest});
1497
+ let result = spec.interpretResponse({ body: responseWithDeal }, { bidderRequest });
1489
1498
  expect(Object.keys(result[0].appnexus)).to.include.members(['buyerMemberId', 'dealPriority', 'dealCode']);
1490
1499
  expect(result[0].video.dealTier).to.equal(5);
1491
1500
  });
1492
1501
 
1493
- it('should add advertiser id', function() {
1502
+ it('should add advertiser id', function () {
1494
1503
  let responseAdvertiserId = deepClone(response);
1495
1504
  responseAdvertiserId.tags[0].ads[0].advertiser_id = '123';
1496
1505
 
@@ -1500,11 +1509,11 @@ describe('AppNexusAdapter', function () {
1500
1509
  adUnitCode: 'code'
1501
1510
  }]
1502
1511
  }
1503
- let result = spec.interpretResponse({ body: responseAdvertiserId }, {bidderRequest});
1512
+ let result = spec.interpretResponse({ body: responseAdvertiserId }, { bidderRequest });
1504
1513
  expect(Object.keys(result[0].meta)).to.include.members(['advertiserId']);
1505
1514
  });
1506
1515
 
1507
- it('should add brand id', function() {
1516
+ it('should add brand id', function () {
1508
1517
  let responseBrandId = deepClone(response);
1509
1518
  responseBrandId.tags[0].ads[0].brand_id = 123;
1510
1519
 
@@ -1514,11 +1523,11 @@ describe('AppNexusAdapter', function () {
1514
1523
  adUnitCode: 'code'
1515
1524
  }]
1516
1525
  }
1517
- let result = spec.interpretResponse({ body: responseBrandId }, {bidderRequest});
1526
+ let result = spec.interpretResponse({ body: responseBrandId }, { bidderRequest });
1518
1527
  expect(Object.keys(result[0].meta)).to.include.members(['brandId']);
1519
1528
  });
1520
1529
 
1521
- it('should add advertiserDomains', function() {
1530
+ it('should add advertiserDomains', function () {
1522
1531
  let responseAdvertiserId = deepClone(response);
1523
1532
  responseAdvertiserId.tags[0].ads[0].adomain = ['123'];
1524
1533
 
@@ -1528,7 +1537,7 @@ describe('AppNexusAdapter', function () {
1528
1537
  adUnitCode: 'code'
1529
1538
  }]
1530
1539
  }
1531
- let result = spec.interpretResponse({ body: responseAdvertiserId }, {bidderRequest});
1540
+ let result = spec.interpretResponse({ body: responseAdvertiserId }, { bidderRequest });
1532
1541
  expect(Object.keys(result[0].meta)).to.include.members(['advertiserDomains']);
1533
1542
  expect(Object.keys(result[0].meta.advertiserDomains)).to.deep.equal([]);
1534
1543
  });
@@ -1538,11 +1547,11 @@ describe('AppNexusAdapter', function () {
1538
1547
  let gcStub;
1539
1548
  let adUnit = { bids: [{ bidder: 'appnexus' }] }; ;
1540
1549
 
1541
- before(function() {
1550
+ before(function () {
1542
1551
  gcStub = sinon.stub(config, 'getConfig');
1543
1552
  });
1544
1553
 
1545
- after(function() {
1554
+ after(function () {
1546
1555
  gcStub.restore();
1547
1556
  });
1548
1557