prebid.js 8.1.0 → 8.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (183) 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/adtrgtmeBidAdapter.js +1 -1
  11. package/dist/adxcgBidAdapter.js +1 -1
  12. package/dist/adyoulikeBidAdapter.js +1 -1
  13. package/dist/ajaBidAdapter.js +1 -1
  14. package/dist/amxBidAdapter.js +1 -1
  15. package/dist/amxIdSystem.js +1 -1
  16. package/dist/appierAnalyticsAdapter.js +1 -1
  17. package/dist/appnexusBidAdapter.js +1 -1
  18. package/dist/asoBidAdapter.js +1 -1
  19. package/dist/axonixBidAdapter.js +1 -1
  20. package/dist/bidglassBidAdapter.js +1 -1
  21. package/dist/big-richmediaBidAdapter.js +1 -1
  22. package/dist/bridBidAdapter.js +1 -0
  23. package/dist/bridgewellBidAdapter.js +1 -1
  24. package/dist/brightMountainMediaBidAdapter.js +1 -1
  25. package/dist/carodaBidAdapter.js +1 -1
  26. package/dist/categoryTranslation.js +1 -1
  27. package/dist/chtnwBidAdapter.js +1 -1
  28. package/dist/cmp.js +1 -0
  29. package/dist/concertBidAdapter.js +1 -1
  30. package/dist/connectadBidAdapter.js +1 -1
  31. package/dist/consentManagement.js +1 -1
  32. package/dist/consentManagementGpp.js +1 -1
  33. package/dist/consentManagementUsp.js +1 -1
  34. package/dist/consumableBidAdapter.js +1 -1
  35. package/dist/conversantAnalyticsAdapter.js +1 -1
  36. package/dist/conversantBidAdapter.js +1 -1
  37. package/dist/craftBidAdapter.js +1 -1
  38. package/dist/criteoBidAdapter.js +1 -1
  39. package/dist/cwireBidAdapter.js +1 -1
  40. package/dist/dependencies.json +12 -0
  41. package/dist/dspxBidAdapter.js +1 -1
  42. package/dist/eplanningBidAdapter.js +1 -1
  43. package/dist/euidIdSystem.js +1 -1
  44. package/dist/feedadBidAdapter.js +1 -1
  45. package/dist/finativeBidAdapter.js +1 -1
  46. package/dist/freewheel-sspBidAdapter.js +1 -1
  47. package/dist/gmosspBidAdapter.js +1 -1
  48. package/dist/goldbachBidAdapter.js +1 -1
  49. package/dist/gppControl_usnat.js +1 -0
  50. package/dist/greenbidsAnalyticsAdapter.js +1 -1
  51. package/dist/greenbidsRtdProvider.js +1 -1
  52. package/dist/gridBidAdapter.js +1 -1
  53. package/dist/gumgumBidAdapter.js +1 -1
  54. package/dist/h12mediaBidAdapter.js +1 -1
  55. package/dist/hypelabBidAdapter.js +1 -1
  56. package/dist/id5IdSystem.js +1 -1
  57. package/dist/imdsBidAdapter.js +1 -1
  58. package/dist/improvedigitalBidAdapter.js +1 -1
  59. package/dist/insticatorBidAdapter.js +1 -1
  60. package/dist/intentIqIdSystem.js +1 -1
  61. package/dist/ixBidAdapter.js +1 -1
  62. package/dist/justpremiumBidAdapter.js +1 -1
  63. package/dist/kargoBidAdapter.js +1 -1
  64. package/dist/konduitAnalyticsAdapter.js +1 -1
  65. package/dist/kueezBidAdapter.js +1 -1
  66. package/dist/kueezRtbBidAdapter.js +1 -1
  67. package/dist/kulturemediaBidAdapter.js +1 -1
  68. package/dist/lassoBidAdapter.js +1 -1
  69. package/dist/lifestreetBidAdapter.js +1 -1
  70. package/dist/liveIntentIdSystem.js +1 -1
  71. package/dist/logicadBidAdapter.js +1 -1
  72. package/dist/loglyliftBidAdapter.js +1 -1
  73. package/dist/magniteAnalyticsAdapter.js +1 -1
  74. package/dist/malltvAnalyticsAdapter.js +1 -1
  75. package/dist/marsmediaBidAdapter.js +1 -1
  76. package/dist/mediafuseBidAdapter.js +1 -1
  77. package/dist/mediasquareBidAdapter.js +1 -1
  78. package/dist/mgidBidAdapter.js +1 -1
  79. package/dist/minutemediaBidAdapter.js +1 -1
  80. package/dist/minutemediaplusBidAdapter.js +1 -1
  81. package/dist/mspa.js +1 -0
  82. package/dist/nexx360BidAdapter.js +1 -1
  83. package/dist/not-for-prod/prebid.js +136 -132
  84. package/dist/oguryBidAdapter.js +1 -1
  85. package/dist/onetagBidAdapter.js +1 -1
  86. package/dist/ooloAnalyticsAdapter.js +1 -1
  87. package/dist/optidigitalBidAdapter.js +1 -1
  88. package/dist/outbrainBidAdapter.js +1 -1
  89. package/dist/oxxionRtdProvider.js +1 -1
  90. package/dist/parrableIdSystem.js +1 -1
  91. package/dist/pixfutureBidAdapter.js +1 -1
  92. package/dist/prebid-core.js +1 -1
  93. package/dist/publinkIdSystem.js +1 -1
  94. package/dist/pubmaticBidAdapter.js +1 -1
  95. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  96. package/dist/pxyzBidAdapter.js +1 -1
  97. package/dist/quantcastBidAdapter.js +1 -1
  98. package/dist/readpeakBidAdapter.js +1 -1
  99. package/dist/relaidoBidAdapter.js +1 -1
  100. package/dist/retailspotBidAdapter.js +1 -1
  101. package/dist/rhythmoneBidAdapter.js +1 -1
  102. package/dist/riseBidAdapter.js +1 -1
  103. package/dist/rubiconBidAdapter.js +1 -1
  104. package/dist/seedingAllianceBidAdapter.js +1 -1
  105. package/dist/seedtagBidAdapter.js +1 -1
  106. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  107. package/dist/sharethroughBidAdapter.js +1 -1
  108. package/dist/shinezBidAdapter.js +1 -1
  109. package/dist/smaatoBidAdapter.js +1 -1
  110. package/dist/smartadserverBidAdapter.js +1 -1
  111. package/dist/smartxBidAdapter.js +1 -1
  112. package/dist/smilewantedBidAdapter.js +1 -1
  113. package/dist/sonobiBidAdapter.js +1 -1
  114. package/dist/sovrnAnalyticsAdapter.js +1 -1
  115. package/dist/sovrnBidAdapter.js +1 -1
  116. package/dist/sspBCBidAdapter.js +1 -1
  117. package/dist/stvBidAdapter.js +1 -1
  118. package/dist/sublimeBidAdapter.js +1 -1
  119. package/dist/targetVideoBidAdapter.js +1 -1
  120. package/dist/teadsBidAdapter.js +1 -1
  121. package/dist/trionBidAdapter.js +1 -1
  122. package/dist/tripleliftBidAdapter.js +1 -1
  123. package/dist/ttdBidAdapter.js +1 -1
  124. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  125. package/dist/uid2IdSystem.js +1 -1
  126. package/dist/underdogmediaBidAdapter.js +1 -1
  127. package/dist/undertoneBidAdapter.js +1 -1
  128. package/dist/userId.js +1 -1
  129. package/dist/vidazooBidAdapter.js +1 -1
  130. package/dist/videobyteBidAdapter.js +1 -1
  131. package/dist/visxBidAdapter.js +1 -1
  132. package/dist/vuukleBidAdapter.js +1 -1
  133. package/dist/widespaceBidAdapter.js +1 -1
  134. package/dist/winrBidAdapter.js +1 -1
  135. package/dist/yahoosspBidAdapter.js +1 -1
  136. package/dist/yieldmoBidAdapter.js +1 -1
  137. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  138. package/libraries/cmp/cmpClient.js +139 -0
  139. package/libraries/mspa/activityControls.js +91 -0
  140. package/modules/admanBidAdapter.js +5 -0
  141. package/modules/bridBidAdapter.js +223 -0
  142. package/modules/categoryTranslation.js +3 -2
  143. package/modules/consentManagement.js +12 -86
  144. package/modules/consentManagementGpp.js +47 -126
  145. package/modules/consentManagementUsp.js +19 -97
  146. package/modules/gppControl_usnat.js +11 -0
  147. package/modules/intentIqIdSystem.js +6 -5
  148. package/modules/liveIntentIdSystem.js +8 -3
  149. package/modules/mediasquareBidAdapter.js +19 -23
  150. package/modules/oxxionRtdProvider.js +124 -11
  151. package/modules/oxxionRtdProvider.md +19 -4
  152. package/modules/tripleliftBidAdapter.js +21 -1
  153. package/modules/userId/eids.js +29 -0
  154. package/modules/userId/eids.md +19 -2
  155. package/modules/userId/index.js +78 -29
  156. package/modules/userId/userId.md +3 -0
  157. package/package.json +1 -1
  158. package/src/activities/params.js +4 -1
  159. package/test/spec/libraries/cmp/cmpClient_spec.js +233 -0
  160. package/test/spec/libraries/mspa/activityControls_spec.js +315 -0
  161. package/test/spec/modules/admanBidAdapter_spec.js +8 -2
  162. package/test/spec/modules/adqueryBidAdapter_spec.js +5 -1
  163. package/test/spec/modules/bridBidAdapter_spec.js +129 -0
  164. package/test/spec/modules/byDataAnalyticsAdapter_spec.js +9 -7
  165. package/test/spec/modules/chtnwBidAdapter_spec.js +4 -1
  166. package/test/spec/modules/consentManagementGpp_spec.js +84 -7
  167. package/test/spec/modules/consentManagement_spec.js +8 -18
  168. package/test/spec/modules/datablocksBidAdapter_spec.js +7 -3
  169. package/test/spec/modules/eids_spec.js +87 -0
  170. package/test/spec/modules/insticatorBidAdapter_spec.js +6 -2
  171. package/test/spec/modules/intentIqIdSystem_spec.js +36 -2
  172. package/test/spec/modules/ixBidAdapter_spec.js +40 -12
  173. package/test/spec/modules/lassoBidAdapter_spec.js +6 -4
  174. package/test/spec/modules/liveIntentIdMinimalSystem_spec.js +17 -2
  175. package/test/spec/modules/liveIntentIdSystem_spec.js +11 -6
  176. package/test/spec/modules/mediasquareBidAdapter_spec.js +3 -0
  177. package/test/spec/modules/onetagBidAdapter_spec.js +81 -75
  178. package/test/spec/modules/orbidderBidAdapter_spec.js +6 -3
  179. package/test/spec/modules/oxxionRtdProvider_spec.js +113 -1
  180. package/test/spec/modules/relaidoBidAdapter_spec.js +4 -3
  181. package/test/spec/modules/tripleliftBidAdapter_spec.js +20 -1
  182. package/test/spec/modules/ucfunnelBidAdapter_spec.js +37 -16
  183. package/test/spec/modules/userId_spec.js +393 -6
