prebid.js 7.53.0 → 8.0.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 (706) hide show
  1. package/.github/workflows/codeql-analysis.yml +2 -2
  2. package/dist/1plusXRtdProvider.js +1 -1
  3. package/dist/33acrossBidAdapter.js +1 -1
  4. package/dist/33acrossIdSystem.js +1 -1
  5. package/dist/adWMGAnalyticsAdapter.js +1 -1
  6. package/dist/adWMGBidAdapter.js +1 -1
  7. package/dist/adagioAnalyticsAdapter.js +1 -1
  8. package/dist/adagioBidAdapter.js +1 -1
  9. package/dist/adbookpspBidAdapter.js +1 -1
  10. package/dist/adfBidAdapter.js +1 -1
  11. package/dist/adgenerationBidAdapter.js +1 -1
  12. package/dist/adhashBidAdapter.js +1 -1
  13. package/dist/adkernelAdnAnalyticsAdapter.js +1 -1
  14. package/dist/adkernelAdnBidAdapter.js +1 -1
  15. package/dist/adkernelBidAdapter.js +1 -1
  16. package/dist/adlooxAdServerVideo.js +1 -1
  17. package/dist/adlooxAnalyticsAdapter.js +1 -1
  18. package/dist/adlooxRtdProvider.js +1 -1
  19. package/dist/adomikAnalyticsAdapter.js +1 -1
  20. package/dist/adprimeBidAdapter.js +1 -1
  21. package/dist/adqueryBidAdapter.js +1 -1
  22. package/dist/adrelevantisBidAdapter.js +1 -1
  23. package/dist/adtrgtmeBidAdapter.js +1 -1
  24. package/dist/adtrueBidAdapter.js +1 -1
  25. package/dist/aduptechBidAdapter.js +1 -1
  26. package/dist/advangelistsBidAdapter.js +1 -1
  27. package/dist/adxcgAnalyticsAdapter.js +1 -1
  28. package/dist/adxcgBidAdapter.js +1 -1
  29. package/dist/adxpremiumAnalyticsAdapter.js +1 -1
  30. package/dist/adyoulikeBidAdapter.js +1 -1
  31. package/dist/afpBidAdapter.js +1 -1
  32. package/dist/aidemBidAdapter.js +1 -1
  33. package/dist/airgridRtdProvider.js +1 -1
  34. package/dist/ajaBidAdapter.js +1 -1
  35. package/dist/amxBidAdapter.js +1 -1
  36. package/dist/amxIdSystem.js +1 -1
  37. package/dist/analyticsAdapter.js +1 -1
  38. package/dist/apacdexBidAdapter.js +1 -1
  39. package/dist/appierAnalyticsAdapter.js +1 -1
  40. package/dist/appnexusBidAdapter.js +1 -1
  41. package/dist/appnexusKeywords.js +1 -0
  42. package/dist/asoBidAdapter.js +1 -1
  43. package/dist/astraoneBidAdapter.js +1 -1
  44. package/dist/atsAnalyticsAdapter.js +1 -1
  45. package/dist/audiencerunBidAdapter.js +1 -1
  46. package/dist/automatadBidAdapter.js +1 -1
  47. package/dist/axonixBidAdapter.js +1 -1
  48. package/dist/beachfrontBidAdapter.js +1 -1
  49. package/dist/beopBidAdapter.js +1 -1
  50. package/dist/betweenBidAdapter.js +1 -1
  51. package/dist/bidViewability.js +1 -1
  52. package/dist/bidglassBidAdapter.js +1 -1
  53. package/dist/bidwatchAnalyticsAdapter.js +1 -1
  54. package/dist/big-richmediaBidAdapter.js +1 -1
  55. package/dist/bizzclickBidAdapter.js +1 -1
  56. package/dist/bluebillywigBidAdapter.js +1 -1
  57. package/dist/braveBidAdapter.js +1 -1
  58. package/dist/bridgewellBidAdapter.js +1 -1
  59. package/dist/brightMountainMediaBidAdapter.js +1 -1
  60. package/dist/browsiBidAdapter.js +1 -1
  61. package/dist/byDataAnalyticsAdapter.js +1 -1
  62. package/dist/cadentApertureMXBidAdapter.js +1 -0
  63. package/dist/carodaBidAdapter.js +1 -1
  64. package/dist/categoryTranslationMapping.js +1 -0
  65. package/dist/ccxBidAdapter.js +1 -1
  66. package/dist/chtnwBidAdapter.js +1 -1
  67. package/dist/cleanmedianetBidAdapter.js +1 -1
  68. package/dist/codefuelBidAdapter.js +1 -1
  69. package/dist/colossussspBidAdapter.js +1 -1
  70. package/dist/concertAnalyticsAdapter.js +1 -1
  71. package/dist/concertBidAdapter.js +1 -1
  72. package/dist/connectIdSystem.js +1 -1
  73. package/dist/connectadBidAdapter.js +1 -1
  74. package/dist/consentManagement.js +1 -1
  75. package/dist/consentManagementGpp.js +1 -1
  76. package/dist/consentManagementUsp.js +1 -1
  77. package/dist/consumableBidAdapter.js +1 -1
  78. package/dist/conversantAnalyticsAdapter.js +1 -1
  79. package/dist/conversantBidAdapter.js +1 -1
  80. package/dist/craftBidAdapter.js +1 -1
  81. package/dist/criteoBidAdapter.js +1 -1
  82. package/dist/criteoIdSystem.js +1 -1
  83. package/dist/currency.js +1 -1
  84. package/dist/cwireBidAdapter.js +1 -1
  85. package/dist/dailyhuntBidAdapter.js +1 -1
  86. package/dist/datablocksAnalyticsAdapter.js +1 -1
  87. package/dist/datablocksBidAdapter.js +1 -1
  88. package/dist/datawrkzBidAdapter.js +1 -1
  89. package/dist/debugging-standalone.js +1 -1
  90. package/dist/debugging.js +1 -1
  91. package/dist/deltaprojectsBidAdapter.js +1 -1
  92. package/dist/dependencies.json +58 -14
  93. package/dist/dfpAdServerVideo.js +1 -1
  94. package/dist/dianomiBidAdapter.js +1 -1
  95. package/dist/displayioBidAdapter.js +1 -1
  96. package/dist/dspxBidAdapter.js +1 -1
  97. package/dist/ebdrBidAdapter.js +1 -1
  98. package/dist/eplanningAnalyticsAdapter.js +1 -1
  99. package/dist/eplanningBidAdapter.js +1 -1
  100. package/dist/etargetBidAdapter.js +1 -1
  101. package/dist/euidIdSystem.js +1 -1
  102. package/dist/feedadBidAdapter.js +1 -1
  103. package/dist/finativeBidAdapter.js +1 -1
  104. package/dist/fintezaAnalyticsAdapter.js +1 -1
  105. package/dist/fluctBidAdapter.js +1 -1
  106. package/dist/freewheel-sspBidAdapter.js +1 -1
  107. package/dist/ftrackIdSystem.js +1 -1
  108. package/dist/gamoshiBidAdapter.js +1 -1
  109. package/dist/gdprEnforcement.js +1 -1
  110. package/dist/genericAnalyticsAdapter.js +1 -1
  111. package/dist/gmosspBidAdapter.js +1 -1
  112. package/dist/gnetBidAdapter.js +1 -1
  113. package/dist/goldbachBidAdapter.js +1 -1
  114. package/dist/gothamadsBidAdapter.js +1 -1
  115. package/dist/greenbidsAnalyticsAdapter.js +1 -1
  116. package/dist/greenbidsRtdProvider.js +1 -1
  117. package/dist/gridBidAdapter.js +1 -1
  118. package/dist/growthCodeAnalyticsAdapter.js +1 -1
  119. package/dist/gumgumBidAdapter.js +1 -1
  120. package/dist/h12mediaBidAdapter.js +1 -1
  121. package/dist/hadronAnalyticsAdapter.js +1 -1
  122. package/dist/holidBidAdapter.js +1 -1
  123. package/dist/hybridBidAdapter.js +1 -1
  124. package/dist/hypelabBidAdapter.js +1 -0
  125. package/dist/id5AnalyticsAdapter.js +1 -1
  126. package/dist/id5IdSystem.js +1 -1
  127. package/dist/imdsBidAdapter.js +1 -0
  128. package/dist/impactifyBidAdapter.js +1 -1
  129. package/dist/improvedigitalBidAdapter.js +1 -1
  130. package/dist/insticatorBidAdapter.js +1 -1
  131. package/dist/interactiveOffersBidAdapter.js +1 -1
  132. package/dist/invisiblyAnalyticsAdapter.js +1 -1
  133. package/dist/ixBidAdapter.js +1 -1
  134. package/dist/justpremiumBidAdapter.js +1 -1
  135. package/dist/kargoAnalyticsAdapter.js +1 -1
  136. package/dist/kargoBidAdapter.js +1 -1
  137. package/dist/keywords.js +1 -0
  138. package/dist/kinessoIdSystem.js +1 -1
  139. package/dist/koblerBidAdapter.js +1 -1
  140. package/dist/konduitAnalyticsAdapter.js +1 -1
  141. package/dist/kueezBidAdapter.js +1 -1
  142. package/dist/kueezRtbBidAdapter.js +1 -1
  143. package/dist/kulturemediaBidAdapter.js +1 -1
  144. package/dist/lassoBidAdapter.js +1 -1
  145. package/dist/lifestreetBidAdapter.js +1 -1
  146. package/dist/limelightDigitalBidAdapter.js +1 -1
  147. package/dist/liveIntentAnalyticsAdapter.js +1 -1
  148. package/dist/liveIntentIdSystem.js +1 -1
  149. package/dist/livewrappedAnalyticsAdapter.js +1 -1
  150. package/dist/livewrappedBidAdapter.js +1 -1
  151. package/dist/logicadBidAdapter.js +1 -1
  152. package/dist/loglyliftBidAdapter.js +1 -1
  153. package/dist/lotamePanoramaIdSystem.js +1 -1
  154. package/dist/luponmediaBidAdapter.js +1 -1
  155. package/dist/magniteAnalyticsAdapter.js +1 -1
  156. package/dist/malltvAnalyticsAdapter.js +1 -1
  157. package/dist/marsmediaAnalyticsAdapter.js +1 -1
  158. package/dist/marsmediaBidAdapter.js +1 -1
  159. package/dist/mediaforceBidAdapter.js +1 -1
  160. package/dist/mediafuseBidAdapter.js +1 -1
  161. package/dist/mediakeysBidAdapter.js +1 -1
  162. package/dist/medianetAnalyticsAdapter.js +1 -1
  163. package/dist/medianetBidAdapter.js +1 -1
  164. package/dist/mediasniperBidAdapter.js +1 -1
  165. package/dist/mediasquareBidAdapter.js +1 -1
  166. package/dist/mgidBidAdapter.js +1 -1
  167. package/dist/microadBidAdapter.js +1 -1
  168. package/dist/minutemediaBidAdapter.js +1 -1
  169. package/dist/minutemediaplusBidAdapter.js +1 -1
  170. package/dist/newspassidBidAdapter.js +1 -1
  171. package/dist/nextMillenniumBidAdapter.js +1 -1
  172. package/dist/nexx360BidAdapter.js +1 -1
  173. package/dist/not-for-prod/prebid.js +293 -323
  174. package/dist/objectGuard.js +1 -1
  175. package/dist/oguryBidAdapter.js +1 -1
  176. package/dist/onetagBidAdapter.js +1 -1
  177. package/dist/ooloAnalyticsAdapter.js +1 -1
  178. package/dist/operaadsBidAdapter.js +1 -1
  179. package/dist/optidigitalBidAdapter.js +1 -1
  180. package/dist/optimonAnalyticsAdapter.js +1 -1
  181. package/dist/orbidderBidAdapter.js +1 -1
  182. package/dist/ortbConverter.js +1 -1
  183. package/dist/otmBidAdapter.js +1 -1
  184. package/dist/outbrainBidAdapter.js +1 -1
  185. package/dist/oxxionAnalyticsAdapter.js +1 -1
  186. package/dist/oxxionRtdProvider.js +1 -1
  187. package/dist/ozoneBidAdapter.js +1 -1
  188. package/dist/padsquadBidAdapter.js +1 -1
  189. package/dist/parrableIdSystem.js +1 -1
  190. package/dist/pbsExtensions.js +1 -1
  191. package/dist/pianoDmpAnalyticsAdapter.js +1 -1
  192. package/dist/pixfutureBidAdapter.js +1 -1
  193. package/dist/prebid-core.js +2 -2
  194. package/dist/prebidServerBidAdapter.js +1 -1
  195. package/dist/prebidmanagerAnalyticsAdapter.js +1 -1
  196. package/dist/priceFloors.js +1 -1
  197. package/dist/prismaBidAdapter.js +1 -1
  198. package/dist/proxistoreBidAdapter.js +1 -1
  199. package/dist/pubgeniusBidAdapter.js +1 -1
  200. package/dist/publinkIdSystem.js +1 -1
  201. package/dist/pubmaticAnalyticsAdapter.js +1 -1
  202. package/dist/pubmaticBidAdapter.js +1 -1
  203. package/dist/pubperfAnalyticsAdapter.js +1 -1
  204. package/dist/pubstackAnalyticsAdapter.js +1 -1
  205. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  206. package/dist/pubwiseBidAdapter.js +1 -1
  207. package/dist/pubxaiAnalyticsAdapter.js +1 -1
  208. package/dist/pulsepointAnalyticsAdapter.js +1 -1
  209. package/dist/pxyzBidAdapter.js +1 -1
  210. package/dist/quantcastBidAdapter.js +1 -1
  211. package/dist/quantcastIdSystem.js +1 -1
  212. package/dist/rasBidAdapter.js +1 -1
  213. package/dist/readpeakBidAdapter.js +1 -1
  214. package/dist/relaidoBidAdapter.js +1 -1
  215. package/dist/relevantAnalyticsAdapter.js +1 -1
  216. package/dist/retailspotBidAdapter.js +1 -1
  217. package/dist/revcontentBidAdapter.js +1 -1
  218. package/dist/rhythmoneBidAdapter.js +1 -1
  219. package/dist/richaudienceBidAdapter.js +1 -1
  220. package/dist/riseBidAdapter.js +1 -1
  221. package/dist/rivrAnalyticsAdapter.js +1 -1
  222. package/dist/roxotAnalyticsAdapter.js +1 -1
  223. package/dist/rtbhouseBidAdapter.js +1 -1
  224. package/dist/rtdModule.js +1 -1
  225. package/dist/rubiconBidAdapter.js +1 -1
  226. package/dist/s2sTesting.js +1 -1
  227. package/dist/saambaaBidAdapter.js +1 -1
  228. package/dist/scaleableAnalyticsAdapter.js +1 -1
  229. package/dist/schain.js +1 -1
  230. package/dist/seedingAllianceBidAdapter.js +1 -1
  231. package/dist/seedtagBidAdapter.js +1 -1
  232. package/dist/sharedIdSystem.js +1 -1
  233. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  234. package/dist/sharethroughBidAdapter.js +1 -1
  235. package/dist/shinezBidAdapter.js +1 -1
  236. package/dist/showheroes-bsBidAdapter.js +1 -1
  237. package/dist/sigmoidAnalyticsAdapter.js +1 -1
  238. package/dist/sizeMapping.js +1 -0
  239. package/dist/slimcutBidAdapter.js +1 -1
  240. package/dist/smaatoBidAdapter.js +1 -1
  241. package/dist/smartadserverBidAdapter.js +1 -1
  242. package/dist/smartxBidAdapter.js +1 -1
  243. package/dist/smartytechBidAdapter.js +1 -1
  244. package/dist/smilewantedBidAdapter.js +1 -1
  245. package/dist/sonobiAnalyticsAdapter.js +1 -1
  246. package/dist/sonobiBidAdapter.js +1 -1
  247. package/dist/sovrnAnalyticsAdapter.js +1 -1
  248. package/dist/sovrnBidAdapter.js +1 -1
  249. package/dist/sspBCBidAdapter.js +1 -1
  250. package/dist/staqAnalyticsAdapter.js +1 -1
  251. package/dist/stvBidAdapter.js +1 -1
  252. package/dist/sublimeBidAdapter.js +1 -1
  253. package/dist/taboolaBidAdapter.js +1 -1
  254. package/dist/tapadIdSystem.js +1 -1
  255. package/dist/tappxBidAdapter.js +1 -1
  256. package/dist/targetVideoBidAdapter.js +1 -1
  257. package/dist/teadsBidAdapter.js +1 -1
  258. package/dist/teadsIdSystem.js +1 -1
  259. package/dist/telariaBidAdapter.js +1 -1
  260. package/dist/terceptAnalyticsAdapter.js +1 -1
  261. package/dist/theAdxBidAdapter.js +1 -1
  262. package/dist/topicsFpdModule.js +1 -1
  263. package/dist/trionBidAdapter.js +1 -1
  264. package/dist/tripleliftBidAdapter.js +1 -1
  265. package/dist/ttdBidAdapter.js +1 -1
  266. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  267. package/dist/uid2IdSystem.js +1 -1
  268. package/dist/underdogmediaBidAdapter.js +1 -1
  269. package/dist/undertoneBidAdapter.js +1 -1
  270. package/dist/unicornBidAdapter.js +1 -1
  271. package/dist/unrulyBidAdapter.js +1 -1
  272. package/dist/userId.js +1 -1
  273. package/dist/utiqSystem.js +1 -0
  274. package/dist/vibrantmediaBidAdapter.js +1 -1
  275. package/dist/vidazooBidAdapter.js +1 -1
  276. package/dist/videobyteBidAdapter.js +1 -1
  277. package/dist/videojsVideoProvider.js +1 -1
  278. package/dist/videoreachBidAdapter.js +1 -1
  279. package/dist/visxBidAdapter.js +1 -1
  280. package/dist/vrtcalBidAdapter.js +1 -1
  281. package/dist/vuukleBidAdapter.js +1 -1
  282. package/dist/weboramaRtdProvider.js +1 -1
  283. package/dist/widespaceBidAdapter.js +1 -1
  284. package/dist/winrBidAdapter.js +1 -1
  285. package/dist/xeBidAdapter.js +1 -1
  286. package/dist/yahoosspBidAdapter.js +1 -1
  287. package/dist/yieldliftBidAdapter.js +1 -1
  288. package/dist/yieldmoBidAdapter.js +1 -1
  289. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  290. package/dist/yieldoneBidAdapter.js +1 -1
  291. package/dist/yuktamediaAnalyticsAdapter.js +1 -1
  292. package/dist/zetaBidAdapter.js +1 -1
  293. package/dist/zeta_global_sspAnalyticsAdapter.js +1 -1
  294. package/dist/zeta_global_sspBidAdapter.js +1 -1
  295. package/libraries/analyticsAdapter/AnalyticsAdapter.js +1 -7
  296. package/libraries/appnexusKeywords/anKeywords.js +140 -0
  297. package/libraries/categoryTranslationMapping/index.js +100 -0
  298. package/libraries/keywords/keywords.js +31 -0
  299. package/libraries/objectGuard/objectGuard.js +2 -11
  300. package/libraries/ortbConverter/processors/default.js +3 -4
  301. package/modules/.submodules.json +1 -1
  302. package/modules/1plusXRtdProvider.js +4 -14
  303. package/modules/33acrossBidAdapter.js +11 -11
  304. package/modules/adWMGBidAdapter.js +2 -1
  305. package/modules/adagioBidAdapter.js +18 -30
  306. package/modules/adbookpspBidAdapter.js +1 -1
  307. package/modules/addefendBidAdapter.js +1 -0
  308. package/modules/adfBidAdapter.js +3 -3
  309. package/modules/adgenerationBidAdapter.js +1 -1
  310. package/modules/adhashBidAdapter.js +56 -34
  311. package/modules/adkernelAdnBidAdapter.js +5 -6
  312. package/modules/adkernelBidAdapter.js +5 -5
  313. package/modules/adprimeBidAdapter.js +2 -1
  314. package/modules/adqueryBidAdapter.js +1 -0
  315. package/modules/adrelevantisBidAdapter.js +3 -24
  316. package/modules/adtrueBidAdapter.js +2 -2
  317. package/modules/aduptechBidAdapter.js +2 -1
  318. package/modules/advangelistsBidAdapter.js +0 -1
  319. package/modules/adxcgBidAdapter.js +1 -1
  320. package/modules/adyoulikeBidAdapter.js +1 -1
  321. package/modules/afpBidAdapter.js +2 -2
  322. package/modules/aidemBidAdapter.js +16 -3
  323. package/modules/airgridRtdProvider.js +24 -53
  324. package/modules/ajaBidAdapter.js +1 -1
  325. package/modules/alkimiBidAdapter.js +2 -1
  326. package/modules/amxBidAdapter.js +1 -0
  327. package/modules/apacdexBidAdapter.js +3 -3
  328. package/modules/appnexusBidAdapter.js +16 -114
  329. package/modules/apstreamBidAdapter.js +1 -0
  330. package/modules/asoBidAdapter.js +1 -1
  331. package/modules/astraoneBidAdapter.js +1 -1
  332. package/modules/audiencerunBidAdapter.js +2 -1
  333. package/modules/automatadBidAdapter.js +5 -5
  334. package/modules/beachfrontBidAdapter.js +0 -1
  335. package/modules/beopBidAdapter.js +20 -17
  336. package/modules/betweenBidAdapter.js +2 -1
  337. package/modules/bizzclickBidAdapter.js +9 -6
  338. package/modules/bliinkBidAdapter.js +1 -0
  339. package/modules/bluebillywigBidAdapter.js +2 -2
  340. package/modules/braveBidAdapter.js +9 -7
  341. package/modules/browsiBidAdapter.js +3 -3
  342. package/modules/{emx_digitalBidAdapter.js → cadentApertureMXBidAdapter.js} +61 -56
  343. package/modules/{emx_digitalBidAdapter.md → cadentApertureMXBidAdapter.md} +6 -6
  344. package/modules/carodaBidAdapter.js +1 -0
  345. package/modules/ccxBidAdapter.js +1 -1
  346. package/modules/cleanmedianetBidAdapter.js +3 -3
  347. package/modules/codefuelBidAdapter.js +1 -1
  348. package/modules/colossussspBidAdapter.js +1 -1
  349. package/modules/concertBidAdapter.js +1 -1
  350. package/modules/connectadBidAdapter.js +1 -0
  351. package/modules/conversantAnalyticsAdapter.js +2 -0
  352. package/modules/conversantBidAdapter.js +22 -6
  353. package/modules/craftBidAdapter.js +6 -28
  354. package/modules/criteoBidAdapter.js +12 -9
  355. package/modules/currency.js +3 -3
  356. package/modules/dailyhuntBidAdapter.js +2 -2
  357. package/modules/datablocksBidAdapter.js +10 -8
  358. package/modules/datawrkzBidAdapter.js +0 -6
  359. package/modules/deltaprojectsBidAdapter.js +12 -3
  360. package/modules/dianomiBidAdapter.js +1 -1
  361. package/modules/discoveryBidAdapter.js +1 -0
  362. package/modules/displayioBidAdapter.js +2 -1
  363. package/modules/dspxBidAdapter.js +1 -0
  364. package/modules/ebdrBidAdapter.js +3 -2
  365. package/modules/etargetBidAdapter.js +1 -2
  366. package/modules/feedadBidAdapter.js +1 -1
  367. package/modules/finativeBidAdapter.js +8 -8
  368. package/modules/fluctBidAdapter.js +1 -2
  369. package/modules/gamoshiBidAdapter.js +3 -3
  370. package/modules/gdprEnforcement.js +0 -15
  371. package/modules/genericAnalyticsAdapter.js +0 -5
  372. package/modules/glomexBidAdapter.js +1 -0
  373. package/modules/gmosspBidAdapter.js +1 -1
  374. package/modules/gnetBidAdapter.js +1 -1
  375. package/modules/goldbachBidAdapter.js +7 -45
  376. package/modules/gothamadsBidAdapter.js +4 -3
  377. package/modules/gridBidAdapter.js +20 -421
  378. package/modules/gumgumBidAdapter.js +1 -2
  379. package/modules/h12mediaBidAdapter.js +1 -1
  380. package/modules/holidBidAdapter.js +8 -13
  381. package/modules/hybridBidAdapter.js +2 -2
  382. package/modules/hypelabBidAdapter.js +153 -0
  383. package/modules/hypelabBidAdapter.md +38 -0
  384. package/modules/{synacormediaBidAdapter.js → imdsBidAdapter.js} +11 -8
  385. package/modules/{synacormediaBidAdapter.md → imdsBidAdapter.md} +5 -5
  386. package/modules/impactifyBidAdapter.js +6 -6
  387. package/modules/improvedigitalBidAdapter.js +1 -2
  388. package/modules/innityBidAdapter.js +1 -0
  389. package/modules/insticatorBidAdapter.js +1 -1
  390. package/modules/interactiveOffersBidAdapter.js +5 -4
  391. package/modules/iqmBidAdapter.js +1 -0
  392. package/modules/ixBidAdapter.js +74 -75
  393. package/modules/jixieBidAdapter.js +1 -0
  394. package/modules/kargoBidAdapter.js +1 -1
  395. package/modules/koblerBidAdapter.js +2 -1
  396. package/modules/kueezBidAdapter.js +1 -1
  397. package/modules/kueezRtbBidAdapter.js +1 -0
  398. package/modules/kulturemediaBidAdapter.js +7 -7
  399. package/modules/lassoBidAdapter.js +2 -1
  400. package/modules/limelightDigitalBidAdapter.js +1 -1
  401. package/modules/livewrappedBidAdapter.js +2 -2
  402. package/modules/logicadBidAdapter.js +2 -1
  403. package/modules/loglyliftBidAdapter.js +2 -1
  404. package/modules/luponmediaBidAdapter.js +16 -4
  405. package/modules/magniteAnalyticsAdapter.js +61 -72
  406. package/modules/malltvBidAdapter.js +1 -0
  407. package/modules/mediaforceBidAdapter.js +2 -1
  408. package/modules/mediafuseBidAdapter.js +45 -62
  409. package/modules/mediagoBidAdapter.js +1 -0
  410. package/modules/mediakeysBidAdapter.js +3 -5
  411. package/modules/medianetBidAdapter.js +2 -1
  412. package/modules/mediasniperBidAdapter.js +1 -2
  413. package/modules/mediasquareBidAdapter.js +2 -1
  414. package/modules/microadBidAdapter.js +1 -9
  415. package/modules/minutemediaBidAdapter.js +2 -2
  416. package/modules/minutemediaplusBidAdapter.js +3 -2
  417. package/modules/newspassidBidAdapter.js +6 -4
  418. package/modules/nextMillenniumBidAdapter.js +10 -9
  419. package/modules/oguryBidAdapter.js +5 -5
  420. package/modules/onetagBidAdapter.js +2 -1
  421. package/modules/operaadsBidAdapter.js +2 -2
  422. package/modules/optidigitalBidAdapter.js +2 -2
  423. package/modules/orbidderBidAdapter.js +2 -1
  424. package/modules/otmBidAdapter.js +2 -2
  425. package/modules/outbrainBidAdapter.js +9 -11
  426. package/modules/oxxionRtdProvider.js +7 -29
  427. package/modules/ozoneBidAdapter.js +2 -1
  428. package/modules/padsquadBidAdapter.js +2 -2
  429. package/modules/pixfutureBidAdapter.js +12 -36
  430. package/modules/prebidServerBidAdapter/index.js +1 -3
  431. package/modules/prebidServerBidAdapter/ortbConverter.js +34 -5
  432. package/modules/priceFloors.js +7 -7
  433. package/modules/prismaBidAdapter.js +4 -3
  434. package/modules/proxistoreBidAdapter.js +2 -1
  435. package/modules/pubgeniusBidAdapter.js +5 -5
  436. package/modules/pubmaticAnalyticsAdapter.js +31 -12
  437. package/modules/pubmaticBidAdapter.js +6 -4
  438. package/modules/pubwiseBidAdapter.js +6 -5
  439. package/modules/pxyzBidAdapter.js +4 -4
  440. package/modules/rasBidAdapter.js +4 -2
  441. package/modules/readpeakBidAdapter.js +1 -1
  442. package/modules/relaidoBidAdapter.js +2 -1
  443. package/modules/resetdigitalBidAdapter.js +1 -0
  444. package/modules/revcontentBidAdapter.js +6 -7
  445. package/modules/rhythmoneBidAdapter.js +0 -2
  446. package/modules/richaudienceBidAdapter.js +6 -4
  447. package/modules/riseBidAdapter.js +1 -1
  448. package/modules/rtbhouseBidAdapter.js +5 -5
  449. package/modules/rtbsapeBidAdapter.js +1 -0
  450. package/modules/rubiconBidAdapter.js +8 -11
  451. package/modules/saambaaBidAdapter.js +0 -1
  452. package/modules/seedingAllianceBidAdapter.js +6 -7
  453. package/modules/seedtagBidAdapter.js +1 -1
  454. package/modules/sharethroughBidAdapter.js +1 -1
  455. package/modules/shinezBidAdapter.js +435 -435
  456. package/modules/showheroes-bsBidAdapter.js +1 -1
  457. package/{src → modules}/sizeMapping.js +46 -32
  458. package/modules/slimcutBidAdapter.js +2 -2
  459. package/modules/smaatoBidAdapter.js +16 -3
  460. package/modules/smartadserverBidAdapter.js +1 -1
  461. package/modules/smarticoBidAdapter.js +1 -0
  462. package/modules/smartytechBidAdapter.js +0 -1
  463. package/modules/smilewantedBidAdapter.js +2 -2
  464. package/modules/sonobiBidAdapter.js +2 -1
  465. package/modules/sspBCBidAdapter.js +1 -1
  466. package/modules/stroeerCoreBidAdapter.js +1 -0
  467. package/modules/sublimeBidAdapter.js +1 -0
  468. package/modules/taboolaBidAdapter.js +3 -3
  469. package/modules/talkadsBidAdapter.js +1 -0
  470. package/modules/tappxBidAdapter.js +1 -1
  471. package/modules/teadsBidAdapter.js +1 -2
  472. package/modules/telariaBidAdapter.js +1 -1
  473. package/modules/theAdxBidAdapter.js +1 -1
  474. package/modules/topicsFpdModule.js +4 -1
  475. package/modules/tpmnBidAdapter.js +1 -0
  476. package/modules/truereachBidAdapter.js +1 -0
  477. package/modules/ttdBidAdapter.js +3 -3
  478. package/modules/underdogmediaBidAdapter.js +0 -1
  479. package/modules/unicornBidAdapter.js +1 -1
  480. package/modules/unrulyBidAdapter.js +1 -1
  481. package/modules/userId/eids.js +3 -3
  482. package/modules/userId/eids.md +1 -1
  483. package/modules/userId/index.js +2 -19
  484. package/modules/userId/userId.md +12 -10
  485. package/modules/utiqSystem.js +129 -0
  486. package/modules/{trustpidSystem.md → utiqSystem.md} +7 -7
  487. package/modules/vdoaiBidAdapter.js +1 -0
  488. package/modules/vibrantmediaBidAdapter.js +1 -1
  489. package/modules/vidazooBidAdapter.js +3 -2
  490. package/modules/videobyteBidAdapter.js +0 -1
  491. package/modules/videoheroesBidAdapter.js +2 -0
  492. package/modules/videojsVideoProvider.js +2 -0
  493. package/modules/videoreachBidAdapter.js +2 -1
  494. package/modules/vlybyBidAdapter.js +1 -0
  495. package/modules/voxBidAdapter.js +2 -0
  496. package/modules/vrtcalBidAdapter.js +6 -1
  497. package/modules/winrBidAdapter.js +4 -25
  498. package/modules/xeBidAdapter.js +2 -1
  499. package/modules/yieldliftBidAdapter.js +2 -2
  500. package/modules/yieldmoBidAdapter.js +1 -0
  501. package/modules/yieldoneBidAdapter.js +1 -1
  502. package/modules/zetaBidAdapter.js +4 -9
  503. package/modules/zeta_global_sspBidAdapter.js +1 -1
  504. package/package.json +1 -1
  505. package/src/activities/activities.js +5 -0
  506. package/src/activities/redactor.js +36 -8
  507. package/src/adapterManager.js +31 -20
  508. package/src/adapters/bidderFactory.js +41 -91
  509. package/src/auction.js +5 -21
  510. package/src/constants.json +1 -2
  511. package/src/utils.js +2 -34
  512. package/test/fixtures/fixtures.js +0 -7
  513. package/test/pages/banner.html +1 -0
  514. package/test/pages/bidderSettings.html +1 -0
  515. package/test/pages/consent_mgt_gdpr.html +1 -0
  516. package/test/pages/currency.html +1 -0
  517. package/test/pages/instream.html +1 -0
  518. package/test/pages/multiple_bidders.html +1 -1
  519. package/test/pages/native.html +1 -0
  520. package/test/pages/outstream.html +4 -1
  521. package/test/spec/activities/redactor_spec.js +10 -2
  522. package/test/spec/appnexusKeywords_spec.js +70 -0
  523. package/test/spec/auctionmanager_spec.js +11 -22
  524. package/test/spec/keywords_spec.js +102 -0
  525. package/test/spec/modules/1plusXRtdProvider_spec.js +17 -18
  526. package/test/spec/modules/33acrossBidAdapter_spec.js +49 -73
  527. package/test/spec/modules/adagioBidAdapter_spec.js +15 -24
  528. package/test/spec/modules/adbookpspBidAdapter_spec.js +5 -0
  529. package/test/spec/modules/adfBidAdapter_spec.js +4 -1
  530. package/test/spec/modules/adhashBidAdapter_spec.js +18 -2
  531. package/test/spec/modules/adkernelAdnBidAdapter_spec.js +1 -3
  532. package/test/spec/modules/adrelevantisBidAdapter_spec.js +0 -9
  533. package/test/spec/modules/adriverBidAdapter_spec.js +0 -9
  534. package/test/spec/modules/adtrueBidAdapter_spec.js +11 -7
  535. package/test/spec/modules/aduptechBidAdapter_spec.js +26 -8
  536. package/test/spec/modules/advangelistsBidAdapter_spec.js +0 -1
  537. package/test/spec/modules/adxcgBidAdapter_spec.js +4 -1
  538. package/test/spec/modules/adyoulikeBidAdapter_spec.js +50 -10
  539. package/test/spec/modules/afpBidAdapter_spec.js +5 -1
  540. package/test/spec/modules/aidemBidAdapter_spec.js +10 -2
  541. package/test/spec/modules/airgridRtdProvider_spec.js +9 -59
  542. package/test/spec/modules/apacdexBidAdapter_spec.js +2 -2
  543. package/test/spec/modules/appnexusBidAdapter_spec.js +100 -27
  544. package/test/spec/modules/astraoneBidAdapter_spec.js +5 -1
  545. package/test/spec/modules/beachfrontBidAdapter_spec.js +0 -1
  546. package/test/spec/modules/big-richmediaBidAdapter_spec.js +0 -10
  547. package/test/spec/modules/bluebillywigBidAdapter_spec.js +12 -10
  548. package/test/spec/modules/browsiBidAdapter_spec.js +6 -3
  549. package/test/spec/modules/{emx_digitalBidAdapter_spec.js → cadentApertureMXBidAdapter_spec.js} +16 -16
  550. package/test/spec/modules/ccxBidAdapter_spec.js +1 -1
  551. package/test/spec/modules/cleanmedianetBidAdapter_spec.js +2 -2
  552. package/test/spec/modules/codefuelBidAdapter_spec.js +10 -1
  553. package/test/spec/modules/colossussspBidAdapter_spec.js +1 -1
  554. package/test/spec/modules/concertBidAdapter_spec.js +5 -1
  555. package/test/spec/modules/conversantBidAdapter_spec.js +7 -2
  556. package/test/spec/modules/criteoBidAdapter_spec.js +78 -8
  557. package/test/spec/modules/currency_spec.js +12 -12
  558. package/test/spec/modules/datawrkzBidAdapter_spec.js +0 -4
  559. package/test/spec/modules/dianomiBidAdapter_spec.js +1 -1
  560. package/test/spec/modules/etargetBidAdapter_spec.js +35 -8
  561. package/test/spec/modules/euidIdSystem_spec.js +0 -7
  562. package/test/spec/modules/feedadBidAdapter_spec.js +5 -1
  563. package/test/spec/modules/finativeBidAdapter_spec.js +0 -12
  564. package/test/spec/modules/fluctBidAdapter_spec.js +0 -2
  565. package/test/spec/modules/gamoshiBidAdapter_spec.js +5 -2
  566. package/test/spec/modules/gmosspBidAdapter_spec.js +5 -1
  567. package/test/spec/modules/gnetBidAdapter_spec.js +5 -1
  568. package/test/spec/modules/goldbachBidAdapter_spec.js +0 -10
  569. package/test/spec/modules/gridBidAdapter_spec.js +42 -302
  570. package/test/spec/modules/hybridBidAdapter_spec.js +5 -1
  571. package/test/spec/modules/hypelabBidAdapter_spec.js +281 -0
  572. package/test/spec/modules/{synacormediaBidAdapter_spec.js → imdsBidAdapter_spec.js} +19 -19
  573. package/test/spec/modules/improvedigitalBidAdapter_spec.js +6 -1
  574. package/test/spec/modules/insticatorBidAdapter_spec.js +6 -2
  575. package/test/spec/modules/invisiblyAnalyticsAdapter_spec.js +1 -1
  576. package/test/spec/modules/ivsBidAdapter_spec.js +0 -2
  577. package/test/spec/modules/ixBidAdapter_spec.js +8 -3
  578. package/test/spec/modules/kargoBidAdapter_spec.js +3 -3
  579. package/test/spec/modules/koblerBidAdapter_spec.js +13 -2
  580. package/test/spec/modules/kulturemediaBidAdapter_spec.js +0 -1
  581. package/test/spec/modules/limelightDigitalBidAdapter_spec.js +21 -5
  582. package/test/spec/modules/livewrappedAnalyticsAdapter_spec.js +1 -1
  583. package/test/spec/modules/livewrappedBidAdapter_spec.js +5 -6
  584. package/test/spec/modules/loglyliftBidAdapter_spec.js +10 -0
  585. package/test/spec/modules/luponmediaBidAdapter_spec.js +23 -2
  586. package/test/spec/modules/magniteAnalyticsAdapter_spec.js +93 -1
  587. package/test/spec/modules/mediaforceBidAdapter_spec.js +11 -3
  588. package/test/spec/modules/mediafuseBidAdapter_spec.js +2 -6
  589. package/test/spec/modules/mediakeysBidAdapter_spec.js +6 -2
  590. package/test/spec/modules/medianetBidAdapter_spec.js +86 -17
  591. package/test/spec/modules/mediasniperBidAdapter_spec.js +1 -1
  592. package/test/spec/modules/mediasquareBidAdapter_spec.js +5 -5
  593. package/test/spec/modules/microadBidAdapter_spec.js +7 -3
  594. package/test/spec/modules/minutemediaplusBidAdapter_spec.js +7 -3
  595. package/test/spec/modules/nextMillenniumBidAdapter_spec.js +2 -2
  596. package/test/spec/modules/nexx360BidAdapter_spec.js +0 -1
  597. package/test/spec/modules/oguryBidAdapter_spec.js +2 -1
  598. package/test/spec/modules/onetagBidAdapter_spec.js +5 -1
  599. package/test/spec/modules/openxBidAdapter_spec.js +1 -1
  600. package/test/spec/modules/operaadsBidAdapter_spec.js +5 -5
  601. package/test/spec/modules/optidigitalBidAdapter_spec.js +0 -2
  602. package/test/spec/modules/orbidderBidAdapter_spec.js +12 -4
  603. package/test/spec/modules/outbrainBidAdapter_spec.js +5 -0
  604. package/test/spec/modules/oxxionRtdProvider_spec.js +3 -2
  605. package/test/spec/modules/prebidServerBidAdapter_spec.js +114 -32
  606. package/test/spec/modules/priceFloors_spec.js +7 -25
  607. package/test/spec/modules/pubgeniusBidAdapter_spec.js +2 -1
  608. package/test/spec/modules/pubmaticAnalyticsAdapter_spec.js +7 -0
  609. package/test/spec/modules/pubmaticBidAdapter_spec.js +41 -32
  610. package/test/spec/modules/pubwiseBidAdapter_spec.js +10 -6
  611. package/test/spec/modules/relaidoBidAdapter_spec.js +6 -2
  612. package/test/spec/modules/revcontentBidAdapter_spec.js +0 -10
  613. package/test/spec/modules/richaudienceBidAdapter_spec.js +5 -1
  614. package/test/spec/modules/rubiconBidAdapter_spec.js +26 -7
  615. package/test/spec/modules/scatteredBidAdapter_spec.js +0 -2
  616. package/test/spec/modules/seedingAllianceAdapter_spec.js +0 -13
  617. package/test/spec/modules/seedtagBidAdapter_spec.js +5 -1
  618. package/test/spec/modules/sharethroughBidAdapter_spec.js +6 -2
  619. package/test/spec/modules/sizeMapping_spec.js +342 -0
  620. package/test/spec/modules/slimcutBidAdapter_spec.js +0 -1
  621. package/test/spec/modules/smaatoBidAdapter_spec.js +3 -2
  622. package/test/spec/modules/smartadserverBidAdapter_spec.js +15 -3
  623. package/test/spec/modules/smilewantedBidAdapter_spec.js +25 -6
  624. package/test/spec/modules/sspBCBidAdapter_spec.js +4 -4
  625. package/test/spec/modules/taboolaBidAdapter_spec.js +10 -12
  626. package/test/spec/modules/teadsBidAdapter_spec.js +7 -0
  627. package/test/spec/modules/terceptAnalyticsAdapter_spec.js +0 -1
  628. package/test/spec/modules/ttdBidAdapter_spec.js +13 -5
  629. package/test/spec/modules/uid2IdSystem_spec.js +0 -10
  630. package/test/spec/modules/underdogmediaBidAdapter_spec.js +0 -1
  631. package/test/spec/modules/utiqSystem_spec.js +188 -0
  632. package/test/spec/modules/vidazooBidAdapter_spec.js +6 -2
  633. package/test/spec/modules/videobyteBidAdapter_spec.js +0 -1
  634. package/test/spec/modules/vrtcalBidAdapter_spec.js +9 -2
  635. package/test/spec/modules/winrBidAdapter_spec.js +0 -9
  636. package/test/spec/modules/xeBidAdapter_spec.js +6 -2
  637. package/test/spec/unit/core/adapterManager_spec.js +69 -115
  638. package/test/spec/unit/core/bidderFactory_spec.js +80 -152
  639. package/test/spec/unit/core/targeting_spec.js +0 -6
  640. package/test/spec/utils_spec.js +21 -90
  641. package/dist/aolBidAdapter.js +0 -1
  642. package/dist/captifyRtdProvider.js +0 -1
  643. package/dist/emx_digitalBidAdapter.js +0 -1
  644. package/dist/glimpseBidAdapter.js +0 -1
  645. package/dist/googleAnalyticsAdapter.js +0 -1
  646. package/dist/inmarBidAdapter.js +0 -1
  647. package/dist/inskinBidAdapter.js +0 -1
  648. package/dist/liveyieldAnalyticsAdapter.js +0 -1
  649. package/dist/mass.js +0 -1
  650. package/dist/openxAnalyticsAdapter.js +0 -1
  651. package/dist/openxOrtbBidAdapter.js +0 -1
  652. package/dist/pubCommonId.js +0 -1
  653. package/dist/realvuAnalyticsAdapter.js +0 -1
  654. package/dist/rubiconAnalyticsAdapter.js +0 -1
  655. package/dist/synacormediaBidAdapter.js +0 -1
  656. package/dist/trustpidSystem.js +0 -1
  657. package/dist/viewability.js +0 -1
  658. package/dist/zeusPrimeRtdProvider.js +0 -21
  659. package/integrationExamples/gpt/captifyRtdProvider_example.html +0 -167
  660. package/integrationExamples/mass/index.html +0 -132
  661. package/modules/aolBidAdapter.js +0 -462
  662. package/modules/aolBidAdapter.md +0 -46
  663. package/modules/captifyRtdProvider.js +0 -146
  664. package/modules/captifyRtdProvider.md +0 -68
  665. package/modules/conversantAnalyticsAdapter.md +0 -46
  666. package/modules/conversantBidAdapter.md +0 -46
  667. package/modules/glimpseBidAdapter.js +0 -198
  668. package/modules/glimpseBidAdapter.md +0 -37
  669. package/modules/googleAnalyticsAdapter.js +0 -298
  670. package/modules/googleAnalyticsAdapter.md +0 -38
  671. package/modules/inmarBidAdapter.js +0 -132
  672. package/modules/inmarBidAdapter.md +0 -44
  673. package/modules/inskinBidAdapter.js +0 -391
  674. package/modules/inskinBidAdapter.md +0 -31
  675. package/modules/liveyieldAnalyticsAdapter.js +0 -454
  676. package/modules/liveyieldAnalyticsAdapter.md +0 -45
  677. package/modules/mass.js +0 -184
  678. package/modules/mass.md +0 -137
  679. package/modules/openxAnalyticsAdapter.js +0 -27
  680. package/modules/openxAnalyticsAdapter.md +0 -135
  681. package/modules/openxOrtbBidAdapter.js +0 -238
  682. package/modules/openxOrtbBidAdapter.md +0 -108
  683. package/modules/pubCommonId.js +0 -303
  684. package/modules/pubCommonId.md +0 -37
  685. package/modules/realvuAnalyticsAdapter.js +0 -976
  686. package/modules/realvuAnalyticsAdapter.md +0 -9
  687. package/modules/rubiconAnalyticsAdapter.js +0 -938
  688. package/modules/trustpidSystem.js +0 -143
  689. package/modules/viewability.js +0 -9
  690. package/modules/zeusPrimeRtdProvider.js +0 -37
  691. package/modules/zeusPrimeRtdProvider.md +0 -63
  692. package/test/spec/modules/aolBidAdapter_spec.js +0 -890
  693. package/test/spec/modules/captifyRtdProvider_spec.js +0 -253
  694. package/test/spec/modules/glimpseBidAdapter_spec.js +0 -422
  695. package/test/spec/modules/googleAnalyticsAdapter_spec.js +0 -27
  696. package/test/spec/modules/inmarBidAdapter_spec.js +0 -242
  697. package/test/spec/modules/inskinBidAdapter_spec.js +0 -386
  698. package/test/spec/modules/liveyieldAnalyticsAdapter_spec.js +0 -704
  699. package/test/spec/modules/mass_spec.js +0 -141
  700. package/test/spec/modules/openxAnalyticsAdapter_spec.js +0 -21
  701. package/test/spec/modules/openxOrtbBidAdapter_spec.js +0 -1615
  702. package/test/spec/modules/pubCommonId_spec.js +0 -353
  703. package/test/spec/modules/rubiconAnalyticsAdapter_spec.js +0 -2540
  704. package/test/spec/modules/rubiconAnalyticsSchema.json +0 -494
  705. package/test/spec/modules/trustpidSystem_spec.js +0 -237
  706. package/test/spec/sizeMapping_spec.js +0 -341
