prebid.js 9.2.0 → 9.4.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 (279) 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/adnuntiusBidAdapter.js +1 -1
  16. package/dist/adqueryBidAdapter.js +1 -1
  17. package/dist/adrelevantisBidAdapter.js +1 -1
  18. package/dist/adstirBidAdapter.js +1 -1
  19. package/dist/adtrgtmeBidAdapter.js +1 -1
  20. package/dist/adxcgAnalyticsAdapter.js +1 -1
  21. package/dist/adxcgBidAdapter.js +1 -1
  22. package/dist/adyoulikeBidAdapter.js +1 -1
  23. package/dist/agmaAnalyticsAdapter.js +1 -1
  24. package/dist/ajaBidAdapter.js +1 -1
  25. package/dist/amxBidAdapter.js +1 -1
  26. package/dist/amxIdSystem.js +1 -1
  27. package/dist/appierAnalyticsAdapter.js +1 -1
  28. package/dist/appnexusBidAdapter.js +1 -1
  29. package/dist/asoBidAdapter.js +1 -1
  30. package/dist/axonixBidAdapter.js +1 -1
  31. package/dist/bidglassBidAdapter.js +1 -1
  32. package/dist/big-richmediaBidAdapter.js +1 -1
  33. package/dist/bridBidAdapter.js +1 -1
  34. package/dist/bridgewellBidAdapter.js +1 -1
  35. package/dist/brightMountainMediaBidAdapter.js +1 -1
  36. package/dist/carodaBidAdapter.js +1 -1
  37. package/dist/chtnwBidAdapter.js +1 -1
  38. package/dist/chunk-core.js +1 -1
  39. package/dist/codefuelBidAdapter.js +1 -1
  40. package/dist/concertBidAdapter.js +1 -1
  41. package/dist/connectadBidAdapter.js +1 -1
  42. package/dist/consentManagement.js +1 -0
  43. package/dist/consentManagementGpp.js +1 -1
  44. package/dist/consentManagementTcf.js +1 -1
  45. package/dist/consumableBidAdapter.js +1 -1
  46. package/dist/conversantAnalyticsAdapter.js +1 -1
  47. package/dist/conversantBidAdapter.js +1 -1
  48. package/dist/copper6sspBidAdapter.js +1 -0
  49. package/dist/cpmstarBidAdapter.js +1 -1
  50. package/dist/craftBidAdapter.js +1 -1
  51. package/dist/criteoBidAdapter.js +1 -1
  52. package/dist/cwireBidAdapter.js +1 -1
  53. package/dist/dailymotionBidAdapter.js +1 -1
  54. package/dist/deltaprojectsBidAdapter.js +1 -1
  55. package/dist/dependencies.json +51 -13
  56. package/dist/dianomiBidAdapter.js +1 -1
  57. package/dist/dspxBidAdapter.js +1 -1
  58. package/dist/dxkultureBidAdapter.js +1 -1
  59. package/dist/eplanningBidAdapter.js +1 -1
  60. package/dist/euidIdSystem.js +1 -1
  61. package/dist/exadsBidAdapter.js +1 -1
  62. package/dist/feedadBidAdapter.js +1 -1
  63. package/dist/finativeBidAdapter.js +1 -1
  64. package/dist/freewheel-sspBidAdapter.js +1 -1
  65. package/dist/gmosspBidAdapter.js +1 -1
  66. package/dist/goldbachBidAdapter.js +1 -1
  67. package/dist/greenbidsAnalyticsAdapter.js +1 -1
  68. package/dist/greenbidsRtdProvider.js +1 -1
  69. package/dist/gridBidAdapter.js +1 -1
  70. package/dist/gumgumBidAdapter.js +1 -1
  71. package/dist/h12mediaBidAdapter.js +1 -1
  72. package/dist/hypelabBidAdapter.js +1 -1
  73. package/dist/id5AnalyticsAdapter.js +1 -1
  74. package/dist/id5IdSystem.js +1 -1
  75. package/dist/illuminBidAdapter.js +1 -1
  76. package/dist/imdsBidAdapter.js +1 -1
  77. package/dist/improvedigitalBidAdapter.js +1 -1
  78. package/dist/insticatorBidAdapter.js +1 -1
  79. package/dist/intentIqIdSystem.js +1 -1
  80. package/dist/ixBidAdapter.js +1 -1
  81. package/dist/jixieBidAdapter.js +1 -1
  82. package/dist/justpremiumBidAdapter.js +1 -1
  83. package/dist/kargoBidAdapter.js +1 -1
  84. package/dist/kimberliteBidAdapter.js +1 -1
  85. package/dist/konduitAnalyticsAdapter.js +1 -1
  86. package/dist/kueezBidAdapter.js +1 -1
  87. package/dist/kueezRtbBidAdapter.js +1 -1
  88. package/dist/lassoBidAdapter.js +1 -1
  89. package/dist/lifestreetBidAdapter.js +1 -1
  90. package/dist/liveIntentIdSystem.js +1 -1
  91. package/dist/logicadBidAdapter.js +1 -1
  92. package/dist/loglyliftBidAdapter.js +1 -1
  93. package/dist/luceadBidAdapter.js +1 -1
  94. package/dist/luponmediaBidAdapter.js +1 -1
  95. package/dist/mabidderBidAdapter.js +1 -1
  96. package/dist/magniteAnalyticsAdapter.js +1 -1
  97. package/dist/malltvAnalyticsAdapter.js +1 -1
  98. package/dist/marsmediaBidAdapter.js +1 -1
  99. package/dist/mediafuseBidAdapter.js +1 -1
  100. package/dist/medianetAnalyticsAdapter.js +1 -1
  101. package/dist/medianetBidAdapter.js +1 -1
  102. package/dist/mediasquareBidAdapter.js +1 -1
  103. package/dist/mgidBidAdapter.js +1 -1
  104. package/dist/minutemediaBidAdapter.js +1 -1
  105. package/dist/missenaBidAdapter.js +1 -1
  106. package/dist/nexx360BidAdapter.js +1 -1
  107. package/dist/nobidAnalyticsAdapter.js +1 -1
  108. package/dist/nobidBidAdapter.js +1 -1
  109. package/dist/not-for-prod/prebid.js +184 -178
  110. package/dist/oguryBidAdapter.js +1 -1
  111. package/dist/onetagBidAdapter.js +1 -1
  112. package/dist/ooloAnalyticsAdapter.js +1 -1
  113. package/dist/openwebBidAdapter.js +1 -1
  114. package/dist/openxBidAdapter.js +1 -1
  115. package/dist/optidigitalBidAdapter.js +1 -1
  116. package/dist/orakiBidAdapter.js +1 -0
  117. package/dist/orbidderBidAdapter.js +1 -1
  118. package/dist/outbrainBidAdapter.js +1 -1
  119. package/dist/ozoneBidAdapter.js +1 -1
  120. package/dist/pairIdSystem.js +1 -1
  121. package/dist/pixfutureBidAdapter.js +1 -1
  122. package/dist/prebidServerBidAdapter.js +1 -1
  123. package/dist/processResponse.js +1 -0
  124. package/dist/publinkIdSystem.js +1 -1
  125. package/dist/publirBidAdapter.js +1 -1
  126. package/dist/pubmaticAnalyticsAdapter.js +1 -1
  127. package/dist/pubmaticBidAdapter.js +1 -1
  128. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  129. package/dist/pxyzBidAdapter.js +1 -1
  130. package/dist/quantcastBidAdapter.js +1 -1
  131. package/dist/readpeakBidAdapter.js +1 -1
  132. package/dist/relaidoBidAdapter.js +1 -1
  133. package/dist/retailspotBidAdapter.js +1 -1
  134. package/dist/rhythmoneBidAdapter.js +1 -1
  135. package/dist/riseBidAdapter.js +1 -1
  136. package/dist/rubiconBidAdapter.js +1 -1
  137. package/dist/seedingAllianceBidAdapter.js +1 -1
  138. package/dist/seedtagBidAdapter.js +1 -1
  139. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  140. package/dist/sharethroughBidAdapter.js +1 -1
  141. package/dist/shinezBidAdapter.js +1 -1
  142. package/dist/shinezRtbBidAdapter.js +1 -1
  143. package/dist/smaatoBidAdapter.js +1 -1
  144. package/dist/smartadserverBidAdapter.js +1 -1
  145. package/dist/smartxBidAdapter.js +1 -1
  146. package/dist/smartyadsBidAdapter.js +1 -1
  147. package/dist/smartyadsUtils.js +1 -0
  148. package/dist/smilewantedBidAdapter.js +1 -1
  149. package/dist/snigelBidAdapter.js +1 -1
  150. package/dist/sonobiBidAdapter.js +1 -1
  151. package/dist/sovrnBidAdapter.js +1 -1
  152. package/dist/sspBCBidAdapter.js +1 -1
  153. package/dist/stnBidAdapter.js +1 -1
  154. package/dist/stvBidAdapter.js +1 -1
  155. package/dist/sublimeBidAdapter.js +1 -1
  156. package/dist/taboolaBidAdapter.js +1 -1
  157. package/dist/tagorasBidAdapter.js +1 -1
  158. package/dist/tappxBidAdapter.js +1 -1
  159. package/dist/targetVideoBidAdapter.js +1 -1
  160. package/dist/teadsBidAdapter.js +1 -1
  161. package/dist/terceptAnalyticsAdapter.js +1 -1
  162. package/dist/themoneytizerBidAdapter.js +1 -1
  163. package/dist/trionBidAdapter.js +1 -1
  164. package/dist/tripleliftBidAdapter.js +1 -1
  165. package/dist/ttdBidAdapter.js +1 -1
  166. package/dist/twistDigitalBidAdapter.js +1 -1
  167. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  168. package/dist/uid2IdSystem.js +1 -1
  169. package/dist/underdogmediaBidAdapter.js +1 -1
  170. package/dist/undertoneBidAdapter.js +1 -1
  171. package/dist/unrulyBidAdapter.js +1 -1
  172. package/dist/userId.js +1 -1
  173. package/dist/viantOrtbBidAdapter.js +1 -1
  174. package/dist/vidazooBidAdapter.js +1 -1
  175. package/dist/vidazooUtils.js +1 -0
  176. package/dist/videobyteBidAdapter.js +1 -1
  177. package/dist/visxBidAdapter.js +1 -1
  178. package/dist/vuukleBidAdapter.js +1 -1
  179. package/dist/widespaceBidAdapter.js +1 -1
  180. package/dist/winrBidAdapter.js +1 -1
  181. package/dist/yahooAdsBidAdapter.js +1 -1
  182. package/dist/yieldmoBidAdapter.js +1 -1
  183. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  184. package/dist/yuktamediaAnalyticsAdapter.js +1 -1
  185. package/dist/zeta_global_sspBidAdapter.js +1 -1
  186. package/integrationExamples/gpt/x-domain/creative.html +1 -1
  187. package/libraries/consentManagement/cmUtils.js +38 -0
  188. package/libraries/processResponse/index.js +12 -0
  189. package/libraries/smartyadsUtils/getAdUrlByRegion.js +32 -0
  190. package/libraries/vidazooUtils/bidderUtils.js +480 -0
  191. package/libraries/vidazooUtils/constants.js +7 -0
  192. package/modules/adagioRtdProvider.js +9 -7
  193. package/modules/addefendBidAdapter.js +1 -2
  194. package/modules/adfBidAdapter.js +1 -10
  195. package/modules/adlooxRtdProvider.js +1 -1
  196. package/modules/adnuntiusBidAdapter.js +1 -0
  197. package/modules/adxcgAnalyticsAdapter.js +1 -2
  198. package/modules/carodaBidAdapter.js +3 -8
  199. package/modules/codefuelBidAdapter.js +1 -10
  200. package/modules/consentManagementGpp.js +2 -38
  201. package/modules/consentManagementTcf.js +7 -38
  202. package/modules/conversantAnalyticsAdapter.js +1 -2
  203. package/modules/copper6sspBidAdapter.js +19 -0
  204. package/modules/copper6sspBidAdapter.md +79 -0
  205. package/modules/cpmstarBidAdapter.js +52 -36
  206. package/modules/cpmstarBidAdapter.md +1 -4
  207. package/modules/criteoBidAdapter.js +10 -3
  208. package/modules/dailymotionBidAdapter.js +1 -1
  209. package/modules/deltaprojectsBidAdapter.js +2 -11
  210. package/modules/dianomiBidAdapter.js +1 -9
  211. package/modules/finativeBidAdapter.js +1 -10
  212. package/modules/gridBidAdapter.js +2 -12
  213. package/modules/id5AnalyticsAdapter.js +1 -2
  214. package/modules/illuminBidAdapter.js +9 -304
  215. package/modules/intentIqIdSystem.js +408 -50
  216. package/modules/intentIqIdSystem.md +92 -0
  217. package/modules/kueezRtbBidAdapter.js +17 -312
  218. package/modules/liveIntentIdSystem.js +2 -2
  219. package/modules/luponmediaBidAdapter.js +4 -10
  220. package/modules/mabidderBidAdapter.js +1 -2
  221. package/modules/medianetAnalyticsAdapter.js +1 -2
  222. package/modules/medianetBidAdapter.js +1 -1
  223. package/modules/mgidBidAdapter.js +1 -10
  224. package/modules/orakiBidAdapter.js +19 -0
  225. package/modules/orakiBidAdapter.md +79 -0
  226. package/modules/orbidderBidAdapter.js +4 -2
  227. package/modules/outbrainBidAdapter.js +8 -43
  228. package/modules/ozoneBidAdapter.js +9 -7
  229. package/modules/pairIdSystem.js +27 -10
  230. package/modules/pixfutureBidAdapter.js +1 -2
  231. package/modules/prebidServerBidAdapter/index.js +1 -1
  232. package/modules/seedtagBidAdapter.js +4 -0
  233. package/modules/shinezRtbBidAdapter.js +12 -304
  234. package/modules/smartadserverBidAdapter.js +3 -0
  235. package/modules/smartyadsBidAdapter.js +6 -110
  236. package/modules/snigelBidAdapter.js +1 -2
  237. package/modules/tagorasBidAdapter.js +13 -316
  238. package/modules/tappxBidAdapter.js +1 -2
  239. package/modules/terceptAnalyticsAdapter.js +1 -2
  240. package/modules/twistDigitalBidAdapter.js +9 -433
  241. package/modules/userId/index.js +31 -21
  242. package/modules/viantOrtbBidAdapter.js +20 -0
  243. package/modules/vidazooBidAdapter.js +26 -468
  244. package/modules/visxBidAdapter.js +27 -29
  245. package/modules/yahooAdsBidAdapter.js +4 -1
  246. package/modules/yuktamediaAnalyticsAdapter.js +1 -2
  247. package/modules/zeta_global_sspBidAdapter.js +2 -2
  248. package/package.json +1 -1
  249. package/src/adRendering.js +25 -2
  250. package/src/constants.js +2 -0
  251. package/src/prebid.js +2 -1
  252. package/src/utils.js +19 -1
  253. package/test/spec/creative/crossDomainCreative_spec.js +38 -2
  254. package/test/spec/fpd/gdpr_spec.js +24 -2
  255. package/test/spec/libraries/processResponse_spec.js +60 -0
  256. package/test/spec/modules/adagioRtdProvider_spec.js +12 -0
  257. package/test/spec/modules/adnuntiusBidAdapter_spec.js +6 -3
  258. package/test/spec/modules/conversantAnalyticsAdapter_spec.js +1 -1
  259. package/test/spec/modules/copper6sspBidAdapter_spec.js +514 -0
  260. package/test/spec/modules/cpmstarBidAdapter_spec.js +1 -1
  261. package/test/spec/modules/dailymotionBidAdapter_spec.js +18 -14
  262. package/test/spec/modules/illuminBidAdapter_spec.js +26 -13
  263. package/test/spec/modules/intentIqIdSystem_spec.js +264 -36
  264. package/test/spec/modules/kueezRtbBidAdapter_spec.js +26 -15
  265. package/test/spec/modules/orakiBidAdapter_spec.js +510 -0
  266. package/test/spec/modules/outbrainBidAdapter_spec.js +32 -1
  267. package/test/spec/modules/seedtagBidAdapter_spec.js +27 -0
  268. package/test/spec/modules/shinezRtbBidAdapter_spec.js +26 -14
  269. package/test/spec/modules/smartadserverBidAdapter_spec.js +7 -0
  270. package/test/spec/modules/smartyadsBidAdapter_spec.js +6 -83
  271. package/test/spec/modules/tagorasBidAdapter_spec.js +26 -15
  272. package/test/spec/modules/twistDigitalBidAdapter_spec.js +19 -22
  273. package/test/spec/modules/userId_spec.js +86 -47
  274. package/test/spec/modules/viantOrtbBidAdapter_spec.js +87 -6
  275. package/test/spec/modules/vidazooBidAdapter_spec.js +21 -23
  276. package/test/spec/modules/visxBidAdapter_spec.js +180 -0
  277. package/test/spec/modules/yahooAdsBidAdapter_spec.js +1 -1
  278. package/test/spec/modules/zeta_global_sspBidAdapter_spec.js +11 -0
  279. package/test/spec/unit/pbjs_api_spec.js +6 -1
