prebid.js 7.35.0 → 7.36.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 (188) hide show
  1. package/.devcontainer/Dockerfile +2 -0
  2. package/dist/33acrossBidAdapter.js +1 -1
  3. package/dist/33acrossIdSystem.js +1 -1
  4. package/dist/adagioBidAdapter.js +1 -1
  5. package/dist/adbookpspBidAdapter.js +1 -1
  6. package/dist/adgenerationBidAdapter.js +1 -1
  7. package/dist/admaruBidAdapter.js +1 -1
  8. package/dist/adrelevantisBidAdapter.js +1 -1
  9. package/dist/adtrgtmeBidAdapter.js +1 -1
  10. package/dist/adxcgBidAdapter.js +1 -1
  11. package/dist/adyoulikeBidAdapter.js +1 -1
  12. package/dist/aidemBidAdapter.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/aolBidAdapter.js +1 -1
  17. package/dist/appierAnalyticsAdapter.js +1 -1
  18. package/dist/appnexusBidAdapter.js +1 -1
  19. package/dist/asoBidAdapter.js +1 -1
  20. package/dist/audiencerunBidAdapter.js +1 -1
  21. package/dist/axonixBidAdapter.js +1 -1
  22. package/dist/bidglassBidAdapter.js +1 -1
  23. package/dist/big-richmediaBidAdapter.js +1 -1
  24. package/dist/bluebillywigBidAdapter.js +1 -1
  25. package/dist/bridgewellBidAdapter.js +1 -1
  26. package/dist/brightMountainMediaBidAdapter.js +1 -1
  27. package/dist/brightcomBidAdapter.js +1 -1
  28. package/dist/brightcomSSPBidAdapter.js +1 -0
  29. package/dist/carodaBidAdapter.js +1 -1
  30. package/dist/chtnwBidAdapter.js +1 -1
  31. package/dist/concertBidAdapter.js +1 -1
  32. package/dist/connectadBidAdapter.js +1 -1
  33. package/dist/consumableBidAdapter.js +1 -1
  34. package/dist/conversantBidAdapter.js +1 -1
  35. package/dist/craftBidAdapter.js +1 -1
  36. package/dist/criteoBidAdapter.js +1 -1
  37. package/dist/cwireBidAdapter.js +1 -1
  38. package/dist/dependencies.json +3 -0
  39. package/dist/dspxBidAdapter.js +1 -1
  40. package/dist/eplanningBidAdapter.js +1 -1
  41. package/dist/feedadBidAdapter.js +1 -1
  42. package/dist/finativeBidAdapter.js +1 -1
  43. package/dist/freewheel-sspBidAdapter.js +1 -1
  44. package/dist/glimpseBidAdapter.js +1 -1
  45. package/dist/gmosspBidAdapter.js +1 -1
  46. package/dist/goldbachBidAdapter.js +1 -1
  47. package/dist/gridBidAdapter.js +1 -1
  48. package/dist/gridNMBidAdapter.js +1 -1
  49. package/dist/gumgumBidAdapter.js +1 -1
  50. package/dist/h12mediaBidAdapter.js +1 -1
  51. package/dist/id5IdSystem.js +1 -1
  52. package/dist/impactifyBidAdapter.js +1 -1
  53. package/dist/improvedigitalBidAdapter.js +1 -1
  54. package/dist/inmarBidAdapter.js +1 -1
  55. package/dist/insticatorBidAdapter.js +1 -1
  56. package/dist/ixBidAdapter.js +1 -1
  57. package/dist/jixieBidAdapter.js +1 -1
  58. package/dist/justpremiumBidAdapter.js +1 -1
  59. package/dist/konduitAnalyticsAdapter.js +1 -1
  60. package/dist/kueezBidAdapter.js +1 -1
  61. package/dist/kueezRtbBidAdapter.js +1 -1
  62. package/dist/lassoBidAdapter.js +1 -1
  63. package/dist/lifestreetBidAdapter.js +1 -1
  64. package/dist/limelightDigitalBidAdapter.js +1 -1
  65. package/dist/liveIntentIdSystem.js +1 -1
  66. package/dist/liveyieldAnalyticsAdapter.js +1 -1
  67. package/dist/logicadBidAdapter.js +1 -1
  68. package/dist/loglyliftBidAdapter.js +1 -1
  69. package/dist/magniteAnalyticsAdapter.js +1 -1
  70. package/dist/malltvAnalyticsAdapter.js +1 -1
  71. package/dist/marsmediaBidAdapter.js +1 -1
  72. package/dist/mediafuseBidAdapter.js +1 -1
  73. package/dist/mediakeysBidAdapter.js +1 -1
  74. package/dist/mediasquareBidAdapter.js +1 -1
  75. package/dist/mgidBidAdapter.js +1 -1
  76. package/dist/minutemediaBidAdapter.js +1 -1
  77. package/dist/neuwoRtdProvider.js +1 -0
  78. package/dist/nexx360BidAdapter.js +1 -1
  79. package/dist/not-for-prod/prebid.js +132 -129
  80. package/dist/oguryBidAdapter.js +1 -1
  81. package/dist/onetagBidAdapter.js +1 -1
  82. package/dist/ooloAnalyticsAdapter.js +1 -1
  83. package/dist/outbrainBidAdapter.js +1 -1
  84. package/dist/parrableIdSystem.js +1 -1
  85. package/dist/pixfutureBidAdapter.js +1 -1
  86. package/dist/prebid-core.js +1 -1
  87. package/dist/publinkIdSystem.js +1 -1
  88. package/dist/pubmaticBidAdapter.js +1 -1
  89. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  90. package/dist/pxyzBidAdapter.js +1 -1
  91. package/dist/quantcastBidAdapter.js +1 -1
  92. package/dist/readpeakBidAdapter.js +1 -1
  93. package/dist/relaidoBidAdapter.js +1 -1
  94. package/dist/rhythmoneBidAdapter.js +1 -1
  95. package/dist/riseBidAdapter.js +1 -1
  96. package/dist/rubiconAnalyticsAdapter.js +1 -1
  97. package/dist/rubiconBidAdapter.js +1 -1
  98. package/dist/scatteredBidAdapter.js +1 -0
  99. package/dist/seedingAllianceBidAdapter.js +1 -1
  100. package/dist/seedtagBidAdapter.js +1 -1
  101. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  102. package/dist/sharethroughBidAdapter.js +1 -1
  103. package/dist/shinezBidAdapter.js +1 -1
  104. package/dist/sirdataRtdProvider.js +1 -1
  105. package/dist/smaatoBidAdapter.js +1 -1
  106. package/dist/smartadserverBidAdapter.js +1 -1
  107. package/dist/smartxBidAdapter.js +1 -1
  108. package/dist/smilewantedBidAdapter.js +1 -1
  109. package/dist/sonobiBidAdapter.js +1 -1
  110. package/dist/sovrnAnalyticsAdapter.js +1 -1
  111. package/dist/sovrnBidAdapter.js +1 -1
  112. package/dist/sspBCBidAdapter.js +1 -1
  113. package/dist/sublimeBidAdapter.js +1 -1
  114. package/dist/synacormediaBidAdapter.js +1 -1
  115. package/dist/targetVideoBidAdapter.js +1 -1
  116. package/dist/teadsBidAdapter.js +1 -1
  117. package/dist/trionBidAdapter.js +1 -1
  118. package/dist/tripleliftBidAdapter.js +1 -1
  119. package/dist/ttdBidAdapter.js +1 -1
  120. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  121. package/dist/uid2IdSystem.js +1 -1
  122. package/dist/underdogmediaBidAdapter.js +1 -1
  123. package/dist/undertoneBidAdapter.js +1 -1
  124. package/dist/userId.js +1 -1
  125. package/dist/vidazooBidAdapter.js +1 -1
  126. package/dist/videobyteBidAdapter.js +1 -1
  127. package/dist/visxBidAdapter.js +1 -1
  128. package/dist/vuukleBidAdapter.js +1 -1
  129. package/dist/widespaceBidAdapter.js +1 -1
  130. package/dist/winrBidAdapter.js +1 -1
  131. package/dist/yahoosspBidAdapter.js +1 -1
  132. package/dist/yieldmoBidAdapter.js +1 -1
  133. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  134. package/integrationExamples/gpt/neuwoRtdProvider_example.html +190 -0
  135. package/modules/33acrossBidAdapter.js +13 -4
  136. package/modules/admaruBidAdapter.js +19 -1
  137. package/modules/aidemBidAdapter.js +90 -65
  138. package/modules/aidemBidAdapter.md +10 -7
  139. package/modules/ajaBidAdapter.js +6 -1
  140. package/modules/amxIdSystem.md +2 -10
  141. package/modules/aolBidAdapter.js +1 -1
  142. package/modules/appnexusBidAdapter.js +45 -48
  143. package/modules/brightcomBidAdapter.js +1 -0
  144. package/modules/brightcomSSPBidAdapter.js +323 -0
  145. package/modules/brightcomSSPBidAdapter.md +46 -0
  146. package/modules/feedadBidAdapter.js +35 -15
  147. package/modules/fpdModule/index.md +5 -2
  148. package/modules/freewheel-sspBidAdapter.js +5 -1
  149. package/modules/gridBidAdapter.js +3 -1
  150. package/modules/ixBidAdapter.js +318 -175
  151. package/modules/limelightDigitalBidAdapter.js +6 -1
  152. package/modules/limelightDigitalBidAdapter.md +12 -2
  153. package/modules/liveIntentIdSystem.js +1 -1
  154. package/modules/neuwoRtdProvider.js +171 -0
  155. package/modules/neuwoRtdProvider.md +40 -0
  156. package/modules/nexx360BidAdapter.js +1 -1
  157. package/modules/pubmaticBidAdapter.js +4 -0
  158. package/modules/scatteredBidAdapter.js +72 -0
  159. package/modules/scatteredBidAdapter.md +36 -0
  160. package/modules/sirdataRtdProvider.js +262 -284
  161. package/modules/smartxBidAdapter.js +2 -0
  162. package/modules/smilewantedBidAdapter.js +5 -0
  163. package/modules/topicsFpdModule.md +62 -0
  164. package/modules/userId/eids.js +1 -1
  165. package/modules/vidazooBidAdapter.js +3 -1
  166. package/modules/yahoosspBidAdapter.js +1 -1
  167. package/package.json +2 -2
  168. package/test/spec/modules/33acrossBidAdapter_spec.js +51 -18
  169. package/test/spec/modules/admaruBidAdapter_spec.js +48 -0
  170. package/test/spec/modules/aidemBidAdapter_spec.js +77 -10
  171. package/test/spec/modules/ajaBidAdapter_spec.js +21 -1
  172. package/test/spec/modules/aolBidAdapter_spec.js +2 -2
  173. package/test/spec/modules/appnexusBidAdapter_spec.js +123 -16
  174. package/test/spec/modules/brightcomSSPBidAdapter_spec.js +411 -0
  175. package/test/spec/modules/eids_spec.js +1 -1
  176. package/test/spec/modules/feedadBidAdapter_spec.js +47 -77
  177. package/test/spec/modules/freewheel-sspBidAdapter_spec.js +1 -1
  178. package/test/spec/modules/ixBidAdapter_spec.js +24 -54
  179. package/test/spec/modules/limelightDigitalBidAdapter_spec.js +35 -5
  180. package/test/spec/modules/neuwoRtdProvider_spec.js +123 -0
  181. package/test/spec/modules/pubmaticBidAdapter_spec.js +15 -0
  182. package/test/spec/modules/scatteredBidAdapter_spec.js +210 -0
  183. package/test/spec/modules/sirdataRtdProvider_spec.js +116 -22
  184. package/test/spec/modules/smilewantedBidAdapter_spec.js +54 -3
  185. package/test/spec/modules/tripleliftBidAdapter_spec.js +2 -2
  186. package/test/spec/modules/userId_spec.js +1 -1
  187. package/test/spec/modules/vidazooBidAdapter_spec.js +4 -1
  188. package/test/spec/modules/yahoosspBidAdapter_spec.js +1 -1
