prebid.js 7.53.0 → 7.54.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 (148) hide show
  1. package/dist/33acrossBidAdapter.js +1 -1
  2. package/dist/33acrossIdSystem.js +1 -1
  3. package/dist/adagioBidAdapter.js +1 -1
  4. package/dist/adbookpspBidAdapter.js +1 -1
  5. package/dist/adgenerationBidAdapter.js +1 -1
  6. package/dist/adhashBidAdapter.js +1 -1
  7. package/dist/adqueryBidAdapter.js +1 -1
  8. package/dist/adrelevantisBidAdapter.js +1 -1
  9. package/dist/adtrgtmeBidAdapter.js +1 -1
  10. package/dist/adxcgBidAdapter.js +1 -1
  11. package/dist/adyoulikeBidAdapter.js +1 -1
  12. package/dist/ajaBidAdapter.js +1 -1
  13. package/dist/amxBidAdapter.js +1 -1
  14. package/dist/amxIdSystem.js +1 -1
  15. package/dist/appierAnalyticsAdapter.js +1 -1
  16. package/dist/appnexusBidAdapter.js +1 -1
  17. package/dist/asoBidAdapter.js +1 -1
  18. package/dist/axonixBidAdapter.js +1 -1
  19. package/dist/bidglassBidAdapter.js +1 -1
  20. package/dist/big-richmediaBidAdapter.js +1 -1
  21. package/dist/bridgewellBidAdapter.js +1 -1
  22. package/dist/brightMountainMediaBidAdapter.js +1 -1
  23. package/dist/carodaBidAdapter.js +1 -1
  24. package/dist/chtnwBidAdapter.js +1 -1
  25. package/dist/concertBidAdapter.js +1 -1
  26. package/dist/connectadBidAdapter.js +1 -1
  27. package/dist/consumableBidAdapter.js +1 -1
  28. package/dist/conversantAnalyticsAdapter.js +1 -1
  29. package/dist/conversantBidAdapter.js +1 -1
  30. package/dist/craftBidAdapter.js +1 -1
  31. package/dist/criteoBidAdapter.js +1 -1
  32. package/dist/cwireBidAdapter.js +1 -1
  33. package/dist/dspxBidAdapter.js +1 -1
  34. package/dist/eplanningBidAdapter.js +1 -1
  35. package/dist/euidIdSystem.js +1 -1
  36. package/dist/feedadBidAdapter.js +1 -1
  37. package/dist/finativeBidAdapter.js +1 -1
  38. package/dist/freewheel-sspBidAdapter.js +1 -1
  39. package/dist/glimpseBidAdapter.js +1 -1
  40. package/dist/gmosspBidAdapter.js +1 -1
  41. package/dist/goldbachBidAdapter.js +1 -1
  42. package/dist/greenbidsAnalyticsAdapter.js +1 -1
  43. package/dist/greenbidsRtdProvider.js +1 -1
  44. package/dist/gridBidAdapter.js +1 -1
  45. package/dist/gumgumBidAdapter.js +1 -1
  46. package/dist/h12mediaBidAdapter.js +1 -1
  47. package/dist/hypelabBidAdapter.js +1 -0
  48. package/dist/id5IdSystem.js +1 -1
  49. package/dist/improvedigitalBidAdapter.js +1 -1
  50. package/dist/inmarBidAdapter.js +1 -1
  51. package/dist/insticatorBidAdapter.js +1 -1
  52. package/dist/ixBidAdapter.js +1 -1
  53. package/dist/justpremiumBidAdapter.js +1 -1
  54. package/dist/kargoBidAdapter.js +1 -1
  55. package/dist/konduitAnalyticsAdapter.js +1 -1
  56. package/dist/kueezBidAdapter.js +1 -1
  57. package/dist/kueezRtbBidAdapter.js +1 -1
  58. package/dist/kulturemediaBidAdapter.js +1 -1
  59. package/dist/lassoBidAdapter.js +1 -1
  60. package/dist/lifestreetBidAdapter.js +1 -1
  61. package/dist/liveyieldAnalyticsAdapter.js +1 -1
  62. package/dist/logicadBidAdapter.js +1 -1
  63. package/dist/loglyliftBidAdapter.js +1 -1
  64. package/dist/magniteAnalyticsAdapter.js +1 -1
  65. package/dist/malltvAnalyticsAdapter.js +1 -1
  66. package/dist/marsmediaBidAdapter.js +1 -1
  67. package/dist/mediafuseBidAdapter.js +1 -1
  68. package/dist/mediasquareBidAdapter.js +1 -1
  69. package/dist/mgidBidAdapter.js +1 -1
  70. package/dist/minutemediaBidAdapter.js +1 -1
  71. package/dist/minutemediaplusBidAdapter.js +1 -1
  72. package/dist/nexx360BidAdapter.js +1 -1
  73. package/dist/not-for-prod/prebid.js +133 -132
  74. package/dist/oguryBidAdapter.js +1 -1
  75. package/dist/onetagBidAdapter.js +1 -1
  76. package/dist/ooloAnalyticsAdapter.js +1 -1
  77. package/dist/optidigitalBidAdapter.js +1 -1
  78. package/dist/outbrainBidAdapter.js +1 -1
  79. package/dist/oxxionRtdProvider.js +1 -1
  80. package/dist/parrableIdSystem.js +1 -1
  81. package/dist/pixfutureBidAdapter.js +1 -1
  82. package/dist/prebid-core.js +1 -1
  83. package/dist/publinkIdSystem.js +1 -1
  84. package/dist/pubmaticAnalyticsAdapter.js +1 -1
  85. package/dist/pubmaticBidAdapter.js +1 -1
  86. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  87. package/dist/pxyzBidAdapter.js +1 -1
  88. package/dist/quantcastBidAdapter.js +1 -1
  89. package/dist/readpeakBidAdapter.js +1 -1
  90. package/dist/relaidoBidAdapter.js +1 -1
  91. package/dist/retailspotBidAdapter.js +1 -1
  92. package/dist/rhythmoneBidAdapter.js +1 -1
  93. package/dist/riseBidAdapter.js +1 -1
  94. package/dist/rubiconAnalyticsAdapter.js +1 -1
  95. package/dist/rubiconBidAdapter.js +1 -1
  96. package/dist/seedingAllianceBidAdapter.js +1 -1
  97. package/dist/seedtagBidAdapter.js +1 -1
  98. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  99. package/dist/sharethroughBidAdapter.js +1 -1
  100. package/dist/shinezBidAdapter.js +1 -1
  101. package/dist/smaatoBidAdapter.js +1 -1
  102. package/dist/smartadserverBidAdapter.js +1 -1
  103. package/dist/smartxBidAdapter.js +1 -1
  104. package/dist/smilewantedBidAdapter.js +1 -1
  105. package/dist/sonobiBidAdapter.js +1 -1
  106. package/dist/sovrnAnalyticsAdapter.js +1 -1
  107. package/dist/sovrnBidAdapter.js +1 -1
  108. package/dist/sspBCBidAdapter.js +1 -1
  109. package/dist/stvBidAdapter.js +1 -1
  110. package/dist/sublimeBidAdapter.js +1 -1
  111. package/dist/synacormediaBidAdapter.js +1 -1
  112. package/dist/targetVideoBidAdapter.js +1 -1
  113. package/dist/teadsBidAdapter.js +1 -1
  114. package/dist/topicsFpdModule.js +1 -1
  115. package/dist/trionBidAdapter.js +1 -1
  116. package/dist/tripleliftBidAdapter.js +1 -1
  117. package/dist/ttdBidAdapter.js +1 -1
  118. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  119. package/dist/uid2IdSystem.js +1 -1
  120. package/dist/underdogmediaBidAdapter.js +1 -1
  121. package/dist/undertoneBidAdapter.js +1 -1
  122. package/dist/vidazooBidAdapter.js +1 -1
  123. package/dist/videobyteBidAdapter.js +1 -1
  124. package/dist/videojsVideoProvider.js +1 -1
  125. package/dist/visxBidAdapter.js +1 -1
  126. package/dist/vrtcalBidAdapter.js +1 -1
  127. package/dist/vuukleBidAdapter.js +1 -1
  128. package/dist/widespaceBidAdapter.js +1 -1
  129. package/dist/winrBidAdapter.js +1 -1
  130. package/dist/yahoosspBidAdapter.js +1 -1
  131. package/dist/yieldmoBidAdapter.js +1 -1
  132. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  133. package/modules/adhashBidAdapter.js +56 -34
  134. package/modules/hypelabBidAdapter.js +153 -0
  135. package/modules/hypelabBidAdapter.md +38 -0
  136. package/modules/oxxionRtdProvider.js +7 -29
  137. package/modules/pubmaticAnalyticsAdapter.js +31 -8
  138. package/modules/teadsBidAdapter.js +0 -1
  139. package/modules/topicsFpdModule.js +4 -1
  140. package/modules/videojsVideoProvider.js +2 -0
  141. package/modules/vrtcalBidAdapter.js +5 -0
  142. package/package.json +1 -1
  143. package/test/spec/modules/adhashBidAdapter_spec.js +18 -2
  144. package/test/spec/modules/hypelabBidAdapter_spec.js +281 -0
  145. package/test/spec/modules/oxxionRtdProvider_spec.js +3 -2
  146. package/test/spec/modules/pubmaticAnalyticsAdapter_spec.js +7 -0
  147. package/test/spec/modules/teadsBidAdapter_spec.js +7 -0
  148. package/test/spec/modules/vrtcalBidAdapter_spec.js +9 -2
