prebid.js 7.43.0 → 7.44.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 (401) hide show
  1. package/dist/33acrossBidAdapter.js +1 -1
  2. package/dist/33acrossIdSystem.js +1 -1
  3. package/dist/adagioBidAdapter.js +1 -1
  4. package/dist/adbookpspBidAdapter.js +1 -1
  5. package/dist/adgenerationBidAdapter.js +1 -1
  6. package/dist/adkernelAdnAnalyticsAdapter.js +1 -1
  7. package/dist/admixerIdSystem.js +1 -1
  8. package/dist/adnuntiusBidAdapter.js +1 -1
  9. package/dist/adqueryBidAdapter.js +1 -1
  10. package/dist/adqueryIdSystem.js +1 -1
  11. package/dist/adrelevantisBidAdapter.js +1 -1
  12. package/dist/adrinoBidAdapter.js +1 -1
  13. package/dist/adriverIdSystem.js +1 -1
  14. package/dist/adsinteractiveBidAdapter.js +1 -0
  15. package/dist/adtrgtmeBidAdapter.js +1 -1
  16. package/dist/adxcgBidAdapter.js +1 -1
  17. package/dist/adyoulikeBidAdapter.js +1 -1
  18. package/dist/aidemBidAdapter.js +1 -1
  19. package/dist/airgridRtdProvider.js +1 -1
  20. package/dist/ajaBidAdapter.js +1 -1
  21. package/dist/akamaiDapRtdProvider.js +1 -1
  22. package/dist/amxBidAdapter.js +1 -1
  23. package/dist/amxIdSystem.js +1 -1
  24. package/dist/appierAnalyticsAdapter.js +1 -1
  25. package/dist/appnexusBidAdapter.js +1 -1
  26. package/dist/apstreamBidAdapter.js +1 -1
  27. package/dist/asoBidAdapter.js +1 -1
  28. package/dist/atsAnalyticsAdapter.js +1 -1
  29. package/dist/audiencerunBidAdapter.js +1 -1
  30. package/dist/axonixBidAdapter.js +1 -1
  31. package/dist/bedigitechBidAdapter.js +1 -0
  32. package/dist/bidglassBidAdapter.js +1 -1
  33. package/dist/big-richmediaBidAdapter.js +1 -1
  34. package/dist/bluebillywigBidAdapter.js +1 -1
  35. package/dist/blueconicRtdProvider.js +1 -1
  36. package/dist/bridgewellBidAdapter.js +1 -1
  37. package/dist/brightMountainMediaBidAdapter.js +1 -1
  38. package/dist/brightcomBidAdapter.js +1 -1
  39. package/dist/brightcomSSPBidAdapter.js +1 -1
  40. package/dist/browsiRtdProvider.js +1 -1
  41. package/dist/byDataAnalyticsAdapter.js +1 -1
  42. package/dist/carodaBidAdapter.js +1 -1
  43. package/dist/chtnwBidAdapter.js +1 -1
  44. package/dist/concertBidAdapter.js +1 -1
  45. package/dist/connectadBidAdapter.js +1 -1
  46. package/dist/consumableBidAdapter.js +1 -1
  47. package/dist/conversantAnalyticsAdapter.js +1 -1
  48. package/dist/conversantBidAdapter.js +1 -1
  49. package/dist/craftBidAdapter.js +1 -1
  50. package/dist/criteoBidAdapter.js +1 -1
  51. package/dist/criteoIdSystem.js +1 -1
  52. package/dist/cwireBidAdapter.js +1 -1
  53. package/dist/czechAdIdSystem.js +1 -1
  54. package/dist/dacIdSystem.js +1 -1
  55. package/dist/deepintentDpesIdSystem.js +1 -1
  56. package/dist/dependencies.json +3 -0
  57. package/dist/discoveryBidAdapter.js +1 -1
  58. package/dist/dspxBidAdapter.js +1 -1
  59. package/dist/eplanningBidAdapter.js +1 -1
  60. package/dist/feedadBidAdapter.js +1 -1
  61. package/dist/finativeBidAdapter.js +1 -1
  62. package/dist/fintezaAnalyticsAdapter.js +1 -1
  63. package/dist/fledgeForGpt.js +1 -1
  64. package/dist/freewheel-sspBidAdapter.js +1 -1
  65. package/dist/ftrackIdSystem.js +1 -1
  66. package/dist/gdprEnforcement.js +1 -1
  67. package/dist/glimpseBidAdapter.js +1 -1
  68. package/dist/gmosspBidAdapter.js +1 -1
  69. package/dist/gnetBidAdapter.js +1 -1
  70. package/dist/goldbachBidAdapter.js +1 -1
  71. package/dist/gravitoIdSystem.js +1 -1
  72. package/dist/greenbidsAnalyticsAdapter.js +1 -0
  73. package/dist/gridBidAdapter.js +1 -1
  74. package/dist/gridNMBidAdapter.js +1 -1
  75. package/dist/growthCodeAnalyticsAdapter.js +1 -1
  76. package/dist/growthCodeIdSystem.js +1 -1
  77. package/dist/gumgumBidAdapter.js +1 -1
  78. package/dist/h12mediaBidAdapter.js +1 -1
  79. package/dist/hadronAnalyticsAdapter.js +1 -1
  80. package/dist/hadronIdSystem.js +1 -1
  81. package/dist/hadronRtdProvider.js +1 -1
  82. package/dist/id5IdSystem.js +1 -1
  83. package/dist/idWardRtdProvider.js +1 -1
  84. package/dist/identityLinkIdSystem.js +1 -1
  85. package/dist/idxIdSystem.js +1 -1
  86. package/dist/imRtdProvider.js +1 -1
  87. package/dist/impactifyBidAdapter.js +1 -1
  88. package/dist/improvedigitalBidAdapter.js +1 -1
  89. package/dist/imuIdSystem.js +1 -1
  90. package/dist/inmarBidAdapter.js +1 -1
  91. package/dist/insticatorBidAdapter.js +1 -1
  92. package/dist/intentIqIdSystem.js +1 -1
  93. package/dist/invibesBidAdapter.js +1 -1
  94. package/dist/ixBidAdapter.js +1 -1
  95. package/dist/jixieBidAdapter.js +1 -1
  96. package/dist/justpremiumBidAdapter.js +1 -1
  97. package/dist/kargoBidAdapter.js +1 -1
  98. package/dist/konduitAnalyticsAdapter.js +1 -1
  99. package/dist/kueezBidAdapter.js +1 -1
  100. package/dist/kueezRtbBidAdapter.js +1 -1
  101. package/dist/kulturemediaBidAdapter.js +1 -1
  102. package/dist/lassoBidAdapter.js +1 -1
  103. package/dist/lifestreetBidAdapter.js +1 -1
  104. package/dist/liveIntentIdSystem.js +1 -1
  105. package/dist/liveyieldAnalyticsAdapter.js +1 -1
  106. package/dist/logicadBidAdapter.js +1 -1
  107. package/dist/loglyliftBidAdapter.js +1 -1
  108. package/dist/lotamePanoramaIdSystem.js +1 -1
  109. package/dist/magniteAnalyticsAdapter.js +1 -1
  110. package/dist/malltvAnalyticsAdapter.js +1 -1
  111. package/dist/marsmediaBidAdapter.js +1 -1
  112. package/dist/mediafuseBidAdapter.js +1 -1
  113. package/dist/mediagoBidAdapter.js +1 -1
  114. package/dist/mediakeysBidAdapter.js +1 -1
  115. package/dist/mediasquareBidAdapter.js +1 -1
  116. package/dist/merkleIdSystem.js +1 -1
  117. package/dist/mgidBidAdapter.js +1 -1
  118. package/dist/mgidRtdProvider.js +1 -1
  119. package/dist/minutemediaBidAdapter.js +1 -1
  120. package/dist/minutemediaplusBidAdapter.js +1 -1
  121. package/dist/mwOpenLinkIdSystem.js +1 -1
  122. package/dist/naveggIdSystem.js +1 -1
  123. package/dist/nexx360BidAdapter.js +1 -1
  124. package/dist/nobidBidAdapter.js +1 -1
  125. package/dist/not-for-prod/prebid.js +205 -202
  126. package/dist/novatiqIdSystem.js +1 -1
  127. package/dist/oguryBidAdapter.js +1 -1
  128. package/dist/onetagBidAdapter.js +1 -1
  129. package/dist/ooloAnalyticsAdapter.js +1 -1
  130. package/dist/openxOrtbBidAdapter.js +1 -1
  131. package/dist/optidigitalBidAdapter.js +1 -1
  132. package/dist/ortbConverter.js +1 -1
  133. package/dist/outbrainBidAdapter.js +1 -1
  134. package/dist/parrableIdSystem.js +1 -1
  135. package/dist/permutiveRtdProvider.js +1 -1
  136. package/dist/pixfutureBidAdapter.js +1 -1
  137. package/dist/prebid-core.js +1 -1
  138. package/dist/prebidServerBidAdapter.js +1 -1
  139. package/dist/prebidmanagerAnalyticsAdapter.js +1 -1
  140. package/dist/pubCommonId.js +1 -1
  141. package/dist/publinkIdSystem.js +1 -1
  142. package/dist/pubmaticAnalyticsAdapter.js +1 -1
  143. package/dist/pubmaticBidAdapter.js +1 -1
  144. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  145. package/dist/pxyzBidAdapter.js +1 -1
  146. package/dist/quantcastBidAdapter.js +1 -1
  147. package/dist/quantcastIdSystem.js +1 -1
  148. package/dist/readpeakBidAdapter.js +1 -1
  149. package/dist/realvuAnalyticsAdapter.js +1 -1
  150. package/dist/relaidoBidAdapter.js +1 -1
  151. package/dist/rhythmoneBidAdapter.js +1 -1
  152. package/dist/riseBidAdapter.js +1 -1
  153. package/dist/roxotAnalyticsAdapter.js +1 -1
  154. package/dist/rtbhouseBidAdapter.js +1 -1
  155. package/dist/rtdModule.js +1 -1
  156. package/dist/rubiconAnalyticsAdapter.js +1 -1
  157. package/dist/rubiconBidAdapter.js +1 -1
  158. package/dist/seedingAllianceBidAdapter.js +1 -1
  159. package/dist/seedtagBidAdapter.js +1 -1
  160. package/dist/sharedIdSystem.js +1 -1
  161. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  162. package/dist/sharethroughBidAdapter.js +1 -1
  163. package/dist/shinezBidAdapter.js +1 -1
  164. package/dist/sigmoidAnalyticsAdapter.js +1 -1
  165. package/dist/smaatoBidAdapter.js +1 -1
  166. package/dist/smartadserverBidAdapter.js +1 -1
  167. package/dist/smartxBidAdapter.js +1 -1
  168. package/dist/smilewantedBidAdapter.js +1 -1
  169. package/dist/sonobiBidAdapter.js +1 -1
  170. package/dist/sovrnAnalyticsAdapter.js +1 -1
  171. package/dist/sovrnBidAdapter.js +1 -1
  172. package/dist/sspBCBidAdapter.js +1 -1
  173. package/dist/staqAnalyticsAdapter.js +1 -1
  174. package/dist/stroeerCoreBidAdapter.js +1 -1
  175. package/dist/stvBidAdapter.js +1 -1
  176. package/dist/sublimeBidAdapter.js +1 -1
  177. package/dist/synacormediaBidAdapter.js +1 -1
  178. package/dist/taboolaBidAdapter.js +1 -1
  179. package/dist/targetVideoBidAdapter.js +1 -1
  180. package/dist/teadsBidAdapter.js +1 -1
  181. package/dist/teadsIdSystem.js +1 -1
  182. package/dist/trionBidAdapter.js +1 -1
  183. package/dist/tripleliftBidAdapter.js +1 -1
  184. package/dist/trustpidSystem.js +1 -1
  185. package/dist/ttdBidAdapter.js +1 -1
  186. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  187. package/dist/uid2IdSystem.js +1 -1
  188. package/dist/underdogmediaBidAdapter.js +1 -1
  189. package/dist/undertoneBidAdapter.js +1 -1
  190. package/dist/userId.js +1 -1
  191. package/dist/validationFpdModule.js +1 -1
  192. package/dist/vidazooBidAdapter.js +1 -1
  193. package/dist/videobyteBidAdapter.js +1 -1
  194. package/dist/vidoomyBidAdapter.js +1 -1
  195. package/dist/visxBidAdapter.js +1 -1
  196. package/dist/vuukleBidAdapter.js +1 -1
  197. package/dist/weboramaRtdProvider.js +1 -1
  198. package/dist/widespaceBidAdapter.js +1 -1
  199. package/dist/winrBidAdapter.js +1 -1
  200. package/dist/yahoosspBidAdapter.js +1 -1
  201. package/dist/yieldmoBidAdapter.js +1 -1
  202. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  203. package/dist/yuktamediaAnalyticsAdapter.js +1 -1
  204. package/dist/zeotapIdPlusIdSystem.js +1 -1
  205. package/dist/zeta_global_sspBidAdapter.js +1 -1
  206. package/libraries/ortbConverter/converter.js +3 -2
  207. package/modules/33acrossIdSystem.js +5 -2
  208. package/modules/adagioBidAdapter.js +3 -4
  209. package/modules/adkernelAdnAnalyticsAdapter.js +4 -2
  210. package/modules/admixerIdSystem.js +4 -2
  211. package/modules/adnuntiusBidAdapter.js +1 -1
  212. package/modules/adqueryBidAdapter.js +1 -1
  213. package/modules/adqueryIdSystem.js +2 -1
  214. package/modules/adrinoBidAdapter.js +24 -16
  215. package/modules/adriverIdSystem.js +3 -2
  216. package/modules/adsinteractiveBidAdapter.js +144 -0
  217. package/modules/adsinteractiveBidAdapter.md +31 -0
  218. package/modules/adyoulikeBidAdapter.js +2 -3
  219. package/modules/aidemBidAdapter.js +5 -0
  220. package/modules/airgridRtdProvider.js +4 -2
  221. package/modules/ajaBidAdapter.js +38 -16
  222. package/modules/akamaiDapRtdProvider.js +2 -1
  223. package/modules/amxBidAdapter.js +11 -9
  224. package/modules/appnexusBidAdapter.js +8 -8
  225. package/modules/apstreamBidAdapter.js +1 -1
  226. package/modules/atsAnalyticsAdapter.js +4 -2
  227. package/modules/audiencerunBidAdapter.js +9 -10
  228. package/modules/bedigitechBidAdapter.js +67 -0
  229. package/modules/bedigitechBidAdapter.md +32 -0
  230. package/modules/bluebillywigBidAdapter.js +2 -4
  231. package/modules/blueconicRtdProvider.js +2 -1
  232. package/modules/brightcomBidAdapter.js +0 -1
  233. package/modules/brightcomSSPBidAdapter.js +0 -1
  234. package/modules/browsiRtdProvider.js +4 -2
  235. package/modules/byDataAnalyticsAdapter.js +6 -3
  236. package/modules/concertBidAdapter.js +14 -7
  237. package/modules/connectadBidAdapter.js +2 -4
  238. package/modules/craftBidAdapter.js +29 -24
  239. package/modules/criteoBidAdapter.js +4 -2
  240. package/modules/criteoIdSystem.js +6 -2
  241. package/modules/czechAdIdSystem.js +3 -2
  242. package/modules/dacIdSystem.js +4 -3
  243. package/modules/deepintentDpesIdSystem.js +3 -2
  244. package/modules/discoveryBidAdapter.js +1 -1
  245. package/modules/dspxBidAdapter.js +223 -15
  246. package/modules/fintezaAnalyticsAdapter.js +5 -3
  247. package/modules/fledgeForGpt.js +54 -6
  248. package/modules/ftrackIdSystem.js +6 -6
  249. package/modules/gdprEnforcement.js +56 -68
  250. package/modules/glimpseBidAdapter.js +1 -4
  251. package/modules/gnetBidAdapter.js +1 -2
  252. package/modules/gravitoIdSystem.js +5 -3
  253. package/modules/greenbidsAnalyticsAdapter.js +181 -0
  254. package/modules/greenbidsAnalyticsAdapter.md +23 -0
  255. package/modules/gridBidAdapter.js +13 -7
  256. package/modules/growthCodeAnalyticsAdapter.js +3 -2
  257. package/modules/growthCodeIdSystem.js +3 -2
  258. package/modules/gumgumBidAdapter.js +7 -17
  259. package/modules/hadronAnalyticsAdapter.js +5 -3
  260. package/modules/hadronIdSystem.js +3 -1
  261. package/modules/hadronRtdProvider.js +4 -2
  262. package/modules/id5IdSystem.js +4 -2
  263. package/modules/idWardRtdProvider.js +2 -1
  264. package/modules/identityLinkIdSystem.js +5 -2
  265. package/modules/idxIdSystem.js +3 -2
  266. package/modules/imRtdProvider.js +3 -1
  267. package/modules/impactifyBidAdapter.js +2 -4
  268. package/modules/imuIdSystem.js +6 -3
  269. package/modules/insticatorBidAdapter.js +1 -1
  270. package/modules/intentIqIdSystem.js +3 -2
  271. package/modules/invibesBidAdapter.js +1 -1
  272. package/modules/ixBidAdapter.js +1 -1
  273. package/modules/jixieBidAdapter.js +3 -6
  274. package/modules/kargoBidAdapter.js +1 -1
  275. package/modules/kueezRtbBidAdapter.js +1 -1
  276. package/modules/liveIntentIdSystem.js +3 -2
  277. package/modules/lotamePanoramaIdSystem.js +3 -2
  278. package/modules/magniteAnalyticsAdapter.js +25 -6
  279. package/modules/mediafuseBidAdapter.js +1 -1
  280. package/modules/mediagoBidAdapter.js +1 -1
  281. package/modules/mediakeysBidAdapter.js +2 -3
  282. package/modules/merkleIdSystem.js +2 -1
  283. package/modules/mgidBidAdapter.js +1 -1
  284. package/modules/mgidRtdProvider.js +3 -1
  285. package/modules/minutemediaplusBidAdapter.js +1 -1
  286. package/modules/mwOpenLinkIdSystem.js +3 -2
  287. package/modules/naveggIdSystem.js +3 -2
  288. package/modules/nexx360BidAdapter.js +0 -1
  289. package/modules/nobidBidAdapter.js +1 -1
  290. package/modules/novatiqIdSystem.js +6 -3
  291. package/modules/onetagBidAdapter.js +1 -1
  292. package/modules/openxOrtbBidAdapter.js +19 -7
  293. package/modules/openxOrtbBidAdapter.md +6 -5
  294. package/modules/parrableIdSystem.js +4 -2
  295. package/modules/permutiveRtdProvider.js +2 -1
  296. package/modules/prebidServerBidAdapter/index.js +9 -3
  297. package/modules/prebidServerBidAdapter/ortbConverter.js +12 -2
  298. package/modules/prebidmanagerAnalyticsAdapter.js +3 -2
  299. package/modules/pubCommonId.js +6 -3
  300. package/modules/publinkIdSystem.js +2 -1
  301. package/modules/pubmaticAnalyticsAdapter.js +12 -1
  302. package/modules/pubmaticBidAdapter.js +192 -222
  303. package/modules/pubwiseAnalyticsAdapter.js +5 -3
  304. package/modules/quantcastBidAdapter.js +1 -1
  305. package/modules/quantcastIdSystem.js +5 -3
  306. package/modules/realvuAnalyticsAdapter.js +6 -3
  307. package/modules/roxotAnalyticsAdapter.js +5 -2
  308. package/modules/rtbhouseBidAdapter.js +5 -3
  309. package/modules/rtdModule/index.js +3 -0
  310. package/modules/rubiconAnalyticsAdapter.js +3 -2
  311. package/modules/rubiconBidAdapter.js +1 -0
  312. package/modules/sharedIdSystem.js +12 -9
  313. package/modules/sharethroughBidAdapter.js +1 -2
  314. package/modules/sigmoidAnalyticsAdapter.js +4 -2
  315. package/modules/smartadserverBidAdapter.js +2 -3
  316. package/modules/sovrnBidAdapter.js +2 -3
  317. package/modules/staqAnalyticsAdapter.js +5 -3
  318. package/modules/stroeerCoreBidAdapter.js +3 -2
  319. package/modules/taboolaBidAdapter.js +4 -2
  320. package/modules/teadsBidAdapter.js +1 -1
  321. package/modules/teadsIdSystem.js +2 -1
  322. package/modules/tripleliftBidAdapter.js +1 -1
  323. package/modules/trustpidSystem.js +3 -2
  324. package/modules/ttdBidAdapter.js +11 -5
  325. package/modules/uid2IdSystem.js +3 -2
  326. package/modules/undertoneBidAdapter.js +1 -0
  327. package/modules/userId/index.js +5 -2
  328. package/modules/validationFpdModule/index.js +3 -2
  329. package/modules/vidazooBidAdapter.js +14 -5
  330. package/modules/vidoomyBidAdapter.js +29 -1
  331. package/modules/weboramaRtdProvider.js +3 -1
  332. package/modules/yieldmoBidAdapter.js +2 -3
  333. package/modules/yuktamediaAnalyticsAdapter.js +4 -2
  334. package/modules/zeotapIdPlusIdSystem.js +3 -2
  335. package/modules/zeta_global_sspBidAdapter.js +3 -0
  336. package/package.json +1 -1
  337. package/plugins/eslint/validateImports.js +13 -14
  338. package/plugins/pbjsGlobals.js +3 -1
  339. package/src/activities/modules.js +5 -0
  340. package/src/adapterManager.js +4 -8
  341. package/src/adapters/bidderFactory.js +30 -16
  342. package/src/consentHandler.js +42 -0
  343. package/src/refererDetection.js +39 -21
  344. package/src/secureCreatives.js +2 -2
  345. package/src/storageManager.js +33 -47
  346. package/src/userSync.js +7 -4
  347. package/test/spec/modules/33acrossIdSystem_spec.js +1 -1
  348. package/test/spec/modules/adagioBidAdapter_spec.js +11 -17
  349. package/test/spec/modules/admixerIdSystem_spec.js +0 -3
  350. package/test/spec/modules/adnuntiusBidAdapter_spec.js +6 -6
  351. package/test/spec/modules/adrinoBidAdapter_spec.js +65 -34
  352. package/test/spec/modules/adsinteractiveBidAdapter_spec.js +207 -0
  353. package/test/spec/modules/adyoulikeBidAdapter_spec.js +13 -11
  354. package/test/spec/modules/aidemBidAdapter_spec.js +72 -8
  355. package/test/spec/modules/amxBidAdapter_spec.js +4 -1
  356. package/test/spec/modules/atsAnalyticsAdapter_spec.js +2 -2
  357. package/test/spec/modules/audiencerunBidAdapter_spec.js +8 -11
  358. package/test/spec/modules/bedigitechBidAdapter_spec.js +145 -0
  359. package/test/spec/modules/bluebillywigBidAdapter_spec.js +1 -3
  360. package/test/spec/modules/concertBidAdapter_spec.js +3 -8
  361. package/test/spec/modules/connectadBidAdapter_spec.js +11 -3
  362. package/test/spec/modules/criteoBidAdapter_spec.js +29 -0
  363. package/test/spec/modules/criteoIdSystem_spec.js +38 -0
  364. package/test/spec/modules/datablocksBidAdapter_spec.js +0 -1
  365. package/test/spec/modules/dspxBidAdapter_spec.js +184 -13
  366. package/test/spec/modules/fledge_spec.js +173 -2
  367. package/test/spec/modules/gdprEnforcement_spec.js +134 -164
  368. package/test/spec/modules/greenbidsAnalyticsAdapter_spec.js +418 -0
  369. package/test/spec/modules/gridBidAdapter_spec.js +9 -5
  370. package/test/spec/modules/growthCodeIdSystem_spec.js +2 -1
  371. package/test/spec/modules/id5IdSystem_spec.js +41 -4
  372. package/test/spec/modules/identityLinkIdSystem_spec.js +2 -2
  373. package/test/spec/modules/improvedigitalBidAdapter_spec.js +10 -3
  374. package/test/spec/modules/jixieBidAdapter_spec.js +42 -60
  375. package/test/spec/modules/mediakeysBidAdapter_spec.js +12 -16
  376. package/test/spec/modules/openxOrtbBidAdapter_spec.js +96 -11
  377. package/test/spec/modules/prebidServerBidAdapter_spec.js +68 -2
  378. package/test/spec/modules/publinkIdSystem_spec.js +3 -2
  379. package/test/spec/modules/pubmaticBidAdapter_spec.js +67 -10
  380. package/test/spec/modules/realTimeDataModule_spec.js +22 -0
  381. package/test/spec/modules/realvuAnalyticsAdapter_spec.js +0 -1
  382. package/test/spec/modules/relaidoBidAdapter_spec.js +5 -5
  383. package/test/spec/modules/rubiconBidAdapter_spec.js +2 -1
  384. package/test/spec/modules/sharethroughBidAdapter_spec.js +97 -21
  385. package/test/spec/modules/smartadserverBidAdapter_spec.js +74 -12
  386. package/test/spec/modules/sovrnBidAdapter_spec.js +25 -6
  387. package/test/spec/modules/stroeerCoreBidAdapter_spec.js +13 -18
  388. package/test/spec/modules/taboolaBidAdapter_spec.js +101 -0
  389. package/test/spec/modules/ttdBidAdapter_spec.js +25 -7
  390. package/test/spec/modules/userId_spec.js +68 -0
  391. package/test/spec/modules/vidazooBidAdapter_spec.js +13 -0
  392. package/test/spec/modules/vidoomyBidAdapter_spec.js +33 -0
  393. package/test/spec/modules/yieldmoBidAdapter_spec.js +18 -2
  394. package/test/spec/modules/zeotapIdPlusIdSystem_spec.js +3 -2
  395. package/test/spec/modules/zeta_global_sspBidAdapter_spec.js +8 -0
  396. package/test/spec/refererDetection_spec.js +56 -1
  397. package/test/spec/unit/core/adapterManager_spec.js +21 -58
  398. package/test/spec/unit/core/bidderFactory_spec.js +28 -10
  399. package/test/spec/unit/core/consentHandler_spec.js +29 -1
  400. package/test/spec/unit/core/storageManager_spec.js +31 -21
  401. package/test/spec/userSync_spec.js +2 -1
