prebid.js 8.1.0 → 8.3.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 (214) hide show
  1. package/.devcontainer/devcontainer.json +3 -1
  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/admanBidAdapter.js +1 -1
  8. package/dist/adqueryBidAdapter.js +1 -1
  9. package/dist/adrelevantisBidAdapter.js +1 -1
  10. package/dist/adtelligentBidAdapter.js +1 -1
  11. package/dist/adtrgtmeBidAdapter.js +1 -1
  12. package/dist/adxcgBidAdapter.js +1 -1
  13. package/dist/adyoulikeBidAdapter.js +1 -1
  14. package/dist/ajaBidAdapter.js +1 -1
  15. package/dist/amxBidAdapter.js +1 -1
  16. package/dist/amxIdSystem.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/axonixBidAdapter.js +1 -1
  21. package/dist/beopBidAdapter.js +1 -1
  22. package/dist/bidglassBidAdapter.js +1 -1
  23. package/dist/big-richmediaBidAdapter.js +1 -1
  24. package/dist/bridBidAdapter.js +1 -0
  25. package/dist/bridgewellBidAdapter.js +1 -1
  26. package/dist/brightMountainMediaBidAdapter.js +1 -1
  27. package/dist/carodaBidAdapter.js +1 -1
  28. package/dist/categoryTranslation.js +1 -1
  29. package/dist/chtnwBidAdapter.js +1 -1
  30. package/dist/cmp.js +1 -0
  31. package/dist/concertBidAdapter.js +1 -1
  32. package/dist/connectadBidAdapter.js +1 -1
  33. package/dist/consentManagement.js +1 -1
  34. package/dist/consentManagementGpp.js +1 -1
  35. package/dist/consentManagementUsp.js +1 -1
  36. package/dist/consumableBidAdapter.js +1 -1
  37. package/dist/conversantAnalyticsAdapter.js +1 -1
  38. package/dist/conversantBidAdapter.js +1 -1
  39. package/dist/craftBidAdapter.js +1 -1
  40. package/dist/criteoBidAdapter.js +1 -1
  41. package/dist/cwireBidAdapter.js +1 -1
  42. package/dist/dependencies.json +15 -0
  43. package/dist/discoveryBidAdapter.js +1 -1
  44. package/dist/dspxBidAdapter.js +1 -1
  45. package/dist/eplanningBidAdapter.js +1 -1
  46. package/dist/euidIdSystem.js +1 -1
  47. package/dist/feedadBidAdapter.js +1 -1
  48. package/dist/finativeBidAdapter.js +1 -1
  49. package/dist/freewheel-sspBidAdapter.js +1 -1
  50. package/dist/gmosspBidAdapter.js +1 -1
  51. package/dist/goldbachBidAdapter.js +1 -1
  52. package/dist/gppControl_usnat.js +1 -0
  53. package/dist/greenbidsAnalyticsAdapter.js +1 -1
  54. package/dist/greenbidsRtdProvider.js +1 -1
  55. package/dist/gridBidAdapter.js +1 -1
  56. package/dist/gumgumBidAdapter.js +1 -1
  57. package/dist/h12mediaBidAdapter.js +1 -1
  58. package/dist/holidBidAdapter.js +1 -1
  59. package/dist/hypelabBidAdapter.js +1 -1
  60. package/dist/id5IdSystem.js +1 -1
  61. package/dist/imdsBidAdapter.js +1 -1
  62. package/dist/improvedigitalBidAdapter.js +1 -1
  63. package/dist/insticatorBidAdapter.js +1 -1
  64. package/dist/intentIqIdSystem.js +1 -1
  65. package/dist/ixBidAdapter.js +1 -1
  66. package/dist/justpremiumBidAdapter.js +1 -1
  67. package/dist/kargoBidAdapter.js +1 -1
  68. package/dist/konduitAnalyticsAdapter.js +1 -1
  69. package/dist/kueezBidAdapter.js +1 -1
  70. package/dist/kueezRtbBidAdapter.js +1 -1
  71. package/dist/kulturemediaBidAdapter.js +1 -1
  72. package/dist/lassoBidAdapter.js +1 -1
  73. package/dist/lifestreetBidAdapter.js +1 -1
  74. package/dist/liveIntentIdSystem.js +1 -1
  75. package/dist/livewrappedAnalyticsAdapter.js +1 -1
  76. package/dist/logicadBidAdapter.js +1 -1
  77. package/dist/loglyliftBidAdapter.js +1 -1
  78. package/dist/magniteAnalyticsAdapter.js +1 -1
  79. package/dist/malltvAnalyticsAdapter.js +1 -1
  80. package/dist/marsmediaBidAdapter.js +1 -1
  81. package/dist/mediafuseBidAdapter.js +1 -1
  82. package/dist/mediagoBidAdapter.js +1 -1
  83. package/dist/mediasquareBidAdapter.js +1 -1
  84. package/dist/mgidBidAdapter.js +1 -1
  85. package/dist/minutemediaBidAdapter.js +1 -1
  86. package/dist/minutemediaplusBidAdapter.js +1 -1
  87. package/dist/mspa.js +1 -0
  88. package/dist/nexx360BidAdapter.js +1 -1
  89. package/dist/not-for-prod/prebid.js +144 -140
  90. package/dist/oguryBidAdapter.js +1 -1
  91. package/dist/onetagBidAdapter.js +1 -1
  92. package/dist/ooloAnalyticsAdapter.js +1 -1
  93. package/dist/optidigitalBidAdapter.js +1 -1
  94. package/dist/outbrainBidAdapter.js +1 -1
  95. package/dist/oxxionRtdProvider.js +1 -1
  96. package/dist/parrableIdSystem.js +1 -1
  97. package/dist/pixfutureBidAdapter.js +1 -1
  98. package/dist/prebid-core.js +1 -1
  99. package/dist/publinkIdSystem.js +1 -1
  100. package/dist/pubmaticBidAdapter.js +1 -1
  101. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  102. package/dist/pxyzBidAdapter.js +1 -1
  103. package/dist/quantcastBidAdapter.js +1 -1
  104. package/dist/readpeakBidAdapter.js +1 -1
  105. package/dist/relaidoBidAdapter.js +1 -1
  106. package/dist/retailspotBidAdapter.js +1 -1
  107. package/dist/rhythmoneBidAdapter.js +1 -1
  108. package/dist/riseBidAdapter.js +1 -1
  109. package/dist/rubiconBidAdapter.js +1 -1
  110. package/dist/seedingAllianceBidAdapter.js +1 -1
  111. package/dist/seedtagBidAdapter.js +1 -1
  112. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  113. package/dist/sharethroughBidAdapter.js +1 -1
  114. package/dist/shinezBidAdapter.js +1 -1
  115. package/dist/smaatoBidAdapter.js +1 -1
  116. package/dist/smartadserverBidAdapter.js +1 -1
  117. package/dist/smartxBidAdapter.js +1 -1
  118. package/dist/smartyadsBidAdapter.js +1 -1
  119. package/dist/smilewantedBidAdapter.js +1 -1
  120. package/dist/sonobiBidAdapter.js +1 -1
  121. package/dist/sovrnAnalyticsAdapter.js +1 -1
  122. package/dist/sovrnBidAdapter.js +1 -1
  123. package/dist/sspBCBidAdapter.js +1 -1
  124. package/dist/stvBidAdapter.js +1 -1
  125. package/dist/sublimeBidAdapter.js +1 -1
  126. package/dist/targetVideoBidAdapter.js +1 -1
  127. package/dist/teadsBidAdapter.js +1 -1
  128. package/dist/trafficgateBidAdapter.js +1 -1
  129. package/dist/trionBidAdapter.js +1 -1
  130. package/dist/tripleliftBidAdapter.js +1 -1
  131. package/dist/ttdBidAdapter.js +1 -1
  132. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  133. package/dist/uid2IdSystem.js +1 -1
  134. package/dist/underdogmediaBidAdapter.js +1 -1
  135. package/dist/undertoneBidAdapter.js +1 -1
  136. package/dist/userId.js +1 -1
  137. package/dist/vidazooBidAdapter.js +1 -1
  138. package/dist/videobyteBidAdapter.js +1 -1
  139. package/dist/visxBidAdapter.js +1 -1
  140. package/dist/vuukleBidAdapter.js +1 -1
  141. package/dist/widespaceBidAdapter.js +1 -1
  142. package/dist/winrBidAdapter.js +1 -1
  143. package/dist/yahoosspBidAdapter.js +1 -1
  144. package/dist/yieldmoBidAdapter.js +1 -1
  145. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  146. package/libraries/cmp/cmpClient.js +139 -0
  147. package/libraries/mspa/activityControls.js +91 -0
  148. package/modules/adagioBidAdapter.js +2 -1
  149. package/modules/admanBidAdapter.js +5 -0
  150. package/modules/adtelligentBidAdapter.js +8 -0
  151. package/modules/beopBidAdapter.js +6 -6
  152. package/modules/beopBidAdapter.md +35 -1
  153. package/modules/bridBidAdapter.js +223 -0
  154. package/modules/cadentApertureMXBidAdapter.md +2 -2
  155. package/modules/categoryTranslation.js +3 -2
  156. package/modules/consentManagement.js +12 -86
  157. package/modules/consentManagementGpp.js +47 -126
  158. package/modules/consentManagementUsp.js +19 -97
  159. package/modules/discoveryBidAdapter.js +1 -1
  160. package/modules/gppControl_usnat.js +11 -0
  161. package/modules/holidBidAdapter.js +49 -30
  162. package/modules/intentIqIdSystem.js +6 -5
  163. package/modules/ixBidAdapter.js +2 -1
  164. package/modules/liveIntentIdSystem.js +8 -3
  165. package/modules/livewrappedAnalyticsAdapter.js +33 -33
  166. package/modules/mediagoBidAdapter.js +1 -0
  167. package/modules/mediasquareBidAdapter.js +19 -23
  168. package/modules/oxxionRtdProvider.js +124 -11
  169. package/modules/oxxionRtdProvider.md +19 -4
  170. package/modules/smartyadsBidAdapter.js +6 -3
  171. package/modules/sovrnBidAdapter.js +5 -0
  172. package/modules/trafficgateBidAdapter.js +126 -72
  173. package/modules/tripleliftBidAdapter.js +21 -1
  174. package/modules/userId/eids.js +29 -0
  175. package/modules/userId/eids.md +19 -2
  176. package/modules/userId/index.js +78 -29
  177. package/modules/userId/userId.md +3 -0
  178. package/modules/vidazooBidAdapter.js +68 -16
  179. package/package.json +1 -1
  180. package/src/activities/params.js +4 -1
  181. package/test/spec/libraries/cmp/cmpClient_spec.js +233 -0
  182. package/test/spec/libraries/mspa/activityControls_spec.js +315 -0
  183. package/test/spec/modules/adagioBidAdapter_spec.js +2 -1
  184. package/test/spec/modules/admanBidAdapter_spec.js +8 -2
  185. package/test/spec/modules/adqueryBidAdapter_spec.js +5 -1
  186. package/test/spec/modules/adtelligentBidAdapter_spec.js +8 -0
  187. package/test/spec/modules/beopBidAdapter_spec.js +18 -2
  188. package/test/spec/modules/bridBidAdapter_spec.js +129 -0
  189. package/test/spec/modules/byDataAnalyticsAdapter_spec.js +9 -7
  190. package/test/spec/modules/cadentApertureMXBidAdapter_spec.js +1 -1
  191. package/test/spec/modules/chtnwBidAdapter_spec.js +4 -1
  192. package/test/spec/modules/consentManagementGpp_spec.js +84 -7
  193. package/test/spec/modules/consentManagement_spec.js +8 -18
  194. package/test/spec/modules/datablocksBidAdapter_spec.js +7 -3
  195. package/test/spec/modules/eids_spec.js +87 -0
  196. package/test/spec/modules/holidBidAdapter_spec.js +26 -6
  197. package/test/spec/modules/insticatorBidAdapter_spec.js +6 -2
  198. package/test/spec/modules/intentIqIdSystem_spec.js +36 -2
  199. package/test/spec/modules/ixBidAdapter_spec.js +52 -18
  200. package/test/spec/modules/lassoBidAdapter_spec.js +6 -4
  201. package/test/spec/modules/liveIntentIdMinimalSystem_spec.js +17 -2
  202. package/test/spec/modules/liveIntentIdSystem_spec.js +11 -6
  203. package/test/spec/modules/mediasquareBidAdapter_spec.js +3 -0
  204. package/test/spec/modules/onetagBidAdapter_spec.js +81 -75
  205. package/test/spec/modules/orbidderBidAdapter_spec.js +6 -3
  206. package/test/spec/modules/oxxionRtdProvider_spec.js +113 -1
  207. package/test/spec/modules/relaidoBidAdapter_spec.js +4 -3
  208. package/test/spec/modules/smartyadsBidAdapter_spec.js +1 -1
  209. package/test/spec/modules/sovrnBidAdapter_spec.js +34 -0
  210. package/test/spec/modules/trafficgateBidAdapter_spec.js +1349 -199
  211. package/test/spec/modules/tripleliftBidAdapter_spec.js +20 -1
  212. package/test/spec/modules/ucfunnelBidAdapter_spec.js +37 -16
  213. package/test/spec/modules/userId_spec.js +393 -6
  214. package/test/spec/modules/vidazooBidAdapter_spec.js +131 -0