@@ -4,7 +4,7 @@ import {BANNER, NATIVE, VIDEO} from '../../../src/mediaTypes.js';
4
4
  import {server} from 'test/mocks/xhr.js';
5
5
 
6
6
  const CODE = 'feedad';
7
- const EXPECTED_ADAPTER_VERSION = '1.0.5';
7
+ const EXPECTED_ADAPTER_VERSION = '1.0.6';
8
8
 
9
9
  describe('FeedAdAdapter', function () {
10
10
  describe('Public API', function () {
@@ -373,81 +373,67 @@ describe('FeedAdAdapter', function () {
373
373
  const pixelSync2 = {type: 'image', url: 'the pixel url 2'};
374
374
  const iFrameSync1 = {type: 'iframe', url: 'the iFrame url 1'};
375
375
  const iFrameSync2 = {type: 'iframe', url: 'the iFrame url 2'};
376
- const mockServerResponse = (content) => {
377
- if (!(content instanceof Array)) {
378
- content = [content];
379
- }
380
- return content.map(it => ({body: it}));
381
- };
382
-
383
- it('should pass through the syncs out of the extension fields of the server response', function () {
384
- const serverResponse = mockServerResponse([{
376
+ const response1 = {
377
+ body: [{
385
378
  ext: {
386
379
  pixels: [pixelSync1, pixelSync2],
387
- iframes: [iFrameSync1, iFrameSync2],
380
+ iframes: [iFrameSync1]
381
+ },
382
+ }]
383
+ };
384
+ const response2 = {
385
+ body: [{
386
+ ext: {
387
+ pixels: [pixelSync1],
388
+ iframes: [iFrameSync1],
388
389
  }
389
- }]);
390
- const result = spec.getUserSyncs({iframeEnabled: true, pixelEnabled: true}, serverResponse)
390
+ }, {
391
+ ext: {
392
+ pixels: [pixelSync2],
393
+ iframes: [iFrameSync2],
394
+ }
395
+ }]
396
+ };
397
+ it('should pass through the syncs out of the extension fields of the server response', function () {
398
+ const result = spec.getUserSyncs({iframeEnabled: true, pixelEnabled: true}, [response1])
391
399
  expect(result).to.deep.equal([
392
400
  pixelSync1,
393
401
  pixelSync2,
394
402
  iFrameSync1,
395
- iFrameSync2,
396
403
  ]);
397
404
  });
398
405
 
399
406
  it('should concat the syncs of all responses', function () {
400
- const serverResponse = mockServerResponse([{
401
- ext: {
402
- pixels: [pixelSync1],
403
- iframes: [iFrameSync2],
404
- },
405
- ad: 'ad html',
406
- cpm: 100
407
- }, {
408
- ext: {
409
- iframes: [iFrameSync1],
410
- }
411
- }, {
412
- ext: {
413
- pixels: [pixelSync2],
414
- }
415
- }]);
416
- const result = spec.getUserSyncs({iframeEnabled: true, pixelEnabled: true}, serverResponse);
407
+ const result = spec.getUserSyncs({iframeEnabled: true, pixelEnabled: true}, [response1, response2]);
417
408
  expect(result).to.deep.equal([
418
409
  pixelSync1,
410
+ pixelSync2,
411
+ iFrameSync1,
419
412
  iFrameSync2,
413
+ ]);
414
+ });
415
+
416
+ it('should concat the syncs of all bids', function () {
417
+ const result = spec.getUserSyncs({iframeEnabled: true, pixelEnabled: true}, [response2]);
418
+ expect(result).to.deep.equal([
419
+ pixelSync1,
420
420
  iFrameSync1,
421
421
  pixelSync2,
422
+ iFrameSync2,
422
423
  ]);
423
424
  });
424
425
 
425
426
  it('should filter out duplicates', function () {
426
- const serverResponse = mockServerResponse([{
427
- ext: {
428
- pixels: [pixelSync1, pixelSync1],
429
- iframes: [iFrameSync2, iFrameSync2],
430
- }
431
- }, {
432
- ext: {
433
- iframes: [iFrameSync2, iFrameSync2],
434
- }
435
- }]);
436
- const result = spec.getUserSyncs({iframeEnabled: true, pixelEnabled: true}, serverResponse);
427
+ const result = spec.getUserSyncs({iframeEnabled: true, pixelEnabled: true}, [response1, response1]);
437
428
  expect(result).to.deep.equal([
438
429
  pixelSync1,
439
- iFrameSync2,
430
+ pixelSync2,
431
+ iFrameSync1,
440
432
  ]);
441
433
  });
442
434
 
443
435
  it('should not include iFrame syncs if the option is disabled', function () {
444
- const serverResponse = mockServerResponse([{
445
- ext: {
446
- pixels: [pixelSync1, pixelSync2],
447
- iframes: [iFrameSync1, iFrameSync2],
448
- }
449
- }]);
450
- const result = spec.getUserSyncs({iframeEnabled: false, pixelEnabled: true}, serverResponse);
436
+ const result = spec.getUserSyncs({iframeEnabled: false, pixelEnabled: true}, [response1]);
451
437
  expect(result).to.deep.equal([
452
438
  pixelSync1,
453
439
  pixelSync2,
@@ -455,52 +441,36 @@ describe('FeedAdAdapter', function () {
455
441
  });
456
442
 
457
443
  it('should not include pixel syncs if the option is disabled', function () {
458
- const serverResponse = mockServerResponse([{
459
- ext: {
460
- pixels: [pixelSync1, pixelSync2],
461
- iframes: [iFrameSync1, iFrameSync2],
462
- }
463
- }]);
464
- const result = spec.getUserSyncs({iframeEnabled: true, pixelEnabled: false}, serverResponse);
444
+ const result = spec.getUserSyncs({iframeEnabled: true, pixelEnabled: false}, [response1]);
465
445
  expect(result).to.deep.equal([
466
446
  iFrameSync1,
467
- iFrameSync2,
468
447
  ]);
469
448
  });
470
449
 
471
450
  it('should not include any syncs if the sync options are disabled or missing', function () {
472
- const serverResponse = mockServerResponse([{
473
- ext: {
474
- pixels: [pixelSync1, pixelSync2],
475
- iframes: [iFrameSync1, iFrameSync2],
476
- }
477
- }]);
478
- const result = spec.getUserSyncs({iframeEnabled: false, pixelEnabled: false}, serverResponse);
451
+ const result = spec.getUserSyncs({iframeEnabled: false, pixelEnabled: false}, [response1]);
479
452
  expect(result).to.deep.equal([]);
480
453
  });
481
454
 
482
455
  it('should handle empty responses', function () {
483
- const serverResponse = mockServerResponse([]);
484
- const result = spec.getUserSyncs({iframeEnabled: true, pixelEnabled: true}, serverResponse)
456
+ const result = spec.getUserSyncs({iframeEnabled: true, pixelEnabled: true}, [])
485
457
  expect(result).to.deep.equal([]);
486
458
  });
487
459
 
488
460
  it('should not throw if the server response is weird', function () {
489
461
  const responses = [
490
- mockServerResponse(null),
491
- mockServerResponse('null'),
492
- mockServerResponse(1234),
493
- mockServerResponse({}),
494
- mockServerResponse([{}, 123]),
462
+ {body: null},
463
+ {body: 'null'},
464
+ {body: 1234},
465
+ {body: {}},
466
+ {body: [{}, 123]},
495
467
  ];
496
- responses.forEach(it => {
497
- expect(() => spec.getUserSyncs({iframeEnabled: true, pixelEnabled: true}, it)).not.to.throw;
498
- });
468
+ expect(() => spec.getUserSyncs({iframeEnabled: true, pixelEnabled: true}, responses)).to.not.throw();
499
469
  });
500
470
 
501
471
  it('should return empty array if the body extension is null', function () {
502
- const response = mockServerResponse({ext: null});
503
- const result = spec.getUserSyncs({iframeEnabled: true, pixelEnabled: true}, response);
472
+ const response = {body: [{ext: null}]};
473
+ const result = spec.getUserSyncs({iframeEnabled: true, pixelEnabled: true}, [response]);
504
474
  expect(result).to.deep.equal([]);
505
475
  });
506
476
  });
@@ -128,7 +128,7 @@ describe('freewheelSSP BidAdapter Test', () => {
128
128
  it('should return a properly formatted request with schain defined', function () {
129
129
  const request = spec.buildRequests(bidRequests);
130
130
  const payload = request[0].data;
131
- expect(payload.schain).to.deep.equal(bidRequests[0].schain)
131
+ expect(payload.schain).to.deep.equal('{\"ver\":\"1.0\",\"complete\":1,\"nodes\":[{\"asi\":\"example.com\",\"sid\":\"0\",\"hp\":1,\"rid\":\"bidrequestid\",\"domain\":\"example.com\"}]}');
132
132
  });
133
133
 
134
134
  it('sends bid request to ENDPOINT via GET', () => {
@@ -750,7 +750,8 @@ describe('IndexexchangeAdapter', function () {
750
750
  // so structured because when calling createEidsArray, UID2's getValue func takes .id to set in uids
751
751
  uid2: { id: 'testuid2' }, // UID 2.0
752
752
  // similar to uid2, but id5's getValue takes .uid
753
- id5id: { uid: 'testid5id' } // ID5
753
+ id5id: { uid: 'testid5id' }, // ID5
754
+ imuid: 'testimuid'
754
755
  };
755
756
 
756
757
  const DEFAULT_USERIDASEIDS_DATA = createEidsArray(DEFAULT_USERID_DATA);
@@ -801,6 +802,11 @@ describe('IndexexchangeAdapter', function () {
801
802
  uids: [{
802
803
  id: DEFAULT_USERID_DATA.id5id.uid
803
804
  }]
805
+ }, {
806
+ source: 'intimatemerger.com',
807
+ uids: [{
808
+ id: DEFAULT_USERID_DATA.imuid,
809
+ }]
804
810
  }
805
811
  ];
806
812
 
@@ -1193,7 +1199,7 @@ describe('IndexexchangeAdapter', function () {
1193
1199
  const payload = extractPayload(request[0]);
1194
1200
  expect(request).to.be.an('array');
1195
1201
  expect(request).to.have.lengthOf.above(0); // should be 1 or more
1196
- expect(payload.user.eids).to.have.lengthOf(6);
1202
+ expect(payload.user.eids).to.have.lengthOf(7);
1197
1203
  expect(payload.user.eids).to.deep.include(DEFAULT_USERID_PAYLOAD[0]);
1198
1204
  });
1199
1205
  });
@@ -1381,8 +1387,7 @@ describe('IndexexchangeAdapter', function () {
1381
1387
  cloneValidBid[0].userIdAsEids = utils.deepClone(DEFAULT_USERIDASEIDS_DATA);
1382
1388
  const request = spec.buildRequests(cloneValidBid, DEFAULT_OPTION)[0];
1383
1389
  const payload = extractPayload(request);
1384
-
1385
- expect(payload.user.eids).to.have.lengthOf(6);
1390
+ expect(payload.user.eids).to.have.lengthOf(7);
1386
1391
  expect(payload.user.eids).to.have.deep.members(DEFAULT_USERID_PAYLOAD);
1387
1392
  });
1388
1393
 
@@ -1515,7 +1520,7 @@ describe('IndexexchangeAdapter', function () {
1515
1520
  })
1516
1521
 
1517
1522
  expect(payload.user).to.exist;
1518
- expect(payload.user.eids).to.have.lengthOf(8);
1523
+ expect(payload.user.eids).to.have.lengthOf(9);
1519
1524
 
1520
1525
  expect(payload.user.eids).to.have.deep.members(validUserIdPayload);
1521
1526
  });
@@ -1557,7 +1562,7 @@ describe('IndexexchangeAdapter', function () {
1557
1562
  });
1558
1563
 
1559
1564
  const payload = extractPayload(request);
1560
- expect(payload.user.eids).to.have.lengthOf(7);
1565
+ expect(payload.user.eids).to.have.lengthOf(8);
1561
1566
  expect(payload.user.eids).to.have.deep.members(validUserIdPayload);
1562
1567
  });
1563
1568
  });
@@ -3610,27 +3615,9 @@ describe('IndexexchangeAdapter', function () {
3610
3615
  expect(FEATURE_TOGGLES.featureToggles).to.deep.equal({});
3611
3616
  });
3612
3617
 
3613
- it('should set request size limit to 32KB when its feature enabled', () => {
3614
- sandbox.stub(storage, 'localStorageIsEnabled').returns(true);
3615
- serverResponse.body.ext.features.pbjs_use_32kb_size_limit = {
3616
- activated: true
3617
- };
3618
- FEATURE_TOGGLES.setFeatureToggles(serverResponse);
3619
- const bid = utils.deepClone(DEFAULT_MULTIFORMAT_VIDEO_VALID_BID[0]);
3620
- bid.bidderRequestId = Array(10000).join('#');
3621
-
3622
- expect(spec.isBidRequestValid(bid)).to.be.true;
3623
- spec.buildRequests([bid], {});
3624
- const lsData = JSON.parse(storage.getDataFromLocalStorage(LOCAL_STORAGE_FEATURE_TOGGLES_KEY));
3625
- expect(lsData.features.pbjs_use_32kb_size_limit.activated).to.be.true;
3626
- });
3627
-
3628
- it('6 ad units should generate only 2 requests if 32kb size limit FT is enabled', function () {
3618
+ it('6 ad units should generate only 1 request if buildRequestV2 FT is enabled', function () {
3629
3619
  sandbox.stub(storage, 'localStorageIsEnabled').returns(true);
3630
- serverResponse.body.ext.features.pbjs_use_32kb_size_limit = {
3631
- activated: true
3632
- };
3633
- serverResponse.body.ext.features.pbjs_enable_post = {
3620
+ serverResponse.body.ext.features.pbjs_use_buildRequestV2 = {
3634
3621
  activated: true
3635
3622
  };
3636
3623
  FEATURE_TOGGLES.setFeatureToggles(serverResponse);
@@ -3660,47 +3647,30 @@ describe('IndexexchangeAdapter', function () {
3660
3647
  const requests = spec.buildRequests([bid1, bid2, bid3, bid4, bid5, bid6], DEFAULT_OPTION);
3661
3648
 
3662
3649
  expect(requests).to.be.an('array');
3663
- // 32KB size limit causes only 2 requests to get generated.
3664
- expect(requests).to.have.lengthOf(2);
3650
+ // buildRequestv2 enabled causes only 1 requests to get generated.
3651
+ expect(requests).to.have.lengthOf(1);
3665
3652
  for (let request of requests) {
3666
3653
  expect(request.method).to.equal('POST');
3667
3654
  }
3668
3655
  });
3669
3656
 
3670
- it('4 ad units should generate only 1 requests if 32kb size limit FT is enabled', function () {
3657
+ it('1 request with 2 ad units, buildRequestV2 enabled', function () {
3671
3658
  sandbox.stub(storage, 'localStorageIsEnabled').returns(true);
3672
- serverResponse.body.ext.features.pbjs_use_32kb_size_limit = {
3673
- activated: true
3674
- };
3675
- serverResponse.body.ext.features.pbjs_enable_post = {
3659
+ serverResponse.body.ext.features.pbjs_use_buildRequestV2 = {
3676
3660
  activated: true
3677
3661
  };
3678
3662
  FEATURE_TOGGLES.setFeatureToggles(serverResponse);
3679
3663
 
3680
- const bid1 = utils.deepClone(DEFAULT_BANNER_VALID_BID[0]);
3681
- bid1.mediaTypes.banner.sizes = LARGE_SET_OF_SIZES;
3682
- bid1.params.siteId = '121';
3683
- bid1.adUnitCode = 'div-gpt-1'
3684
- bid1.transactionId = 'tr1';
3685
- bid1.bidId = '2f6g5s5e';
3686
-
3687
- const bid2 = utils.deepClone(bid1);
3688
- bid2.transactionId = 'tr2';
3689
-
3690
- const bid3 = utils.deepClone(bid1);
3691
- bid3.transactionId = 'tr3';
3692
-
3693
- const bid4 = utils.deepClone(bid1);
3694
- bid4.transactionId = 'tr4';
3695
-
3696
- const requests = spec.buildRequests([bid1, bid2, bid3, bid4], DEFAULT_OPTION);
3664
+ const bid = utils.deepClone(DEFAULT_BANNER_VALID_BID[0]);
3665
+ bid.mediaTypes.banner.sizes = LARGE_SET_OF_SIZES;
3666
+ bid.params.siteId = '124';
3667
+ bid.adUnitCode = 'div-gpt-1'
3668
+ bid.transactionId = '152e36d1-1241-4242-t35e-y1dv34d12315';
3669
+ bid.bidId = '2f6g5s5e';
3697
3670
 
3671
+ const requests = spec.buildRequests([bid, DEFAULT_BANNER_VALID_BID[0]], DEFAULT_OPTION);
3698
3672
  expect(requests).to.be.an('array');
3699
- // 32KB size limit causes only 1 requests to get generated.
3700
3673
  expect(requests).to.have.lengthOf(1);
3701
- for (let request of requests) {
3702
- expect(request.method).to.equal('POST');
3703
- }
3704
3674
  });
3705
3675
  });
3706
3676
 
@@ -10,7 +10,12 @@ describe('limelightDigitalAdapter', function () {
10
10
  host: 'exchange.ortb.net',
11
11
  adUnitId: 123,
12
12
  adUnitType: 'banner',
13
- publisherId: 'perfectPublisher'
13
+ publisherId: 'perfectPublisher',
14
+ custom1: 'custom1',
15
+ custom2: 'custom2',
16
+ custom3: 'custom3',
17
+ custom4: 'custom4',
18
+ custom5: 'custom5'
14
19
  },
15
20
  placementCode: 'placement_0',
16
21
  auctionId: '74f78609-a92d-4cf1-869f-1b244bbfb5d2',
@@ -49,7 +54,12 @@ describe('limelightDigitalAdapter', function () {
49
54
  params: {
50
55
  host: 'ads.project-limelight.com',
51
56
  adUnitId: 456,
52
- adUnitType: 'banner'
57
+ adUnitType: 'banner',
58
+ custom1: 'custom1',
59
+ custom2: 'custom2',
60
+ custom3: 'custom3',
61
+ custom4: 'custom4',
62
+ custom5: 'custom5'
53
63
  },
54
64
  placementCode: 'placement_1',
55
65
  auctionId: '482f88de-29ab-45c8-981a-d25e39454a34',
@@ -90,7 +100,12 @@ describe('limelightDigitalAdapter', function () {
90
100
  host: 'exchange.ortb.net',
91
101
  adUnitId: 789,
92
102
  adUnitType: 'video',
93
- publisherId: 'secondPerfectPublisher'
103
+ publisherId: 'secondPerfectPublisher',
104
+ custom1: 'custom1',
105
+ custom2: 'custom2',
106
+ custom3: 'custom3',
107
+ custom4: 'custom4',
108
+ custom5: 'custom5'
94
109
  },
95
110
  placementCode: 'placement_2',
96
111
  auctionId: 'e4771143-6aa7-41ec-8824-ced4342c96c8',
@@ -128,7 +143,12 @@ describe('limelightDigitalAdapter', function () {
128
143
  params: {
129
144
  host: 'exchange.ortb.net',
130
145
  adUnitId: 789,
131
- adUnitType: 'video'
146
+ adUnitType: 'video',
147
+ custom1: 'custom1',
148
+ custom2: 'custom2',
149
+ custom3: 'custom3',
150
+ custom4: 'custom4',
151
+ custom5: 'custom5'
132
152
  },
133
153
  placementCode: 'placement_2',
134
154
  auctionId: 'e4771143-6aa7-41ec-8824-ced4342c96c8',
@@ -196,7 +216,12 @@ describe('limelightDigitalAdapter', function () {
196
216
  'transactionId',
197
217
  'publisherId',
198
218
  'userIdAsEids',
199
- 'supplyChain'
219
+ 'supplyChain',
220
+ 'custom1',
221
+ 'custom2',
222
+ 'custom3',
223
+ 'custom4',
224
+ 'custom5'
200
225
  );
201
226
  expect(adUnit.id).to.be.a('number');
202
227
  expect(adUnit.bidId).to.be.a('string');
@@ -205,6 +230,11 @@ describe('limelightDigitalAdapter', function () {
205
230
  expect(adUnit.sizes).to.be.an('array');
206
231
  expect(adUnit.userIdAsEids).to.be.an('array');
207
232
  expect(adUnit.supplyChain).to.be.an('object');
233
+ expect(adUnit.custom1).to.be.a('string');
234
+ expect(adUnit.custom2).to.be.a('string');
235
+ expect(adUnit.custom3).to.be.a('string');
236
+ expect(adUnit.custom4).to.be.a('string');
237
+ expect(adUnit.custom5).to.be.a('string');
208
238
  })
209
239
  })
210
240
  })
@@ -0,0 +1,123 @@
1
+ import { server } from 'test/mocks/xhr.js';
2
+ import * as neuwo from 'modules/neuwoRtdProvider';
3
+
4
+ const PUBLIC_TOKEN = 'public_key_0000';
5
+ const config = () => ({
6
+ params: {
7
+ publicToken: PUBLIC_TOKEN
8
+ }
9
+ })
10
+
11
+ const apiReturns = () => ({
12
+ somethingExtra: { object: true },
13
+ marketing_categories: {
14
+ iab_tier_1: [
15
+ { ID: 'IAB21', label: 'Real Estate', relevance: '0.45699' }
16
+ ]
17
+ }
18
+ })
19
+
20
+ const TAX_ID = '441'
21
+
22
+ /**
23
+ * Object generator, like above, written using alternative techniques
24
+ * @returns object with predefined (expected) bidsConfig fields
25
+ */
26
+ function bidsConfiglike() {
27
+ return Object.assign({}, {
28
+ ortb2Fragments: { global: {} }
29
+ })
30
+ }
31
+
32
+ describe('neuwoRtdProvider', function () {
33
+ describe('neuwoRtdModule', function () {
34
+ it('initializes', function () {
35
+ expect(neuwo.neuwoRtdModule.init(config())).to.be.true;
36
+ })
37
+ it('init needs that public token', function () {
38
+ expect(neuwo.neuwoRtdModule.init()).to.be.false;
39
+ })
40
+
41
+ describe('segment picking', function () {
42
+ it('handles bad inputs', function () {
43
+ expect(neuwo.pickSegments()).to.be.an('array').that.is.empty;
44
+ expect(neuwo.pickSegments('technically also an array')).to.be.an('array').that.is.empty;
45
+ expect(neuwo.pickSegments({ bad_object: 'bad' })).to.be.an('array').that.is.empty;
46
+ })
47
+ it('handles malformations', function () {
48
+ let result = neuwo.pickSegments([{something_wrong: true}, null, { ID: 'IAB19-20' }, { id: 'IAB3-1', ID: 'IAB9-20' }])
49
+ expect(result[0].id).to.equal('631')
50
+ expect(result[1].id).to.equal('58')
51
+ expect(result.length).to.equal(2)
52
+ })
53
+ })
54
+
55
+ describe('topic injection', function () {
56
+ it('mutates bidsConfig', function () {
57
+ let topics = apiReturns()
58
+ let bidsConfig = bidsConfiglike()
59
+ neuwo.injectTopics(topics, bidsConfig, () => { })
60
+ expect(bidsConfig.ortb2Fragments.global.site.content.data[0].name, 'name of first content data object').to.equal(neuwo.DATA_PROVIDER)
61
+ expect(bidsConfig.ortb2Fragments.global.site.content.data[0].segment[0].id, 'id of first segment in content.data').to.equal(TAX_ID)
62
+ expect(bidsConfig.ortb2Fragments.global.site.cattax, 'category taxonomy code for pagecat').to.equal(6) // CATTAX_IAB
63
+ expect(bidsConfig.ortb2Fragments.global.site.pagecat[0], 'category taxonomy code for pagecat').to.equal(TAX_ID)
64
+ })
65
+
66
+ it('handles malformed responses', function () {
67
+ let topics = { message: 'Forbidden' }
68
+ let bidsConfig = bidsConfiglike()
69
+ neuwo.injectTopics(topics, bidsConfig, () => { })
70
+ expect(bidsConfig.ortb2Fragments.global.site.content.data[0].name, 'name of first content data object').to.equal(neuwo.DATA_PROVIDER)
71
+ expect(bidsConfig.ortb2Fragments.global.site.content.data[0].segment, 'length of segment(s) in content.data').to.be.an('array').that.is.empty;
72
+
73
+ topics = '404 wouldn\'t really even show up for injection'
74
+ let bdsConfig = bidsConfiglike()
75
+ neuwo.injectTopics(topics, bdsConfig, () => { })
76
+ expect(bdsConfig.ortb2Fragments.global.site.content.data[0].name, 'name of first content data object').to.equal(neuwo.DATA_PROVIDER)
77
+ expect(bdsConfig.ortb2Fragments.global.site.content.data[0].segment, 'length of segment(s) in content.data').to.be.an('array').that.is.empty;
78
+
79
+ topics = undefined
80
+ let bdsConfigE = bidsConfiglike()
81
+ neuwo.injectTopics(topics, bdsConfigE, () => { })
82
+ expect(bdsConfigE.ortb2Fragments.global.site.content.data[0].name, 'name of first content data object').to.equal(neuwo.DATA_PROVIDER)
83
+ expect(bdsConfigE.ortb2Fragments.global.site.content.data[0].segment, 'length of segment(s) in content.data').to.be.an('array').that.is.empty;
84
+ })
85
+ })
86
+
87
+ describe('fragment addition', function () {
88
+ it('mutates input objects', function () {
89
+ let alphabet = { a: { b: { c: {} } } }
90
+ neuwo.addFragment(alphabet.a.b.c, 'd.e.f', { g: 'h' })
91
+ expect(alphabet.a.b.c.d.e.f.g).to.equal('h')
92
+ })
93
+ })
94
+
95
+ describe('getBidRequestData', function () {
96
+ it('forms requests properly and mutates input bidsConfig', function () {
97
+ let bids = bidsConfiglike()
98
+ let conf = config()
99
+ // control xhr api request target for testing
100
+ conf.params.argUrl = 'https://publisher.works/article.php?get=horrible_url_for_testing&id=5'
101
+
102
+ neuwo.getBidRequestData(bids, () => { }, conf, 'any consent data works, clearly')
103
+
104
+ let request = server.requests[0];
105
+ expect(request.url).to.be.a('string').that.includes(conf.params.publicToken)
106
+ expect(request.url).to.include(encodeURIComponent(conf.params.argUrl))
107
+ request.respond(200, { 'Content-Type': 'application/json; encoding=UTF-8' }, JSON.stringify(apiReturns()));
108
+
109
+ expect(bids.ortb2Fragments.global.site.content.data[0].name, 'name of first content data object').to.equal(neuwo.DATA_PROVIDER)
110
+ expect(bids.ortb2Fragments.global.site.content.data[0].segment[0].id, 'id of first segment in content.data').to.equal(TAX_ID)
111
+ })
112
+
113
+ it('accepts detail not available result', function () {
114
+ let bidsConfig = bidsConfiglike()
115
+ let comparison = bidsConfiglike()
116
+ neuwo.getBidRequestData(bidsConfig, () => { }, config(), 'consensually')
117
+ let request = server.requests[0];
118
+ request.respond(404, { 'Content-Type': 'application/json; encoding=UTF-8' }, JSON.stringify({ detail: 'Basically first time seeing this' }));
119
+ expect(bidsConfig).to.deep.equal(comparison)
120
+ })
121
+ })
122
+ })
123
+ })
@@ -2607,6 +2607,21 @@ describe('PubMatic adapter', function () {
2607
2607
  expect(data.imp[1]['video']['h']).to.equal(multipleMediaRequests[1].mediaTypes.video.playerSize[1]);
2608
2608
  });
2609
2609
 
2610
+ it('should pass device.sua if present in bidderRequest fpd ortb2 object', function () {
2611
+ const suaObject = {'source': 2, 'platform': {'brand': 'macOS', 'version': ['12', '4', '0']}, 'browsers': [{'brand': 'Not_A Brand', 'version': ['99', '0', '0', '0']}, {'brand': 'Google Chrome', 'version': ['109', '0', '5414', '119']}, {'brand': 'Chromium', 'version': ['109', '0', '5414', '119']}], 'mobile': 0, 'model': '', 'bitness': '64', 'architecture': 'x86'};
2612
+ let request = spec.buildRequests(multipleMediaRequests, {
2613
+ auctionId: 'new-auction-id',
2614
+ ortb2: {
2615
+ device: {
2616
+ sua: suaObject
2617
+ }
2618
+ }
2619
+ });
2620
+ let data = JSON.parse(request.data);
2621
+ expect(data.device.sua).to.exist.and.to.be.an('object');
2622
+ expect(data.device.sua).to.deep.equal(suaObject);
2623
+ });
2624
+
2610
2625
  it('Request params should have valid native bid request for all valid params', function () {
2611
2626
  let request = spec.buildRequests(nativeBidRequests, {
2612
2627
  auctionId: 'new-auction-id'