prebid.js 9.3.0 → 9.4.1

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 (221) hide show
  1. package/creative/constants.js +2 -1
  2. package/creative/crossDomain.js +16 -4
  3. package/dist/33acrossAnalyticsAdapter.js +1 -1
  4. package/dist/33acrossBidAdapter.js +1 -1
  5. package/dist/33acrossIdSystem.js +1 -1
  6. package/dist/BTBidAdapter.js +1 -1
  7. package/dist/adagioAnalyticsAdapter.js +1 -1
  8. package/dist/adagioBidAdapter.js +1 -1
  9. package/dist/adagioRtdProvider.js +1 -1
  10. package/dist/adagioUtils.js +1 -1
  11. package/dist/addefendBidAdapter.js +1 -1
  12. package/dist/adfBidAdapter.js +1 -1
  13. package/dist/adgenerationBidAdapter.js +1 -1
  14. package/dist/adlooxRtdProvider.js +1 -1
  15. package/dist/adqueryBidAdapter.js +1 -1
  16. package/dist/adrelevantisBidAdapter.js +1 -1
  17. package/dist/adstirBidAdapter.js +1 -1
  18. package/dist/adtrgtmeBidAdapter.js +1 -1
  19. package/dist/adxcgAnalyticsAdapter.js +1 -1
  20. package/dist/adxcgBidAdapter.js +1 -1
  21. package/dist/adyoulikeBidAdapter.js +1 -1
  22. package/dist/agmaAnalyticsAdapter.js +1 -1
  23. package/dist/ajaBidAdapter.js +1 -1
  24. package/dist/amxBidAdapter.js +1 -1
  25. package/dist/amxIdSystem.js +1 -1
  26. package/dist/appierAnalyticsAdapter.js +1 -1
  27. package/dist/appnexusBidAdapter.js +1 -1
  28. package/dist/asoBidAdapter.js +1 -1
  29. package/dist/axonixBidAdapter.js +1 -1
  30. package/dist/bidglassBidAdapter.js +1 -1
  31. package/dist/big-richmediaBidAdapter.js +1 -1
  32. package/dist/bridBidAdapter.js +1 -1
  33. package/dist/bridgewellBidAdapter.js +1 -1
  34. package/dist/brightMountainMediaBidAdapter.js +1 -1
  35. package/dist/carodaBidAdapter.js +1 -1
  36. package/dist/chtnwBidAdapter.js +1 -1
  37. package/dist/chunk-core.js +1 -1
  38. package/dist/codefuelBidAdapter.js +1 -1
  39. package/dist/concertBidAdapter.js +1 -1
  40. package/dist/connectadBidAdapter.js +1 -1
  41. package/dist/consumableBidAdapter.js +1 -1
  42. package/dist/conversantAnalyticsAdapter.js +1 -1
  43. package/dist/conversantBidAdapter.js +1 -1
  44. package/dist/cpmstarBidAdapter.js +1 -1
  45. package/dist/craftBidAdapter.js +1 -1
  46. package/dist/criteoBidAdapter.js +1 -1
  47. package/dist/cwireBidAdapter.js +1 -1
  48. package/dist/dailymotionBidAdapter.js +1 -1
  49. package/dist/deltaprojectsBidAdapter.js +1 -1
  50. package/dist/dependencies.json +33 -9
  51. package/dist/dianomiBidAdapter.js +1 -1
  52. package/dist/dspxBidAdapter.js +1 -1
  53. package/dist/dxkultureBidAdapter.js +1 -1
  54. package/dist/eplanningBidAdapter.js +1 -1
  55. package/dist/euidIdSystem.js +1 -1
  56. package/dist/exadsBidAdapter.js +1 -1
  57. package/dist/feedadBidAdapter.js +1 -1
  58. package/dist/finativeBidAdapter.js +1 -1
  59. package/dist/freewheel-sspBidAdapter.js +1 -1
  60. package/dist/gmosspBidAdapter.js +1 -1
  61. package/dist/goldbachBidAdapter.js +1 -1
  62. package/dist/greenbidsAnalyticsAdapter.js +1 -1
  63. package/dist/greenbidsRtdProvider.js +1 -1
  64. package/dist/gridBidAdapter.js +1 -1
  65. package/dist/gumgumBidAdapter.js +1 -1
  66. package/dist/h12mediaBidAdapter.js +1 -1
  67. package/dist/hypelabBidAdapter.js +1 -1
  68. package/dist/id5AnalyticsAdapter.js +1 -1
  69. package/dist/id5IdSystem.js +1 -1
  70. package/dist/illuminBidAdapter.js +1 -1
  71. package/dist/imdsBidAdapter.js +1 -1
  72. package/dist/improvedigitalBidAdapter.js +1 -1
  73. package/dist/insticatorBidAdapter.js +1 -1
  74. package/dist/ixBidAdapter.js +1 -1
  75. package/dist/jixieBidAdapter.js +1 -1
  76. package/dist/justpremiumBidAdapter.js +1 -1
  77. package/dist/kargoBidAdapter.js +1 -1
  78. package/dist/kimberliteBidAdapter.js +1 -1
  79. package/dist/konduitAnalyticsAdapter.js +1 -1
  80. package/dist/kueezBidAdapter.js +1 -1
  81. package/dist/kueezRtbBidAdapter.js +1 -1
  82. package/dist/lassoBidAdapter.js +1 -1
  83. package/dist/lifestreetBidAdapter.js +1 -1
  84. package/dist/liveIntentIdSystem.js +1 -1
  85. package/dist/logicadBidAdapter.js +1 -1
  86. package/dist/loglyliftBidAdapter.js +1 -1
  87. package/dist/luceadBidAdapter.js +1 -1
  88. package/dist/luponmediaBidAdapter.js +1 -1
  89. package/dist/mabidderBidAdapter.js +1 -1
  90. package/dist/magniteAnalyticsAdapter.js +1 -1
  91. package/dist/malltvAnalyticsAdapter.js +1 -1
  92. package/dist/marsmediaBidAdapter.js +1 -1
  93. package/dist/mediafuseBidAdapter.js +1 -1
  94. package/dist/medianetAnalyticsAdapter.js +1 -1
  95. package/dist/medianetBidAdapter.js +1 -1
  96. package/dist/mediasquareBidAdapter.js +1 -1
  97. package/dist/mgidBidAdapter.js +1 -1
  98. package/dist/minutemediaBidAdapter.js +1 -1
  99. package/dist/missenaBidAdapter.js +1 -1
  100. package/dist/nexx360BidAdapter.js +1 -1
  101. package/dist/nobidAnalyticsAdapter.js +1 -1
  102. package/dist/nobidBidAdapter.js +1 -1
  103. package/dist/not-for-prod/prebid.js +171 -170
  104. package/dist/oguryBidAdapter.js +1 -1
  105. package/dist/onetagBidAdapter.js +1 -1
  106. package/dist/ooloAnalyticsAdapter.js +1 -1
  107. package/dist/openwebBidAdapter.js +1 -1
  108. package/dist/openxBidAdapter.js +1 -1
  109. package/dist/optidigitalBidAdapter.js +1 -1
  110. package/dist/orbidderBidAdapter.js +1 -1
  111. package/dist/outbrainBidAdapter.js +1 -1
  112. package/dist/ozoneBidAdapter.js +1 -1
  113. package/dist/pixfutureBidAdapter.js +1 -1
  114. package/dist/processResponse.js +1 -0
  115. package/dist/publinkIdSystem.js +1 -1
  116. package/dist/publirBidAdapter.js +1 -1
  117. package/dist/pubmaticAnalyticsAdapter.js +1 -1
  118. package/dist/pubmaticBidAdapter.js +1 -1
  119. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  120. package/dist/pxyzBidAdapter.js +1 -1
  121. package/dist/quantcastBidAdapter.js +1 -1
  122. package/dist/readpeakBidAdapter.js +1 -1
  123. package/dist/relaidoBidAdapter.js +1 -1
  124. package/dist/retailspotBidAdapter.js +1 -1
  125. package/dist/rhythmoneBidAdapter.js +1 -1
  126. package/dist/riseBidAdapter.js +1 -1
  127. package/dist/rubiconBidAdapter.js +1 -1
  128. package/dist/seedingAllianceBidAdapter.js +1 -1
  129. package/dist/seedtagBidAdapter.js +1 -1
  130. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  131. package/dist/sharethroughBidAdapter.js +1 -1
  132. package/dist/shinezBidAdapter.js +1 -1
  133. package/dist/shinezRtbBidAdapter.js +1 -1
  134. package/dist/smaatoBidAdapter.js +1 -1
  135. package/dist/smartadserverBidAdapter.js +1 -1
  136. package/dist/smartxBidAdapter.js +1 -1
  137. package/dist/smilewantedBidAdapter.js +1 -1
  138. package/dist/snigelBidAdapter.js +1 -1
  139. package/dist/sonobiBidAdapter.js +1 -1
  140. package/dist/sovrnBidAdapter.js +1 -1
  141. package/dist/sspBCBidAdapter.js +1 -1
  142. package/dist/stnBidAdapter.js +1 -1
  143. package/dist/stvBidAdapter.js +1 -1
  144. package/dist/sublimeBidAdapter.js +1 -1
  145. package/dist/taboolaBidAdapter.js +1 -1
  146. package/dist/tagorasBidAdapter.js +1 -1
  147. package/dist/tappxBidAdapter.js +1 -1
  148. package/dist/targetVideoBidAdapter.js +1 -1
  149. package/dist/teadsBidAdapter.js +1 -1
  150. package/dist/terceptAnalyticsAdapter.js +1 -1
  151. package/dist/themoneytizerBidAdapter.js +1 -1
  152. package/dist/trionBidAdapter.js +1 -1
  153. package/dist/tripleliftBidAdapter.js +1 -1
  154. package/dist/ttdBidAdapter.js +1 -1
  155. package/dist/twistDigitalBidAdapter.js +1 -1
  156. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  157. package/dist/uid2IdSystem.js +1 -1
  158. package/dist/underdogmediaBidAdapter.js +1 -1
  159. package/dist/undertoneBidAdapter.js +1 -1
  160. package/dist/unrulyBidAdapter.js +1 -1
  161. package/dist/viantOrtbBidAdapter.js +1 -1
  162. package/dist/vidazooBidAdapter.js +1 -1
  163. package/dist/vidazooUtils.js +1 -1
  164. package/dist/videobyteBidAdapter.js +1 -1
  165. package/dist/visxBidAdapter.js +1 -1
  166. package/dist/vuukleBidAdapter.js +1 -1
  167. package/dist/widespaceBidAdapter.js +1 -1
  168. package/dist/winrBidAdapter.js +1 -1
  169. package/dist/yahooAdsBidAdapter.js +1 -1
  170. package/dist/yieldmoBidAdapter.js +1 -1
  171. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  172. package/dist/zeta_global_sspBidAdapter.js +1 -1
  173. package/integrationExamples/gpt/x-domain/creative.html +1 -1
  174. package/libraries/processResponse/index.js +12 -0
  175. package/libraries/vidazooUtils/bidderUtils.js +9 -10
  176. package/modules/adagioRtdProvider.js +9 -7
  177. package/modules/adfBidAdapter.js +1 -10
  178. package/modules/carodaBidAdapter.js +3 -8
  179. package/modules/codefuelBidAdapter.js +1 -10
  180. package/modules/cpmstarBidAdapter.js +52 -36
  181. package/modules/cpmstarBidAdapter.md +1 -4
  182. package/modules/dailymotionBidAdapter.js +1 -1
  183. package/modules/deltaprojectsBidAdapter.js +2 -11
  184. package/modules/dianomiBidAdapter.js +1 -9
  185. package/modules/finativeBidAdapter.js +1 -10
  186. package/modules/gridBidAdapter.js +2 -12
  187. package/modules/illuminBidAdapter.js +9 -304
  188. package/modules/kueezRtbBidAdapter.js +17 -312
  189. package/modules/luponmediaBidAdapter.js +4 -10
  190. package/modules/mgidBidAdapter.js +1 -10
  191. package/modules/outbrainBidAdapter.js +8 -43
  192. package/modules/ozoneBidAdapter.js +9 -7
  193. package/modules/shinezRtbBidAdapter.js +12 -304
  194. package/modules/tagorasBidAdapter.js +13 -316
  195. package/modules/twistDigitalBidAdapter.js +9 -422
  196. package/modules/viantOrtbBidAdapter.js +20 -0
  197. package/modules/vidazooBidAdapter.js +3 -3
  198. package/modules/visxBidAdapter.js +27 -29
  199. package/modules/zeta_global_sspBidAdapter.js +2 -2
  200. package/package.json +1 -1
  201. package/src/adRendering.js +29 -2
  202. package/src/constants.js +2 -0
  203. package/src/prebid.js +2 -1
  204. package/src/utils.js +19 -1
  205. package/test/pages/banner_sync.html +97 -0
  206. package/test/spec/creative/crossDomainCreative_spec.js +38 -2
  207. package/test/spec/e2e/banner/basic_banner_ad.spec.js +20 -14
  208. package/test/spec/libraries/processResponse_spec.js +60 -0
  209. package/test/spec/modules/adagioRtdProvider_spec.js +12 -0
  210. package/test/spec/modules/cpmstarBidAdapter_spec.js +1 -1
  211. package/test/spec/modules/dailymotionBidAdapter_spec.js +18 -14
  212. package/test/spec/modules/illuminBidAdapter_spec.js +26 -13
  213. package/test/spec/modules/kueezRtbBidAdapter_spec.js +26 -15
  214. package/test/spec/modules/outbrainBidAdapter_spec.js +32 -1
  215. package/test/spec/modules/shinezRtbBidAdapter_spec.js +26 -14
  216. package/test/spec/modules/tagorasBidAdapter_spec.js +26 -15
  217. package/test/spec/modules/twistDigitalBidAdapter_spec.js +15 -20
  218. package/test/spec/modules/viantOrtbBidAdapter_spec.js +87 -6
  219. package/test/spec/modules/visxBidAdapter_spec.js +180 -0
  220. package/test/spec/modules/zeta_global_sspBidAdapter_spec.js +11 -0
  221. package/test/spec/unit/pbjs_api_spec.js +6 -1
