prebid.js 9.5.0 → 9.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 (197) hide show
  1. package/dist/33acrossAnalyticsAdapter.js +1 -1
  2. package/dist/33acrossBidAdapter.js +1 -1
  3. package/dist/33acrossIdSystem.js +1 -1
  4. package/dist/BTBidAdapter.js +1 -1
  5. package/dist/adagioAnalyticsAdapter.js +1 -1
  6. package/dist/adagioBidAdapter.js +1 -1
  7. package/dist/adagioUtils.js +1 -1
  8. package/dist/addefendBidAdapter.js +1 -1
  9. package/dist/adgenerationBidAdapter.js +1 -1
  10. package/dist/adkernelBidAdapter.js +1 -1
  11. package/dist/adlooxRtdProvider.js +1 -1
  12. package/dist/adqueryBidAdapter.js +1 -1
  13. package/dist/adrelevantisBidAdapter.js +1 -1
  14. package/dist/adstirBidAdapter.js +1 -1
  15. package/dist/adtrgtmeBidAdapter.js +1 -1
  16. package/dist/adxcgAnalyticsAdapter.js +1 -1
  17. package/dist/adxcgBidAdapter.js +1 -1
  18. package/dist/adyoulikeBidAdapter.js +1 -1
  19. package/dist/agmaAnalyticsAdapter.js +1 -1
  20. package/dist/aidemBidAdapter.js +1 -1
  21. package/dist/ajaBidAdapter.js +1 -1
  22. package/dist/amxBidAdapter.js +1 -1
  23. package/dist/amxIdSystem.js +1 -1
  24. package/dist/appierAnalyticsAdapter.js +1 -1
  25. package/dist/appnexusBidAdapter.js +1 -1
  26. package/dist/asoBidAdapter.js +1 -1
  27. package/dist/axonixBidAdapter.js +1 -1
  28. package/dist/bidglassBidAdapter.js +1 -1
  29. package/dist/big-richmediaBidAdapter.js +1 -1
  30. package/dist/bridBidAdapter.js +1 -1
  31. package/dist/bridgewellBidAdapter.js +1 -1
  32. package/dist/brightMountainMediaBidAdapter.js +1 -1
  33. package/dist/carodaBidAdapter.js +1 -1
  34. package/dist/chtnwBidAdapter.js +1 -1
  35. package/dist/chunk-core.js +1 -1
  36. package/dist/concertBidAdapter.js +1 -1
  37. package/dist/connectIdSystem.js +1 -1
  38. package/dist/connectadBidAdapter.js +1 -1
  39. package/dist/consumableBidAdapter.js +1 -1
  40. package/dist/conversantAnalyticsAdapter.js +1 -1
  41. package/dist/conversantBidAdapter.js +1 -1
  42. package/dist/craftBidAdapter.js +1 -1
  43. package/dist/criteoBidAdapter.js +1 -1
  44. package/dist/cwireBidAdapter.js +1 -1
  45. package/dist/dailymotionBidAdapter.js +1 -1
  46. package/dist/dependencies.json +26 -1
  47. package/dist/dspxBidAdapter.js +1 -1
  48. package/dist/dxkultureBidAdapter.js +1 -1
  49. package/dist/eplanningBidAdapter.js +1 -1
  50. package/dist/euidIdSystem.js +1 -1
  51. package/dist/exadsBidAdapter.js +1 -1
  52. package/dist/feedadBidAdapter.js +1 -1
  53. package/dist/finativeBidAdapter.js +1 -1
  54. package/dist/freewheel-sspBidAdapter.js +1 -1
  55. package/dist/gmosspBidAdapter.js +1 -1
  56. package/dist/goldbachBidAdapter.js +1 -1
  57. package/dist/greenbidsAnalyticsAdapter.js +1 -1
  58. package/dist/greenbidsRtdProvider.js +1 -1
  59. package/dist/gridBidAdapter.js +1 -1
  60. package/dist/gumgumBidAdapter.js +1 -1
  61. package/dist/h12mediaBidAdapter.js +1 -1
  62. package/dist/hypelabBidAdapter.js +1 -1
  63. package/dist/id5AnalyticsAdapter.js +1 -1
  64. package/dist/id5IdSystem.js +1 -1
  65. package/dist/imdsBidAdapter.js +1 -1
  66. package/dist/improvedigitalBidAdapter.js +1 -1
  67. package/dist/insticatorBidAdapter.js +1 -1
  68. package/dist/intentIqAnalyticsAdapter.js +1 -1
  69. package/dist/ixBidAdapter.js +1 -1
  70. package/dist/jixieBidAdapter.js +1 -1
  71. package/dist/justpremiumBidAdapter.js +1 -1
  72. package/dist/kargoBidAdapter.js +1 -1
  73. package/dist/kimberliteBidAdapter.js +1 -1
  74. package/dist/konduitAnalyticsAdapter.js +1 -1
  75. package/dist/kueezBidAdapter.js +1 -1
  76. package/dist/lassoBidAdapter.js +1 -1
  77. package/dist/lifestreetBidAdapter.js +1 -1
  78. package/dist/liveIntentIdSystem.js +1 -1
  79. package/dist/logicadBidAdapter.js +1 -1
  80. package/dist/loglyliftBidAdapter.js +1 -1
  81. package/dist/luceadBidAdapter.js +1 -1
  82. package/dist/mabidderBidAdapter.js +1 -1
  83. package/dist/magniteAnalyticsAdapter.js +1 -1
  84. package/dist/malltvAnalyticsAdapter.js +1 -1
  85. package/dist/marsmediaBidAdapter.js +1 -1
  86. package/dist/mediafuseBidAdapter.js +1 -1
  87. package/dist/medianetAnalyticsAdapter.js +1 -1
  88. package/dist/medianetBidAdapter.js +1 -1
  89. package/dist/mediasquareBidAdapter.js +1 -1
  90. package/dist/mgidBidAdapter.js +1 -1
  91. package/dist/minutemediaBidAdapter.js +1 -1
  92. package/dist/missenaBidAdapter.js +1 -1
  93. package/dist/nexx360BidAdapter.js +1 -1
  94. package/dist/nobidAnalyticsAdapter.js +1 -1
  95. package/dist/nobidBidAdapter.js +1 -1
  96. package/dist/not-for-prod/prebid.js +163 -162
  97. package/dist/oguryBidAdapter.js +1 -1
  98. package/dist/onetagBidAdapter.js +1 -1
  99. package/dist/ooloAnalyticsAdapter.js +1 -1
  100. package/dist/openwebBidAdapter.js +1 -1
  101. package/dist/openxBidAdapter.js +1 -1
  102. package/dist/optidigitalBidAdapter.js +1 -1
  103. package/dist/orbidderBidAdapter.js +1 -1
  104. package/dist/outbrainBidAdapter.js +1 -1
  105. package/dist/pixfutureBidAdapter.js +1 -1
  106. package/dist/publinkIdSystem.js +1 -1
  107. package/dist/publirBidAdapter.js +1 -1
  108. package/dist/pubmaticAnalyticsAdapter.js +1 -1
  109. package/dist/pubmaticBidAdapter.js +1 -1
  110. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  111. package/dist/pubxaiAnalyticsAdapter.js +1 -1
  112. package/dist/pxyzBidAdapter.js +1 -1
  113. package/dist/quantcastBidAdapter.js +1 -1
  114. package/dist/readpeakBidAdapter.js +1 -1
  115. package/dist/relaidoBidAdapter.js +1 -1
  116. package/dist/retailspotBidAdapter.js +1 -1
  117. package/dist/rhythmoneBidAdapter.js +1 -1
  118. package/dist/riseBidAdapter.js +1 -1
  119. package/dist/riseUtils.js +1 -0
  120. package/dist/rubiconBidAdapter.js +1 -1
  121. package/dist/seedingAllianceBidAdapter.js +1 -1
  122. package/dist/seedtagBidAdapter.js +1 -1
  123. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  124. package/dist/sharethroughBidAdapter.js +1 -1
  125. package/dist/shinezBidAdapter.js +1 -1
  126. package/dist/smaatoBidAdapter.js +1 -1
  127. package/dist/smartadserverBidAdapter.js +1 -1
  128. package/dist/smarthubBidAdapter.js +1 -1
  129. package/dist/smartxBidAdapter.js +1 -1
  130. package/dist/smilewantedBidAdapter.js +1 -1
  131. package/dist/snigelBidAdapter.js +1 -1
  132. package/dist/sonobiBidAdapter.js +1 -1
  133. package/dist/sovrnBidAdapter.js +1 -1
  134. package/dist/sspBCBidAdapter.js +1 -1
  135. package/dist/stnBidAdapter.js +1 -1
  136. package/dist/stvBidAdapter.js +1 -1
  137. package/dist/sublimeBidAdapter.js +1 -1
  138. package/dist/taboolaBidAdapter.js +1 -1
  139. package/dist/tappxBidAdapter.js +1 -1
  140. package/dist/targetVideoBidAdapter.js +1 -1
  141. package/dist/teadsBidAdapter.js +1 -1
  142. package/dist/telariaBidAdapter.js +1 -1
  143. package/dist/teqblazeUtils.js +1 -1
  144. package/dist/terceptAnalyticsAdapter.js +1 -1
  145. package/dist/themoneytizerBidAdapter.js +1 -1
  146. package/dist/trionBidAdapter.js +1 -1
  147. package/dist/tripleliftBidAdapter.js +1 -1
  148. package/dist/ttdBidAdapter.js +1 -1
  149. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  150. package/dist/uid2IdSystem.js +1 -1
  151. package/dist/uid2IdSystem_shared.js +1 -1
  152. package/dist/underdogmediaBidAdapter.js +1 -1
  153. package/dist/undertoneBidAdapter.js +1 -1
  154. package/dist/unrulyBidAdapter.js +1 -1
  155. package/dist/vidazooUtils.js +1 -1
  156. package/dist/videobyteBidAdapter.js +1 -1
  157. package/dist/visxBidAdapter.js +1 -1
  158. package/dist/vuukleBidAdapter.js +1 -1
  159. package/dist/widespaceBidAdapter.js +1 -1
  160. package/dist/winrBidAdapter.js +1 -1
  161. package/dist/yahooAdsBidAdapter.js +1 -1
  162. package/dist/yieldmoBidAdapter.js +1 -1
  163. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  164. package/libraries/riseUtils/index.js +330 -0
  165. package/libraries/teqblazeUtils/bidderUtils.js +15 -11
  166. package/modules/adagioAnalyticsAdapter.js +101 -84
  167. package/modules/adagioAnalyticsAdapter.md +4 -0
  168. package/modules/adagioBidAdapter.js +4 -16
  169. package/modules/adkernelBidAdapter.js +2 -2
  170. package/modules/aidemBidAdapter.js +2 -0
  171. package/modules/connectIdSystem.js +5 -3
  172. package/modules/insticatorBidAdapter.js +35 -31
  173. package/modules/kargoBidAdapter.js +11 -14
  174. package/modules/kimberliteBidAdapter.js +24 -7
  175. package/modules/kimberliteBidAdapter.md +30 -1
  176. package/modules/minutemediaBidAdapter.js +21 -398
  177. package/modules/nexx360BidAdapter.js +3 -2
  178. package/modules/openwebBidAdapter.js +18 -396
  179. package/modules/publirBidAdapter.js +20 -273
  180. package/modules/resetdigitalBidAdapter.md +54 -45
  181. package/modules/riseBidAdapter.js +19 -400
  182. package/modules/shinezBidAdapter.js +17 -361
  183. package/modules/smarthubBidAdapter.js +45 -177
  184. package/modules/stnBidAdapter.js +22 -398
  185. package/modules/telariaBidAdapter.js +2 -32
  186. package/modules/uid2IdSystem_shared.js +51 -39
  187. package/package.json +1 -1
  188. package/src/prebid.js +4 -0
  189. package/test/spec/modules/adagioAnalyticsAdapter_spec.js +231 -141
  190. package/test/spec/modules/adagioBidAdapter_spec.js +32 -66
  191. package/test/spec/modules/connectIdSystem_spec.js +27 -28
  192. package/test/spec/modules/insticatorBidAdapter_spec.js +8 -1
  193. package/test/spec/modules/kargoBidAdapter_spec.js +7 -8
  194. package/test/spec/modules/kimberliteBidAdapter_spec.js +137 -65
  195. package/test/spec/modules/nexx360BidAdapter_spec.js +1 -1
  196. package/test/spec/modules/smarthubBidAdapter_spec.js +6 -4
  197. package/test/spec/unit/pbjs_api_spec.js +11 -0