@@ -0,0 +1,5 @@
1
+ export const MODULE_TYPE_CORE = 'core';
2
+ export const MODULE_TYPE_BIDDER = 'bidder';
3
+ export const MODULE_TYPE_UID = 'userId';
4
+ export const MODULE_TYPE_RTD = 'rtd';
5
+ export const MODULE_TYPE_ANALYTICS = 'analytics';
@@ -31,11 +31,12 @@ import {hook} from './hook.js';
31
31
  import {find, includes} from './polyfill.js';
32
32
  import {adunitCounter} from './adUnits.js';
33
33
  import {getRefererInfo} from './refererDetection.js';
34
- import {GdprConsentHandler, UspConsentHandler, GppConsentHandler} from './consentHandler.js';
34
+ import {GdprConsentHandler, UspConsentHandler, GppConsentHandler, GDPR_GVLIDS} from './consentHandler.js';
35
35
  import * as events from './events.js';
36
36
  import CONSTANTS from './constants.json';
37
37
  import {useMetrics} from './utils/perfMetrics.js';
38
38
  import {auctionManager} from './auctionManager.js';
39
+ import {MODULE_TYPE_ANALYTICS, MODULE_TYPE_BIDDER} from './activities/modules.js';
39
40
 
40
41
  export const PARTITIONS = {
41
42
  CLIENT: 'client',
@@ -338,13 +339,6 @@ adapterManager.makeBidRequests = hook('sync', function (adUnits, auctionStart, a
338
339
  }
339
340
  });