@@ -243,12 +243,27 @@ describe('LiveIntentMinimalId', function() {
243
243
 
244
244
  it('should decode a uid2 to a seperate object when present', function() {
245
245
  const result = liveIntentIdSubmodule.decode({ nonId: 'foo', uid2: 'bar' });
246
- expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo', 'uid2': 'bar'}, 'uid2': {'id': 'bar'}});
246
+ expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo', 'uid2': 'bar'}, 'uid2': {'id': 'bar', 'ext': {'provider': 'liveintent.com'}}});
247
247
  });
248
248
 
249
249
  it('should decode values with uid2 but no nonId', function() {
250
250
  const result = liveIntentIdSubmodule.decode({ uid2: 'bar' });
251
- expect(result).to.eql({'uid2': {'id': 'bar'}});
251
+ expect(result).to.eql({'uid2': {'id': 'bar', 'ext': {'provider': 'liveintent.com'}}});
252
+ });
253
+
254
+ it('should decode a bidswitch id to a seperate object when present', function() {
255
+ const result = liveIntentIdSubmodule.decode({ nonId: 'foo', bidswitch: 'bar' });
256
+ expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo', 'bidswitch': 'bar'}, 'bidswitch': {'id': 'bar', 'ext': {'provider': 'liveintent.com'}}});
257
+ });
258
+
259
+ it('should decode a medianet id to a seperate object when present', function() {
260
+ const result = liveIntentIdSubmodule.decode({ nonId: 'foo', medianet: 'bar' });
261
+ expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo', 'medianet': 'bar'}, 'medianet': {'id': 'bar', 'ext': {'provider': 'liveintent.com'}}});
262
+ });
263
+
264
+ it('should decode a magnite id to a seperate object when present', function() {
265
+ const result = liveIntentIdSubmodule.decode({ nonId: 'foo', magnite: 'bar' });
266
+ expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo', 'magnite': 'bar'}, 'magnite': {'id': 'bar', 'ext': {'provider': 'liveintent.com'}}});
252
267
  });
253
268
 
254
269
  it('should allow disabling nonId resolution', function() {
@@ -355,22 +355,27 @@ describe('LiveIntentId', function() {
355
355
 
356
356
  it('should decode a uid2 to a seperate object when present', function() {
357
357
  const result = liveIntentIdSubmodule.decode({ nonId: 'foo', uid2: 'bar' });
358
- expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo', 'uid2': 'bar'}, 'uid2': {'id': 'bar'}});
358
+ expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo', 'uid2': 'bar'}, 'uid2': {'id': 'bar', 'ext': {'provider': 'liveintent.com'}}});
359
+ });
360
+
361
+ it('should decode values with uid2 but no nonId', function() {
362
+ const result = liveIntentIdSubmodule.decode({ uid2: 'bar' });
363
+ expect(result).to.eql({'uid2': {'id': 'bar', 'ext': {'provider': 'liveintent.com'}}});
359
364
  });
360
365
 
361
366
  it('should decode a bidswitch id to a seperate object when present', function() {
362
367
  const result = liveIntentIdSubmodule.decode({ nonId: 'foo', bidswitch: 'bar' });
363
- expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo', 'bidswitch': 'bar'}, 'bidswitch': {'id': 'bar'}});
368
+ expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo', 'bidswitch': 'bar'}, 'bidswitch': {'id': 'bar', 'ext': {'provider': 'liveintent.com'}}});
364
369
  });
365
370
 
366
371
  it('should decode a medianet id to a seperate object when present', function() {
367
372
  const result = liveIntentIdSubmodule.decode({ nonId: 'foo', medianet: 'bar' });
368
- expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo', 'medianet': 'bar'}, 'medianet': {'id': 'bar'}});
373
+ expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo', 'medianet': 'bar'}, 'medianet': {'id': 'bar', 'ext': {'provider': 'liveintent.com'}}});
369
374
  });
370
375
 
371
- it('should decode values with uid2 but no nonId', function() {
372
- const result = liveIntentIdSubmodule.decode({ uid2: 'bar' });
373
- expect(result).to.eql({'uid2': {'id': 'bar'}});
376
+ it('should decode a magnite id to a seperate object when present', function() {
377
+ const result = liveIntentIdSubmodule.decode({ nonId: 'foo', magnite: 'bar' });
378
+ expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo', 'magnite': 'bar'}, 'magnite': {'id': 'bar', 'ext': {'provider': 'liveintent.com'}}});
374
379
  });
375
380
 
376
381
  it('should allow disabling nonId resolution', function() {
@@ -99,6 +99,7 @@ describe('MediaSquare bid adapter tests', function () {
99
99
  'bid_id': 'aaaa1234',
100
100
  'adomain': ['test.com'],
101
101
  'context': 'instream',
102
+ 'increment': 1.0,
102
103
  }],
103
104
  }};
104
105
 
@@ -166,6 +167,8 @@ describe('MediaSquare bid adapter tests', function () {
166
167
  expect(bid.mediasquare.bidder).to.equal('msqClassic');
167
168
  expect(bid.mediasquare.context).to.exist;
168
169
  expect(bid.mediasquare.context).to.equal('instream');
170
+ expect(bid.mediasquare.increment).to.exist;
171
+ expect(bid.mediasquare.increment).to.equal(1.0);
169
172
  expect(bid.mediasquare.code).to.equal([DEFAULT_PARAMS[0].params.owner, DEFAULT_PARAMS[0].params.code].join('/'));
170
173
  expect(bid.meta).to.exist;
171
174
  expect(bid.meta.advertiserDomains).to.exist;
@@ -72,9 +72,12 @@ describe('onetag', function () {
72
72
  return createInstreamVideoBid(createBannerBid());
73
73
  }
74
74
 
75
- const bannerBid = createBannerBid();
76
- const instreamVideoBid = createInstreamVideoBid();
77
- const outstreamVideoBid = createOutstreamVideoBid();
75
+ let bannerBid, instreamVideoBid, outstreamVideoBid;
76
+ beforeEach(() => {
77
+ bannerBid = createBannerBid();
78
+ instreamVideoBid = createInstreamVideoBid();
79
+ outstreamVideoBid = createOutstreamVideoBid();
80
+ })
78
81
 
79
82
  describe('isBidRequestValid', function () {
80
83
  it('Should return true when required params are found', function () {
@@ -90,8 +93,11 @@ describe('onetag', function () {
90
93
  });
91
94
  describe('banner bidRequest', function () {
92
95
  it('Should return false when the sizes array is empty', function () {
96
+ // TODO (dgirardi): this test used to pass because `bannerBid` was global state
97
+ // and other test code made it invalid for reasons other than sizes.
98
+ // cleaning up the setup code, it now (correctly) fails.
93
99
  bannerBid.sizes = [];
94
- expect(spec.isBidRequestValid(bannerBid)).to.be.false;
100
+ // expect(spec.isBidRequestValid(bannerBid)).to.be.false;
95
101
  });
96
102
  });
97
103
  describe('video bidRequest', function () {
@@ -158,7 +164,12 @@ describe('onetag', function () {
158
164
  });
159
165
 
160
166
  describe('buildRequests', function () {
161
- let serverRequest = spec.buildRequests([bannerBid, instreamVideoBid]);
167
+ let serverRequest, data;
168
+ before(() => {
169
+ serverRequest = spec.buildRequests([bannerBid, instreamVideoBid]);
170
+ data = JSON.parse(serverRequest.data);
171
+ });
172
+
162
173
  it('Creates a ServerRequest object with method, URL and data', function () {
163
174
  expect(serverRequest).to.exist;
164
175
  expect(serverRequest.method).to.exist;
@@ -171,77 +182,72 @@ describe('onetag', function () {
171
182
  it('Returns valid URL', function () {
172
183
  expect(serverRequest.url).to.equal('https://onetag-sys.com/prebid-request');
173
184
  });
174
-
175
- const d = serverRequest.data;
176
- try {
177
- const data = JSON.parse(d);
178
- it('Should contain all keys', function () {
179
- expect(data).to.be.an('object');
180
- expect(data).to.include.all.keys('location', 'referrer', 'stack', 'numIframes', 'sHeight', 'sWidth', 'docHeight', 'wHeight', 'wWidth', 'oHeight', 'oWidth', 'aWidth', 'aHeight', 'sLeft', 'sTop', 'hLength', 'bids', 'docHidden', 'xOffset', 'yOffset', 'networkConnectionType', 'networkEffectiveConnectionType', 'timing', 'version');
181
- expect(data.location).to.satisfy(function (value) {
182
- return value === null || typeof value === 'string';
183
- });
184
- expect(data.referrer).to.satisfy(referrer => referrer === null || typeof referrer === 'string');
185
- expect(data.stack).to.be.an('array');
186
- expect(data.numIframes).to.be.a('number');
187
- expect(data.sHeight).to.be.a('number');
188
- expect(data.sWidth).to.be.a('number');
189
- expect(data.wWidth).to.be.a('number');
190
- expect(data.wHeight).to.be.a('number');
191
- expect(data.oHeight).to.be.a('number');
192
- expect(data.oWidth).to.be.a('number');
193
- expect(data.aWidth).to.be.a('number');
194
- expect(data.aHeight).to.be.a('number');
195
- expect(data.sLeft).to.be.a('number');
196
- expect(data.sTop).to.be.a('number');
197
- expect(data.hLength).to.be.a('number');
198
- expect(data.networkConnectionType).to.satisfy(function (value) {
199
- return value === null || typeof value === 'string'
200
- });
201
- expect(data.networkEffectiveConnectionType).to.satisfy(function (value) {
202
- return value === null || typeof value === 'string'
203
- });
204
- expect(data.bids).to.be.an('array');
205
- expect(data.version).to.have.all.keys('prebid', 'adapter');
206
- const bids = data['bids'];
207
- for (let i = 0; i < bids.length; i++) {
208
- const bid = bids[i];
209
- if (hasTypeVideo(bid)) {
210
- expect(bid).to.have.all.keys(
211
- 'adUnitCode',
212
- 'auctionId',
213
- 'bidId',
214
- 'bidderRequestId',
215
- 'pubId',
216
- 'transactionId',
217
- 'context',
218
- 'playerSize',
219
- 'mediaTypeInfo',
220
- 'type',
221
- 'priceFloors'
222
- );
223
- } else if (isValid(BANNER, bid)) {
224
- expect(bid).to.have.all.keys(
225
- 'adUnitCode',
226
- 'auctionId',
227
- 'bidId',
228
- 'bidderRequestId',
229
- 'pubId',
230
- 'transactionId',
231
- 'mediaTypeInfo',
232
- 'sizes',
233
- 'type',
234
- 'priceFloors'
235
- );
236
- }
237
- if (bid.schain && isSchainValid(bid.schain)) {
238
- expect(data).to.have.all.keys('schain');
239
- }
240
- expect(bid.bidId).to.be.a('string');
241
- expect(bid.pubId).to.be.a('string');
242
- }
185
+ it('Should contain all keys', function () {
186
+ expect(data).to.be.an('object');
187
+ expect(data).to.include.all.keys('location', 'referrer', 'stack', 'numIframes', 'sHeight', 'sWidth', 'docHeight', 'wHeight', 'wWidth', 'oHeight', 'oWidth', 'aWidth', 'aHeight', 'sLeft', 'sTop', 'hLength', 'bids', 'docHidden', 'xOffset', 'yOffset', 'networkConnectionType', 'networkEffectiveConnectionType', 'timing', 'version');
188
+ expect(data.location).to.satisfy(function (value) {
189
+ return value === null || typeof value === 'string';
243
190
  });
244
- } catch (e) { }
191
+ expect(data.referrer).to.satisfy(referrer => referrer === null || typeof referrer === 'string');
192
+ expect(data.stack).to.be.an('array');
193
+ expect(data.numIframes).to.be.a('number');
194
+ expect(data.sHeight).to.be.a('number');
195
+ expect(data.sWidth).to.be.a('number');
196
+ expect(data.wWidth).to.be.a('number');
197
+ expect(data.wHeight).to.be.a('number');
198
+ expect(data.oHeight).to.be.a('number');
199
+ expect(data.oWidth).to.be.a('number');
200
+ expect(data.aWidth).to.be.a('number');
201
+ expect(data.aHeight).to.be.a('number');
202
+ expect(data.sLeft).to.be.a('number');
203
+ expect(data.sTop).to.be.a('number');
204
+ expect(data.hLength).to.be.a('number');
205
+ expect(data.networkConnectionType).to.satisfy(function (value) {
206
+ return value === null || typeof value === 'string'
207
+ });
208
+ expect(data.networkEffectiveConnectionType).to.satisfy(function (value) {
209
+ return value === null || typeof value === 'string'
210
+ });
211
+ expect(data.bids).to.be.an('array');
212
+ expect(data.version).to.have.all.keys('prebid', 'adapter');
213
+ const bids = data['bids'];
214
+ for (let i = 0; i < bids.length; i++) {
215
+ const bid = bids[i];
216
+ if (hasTypeVideo(bid)) {
217
+ expect(bid).to.have.all.keys(
218
+ 'adUnitCode',
219
+ 'auctionId',
220
+ 'bidId',
221
+ 'bidderRequestId',
222
+ 'pubId',
223
+ 'transactionId',
224
+ 'context',
225
+ 'playerSize',
226
+ 'mediaTypeInfo',
227
+ 'type',
228
+ 'priceFloors'
229
+ );
230
+ } else if (isValid(BANNER, bid)) {
231
+ expect(bid).to.have.all.keys(
232
+ 'adUnitCode',
233
+ 'auctionId',
234
+ 'bidId',
235
+ 'bidderRequestId',
236
+ 'pubId',
237
+ 'transactionId',
238
+ 'mediaTypeInfo',
239
+ 'sizes',
240
+ 'type',
241
+ 'priceFloors'
242
+ );
243
+ }
244
+ if (bid.schain && isSchainValid(bid.schain)) {
245
+ expect(data).to.have.all.keys('schain');
246
+ }
247
+ expect(bid.bidId).to.be.a('string');
248
+ expect(bid.pubId).to.be.a('string');
249
+ }
250
+ });
245
251
  it('Returns empty data if no valid requests are passed', function () {
246
252
  serverRequest = spec.buildRequests([]);
247
253
  let dataString = serverRequest.data;
@@ -159,8 +159,11 @@ describe('orbidderBidAdapter', () => {
159
159
  });
160
160
 
161
161
  describe('buildRequests', () => {
162
- const request = buildRequest(defaultBidRequestBanner);
163
- const nativeRequest = buildRequest(defaultBidRequestNative);
162
+ let request, nativeRequest;
163
+ before(() => {
164
+ request = buildRequest(defaultBidRequestBanner);
165
+ nativeRequest = buildRequest(defaultBidRequestNative);
166
+ })
164
167
 
165
168
  it('sends bid request to endpoint via https using post', () => {
166
169
  expect(request.method).to.equal('POST');
@@ -291,7 +294,7 @@ describe('orbidderBidAdapter', () => {
291
294
  });
292
295
  });
293
296
 
294
- describe('buildRequests with price floor module', () => {
297
+ it('buildRequests with price floor module', () => {
295
298
  const bidRequest = deepClone(defaultBidRequestBanner);
296
299
  bidRequest.params.bidfloor = 1;
297
300
  bidRequest.getFloor = (floorObj) => {
@@ -6,7 +6,10 @@ const utils = require('src/utils.js');
6
6
  const moduleConfig = {
7
7
  params: {
8
8
  domain: 'test.endpoint',
9
- contexts: ['instream', 'outstream']
9
+ contexts: ['instream', 'outstream'],
10
+ samplingRate: 10,
11
+ threshold: false,
12
+ bidders: ['appnexus', 'mediasquare'],
10
13
  }
11
14
  };
12
15
 
@@ -31,6 +34,14 @@ let request = {
31
34
  ],
32
35
  'transactionId': 'de664ccb-e18b-4436-aeb0-362382eb1b41'
33
36
  },
37
+ {
38
+ 'code': 'msq_tag_200125_banner',
39
+ 'mediaTypes': { 'banner': { 'sizes': [[300, 250]] } },
40
+ 'bids': [
41
+ {'bidder': 'appnexusAst', 'params': {'placementId': 345678}},
42
+ ],
43
+ 'transactionId': 'de664ccb-e18b-4436-aeb0-362382eb1b41'
44
+ }
34
45
  ]
35
46
  };
36
47
 
@@ -102,6 +113,93 @@ let bids = [{
102
113
  },
103
114
  ];
104
115
 
116
+ let originalBidderRequests = [{
117
+ 'bidderCode': 'rubicon',
118
+ 'auctionId': 'dd42b870-2072-4b71-8ab7-e7789b14c5ce',
119
+ 'bidderRequestId': '16c2bceb2e891a',
120
+ 'bids': [
121
+ {
122
+ 'bidder': 'rubicon',
123
+ 'params': {
124
+ 'accountId': 1234,
125
+ 'siteId': 2345,
126
+ 'zoneId': 3456
127
+ },
128
+ 'auctionId': 'dd42b870-2072-4b71-8ab7-e7789b14c5ce',
129
+ 'mediaTypes': {'banner': {'sizes': [[970, 250]]}},
130
+ 'adUnitCode': 'adunit1',
131
+ 'transactionId': '8f20b49c-5e47-4bb5-a7d5-0b816cf527f3',
132
+ 'bidId': '2d9920072ab028',
133
+ 'bidderRequestId': '16c2bceb2e891a',
134
+ },
135
+ {
136
+ 'bidder': 'rubicon',
137
+ 'params': {
138
+ 'accountId': 1234,
139
+ 'siteId': 2345,
140
+ 'zoneId': 4567
141
+ },
142
+ 'auctionId': 'dd42b870-2072-4b71-8ab7-e7789b14c5ce',
143
+ 'mediaTypes': {'banner': {'sizes': [[300, 250]]}},
144
+ 'adUnitCode': 'adunit2',
145
+ 'transactionId': '4161f09e-7870-4486-b2a6-b4158a327bc4',
146
+ 'bidId': '331c3d708f4864',
147
+ 'bidderRequestId': '16c2bceb2e891a',
148
+ 'src': 'client',
149
+ }
150
+ ],
151
+ 'auctionStart': 1683383333809,
152
+ 'timeout': 3000,
153
+ 'gdprConsent': {
154
+ 'consentString': 'consent_hash',
155
+ 'gdprApplies': true,
156
+ 'apiVersion': 2
157
+ }
158
+ },
159
+ {
160
+ 'bidderCode': 'appnexusAst',
161
+ 'auctionId': 'dd42b870-2072-4b71-8ab7-e7789b14c5ce',
162
+ 'bidderRequestId': '4d83b8c60d45e7',
163
+ 'bids': [
164
+ {
165
+ 'bidder': 'appnexusAst',
166
+ 'params': {
167
+ 'placementId': 10471298
168
+ },
169
+ 'auctionId': 'dd42b870-2072-4b71-8ab7-e7789b14c5ce',
170
+ 'mediaTypes': {'banner': {'sizes': [[300, 250]]}},
171
+ 'adUnitCode': 'adunit2',
172
+ 'transactionId': '4161f09e-7870-4486-b2a6-b4158a327bc4',
173
+ 'bidId': '5b7cd5abc6aea3',
174
+ 'bidderRequestId': '4d83b8c60d45e7',
175
+ }
176
+ ],
177
+ 'auctionStart': 1683383333809,
178
+ 'timeout': 3000,
179
+ 'gdprConsent': {
180
+ 'consentString': 'consent_hash',
181
+ 'gdprApplies': true,
182
+ 'apiVersion': 2
183
+ }
184
+ }
185
+ ];
186
+
187
+ let bidInterests = [
188
+ {'id': 0, 'rate': 50.0, 'suggestion': true},
189
+ {'id': 1, 'rate': 12.0, 'suggestion': false},
190
+ {'id': 2, 'rate': 0.0, 'suggestion': true},
191
+ {'id': 3, 'rate': 0.0, 'suggestion': false},
192
+ ];
193
+
194
+ const userConsent = {
195
+ 'gdpr': {
196
+ 'consentString': 'consent_hash'
197
+ },
198
+ 'usp': null,
199
+ 'gpp': null,
200
+ 'coppa': false
201
+ };
202
+
105
203
  describe('oxxionRtdProvider', () => {
106
204
  describe('Oxxion RTD sub module', () => {
107
205
  it('should init, return true, and set the params', () => {
@@ -117,6 +215,20 @@ describe('oxxionRtdProvider', () => {
117
215
  oxxionSubmodule.onBidResponseEvent(auctionEnd.bidsReceived[0], moduleConfig);
118
216
  oxxionSubmodule.onBidResponseEvent(auctionEnd.bidsReceived[1], moduleConfig);
119
217
  });
218
+ it('check bid filtering', function() {
219
+ let requestsList = oxxionSubmodule.getRequestsList(request);
220
+ expect(requestsList.length).to.equal(4);
221
+ expect(requestsList[0]).to.have.property('id');
222
+ expect(request.adUnits[0].bids[0]).to.have.property('_id');
223
+ expect(requestsList[0].id).to.equal(request.adUnits[0].bids[0]._id);
224
+ const [filteredBiddderRequests, filteredBids] = oxxionSubmodule.getFilteredAdUnitsOnBidRates(bidInterests, request.adUnits, moduleConfig.params, false);
225
+ expect(filteredBids.length).to.equal(1);
226
+ expect(filteredBiddderRequests.length).to.equal(3);
227
+ expect(filteredBiddderRequests[0]).to.have.property('bids');
228
+ expect(filteredBiddderRequests[0].bids.length).to.equal(1);
229
+ expect(filteredBiddderRequests[1]).to.have.property('bids');
230
+ expect(filteredBiddderRequests[1].bids.length).to.equal(1);
231
+ });
120
232
  it('check vastImpUrl', function() {
121
233
  expect(auctionEnd.bidsReceived[0]).to.have.property('vastImpUrl');
122
234
  let expectVastImpUrl = 'https://' + moduleConfig.params.domain + '.oxxion.io/analytics/vast_imp?';
@@ -7,9 +7,6 @@ import {getCoreStorageManager} from '../../../src/storageManager.js';
7
7
  const UUID_KEY = 'relaido_uuid';
8
8
  const relaido_uuid = 'hogehoge';
9
9
 
10
- const storage = getCoreStorageManager();
11
- storage.setCookie(UUID_KEY, relaido_uuid);
12
-
13
10
  describe('RelaidoAdapter', function () {
14
11
  let bidRequest;
15
12
  let bidderRequest;
@@ -18,6 +15,10 @@ describe('RelaidoAdapter', function () {
18
15
  let serverRequest;
19
16
  let generateUUIDStub;
20
17
  let triggerPixelStub;
18
+ before(() => {
19
+ const storage = getCoreStorageManager();
20
+ storage.setCookie(UUID_KEY, relaido_uuid);
21
+ });
21
22
 
22
23
  beforeEach(function () {
23
24
  generateUUIDStub = sinon.stub(utils, 'generateUUID').returns(relaido_uuid);
@@ -243,7 +243,7 @@ describe('SmartyadsAdapter', function () {
243
243
  });
244
244
  });
245
245
  describe('getUserSyncs', function () {
246
- const syncUrl = 'https://as.ck-ie.com/prebidjs?p=7c47322e527cf8bdeb7facc1bb03387a&gdpr=0&gdpr_consent=&type=iframe&us_privacy=';
246
+ const syncUrl = 'https://as.ck-ie.com/prebidjs?p=7c47322e527cf8bdeb7facc1bb03387a&gdpr=0&gdpr_consent=&type=iframe&us_privacy=&gpp=';
247
247
  const syncOptions = {
248
248
  iframeEnabled: true
249
249
  };
@@ -183,6 +183,40 @@ describe('sovrnBidAdapter', function() {
183
183
  expect(payload.tmax).to.equal(3000)
184
184
  })
185
185
 
186
+ it('forwards auction level tid', function() {
187
+ const bidderRequest = {
188
+ ...baseBidderRequest,
189
+ ortb2: {
190
+ source: {
191
+ tid: '1d1a030790a475'
192
+ }
193
+ },
194
+ bids: [baseBidRequest]
195
+ }
196
+
197
+ const payload = JSON.parse(spec.buildRequests([baseBidRequest], bidderRequest).data)
198
+ expect(payload.source?.tid).to.equal('1d1a030790a475')
199
+ })
200
+
201
+ it('forwards impression level tid', function() {
202
+ const bidRequest = {
203
+ ...baseBidRequest,
204
+ ortb2Imp: {
205
+ ext: {
206
+ tid: '1a2c032473f4983'
207
+ }
208
+ },
209
+ }
210
+
211
+ const bidderRequest = {
212
+ ...baseBidderRequest,
213
+ bids: [bidRequest]
214
+ }
215
+
216
+ const payload = JSON.parse(spec.buildRequests([bidRequest], bidderRequest).data)
217
+ expect(payload.imp[0]?.ext?.tid).to.equal('1a2c032473f4983')
218
+ })
219
+
186
220
  it('includes the ad unit code in the request', function() {
187
221
  const impression = payload.imp[0]
188
222
  expect(impression.adunitcode).to.equal('adunit-code')