@@ -256,6 +256,10 @@ export function getMetadata(meta) {
256
256
  return metaObj;
257
257
  }
258
258
 
259
+ function isS2SBidder(bidder) {
260
+ return (s2sBidders.indexOf(bidder) > -1) ? 1 : 0
261
+ }
262
+
259
263
  function gatherPartnerBidsForAdUnitForLogger(adUnit, adUnitId, highestBid) {
260
264
  highestBid = (highestBid && highestBid.length > 0) ? highestBid[0] : null;
261
265
  return Object.keys(adUnit.bids).reduce(function(partnerBids, bidId) {
@@ -275,7 +279,7 @@ function gatherPartnerBidsForAdUnitForLogger(adUnit, adUnitId, highestBid) {
275
279
  'l1': bid.bidResponse ? bid.clientLatencyTimeMs : 0,
276
280
  'l2': 0,
277
281
  'adv': bid.bidResponse ? getAdDomain(bid.bidResponse) || undefined : undefined,
278
- 'ss': (s2sBidders.indexOf(bid.bidder) > -1) ? 1 : 0,
282
+ 'ss': isS2SBidder(bid.bidder),
279
283
  't': (bid.status == ERROR && bid.error.code == TIMEOUT_ERROR) ? 1 : 0,
280
284
  'wb': (highestBid && highestBid.adId === bid.adId ? 1 : 0),
281
285
  'mi': bid.bidResponse ? (bid.bidResponse.mi || undefined) : undefined,
@@ -311,6 +315,14 @@ function getAdUnit(adUnits, adUnitId) {
311
315
  return adUnits.filter(adUnit => (adUnit.divID && adUnit.divID == adUnitId) || (adUnit.code == adUnitId))[0];
312
316
  }
313
317
 
318
+ function getTgId() {
319
+ var testGroupId = parseInt(config.getConfig('testGroupId') || 0);
320
+ if (testGroupId <= 15 && testGroupId >= 0) {
321
+ return testGroupId;
322
+ }
323
+ return 0;
324
+ }
325
+
314
326
  function executeBidsLoggerCall(e, highestCpmBids) {
315
327
  let auctionId = e.auctionId;
316
328
  let referrer = config.getConfig('pageUrl') || cache.auctions[auctionId].referer || '';
@@ -337,13 +349,7 @@ function executeBidsLoggerCall(e, highestCpmBids) {
337
349
  outputObj['pid'] = '' + profileId;
338
350
  outputObj['pdvid'] = '' + profileVersionId;
339
351
  outputObj['dvc'] = {'plt': getDevicePlatform()};
340
- outputObj['tgid'] = (function() {
341
- var testGroupId = parseInt(config.getConfig('testGroupId') || 0);
342
- if (testGroupId <= 15 && testGroupId >= 0) {
343
- return testGroupId;
344
- }
345
- return 0;
346
- })();
352
+ outputObj['tgid'] = getTgId();
347
353
 
348
354
  if (floorData) {
349
355
  outputObj['fmv'] = floorData.floorRequestData ? floorData.floorRequestData.modelVersion || undefined : undefined;
@@ -391,6 +397,12 @@ function executeBidWonLoggerCall(auctionId, adUnitId) {
391
397
 
392
398
  const adapterName = getAdapterNameForAlias(winningBid.adapterCode || winningBid.bidder);
393
399
  let origAdUnit = getAdUnit(cache.auctions[auctionId].origAdUnits, adUnitId) || {};
400
+ let auctionCache = cache.auctions[auctionId];
401
+ let floorData = auctionCache.floorData;
402
+ let referrer = config.getConfig('pageUrl') || cache.auctions[auctionId].referer || '';
403
+ let adv = winningBid.bidResponse ? getAdDomain(winningBid.bidResponse) || undefined : undefined;
404
+ let fskp = floorData ? (floorData.floorRequestData ? (floorData.floorRequestData.skipped == false ? 0 : 1) : undefined) : undefined;
405
+
394
406
  let pixelURL = END_POINT_WIN_BID_LOGGER;
395
407
  pixelURL += 'pubid=' + publisherId;
396
408
  pixelURL += '&purl=' + enc(config.getConfig('pageUrl') || cache.auctions[auctionId].referer || '');
@@ -407,6 +419,17 @@ function executeBidWonLoggerCall(auctionId, adUnitId) {
407
419
  pixelURL += '&eg=' + enc(winningBid.bidResponse.bidGrossCpmUSD);
408
420
  pixelURL += '&kgpv=' + enc(getValueForKgpv(winningBid, adUnitId));
409
421
  pixelURL += '&piid=' + enc(winningBid.bidResponse.partnerImpId || EMPTY_STRING);
422
+
423
+ pixelURL += '&plt=' + enc(getDevicePlatform());
424
+ pixelURL += '&psz=' + enc((winningBid?.bidResponse?.dimensions?.width || '0') + 'x' +
425
+ (winningBid?.bidResponse?.dimensions?.height || '0'));
426
+ pixelURL += '&tgid=' + enc(getTgId());
427
+ adv && (pixelURL += '&adv=' + enc(adv));
428
+ pixelURL += '&orig=' + enc(getDomainFromUrl(referrer));
429
+ pixelURL += '&ss=' + enc(isS2SBidder(winningBid.bidder));
430
+ (fskp != undefined) && (pixelURL += '&fskp=' + enc(fskp));
431
+ pixelURL += '&af=' + enc(winningBid.bidResponse ? (winningBid.bidResponse.mediaType || undefined) : undefined);
432
+
410
433
  ajax(
411
434
  pixelURL,
412
435
  null,
@@ -227,7 +227,6 @@ function buildRequestObject(bid) {
227
227
  reqObj.placementId = parseInt(placementId, 10);
228
228
  reqObj.pageId = parseInt(pageId, 10);
229
229
  reqObj.adUnitCode = getBidIdParameter('adUnitCode', bid);
230
- reqObj.auctionId = getBidIdParameter('auctionId', bid);
231
230
  reqObj.transactionId = getBidIdParameter('transactionId', bid);
232
231
  if (gpid) { reqObj.gpid = gpid; }
233
232
  return reqObj;
@@ -28,7 +28,10 @@ export const lastUpdated = 'lastUpdated';
28
28
  const iframeLoadedURL = [];
29
29
  const TAXONOMIES = {
30
30
  // map from topic taxonomyVersion to IAB segment taxonomy
31
- '1': 600
31
+ '1': 600,
32
+ '2': 601,
33
+ '3': 602,
34
+ '4': 603
32
35
  }
33
36
 
34
37
  function partitionBy(field, items) {
@@ -628,6 +628,8 @@ export const utils = {
628
628
  return 'adserror';
629
629
  case CONTENT_LOADED:
630
630
  return 'loadstart';
631
+ case ERROR:
632
+ return ['error', 'aderror', 'contenterror'];
631
633
  case PLAY:
632
634
  return PLAY + 'ing';
633
635
  case PLAYBACK_REQUEST:
@@ -93,6 +93,11 @@ export const spec = {
93
93
  params.imp[0].banner.h = bid.sizes[0][1];
94
94
  }
95
95
 
96
+ if (bid.ortb2?.regs?.gpp) {
97
+ params.regs.ext.gpp = bid.ortb2.regs.gpp;
98
+ params.regs.ext.gpp_sid = bid.ortb2.regs.gpp_sid;
99
+ }
100
+
96
101
  return {method: 'POST', url: 'https://rtb.vrtcal.com/bidder_prebid.vap?ssp=1804', data: JSON.stringify(params), options: {withCredentials: false, crossOrigin: true}};
97
102
  });
98
103
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prebid.js",
3
- "version": "7.53.0",
3
+ "version": "7.54.0",
4
4
  "description": "Header Bidding Management Library",
5
5
  "main": "src/prebid.js",
6
6
  "scripts": {
@@ -88,7 +88,7 @@ describe('adhashBidAdapter', function () {
88
88
  );
89
89
  expect(result.length).to.equal(1);
90
90
  expect(result[0].method).to.equal('POST');
91
- expect(result[0].url).to.equal('https://bidder.adhash.com/rtb?version=3.2&prebid=true&publisher=0xc3b09b27e9c6ef73957901aa729b9e69e5bbfbfb');
91
+ expect(result[0].url).to.equal('https://bidder.adhash.com/rtb?version=3.6&prebid=true&publisher=0xc3b09b27e9c6ef73957901aa729b9e69e5bbfbfb');
92
92
  expect(result[0].bidRequest).to.equal(bidRequest);
93
93
  expect(result[0].data).to.have.property('timezone');
94
94
  expect(result[0].data).to.have.property('location');
@@ -104,7 +104,7 @@ describe('adhashBidAdapter', function () {
104
104
  const result = spec.buildRequests([ bidRequest ], { gdprConsent: { gdprApplies: true, consentString: 'example' } });
105
105
  expect(result.length).to.equal(1);
106
106
  expect(result[0].method).to.equal('POST');
107
- expect(result[0].url).to.equal('https://bidder.adhash.com/rtb?version=3.2&prebid=true&publisher=0xc3b09b27e9c6ef73957901aa729b9e69e5bbfbfb');
107
+ expect(result[0].url).to.equal('https://bidder.adhash.com/rtb?version=3.6&prebid=true&publisher=0xc3b09b27e9c6ef73957901aa729b9e69e5bbfbfb');
108
108
  expect(result[0].bidRequest).to.equal(bidRequest);
109
109
  expect(result[0].data).to.have.property('timezone');
110
110
  expect(result[0].data).to.have.property('location');
@@ -152,6 +152,8 @@ describe('adhashBidAdapter', function () {
152
152
  ['дума', 'full', 1],
153
153
  ['старт', 'starts', 1],
154
154
  ['край', 'ends', 1],
155
+ ['onq jbeq', 'partial', 1],
156
+ ['dhrra qvrf', 'combo', 2],
155
157
  ],
156
158
  maxScore: 2
157
159
  }
@@ -196,6 +198,13 @@ describe('adhashBidAdapter', function () {
196
198
  expect(spec.interpretResponse(serverResponse, request).length).to.equal(0);
197
199
  });
198
200
 
201
+ it('should return empty array when there are bad words (partial, compound phrase)', function () {
202
+ bodyStub = sinon.stub(window.top.document.body, 'innerText').get(function() {
203
+ return 'example text partialbad wordb bad wordb example bad wordbtext' + ' word'.repeat(994);
204
+ });
205
+ expect(spec.interpretResponse(serverResponse, request).length).to.equal(0);
206
+ });
207
+
199
208
  it('should return empty array when there are bad words (starts)', function () {
200
209
  bodyStub = sinon.stub(window.top.document.body, 'innerText').get(function() {
201
210
  return 'example text startsWith starts text startsAgain' + ' word'.repeat(994);
@@ -224,6 +233,13 @@ describe('adhashBidAdapter', function () {
224
233
  expect(spec.interpretResponse(serverResponse, request).length).to.equal(0);
225
234
  });
226
235
 
236
+ it('should return empty array when there are bad words (combo)', function () {
237
+ bodyStub = sinon.stub(window.top.document.body, 'innerText').get(function() {
238
+ return 'queen of england dies, the queen dies' + ' word'.repeat(993);
239
+ });
240
+ expect(spec.interpretResponse(serverResponse, request).length).to.equal(0);
241
+ });
242
+
227
243
  it('should return empty array when there are bad words (regexp)', function () {
228
244
  bodyStub = sinon.stub(window.top.document.body, 'innerText').get(function() {
229
245
  return 'example text xxxayyy zzxxxAyyyzz text xxxbyyy' + ' word'.repeat(994);
@@ -0,0 +1,281 @@
1
+ import { expect } from 'chai';
2
+ import sinon from 'sinon';
3
+ import { server } from '../../mocks/xhr';
4
+
5
+ import {
6
+ mediaSize,
7
+ spec,
8
+ BIDDER_CODE,
9
+ ENDPOINT_URL,
10
+ REQUEST_ROUTE,
11
+ } from 'modules/hypelabBidAdapter.js';
12
+
13
+ import { BANNER } from 'src/mediaTypes.js';
14
+
15
+ const mockValidBidRequest = {
16
+ bidder: 'hypelab',
17
+ params: {
18
+ property_slug: 'prebid',
19
+ placement_slug: 'test_placement',
20
+ uuid: '',
21
+ sdk_version: '0.1.0',
22
+ provider_name: 'react',
23
+ provider_version: '0.3.1',
24
+ },
25
+ userIds: [],
26
+ mediaTypes: {
27
+ banner: {
28
+ sizes: [[728, 90]],
29
+ },
30
+ },
31
+ adUnitCode: 'test-div',
32
+ sizes: [[728, 90]],
33
+ bidId: '24d2b2c86c5e19',
34
+ bidderRequestId: '1d1f40b509f18',
35
+ auctionId: '3bf3b1fb-cb0a-4ee8-90ef-69b8e6e56dbd',
36
+ bidRequestsCount: 1,
37
+ bidderRequestsCount: 1,
38
+ bidderWinsCount: 0,
39
+ };
40
+
41
+ const mockValidBidRequests = [mockValidBidRequest];
42
+
43
+ const mockServerResponse = {
44
+ body: {
45
+ status: 'success',
46
+ data: {
47
+ currency: 'USD',
48
+ campaign_slug: '9dbe230882',
49
+ creative_set_slug: '842984f045',
50
+ creative_set: {
51
+ image: {
52
+ url: 'https://cloudfront.net/up/asset/12345',
53
+ height: 90,
54
+ width: 728,
55
+ },
56
+ },
57
+ cpm: 1.5,
58
+ html: "<!DOCTYPE html>\n <html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\">\n <title>Ad</title>\n <style>\n html, body {\n margin: 0;\n padding: 0;\n overflow: hidden;\n }\n </style>\n </head>\n <body>\n <a\n id=\"link\"\n href=https://web.hypelab-staging.com/click?campaign_slug=9dbe230882&creative_set_slug=842984f045&placement_slug=test_placement \n target=\"_blank\">\n <img src=\"https://di30gnjrtlisb.cloudfront.net/up/asset/d1d1d65463/8eb7e9065e.jpg?tr=w-728,h-90\">\n </a>\n \n <script>\n function track(type) {\n var request = new XMLHttpRequest();\n request.open('POST', 'https://api.hypelab-staging.com/v1/events');\n request.setRequestHeader('Content-Type', 'application/json');\n\n var event = {\n property_slug: 'prebid',\n placement_slug: 'test_placement',\n campaign_slug: '9dbe230882',\n creative_set_slug: '842984f045',\n type: type,\n uuid: '',\n wids: []\n };\n\n request.send(JSON.stringify(event));\n }\n\n document.getElementById('link').addEventListener('click', function() {\n track('click');\n });\n\n track('impression');\n </script>\n </body>\n </html>\n ",
59
+ advertiser_domains: ['ogx.com'],
60
+ media_type: 'banner',
61
+ ttl: 360,
62
+ },
63
+ },
64
+ };
65
+
66
+ const mockBidderRequest = {
67
+ bidderCode: 'hypelab',
68
+ auctionId: '4462005b-ba06-49a9-a95d-0209c22f4606',
69
+ bidderRequestId: '1bf399761210ad',
70
+ bids: mockValidBidRequests,
71
+ auctionStart: 1684983987435,
72
+ timeout: 2000,
73
+ refererInfo: {
74
+ topmostLocation: 'https://example.com/hello_world.html',
75
+ location: 'https://example.com/hello_world.html',
76
+ canonicalUrl: null,
77
+ page: 'https://example.com/hello_world.html',
78
+ domain: null,
79
+ ref: null,
80
+ },
81
+ };
82
+
83
+ const mockBidRequest = {
84
+ method: 'POST',
85
+ url: 'https://api.hypelab.com/v1/prebid_requests',
86
+ options: {
87
+ contentType: 'application/json',
88
+ withCredentials: false,
89
+ },
90
+ data: {
91
+ property_slug: 'prebid',
92
+ placement_slug: 'test_placement',
93
+ provider_version: '0.0.1',
94
+ provider_name: 'prebid',
95
+ referrer: 'https://example.com',
96
+ sdk_version: '7.51.0-pre',
97
+ sizes: [[728, 90]],
98
+ wids: [],
99
+ uuid: 'tmp_c5abf809-47d6-40b9-8274-372c6d816dd8',
100
+ bidRequestsCount: 1,
101
+ bidderRequestsCount: 1,
102
+ bidderWinsCount: 0,
103
+ },
104
+ bidId: '2e02b562f700ae',
105
+ };
106
+
107
+ describe('hypelabBidAdapter', function () {
108
+ describe('mediaSize', function () {
109
+ describe('when given an invalid media object', function () {
110
+ expect(mediaSize({})).to.eql({ width: 0, height: 0 });
111
+ });
112
+
113
+ describe('when given a valid media object', function () {
114
+ expect(
115
+ mediaSize({ creative_set: { image: { width: 728, height: 90 } } })
116
+ ).to.eql({ width: 728, height: 90 });
117
+ });
118
+ });
119
+
120
+ describe('isBidRequestValid', function () {
121
+ describe('when given an invalid bid request', function () {
122
+ expect(spec.isBidRequestValid({})).to.equal(false);
123
+ });
124
+
125
+ describe('when given a valid bid request', function () {
126
+ expect(spec.isBidRequestValid(mockValidBidRequest)).to.equal(true);
127
+ });
128
+ });
129
+
130
+ describe('Bidder code valid', function () {
131
+ expect(spec.code).to.equal(BIDDER_CODE);
132
+ });
133
+
134
+ describe('Media types valid', function () {
135
+ expect(spec.supportedMediaTypes).to.contain(BANNER);
136
+ });
137
+
138
+ describe('Bid request valid', function () {
139
+ expect(spec.isBidRequestValid(mockValidBidRequest)).to.equal(true);
140
+ });
141
+
142
+ describe('buildRequests', () => {
143
+ describe('returns a valid request', function () {
144
+ const result = spec.buildRequests(
145
+ mockValidBidRequests,
146
+ mockBidderRequest
147
+ );
148
+ expect(result).to.be.an('array');
149
+
150
+ const first = result[0] || {};
151
+ expect(first).to.be.an('object');
152
+ expect(first.method).to.equal('POST');
153
+ expect(first.url).to.be.a('string');
154
+ expect(first.url).to.equal(ENDPOINT_URL + REQUEST_ROUTE);
155
+
156
+ const data = first.data || {};
157
+ expect(data).to.be.an('object');
158
+ expect(data.property_slug).to.be.a('string');
159
+ expect(data.placement_slug).to.be.a('string');
160
+ expect(data.bidRequestsCount).to.be.a('number');
161
+ expect(data.bidderRequestsCount).to.be.a('number');
162
+ expect(data.bidderWinsCount).to.be.a('number');
163
+ });
164
+
165
+ describe('should set uuid to the first id in userIdAsEids', () => {
166
+ mockValidBidRequests[0].userIdAsEids = [
167
+ {
168
+ source: 'pubcid.org',
169
+ uids: [
170
+ {
171
+ id: 'pubcid_id',
172
+ },
173
+ ],
174
+ },
175
+ {
176
+ source: 'criteo.com',
177
+ uids: [
178
+ {
179
+ id: 'criteo_id',
180
+ },
181
+ ],
182
+ },
183
+ ];
184
+
185
+ const result = spec.buildRequests(
186
+ mockValidBidRequests,
187
+ mockBidderRequest
188
+ );
189
+
190
+ const data = result[0].data || {};
191
+ expect(data.uuid).to.be.eq('pubcid_id');
192
+ });
193
+ });
194
+
195
+ describe('interpretResponse', () => {
196
+ describe('successfully interpret a valid response', function () {
197
+ const result = spec.interpretResponse(mockServerResponse, mockBidRequest);
198
+
199
+ expect(result).to.be.an('array');
200
+ const data = result[0] || {};
201
+ expect(data).to.be.an('object');
202
+ expect(data.requestId).to.be.a('string');
203
+ expect(data.cpm).to.be.a('number');
204
+ expect(data.width).to.be.a('number');
205
+ expect(data.height).to.be.a('number');
206
+ expect(data.creativeId).to.be.a('string');
207
+ expect(data.currency).to.be.a('string');
208
+ expect(data.netRevenue).to.be.a('boolean');
209
+ expect(data.referrer).to.be.a('string');
210
+ expect(data.ttl).to.be.a('number');
211
+ expect(data.ad).to.be.a('string');
212
+ expect(data.mediaType).to.be.a('string');
213
+ expect(data.meta.advertiserDomains).to.be.an('array');
214
+ });
215
+
216
+ describe('should return a blank array if cpm is not set', () => {
217
+ mockServerResponse.body.data.cpm = undefined;
218
+ const result = spec.interpretResponse(mockServerResponse, mockBidRequest);
219
+ expect(result).to.eql([]);
220
+ });
221
+ });
222
+
223
+ describe('report', () => {
224
+ it('returns if REPORTING_ROUTE is not set', () => {
225
+ spec.REPORTING_ROUTE = '';
226
+ expect(spec.report('test', {})).to.be.undefined;
227
+ });
228
+
229
+ it('makes a POST request if REPORTING_ROUTE is set', () => {
230
+ spec.report('test', {}, '/v1/events');
231
+
232
+ expect(server.requests[0].url).to.equals(
233
+ 'https://api.hypelab.com/v1/events'
234
+ );
235
+ });
236
+ });
237
+
238
+ describe('callbacks', () => {
239
+ let bid = {};
240
+ let reportStub;
241
+
242
+ beforeEach(() => (reportStub = sinon.stub(spec, 'report')));
243
+ afterEach(() => reportStub.restore());
244
+
245
+ describe('onTimeout', () => {
246
+ it('should call report with the correct data', () => {
247
+ spec.onTimeout(bid);
248
+
249
+ expect(reportStub.calledOnce).to.be.true;
250
+ expect(reportStub.getCall(0).args).to.eql(['timeout', bid]);
251
+ });
252
+ });
253
+
254
+ describe('onSetTargeting', () => {
255
+ it('should call report with the correct data', () => {
256
+ spec.onSetTargeting(bid);
257
+
258
+ expect(reportStub.calledOnce).to.be.true;
259
+ expect(reportStub.getCall(0).args).to.eql(['setTargeting', bid]);
260
+ });
261
+ });
262
+
263
+ describe('onBidWon', () => {
264
+ it('should call report with the correct data', () => {
265
+ spec.onBidWon(bid);
266
+
267
+ expect(reportStub.calledOnce).to.be.true;
268
+ expect(reportStub.getCall(0).args).to.eql(['bidWon', bid]);
269
+ });
270
+ });
271
+
272
+ describe('onBidderError', () => {
273
+ it('should call report with the correct data', () => {
274
+ spec.onBidderError(bid);
275
+
276
+ expect(reportStub.calledOnce).to.be.true;
277
+ expect(reportStub.getCall(0).args).to.eql(['bidderError', bid]);
278
+ });
279
+ });
280
+ });
281
+ });
@@ -114,7 +114,8 @@ describe('oxxionRtdProvider', () => {
114
114
  auctionEnd.bidsReceived = bids;
115
115
  it('call everything', function() {
116
116
  oxxionSubmodule.getBidRequestData(request, null, moduleConfig);
117
- oxxionSubmodule.onAuctionEndEvent(auctionEnd, moduleConfig);
117
+ oxxionSubmodule.onBidResponseEvent(auctionEnd.bidsReceived[0], moduleConfig);
118
+ oxxionSubmodule.onBidResponseEvent(auctionEnd.bidsReceived[1], moduleConfig);
118
119
  });
119
120
  it('check vastImpUrl', function() {
120
121
  expect(auctionEnd.bidsReceived[0]).to.have.property('vastImpUrl');
@@ -136,7 +137,7 @@ describe('oxxionRtdProvider', () => {
136
137
  expect(inlineImpressions).to.have.lengthOf.above(0);
137
138
  });
138
139
  it('check cpmIncrement', function() {
139
- expect(auctionEnd.bidsReceived[1].vastImpUrl).to.contain(encodeURI('cpmIncrement=1'));
140
+ expect(auctionEnd.bidsReceived[1].vastImpUrl).to.contain(encodeURI('cpmIncrement=0'));
140
141
  });
141
142
  });
142
143
  });
@@ -443,6 +443,13 @@ describe('pubmatic analytics adapter', function () {
443
443
  expect(data.eg).to.equal('1.23');
444
444
  expect(data.en).to.equal('1.23');
445
445
  expect(data.piid).to.equal('partnerImpressionID-1');
446
+ expect(data.plt).to.equal('1');
447
+ expect(data.psz).to.equal('640x480');
448
+ expect(data.tgid).to.equal('15');
449
+ expect(data.orig).to.equal('www.test.com');
450
+ expect(data.ss).to.equal('1');
451
+ expect(data.fskp).to.equal('0');
452
+ expect(data.af).to.equal('video');
446
453
  });
447
454
 
448
455
  it('bidCpmAdjustment: USD: Logger: best case + win tracker', function() {
@@ -121,6 +121,13 @@ describe('teadsBidAdapter', () => {
121
121
  expect(request.method).to.equal('POST');
122
122
  });
123
123
 
124
+ it('should not send auctionId in bid request ', function() {
125
+ const request = spec.buildRequests(bidRequests, bidderResquestDefault);
126
+ const payload = JSON.parse(request.data);
127
+
128
+ expect(payload.data[0].auctionId).to.not.exist
129
+ });
130
+
124
131
  it('should send US Privacy to endpoint', function() {
125
132
  let usPrivacy = 'OHHHFCP1'
126
133
  let bidderRequest = {
@@ -55,14 +55,21 @@ describe('vrtcalBidAdapter', function () {
55
55
  expect(request[0].data).to.match(/"bidfloor":0.55/);
56
56
  });
57
57
 
58
- it('pass GDPR,CCPA, and COPPA indicators/consent strings with the request when present', function () {
58
+ it('pass GDPR,CCPA,COPPA, and GPP indicators/consent strings with the request when present', function () {
59
59
  bidRequests[0].gdprConsent = {consentString: 'gdpr-consent-string', gdprApplies: true};
60
60
  bidRequests[0].uspConsent = 'ccpa-consent-string';
61
61
  config.setConfig({ coppa: false });
62
62
 
63
+ bidRequests[0].ortb2 = {
64
+ regs: {
65
+ gpp: 'testGpp',
66
+ gpp_sid: [1, 2, 3]
67
+ }
68
+ }
69
+
63
70
  request = spec.buildRequests(bidRequests);
64
71
  expect(request[0].data).to.match(/"user":{"ext":{"consent":"gdpr-consent-string"/);
65
- expect(request[0].data).to.match(/"regs":{"coppa":0,"ext":{"gdpr":1,"us_privacy":"ccpa-consent-string"}}/);
72
+ expect(request[0].data).to.match(/"regs":{"coppa":0,"ext":{"gdpr":1,"us_privacy":"ccpa-consent-string","gpp":"testGpp","gpp_sid":\[1,2,3\]}}/);
66
73
  });
67
74
 
68
75
  it('pass bidder timeout/tmax with the request', function () {