340
341
 
341
- bidRequests.forEach(bidRequest => {
342
- config.runWithBidder(bidRequest.bidderCode, () => {
343
- const fledgeEnabledFromConfig = config.getConfig('fledgeEnabled');
344
- bidRequest['fledgeEnabled'] = navigator.runAdAuction && fledgeEnabledFromConfig
345
- });
346
- });
347
-
348
342
  return bidRequests;
349
343
  }, 'makeBidRequests');
350
344
 
@@ -470,6 +464,7 @@ adapterManager.registerBidAdapter = function (bidAdapter, bidderCode, {supported
470
464
  if (bidAdapter && bidderCode) {
471
465
  if (typeof bidAdapter.callBids === 'function') {
472
466
  _bidderRegistry[bidderCode] = bidAdapter;
467
+ GDPR_GVLIDS.register(MODULE_TYPE_BIDDER, bidderCode, bidAdapter.getSpec?.().gvlid);
473
468
 
474
469
  if (FEATURES.VIDEO && includes(supportedMediaTypes, 'video')) {
475
470
  adapterManager.videoAdapters.push(bidderCode);
@@ -539,6 +534,7 @@ adapterManager.registerAnalyticsAdapter = function ({adapter, code, gvlid}) {
539
534
  if (typeof adapter.enableAnalytics === 'function') {
540
535
  adapter.code = code;
541
536
  _analyticsRegistry[code] = { adapter, gvlid };
537
+ GDPR_GVLIDS.register(MODULE_TYPE_ANALYTICS, code, gvlid);
542
538
  } else {
543
539
  logError(`Prebid Error: Analytics adaptor error for analytics "${code}"
544
540
  analytics adapter must implement an enableAnalytics() function`);
@@ -1,20 +1,32 @@
1
1
  import Adapter from '../adapter.js';
2
2
  import adapterManager from '../adapterManager.js';
3
- import { config } from '../config.js';
4
- import { createBid } from '../bidfactory.js';
5
- import { userSync } from '../userSync.js';
6
- import { nativeBidIsValid } from '../native.js';
7
- import { isValidVideoBid } from '../video.js';
3
+ import {config} from '../config.js';
4
+ import {createBid} from '../bidfactory.js';
5
+ import {userSync} from '../userSync.js';
6
+ import {nativeBidIsValid} from '../native.js';
7
+ import {isValidVideoBid} from '../video.js';
8
8
  import CONSTANTS from '../constants.json';
9
9
  import * as events from '../events.js';
10
10
  import {includes} from '../polyfill.js';
11
- import { ajax } from '../ajax.js';
12
- import { logWarn, logInfo, logError, parseQueryStringParameters, delayExecution, parseSizesInput, flatten, uniques, timestamp, deepAccess, isArray, isPlainObject } from '../utils.js';
13
- import { ADPOD } from '../mediaTypes.js';
14
- import { getHook, hook } from '../hook.js';
15
- import { getCoreStorageManager } from '../storageManager.js';
11
+ import {ajax} from '../ajax.js';
12
+ import {
13
+ deepAccess,
14
+ delayExecution,
15
+ flatten,
16
+ isArray,
17
+ isPlainObject,
18
+ logError,
19
+ logWarn,
20
+ parseQueryStringParameters,
21
+ parseSizesInput,
22
+ timestamp,
23
+ uniques
24
+ } from '../utils.js';
25
+ import {ADPOD} from '../mediaTypes.js';
26
+ import {getHook, hook} from '../hook.js';
27
+ import {getCoreStorageManager} from '../storageManager.js';
16
28
  import {auctionManager} from '../auctionManager.js';
17
- import { bidderSettings } from '../bidderSettings.js';
29
+ import {bidderSettings} from '../bidderSettings.js';
18
30
  import {useMetrics} from '../utils/perfMetrics.js';
19
31
 
20
32
  export const storage = getCoreStorageManager('bidderFactory');
@@ -187,7 +199,7 @@ export function registerBidder(spec) {
187
199
  export function newBidder(spec) {
188
200
  return Object.assign(new Adapter(spec.code), {
189
201
  getSpec: function() {
190
- return Object.freeze(spec);
202
+ return Object.freeze(Object.assign({}, spec));
191
203
  },
192
204
  registerSyncs,
193
205
  callBids: function(bidderRequest, addBidResponse, done, ajax, onTimelyResponse, configEnabledCallback) {
@@ -247,7 +259,9 @@ export function newBidder(spec) {
247
259
  fledgeAuctionConfigs.forEach((fledgeAuctionConfig) => {
248
260
  const bidRequest = bidRequestMap[fledgeAuctionConfig.bidId];
249
261
  if (bidRequest) {
250
- addComponentAuction(bidRequest, fledgeAuctionConfig);
262
+ addComponentAuction(bidRequest.adUnitCode, fledgeAuctionConfig.config);
263
+ } else {
264
+ logWarn('Received fledge auction configuration for an unknown bidId', fledgeAuctionConfig);
251
265
  }
252
266
  });
253
267
  },
@@ -463,13 +477,13 @@ export const registerSyncInner = hook('async', function(spec, responses, gdprCon
463
477
  syncs.forEach((sync) => {
464
478
  userSync.registerSync(sync.type, spec.code, sync.url)
465
479
  });
480
+ userSync.bidderDone(spec.code);
466
481
  }
467
482
  }
468
483
  }, 'registerSyncs')
469
484
 
470
- export const addComponentAuction = hook('sync', (_bidRequest, fledgeAuctionConfig) => {
471
- logInfo(`bidderFactory.addComponentAuction`, fledgeAuctionConfig);
472
- }, 'addComponentAuction')
485
+ export const addComponentAuction = hook('sync', (adUnitCode, fledgeAuctionConfig) => {
486
+ }, 'addComponentAuction');
473
487
 
474
488
  export function preloadBidderMappingFile(fn, adUnits) {
475
489
  if (FEATURES.VIDEO) {
@@ -118,3 +118,45 @@ export class GppConsentHandler extends ConsentHandler {
118
118
  }
119
119
  }
120
120
  }
121
+
122
+ export function gvlidRegistry() {
123
+ const registry = {};
124
+ const flat = {};
125
+ const none = {};
126
+ return {
127
+ /**
128
+ * Register a module's GVL ID.
129
+ * @param {string} moduleType defined in `activities/modules.js`
130
+ * @param {string} moduleName
131
+ * @param {number} gvlid
132
+ */
133
+ register(moduleType, moduleName, gvlid) {
134
+ if (gvlid) {
135
+ (registry[moduleName] = registry[moduleName] || {})[moduleType] = gvlid;
136
+ if (flat.hasOwnProperty(moduleName)) {
137
+ if (flat[moduleName] !== gvlid) flat[moduleName] = none;
138
+ } else {
139
+ flat[moduleName] = gvlid;
140
+ }
141
+ }
142
+ },
143
+ /**
144
+ * Get a module's GVL ID(s).
145
+ *
146
+ * @param {string} moduleName
147
+ * @return {{modules: {[moduleType]: number}, gvlid?: number}} an object where:
148
+ * `modules` is a map from module type to that module's GVL ID;
149
+ * `gvlid` is the single GVL ID for this family of modules (only defined
150
+ * if all modules with this name declared the same ID).
151
+ */
152
+ get(moduleName) {
153
+ const result = {modules: registry[moduleName] || {}};
154
+ if (flat.hasOwnProperty(moduleName) && flat[moduleName] !== none) {
155
+ result.gvlid = flat[moduleName];
156
+ }
157
+ return result;
158
+ }
159
+ }
160
+ }
161
+
162
+ export const GDPR_GVLIDS = gvlidRegistry();
@@ -51,6 +51,26 @@ export function parseDomain(url, {noLeadingWww = false, noPort = false} = {}) {
51
51
  return url;
52
52
  }
53
53
 
54
+ /**
55
+ * This function returns canonical URL which refers to an HTML link element, with the attribute of rel="canonical", found in the <head> element of your webpage
56
+ *
57
+ * @param {Object} doc document
58
+ * @returns {string|null}
59
+ */
60
+ function getCanonicalUrl(doc) {
61
+ try {
62
+ const element = doc.querySelector("link[rel='canonical']");
63
+
64
+ if (element !== null) {
65
+ return element.href;
66
+ }
67
+ } catch (e) {
68
+ // Ignore error
69
+ }
70
+
71
+ return null;
72
+ }
73
+
54
74
  /**
55
75
  * @param {Window} win Window
56
76
  * @returns {Function}
@@ -75,26 +95,6 @@ export function detectReferer(win) {
75
95
  }
76
96
  }
77
97
 
78
- /**
79
- * This function returns canonical URL which refers to an HTML link element, with the attribute of rel="canonical", found in the <head> element of your webpage
80
- *
81
- * @param {Object} doc document
82
- * @returns {string|null}
83
- */
84
- function getCanonicalUrl(doc) {
85
- try {
86
- const element = doc.querySelector("link[rel='canonical']");
87
-
88
- if (element !== null) {
89
- return element.href;
90
- }
91
- } catch (e) {
92
- // Ignore error
93
- }
94
-
95
- return null;
96
- }
97
-
98
98
  // TODO: the meaning of "reachedTop" seems to be intentionally ambiguous - best to leave them out of
99
99
  // the typedef for now. (for example, unit tests enforce that "reachedTop" should be false in some situations where we
100
100
  // happily provide a location for the top).
@@ -260,7 +260,25 @@ export function detectReferer(win) {
260
260
  return refererInfo;
261
261
  }
262
262
 
263
+ // cache result of fn (= referer info) as long as:
264
+ // - we are the top window
265
+ // - canonical URL tag and window location have not changed
266
+ export function cacheWithLocation(fn, win = window) {
267
+ if (win.top !== win) return fn;
268
+ let canonical, href, value;
269
+ return function () {
270
+ const newCanonical = getCanonicalUrl(win.document);
271
+ const newHref = win.location.href;
272
+ if (canonical !== newCanonical || newHref !== href) {
273
+ canonical = newCanonical;
274
+ href = newHref;
275
+ value = fn();
276
+ }
277
+ return value;
278
+ }
279
+ }
280
+
263
281
  /**
264
282
  * @type {function(): refererInfo}
265
283
  */
266
- export const getRefererInfo = detectReferer(window);
284
+ export const getRefererInfo = cacheWithLocation(detectReferer(window));
@@ -73,7 +73,7 @@ function handleRenderRequest(reply, data, adObject) {
73
73
  if (adObject == null) {
74
74
  emitAdRenderFail({
75
75
  reason: constants.AD_RENDER_FAILED_REASON.CANNOT_FIND_AD,
76
- message: `Cannot find ad '${data.adId}' for cross-origin render request`,
76
+ message: `Cannot find ad for cross-origin render request: '${data.adId}'`,
77
77
  id: data.adId
78
78
  });
79
79
  return;
@@ -111,7 +111,7 @@ function handleNativeRequest(reply, data, adObject) {
111
111
  // adId: '%%PATTERN:hb_adid%%'
112
112
  // }), '*');
113
113
  if (adObject == null) {
114
- logError(`Cannot find ad '${data.adId}' for x-origin event request`);
114
+ logError(`Cannot find ad for x-origin event request: '${data.adId}'`);
115
115
  return;
116
116
  }
117
117
 
@@ -1,51 +1,30 @@
1
1
  import {hook} from './hook.js';
2
- import {hasDeviceAccess, checkCookieSupport, logError, logInfo, isPlainObject} from './utils.js';
2
+ import {checkCookieSupport, hasDeviceAccess, logError, logInfo} from './utils.js';
3
3
  import {bidderSettings as defaultBidderSettings} from './bidderSettings.js';
4
- import {VENDORLESS_GVLID} from './consentHandler.js';
5
-
6
- const moduleTypeWhiteList = ['core', 'prebid-module'];
7
-
8
- export let storageCallbacks = [];
4
+ import {MODULE_TYPE_BIDDER, MODULE_TYPE_CORE} from './activities/modules.js';
9
5
 
10
6
  export const STORAGE_TYPE_LOCALSTORAGE = 'html5';
11
7
  export const STORAGE_TYPE_COOKIES = 'cookie';
12
8
 
13
- /**
14
- * Storage options
15
- * @typedef {Object} storageOptions
16
- * @property {Number=} gvlid - Vendor id
17
- * @property {string} moduleName? - Module name
18
- * @property {string=} bidderCode? - Bidder code
19
- * @property {string=} moduleType - Module type, value can be anyone of core or prebid-module
20
- */
9
+ export let storageCallbacks = [];
21
10
 
22
- /**
23
- * Returns list of storage related functions with gvlid, module name and module type in its scope.
24
- * All three argument are optional here. Below shows the usage of of these
25
- * - GVL Id: Pass GVL id if you are a vendor
26
- * - Bidder code: All bid adapters need to pass bidderCode
27
- * - Module name: All other modules need to pass module name
28
- * - Module type: Some modules may need these functions but are not vendor. e.g prebid core files in src and modules like currency.
29
- * @param {storageOptions} options
11
+ /*
12
+ * Storage manager constructor. Consumers should prefer one of `getStorageManager` or `getCoreStorageManager`.
30
13
  */
31
- export function newStorageManager({gvlid, moduleName, bidderCode, moduleType} = {}, {bidderSettings = defaultBidderSettings} = {}) {
14
+ export function newStorageManager({moduleName, moduleType} = {}, {bidderSettings = defaultBidderSettings} = {}) {
32
15
  function isBidderAllowed(storageType) {
33
- if (bidderCode == null) {
16
+ if (moduleType !== MODULE_TYPE_BIDDER) {
34
17
  return true;
35
18
  }
36
- const storageAllowed = bidderSettings.get(bidderCode, 'storageAllowed');
19
+ const storageAllowed = bidderSettings.get(moduleName, 'storageAllowed');
37
20
  if (!storageAllowed || storageAllowed === true) return !!storageAllowed;
38
21
  if (Array.isArray(storageAllowed)) return storageAllowed.some((e) => e === storageType);
39
22
  return storageAllowed === storageType;
40
23
  }
41
24
 
42
- if (moduleTypeWhiteList.includes(moduleType)) {
43
- gvlid = gvlid || VENDORLESS_GVLID;
44
- }
45
-
46
25
  function isValid(cb, storageType) {
47
26
  if (!isBidderAllowed(storageType)) {
48
- logInfo(`bidderSettings denied access to device storage for bidder '${bidderCode}'`);
27
+ logInfo(`bidderSettings denied access to device storage for bidder '${moduleName}'`);
49
28
  const result = {valid: false};
50
29
  return cb(result);
51
30
  } else {
@@ -53,7 +32,7 @@ export function newStorageManager({gvlid, moduleName, bidderCode, moduleType} =
53
32
  let hookDetails = {
54
33
  hasEnforcementHook: false
55
34
  }
56
- validateStorageEnforcement(gvlid, bidderCode || moduleName, hookDetails, function(result) {
35
+ validateStorageEnforcement(moduleType, moduleName, hookDetails, function(result) {
57
36
  if (result && result.hasEnforcementHook) {
58
37
  value = cb(result);
59
38
  } else {
@@ -252,31 +231,38 @@ export function newStorageManager({gvlid, moduleName, bidderCode, moduleType} =
252
231
  /**
253
232
  * This hook validates the storage enforcement if gdprEnforcement module is included
254
233
  */
255
- export const validateStorageEnforcement = hook('async', function(gvlid, moduleName, hookDetails, callback) {
234
+ export const validateStorageEnforcement = hook('async', function(moduleType, moduleName, hookDetails, callback) {
256
235
  callback(hookDetails);
257
236
  }, 'validateStorageEnforcement');
258
237
 
259
238
  /**
260
- * This function returns storage functions to access cookies and localstorage. This function will bypass the gdpr enforcement requirement. Prebid as a software needs to use storage in some scenarios and is not a vendor so GDPR enforcement rules does not apply on Prebid.
261
- * @param {string} moduleName Module name
239
+ * Get a storage manager for a particular module.
240
+ *
241
+ * Either bidderCode or a combination of moduleType + moduleName must be provided. The former is a shorthand
242
+ * for `{moduleType: 'bidder', moduleName: bidderCode}`.
243
+ *
262
244
  */
263
- export function getCoreStorageManager(moduleName) {
264
- return newStorageManager({moduleName: moduleName, moduleType: 'core'});
245
+ export function getStorageManager({moduleType, moduleName, bidderCode} = {}) {
246
+ function err() {
247
+ throw new Error(`Invalid invocation for getStorageManager: must set either bidderCode, or moduleType + moduleName`)
248
+ }
249
+ if (bidderCode) {
250
+ if ((moduleType && moduleType !== MODULE_TYPE_BIDDER) || moduleName) err()
251
+ moduleType = MODULE_TYPE_BIDDER;
252
+ moduleName = bidderCode;
253
+ } else if (!moduleName || !moduleType) {
254
+ err()
255
+ }
256
+ return newStorageManager({moduleType, moduleName});
265
257
  }
266
258
 
267
259
  /**
268
- * Note: Core modules or Prebid modules like Currency, SizeMapping should use getCoreStorageManager
269
- * This function returns storage functions to access cookies and localstorage. Bidders and User id modules should import this and use it in their module if needed.
270
- * Bid adapters should always provide `bidderCode`. GVL ID and Module name are optional param but gvl id is needed for when gdpr enforcement module is used.
271
- * @param {Number=} gvlid? Vendor id - required for proper GDPR integration
272
- * @param {string=} bidderCode? - required for bid adapters
273
- * @param {string=} moduleName? module name
260
+ * Get a storage manager for "core" (vendorless, or first-party) modules. Shorthand for `getStorageManager({moduleName, moduleType: 'core'})`.
261
+ *
262
+ * @param {string} moduleName Module name
274
263
  */
275
- export function getStorageManager({gvlid, moduleName, bidderCode} = {}) {
276
- if (arguments.length > 1 || (arguments.length > 0 && !isPlainObject(arguments[0]))) {
277
- throw new Error('Invalid invocation for getStorageManager')
278
- }
279
- return newStorageManager({gvlid, moduleName, bidderCode});
264
+ export function getCoreStorageManager(moduleName) {
265
+ return newStorageManager({moduleName: moduleName, moduleType: MODULE_TYPE_CORE});
280
266
  }
281
267
 
282
268
  export function resetData() {
package/src/userSync.js CHANGED
@@ -109,10 +109,7 @@ export function newUserSync(userSyncDependencies) {
109
109
  // Randomize the order of the pixels before firing
110
110
  // This is to avoid giving any bidder who has registered multiple syncs
111
111
  // any preferential treatment and balancing them out
112
- shuffle(queue).forEach((sync) => {
113
- fn(sync);
114
- hasFiredBidder.add(sync[0]);
115
- });
112
+ shuffle(queue).forEach(fn);
116
113
  }
117
114
 
118
115
  /**
@@ -212,6 +209,12 @@ export function newUserSync(userSyncDependencies) {
212
209
  numAdapterBids = incrementAdapterBids(numAdapterBids, bidder);
213
210
  };
214
211
 
212
+ /**
213
+ * Mark a bidder as done with its user syncs - no more will be accepted from them in this session.
214
+ * @param {string} bidderCode
215
+ */
216
+ publicApi.bidderDone = hasFiredBidder.add.bind(hasFiredBidder);
217
+
215
218
  /**
216
219
  * @function shouldBidderBeBlocked
217
220
  * @summary Check filterSettings logic to determine if the bidder should be prevented from registering their userSync tracker
@@ -282,7 +282,7 @@ describe('33acrossIdSystem', () => {
282
282
  error: 'foo'
283
283
  }));
284
284
 
285
- expect(logErrorSpy.calledOnceWithExactly(`${thirthyThreeAcrossIdSubmodule.name}: Unsuccessful response`)).to.be.true;
285
+ expect(logErrorSpy.calledOnceWithExactly(`${thirthyThreeAcrossIdSubmodule.name}: Unsuccessful response foo`)).to.be.true;
286
286
 
287
287
  logErrorSpy.restore();
288
288
  });
@@ -684,32 +684,26 @@ describe('Adagio bid adapter', () => {
684
684
  });
685
685
 
686
686
  describe('with userID modules', function() {
687
- const userId = {
688
- pubcid: '01EAJWWNEPN3CYMM5N8M5VXY22',
689
- unsuported: '666'
690
- };
687
+ const userIdAsEids = [{
688
+ 'source': 'pubcid.org',
689
+ 'uids': [
690
+ {
691
+ 'atype': 1,
692
+ 'id': '01EAJWWNEPN3CYMM5N8M5VXY22'
693
+ }
694
+ ]
695
+ }];
691
696
 
692
697
  it('should send "user.eids" in the request for Prebid.js supported modules only', function() {
693
698
  const bid01 = new BidRequestBuilder({
694
- userId
699
+ userIdAsEids
695
700
  }).withParams().build();
696
701
 
697
702
  const bidderRequest = new BidderRequestBuilder().build();
698
703
 
699
704
  const requests = spec.buildRequests([bid01], bidderRequest);
700
705
 
701
- const expected = [{
702
- source: 'pubcid.org',
703
- uids: [
704
- {
705
- atype: 1,
706
- id: '01EAJWWNEPN3CYMM5N8M5VXY22'
707
- }
708
- ]
709
- }];
710
-
711
- expect(requests[0].data.user.eids).to.have.lengthOf(1);
712
- expect(requests[0].data.user.eids).to.deep.equal(expected);
706
+ expect(requests[0].data.user.eids).to.deep.equal(userIdAsEids);
713
707
  });
714
708
 
715
709
  it('should send an empty "user.eids" array in the request if userId module is unsupported', function() {
@@ -1,9 +1,6 @@
1
1
  import {admixerIdSubmodule} from 'modules/admixerIdSystem.js';
2
2
  import * as utils from 'src/utils.js';
3
3
  import {server} from 'test/mocks/xhr.js';
4
- import {getStorageManager} from '../../../src/storageManager.js';
5
-
6
- export const storage = getStorageManager();
7
4
 
8
5
  const pid = '4D393FAC-B6BB-4E19-8396-0A4813607316';
9
6
  const getIdParams = {params: {pid: pid}};
@@ -13,21 +13,21 @@ describe('adnuntiusBidAdapter', function () {
13
13
  const meta = [{ key: 'usi', value: usi }]
14
14
 
15
15
  before(() => {
16
- const storage = getStorageManager({ gvlid: GVLID, moduleName: 'adnuntius' })
17
- storage.setDataInLocalStorage('adn.metaData', JSON.stringify(meta))
18
- });
19
-
20
- beforeEach(function () {
21
16
  $$PREBID_GLOBAL$$.bidderSettings = {
22
17
  adnuntius: {
23
18
  storageAllowed: true
24
19
  }
25
20
  };
21
+ const storage = getStorageManager({ bidderCode: 'adnuntius' })
22
+ storage.setDataInLocalStorage('adn.metaData', JSON.stringify(meta))
23
+ });
24
+
25
+ after(() => {
26
+ $$PREBID_GLOBAL$$.bidderSettings = {};
26
27
  });
27
28
 
28
29
  afterEach(function () {
29
30
  config.resetConfig();
30
- $$PREBID_GLOBAL$$.bidderSettings = {};
31
31
  });
32
32
 
33
33
  const tzo = new Date().getTimezoneOffset();
@@ -86,16 +86,16 @@ describe('adrinoBidAdapter', function () {
86
86
  );
87
87
  expect(result.length).to.equal(1);
88
88
  expect(result[0].method).to.equal('POST');
89
- expect(result[0].url).to.equal('https://stg-prebid-bidder.adrino.io/bidder/bid/');
90
- expect(result[0].data.bidId).to.equal('12345678901234');
91
- expect(result[0].data.placementHash).to.equal('abcdef123456');
92
- expect(result[0].data.referer).to.equal('http://example.com/');
93
- expect(result[0].data.userAgent).to.equal(navigator.userAgent);
94
- expect(result[0].data).to.have.property('nativeParams');
95
- expect(result[0].data).not.to.have.property('gdprConsent');
96
- expect(result[0].data).to.have.property('userId');
97
- expect(result[0].data.userId.criteoId).to.equal('2xqi3F94aHdwWnM3');
98
- expect(result[0].data.userId.pubcid).to.equal('3ec0b202-7697');
89
+ expect(result[0].url).to.equal('https://stg-prebid-bidder.adrino.io/bidder/bids/');
90
+ expect(result[0].data[0].bidId).to.equal('12345678901234');
91
+ expect(result[0].data[0].placementHash).to.equal('abcdef123456');
92
+ expect(result[0].data[0].referer).to.equal('http://example.com/');
93
+ expect(result[0].data[0].userAgent).to.equal(navigator.userAgent);
94
+ expect(result[0].data[0]).to.have.property('nativeParams');
95
+ expect(result[0].data[0]).not.to.have.property('gdprConsent');
96
+ expect(result[0].data[0]).to.have.property('userId');
97
+ expect(result[0].data[0].userId.criteoId).to.equal('2xqi3F94aHdwWnM3');
98
+ expect(result[0].data[0].userId.pubcid).to.equal('3ec0b202-7697');
99
99
  });
100
100
 
101
101
  it('should build the request correctly with gdpr', function () {
@@ -105,16 +105,16 @@ describe('adrinoBidAdapter', function () {
105
105
  );
106
106
  expect(result.length).to.equal(1);
107
107
  expect(result[0].method).to.equal('POST');
108
- expect(result[0].url).to.equal('https://prd-prebid-bidder.adrino.io/bidder/bid/');
109
- expect(result[0].data.bidId).to.equal('12345678901234');
110
- expect(result[0].data.placementHash).to.equal('abcdef123456');
111
- expect(result[0].data.referer).to.equal('http://example.com/');
112
- expect(result[0].data.userAgent).to.equal(navigator.userAgent);
113
- expect(result[0].data).to.have.property('nativeParams');
114
- expect(result[0].data).to.have.property('gdprConsent');
115
- expect(result[0].data).to.have.property('userId');
116
- expect(result[0].data.userId.criteoId).to.equal('2xqi3F94aHdwWnM3');
117
- expect(result[0].data.userId.pubcid).to.equal('3ec0b202-7697');
108
+ expect(result[0].url).to.equal('https://prd-prebid-bidder.adrino.io/bidder/bids/');
109
+ expect(result[0].data[0].bidId).to.equal('12345678901234');
110
+ expect(result[0].data[0].placementHash).to.equal('abcdef123456');
111
+ expect(result[0].data[0].referer).to.equal('http://example.com/');
112
+ expect(result[0].data[0].userAgent).to.equal(navigator.userAgent);
113
+ expect(result[0].data[0]).to.have.property('nativeParams');
114
+ expect(result[0].data[0]).to.have.property('gdprConsent');
115
+ expect(result[0].data[0]).to.have.property('userId');
116
+ expect(result[0].data[0].userId.criteoId).to.equal('2xqi3F94aHdwWnM3');
117
+ expect(result[0].data[0].userId.pubcid).to.equal('3ec0b202-7697');
118
118
  });
119
119
 
120
120
  it('should build the request correctly without gdpr', function () {
@@ -124,22 +124,22 @@ describe('adrinoBidAdapter', function () {
124
124
  );
125
125
  expect(result.length).to.equal(1);
126
126
  expect(result[0].method).to.equal('POST');
127
- expect(result[0].url).to.equal('https://prd-prebid-bidder.adrino.io/bidder/bid/');
128
- expect(result[0].data.bidId).to.equal('12345678901234');
129
- expect(result[0].data.placementHash).to.equal('abcdef123456');
130
- expect(result[0].data.referer).to.equal('http://example.com/');
131
- expect(result[0].data.userAgent).to.equal(navigator.userAgent);
132
- expect(result[0].data).to.have.property('nativeParams');
133
- expect(result[0].data).not.to.have.property('gdprConsent');
134
- expect(result[0].data).to.have.property('userId');
135
- expect(result[0].data.userId.criteoId).to.equal('2xqi3F94aHdwWnM3');
136
- expect(result[0].data.userId.pubcid).to.equal('3ec0b202-7697');
127
+ expect(result[0].url).to.equal('https://prd-prebid-bidder.adrino.io/bidder/bids/');
128
+ expect(result[0].data[0].bidId).to.equal('12345678901234');
129
+ expect(result[0].data[0].placementHash).to.equal('abcdef123456');
130
+ expect(result[0].data[0].referer).to.equal('http://example.com/');
131
+ expect(result[0].data[0].userAgent).to.equal(navigator.userAgent);
132
+ expect(result[0].data[0]).to.have.property('nativeParams');
133
+ expect(result[0].data[0]).not.to.have.property('gdprConsent');
134
+ expect(result[0].data[0]).to.have.property('userId');
135
+ expect(result[0].data[0].userId.criteoId).to.equal('2xqi3F94aHdwWnM3');
136
+ expect(result[0].data[0].userId.pubcid).to.equal('3ec0b202-7697');
137
137
  });
138
138
  });
139
139
 
140
140
  describe('interpretResponse', function () {
141
141
  it('should interpret the response correctly', function () {
142
- const response = {
142
+ const response1 = {
143
143
  requestId: '31662c69728811',
144
144
  mediaType: 'native',
145
145
  cpm: 0.53,
@@ -167,13 +167,44 @@ describe('adrinoBidAdapter', function () {
167
167
  }
168
168
  };
169
169
 
170
+ const response2 = {
171
+ requestId: '31662c69728812',
172
+ mediaType: 'native',
173
+ cpm: 0.77,
174
+ currency: 'PLN',
175
+ creativeId: '859120',
176
+ netRevenue: true,
177
+ ttl: 600,
178
+ width: 1,
179
+ height: 1,
180
+ noAd: false,
181
+ testAd: false,
182
+ native: {
183
+ title: 'Ad Title',
184
+ body: 'Ad Body',
185
+ image: {
186
+ url: 'http://emisja.contentstream.pl/_/getImageII/?vid=17180728299&typ=cs_300_150&element=IMAGE&scale=1&prefix=adart&nc=1643878278955',
187
+ height: 150,
188
+ width: 300
189
+ },
190
+ clickUrl: 'http://emisja.contentstream.pl/_/ctr2/?u=https%3A%2F%2Fonline.efortuna.pl%2Fpage%3Fkey%3Dej0xMzUzMTM1NiZsPTE1Mjc1MzY1JnA9NTMyOTA%253D&e=znU3tABN8K4N391dmUxYfte5G9tBaDXELJVo1_-kvaTJH2XwWRw77fmfL2YjcEmrbqRQ3M0GcJ0vPWcLtZlsrf8dWrAEHNoZKAC6JMnZF_65IYhTPbQIJ-zn3ac9TU7gEZftFKksH1al7rMuieleVv9r6_DtrOk_oZcYAe4rMRQM-TiWvivJRPBchAAblE0cqyG7rCunJFpal43sxlYm4GvcBJaYHzErn5PXjEzNbd3xHjkdiap-xU9y6BbfkUZ1xIMS8QZLvwNrTXMFCSfSRN2tgVfEj7KyGdLCITHSaFtuIKT2iW2pxC7f2RtPHnzsEPXH0SgAfhA3OxZ5jkQjOZy0PsO7MiCv3sJai5ezUAOjFgayU91ZhI0Y9r2YpB1tTGIjnO23wot8PvRENlThHQ%3D%3D&ref=https%3A%2F%2Fbox.adrino.cloud%2Ftmielcarz%2Fadrino_prebid%2Ftest_page3.html%3Fpbjs_debug%3Dtrue',
191
+ privacyLink: 'https://adrino.pl/wp-content/uploads/2021/01/POLITYKA-PRYWATNOS%CC%81CI-Adrino-Mobile.pdf',
192
+ impressionTrackers: [
193
+ 'https://prd-impression-tracker-producer.adrino.io/impression/eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ7XCJpbXByZXNzaW9uSWRcIjpcIjMxNjYyYzY5NzI4ODExXCIsXCJkYXRlXCI6WzIwMjIsMiwzXSxcInBsYWNlbWVudEhhc2hcIjpcIjk0NTVjMDQxYzlkMTI1ZmIwNDE4MWVhMGVlZTJmMmFlXCIsXCJjYW1wYWlnbklkXCI6MTc5MjUsXCJhZHZlcnRpc2VtZW50SWRcIjo5MjA3OSxcInZpc3VhbGlzYXRpb25JZFwiOjg1OTExNSxcImNwbVwiOjUzLjB9IiwiZXhwIjoxNjQzOTE2MjUxLCJpYXQiOjE2NDM5MTU2NTF9.0Y_HvInGl6Xo5xP6rDLC8lzQRGvy-wKe0blk1o8ebWyVRFiUY1JGLUeE0k3sCsPNxgdHAv-o6EcbogpUuqlMJA'
194
+ ]
195
+ }
196
+ };
197
+
170
198
  const serverResponse = {
171
- body: response
199
+ body: { bidResponses: [response1, response2] }
172
200
  };
173
201
 
174
202
  const result = spec.interpretResponse(serverResponse, {});
175
- expect(result.length).to.equal(1);
176
- expect(result[0]).to.equal(response);
203
+ expect(result.length).to.equal(2);
204
+ expect(result[0]).to.equal(response1);
205
+ expect(result[0].requestId).to.equal('31662c69728811');
206
+ expect(result[1]).to.equal(response2);
207
+ expect(result[1].requestId).to.equal('31662c69728812');
177
208
  });
178
209
 
179
210
  it('should return empty array of responses', function () {