@@ -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
 
@@ -458,6 +458,13 @@ describe('Smart bid adapter tests', function () {
458
458
  expect(syncs).to.have.lengthOf(0);
459
459
  });
460
460
 
461
+ it('should set browsingTopics=false in request.options', () => {
462
+ const requests = spec.buildRequests(DEFAULT_PARAMS_WO_OPTIONAL);
463
+ expect(requests[0]).to.have.property('options').and.to.deep.equal({
464
+ browsingTopics: false
465
+ });
466
+ });
467
+
461
468
  describe('gdpr tests', function () {
462
469
  afterEach(function () {
463
470
  config.setConfig({ ortb2: undefined });
@@ -61,12 +61,10 @@ describe('SmartyadsAdapter', function () {
61
61
  it('Returns valid data if array of bids is valid', function () {
62
62
  let data = serverRequest.data;
63
63
  expect(data).to.be.an('object');
64
- expect(data).to.have.all.keys('deviceWidth', 'deviceHeight', 'language', 'secure', 'host', 'page', 'placements', 'coppa', 'eeid', 'ifa');
64
+ expect(data).to.have.all.keys('deviceWidth', 'deviceHeight', 'host', 'page', 'placements', 'coppa', 'eeid', 'ifa');
65
65
  expect(data.deviceWidth).to.be.a('number');
66
66
  expect(data.deviceHeight).to.be.a('number');
67
67
  expect(data.coppa).to.be.a('number');
68
- expect(data.language).to.be.a('string');
69
- expect(data.secure).to.be.within(0, 1);
70
68
  expect(data.host).to.be.a('string');
71
69
  expect(data.page).to.be.a('string');
72
70
  let placement = data['placements'][0];
@@ -126,8 +124,8 @@ describe('SmartyadsAdapter', function () {
126
124
  expect(dataItem.width).to.equal(300);
127
125
  expect(dataItem.height).to.equal(250);
128
126
  expect(dataItem.ad).to.equal('Test');
129
- expect(dataItem.meta).to.have.property('advertiserDomains')
130
- expect(dataItem.meta.advertiserDomains).to.deep.equal(['example.com']);
127
+ expect(dataItem.meta).to.have.property('advertiserDomains');
128
+ expect(dataItem.meta.advertiserDomains).to.be.an('array');
131
129
  expect(dataItem.ttl).to.equal(120);
132
130
  expect(dataItem.creativeId).to.equal('2');
133
131
  expect(dataItem.netRevenue).to.be.true;
@@ -152,7 +150,7 @@ describe('SmartyadsAdapter', function () {
152
150
 
153
151
  let dataItem = videoResponses[0];
154
152
  expect(dataItem).to.have.all.keys('requestId', 'cpm', 'vastUrl', 'ttl', 'creativeId',
155
- 'netRevenue', 'currency', 'dealId', 'mediaType');
153
+ 'netRevenue', 'currency', 'dealId', 'mediaType', 'meta');
156
154
  expect(dataItem.requestId).to.equal('23fhj33i987f');
157
155
  expect(dataItem.cpm).to.equal(0.5);
158
156
  expect(dataItem.vastUrl).to.equal('test.com');
@@ -183,7 +181,7 @@ describe('SmartyadsAdapter', function () {
183
181
  expect(nativeResponses).to.be.an('array').that.is.not.empty;
184
182
 
185
183
  let dataItem = nativeResponses[0];
186
- expect(dataItem).to.have.keys('requestId', 'cpm', 'ttl', 'creativeId', 'netRevenue', 'currency', 'mediaType', 'native');
184
+ expect(dataItem).to.have.keys('requestId', 'cpm', 'ttl', 'creativeId', 'netRevenue', 'currency', 'mediaType', 'native', 'meta');
187
185
  expect(dataItem.native).to.have.keys('clickUrl', 'impressionTrackers', 'title', 'image')
188
186
  expect(dataItem.requestId).to.equal('23fhj33i987f');
189
187
  expect(dataItem.cpm).to.equal(0.4);
@@ -263,7 +261,7 @@ describe('SmartyadsAdapter', function () {
263
261
  });
264
262
  });
265
263
  describe('getUserSyncs', function () {
266
- const syncUrl = 'https://as.ck-ie.com/prebidjs?p=7c47322e527cf8bdeb7facc1bb03387a&gdpr=0&gdpr_consent=&type=iframe&us_privacy=&gpp=';
264
+ const syncUrl = 'https://as.ck-ie.com/prebidjs?p=7c47322e527cf8bdeb7facc1bb03387a/iframe?pbjs=1&coppa=0';
267
265
  const syncOptions = {
268
266
  iframeEnabled: true
269
267
  };
@@ -277,79 +275,4 @@ describe('SmartyadsAdapter', function () {
277
275
  ]);
278
276
  });
279
277
  });
280
-
281
- describe('onBidWon', function () {
282
- it('should exists', function () {
283
- expect(spec.onBidWon).to.exist.and.to.be.a('function');
284
- });
285
-
286
- it('should send a valid bid won notice', function () {
287
- const bid = {
288
- 'c': 'o',
289
- 'm': 'prebid',
290
- 'secret_key': 'prebid_js',
291
- 'winTest': '1',
292
- 'postData': [{
293
- 'bidder': 'smartyads',
294
- 'params': [
295
- {'host': 'prebid',
296
- 'accountid': '123',
297
- 'sourceid': '12345'
298
- }]
299
- }]
300
- };
301
- spec.onBidWon(bid);
302
- expect(server.requests.length).to.equal(1);
303
- });
304
- });
305
-
306
- describe('onTimeout', function () {
307
- it('should exists', function () {
308
- expect(spec.onTimeout).to.exist.and.to.be.a('function');
309
- });
310
-
311
- it('should send a valid bid timeout notice', function () {
312
- const bid = {
313
- 'c': 'o',
314
- 'm': 'prebid',
315
- 'secret_key': 'prebid_js',
316
- 'bidTimeout': '1',
317
- 'postData': [{
318
- 'bidder': 'smartyads',
319
- 'params': [
320
- {'host': 'prebid',
321
- 'accountid': '123',
322
- 'sourceid': '12345'
323
- }]
324
- }]
325
- };
326
- spec.onTimeout(bid);
327
- expect(server.requests.length).to.equal(1);
328
- });
329
- });
330
-
331
- describe('onBidderError', function () {
332
- it('should exists', function () {
333
- expect(spec.onBidderError).to.exist.and.to.be.a('function');
334
- });
335
-
336
- it('should send a valid bidder error notice', function () {
337
- const bid = {
338
- 'c': 'o',
339
- 'm': 'prebid',
340
- 'secret_key': 'prebid_js',
341
- 'bidderError': '1',
342
- 'postData': [{
343
- 'bidder': 'smartyads',
344
- 'params': [
345
- {'host': 'prebid',
346
- 'accountid': '123',
347
- 'sourceid': '12345'
348
- }]
349
- }]
350
- };
351
- spec.onBidderError(bid);
352
- expect(server.requests.length).to.equal(1);
353
- });
354
- });
355
278
  });
@@ -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,15 +2,7 @@ import {expect} from 'chai';
2
2
  import {
3
3
  spec as adapter,
4
4
  createDomain,
5
- hashCode,
6
- extractPID,
7
- extractCID,
8
- extractSubDomain,
9
- getStorageItem,
10
- setStorageItem,
11
- tryParseJSON,
12
- getUniqueDealId,
13
- webSessionId
5
+ storage
14
6
  } from 'modules/twistDigitalBidAdapter.js';
15
7
  import * as utils from 'src/utils.js';
16
8
  import {version} from 'package.json';
@@ -18,6 +10,16 @@ import {useFakeTimers} from 'sinon';
18
10
  import {BANNER, VIDEO} from '../../../src/mediaTypes';
19
11
  import {config} from '../../../src/config';
20
12
  import {deepSetValue} from 'src/utils.js';
13
+ import {
14
+ extractPID,
15
+ extractCID,
16
+ extractSubDomain,
17
+ hashCode,
18
+ getStorageItem,
19
+ setStorageItem,
20
+ tryParseJSON,
21
+ getUniqueDealId
22
+ } from '../../../libraries/vidazooUtils/bidderUtils.js';
21
23
 
22
24
  export const TEST_ID_SYSTEMS = ['britepoolid', 'criteoId', 'id5id', 'idl_env', 'lipb', 'netId', 'parrableId', 'pubcid', 'tdid', 'pubProvidedId'];
23
25
 
@@ -355,7 +357,6 @@ describe('TwistDigitalBidAdapter', function () {
355
357
  uniqueDealId: `${hashUrl}_${Date.now().toString()}`,
356
358
  uqs: getTopWindowQueryParams(),
357
359
  isStorageAllowed: true,
358
- webSessionId: webSessionId,
359
360
  mediaTypes: {
360
361
  video: {
361
362
  api: [2],
@@ -453,8 +454,7 @@ describe('TwistDigitalBidAdapter', function () {
453
454
  name: 'example.com',
454
455
  segment: [{id: '243'}],
455
456
  },
456
- ],
457
- webSessionId: webSessionId
457
+ ]
458
458
  }
459
459
  });
460
460
  });
@@ -540,8 +540,7 @@ describe('TwistDigitalBidAdapter', function () {
540
540
  name: 'example.com',
541
541
  segment: [{id: '243'}],
542
542
  },
543
- ],
544
- webSessionId: webSessionId
543
+ ]
545
544
  };
546
545
 
547
546
  const REQUEST_DATA2 = utils.deepClone(REQUEST_DATA);
@@ -738,8 +737,6 @@ describe('TwistDigitalBidAdapter', function () {
738
737
  switch (idSystemProvider) {
739
738
  case 'lipb':
740
739
  return {lipbid: id};
741
- case 'parrableId':
742
- return {eid: id};
743
740
  case 'id5id':
744
741
  return {uid: id};
745
742
  default:
@@ -805,13 +802,13 @@ describe('TwistDigitalBidAdapter', function () {
805
802
  const key = 'myKey';
806
803
  let uniqueDealId;
807
804
  beforeEach(() => {
808
- uniqueDealId = getUniqueDealId(key, 0);
805
+ uniqueDealId = getUniqueDealId(storage, key, 0);
809
806
  })
810
807
 
811
808
  it('should get current unique deal id', function (done) {
812
809
  // waiting some time so `now` will become past
813
810
  setTimeout(() => {
814
- const current = getUniqueDealId(key);
811
+ const current = getUniqueDealId(storage, key);
815
812
  expect(current).to.be.equal(uniqueDealId);
816
813
  done();
817
814
  }, 200);
@@ -819,7 +816,7 @@ describe('TwistDigitalBidAdapter', function () {
819
816
 
820
817
  it('should get new unique deal id on expiration', function (done) {
821
818
  setTimeout(() => {
822
- const current = getUniqueDealId(key, 100);
819
+ const current = getUniqueDealId(storage, key, 100);
823
820
  expect(current).to.not.be.equal(uniqueDealId);
824
821
  done();
825
822
  }, 200)
@@ -843,8 +840,8 @@ describe('TwistDigitalBidAdapter', function () {
843
840
  shouldAdvanceTime: true,
844
841
  now
845
842
  });
846
- setStorageItem('myKey', 2020);
847
- const {value, created} = getStorageItem('myKey');
843
+ setStorageItem(storage, 'myKey', 2020);
844
+ const {value, created} = getStorageItem(storage, 'myKey');
848
845
  expect(created).to.be.equal(now);
849
846
  expect(value).to.be.equal(2020);
850
847
  expect(typeof value).to.be.equal('number');
@@ -855,7 +852,7 @@ describe('TwistDigitalBidAdapter', function () {
855
852
  it('should get external stored value', function () {
856
853
  const value = 'superman'
857
854
  window.localStorage.setItem('myExternalKey', value);
858
- const item = getStorageItem('myExternalKey');
855
+ const item = getStorageItem(storage, 'myExternalKey');
859
856
  expect(item).to.be.equal(value);
860
857
  });
861
858
 
@@ -4,7 +4,7 @@ import {
4
4
  coreStorage,
5
5
  dep,
6
6
  findRootDomain,
7
- getConsentHash,
7
+ getConsentHash, getValidSubmoduleConfigs,
8
8
  init,
9
9
  PBJS_USER_ID_OPTOUT_NAME,
10
10
  requestBidsHook,
@@ -190,6 +190,65 @@ describe('User ID', function () {
190
190
  })
191
191
  })
192
192
 
193
+ describe('userId config validation', () => {
194
+ beforeEach(() => {
195
+ sandbox.stub(utils, 'logWarn');
196
+ });
197
+
198
+ function mockConfig(storageConfig = {}) {
199
+ return {
200
+ name: 'mockModule',
201
+ storage: {
202
+ name: 'mockStorage',
203
+ type: 'cookie',
204
+ ...storageConfig
205
+ }
206
+ }
207
+ }
208
+
209
+ Object.entries({
210
+ 'not an object': 'garbage',
211
+ 'missing name': {},
212
+ 'empty name': {name: ''},
213
+ 'empty storage config': {name: 'mockId', storage: {}},
214
+ 'storage type, but no storage name': mockConfig({name: ''}),
215
+ 'storage name, but no storage type': mockConfig({type: undefined}),
216
+ }).forEach(([t, config]) => {
217
+ it(`should log a warning and reject configuration with ${t}`, () => {
218
+ expect(getValidSubmoduleConfigs([config]).length).to.equal(0);
219
+ sinon.assert.called(utils.logWarn);
220
+ });
221
+ });
222
+
223
+ it('should reject non-array userId configuration', () => {
224
+ expect(getValidSubmoduleConfigs({})).to.eql([]);
225
+ sinon.assert.called(utils.logWarn);
226
+ });
227
+
228
+ it('should accept null configuration', () => {
229
+ expect(getValidSubmoduleConfigs()).to.eql([]);
230
+ sinon.assert.notCalled(utils.logWarn);
231
+ });
232
+
233
+ ['refreshInSeconds', 'expires'].forEach(param => {
234
+ describe(`${param} parameter`, () => {
235
+ it('should be made a number, when possible', () => {
236
+ expect(getValidSubmoduleConfigs([mockConfig({[param]: '123'})])[0].storage[param]).to.equal(123);
237
+ });
238
+
239
+ it('should log a warning when not a number', () => {
240
+ expect(getValidSubmoduleConfigs([mockConfig({[param]: 'garbage'})])[0].storage[param]).to.not.exist;
241
+ sinon.assert.called(utils.logWarn)
242
+ });
243
+
244
+ it('should be left untouched when not specified', () => {
245
+ expect(getValidSubmoduleConfigs([mockConfig()])[0].storage[param]).to.not.exist;
246
+ sinon.assert.notCalled(utils.logWarn);
247
+ });
248
+ })
249
+ })
250
+ })
251
+
193
252
  describe('Decorate Ad Units', function () {
194
253
  beforeEach(function () {
195
254
  // reset mockGpt so nothing else interferes
@@ -2173,60 +2232,40 @@ describe('User ID', function () {
2173
2232
  });
2174
2233
  });
2175
2234
 
2176
- describe('Set cookie behavior', function () {
2177
- let cookie, cookieStub;
2178
-
2179
- beforeEach(function () {
2180
- setSubmoduleRegistry([sharedIdSystemSubmodule]);
2181
- init(config);
2182
- cookie = document.cookie;
2183
- cookieStub = sinon.stub(document, 'cookie');
2184
- cookieStub.get(() => cookie);
2185
- cookieStub.set((val) => cookie = val);
2186
- });
2187
-
2188
- afterEach(function () {
2189
- cookieStub.restore();
2190
- });
2191
-
2192
- it('should allow submodules to override the domain', function () {
2193
- const submodule = {
2194
- submodule: {
2195
- domainOverride: function () {
2196
- return 'foo.com'
2197
- }
2198
- },
2235
+ describe('Submodule ID storage', () => {
2236
+ let submodule;
2237
+ beforeEach(() => {
2238
+ submodule = {
2239
+ submodule: {},
2199
2240
  config: {
2200
2241
  name: 'mockId',
2201
- storage: {
2202
- type: 'cookie'
2203
- }
2204
2242
  },
2205
2243
  storageMgr: {
2206
- setCookie: sinon.stub()
2244
+ setCookie: sinon.stub(),
2245
+ setDataInLocalStorage: sinon.stub()
2207
2246
  },
2208
- enabledStorageTypes: [ 'cookie' ]
2247
+ enabledStorageTypes: ['cookie', 'html5']
2209
2248
  }
2210
- setStoredValue(submodule, 'bar');
2211
- expect(submodule.storageMgr.setCookie.getCall(0).args[4]).to.equal('foo.com');
2212
2249
  });
2213
2250
 
2214
- it('should pass no domain if submodule does not override the domain', function () {
2215
- const submodule = {
2216
- submodule: {},
2217
- config: {
2218
- name: 'mockId',
2219
- storage: {
2220
- type: 'cookie'
2221
- }
2222
- },
2223
- storageMgr: {
2224
- setCookie: sinon.stub()
2225
- },
2226
- enabledStorageTypes: [ 'cookie' ]
2227
- }
2228
- setStoredValue(submodule, 'bar');
2229
- expect(submodule.storageMgr.setCookie.getCall(0).args[4]).to.equal(null);
2251
+ describe('Set cookie behavior', function () {
2252
+ beforeEach(() => {
2253
+ submodule.config.storage = {
2254
+ type: 'cookie'
2255
+ }
2256
+ });
2257
+ it('should allow submodules to override the domain', function () {
2258
+ submodule.submodule.domainOverride = function() {
2259
+ return 'foo.com'
2260
+ }
2261
+ setStoredValue(submodule, 'bar');
2262
+ expect(submodule.storageMgr.setCookie.getCall(0).args[4]).to.equal('foo.com');
2263
+ });
2264
+
2265
+ it('should pass no domain if submodule does not override the domain', function () {
2266
+ setStoredValue(submodule, 'bar');
2267
+ expect(submodule.storageMgr.setCookie.getCall(0).args[4]).to.equal(null);
2268
+ });
2230
2269
  });
2231
2270
  });
2232
2271