@@ -277,8 +277,6 @@ describe('Adagio bid adapter', () => {
277
277
  it('should send bid request to ENDPOINT_PB via POST', function() {
278
278
  sandbox.stub(_internal, 'getDevice').returns({ a: 'a' });
279
279
  sandbox.stub(_internal, 'getSite').returns({ domain: 'adagio.io', 'page': 'https://adagio.io/hb' });
280
- // sandbox.stub(_internal, 'getPageviewId').returns('1234-567');
281
- // sandbox.stub(utils, 'generateUUID').returns('blabla');
282
280
 
283
281
  const bid01 = new BidRequestBuilder().withParams().build();
284
282
  const bidderRequest = new BidderRequestBuilder().build();
@@ -292,7 +290,31 @@ describe('Adagio bid adapter', () => {
292
290
  expect(requests[0].data).to.have.all.keys(expectedDataKeys);
293
291
  });
294
292
 
295
- it('should use a custom generated auctionId and remove transactionId', function() {
293
+ it('should use a custom generated auctionId from ortb2.site.ext.data.adg_rtd.uid when available', function() {
294
+ const expectedAuctionId = '373bcda7-9794-4f1c-be2c-0d223d11d579'
295
+
296
+ const bid01 = new BidRequestBuilder().withParams().build();
297
+ let ortb = {
298
+ ortb2: {
299
+ site: {
300
+ ext: {
301
+ data: {
302
+ adg_rtd: {
303
+ uid: expectedAuctionId
304
+ }
305
+ }
306
+ }
307
+ }
308
+ }
309
+ }
310
+ const bidderRequest = new BidderRequestBuilder(ortb).build();
311
+
312
+ const requests = spec.buildRequests([bid01], bidderRequest);
313
+ expect(requests[0].data.adUnits[0].auctionId).eq(expectedAuctionId);
314
+ expect(requests[0].data.adUnits[0].transactionId).to.not.exist;
315
+ });
316
+
317
+ it('should use a custom generated auctionId when ortb2.site.ext.data.adg_rtd.uid is absent and remove transactionId', function() {
296
318
  const expectedAuctionId = '373bcda7-9794-4f1c-be2c-0d223d11d579'
297
319
  sandbox.stub(utils, 'generateUUID').returns(expectedAuctionId);
298
320
 
@@ -305,9 +327,7 @@ describe('Adagio bid adapter', () => {
305
327
  });
306
328
 
307
329
  it('should enrich prebid bid requests params', function() {
308
- const expectedAuctionId = '373bcda7-9794-4f1c-be2c-0d223d11d579'
309
330
  const expectedPageviewId = '56befc26-8cf0-472d-b105-73896df8eb89';
310
- sandbox.stub(utils, 'generateUUID').returns(expectedAuctionId);
311
331
  sandbox.stub(_internal, 'getAdagioNs').returns({ pageviewId: expectedPageviewId });
312
332
 
313
333
  const bid01 = new BidRequestBuilder().withParams().build();
@@ -315,7 +335,6 @@ describe('Adagio bid adapter', () => {
315
335
 
316
336
  spec.buildRequests([bid01], bidderRequest);
317
337
 
318
- expect(bid01.params.adagioAuctionId).eq(expectedAuctionId);
319
338
  expect(bid01.params.pageviewId).eq(expectedPageviewId);
320
339
  });
321
340
 
@@ -782,77 +801,24 @@ describe('Adagio bid adapter', () => {
782
801
  describe('with GPP', function() {
783
802
  const bid01 = new BidRequestBuilder().withParams().build();
784
803
 
785
- const regsGpp = 'regs_gpp_consent_string';
786
- const regsApplicableSections = [2];
787
-
788
- const ortb2Gpp = 'ortb2_gpp_consent_string';
789
- const ortb2GppSid = [1];
790
-
791
- context('When GPP in regs module', function() {
792
- it('send gpp and gppSid to the server', function() {
793
- const bidderRequest = new BidderRequestBuilder({
794
- gppConsent: {
795
- gppString: regsGpp,
796
- applicableSections: regsApplicableSections,
797
- }
798
- }).build();
799
-
800
- const requests = spec.buildRequests([bid01], bidderRequest);
801
-
802
- expect(requests[0].data.regs.gpp).to.equal(regsGpp);
803
- expect(requests[0].data.regs.gppSid).to.equal(regsApplicableSections);
804
- });
805
- });
806
-
807
- context('When GPP partially defined in regs module', function() {
808
- it('send gpp and gppSid coming from ortb2 to the server', function() {
809
- const bidderRequest = new BidderRequestBuilder({
810
- gppConsent: {
811
- gppString: regsGpp,
812
- },
813
- ortb2: {
814
- regs: {
815
- gpp: ortb2Gpp,
816
- gpp_sid: ortb2GppSid,
817
- }
818
- }
819
- }).build();
820
-
821
- const requests = spec.buildRequests([bid01], bidderRequest);
822
-
823
- expect(requests[0].data.regs.gpp).to.equal(ortb2Gpp);
824
- expect(requests[0].data.regs.gppSid).to.equal(ortb2GppSid);
825
- });
826
-
827
- it('send empty gpp and gppSid if no ortb2 fields to the server', function() {
828
- const bidderRequest = new BidderRequestBuilder({
829
- gppConsent: {
830
- gppString: regsGpp,
831
- }
832
- }).build();
833
-
834
- const requests = spec.buildRequests([bid01], bidderRequest);
835
-
836
- expect(requests[0].data.regs.gpp).to.equal('');
837
- expect(requests[0].data.regs.gppSid).to.be.empty;
838
- });
839
- });
804
+ const gpp = 'gpp_consent_string';
805
+ const gppSid = [1];
840
806
 
841
- context('When GPP defined in ortb2 module', function() {
807
+ context('When GPP is defined', function() {
842
808
  it('send gpp and gppSid coming from ortb2 to the server', function() {
843
809
  const bidderRequest = new BidderRequestBuilder({
844
810
  ortb2: {
845
811
  regs: {
846
- gpp: ortb2Gpp,
847
- gpp_sid: ortb2GppSid,
812
+ gpp,
813
+ gpp_sid: gppSid,
848
814
  }
849
815
  }
850
816
  }).build();
851
817
 
852
818
  const requests = spec.buildRequests([bid01], bidderRequest);
853
819
 
854
- expect(requests[0].data.regs.gpp).to.equal(ortb2Gpp);
855
- expect(requests[0].data.regs.gppSid).to.equal(ortb2GppSid);
820
+ expect(requests[0].data.regs.gpp).to.equal(gpp);
821
+ expect(requests[0].data.regs.gppSid).to.equal(gppSid);
856
822
  });
857
823
  });
858
824
 
@@ -549,24 +549,28 @@ describe('Yahoo ConnectID Submodule', () => {
549
549
  expect(result.callback).to.be.a('function');
550
550
  });
551
551
 
552
+ function mockOptout(value) {
553
+ getLocalStorageStub.callsFake((key) => {
554
+ if (key === 'connectIdOptOut') return value;
555
+ })
556
+ }
557
+
552
558
  it('returns an undefined if the Yahoo specific opt-out key is present in local storage', () => {
553
- localStorage.setItem('connectIdOptOut', '1');
559
+ mockOptout('1');
554
560
  expect(invokeGetIdAPI({
555
561
  he: HASHED_EMAIL,
556
562
  pixelId: PIXEL_ID
557
563
  }, consentData)).to.be.undefined;
558
- localStorage.removeItem('connectIdOptOut');
559
564
  });
560
565
 
561
566
  it('returns an object with the callback function if the correct params are passed and Yahoo opt-out value is not "1"', () => {
562
- localStorage.setItem('connectIdOptOut', 'true');
567
+ mockOptout('true');
563
568
  let result = invokeGetIdAPI({
564
569
  he: HASHED_EMAIL,
565
570
  pixelId: PIXEL_ID
566
571
  }, consentData);
567
572
  expect(result).to.be.an('object').that.has.all.keys('callback');
568
573
  expect(result.callback).to.be.a('function');
569
- localStorage.removeItem('connectIdOptOut');
570
574
  });
571
575
 
572
576
  it('Makes an ajax GET request to the production API endpoint with pixelId and he query params', () => {
@@ -804,6 +808,25 @@ describe('Yahoo ConnectID Submodule', () => {
804
808
  });
805
809
  });
806
810
  });
811
+ describe('userHasOptedOut()', () => {
812
+ it('should return a function', () => {
813
+ expect(connectIdSubmodule.userHasOptedOut).to.be.a('function');
814
+ });
815
+
816
+ it('should return false when local storage key has not been set function', () => {
817
+ expect(connectIdSubmodule.userHasOptedOut()).to.be.false;
818
+ });
819
+
820
+ it('should return true when local storage key has been set to "1"', () => {
821
+ getLocalStorageStub.returns('1');
822
+ expect(connectIdSubmodule.userHasOptedOut()).to.be.true;
823
+ });
824
+
825
+ it('should return false when local storage key has not been set to "1"', () => {
826
+ getLocalStorageStub.returns('hello');
827
+ expect(connectIdSubmodule.userHasOptedOut()).to.be.false;
828
+ });
829
+ });
807
830
  });
808
831
 
809
832
  describe('decode()', () => {
@@ -884,28 +907,4 @@ describe('Yahoo ConnectID Submodule', () => {
884
907
  })).to.be.true;
885
908
  });
886
909
  });
887
-
888
- describe('userHasOptedOut()', () => {
889
- afterEach(() => {
890
- localStorage.removeItem('connectIdOptOut');
891
- });
892
-
893
- it('should return a function', () => {
894
- expect(connectIdSubmodule.userHasOptedOut).to.be.a('function');
895
- });
896
-
897
- it('should return false when local storage key has not been set function', () => {
898
- expect(connectIdSubmodule.userHasOptedOut()).to.be.false;
899
- });
900
-
901
- it('should return true when local storage key has been set to "1"', () => {
902
- localStorage.setItem('connectIdOptOut', '1');
903
- expect(connectIdSubmodule.userHasOptedOut()).to.be.true;
904
- });
905
-
906
- it('should return false when local storage key has not been set to "1"', () => {
907
- localStorage.setItem('connectIdOptOut', 'hello');
908
- expect(connectIdSubmodule.userHasOptedOut()).to.be.false;
909
- });
910
- });
911
910
  });
@@ -389,7 +389,7 @@ describe('InsticatorBidAdapter', function () {
389
389
  expect(data.device).to.be.an('object');
390
390
  expect(data.device.w).to.equal(window.innerWidth);
391
391
  expect(data.device.h).to.equal(window.innerHeight);
392
- expect(data.device.js).to.equal(true);
392
+ expect(data.device.js).to.equal(1);
393
393
  expect(data.device.ext).to.be.an('object');
394
394
  expect(data.device.ext.localStorage).to.equal(true);
395
395
  expect(data.device.ext.cookies).to.equal(false);
@@ -439,6 +439,13 @@ describe('InsticatorBidAdapter', function () {
439
439
  insticator: {
440
440
  adUnitId: bidRequest.params.adUnitId,
441
441
  },
442
+ prebid: {
443
+ bidder: {
444
+ insticator: {
445
+ adUnitId: bidRequest.params.adUnitId,
446
+ }
447
+ }
448
+ }
442
449
  }
443
450
  }]);
444
451
  expect(data.ext).to.be.an('object');
@@ -1885,16 +1885,15 @@ describe('kargo adapter tests', function() {
1885
1885
  describe('getUserSyncs', function() {
1886
1886
  let crb = {};
1887
1887
  const clientId = 'random-client-id-string';
1888
- const baseUrl = 'https://crb.kargo.com/api/v1/initsyncrnd/random-client-id-string?seed=3205e885-8d37-4139-b47e-f82cff268000&idx=0&gdpr=0&gdpr_consent=&us_privacy=&gpp=&gpp_sid=';
1888
+ const baseUrl = 'https://crb.kargo.com/api/v1/initsyncrnd/random-client-id-string?seed=3205e885-8d37-4139-b47e-f82cff268000&gdpr=0&gdpr_consent=&us_privacy=&gpp=&gpp_sid=';
1889
1889
 
1890
- function buildSyncUrls(baseUrl = 'https://crb.kargo.com/api/v1/initsyncrnd/random-client-id-string?seed=3205e885-8d37-4139-b47e-f82cff268000&idx=0&gdpr=0&gdpr_consent=&us_privacy=&gpp=&gpp_sid=') {
1890
+ function buildSyncUrls(baseUrl = 'https://crb.kargo.com/api/v1/initsyncrnd/random-client-id-string?seed=3205e885-8d37-4139-b47e-f82cff268000&gdpr=0&gdpr_consent=&us_privacy=&gpp=&gpp_sid=') {
1891
1891
  let syncs = [];
1892
- for (let i = 0; i < 5; i++) {
1893
- syncs.push({
1894
- type: 'iframe',
1895
- url: baseUrl.replace(/idx=\d+&/, `idx=${i}&`),
1896
- });
1897
- }
1892
+
1893
+ syncs.push({
1894
+ type: 'iframe',
1895
+ url: baseUrl
1896
+ });
1898
1897
 
1899
1898
  return syncs;
1900
1899
  }
@@ -1,6 +1,6 @@
1
- import { spec } from 'modules/kimberliteBidAdapter.js';
1
+ import { spec, ENDPOINT_URL } from 'modules/kimberliteBidAdapter.js';
2
2
  import { assert } from 'chai';
3
- import { BANNER } from '../../../src/mediaTypes.js';
3
+ import { BANNER, VIDEO } from '../../../src/mediaTypes.js';
4
4
 
5
5
  const BIDDER_CODE = 'kimberlite';
6
6
 
@@ -8,74 +8,104 @@ describe('kimberliteBidAdapter', function () {
8
8
  const sizes = [[640, 480]];
9
9
 
10
10
  describe('isBidRequestValid', function () {
11
- let bidRequest;
11
+ let bidRequests;
12
12
 
13
13
  beforeEach(function () {
14
- bidRequest = {
15
- mediaTypes: {
16
- [BANNER]: {
17
- sizes: [[320, 240]]
14
+ bidRequests = [
15
+ {
16
+ mediaTypes: {
17
+ [BANNER]: {
18
+ sizes: [[320, 240]]
19
+ }
20
+ },
21
+ params: {
22
+ placementId: 'test-placement'
18
23
  }
19
24
  },
20
- params: {
21
- placementId: 'test-placement'
25
+ {
26
+ mediaTypes: {
27
+ [VIDEO]: {
28
+ mimes: ['video/mp4']
29
+ }
30
+ },
31
+ params: {
32
+ placementId: 'test-placement'
33
+ }
22
34
  }
23
- };
35
+ ];
24
36
  });
25
37
 
26
- it('pass on valid bidRequest', function () {
27
- assert.isTrue(spec.isBidRequestValid(bidRequest));
38
+ it('pass on valid banner bidRequest', function () {
39
+ assert.isTrue(spec.isBidRequestValid(bidRequests[0]));
28
40
  });
29
41
 
30
42
  it('fails on missed placementId', function () {
31
- delete bidRequest.params.placementId;
32
- assert.isFalse(spec.isBidRequestValid(bidRequest));
43
+ delete bidRequests[0].params.placementId;
44
+ assert.isFalse(spec.isBidRequestValid(bidRequests[0]));
33
45
  });
34
46
 
35
47
  it('fails on empty banner', function () {
36
- delete bidRequest.mediaTypes.banner;
37
- assert.isFalse(spec.isBidRequestValid(bidRequest));
48
+ delete bidRequests[0].mediaTypes.banner;
49
+ assert.isFalse(spec.isBidRequestValid(bidRequests[0]));
38
50
  });
39
51
 
40
52
  it('fails on empty banner.sizes', function () {
41
- delete bidRequest.mediaTypes.banner.sizes;
42
- assert.isFalse(spec.isBidRequestValid(bidRequest));
53
+ delete bidRequests[0].mediaTypes.banner.sizes;
54
+ assert.isFalse(spec.isBidRequestValid(bidRequests[0]));
43
55
  });
44
56
 
45
57
  it('fails on empty request', function () {
46
58
  assert.isFalse(spec.isBidRequestValid());
47
59
  });
60
+
61
+ it('pass on valid video bidRequest', function () {
62
+ assert.isTrue(spec.isBidRequestValid(bidRequests[1]));
63
+ });
64
+
65
+ it('fails on missed video.mimes', function () {
66
+ delete bidRequests[1].mediaTypes.video.mimes;
67
+ assert.isFalse(spec.isBidRequestValid(bidRequests[1]));
68
+ });
48
69
  });
49
70
 
50
71
  describe('buildRequests', function () {
51
72
  let bidRequests, bidderRequest;
52
73
 
53
74
  beforeEach(function () {
54
- bidRequests = [{
55
- mediaTypes: {
56
- [BANNER]: {sizes: sizes}
75
+ bidRequests = [
76
+ {
77
+ mediaTypes: {
78
+ [BANNER]: {sizes: sizes}
79
+ },
80
+ params: {
81
+ placementId: 'test-placement'
82
+ }
57
83
  },
58
- params: {
59
- placementId: 'test-placement'
84
+ {
85
+ mediaTypes: {
86
+ [VIDEO]: {
87
+ mimes: ['video/mp4'],
88
+ }
89
+ },
90
+ params: {
91
+ placementId: 'test-placement'
92
+ }
60
93
  }
61
- }];
94
+ ];
62
95
 
63
96
  bidderRequest = {
64
97
  refererInfo: {
65
98
  domain: 'example.com',
66
99
  page: 'https://www.example.com/test.html',
67
- },
68
- bids: [{
69
- mediaTypes: {
70
- [BANNER]: {sizes: sizes}
71
- }
72
- }]
100
+ }
73
101
  };
74
102
  });
75
103
 
76
104
  it('valid bid request', function () {
77
105
  const bidRequest = spec.buildRequests(bidRequests, bidderRequest);
106
+
78
107
  assert.equal(bidRequest.method, 'POST');
108
+ assert.equal(bidRequest.url, ENDPOINT_URL);
79
109
  assert.ok(bidRequest.data);
80
110
 
81
111
  const requestData = bidRequest.data;
@@ -87,10 +117,10 @@ describe('kimberliteBidAdapter', function () {
87
117
  expect(requestData.ext).to.be.an('Object').and.have.all.keys('prebid');
88
118
  expect(requestData.ext.prebid).to.be.an('Object').and.have.all.keys('ver', 'adapterVer');
89
119
 
90
- const impData = requestData.imp[0];
91
- expect(impData.banner).is.to.be.an('Object').and.have.all.keys(['format', 'topframe']);
120
+ const impBannerData = requestData.imp[0];
121
+ expect(impBannerData.banner).is.to.be.an('Object').and.have.all.keys(['format', 'topframe']);
92
122
 
93
- const bannerData = impData.banner;
123
+ const bannerData = impBannerData.banner;
94
124
  expect(bannerData.format).to.be.an('array').and.is.not.empty;
95
125
 
96
126
  const formatData = bannerData.format[0];
@@ -98,30 +128,44 @@ describe('kimberliteBidAdapter', function () {
98
128
 
99
129
  assert.equal(formatData.w, sizes[0][0]);
100
130
  assert.equal(formatData.h, sizes[0][1]);
131
+
132
+ if (FEATURES.VIDEO) {
133
+ const impVideoData = requestData.imp[1];
134
+ expect(impVideoData.video).is.to.be.an('Object').and.have.all.keys(['mimes']);
135
+
136
+ const videoData = impVideoData.video;
137
+ expect(videoData.mimes).to.be.an('array').and.is.not.empty;
138
+ expect(videoData.mimes[0]).to.be.a('string').that.equals('video/mp4');
139
+ }
101
140
  });
102
141
  });
103
142
 
104
143
  describe('interpretResponse', function () {
105
- let bidderResponse, bidderRequest, bidRequest, expectedBid;
144
+ let bidderResponse, bidderRequest, bidRequest, expectedBids;
106
145
 
107
146
  const requestId = '07fba8b0-8812-4dc6-b91e-4a525d81729c';
108
- const bidId = '222209853178';
109
- const impId = 'imp-id';
110
- const crId = 'creative-id';
111
- const adm = '<a href="http://test.landing.com">landing</a>';
147
+ const bannerAdm = '<a href="http://test.landing.com">landing</a>';
148
+ const videoAdm = '<VAST version="3.0">test vast</VAST>';
112
149
 
113
150
  beforeEach(function () {
114
151
  bidderResponse = {
115
152
  body: {
116
153
  id: requestId,
117
154
  seatbid: [{
118
- bid: [{
119
- crid: crId,
120
- id: bidId,
121
- impid: impId,
122
- price: 1,
123
- adm: adm
124
- }]
155
+ bid: [
156
+ {
157
+ crid: 1,
158
+ impid: 1,
159
+ price: 1,
160
+ adm: bannerAdm
161
+ },
162
+ {
163
+ crid: 2,
164
+ impid: 2,
165
+ price: 1,
166
+ adm: videoAdm
167
+ }
168
+ ]
125
169
  }]
126
170
  }
127
171
  };
@@ -131,36 +175,64 @@ describe('kimberliteBidAdapter', function () {
131
175
  domain: 'example.com',
132
176
  page: 'https://www.example.com/test.html',
133
177
  },
134
- bids: [{
135
- bidId: impId,
136
- mediaTypes: {
137
- [BANNER]: {sizes: sizes}
178
+ bids: [
179
+ {
180
+ bidId: 1,
181
+ mediaTypes: {
182
+ banner: {sizes: sizes}
183
+ },
184
+ params: {
185
+ placementId: 'test-placement'
186
+ }
138
187
  },
139
- params: {
140
- placementId: 'test-placement'
188
+ {
189
+ bidId: 2,
190
+ mediaTypes: {
191
+ video: {
192
+ mimes: ['video/mp4']
193
+ }
194
+ },
195
+ params: {
196
+ placementId: 'test-placement'
197
+ }
141
198
  }
142
- }]
199
+ ]
143
200
  };
144
201
 
145
- expectedBid = {
146
- mediaType: 'banner',
147
- requestId: 'imp-id',
148
- seatBidId: '222209853178',
149
- cpm: 1,
150
- creative_id: 'creative-id',
151
- creativeId: 'creative-id',
152
- ttl: 300,
153
- netRevenue: true,
154
- ad: adm,
155
- meta: {}
156
- };
202
+ expectedBids = [
203
+ {
204
+ mediaType: 'banner',
205
+ requestId: 1,
206
+ cpm: 1,
207
+ creative_id: 1,
208
+ creativeId: 1,
209
+ ttl: 300,
210
+ netRevenue: true,
211
+ ad: bannerAdm,
212
+ meta: {}
213
+ },
214
+ {
215
+ mediaType: 'video',
216
+ requestId: 2,
217
+ cpm: 1,
218
+ creative_id: 2,
219
+ creativeId: 2,
220
+ ttl: 300,
221
+ netRevenue: true,
222
+ vastXml: videoAdm,
223
+ meta: {}
224
+ },
225
+ ];
157
226
 
158
227
  bidRequest = spec.buildRequests(bidderRequest.bids, bidderRequest);
159
228
  });
160
229
 
161
230
  it('pass on valid request', function () {
162
231
  const bids = spec.interpretResponse(bidderResponse, bidRequest);
163
- assert.deepEqual(bids[0], expectedBid);
232
+ assert.deepEqual(bids[0], expectedBids[0]);
233
+ if (FEATURES.VIDEO) {
234
+ assert.deepEqual(bids[1], expectedBids[1]);
235
+ }
164
236
  });
165
237
 
166
238
  it('fails on empty response', function () {
@@ -405,7 +405,7 @@ describe('Nexx360 bid adapter tests', function () {
405
405
  expect(requestContent.imp[1].tagid).to.be.eql('div-2-abcd');
406
406
  expect(requestContent.imp[1].ext.adUnitCode).to.be.eql('div-2-abcd');
407
407
  expect(requestContent.imp[1].ext.divId).to.be.eql('div-2-abcd');
408
- expect(requestContent.ext.bidderVersion).to.be.eql('4.1');
408
+ expect(requestContent.ext.bidderVersion).to.be.eql('4.2');
409
409
  expect(requestContent.ext.source).to.be.eql('prebid.js');
410
410
  });
411
411
 
@@ -106,7 +106,9 @@ describe('SmartHubBidAdapter', function () {
106
106
 
107
107
  const bidderRequest = {
108
108
  uspConsent: '1---',
109
- gdprConsent: 'COvFyGBOvFyGBAbAAAENAPCAAOAAAAAAAAAAAEEUACCKAAA.IFoEUQQgAIQwgIwQABAEAAAAOIAACAIAAAAQAIAgEAACEAAAAAgAQBAAAAAAAGBAAgAAAAAAAFAAECAAAgAAQARAEQAAAAAJAAIAAgAAAYQEAAAQmAgBC3ZAYzUw',
109
+ gdprConsent: {
110
+ consentString: 'COvFyGBOvFyGBAbAAAENAPCAAOAAAAAAAAAAAEEUACCKAAA.IFoEUQQgAIQwgIwQABAEAAAAOIAACAIAAAAQAIAgEAACEAAAAAgAQBAAAAAAAGBAAgAAAAAAAFAAECAAAgAAQARAEQAAAAAJAAIAAgAAAYQEAAAQmAgBC3ZAYzUw'
111
+ },
110
112
  refererInfo: {
111
113
  page: 'https://test.com'
112
114
  },
@@ -166,7 +168,7 @@ describe('SmartHubBidAdapter', function () {
166
168
  expect(data.host).to.be.a('string');
167
169
  expect(data.page).to.be.a('string');
168
170
  expect(data.coppa).to.be.a('number');
169
- expect(data.gdpr).to.be.a('string');
171
+ expect(data.gdpr.consentString).to.be.a('string');
170
172
  expect(data.ccpa).to.be.a('string');
171
173
  expect(data.tmax).to.be.a('number');
172
174
  expect(data.placements).to.have.lengthOf(3);
@@ -212,8 +214,8 @@ describe('SmartHubBidAdapter', function () {
212
214
  serverRequest = spec.buildRequests(bids, bidderRequest);
213
215
  let data = serverRequest[0].data;
214
216
  expect(data.gdpr).to.exist;
215
- expect(data.gdpr).to.be.a('string');
216
- expect(data.gdpr).to.equal(bidderRequest.gdprConsent);
217
+ expect(data.gdpr.consentString).to.be.a('string');
218
+ expect(data.gdpr.consentString).to.equal(bidderRequest.gdprConsent.consentString);
217
219
  expect(data.ccpa).to.not.exist;
218
220
  delete bidderRequest.gdprConsent;
219
221
  });
@@ -3757,4 +3757,15 @@ describe('Unit: Prebid Module', function () {
3757
3757
  sinon.assert.calledOnce(adapterManager.callBidBillableBidder);
3758
3758
  });
3759
3759
  });
3760
+
3761
+ describe('clearAllAuctions', () => {
3762
+ after(() => {
3763
+ resetAuction();
3764
+ });
3765
+ it('clears auction data', function () {
3766
+ expect(auctionManager.getBidsReceived().length).to.not.equal(0);
3767
+ $$PREBID_GLOBAL$$.clearAllAuctions();
3768
+ expect(auctionManager.getBidsReceived().length).to.equal(0);
3769
+ });
3770
+ });
3760
3771
  });