@@ -79,10 +79,12 @@ describe('lassoBidAdapter', function () {
79
79
  });
80
80
 
81
81
  describe('buildRequests', function () {
82
- const validBidRequests = spec.buildRequests([bid], bidderRequest);
83
- expect(validBidRequests).to.be.an('array').that.is.not.empty;
84
-
85
- const bidRequest = validBidRequests[0];
82
+ let validBidRequests, bidRequest;
83
+ before(() => {
84
+ validBidRequests = spec.buildRequests([bid], bidderRequest);
85
+ expect(validBidRequests).to.be.an('array').that.is.not.empty;
86
+ bidRequest = validBidRequests[0];
87
+ })
86
88
 
87
89
  it('Returns valid bidRequest', function () {
88
90
  expect(bidRequest).to.exist;
@@ -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);
@@ -8,6 +8,7 @@ import * as utils from 'src/utils.js';
8
8
 
9
9
  const ENDPOINT = 'https://tlx.3lift.com/header/auction?';
10
10
  const GDPR_CONSENT_STR = 'BOONm0NOONm0NABABAENAa-AAAARh7______b9_3__7_9uz_Kv_K7Vf7nnG072lPVA9LTOQ6gEaY';
11
+ const GPP_CONSENT_STR = 'DBACNYA~CPXxRfAPXxRfAAfKABENB-CgAAAAAAAAAAYgAAAAAAAA~1YNN'
11
12
 
12
13
  describe('triplelift adapter', function () {
13
14
  const adapter = newBidder(tripleliftAdapterSpec);
@@ -1039,6 +1040,12 @@ describe('triplelift adapter', function () {
1039
1040
  const url = request.url;
1040
1041
  expect(url).to.match(/(\?|&)us_privacy=1YYY/);
1041
1042
  });
1043
+ it('should pass fledge signal when Triplelift is eligible for fledge', function() {
1044
+ bidderRequest.fledgeEnabled = true;
1045
+ const request = tripleliftAdapterSpec.buildRequests(bidRequests, bidderRequest);
1046
+ const url = request.url;
1047
+ expect(url).to.match(/(\?|&)fledge=true/);
1048
+ });
1042
1049
  it('should return coppa param when COPPA config is set to true', function() {
1043
1050
  sinon.stub(config, 'getConfig').withArgs('coppa').returns(true);
1044
1051
  const request = tripleliftAdapterSpec.buildRequests(bidRequests, bidderRequest);
@@ -1506,6 +1513,7 @@ describe('triplelift adapter', function () {
1506
1513
  describe('getUserSyncs', function() {
1507
1514
  let expectedIframeSyncUrl = 'https://eb2.3lift.com/sync?gdpr=true&cmp_cs=' + GDPR_CONSENT_STR + '&';
1508
1515
  let expectedImageSyncUrl = 'https://eb2.3lift.com/sync?px=1&src=prebid&gdpr=true&cmp_cs=' + GDPR_CONSENT_STR + '&';
1516
+ let expectedGppSyncUrl = 'https://eb2.3lift.com/sync?gdpr=true&cmp_cs=' + GDPR_CONSENT_STR + '&gpp=' + GPP_CONSENT_STR + '&gpp_sid=2%2C8' + '&';
1509
1517
 
1510
1518
  it('returns undefined when syncing is not enabled', function() {
1511
1519
  expect(tripleliftAdapterSpec.getUserSyncs({})).to.equal(undefined);
@@ -1543,8 +1551,19 @@ describe('triplelift adapter', function () {
1543
1551
  let syncOptions = {
1544
1552
  iframeEnabled: true
1545
1553
  };
1546
- let result = tripleliftAdapterSpec.getUserSyncs(syncOptions, null, null, '1YYY');
1554
+ let result = tripleliftAdapterSpec.getUserSyncs(syncOptions, null, null, '1YYY', null);
1547
1555
  expect(result[0].url).to.match(/(\?|&)us_privacy=1YYY/);
1548
1556
  });
1557
+ it('returns a user sync pixel with GPP signals when available', function() {
1558
+ let syncOptions = {
1559
+ iframeEnabled: true
1560
+ };
1561
+ let gppConsent = {
1562
+ 'applicableSections': [2, 8],
1563
+ 'gppString': 'DBACNYA~CPXxRfAPXxRfAAfKABENB-CgAAAAAAAAAAYgAAAAAAAA~1YNN'
1564
+ }
1565
+ let result = tripleliftAdapterSpec.getUserSyncs(syncOptions, null, null, null, gppConsent);
1566
+ expect(result[0].url).to.equal(expectedGppSyncUrl);
1567
+ });
1549
1568
  });
1550
1569
  });
@@ -1,6 +1,7 @@
1
1
  import { expect } from 'chai';
2
2
  import { spec } from 'modules/ucfunnelBidAdapter.js';
3
3
  import {BANNER, VIDEO, NATIVE} from 'src/mediaTypes.js';
4
+ import {deepClone} from '../../../src/utils.js';
4
5
  const URL = 'https://hb.aralego.com/header';
5
6
  const BIDDER_CODE = 'ucfunnel';
6
7
 
@@ -150,7 +151,10 @@ describe('ucfunnel Adapter', function () {
150
151
  });
151
152
  });
152
153
  describe('build request', function () {
153
- const request = spec.buildRequests([validBannerBidReq], bidderRequest);
154
+ let request;
155
+ before(() => {
156
+ request = spec.buildRequests([validBannerBidReq], bidderRequest);
157
+ })
154
158
  it('should create a POST request for every bid', function () {
155
159
  expect(request[0].method).to.equal('GET');
156
160
  expect(request[0].url).to.equal(spec.ENDPOINT);
@@ -179,15 +183,16 @@ describe('ucfunnel Adapter', function () {
179
183
  it('must parse bid size from a nested array', function () {
180
184
  const width = 640;
181
185
  const height = 480;
182
- validBannerBidReq.sizes = [[ width, height ]];
183
- const requests = spec.buildRequests([ validBannerBidReq ], bidderRequest);
186
+ const bid = deepClone(validBannerBidReq);
187
+ bid.sizes = [[ width, height ]];
188
+ const requests = spec.buildRequests([ bid ], bidderRequest);
184
189
  const data = requests[0].data;
185
190
  expect(data.w).to.equal(width);
186
191
  expect(data.h).to.equal(height);
187
192
  });
188
193
 
189
194
  it('should set bidfloor if configured', function() {
190
- let bid = Object.assign({}, validBannerBidReq);
195
+ let bid = deepClone(validBannerBidReq);
191
196
  bid.getFloor = function() {
192
197
  return {
193
198
  currency: 'USD',
@@ -200,7 +205,7 @@ describe('ucfunnel Adapter', function () {
200
205
  });
201
206
 
202
207
  it('should set bidfloor if configured', function() {
203
- let bid = Object.assign({}, validBannerBidReq);
208
+ let bid = deepClone(validBannerBidReq);
204
209
  bid.params.bidfloor = 2.01;
205
210
  const requests = spec.buildRequests([ bid ], bidderRequest);
206
211
  const data = requests[0].data;
@@ -208,7 +213,7 @@ describe('ucfunnel Adapter', function () {
208
213
  });
209
214
 
210
215
  it('should set bidfloor if configured', function() {
211
- let bid = Object.assign({}, validBannerBidReq);
216
+ let bid = deepClone(validBannerBidReq);
212
217
  bid.getFloor = function() {
213
218
  return {
214
219
  currency: 'USD',
@@ -224,8 +229,12 @@ describe('ucfunnel Adapter', function () {
224
229
 
225
230
  describe('interpretResponse', function () {
226
231
  describe('should support banner', function () {
227
- const request = spec.buildRequests([ validBannerBidReq ], bidderRequest);
228
- const result = spec.interpretResponse({body: validBannerBidRes}, request[0]);
232
+ let request, result;
233
+ before(() => {
234
+ request = spec.buildRequests([ validBannerBidReq ], bidderRequest);
235
+ result = spec.interpretResponse({body: validBannerBidRes}, request[0]);
236
+ });
237
+
229
238
  it('should build bid array for banner', function () {
230
239
  expect(result.length).to.equal(1);
231
240
  });
@@ -243,8 +252,11 @@ describe('ucfunnel Adapter', function () {
243
252
  });
244
253
 
245
254
  describe('handle banner no ad', function () {
246
- const request = spec.buildRequests([ validBannerBidReq ], bidderRequest);
247
- const result = spec.interpretResponse({body: invalidBannerBidRes}, request[0]);
255
+ let request, result;
256
+ before(() => {
257
+ request = spec.buildRequests([ validBannerBidReq ], bidderRequest);
258
+ result = spec.interpretResponse({body: invalidBannerBidRes}, request[0]);
259
+ })
248
260
  it('should build bid array for banner', function () {
249
261
  expect(result.length).to.equal(1);
250
262
  });
@@ -261,8 +273,11 @@ describe('ucfunnel Adapter', function () {
261
273
  });
262
274
 
263
275
  describe('handle banner cpm under bidfloor', function () {
264
- const request = spec.buildRequests([ validBannerBidReq ], bidderRequest);
265
- const result = spec.interpretResponse({body: invalidBannerBidRes}, request[0]);
276
+ let request, result;
277
+ before(() => {
278
+ request = spec.buildRequests([ validBannerBidReq ], bidderRequest);
279
+ result = spec.interpretResponse({body: invalidBannerBidRes}, request[0]);
280
+ })
266
281
  it('should build bid array for banner', function () {
267
282
  expect(result.length).to.equal(1);
268
283
  });
@@ -279,8 +294,11 @@ describe('ucfunnel Adapter', function () {
279
294
  });
280
295
 
281
296
  describe('should support video', function () {
282
- const request = spec.buildRequests([ validVideoBidReq ], bidderRequest);
283
- const result = spec.interpretResponse({body: validVideoBidRes}, request[0]);
297
+ let request, result;
298
+ before(() => {
299
+ request = spec.buildRequests([ validVideoBidReq ], bidderRequest);
300
+ result = spec.interpretResponse({body: validVideoBidRes}, request[0]);
301
+ })
284
302
  it('should build bid array', function () {
285
303
  expect(result.length).to.equal(1);
286
304
  });
@@ -299,8 +317,11 @@ describe('ucfunnel Adapter', function () {
299
317
  });
300
318
 
301
319
  describe('should support native', function () {
302
- const request = spec.buildRequests([ validNativeBidReq ], bidderRequest);
303
- const result = spec.interpretResponse({body: validNativeBidRes}, request[0]);
320
+ let request, result;
321
+ before(() => {
322
+ request = spec.buildRequests([ validNativeBidReq ], bidderRequest);
323
+ result = spec.interpretResponse({body: validNativeBidRes}, request[0]);
324
+ })
304
325
  it('should build bid array', function () {
305
326
  expect(result.length).to.equal(1);
306
327
  });