@@ -1,1615 +0,0 @@
1
- import {expect} from 'chai';
2
- import {spec, REQUEST_URL, SYNC_URL, DEFAULT_PH} from 'modules/openxOrtbBidAdapter.js';
3
- import {newBidder} from 'src/adapters/bidderFactory.js';
4
- import {BANNER, VIDEO} from 'src/mediaTypes.js';
5
- import {config} from 'src/config.js';
6
- import * as utils from 'src/utils.js';
7
- // load modules that register ORTB processors
8
- import 'src/prebid.js'
9
- import 'modules/currency.js';
10
- import 'modules/userId/index.js';
11
- import 'modules/multibid/index.js';
12
- import 'modules/priceFloors.js';
13
- import 'modules/consentManagement.js';
14
- import 'modules/consentManagementUsp.js';
15
- import 'modules/schain.js';
16
- import {deepClone} from 'src/utils.js';
17
- import {syncAddFPDToBidderRequest} from '../../helpers/fpd.js';
18
- import {hook} from '../../../src/hook.js';
19
-
20
- const DEFAULT_SYNC = SYNC_URL + '?ph=' + DEFAULT_PH;
21
-
22
- const BidRequestBuilder = function BidRequestBuilder(options) {
23
- const defaults = {
24
- request: {
25
- auctionId: '4fd1ca2d-846c-4211-b9e5-321dfe1709c9',
26
- adUnitCode: 'adunit-code',
27
- bidder: 'openx'
28
- },
29
- params: {
30
- unit: '12345678',
31
- delDomain: 'test-del-domain'
32
- },
33
- sizes: [[300, 250], [300, 600]],
34
- };
35
-
36
- const request = {
37
- ...defaults.request,
38
- ...options
39
- };
40
-
41
- this.withParams = (options) => {
42
- request.params = {
43
- ...defaults.params,
44
- ...options
45
- };
46
- return this;
47
- };
48
-
49
- this.build = () => request;
50
- };
51
-
52
- const BidderRequestBuilder = function BidderRequestBuilder(options) {
53
- const defaults = {
54
- bidderCode: 'openx',
55
- auctionId: '4fd1ca2d-846c-4211-b9e5-321dfe1709c9',
56
- bidderRequestId: '7g36s867Tr4xF90X',
57
- timeout: 3000,
58
- refererInfo: {
59
- numIframes: 0,
60
- reachedTop: true,
61
- referer: 'http://test.io/index.html?pbjs_debug=true'
62
- }
63
- };
64
-
65
- const request = {
66
- ...defaults,
67
- ...options
68
- };
69
-
70
- this.build = () => request;
71
- };
72
-
73
- describe('OpenxRtbAdapter', function () {
74
- before(() => {
75
- hook.ready();
76
- });
77
-
78
- const adapter = newBidder(spec);
79
-
80
- describe('inherited functions', function () {
81
- it('exists and is a function', function () {
82
- expect(adapter.callBids).to.exist.and.to.be.a('function');
83
- });
84
- });
85
-
86
- describe('isBidRequestValid()', function () {
87
- describe('when request is for a banner ad', function () {
88
- let bannerBid;
89
- beforeEach(function () {
90
- bannerBid = {
91
- bidder: 'openx',
92
- params: {},
93
- adUnitCode: 'adunit-code',
94
- mediaTypes: {banner: {}},
95
- sizes: [[300, 250], [300, 600]],
96
- bidId: '30b31c1838de1e',
97
- bidderRequestId: '22edbae2733bf6',
98
- auctionId: '1d1a030790a475'
99
- };
100
- });
101
-
102
- it('should return false when there is no delivery domain', function () {
103
- bannerBid.params = {'unit': '12345678'};
104
- expect(spec.isBidRequestValid(bannerBid)).to.equal(false);
105
- });
106
-
107
- describe('when there is a delivery domain', function () {
108
- beforeEach(function () {
109
- bannerBid.params = {delDomain: 'test-delivery-domain'}
110
- });
111
-
112
- it('should return false when there is no ad unit id and size', function () {
113
- expect(spec.isBidRequestValid(bannerBid)).to.equal(false);
114
- });
115
-
116
- it('should return true if there is an adunit id ', function () {
117
- bannerBid.params.unit = '12345678';
118
- expect(spec.isBidRequestValid(bannerBid)).to.equal(true);
119
- });
120
-
121
- it('should return true if there is no adunit id and sizes are defined', function () {
122
- bannerBid.mediaTypes.banner.sizes = [720, 90];
123
- expect(spec.isBidRequestValid(bannerBid)).to.equal(true);
124
- });
125
-
126
- it('should return false if no sizes are defined ', function () {
127
- expect(spec.isBidRequestValid(bannerBid)).to.equal(false);
128
- });
129
-
130
- it('should return false if sizes empty ', function () {
131
- bannerBid.mediaTypes.banner.sizes = [];
132
- expect(spec.isBidRequestValid(bannerBid)).to.equal(false);
133
- });
134
- });
135
- });
136
-
137
- describe('when request is for a multiformat ad', function () {
138
- describe('and request config uses mediaTypes video and banner', () => {
139
- const multiformatBid = {
140
- bidder: 'openx',
141
- params: {
142
- unit: '12345678',
143
- delDomain: 'test-del-domain'
144
- },
145
- adUnitCode: 'adunit-code',
146
- mediaTypes: {
147
- banner: {
148
- sizes: [[300, 250]]
149
- },
150
- video: {
151
- playerSize: [300, 250]
152
- }
153
- },
154
- bidId: '30b31c1838de1e',
155
- bidderRequestId: '22edbae2733bf6',
156
- auctionId: '1d1a030790a475',
157
- transactionId: '4008d88a-8137-410b-aa35-fbfdabcb478e'
158
- };
159
- it('should return true multisize when required params found', function () {
160
- expect(spec.isBidRequestValid(multiformatBid)).to.equal(true);
161
- });
162
- });
163
- });
164
-
165
- describe('when request is for a video ad', function () {
166
- describe('and request config uses mediaTypes', () => {
167
- const videoBidWithMediaTypes = {
168
- bidder: 'openx',
169
- params: {
170
- unit: '12345678',
171
- delDomain: 'test-del-domain'
172
- },
173
- adUnitCode: 'adunit-code',
174
- mediaTypes: {
175
- video: {
176
- playerSize: [640, 480]
177
- }
178
- },
179
- bidId: '30b31c1838de1e',
180
- bidderRequestId: '22edbae2733bf6',
181
- auctionId: '1d1a030790a475',
182
- transactionId: '4008d88a-8137-410b-aa35-fbfdabcb478e'
183
- };
184
- it('should return true when required params found', function () {
185
- expect(spec.isBidRequestValid(videoBidWithMediaTypes)).to.equal(true);
186
- });
187
-
188
- it('should return false when required params are not passed', function () {
189
- let videoBidWithMediaTypes = Object.assign({}, videoBidWithMediaTypes);
190
- videoBidWithMediaTypes.params = {};
191
- expect(spec.isBidRequestValid(videoBidWithMediaTypes)).to.equal(false);
192
- });
193
- });
194
- describe('and request config uses both delDomain and platform', () => {
195
- const videoBidWithDelDomainAndPlatform = {
196
- bidder: 'openx',
197
- params: {
198
- unit: '12345678',
199
- delDomain: 'test-del-domain',
200
- platform: '1cabba9e-cafe-3665-beef-f00f00f00f00'
201
- },
202
- adUnitCode: 'adunit-code',
203
- mediaTypes: {
204
- video: {
205
- playerSize: [640, 480]
206
- }
207
- },
208
- bidId: '30b31c1838de1e',
209
- bidderRequestId: '22edbae2733bf6',
210
- auctionId: '1d1a030790a475',
211
- transactionId: '4008d88a-8137-410b-aa35-fbfdabcb478e'
212
- };
213
- it('should return true when required params found', function () {
214
- expect(spec.isBidRequestValid(videoBidWithDelDomainAndPlatform)).to.equal(true);
215
- });
216
-
217
- it('should return false when required params are not passed', function () {
218
- let videoBidWithMediaTypes = Object.assign({}, videoBidWithDelDomainAndPlatform);
219
- videoBidWithMediaTypes.params = {};
220
- expect(spec.isBidRequestValid(videoBidWithMediaTypes)).to.equal(false);
221
- });
222
- });
223
- describe('and request config uses mediaType', () => {
224
- const videoBidWithMediaType = {
225
- 'bidder': 'openx',
226
- 'params': {
227
- 'unit': '12345678',
228
- 'delDomain': 'test-del-domain'
229
- },
230
- 'adUnitCode': 'adunit-code',
231
- 'mediaType': 'video',
232
- 'sizes': [640, 480],
233
- 'bidId': '30b31c1838de1e',
234
- 'bidderRequestId': '22edbae2733bf6',
235
- 'auctionId': '1d1a030790a475',
236
- 'transactionId': '4008d88a-8137-410b-aa35-fbfdabcb478e'
237
- };
238
- it('should return true when required params found', function () {
239
- expect(spec.isBidRequestValid(videoBidWithMediaType)).to.equal(true);
240
- });
241
-
242
- it('should return false when required params are not passed', function () {
243
- let videoBidWithMediaType = Object.assign({}, videoBidWithMediaType);
244
- delete videoBidWithMediaType.params;
245
- videoBidWithMediaType.params = {};
246
- expect(spec.isBidRequestValid(videoBidWithMediaType)).to.equal(false);
247
- });
248
- });
249
- });
250
- });
251
-
252
- describe('buildRequests()', function () {
253
- let bidRequestsWithMediaTypes;
254
- let bidRequestsWithPlatform;
255
- let mockBidderRequest;
256
-
257
- beforeEach(function () {
258
- mockBidderRequest = {refererInfo: {}};
259
-
260
- bidRequestsWithMediaTypes = [{
261
- bidder: 'openx',
262
- params: {
263
- unit: '11',
264
- delDomain: 'test-del-domain',
265
- platform: '1cabba9e-cafe-3665-beef-f00f00f00f00',
266
- },
267
- adUnitCode: '/adunit-code/test-path',
268
- mediaTypes: {
269
- banner: {
270
- sizes: [[300, 250], [300, 600]]
271
- }
272
- },
273
- bidId: 'test-bid-id-1',
274
- bidderRequestId: 'test-bid-request-1',
275
- auctionId: 'test-auction-1',
276
- transactionId: 'test-transactionId-1',
277
- ortb2Imp: {
278
- ext: {
279
- ae: 2
280
- }
281
- }
282
- }, {
283
- bidder: 'openx',
284
- params: {
285
- unit: '22',
286
- delDomain: 'test-del-domain',
287
- platform: '1cabba9e-cafe-3665-beef-f00f00f00f00',
288
- },
289
- adUnitCode: 'adunit-code',
290
- mediaTypes: {
291
- video: {
292
- playerSize: [640, 480]
293
- }
294
- },
295
- bidId: 'test-bid-id-2',
296
- bidderRequestId: 'test-bid-request-2',
297
- auctionId: 'test-auction-2',
298
- transactionId: 'test-transactionId-2'
299
- }];
300
- });
301
-
302
- context('common requests checks', function() {
303
- it('should be able to handle multiformat requests', () => {
304
- const multiformat = utils.deepClone(bidRequestsWithMediaTypes[0]);
305
- multiformat.mediaTypes.video = {
306
- context: 'outstream',
307
- playerSize: [640, 480]
308
- }
309
- const requests = spec.buildRequests([multiformat], mockBidderRequest);
310
- const outgoingFormats = requests.flatMap(rq => rq.data.imp.flatMap(imp => ['banner', 'video'].filter(k => imp[k] != null)));
311
- const expected = FEATURES.VIDEO ? ['banner', 'video'] : ['banner']
312
- expect(outgoingFormats).to.have.members(expected);
313
- })
314
-
315
- it('should send bid request to openx url via POST', function () {
316
- const request = spec.buildRequests(bidRequestsWithMediaTypes, mockBidderRequest);
317
- expect(request[0].url).to.equal(REQUEST_URL);
318
- expect(request[0].method).to.equal('POST');
319
- });
320
-
321
- it('should send delivery domain, if available', function () {
322
- const request = spec.buildRequests(bidRequestsWithMediaTypes, mockBidderRequest);
323
- expect(request[0].data.ext.delDomain).to.equal(bidRequestsWithMediaTypes[0].params.delDomain);
324
- expect(request[0].data.ext.platformId).to.be.undefined;
325
- });
326
-
327
- it('should send platform id, if available', function () {
328
- bidRequestsWithMediaTypes[0].params.platform = '1cabba9e-cafe-3665-beef-f00f00f00f00';
329
- bidRequestsWithMediaTypes[1].params.platform = '1cabba9e-cafe-3665-beef-f00f00f00f00';
330
-
331
- const request = spec.buildRequests(bidRequestsWithMediaTypes, mockBidderRequest);
332
- expect(request[0].data.ext.platform).to.equal(bidRequestsWithMediaTypes[0].params.platform);
333
- expect(request[1].data.ext.platform).to.equal(bidRequestsWithMediaTypes[0].params.platform);
334
- });
335
-
336
- it('should send openx adunit codes', function () {
337
- const request = spec.buildRequests(bidRequestsWithMediaTypes, mockBidderRequest);
338
- expect(request[0].data.imp[0].tagid).to.equal(bidRequestsWithMediaTypes[0].params.unit);
339
- expect(request[1].data.imp[0].tagid).to.equal(bidRequestsWithMediaTypes[1].params.unit);
340
- });
341
-
342
- it('should send out custom params on bids that have customParams specified', function () {
343
- const bidRequest = Object.assign({},
344
- bidRequestsWithMediaTypes[0],
345
- {
346
- params: {
347
- unit: '12345678',
348
- delDomain: 'test-del-domain',
349
- customParams: {'Test1': 'testval1+', 'test2': ['testval2/', 'testval3']}
350
- }
351
- }
352
- );
353
-
354
- mockBidderRequest.bids = [bidRequest];
355
- const request = spec.buildRequests([bidRequest], mockBidderRequest);
356
- expect(request[0].data.imp[0].ext.customParams).to.equal(bidRequest.params.customParams);
357
- })
358
-
359
- describe('floors', function () {
360
- it('should send out custom floors on bids that have customFloors, no currency as account currency is used', function () {
361
- const bidRequest = Object.assign({},
362
- bidRequestsWithMediaTypes[0],
363
- {
364
- params: {
365
- unit: '12345678',
366
- delDomain: 'test-del-domain',
367
- customFloor: 1.500
368
- }
369
- }
370
- );
371
-
372
- const request = spec.buildRequests([bidRequest], mockBidderRequest);
373
- expect(request[0].data.imp[0].bidfloor).to.equal(bidRequest.params.customFloor);
374
- expect(request[0].data.imp[0].bidfloorcur).to.equal(undefined);
375
- });
376
-
377
- context('with floors module', function () {
378
- let adServerCurrencyStub;
379
-
380
- beforeEach(function () {
381
- adServerCurrencyStub = sinon
382
- .stub(config, 'getConfig')
383
- .withArgs('currency.adServerCurrency')
384
- });
385
-
386
- afterEach(function () {
387
- config.getConfig.restore();
388
- });
389
-
390
- it('should send out floors on bids in USD', function () {
391
- const bidRequest = Object.assign({},
392
- bidRequestsWithMediaTypes[0],
393
- {
394
- getFloor: () => {
395
- return {
396
- currency: 'USD',
397
- floor: 9.99
398
- }
399
- }
400
- }
401
- );
402
-
403
- const request = spec.buildRequests([bidRequest], mockBidderRequest);
404
- expect(request[0].data.imp[0].bidfloor).to.equal(9.99);
405
- expect(request[0].data.imp[0].bidfloorcur).to.equal('USD');
406
- });
407
-
408
- it('should send not send floors', function () {
409
- adServerCurrencyStub.returns('EUR');
410
- const bidRequest = Object.assign({},
411
- bidRequestsWithMediaTypes[0],
412
- {
413
- getFloor: () => {
414
- return {
415
- currency: 'BTC',
416
- floor: 9.99
417
- }
418
- }
419
- }
420
- );
421
-
422
- const request = spec.buildRequests([bidRequest], mockBidderRequest);
423
- expect(request[0].data.imp[0].bidfloor).to.equal(undefined)
424
- expect(request[0].data.imp[0].bidfloorcur).to.equal(undefined)
425
- });
426
- })
427
- })
428
-
429
- describe('FPD', function() {
430
- let bidRequests;
431
- const mockBidderRequest = {refererInfo: {}};
432
-
433
- beforeEach(function () {
434
- bidRequests = [{
435
- bidder: 'openx',
436
- params: {
437
- unit: '12345678-banner',
438
- delDomain: 'test-del-domain'
439
- },
440
- adUnitCode: 'adunit-code',
441
- mediaTypes: {
442
- banner: {
443
- sizes: [[300, 250], [300, 600]]
444
- }
445
- },
446
- bidId: 'test-bid-id',
447
- bidderRequestId: 'test-bidder-request-id',
448
- auctionId: 'test-auction-id',
449
- transactionId: 'test-transaction-id-1'
450
- }, {
451
- bidder: 'openx',
452
- mediaTypes: {
453
- video: {
454
- playerSize: [640, 480]
455
- }
456
- },
457
- params: {
458
- unit: '12345678-video',
459
- delDomain: 'test-del-domain'
460
- },
461
- 'adUnitCode': 'adunit-code',
462
-
463
- bidId: 'test-bid-id',
464
- bidderRequestId: 'test-bidder-request-id',
465
- auctionId: 'test-auction-id',
466
- transactionId: 'test-transaction-id-2'
467
- }];
468
- });
469
-
470
- it('ortb2.site should be merged in the request', function() {
471
- const request = spec.buildRequests(bidRequests, {
472
- ...mockBidderRequest,
473
- 'ortb2': {
474
- site: {
475
- domain: 'page.example.com',
476
- cat: ['IAB2'],
477
- sectioncat: ['IAB2-2']
478
- }
479
- }
480
- });
481
- let data = request[0].data;
482
- expect(data.site.domain).to.equal('page.example.com');
483
- expect(data.site.cat).to.deep.equal(['IAB2']);
484
- expect(data.site.sectioncat).to.deep.equal(['IAB2-2']);
485
- });
486
-
487
- it('ortb2.user should be merged in the request', function() {
488
- const request = spec.buildRequests(bidRequests, {
489
- ...mockBidderRequest,
490
- 'ortb2': {
491
- user: {
492
- yob: 1985
493
- }
494
- }
495
- });
496
- let data = request[0].data;
497
- expect(data.user.yob).to.equal(1985);
498
- });
499
-
500
- describe('ortb2Imp', function() {
501
- describe('ortb2Imp.ext.data.pbadslot', function() {
502
- beforeEach(function () {
503
- if (bidRequests[0].hasOwnProperty('ortb2Imp')) {
504
- delete bidRequests[0].ortb2Imp;
505
- }
506
- });
507
-
508
- it('should not send if imp[].ext.data object is invalid', function() {
509
- bidRequests[0].ortb2Imp = {
510
- ext: {}
511
- };
512
- const request = spec.buildRequests(bidRequests, mockBidderRequest);
513
- let data = request[0].data;
514
- expect(data.imp[0].ext).to.not.have.property('data');
515
- });
516
-
517
- it('should not send if imp[].ext.data.pbadslot is undefined', function() {
518
- bidRequests[0].ortb2Imp = {
519
- ext: {
520
- data: {
521
- }
522
- }
523
- };
524
- const request = spec.buildRequests(bidRequests, mockBidderRequest);
525
- let data = request[0].data;
526
- if (data.imp[0].ext.data) {
527
- expect(data.imp[0].ext.data).to.not.have.property('pbadslot');
528
- } else {
529
- expect(data.imp[0].ext).to.not.have.property('data');
530
- }
531
- });
532
-
533
- it('should send if imp[].ext.data.pbadslot is string', function() {
534
- bidRequests[0].ortb2Imp = {
535
- ext: {
536
- data: {
537
- pbadslot: 'abcd'
538
- }
539
- }
540
- };
541
- const request = spec.buildRequests(bidRequests, mockBidderRequest);
542
- let data = request[0].data;
543
- expect(data.imp[0].ext.data).to.have.property('pbadslot');
544
- expect(data.imp[0].ext.data.pbadslot).to.equal('abcd');
545
- });
546
- });
547
-
548
- describe('ortb2Imp.ext.data.adserver', function() {
549
- beforeEach(function () {
550
- if (bidRequests[0].hasOwnProperty('ortb2Imp')) {
551
- delete bidRequests[0].ortb2Imp;
552
- }
553
- });
554
-
555
- it('should not send if imp[].ext.data object is invalid', function() {
556
- bidRequests[0].ortb2Imp = {
557
- ext: {}
558
- };
559
- const request = spec.buildRequests(bidRequests, mockBidderRequest);
560
- let data = request[0].data;
561
- expect(data.imp[0].ext).to.not.have.property('data');
562
- });
563
-
564
- it('should not send if imp[].ext.data.adserver is undefined', function() {
565
- bidRequests[0].ortb2Imp = {
566
- ext: {
567
- data: {
568
- }
569
- }
570
- };
571
- const request = spec.buildRequests(bidRequests, mockBidderRequest);
572
- let data = request[0].data;
573
- if (data.imp[0].ext.data) {
574
- expect(data.imp[0].ext.data).to.not.have.property('adserver');
575
- } else {
576
- expect(data.imp[0].ext).to.not.have.property('data');
577
- }
578
- });
579
-
580
- it('should send', function() {
581
- let adSlotValue = 'abc';
582
- bidRequests[0].ortb2Imp = {
583
- ext: {
584
- data: {
585
- adserver: {
586
- name: 'GAM',
587
- adslot: adSlotValue
588
- }
589
- }
590
- }
591
- };
592
- const request = spec.buildRequests(bidRequests, mockBidderRequest);
593
- let data = request[0].data;
594
- expect(data.imp[0].ext.data.adserver.name).to.equal('GAM');
595
- expect(data.imp[0].ext.data.adserver.adslot).to.equal(adSlotValue);
596
- });
597
- });
598
-
599
- describe('ortb2Imp.ext.data.other', function() {
600
- beforeEach(function () {
601
- if (bidRequests[0].hasOwnProperty('ortb2Imp')) {
602
- delete bidRequests[0].ortb2Imp;
603
- }
604
- });
605
-
606
- it('should not send if imp[].ext.data object is invalid', function() {
607
- bidRequests[0].ortb2Imp = {
608
- ext: {}
609
- };
610
- const request = spec.buildRequests(bidRequests, mockBidderRequest);
611
- let data = request[0].data;
612
- expect(data.imp[0].ext).to.not.have.property('data');
613
- });
614
-
615
- it('should not send if imp[].ext.data.other is undefined', function() {
616
- bidRequests[0].ortb2Imp = {
617
- ext: {
618
- data: {
619
- }
620
- }
621
- };
622
- const request = spec.buildRequests(bidRequests, mockBidderRequest);
623
- let data = request[0].data;
624
- if (data.imp[0].ext.data) {
625
- expect(data.imp[0].ext.data).to.not.have.property('other');
626
- } else {
627
- expect(data.imp[0].ext).to.not.have.property('data');
628
- }
629
- });
630
-
631
- it('ortb2Imp.ext.data.other', function() {
632
- bidRequests[0].ortb2Imp = {
633
- ext: {
634
- data: {
635
- other: 1234
636
- }
637
- }
638
- };
639
- const request = spec.buildRequests(bidRequests, mockBidderRequest);
640
- let data = request[0].data;
641
- expect(data.imp[0].ext.data.other).to.equal(1234);
642
- });
643
- });
644
- });
645
-
646
- describe('with user agent client hints', function () {
647
- it('should add device.sua if available', function () {
648
- const bidderRequestWithUserAgentClientHints = { refererInfo: {},
649
- ortb2: {
650
- device: {
651
- sua: {
652
- source: 2,
653
- platform: {
654
- brand: 'macOS',
655
- version: [ '12', '4', '0' ]
656
- },
657
- browsers: [
658
- {
659
- brand: 'Chromium',
660
- version: [ '106', '0', '5249', '119' ]
661
- },
662
- {
663
- brand: 'Google Chrome',
664
- version: [ '106', '0', '5249', '119' ]
665
- },
666
- {
667
- brand: 'Not;A=Brand',
668
- version: [ '99', '0', '0', '0' ]
669
- }],
670
- mobile: 0,
671
- model: 'Pro',
672
- bitness: '64',
673
- architecture: 'x86'
674
- }
675
- }
676
- }};
677
-
678
- let request = spec.buildRequests(bidRequests, bidderRequestWithUserAgentClientHints);
679
- expect(request[0].data.device.sua).to.exist;
680
- expect(request[0].data.device.sua).to.deep.equal(bidderRequestWithUserAgentClientHints.ortb2.device.sua);
681
- const bidderRequestWithoutUserAgentClientHints = {refererInfo: {}, ortb2: {}};
682
- request = spec.buildRequests(bidRequests, bidderRequestWithoutUserAgentClientHints);
683
- expect(request[0].data.device?.sua).to.not.exist;
684
- });
685
- });
686
- });
687
-
688
- context('when there is a consent management framework', function () {
689
- let bidRequests;
690
- let mockConfig;
691
- let bidderRequest;
692
-
693
- beforeEach(function () {
694
- bidRequests = [{
695
- bidder: 'openx',
696
- params: {
697
- unit: '12345678-banner',
698
- delDomain: 'test-del-domain'
699
- },
700
- adUnitCode: 'adunit-code',
701
- mediaTypes: {
702
- banner: {
703
- sizes: [[300, 250], [300, 600]]
704
- }
705
- },
706
- bidId: 'test-bid-id',
707
- bidderRequestId: 'test-bidder-request-id',
708
- auctionId: 'test-auction-id',
709
- transactionId: 'test-transaction-id-1'
710
- }, {
711
- bidder: 'openx',
712
- mediaTypes: {
713
- video: {
714
- playerSize: [640, 480]
715
- }
716
- },
717
- params: {
718
- unit: '12345678-video',
719
- delDomain: 'test-del-domain'
720
- },
721
- 'adUnitCode': 'adunit-code',
722
-
723
- bidId: 'test-bid-id',
724
- bidderRequestId: 'test-bidder-request-id',
725
- auctionId: 'test-auction-id',
726
- transactionId: 'test-transaction-id-2'
727
- }];
728
- });
729
-
730
- describe('us_privacy', function () {
731
- beforeEach(function () {
732
- bidderRequest = {
733
- uspConsent: '1YYN',
734
- refererInfo: {}
735
- };
736
-
737
- sinon.stub(config, 'getConfig').callsFake((key) => {
738
- return utils.deepAccess(mockConfig, key);
739
- });
740
- });
741
-
742
- afterEach(function () {
743
- config.getConfig.restore();
744
- });
745
-
746
- it('should send a signal to specify that US Privacy applies to this request', function () {
747
- const request = spec.buildRequests(bidRequests, syncAddFPDToBidderRequest(bidderRequest));
748
- expect(request[0].data.regs.ext.us_privacy).to.equal('1YYN');
749
- expect(request[1].data.regs.ext.us_privacy).to.equal('1YYN');
750
- });
751
-
752
- it('should not send the regs object, when consent string is undefined', function () {
753
- delete bidderRequest.uspConsent;
754
- const request = spec.buildRequests(bidRequests, syncAddFPDToBidderRequest(bidderRequest));
755
- expect(request[0].data.regs?.us_privacy).to.not.exist;
756
- });
757
- });
758
-
759
- describe('GDPR', function () {
760
- beforeEach(function () {
761
- bidderRequest = {
762
- gdprConsent: {
763
- consentString: 'test-gdpr-consent-string',
764
- addtlConsent: 'test-addtl-consent-string',
765
- gdprApplies: true
766
- },
767
- refererInfo: {}
768
- };
769
-
770
- mockConfig = {
771
- consentManagement: {
772
- cmpApi: 'iab',
773
- timeout: 1111,
774
- allowAuctionWithoutConsent: 'cancel'
775
- }
776
- };
777
-
778
- sinon.stub(config, 'getConfig').callsFake((key) => {
779
- return utils.deepAccess(mockConfig, key);
780
- });
781
- });
782
-
783
- afterEach(function () {
784
- config.getConfig.restore();
785
- });
786
-
787
- it('should send a signal to specify that GDPR applies to this request', function () {
788
- bidderRequest.bids = bidRequests;
789
- const request = spec.buildRequests(bidRequests, syncAddFPDToBidderRequest(bidderRequest));
790
- expect(request[0].data.regs.ext.gdpr).to.equal(1);
791
- expect(request[1].data.regs.ext.gdpr).to.equal(1);
792
- });
793
-
794
- it('should send the consent string', function () {
795
- bidderRequest.bids = bidRequests;
796
- const request = spec.buildRequests(bidRequests, syncAddFPDToBidderRequest(bidderRequest));
797
- expect(request[0].data.user.ext.consent).to.equal(bidderRequest.gdprConsent.consentString);
798
- expect(request[1].data.user.ext.consent).to.equal(bidderRequest.gdprConsent.consentString);
799
- });
800
-
801
- it('should send the addtlConsent string', function () {
802
- bidderRequest.bids = bidRequests;
803
- const request = spec.buildRequests(bidRequests, syncAddFPDToBidderRequest(bidderRequest));
804
- expect(request[0].data.user.ext.ConsentedProvidersSettings.consented_providers).to.equal(bidderRequest.gdprConsent.addtlConsent);
805
- expect(request[1].data.user.ext.ConsentedProvidersSettings.consented_providers).to.equal(bidderRequest.gdprConsent.addtlConsent);
806
- });
807
-
808
- it('should send a signal to specify that GDPR does not apply to this request', function () {
809
- bidderRequest.gdprConsent.gdprApplies = false;
810
- bidderRequest.bids = bidRequests;
811
- const request = spec.buildRequests(bidRequests, syncAddFPDToBidderRequest(bidderRequest));
812
- expect(request[0].data.regs.ext.gdpr).to.equal(0);
813
- expect(request[1].data.regs.ext.gdpr).to.equal(0);
814
- });
815
-
816
- it('when GDPR application is undefined, should not send a signal to specify whether GDPR applies to this request, ' +
817
- 'but can send consent data, ', function () {
818
- delete bidderRequest.gdprConsent.gdprApplies;
819
- bidderRequest.bids = bidRequests;
820
- const request = spec.buildRequests(bidRequests, syncAddFPDToBidderRequest(bidderRequest));
821
- expect(request[0].data.regs?.ext?.gdpr).to.not.be.ok;
822
- expect(request[0].data.user.ext.consent).to.equal(bidderRequest.gdprConsent.consentString);
823
- expect(request[1].data.user.ext.consent).to.equal(bidderRequest.gdprConsent.consentString);
824
- });
825
-
826
- it('when consent string is undefined, should not send the consent string, ', function () {
827
- delete bidderRequest.gdprConsent.consentString;
828
- bidderRequest.bids = bidRequests;
829
- const request = spec.buildRequests(bidRequests, syncAddFPDToBidderRequest(bidderRequest));
830
- expect(request[0].data.imp[0].ext.consent).to.equal(undefined);
831
- expect(request[1].data.imp[0].ext.consent).to.equal(undefined);
832
- });
833
- });
834
- });
835
-
836
- context('coppa', function() {
837
- it('when there are no coppa param settings, should not send a coppa flag', function () {
838
- const request = spec.buildRequests(bidRequestsWithMediaTypes, syncAddFPDToBidderRequest(mockBidderRequest));
839
- expect(request[0].data.regs?.coppa).to.be.not.ok;
840
- });
841
-
842
- it('should send a coppa flag there is when there is coppa param settings in the bid requests', function () {
843
- let mockConfig = {
844
- coppa: true
845
- };
846
-
847
- sinon.stub(config, 'getConfig').callsFake((key) => {
848
- return utils.deepAccess(mockConfig, key);
849
- });
850
-
851
- const request = spec.buildRequests(bidRequestsWithMediaTypes, syncAddFPDToBidderRequest(mockBidderRequest));
852
- expect(request[0].data.regs.coppa).to.equal(1);
853
- });
854
-
855
- it('should send a coppa flag there is when there is coppa param settings in the bid params', function () {
856
- const request = spec.buildRequests(bidRequestsWithMediaTypes, syncAddFPDToBidderRequest(mockBidderRequest));
857
- request.params = {coppa: true};
858
- expect(request[0].data.regs.coppa).to.equal(1);
859
- });
860
-
861
- after(function () {
862
- config.getConfig.restore()
863
- });
864
- });
865
-
866
- context('do not track (DNT)', function() {
867
- let doNotTrackStub;
868
-
869
- beforeEach(function () {
870
- doNotTrackStub = sinon.stub(utils, 'getDNT');
871
- });
872
- afterEach(function() {
873
- doNotTrackStub.restore();
874
- });
875
-
876
- it('when there is a do not track, should send a dnt', function () {
877
- doNotTrackStub.returns(1);
878
-
879
- const request = spec.buildRequests(bidRequestsWithMediaTypes, syncAddFPDToBidderRequest(mockBidderRequest));
880
- expect(request[0].data.device.dnt).to.equal(1);
881
- });
882
-
883
- it('when there is not do not track, don\'t send dnt', function () {
884
- doNotTrackStub.returns(0);
885
-
886
- const request = spec.buildRequests(bidRequestsWithMediaTypes, syncAddFPDToBidderRequest(mockBidderRequest));
887
- expect(request[0].data.device.dnt).to.equal(0);
888
- });
889
-
890
- it('when there is no defined do not track, don\'t send dnt', function () {
891
- doNotTrackStub.returns(null);
892
-
893
- const request = spec.buildRequests(bidRequestsWithMediaTypes, syncAddFPDToBidderRequest(mockBidderRequest));
894
- expect(request[0].data.device.dnt).to.equal(0);
895
- });
896
- });
897
-
898
- context('supply chain (schain)', function () {
899
- let bidRequests;
900
- let schainConfig;
901
- const supplyChainNodePropertyOrder = ['asi', 'sid', 'hp', 'rid', 'name', 'domain'];
902
-
903
- beforeEach(function () {
904
- schainConfig = {
905
- ver: '1.0',
906
- complete: 1,
907
- nodes: [
908
- {
909
- asi: 'exchange1.com',
910
- sid: '1234',
911
- hp: 1,
912
- rid: 'bid-request-1',
913
- name: 'publisher',
914
- domain: 'publisher.com'
915
- // omitted ext
916
- },
917
- {
918
- asi: 'exchange2.com',
919
- sid: 'abcd',
920
- hp: 1,
921
- rid: 'bid-request-2',
922
- // name field missing
923
- domain: 'intermediary.com'
924
- },
925
- {
926
- asi: 'exchange3.com',
927
- sid: '4321',
928
- hp: 1,
929
- // request id
930
- // name field missing
931
- domain: 'intermediary-2.com'
932
- }
933
- ]
934
- };
935
-
936
- bidRequests = [{
937
- bidder: 'openx',
938
- params: {
939
- unit: '11',
940
- delDomain: 'test-del-domain'
941
- },
942
- adUnitCode: '/adunit-code/test-path',
943
- mediaTypes: {
944
- banner: {
945
- sizes: [[300, 250], [300, 600]]
946
- }
947
- },
948
- bidId: 'test-bid-id-1',
949
- bidderRequestId: 'test-bid-request-1',
950
- auctionId: 'test-auction-1',
951
- schain: schainConfig
952
- }];
953
- });
954
-
955
- it('should send a supply chain object', function () {
956
- const request = spec.buildRequests(bidRequests, mockBidderRequest);
957
- expect(request[0].data.source.ext.schain).to.equal(schainConfig);
958
- });
959
-
960
- it('should send the supply chain object with the right version', function () {
961
- const request = spec.buildRequests(bidRequests, mockBidderRequest);
962
- expect(request[0].data.source.ext.schain.ver).to.equal(schainConfig.ver);
963
- });
964
-
965
- it('should send the supply chain object with the right complete value', function () {
966
- const request = spec.buildRequests(bidRequests, mockBidderRequest);
967
- expect(request[0].data.source.ext.schain.complete).to.equal(schainConfig.complete);
968
- });
969
- });
970
-
971
- context('when there are userid providers', function () {
972
- const userIdAsEids = [
973
- {
974
- source: 'adserver.org',
975
- uids: [{
976
- id: 'some-random-id-value',
977
- atype: 1,
978
- ext: {
979
- rtiPartner: 'TDID'
980
- }
981
- }]
982
- },
983
- {
984
- source: 'id5-sync.com',
985
- uids: [{
986
- id: 'some-random-id-value',
987
- atype: 1
988
- }]
989
- },
990
- {
991
- source: 'sharedid.org',
992
- uids: [{
993
- id: 'some-random-id-value',
994
- atype: 1,
995
- ext: {
996
- third: 'some-random-id-value'
997
- }
998
- }]
999
- }
1000
- ];
1001
-
1002
- it(`should send the user id under the extended ids`, function () {
1003
- const bidRequestsWithUserId = [{
1004
- bidder: 'openx',
1005
- params: {
1006
- unit: '11',
1007
- delDomain: 'test-del-domain'
1008
- },
1009
- userId: {
1010
- },
1011
- adUnitCode: 'adunit-code',
1012
- mediaTypes: {
1013
- banner: {
1014
- sizes: [[300, 250], [300, 600]]
1015
- }
1016
- },
1017
- bidId: 'test-bid-id-1',
1018
- bidderRequestId: 'test-bid-request-1',
1019
- auctionId: 'test-auction-1',
1020
- userIdAsEids: userIdAsEids
1021
- }];
1022
- // enrich bid request with userId key/value
1023
-
1024
- const request = spec.buildRequests(bidRequestsWithUserId, mockBidderRequest);
1025
- expect(request[0].data.user.ext.eids).to.equal(userIdAsEids);
1026
- });
1027
-
1028
- it(`when no user ids are available, it should not send any extended ids`, function () {
1029
- const request = spec.buildRequests(bidRequestsWithMediaTypes, mockBidderRequest);
1030
- expect(request[0].data).to.not.have.any.keys('user');
1031
- });
1032
- });
1033
-
1034
- context('FLEDGE', function() {
1035
- it('when FLEDGE is enabled, should send whatever is set in ortb2imp.ext.ae in all bid requests', function () {
1036
- const request = spec.buildRequests(bidRequestsWithMediaTypes, {
1037
- ...mockBidderRequest,
1038
- fledgeEnabled: true
1039
- });
1040
- expect(request[0].data.imp[0].ext.ae).to.equal(2);
1041
- });
1042
- });
1043
- });
1044
-
1045
- context('banner', function () {
1046
- it('should send bid request with a mediaTypes specified with banner type', function () {
1047
- const request = spec.buildRequests(bidRequestsWithMediaTypes, mockBidderRequest);
1048
- expect(request[0].data.imp[0]).to.have.any.keys(BANNER);
1049
- });
1050
- });
1051
-
1052
- if (FEATURES.VIDEO) {
1053
- context('video', function () {
1054
- it('should send bid request with a mediaTypes specified with video type', function () {
1055
- const request = spec.buildRequests(bidRequestsWithMediaTypes, mockBidderRequest);
1056
- expect(request[1].data.imp[0]).to.have.any.keys(VIDEO);
1057
- });
1058
-
1059
- it('Update imp.video with OpenRTB options from mimeTypes and params', function() {
1060
- const bid01 = new BidRequestBuilder({
1061
- adUnitCode: 'adunit-code-01',
1062
- mediaTypes: {
1063
- banner: { sizes: [[300, 250]] },
1064
- video: {
1065
- context: 'outstream',
1066
- playerSize: [[300, 250]],
1067
- mimes: ['video/mp4'],
1068
- protocols: [8]
1069
- }
1070
- },
1071
- }).withParams({
1072
- // options in video, will merge
1073
- video: {
1074
- skip: 1,
1075
- skipafter: 4,
1076
- minduration: 10,
1077
- maxduration: 30
1078
- }
1079
- }).build();
1080
-
1081
- const bidderRequest = new BidderRequestBuilder().build();
1082
- const expected = {
1083
- mimes: ['video/mp4'],
1084
- skip: 1,
1085
- skipafter: 4,
1086
- minduration: 10,
1087
- maxduration: 30,
1088
- placement: 4,
1089
- protocols: [8],
1090
- w: 300,
1091
- h: 250
1092
- };
1093
- const requests = spec.buildRequests([bid01], bidderRequest);
1094
- expect(requests).to.have.lengthOf(2);
1095
- expect(requests[1].data.imp[0].video).to.deep.equal(expected);
1096
- });
1097
- });
1098
- }
1099
- });
1100
-
1101
- describe('interpretResponse()', function () {
1102
- let bidRequestConfigs;
1103
- let bidRequest;
1104
- let bidResponse;
1105
- let bid;
1106
-
1107
- context('when there is an nbr response', function () {
1108
- let bids;
1109
- beforeEach(function () {
1110
- bidRequestConfigs = [{
1111
- bidder: 'openx',
1112
- params: {
1113
- unit: '12345678',
1114
- delDomain: 'test-del-domain'
1115
- },
1116
- adUnitCode: 'adunit-code',
1117
- mediaTypes: {
1118
- banner: {
1119
- sizes: [[300, 250], [300, 600]],
1120
- },
1121
- },
1122
- bidId: 'test-bid-id',
1123
- bidderRequestId: 'test-bidder-request-id',
1124
- auctionId: 'test-auction-id'
1125
- }];
1126
-
1127
- bidRequest = spec.buildRequests(bidRequestConfigs, {refererInfo: {}})[0];
1128
-
1129
- bidResponse = {nbr: 0}; // Unknown error
1130
- bids = spec.interpretResponse({body: bidResponse}, bidRequest);
1131
- });
1132
-
1133
- it('should not return any bids', function () {
1134
- expect(bids.length).to.equal(0);
1135
- });
1136
- });
1137
-
1138
- context('when no seatbid in response', function () {
1139
- let bids;
1140
- beforeEach(function () {
1141
- bidRequestConfigs = [{
1142
- bidder: 'openx',
1143
- params: {
1144
- unit: '12345678',
1145
- delDomain: 'test-del-domain'
1146
- },
1147
- adUnitCode: 'adunit-code',
1148
- mediaTypes: {
1149
- banner: {
1150
- sizes: [[300, 250], [300, 600]],
1151
- },
1152
- },
1153
- bidId: 'test-bid-id',
1154
- bidderRequestId: 'test-bidder-request-id',
1155
- auctionId: 'test-auction-id'
1156
- }];
1157
-
1158
- bidRequest = spec.buildRequests(bidRequestConfigs, {refererInfo: {}})[0];
1159
-
1160
- bidResponse = {ext: {}, id: 'test-bid-id'};
1161
- bids = spec.interpretResponse({body: bidResponse}, bidRequest);
1162
- });
1163
-
1164
- it('should not return any bids', function () {
1165
- expect(bids.length).to.equal(0);
1166
- });
1167
- });
1168
-
1169
- context('when there is no response', function () {
1170
- let bids;
1171
- beforeEach(function () {
1172
- bidRequestConfigs = [{
1173
- bidder: 'openx',
1174
- params: {
1175
- unit: '12345678',
1176
- delDomain: 'test-del-domain'
1177
- },
1178
- adUnitCode: 'adunit-code',
1179
- mediaTypes: {
1180
- banner: {
1181
- sizes: [[300, 250], [300, 600]],
1182
- },
1183
- },
1184
- bidId: 'test-bid-id',
1185
- bidderRequestId: 'test-bidder-request-id',
1186
- auctionId: 'test-auction-id'
1187
- }];
1188
-
1189
- bidRequest = spec.buildRequests(bidRequestConfigs, {refererInfo: {}})[0];
1190
-
1191
- bidResponse = ''; // Unknown error
1192
- bids = spec.interpretResponse({body: bidResponse}, bidRequest);
1193
- });
1194
-
1195
- it('should not return any bids', function () {
1196
- expect(bids.length).to.equal(0);
1197
- });
1198
- });
1199
-
1200
- const SAMPLE_BID_REQUESTS = [{
1201
- bidder: 'openx',
1202
- params: {
1203
- unit: '12345678',
1204
- delDomain: 'test-del-domain'
1205
- },
1206
- adUnitCode: 'adunit-code',
1207
- mediaTypes: {
1208
- banner: {
1209
- sizes: [[300, 250], [300, 600]],
1210
- },
1211
- },
1212
- bidId: 'test-bid-id',
1213
- bidderRequestId: 'test-bidder-request-id',
1214
- auctionId: 'test-auction-id'
1215
- }];
1216
-
1217
- const SAMPLE_BID_RESPONSE = {
1218
- seatbid: [{
1219
- bid: [{
1220
- impid: 'test-bid-id',
1221
- price: 2,
1222
- w: 300,
1223
- h: 250,
1224
- crid: 'test-creative-id',
1225
- dealid: 'test-deal-id',
1226
- adm: 'test-ad-markup',
1227
- adomain: ['brand.com'],
1228
- ext: {
1229
- dsp_id: '123',
1230
- buyer_id: '456',
1231
- brand_id: '789',
1232
- paf: {
1233
- content_id: 'paf_content_id'
1234
- }
1235
- }
1236
- }]
1237
- }],
1238
- cur: 'AUS',
1239
- ext: {
1240
- paf: {
1241
- transmission: {version: '12'}
1242
- }
1243
- }
1244
- };
1245
-
1246
- context('when there is a response, the common response properties', function () {
1247
- beforeEach(function () {
1248
- bidRequestConfigs = deepClone(SAMPLE_BID_REQUESTS);
1249
- bidRequest = spec.buildRequests(bidRequestConfigs, {refererInfo: {}})[0];
1250
- bidResponse = deepClone(SAMPLE_BID_RESPONSE);
1251
-
1252
- bid = spec.interpretResponse({body: bidResponse}, bidRequest)[0];
1253
- });
1254
-
1255
- it('should return a price', function () {
1256
- expect(bid.cpm).to.equal(bidResponse.seatbid[0].bid[0].price);
1257
- });
1258
-
1259
- it('should return a request id', function () {
1260
- expect(bid.requestId).to.equal(bidResponse.seatbid[0].bid[0].impid);
1261
- });
1262
-
1263
- it('should return width and height for the creative', function () {
1264
- expect(bid.width).to.equal(bidResponse.seatbid[0].bid[0].w);
1265
- expect(bid.height).to.equal(bidResponse.seatbid[0].bid[0].h);
1266
- });
1267
-
1268
- it('should return a creativeId', function () {
1269
- expect(bid.creativeId).to.equal(bidResponse.seatbid[0].bid[0].crid);
1270
- });
1271
-
1272
- it('should return an ad', function () {
1273
- expect(bid.ad).to.equal(bidResponse.seatbid[0].bid[0].adm);
1274
- });
1275
-
1276
- it('should return a deal id if it exists', function () {
1277
- expect(bid.dealId).to.equal(bidResponse.seatbid[0].bid[0].dealid);
1278
- });
1279
-
1280
- it('should have a time-to-live of 5 minutes', function () {
1281
- expect(bid.ttl).to.equal(300);
1282
- });
1283
-
1284
- it('should always return net revenue', function () {
1285
- expect(bid.netRevenue).to.equal(true);
1286
- });
1287
-
1288
- it('should return a currency', function () {
1289
- expect(bid.currency).to.equal(bidResponse.cur);
1290
- });
1291
-
1292
- it('should return a brand ID', function () {
1293
- expect(bid.meta.brandId).to.equal(bidResponse.seatbid[0].bid[0].ext.brand_id);
1294
- });
1295
-
1296
- it('should return a dsp ID', function () {
1297
- expect(bid.meta.networkId).to.equal(bidResponse.seatbid[0].bid[0].ext.dsp_id);
1298
- });
1299
-
1300
- it('should return a buyer ID', function () {
1301
- expect(bid.meta.advertiserId).to.equal(bidResponse.seatbid[0].bid[0].ext.buyer_id);
1302
- });
1303
-
1304
- it('should return adomain', function () {
1305
- expect(bid.meta.advertiserDomains).to.equal(bidResponse.seatbid[0].bid[0].adomain);
1306
- });
1307
-
1308
- it('should return paf fields', function () {
1309
- const paf = {
1310
- transmission: {version: '12'},
1311
- content_id: 'paf_content_id'
1312
- }
1313
- expect(bid.meta.paf).to.deep.equal(paf);
1314
- });
1315
- });
1316
-
1317
- context('when there is more than one response', () => {
1318
- let bids;
1319
- beforeEach(function () {
1320
- bidRequestConfigs = deepClone(SAMPLE_BID_REQUESTS);
1321
- bidRequest = spec.buildRequests(bidRequestConfigs, {refererInfo: {}})[0];
1322
- bidResponse = deepClone(SAMPLE_BID_RESPONSE);
1323
- bidResponse.seatbid[0].bid.push(deepClone(bidResponse.seatbid[0].bid[0]));
1324
- bidResponse.seatbid[0].bid[1].ext.paf.content_id = 'second_paf'
1325
-
1326
- bids = spec.interpretResponse({body: bidResponse}, bidRequest);
1327
- });
1328
-
1329
- it('should not confuse paf content_id', () => {
1330
- expect(bids.map(b => b.meta.paf.content_id)).to.eql(['paf_content_id', 'second_paf']);
1331
- });
1332
- })
1333
-
1334
- context('when the response is a banner', function() {
1335
- beforeEach(function () {
1336
- bidRequestConfigs = [{
1337
- bidder: 'openx',
1338
- params: {
1339
- unit: '12345678',
1340
- delDomain: 'test-del-domain'
1341
- },
1342
- adUnitCode: 'adunit-code',
1343
- mediaTypes: {
1344
- banner: {
1345
- sizes: [[300, 250], [300, 600]],
1346
- },
1347
- },
1348
- bidId: 'test-bid-id',
1349
- bidderRequestId: 'test-bidder-request-id',
1350
- auctionId: 'test-auction-id'
1351
- }];
1352
-
1353
- bidRequest = spec.buildRequests(bidRequestConfigs, {refererInfo: {}})[0];
1354
-
1355
- bidResponse = {
1356
- seatbid: [{
1357
- bid: [{
1358
- impid: 'test-bid-id',
1359
- price: 2,
1360
- w: 300,
1361
- h: 250,
1362
- crid: 'test-creative-id',
1363
- dealid: 'test-deal-id',
1364
- adm: 'test-ad-markup'
1365
- }]
1366
- }],
1367
- cur: 'AUS'
1368
- };
1369
-
1370
- bid = spec.interpretResponse({body: bidResponse}, bidRequest)[0];
1371
- });
1372
-
1373
- it('should return the proper mediaType', function () {
1374
- it('should return a creativeId', function () {
1375
- expect(bid.mediaType).to.equal(Object.keys(bidRequestConfigs[0].mediaTypes)[0]);
1376
- });
1377
- });
1378
- });
1379
-
1380
- if (FEATURES.VIDEO) {
1381
- context('when the response is a video', function() {
1382
- beforeEach(function () {
1383
- bidRequestConfigs = [{
1384
- bidder: 'openx',
1385
- params: {
1386
- unit: '12345678',
1387
- delDomain: 'test-del-domain'
1388
- },
1389
- adUnitCode: 'adunit-code',
1390
- mediaTypes: {
1391
- video: {
1392
- playerSize: [[640, 360], [854, 480]],
1393
- },
1394
- },
1395
- bidId: 'test-bid-id',
1396
- bidderRequestId: 'test-bidder-request-id',
1397
- auctionId: 'test-auction-id'
1398
- }];
1399
-
1400
- bidRequest = spec.buildRequests(bidRequestConfigs, {refererInfo: {}})[0];
1401
-
1402
- bidResponse = {
1403
- seatbid: [{
1404
- bid: [{
1405
- impid: 'test-bid-id',
1406
- price: 2,
1407
- w: 854,
1408
- h: 480,
1409
- crid: 'test-creative-id',
1410
- dealid: 'test-deal-id',
1411
- adm: 'test-ad-markup',
1412
- }]
1413
- }],
1414
- cur: 'AUS'
1415
- };
1416
- });
1417
-
1418
- it('should return the proper mediaType', function () {
1419
- bid = spec.interpretResponse({body: bidResponse}, bidRequest)[0];
1420
- expect(bid.mediaType).to.equal(Object.keys(bidRequestConfigs[0].mediaTypes)[0]);
1421
- });
1422
-
1423
- it('should return the proper mediaType', function () {
1424
- const winUrl = 'https//my.win.url';
1425
- bidResponse.seatbid[0].bid[0].nurl = winUrl
1426
- bid = spec.interpretResponse({body: bidResponse}, bidRequest)[0];
1427
-
1428
- expect(bid.vastUrl).to.equal(winUrl);
1429
- });
1430
- });
1431
- }
1432
-
1433
- context('when the response contains FLEDGE interest groups config', function() {
1434
- let response;
1435
-
1436
- beforeEach(function () {
1437
- sinon.stub(config, 'getConfig')
1438
- .withArgs('fledgeEnabled')
1439
- .returns(true);
1440
-
1441
- bidRequestConfigs = [{
1442
- bidder: 'openx',
1443
- params: {
1444
- unit: '12345678',
1445
- delDomain: 'test-del-domain'
1446
- },
1447
- adUnitCode: 'adunit-code',
1448
- mediaTypes: {
1449
- banner: {
1450
- sizes: [[300, 250], [300, 600]],
1451
- },
1452
- },
1453
- bidId: 'test-bid-id',
1454
- bidderRequestId: 'test-bidder-request-id',
1455
- auctionId: 'test-auction-id'
1456
- }];
1457
-
1458
- bidRequest = spec.buildRequests(bidRequestConfigs, {refererInfo: {}})[0];
1459
-
1460
- bidResponse = {
1461
- seatbid: [{
1462
- bid: [{
1463
- impid: 'test-bid-id',
1464
- price: 2,
1465
- w: 300,
1466
- h: 250,
1467
- crid: 'test-creative-id',
1468
- dealid: 'test-deal-id',
1469
- adm: 'test-ad-markup'
1470
- }]
1471
- }],
1472
- cur: 'AUS',
1473
- ext: {
1474
- fledge_auction_configs: {
1475
- 'test-bid-id': {
1476
- seller: 'codinginadtech.com',
1477
- interestGroupBuyers: ['somedomain.com'],
1478
- sellerTimeout: 0,
1479
- perBuyerSignals: {
1480
- 'somedomain.com': {
1481
- base_bid_micros: 0.1,
1482
- disallowed_advertiser_ids: [
1483
- '1234',
1484
- '2345'
1485
- ],
1486
- multiplier: 1.3,
1487
- use_bid_multiplier: true,
1488
- win_reporting_id: '1234567asdf'
1489
- }
1490
- }
1491
- }
1492
- }
1493
- }
1494
- };
1495
-
1496
- response = spec.interpretResponse({body: bidResponse}, bidRequest);
1497
- });
1498
-
1499
- afterEach(function () {
1500
- config.getConfig.restore();
1501
- });
1502
-
1503
- it('should return FLEDGE auction_configs alongside bids', function () {
1504
- expect(response).to.have.property('bids');
1505
- expect(response).to.have.property('fledgeAuctionConfigs');
1506
- expect(response.fledgeAuctionConfigs.length).to.equal(1);
1507
- expect(response.fledgeAuctionConfigs[0].bidId).to.equal('test-bid-id');
1508
- });
1509
- });
1510
- });
1511
-
1512
- describe('user sync', function () {
1513
- it('should register the default image pixel if no pixels available', function () {
1514
- let syncs = spec.getUserSyncs(
1515
- {pixelEnabled: true},
1516
- []
1517
- );
1518
- expect(syncs).to.deep.equal([{type: 'image', url: DEFAULT_SYNC}]);
1519
- });
1520
-
1521
- it('should register custom syncUrl when exists', function () {
1522
- let syncs = spec.getUserSyncs(
1523
- {pixelEnabled: true},
1524
- [{body: {ext: {delDomain: 'www.url.com'}}}]
1525
- );
1526
- expect(syncs).to.deep.equal([{type: 'image', url: 'https://www.url.com/w/1.0/pd'}]);
1527
- });
1528
-
1529
- it('should register custom syncUrl when exists', function () {
1530
- let syncs = spec.getUserSyncs(
1531
- {pixelEnabled: true},
1532
- [{body: {ext: {platform: 'abc'}}}]
1533
- );
1534
- expect(syncs).to.deep.equal([{type: 'image', url: SYNC_URL + '?ph=abc'}]);
1535
- });
1536
-
1537
- it('when iframe sync is allowed, it should register an iframe sync', function () {
1538
- let syncs = spec.getUserSyncs(
1539
- {iframeEnabled: true},
1540
- []
1541
- );
1542
- expect(syncs).to.deep.equal([{type: 'iframe', url: DEFAULT_SYNC}]);
1543
- });
1544
-
1545
- it('should prioritize iframe over image for user sync', function () {
1546
- let syncs = spec.getUserSyncs(
1547
- {iframeEnabled: true, pixelEnabled: true},
1548
- []
1549
- );
1550
- expect(syncs).to.deep.equal([{type: 'iframe', url: DEFAULT_SYNC}]);
1551
- });
1552
-
1553
- describe('when gdpr applies', function () {
1554
- let gdprConsent;
1555
- let gdprPixelUrl;
1556
- const consentString = 'gdpr-pixel-consent';
1557
- const gdprApplies = '1';
1558
- beforeEach(() => {
1559
- gdprConsent = {
1560
- consentString,
1561
- gdprApplies: true
1562
- };
1563
-
1564
- gdprPixelUrl = `${SYNC_URL}&gdpr=${gdprApplies}&gdpr_consent=${consentString}`;
1565
- });
1566
-
1567
- it('when there is a response, it should have the gdpr query params', () => {
1568
- let [{url}] = spec.getUserSyncs(
1569
- {iframeEnabled: true, pixelEnabled: true},
1570
- [],
1571
- gdprConsent
1572
- );
1573
-
1574
- expect(url).to.have.string(`gdpr_consent=${consentString}`);
1575
- expect(url).to.have.string(`gdpr=${gdprApplies}`);
1576
- });
1577
-
1578
- it('should not send signals if no consent object is available', function () {
1579
- let [{url}] = spec.getUserSyncs(
1580
- {iframeEnabled: true, pixelEnabled: true},
1581
- [],
1582
- );
1583
- expect(url).to.not.have.string('gdpr_consent=');
1584
- expect(url).to.not.have.string('gdpr=');
1585
- });
1586
- });
1587
-
1588
- describe('when ccpa applies', function () {
1589
- let usPrivacyConsent;
1590
- let uspPixelUrl;
1591
- const privacyString = 'TEST';
1592
- beforeEach(() => {
1593
- usPrivacyConsent = 'TEST';
1594
- uspPixelUrl = `${DEFAULT_SYNC}&us_privacy=${privacyString}`
1595
- });
1596
- it('should send the us privacy string, ', () => {
1597
- let [{url}] = spec.getUserSyncs(
1598
- {iframeEnabled: true, pixelEnabled: true},
1599
- [],
1600
- undefined,
1601
- usPrivacyConsent
1602
- );
1603
- expect(url).to.have.string(`us_privacy=${privacyString}`);
1604
- });
1605
-
1606
- it('should not send signals if no consent string is available', function () {
1607
- let [{url}] = spec.getUserSyncs(
1608
- {iframeEnabled: true, pixelEnabled: true},
1609
- [],
1610
- );
1611
- expect(url).to.not.have.string('us_privacy=');
1612
- });
1613
- });
1614
- });
1615
- });