@@ -65,6 +65,23 @@ describe('Outbrain Adapter', function () {
65
65
  }
66
66
  }
67
67
 
68
+ const ortb2WithDeviceData = {
69
+ ortb2: {
70
+ device: {
71
+ w: 980,
72
+ h: 1720,
73
+ dnt: 0,
74
+ ua: 'Mozilla/5.0 (iPhone; CPU iPhone OS 17_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/125.0.6422.80 Mobile/15E148 Safari/604.1',
75
+ language: 'en',
76
+ devicetype: 1,
77
+ make: 'Apple',
78
+ model: 'iPhone 12 Pro Max',
79
+ os: 'iOS',
80
+ osv: '17.4'
81
+ }
82
+ }
83
+ };
84
+
68
85
  describe('isBidRequestValid', function () {
69
86
  before(() => {
70
87
  config.setConfig({
@@ -390,7 +407,8 @@ describe('Outbrain Adapter', function () {
390
407
  minduration: 3,
391
408
  maxduration: 10,
392
409
  startdelay: 2,
393
- placement: 4,
410
+ placement: 5,
411
+ plcmt: 4,
394
412
  linearity: 1
395
413
  }
396
414
  }
@@ -620,6 +638,19 @@ describe('Outbrain Adapter', function () {
620
638
  const resData = JSON.parse(res.data)
621
639
  expect(resData.imp[0].native.request).to.equal(JSON.stringify(expectedNativeAssets));
622
640
  });
641
+
642
+ it('should pass ortb2 device data', function () {
643
+ const bidRequest = {
644
+ ...commonBidRequest,
645
+ ...nativeBidRequestParams,
646
+ };
647
+
648
+ const res = spec.buildRequests(
649
+ [bidRequest],
650
+ {...commonBidderRequest, ...ortb2WithDeviceData},
651
+ );
652
+ expect(JSON.parse(res.data).device).to.deep.equal(ortb2WithDeviceData.ortb2.device);
653
+ });
623
654
  })
624
655
 
625
656
  describe('interpretResponse', function () {
@@ -2,6 +2,9 @@ import {expect} from 'chai';
2
2
  import {
3
3
  spec as adapter,
4
4
  createDomain,
5
+ storage
6
+ } from 'modules/shinezRtbBidAdapter';
7
+ import {
5
8
  hashCode,
6
9
  extractPID,
7
10
  extractCID,
@@ -10,13 +13,12 @@ import {
10
13
  setStorageItem,
11
14
  tryParseJSON,
12
15
  getUniqueDealId,
13
- } from 'modules/shinezRtbBidAdapter';
14
- import * as utils from 'src/utils.js';
16
+ } from '../../../libraries/vidazooUtils/bidderUtils.js';
17
+ import {parseUrl, deepClone} from 'src/utils.js';
15
18
  import {version} from 'package.json';
16
19
  import {useFakeTimers} from 'sinon';
17
20
  import {BANNER, VIDEO} from '../../../src/mediaTypes';
18
21
  import {config} from '../../../src/config';
19
- import {deepAccess} from 'src/utils.js';
20
22
 
21
23
  export const TEST_ID_SYSTEMS = ['criteoId', 'id5id', 'idl_env', 'lipb', 'netId', 'pubcid', 'tdid', 'pubProvidedId'];
22
24
 
@@ -181,7 +183,7 @@ const REQUEST = {
181
183
 
182
184
  function getTopWindowQueryParams() {
183
185
  try {
184
- const parsedUrl = utils.parseUrl(window.top.document.URL, {decodeSearchAsString: true});
186
+ const parsedUrl = parseUrl(window.top.document.URL, {decodeSearchAsString: true});
185
187
  return parsedUrl.search;
186
188
  } catch (e) {
187
189
  return '';
@@ -328,7 +330,12 @@ describe('ShinezRtbBidAdapter', function () {
328
330
  startdelay: 0
329
331
  }
330
332
  },
331
- gpid: '0123456789'
333
+ gpid: '0123456789',
334
+ cat: [],
335
+ contentData: [],
336
+ isStorageAllowed: true,
337
+ pagecat: [],
338
+ userData: []
332
339
  }
333
340
  });
334
341
  });
@@ -390,6 +397,11 @@ describe('ShinezRtbBidAdapter', function () {
390
397
  uqs: getTopWindowQueryParams(),
391
398
  'ext.param1': 'loremipsum',
392
399
  'ext.param2': 'dolorsitamet',
400
+ cat: [],
401
+ contentData: [],
402
+ isStorageAllowed: true,
403
+ pagecat: [],
404
+ userData: []
393
405
  }
394
406
  });
395
407
  });
@@ -463,7 +475,7 @@ describe('ShinezRtbBidAdapter', function () {
463
475
  });
464
476
 
465
477
  it('should get meta from response metaData', function () {
466
- const serverResponse = utils.deepClone(SERVER_RESPONSE);
478
+ const serverResponse = deepClone(SERVER_RESPONSE);
467
479
  serverResponse.body.results[0].metaData = {
468
480
  advertiserDomains: ['sweetgum.io'],
469
481
  agencyName: 'Agency Name',
@@ -496,7 +508,7 @@ describe('ShinezRtbBidAdapter', function () {
496
508
  });
497
509
 
498
510
  it('should take default TTL', function () {
499
- const serverResponse = utils.deepClone(SERVER_RESPONSE);
511
+ const serverResponse = deepClone(SERVER_RESPONSE);
500
512
  delete serverResponse.body.results[0].exp;
501
513
  const responses = adapter.interpretResponse(serverResponse, REQUEST);
502
514
  expect(responses).to.have.length(1);
@@ -507,7 +519,7 @@ describe('ShinezRtbBidAdapter', function () {
507
519
  describe('user id system', function () {
508
520
  TEST_ID_SYSTEMS.forEach((idSystemProvider) => {
509
521
  const id = Date.now().toString();
510
- const bid = utils.deepClone(BID);
522
+ const bid = deepClone(BID);
511
523
 
512
524
  const userId = (function () {
513
525
  switch (idSystemProvider) {
@@ -565,13 +577,13 @@ describe('ShinezRtbBidAdapter', function () {
565
577
  const key = 'myKey';
566
578
  let uniqueDealId;
567
579
  beforeEach(() => {
568
- uniqueDealId = getUniqueDealId(key, 0);
580
+ uniqueDealId = getUniqueDealId(storage, key, 0);
569
581
  })
570
582
 
571
583
  it('should get current unique deal id', function (done) {
572
584
  // waiting some time so `now` will become past
573
585
  setTimeout(() => {
574
- const current = getUniqueDealId(key);
586
+ const current = getUniqueDealId(storage, key);
575
587
  expect(current).to.be.equal(uniqueDealId);
576
588
  done();
577
589
  }, 200);
@@ -579,7 +591,7 @@ describe('ShinezRtbBidAdapter', function () {
579
591
 
580
592
  it('should get new unique deal id on expiration', function (done) {
581
593
  setTimeout(() => {
582
- const current = getUniqueDealId(key, 100);
594
+ const current = getUniqueDealId(storage, key, 100);
583
595
  expect(current).to.not.be.equal(uniqueDealId);
584
596
  done();
585
597
  }, 200)
@@ -603,8 +615,8 @@ describe('ShinezRtbBidAdapter', function () {
603
615
  shouldAdvanceTime: true,
604
616
  now
605
617
  });
606
- setStorageItem('myKey', 2020);
607
- const {value, created} = getStorageItem('myKey');
618
+ setStorageItem(storage, 'myKey', 2020);
619
+ const {value, created} = getStorageItem(storage, 'myKey');
608
620
  expect(created).to.be.equal(now);
609
621
  expect(value).to.be.equal(2020);
610
622
  expect(typeof value).to.be.equal('number');
@@ -615,7 +627,7 @@ describe('ShinezRtbBidAdapter', function () {
615
627
  it('should get external stored value', function () {
616
628
  const value = 'superman'
617
629
  window.localStorage.setItem('myExternalKey', value);
618
- const item = getStorageItem('myExternalKey');
630
+ const item = getStorageItem(storage, 'myExternalKey');
619
631
  expect(item).to.be.equal(value);
620
632
  });
621
633
 
@@ -2,6 +2,14 @@ import {expect} from 'chai';
2
2
  import {
3
3
  spec as adapter,
4
4
  createDomain,
5
+ storage
6
+ } from 'modules/tagorasBidAdapter';
7
+ import * as utils from 'src/utils.js';
8
+ import {version} from 'package.json';
9
+ import {useFakeTimers} from 'sinon';
10
+ import {BANNER, VIDEO} from '../../../src/mediaTypes';
11
+ import {config} from '../../../src/config';
12
+ import {
5
13
  hashCode,
6
14
  extractPID,
7
15
  extractCID,
@@ -10,12 +18,7 @@ import {
10
18
  setStorageItem,
11
19
  tryParseJSON,
12
20
  getUniqueDealId,
13
- } from 'modules/tagorasBidAdapter';
14
- import * as utils from 'src/utils.js';
15
- import {version} from 'package.json';
16
- import {useFakeTimers} from 'sinon';
17
- import {BANNER, VIDEO} from '../../../src/mediaTypes';
18
- import {config} from '../../../src/config';
21
+ } from '../../../libraries/vidazooUtils/bidderUtils.js';
19
22
 
20
23
  export const TEST_ID_SYSTEMS = ['britepoolid', 'criteoId', 'id5id', 'idl_env', 'lipb', 'netId', 'parrableId', 'pubcid', 'tdid', 'pubProvidedId'];
21
24
 
@@ -324,7 +327,12 @@ describe('TagorasBidAdapter', function () {
324
327
  startdelay: 0
325
328
  }
326
329
  },
327
- gpid: ''
330
+ gpid: '',
331
+ cat: [],
332
+ contentData: [],
333
+ isStorageAllowed: true,
334
+ pagecat: [],
335
+ userData: []
328
336
  }
329
337
  });
330
338
  });
@@ -385,6 +393,11 @@ describe('TagorasBidAdapter', function () {
385
393
  uqs: getTopWindowQueryParams(),
386
394
  'ext.param1': 'loremipsum',
387
395
  'ext.param2': 'dolorsitamet',
396
+ cat: [],
397
+ contentData: [],
398
+ isStorageAllowed: true,
399
+ pagecat: [],
400
+ userData: []
388
401
  }
389
402
  });
390
403
  });
@@ -527,8 +540,6 @@ describe('TagorasBidAdapter', function () {
527
540
  switch (idSystemProvider) {
528
541
  case 'lipb':
529
542
  return {lipbid: id};
530
- case 'parrableId':
531
- return {eid: id};
532
543
  case 'id5id':
533
544
  return {uid: id};
534
545
  default:
@@ -581,13 +592,13 @@ describe('TagorasBidAdapter', function () {
581
592
  const key = 'myKey';
582
593
  let uniqueDealId;
583
594
  beforeEach(() => {
584
- uniqueDealId = getUniqueDealId(key, 0);
595
+ uniqueDealId = getUniqueDealId(storage, key, 0);
585
596
  })
586
597
 
587
598
  it('should get current unique deal id', function (done) {
588
599
  // waiting some time so `now` will become past
589
600
  setTimeout(() => {
590
- const current = getUniqueDealId(key);
601
+ const current = getUniqueDealId(storage, key);
591
602
  expect(current).to.be.equal(uniqueDealId);
592
603
  done();
593
604
  }, 200);
@@ -595,7 +606,7 @@ describe('TagorasBidAdapter', function () {
595
606
 
596
607
  it('should get new unique deal id on expiration', function (done) {
597
608
  setTimeout(() => {
598
- const current = getUniqueDealId(key, 100);
609
+ const current = getUniqueDealId(storage, key, 100);
599
610
  expect(current).to.not.be.equal(uniqueDealId);
600
611
  done();
601
612
  }, 200)
@@ -619,8 +630,8 @@ describe('TagorasBidAdapter', function () {
619
630
  shouldAdvanceTime: true,
620
631
  now
621
632
  });
622
- setStorageItem('myKey', 2020);
623
- const {value, created} = getStorageItem('myKey');
633
+ setStorageItem(storage, 'myKey', 2020);
634
+ const {value, created} = getStorageItem(storage, 'myKey');
624
635
  expect(created).to.be.equal(now);
625
636
  expect(value).to.be.equal(2020);
626
637
  expect(typeof value).to.be.equal('number');
@@ -631,7 +642,7 @@ describe('TagorasBidAdapter', function () {
631
642
  it('should get external stored value', function () {
632
643
  const value = 'superman'
633
644
  window.localStorage.setItem('myExternalKey', value);
634
- const item = getStorageItem('myExternalKey');
645
+ const item = getStorageItem(storage, 'myExternalKey');
635
646
  expect(item).to.be.equal(value);
636
647
  });
637
648
 
@@ -2,12 +2,7 @@ import {expect} from 'chai';
2
2
  import {
3
3
  spec as adapter,
4
4
  createDomain,
5
- hashCode,
6
- getStorageItem,
7
- setStorageItem,
8
- tryParseJSON,
9
- getUniqueDealId,
10
- webSessionId
5
+ storage
11
6
  } from 'modules/twistDigitalBidAdapter.js';
12
7
  import * as utils from 'src/utils.js';
13
8
  import {version} from 'package.json';
@@ -18,7 +13,12 @@ import {deepSetValue} from 'src/utils.js';
18
13
  import {
19
14
  extractPID,
20
15
  extractCID,
21
- extractSubDomain
16
+ extractSubDomain,
17
+ hashCode,
18
+ getStorageItem,
19
+ setStorageItem,
20
+ tryParseJSON,
21
+ getUniqueDealId
22
22
  } from '../../../libraries/vidazooUtils/bidderUtils.js';
23
23
 
24
24
  export const TEST_ID_SYSTEMS = ['britepoolid', 'criteoId', 'id5id', 'idl_env', 'lipb', 'netId', 'parrableId', 'pubcid', 'tdid', 'pubProvidedId'];
@@ -357,7 +357,6 @@ describe('TwistDigitalBidAdapter', function () {
357
357
  uniqueDealId: `${hashUrl}_${Date.now().toString()}`,
358
358
  uqs: getTopWindowQueryParams(),
359
359
  isStorageAllowed: true,
360
- webSessionId: webSessionId,
361
360
  mediaTypes: {
362
361
  video: {
363
362
  api: [2],
@@ -455,8 +454,7 @@ describe('TwistDigitalBidAdapter', function () {
455
454
  name: 'example.com',
456
455
  segment: [{id: '243'}],
457
456
  },
458
- ],
459
- webSessionId: webSessionId
457
+ ]
460
458
  }
461
459
  });
462
460
  });
@@ -542,8 +540,7 @@ describe('TwistDigitalBidAdapter', function () {
542
540
  name: 'example.com',
543
541
  segment: [{id: '243'}],
544
542
  },
545
- ],
546
- webSessionId: webSessionId
543
+ ]
547
544
  };
548
545
 
549
546
  const REQUEST_DATA2 = utils.deepClone(REQUEST_DATA);
@@ -740,8 +737,6 @@ describe('TwistDigitalBidAdapter', function () {
740
737
  switch (idSystemProvider) {
741
738
  case 'lipb':
742
739
  return {lipbid: id};
743
- case 'parrableId':
744
- return {eid: id};
745
740
  case 'id5id':
746
741
  return {uid: id};
747
742
  default:
@@ -807,13 +802,13 @@ describe('TwistDigitalBidAdapter', function () {
807
802
  const key = 'myKey';
808
803
  let uniqueDealId;
809
804
  beforeEach(() => {
810
- uniqueDealId = getUniqueDealId(key, 0);
805
+ uniqueDealId = getUniqueDealId(storage, key, 0);
811
806
  })
812
807
 
813
808
  it('should get current unique deal id', function (done) {
814
809
  // waiting some time so `now` will become past
815
810
  setTimeout(() => {
816
- const current = getUniqueDealId(key);
811
+ const current = getUniqueDealId(storage, key);
817
812
  expect(current).to.be.equal(uniqueDealId);
818
813
  done();
819
814
  }, 200);
@@ -821,7 +816,7 @@ describe('TwistDigitalBidAdapter', function () {
821
816
 
822
817
  it('should get new unique deal id on expiration', function (done) {
823
818
  setTimeout(() => {
824
- const current = getUniqueDealId(key, 100);
819
+ const current = getUniqueDealId(storage, key, 100);
825
820
  expect(current).to.not.be.equal(uniqueDealId);
826
821
  done();
827
822
  }, 200)
@@ -845,8 +840,8 @@ describe('TwistDigitalBidAdapter', function () {
845
840
  shouldAdvanceTime: true,
846
841
  now
847
842
  });
848
- setStorageItem('myKey', 2020);
849
- const {value, created} = getStorageItem('myKey');
843
+ setStorageItem(storage, 'myKey', 2020);
844
+ const {value, created} = getStorageItem(storage, 'myKey');
850
845
  expect(created).to.be.equal(now);
851
846
  expect(value).to.be.equal(2020);
852
847
  expect(typeof value).to.be.equal('number');
@@ -857,7 +852,7 @@ describe('TwistDigitalBidAdapter', function () {
857
852
  it('should get external stored value', function () {
858
853
  const value = 'superman'
859
854
  window.localStorage.setItem('myExternalKey', value);
860
- const item = getStorageItem('myExternalKey');
855
+ const item = getStorageItem(storage, 'myExternalKey');
861
856
  expect(item).to.be.equal(value);
862
857
  });
863
858
 
@@ -1,8 +1,9 @@
1
- import { spec, converter } from 'modules/viantOrtbBidAdapter.js';
1
+ import {spec, converter} from 'modules/viantOrtbBidAdapter.js';
2
2
  import {assert, expect} from 'chai';
3
- import { deepClone } from '../../../src/utils';
3
+ import {deepClone} from '../../../src/utils';
4
4
  import {buildWindowTree} from '../../helpers/refererDetectionHelper';
5
5
  import {detectReferer} from '../../../src/refererDetection';
6
+
6
7
  describe('viantOrtbBidAdapter', function () {
7
8
  function testBuildRequests(bidRequests, bidderRequestBase) {
8
9
  let clonedBidderRequest = deepClone(bidderRequestBase);
@@ -10,7 +11,8 @@ describe('viantOrtbBidAdapter', function () {
10
11
  let requests = spec.buildRequests(bidRequests, clonedBidderRequest);
11
12
  return requests
12
13
  }
13
- describe('isBidRequestValid', function() {
14
+
15
+ describe('isBidRequestValid', function () {
14
16
  function makeBid() {
15
17
  return {
16
18
  'bidder': 'viant',
@@ -46,9 +48,7 @@ describe('viantOrtbBidAdapter', function () {
46
48
  it('should return true if placementId is not passed ', function () {
47
49
  let bid = makeBid();
48
50
  delete bid.params.placementId;
49
- bid.ortb2Imp = {
50
-
51
- }
51
+ bid.ortb2Imp = {}
52
52
  expect(spec.isBidRequestValid(bid)).to.equal(true);
53
53
  });
54
54
 
@@ -98,6 +98,7 @@ describe('viantOrtbBidAdapter', function () {
98
98
  'transactionId': '4008d88a-8137-410b-aa35-fbfdabcb478e'
99
99
  }
100
100
  }
101
+
101
102
  it('should return true when required params found', function () {
102
103
  expect(spec.isBidRequestValid(makeBid())).to.equal(true);
103
104
  });
@@ -141,6 +142,7 @@ describe('viantOrtbBidAdapter', function () {
141
142
  'transactionId': '4008d88a-8137-410b-aa35-fbfdabcb478e'
142
143
  }
143
144
  }
145
+
144
146
  it('should return true when required params found', function () {
145
147
  expect(spec.isBidRequestValid(makeBid())).to.equal(true);
146
148
  });
@@ -180,6 +182,57 @@ describe('viantOrtbBidAdapter', function () {
180
182
  'src': 'client',
181
183
  'bidRequestsCount': 1
182
184
  }];
185
+ const basePMPDealsBidRequests = [{
186
+ 'bidder': 'viant',
187
+ 'params': {
188
+ 'publisherId': '464',
189
+ 'placementId': '1'
190
+ },
191
+ 'ortb2Imp': {
192
+ 'pmp': {
193
+ 'private_auction': 0,
194
+ 'deals': [
195
+ {
196
+ 'id': '1234567',
197
+ 'at': 3,
198
+ 'bidfloor': 25,
199
+ 'bidfloorcur': 'USD',
200
+ 'ext': {
201
+ 'must_bid': 1,
202
+ 'private_auction': 1
203
+ }
204
+ },
205
+ {
206
+ 'id': '1234568',
207
+ 'at': 3,
208
+ 'bidfloor': 25,
209
+ 'bidfloorcur': 'USD',
210
+ 'ext': {
211
+ 'must_bid': 0
212
+ }
213
+ }
214
+ ]
215
+ },
216
+ },
217
+ 'mediaTypes': {
218
+ 'banner': {
219
+ 'sizes': [[728, 90]]
220
+ }
221
+ },
222
+ 'gdprConsent': {
223
+ 'consentString': 'consentString',
224
+ 'gdprApplies': true,
225
+ },
226
+ 'uspConsent': '1YYY',
227
+ 'sizes': [[728, 90]],
228
+ 'transactionId': '1111474f-58b1-4368-b812-84f8c937a099',
229
+ 'adUnitCode': 'div-gpt-ad-1460505748561-0',
230
+ 'bidId': '243310435309b5',
231
+ 'bidderRequestId': '18084284054531',
232
+ 'auctionId': 'e7b34fa3-8654-424e-8c49-03e509e53d8c',
233
+ 'src': 'client',
234
+ 'bidRequestsCount': 1
235
+ }];
183
236
 
184
237
  const testWindow = buildWindowTree(['https://www.example.com/test', 'https://www.example.com/other/page', 'https://www.example.com/third/page'], 'https://othersite.com/', 'https://example.com/canonical/page');
185
238
  const baseBidderRequestReferer = detectReferer(testWindow)();
@@ -236,6 +289,34 @@ describe('viantOrtbBidAdapter', function () {
236
289
  const requestBody = testBuildRequests(clonedBannerRequests, baseBidderRequest)[0].data;
237
290
  expect(requestBody.imp[0].banner.pos).to.equal(1);
238
291
  });
292
+ it('includes the deals in the bid request', function () {
293
+ const requestBody = testBuildRequests(basePMPDealsBidRequests, baseBidderRequest)[0].data;
294
+ expect(requestBody.imp[0].pmp).to.be.not.null;
295
+ expect(requestBody.imp[0].pmp).to.deep.equal({
296
+ 'private_auction': 0,
297
+ 'deals': [
298
+ {
299
+ 'id': '1234567',
300
+ 'at': 3,
301
+ 'bidfloor': 25,
302
+ 'bidfloorcur': 'USD',
303
+ 'ext': {
304
+ 'must_bid': 1,
305
+ 'private_auction': 1
306
+ }
307
+ },
308
+ {
309
+ 'id': '1234568',
310
+ 'at': 3,
311
+ 'bidfloor': 25,
312
+ 'bidfloorcur': 'USD',
313
+ 'ext': {
314
+ 'must_bid': 0
315
+ }
316
+ }
317
+ ]
318
+ });
319
+ });
239
320
  });
240
321
 
241
322
  if (FEATURES.VIDEO) {