prebid.js 9.1.0 → 9.3.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 (362) hide show
  1. package/browsers.json +3 -3
  2. package/dist/33acrossAnalyticsAdapter.js +1 -1
  3. package/dist/33acrossBidAdapter.js +1 -1
  4. package/dist/33acrossIdSystem.js +1 -1
  5. package/dist/BTBidAdapter.js +1 -1
  6. package/dist/acuityadsBidAdapter.js +1 -1
  7. package/dist/adagioAnalyticsAdapter.js +1 -1
  8. package/dist/adagioBidAdapter.js +1 -1
  9. package/dist/adagioRtdProvider.js +1 -1
  10. package/dist/adagioUtils.js +1 -0
  11. package/dist/addefendBidAdapter.js +1 -1
  12. package/dist/adgenerationBidAdapter.js +1 -1
  13. package/dist/adlooxRtdProvider.js +1 -1
  14. package/dist/admanBidAdapter.js +1 -1
  15. package/dist/adnuntiusBidAdapter.js +1 -1
  16. package/dist/adpod.js +1 -1
  17. package/dist/adprimeBidAdapter.js +1 -1
  18. package/dist/adqueryBidAdapter.js +1 -1
  19. package/dist/adrelevantisBidAdapter.js +1 -1
  20. package/dist/adstirBidAdapter.js +1 -1
  21. package/dist/adtrgtmeBidAdapter.js +1 -1
  22. package/dist/adxcgAnalyticsAdapter.js +1 -1
  23. package/dist/adxcgBidAdapter.js +1 -1
  24. package/dist/adyoulikeBidAdapter.js +1 -1
  25. package/dist/agmaAnalyticsAdapter.js +1 -1
  26. package/dist/ajaBidAdapter.js +1 -1
  27. package/dist/amxBidAdapter.js +1 -1
  28. package/dist/amxIdSystem.js +1 -1
  29. package/dist/appierAnalyticsAdapter.js +1 -1
  30. package/dist/appnexusBidAdapter.js +1 -1
  31. package/dist/appnexusUtils.js +1 -1
  32. package/dist/asoBidAdapter.js +1 -1
  33. package/dist/autoplayDetection.js +1 -1
  34. package/dist/axisBidAdapter.js +1 -1
  35. package/dist/axonixBidAdapter.js +1 -1
  36. package/dist/beyondmediaBidAdapter.js +1 -1
  37. package/dist/bidglassBidAdapter.js +1 -1
  38. package/dist/big-richmediaBidAdapter.js +1 -1
  39. package/dist/bliinkBidAdapter.js +1 -1
  40. package/dist/boldwinBidAdapter.js +1 -1
  41. package/dist/bridBidAdapter.js +1 -1
  42. package/dist/bridgewellBidAdapter.js +1 -1
  43. package/dist/brightMountainMediaBidAdapter.js +1 -1
  44. package/dist/carodaBidAdapter.js +1 -1
  45. package/dist/chtnwBidAdapter.js +1 -1
  46. package/dist/chunk-core.js +1 -1
  47. package/dist/compassBidAdapter.js +1 -1
  48. package/dist/concertBidAdapter.js +1 -1
  49. package/dist/connectadBidAdapter.js +1 -1
  50. package/dist/consentManagement.js +1 -0
  51. package/dist/consentManagementGpp.js +1 -1
  52. package/dist/consentManagementTcf.js +1 -1
  53. package/dist/consumableBidAdapter.js +1 -1
  54. package/dist/contentexchangeBidAdapter.js +1 -1
  55. package/dist/conversantAnalyticsAdapter.js +1 -1
  56. package/dist/conversantBidAdapter.js +1 -1
  57. package/dist/copper6sspBidAdapter.js +1 -0
  58. package/dist/craftBidAdapter.js +1 -1
  59. package/dist/criteoBidAdapter.js +1 -1
  60. package/dist/cwireBidAdapter.js +1 -1
  61. package/dist/dailymotionBidAdapter.js +1 -1
  62. package/dist/dependencies.json +96 -6
  63. package/dist/dspxBidAdapter.js +1 -1
  64. package/dist/dxkultureBidAdapter.js +1 -1
  65. package/dist/e_volutionBidAdapter.js +1 -1
  66. package/dist/emtvBidAdapter.js +1 -1
  67. package/dist/eplanningBidAdapter.js +1 -1
  68. package/dist/euidIdSystem.js +1 -1
  69. package/dist/exadsBidAdapter.js +1 -1
  70. package/dist/feedadBidAdapter.js +1 -1
  71. package/dist/finativeBidAdapter.js +1 -1
  72. package/dist/freewheel-sspBidAdapter.js +1 -1
  73. package/dist/globalsunBidAdapter.js +1 -1
  74. package/dist/gmosspBidAdapter.js +1 -1
  75. package/dist/goldbachBidAdapter.js +1 -1
  76. package/dist/greenbidsAnalyticsAdapter.js +1 -1
  77. package/dist/greenbidsRtdProvider.js +1 -1
  78. package/dist/gridBidAdapter.js +1 -1
  79. package/dist/gumgumBidAdapter.js +1 -1
  80. package/dist/h12mediaBidAdapter.js +1 -1
  81. package/dist/hypelabBidAdapter.js +1 -1
  82. package/dist/id5AnalyticsAdapter.js +1 -1
  83. package/dist/id5IdSystem.js +1 -1
  84. package/dist/illuminBidAdapter.js +1 -1
  85. package/dist/imdsBidAdapter.js +1 -1
  86. package/dist/improvedigitalBidAdapter.js +1 -1
  87. package/dist/insticatorBidAdapter.js +1 -1
  88. package/dist/intentIqIdSystem.js +1 -1
  89. package/dist/iqzoneBidAdapter.js +1 -1
  90. package/dist/ixBidAdapter.js +1 -1
  91. package/dist/jixieBidAdapter.js +1 -1
  92. package/dist/justpremiumBidAdapter.js +1 -1
  93. package/dist/kargoBidAdapter.js +1 -1
  94. package/dist/kimberliteBidAdapter.js +1 -1
  95. package/dist/kiviadsBidAdapter.js +1 -1
  96. package/dist/konduitAnalyticsAdapter.js +1 -1
  97. package/dist/krushmediaBidAdapter.js +1 -1
  98. package/dist/kueezBidAdapter.js +1 -1
  99. package/dist/kueezRtbBidAdapter.js +1 -1
  100. package/dist/lassoBidAdapter.js +1 -1
  101. package/dist/lifestreetBidAdapter.js +1 -1
  102. package/dist/liveIntentIdSystem.js +1 -1
  103. package/dist/logicadBidAdapter.js +1 -1
  104. package/dist/loglyliftBidAdapter.js +1 -1
  105. package/dist/loyalBidAdapter.js +1 -1
  106. package/dist/luceadBidAdapter.js +1 -1
  107. package/dist/lunamediahbBidAdapter.js +1 -1
  108. package/dist/mabidderBidAdapter.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/mathildeadsBidAdapter.js +1 -1
  113. package/dist/mediafuseBidAdapter.js +1 -1
  114. package/dist/medianetAnalyticsAdapter.js +1 -1
  115. package/dist/medianetBidAdapter.js +1 -1
  116. package/dist/mediasquareBidAdapter.js +1 -1
  117. package/dist/mgidBidAdapter.js +1 -1
  118. package/dist/mgidXBidAdapter.js +1 -1
  119. package/dist/minutemediaBidAdapter.js +1 -1
  120. package/dist/missenaBidAdapter.js +1 -1
  121. package/dist/mobfoxpbBidAdapter.js +1 -1
  122. package/dist/mobianRtdProvider.js +1 -1
  123. package/dist/nexx360BidAdapter.js +1 -1
  124. package/dist/nobidAnalyticsAdapter.js +1 -1
  125. package/dist/nobidBidAdapter.js +1 -1
  126. package/dist/not-for-prod/prebid.js +211 -204
  127. package/dist/oguryBidAdapter.js +1 -1
  128. package/dist/onetagBidAdapter.js +1 -1
  129. package/dist/ooloAnalyticsAdapter.js +1 -1
  130. package/dist/openwebBidAdapter.js +1 -1
  131. package/dist/openxBidAdapter.js +1 -1
  132. package/dist/optidigitalBidAdapter.js +1 -1
  133. package/dist/orakiBidAdapter.js +1 -0
  134. package/dist/orbidderBidAdapter.js +1 -1
  135. package/dist/ortbConverter.js +1 -1
  136. package/dist/outbrainBidAdapter.js +1 -1
  137. package/dist/ozoneBidAdapter.js +1 -1
  138. package/dist/paapi.js +1 -1
  139. package/dist/pairIdSystem.js +1 -1
  140. package/dist/pgamsspBidAdapter.js +1 -1
  141. package/dist/pixfutureBidAdapter.js +1 -1
  142. package/dist/playdigoBidAdapter.js +1 -1
  143. package/dist/prebidServerBidAdapter.js +1 -1
  144. package/dist/pubCircleBidAdapter.js +1 -1
  145. package/dist/publinkIdSystem.js +1 -1
  146. package/dist/publirBidAdapter.js +1 -1
  147. package/dist/pubmaticAnalyticsAdapter.js +1 -1
  148. package/dist/pubmaticBidAdapter.js +1 -1
  149. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  150. package/dist/pubxaiAnalyticsAdapter.js +1 -1
  151. package/dist/pxyzBidAdapter.js +1 -1
  152. package/dist/qtBidAdapter.js +1 -1
  153. package/dist/quantcastBidAdapter.js +1 -1
  154. package/dist/raynRtdProvider.js +1 -1
  155. package/dist/readpeakBidAdapter.js +1 -1
  156. package/dist/relaidoBidAdapter.js +1 -1
  157. package/dist/retailspotBidAdapter.js +1 -1
  158. package/dist/rhythmoneBidAdapter.js +1 -1
  159. package/dist/riseBidAdapter.js +1 -1
  160. package/dist/rubiconBidAdapter.js +1 -1
  161. package/dist/seedingAllianceBidAdapter.js +1 -1
  162. package/dist/seedtagBidAdapter.js +1 -1
  163. package/dist/setupadBidAdapter.js +1 -1
  164. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  165. package/dist/sharethroughBidAdapter.js +1 -1
  166. package/dist/shinezBidAdapter.js +1 -1
  167. package/dist/shinezRtbBidAdapter.js +1 -1
  168. package/dist/smaatoBidAdapter.js +1 -1
  169. package/dist/smartadserverBidAdapter.js +1 -1
  170. package/dist/smartxBidAdapter.js +1 -1
  171. package/dist/smartyadsBidAdapter.js +1 -1
  172. package/dist/smartyadsUtils.js +1 -0
  173. package/dist/smartytechBidAdapter.js +1 -1
  174. package/dist/smilewantedBidAdapter.js +1 -1
  175. package/dist/snigelBidAdapter.js +1 -1
  176. package/dist/sonobiBidAdapter.js +1 -1
  177. package/dist/sovrnBidAdapter.js +1 -1
  178. package/dist/sspBCBidAdapter.js +1 -1
  179. package/dist/stnBidAdapter.js +1 -1
  180. package/dist/stvBidAdapter.js +1 -1
  181. package/dist/sublimeBidAdapter.js +1 -1
  182. package/dist/taboolaBidAdapter.js +1 -1
  183. package/dist/tagorasBidAdapter.js +1 -1
  184. package/dist/tappxBidAdapter.js +1 -1
  185. package/dist/targetVideoBidAdapter.js +1 -1
  186. package/dist/teadsBidAdapter.js +1 -1
  187. package/dist/teqblazeUtils.js +1 -0
  188. package/dist/terceptAnalyticsAdapter.js +1 -1
  189. package/dist/themoneytizerBidAdapter.js +1 -1
  190. package/dist/topicsFpdModule.js +1 -1
  191. package/dist/trionBidAdapter.js +1 -1
  192. package/dist/tripleliftBidAdapter.js +1 -1
  193. package/dist/ttdBidAdapter.js +1 -1
  194. package/dist/twistDigitalBidAdapter.js +1 -1
  195. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  196. package/dist/uid2IdSystem.js +1 -1
  197. package/dist/underdogmediaBidAdapter.js +1 -1
  198. package/dist/undertoneBidAdapter.js +1 -1
  199. package/dist/unrulyBidAdapter.js +1 -1
  200. package/dist/userId.js +1 -1
  201. package/dist/vidazooBidAdapter.js +1 -1
  202. package/dist/vidazooUtils.js +1 -0
  203. package/dist/videobyteBidAdapter.js +1 -1
  204. package/dist/visiblemeasuresBidAdapter.js +1 -1
  205. package/dist/visxBidAdapter.js +1 -1
  206. package/dist/vuukleBidAdapter.js +1 -1
  207. package/dist/widespaceBidAdapter.js +1 -1
  208. package/dist/winrBidAdapter.js +1 -1
  209. package/dist/yahooAdsBidAdapter.js +1 -1
  210. package/dist/yieldmoBidAdapter.js +1 -1
  211. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  212. package/dist/yuktamediaAnalyticsAdapter.js +1 -1
  213. package/integrationExamples/gpt/raynRtdProvider_example.html +1 -0
  214. package/libraries/adagioUtils/adagioUtils.js +35 -0
  215. package/libraries/appnexusUtils/anUtils.js +1 -0
  216. package/libraries/autoplayDetection/autoplay.js +8 -1
  217. package/libraries/consentManagement/cmUtils.js +38 -0
  218. package/libraries/ortbConverter/converter.js +1 -1
  219. package/libraries/smartyadsUtils/getAdUrlByRegion.js +32 -0
  220. package/libraries/teqblazeUtils/bidderUtils.js +253 -0
  221. package/libraries/vidazooUtils/bidderUtils.js +481 -0
  222. package/libraries/vidazooUtils/constants.js +7 -0
  223. package/modules/.submodules.json +1 -0
  224. package/modules/acuityadsBidAdapter.js +5 -203
  225. package/modules/adagioBidAdapter.js +1 -17
  226. package/modules/adagioRtdProvider.js +41 -51
  227. package/modules/adagioRtdProvider.md +1 -0
  228. package/modules/addefendBidAdapter.js +1 -2
  229. package/modules/adlooxRtdProvider.js +1 -1
  230. package/modules/admanBidAdapter.js +31 -188
  231. package/modules/adnuntiusBidAdapter.js +1 -0
  232. package/modules/adprimeBidAdapter.js +28 -165
  233. package/modules/adxcgAnalyticsAdapter.js +1 -2
  234. package/modules/axisBidAdapter.js +33 -165
  235. package/modules/beyondmediaBidAdapter.js +5 -189
  236. package/modules/bliinkBidAdapter.js +3 -31
  237. package/modules/boldwinBidAdapter.js +21 -159
  238. package/modules/ceeIdSystem.js +1 -1
  239. package/modules/compassBidAdapter.js +5 -198
  240. package/modules/consentManagementGpp.js +2 -38
  241. package/modules/consentManagementTcf.js +7 -38
  242. package/modules/contentexchangeBidAdapter.js +5 -200
  243. package/modules/conversantAnalyticsAdapter.js +1 -2
  244. package/modules/conversantBidAdapter.js +1 -0
  245. package/modules/copper6sspBidAdapter.js +19 -0
  246. package/modules/copper6sspBidAdapter.md +79 -0
  247. package/modules/criteoBidAdapter.js +10 -3
  248. package/modules/e_volutionBidAdapter.js +4 -186
  249. package/modules/emtvBidAdapter.js +5 -198
  250. package/modules/globalsunBidAdapter.js +5 -199
  251. package/modules/id5AnalyticsAdapter.js +1 -2
  252. package/modules/id5IdSystem.js +31 -2
  253. package/modules/id5IdSystem.md +67 -2
  254. package/modules/intentIqIdSystem.js +408 -50
  255. package/modules/intentIqIdSystem.md +92 -0
  256. package/modules/iqzoneBidAdapter.js +5 -224
  257. package/modules/kiviadsBidAdapter.js +5 -199
  258. package/modules/krushmediaBidAdapter.js +25 -143
  259. package/modules/liveIntentIdSystem.js +2 -2
  260. package/modules/loyalBidAdapter.js +4 -178
  261. package/modules/lunamediahbBidAdapter.js +5 -118
  262. package/modules/mabidderBidAdapter.js +1 -2
  263. package/modules/mathildeadsBidAdapter.js +5 -198
  264. package/modules/medianetAnalyticsAdapter.js +1 -2
  265. package/modules/medianetBidAdapter.js +1 -1
  266. package/modules/mgidXBidAdapter.js +14 -207
  267. package/modules/mobfoxpbBidAdapter.js +4 -135
  268. package/modules/mobianRtdProvider.js +2 -2
  269. package/modules/nobidAnalyticsAdapter.js +2 -3
  270. package/modules/orakiBidAdapter.js +19 -0
  271. package/modules/orakiBidAdapter.md +79 -0
  272. package/modules/orbidderBidAdapter.js +4 -2
  273. package/modules/ozoneBidAdapter.js +117 -58
  274. package/modules/paapi.js +2 -1
  275. package/modules/pairIdSystem.js +27 -10
  276. package/modules/pgamsspBidAdapter.js +5 -240
  277. package/modules/pixfutureBidAdapter.js +1 -2
  278. package/modules/playdigoBidAdapter.js +4 -186
  279. package/modules/prebidServerBidAdapter/index.js +10 -3
  280. package/modules/pubCircleBidAdapter.js +5 -218
  281. package/modules/pubmaticAnalyticsAdapter.js +21 -8
  282. package/modules/pubxaiAnalyticsAdapter.js +1 -5
  283. package/modules/qtBidAdapter.js +5 -224
  284. package/modules/raynRtdProvider.js +36 -3
  285. package/modules/seedtagBidAdapter.js +5 -0
  286. package/modules/setupadBidAdapter.js +58 -140
  287. package/modules/smartadserverBidAdapter.js +3 -0
  288. package/modules/smartyadsBidAdapter.js +6 -110
  289. package/modules/smartytechBidAdapter.js +7 -2
  290. package/modules/snigelBidAdapter.js +1 -2
  291. package/modules/tappxBidAdapter.js +1 -2
  292. package/modules/terceptAnalyticsAdapter.js +1 -2
  293. package/modules/topicsFpdModule.js +1 -1
  294. package/modules/twistDigitalBidAdapter.js +1 -12
  295. package/modules/uid2IdSystem.js +0 -1
  296. package/modules/uid2IdSystem_shared.js +0 -1
  297. package/modules/userId/index.js +31 -21
  298. package/modules/vidazooBidAdapter.js +26 -468
  299. package/modules/visiblemeasuresBidAdapter.js +5 -199
  300. package/modules/yahooAdsBidAdapter.js +4 -1
  301. package/modules/yuktamediaAnalyticsAdapter.js +1 -2
  302. package/package.json +1 -1
  303. package/src/auction.js +5 -63
  304. package/src/utils/focusTimeout.js +41 -0
  305. package/src/utils/ttlCollection.js +2 -1
  306. package/src/utils.js +42 -0
  307. package/src/videoCache.js +72 -0
  308. package/test/mocks/videoCacheStub.js +1 -1
  309. package/test/spec/auctionmanager_spec.js +16 -1
  310. package/test/spec/fpd/gdpr_spec.js +24 -2
  311. package/test/spec/libraries/teqblazeUtils/bidderUtils_spec.js +519 -0
  312. package/test/spec/modules/acuityadsBidAdapter_spec.js +79 -43
  313. package/test/spec/modules/adagioRtdProvider_spec.js +62 -1
  314. package/test/spec/modules/admanBidAdapter_spec.js +370 -247
  315. package/test/spec/modules/adnuntiusBidAdapter_spec.js +6 -3
  316. package/test/spec/modules/adprimeBidAdapter_spec.js +225 -78
  317. package/test/spec/modules/axisBidAdapter_spec.js +78 -14
  318. package/test/spec/modules/beyondmediaBidAdapter_spec.js +80 -18
  319. package/test/spec/modules/bliinkBidAdapter_spec.js +8 -2
  320. package/test/spec/modules/boldwinBidAdapter_spec.js +221 -75
  321. package/test/spec/modules/compassBidAdapter_spec.js +130 -16
  322. package/test/spec/modules/contentexchangeBidAdapter_spec.js +134 -21
  323. package/test/spec/modules/conversantAnalyticsAdapter_spec.js +1 -1
  324. package/test/spec/modules/conversantBidAdapter_spec.js +7 -0
  325. package/test/spec/modules/copper6sspBidAdapter_spec.js +514 -0
  326. package/test/spec/modules/e_volutionBidAdapter_spec.js +65 -3
  327. package/test/spec/modules/emtvBidAdapter_spec.js +131 -16
  328. package/test/spec/modules/globalsunBidAdapter_spec.js +130 -16
  329. package/test/spec/modules/id5IdSystem_spec.js +79 -3
  330. package/test/spec/modules/intentIqIdSystem_spec.js +264 -36
  331. package/test/spec/modules/iqzoneBidAdapter_spec.js +66 -12
  332. package/test/spec/modules/kiviadsBidAdapter_spec.js +131 -20
  333. package/test/spec/modules/krushmediaBidAdapter_spec.js +272 -90
  334. package/test/spec/modules/loyalBidAdapter_spec.js +114 -14
  335. package/test/spec/modules/lunamediahbBidAdapter_spec.js +221 -87
  336. package/test/spec/modules/mathildeadsBidAdapter_spec.js +87 -18
  337. package/test/spec/modules/mgidXBidAdapter_spec.js +11 -3
  338. package/test/spec/modules/mobfoxpbBidAdapter_spec.js +229 -91
  339. package/test/spec/modules/orakiBidAdapter_spec.js +510 -0
  340. package/test/spec/modules/ozoneBidAdapter_spec.js +192 -22
  341. package/test/spec/modules/paapi_spec.js +5 -5
  342. package/test/spec/modules/pgamsspBidAdapter_spec.js +83 -16
  343. package/test/spec/modules/playdigoBidAdapter_spec.js +38 -9
  344. package/test/spec/modules/prebidServerBidAdapter_spec.js +14 -0
  345. package/test/spec/modules/pubCircleBidAdapter_spec.js +82 -17
  346. package/test/spec/modules/pubmaticAnalyticsAdapter_spec.js +52 -5
  347. package/test/spec/modules/qtBidAdapter_spec.js +15 -3
  348. package/test/spec/modules/raynRtdProvider_spec.js +25 -0
  349. package/test/spec/modules/seedtagBidAdapter_spec.js +29 -0
  350. package/test/spec/modules/setupadBidAdapter_spec.js +124 -97
  351. package/test/spec/modules/smartadserverBidAdapter_spec.js +7 -0
  352. package/test/spec/modules/smartyadsBidAdapter_spec.js +6 -83
  353. package/test/spec/modules/smartytechBidAdapter_spec.js +5 -1
  354. package/test/spec/modules/topicsFpdModule_spec.js +43 -59
  355. package/test/spec/modules/twistDigitalBidAdapter_spec.js +5 -3
  356. package/test/spec/modules/userId_spec.js +86 -47
  357. package/test/spec/modules/vidazooBidAdapter_spec.js +21 -23
  358. package/test/spec/modules/visiblemeasuresBidAdapter_spec.js +130 -16
  359. package/test/spec/modules/yahooAdsBidAdapter_spec.js +1 -1
  360. package/test/spec/ortbConverter/converter_spec.js +7 -3
  361. package/test/spec/unit/utils/focusTimeout_spec.js +60 -0
  362. package/test/spec/videoCache_spec.js +56 -53
@@ -1,5 +1,4 @@
1
1
  import {
2
- deepClone,
3
2
  logInfo,
4
3
  logError,
5
4
  deepAccess,
@@ -9,7 +8,7 @@ import {
9
8
  contains,
10
9
  mergeDeep,
11
10
  parseUrl,
12
- generateUUID
11
+ generateUUID, isInteger, deepClone
13
12
  } from '../src/utils.js';
14
13
  import { registerBidder } from '../src/adapters/bidderFactory.js';
15
14
  import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js';
@@ -23,7 +22,7 @@ const AUCTIONURI = '/openrtb2/auction';
23
22
  const OZONECOOKIESYNC = '/static/load-cookie.html';
24
23
  const OZONE_RENDERER_URL = 'https://prebid.the-ozone-project.com/ozone-renderer.js';
25
24
  const ORIGIN_DEV = 'https://test.ozpr.net';
26
- const OZONEVERSION = '2.9.1';
25
+ const OZONEVERSION = '2.9.2';
27
26
  export const spec = {
28
27
  gvlid: 524,
29
28
  aliases: [{code: 'lmc', gvlid: 524}, {code: 'venatus', gvlid: 524}],
@@ -39,11 +38,11 @@ export const spec = {
39
38
  'auctionUrl': ORIGIN + AUCTIONURI,
40
39
  'cookieSyncUrl': ORIGIN + OZONECOOKIESYNC,
41
40
  'rendererUrl': OZONE_RENDERER_URL,
42
- 'batchRequests': false /* you can change this to true OR override it in the config: config.ozone.batchRequests */
41
+ 'batchRequests': false /* you can change this to true OR numeric OR override it in the config: config.ozone.batchRequests = true/false/number */
43
42
  },
44
43
  loadWhitelabelData(bid) {
45
44
  if (this.propertyBag.whitelabel) { return; }
46
- this.propertyBag.whitelabel = deepClone(this.whitelabel_defaults);
45
+ this.propertyBag.whitelabel = JSON.parse(JSON.stringify(this.whitelabel_defaults));
47
46
  let bidder = bid.bidder || 'ozone'; // eg. ozone
48
47
  this.propertyBag.whitelabel.logId = bidder.toUpperCase();
49
48
  this.propertyBag.whitelabel.bidder = bidder;
@@ -77,10 +76,22 @@ export const spec = {
77
76
  }
78
77
  }
79
78
  if (bidderConfig.hasOwnProperty('batchRequests')) {
80
- this.propertyBag.whitelabel.batchRequests = bidderConfig.batchRequests;
79
+ if (this.batchValueIsValid(bidderConfig.batchRequests)) {
80
+ this.propertyBag.whitelabel.batchRequests = bidderConfig.batchRequests;
81
+ } else {
82
+ logError('bidderConfig.batchRequests must be boolean or a number. Found & ignored data type: ' + typeof bidderConfig.batchRequests);
83
+ }
84
+ }
85
+ if (bidderConfig.hasOwnProperty('videoParams')) {
86
+ this.propertyBag.whitelabel.videoParams = bidderConfig.videoParams;
81
87
  }
82
88
  if (arr.hasOwnProperty('batchRequests')) {
83
- this.propertyBag.whitelabel.batchRequests = true;
89
+ let getBatch = parseInt(arr.batchRequests);
90
+ if (this.batchValueIsValid(getBatch)) {
91
+ this.propertyBag.whitelabel.batchRequests = getBatch;
92
+ } else {
93
+ logError('Ignoring query param: batchRequests - this must be a positive number');
94
+ }
84
95
  }
85
96
  try {
86
97
  if (arr.hasOwnProperty('auction') && arr.auction === 'dev') {
@@ -94,6 +105,9 @@ export const spec = {
94
105
  } catch (e) {}
95
106
  logInfo('set propertyBag.whitelabel to', this.propertyBag.whitelabel);
96
107
  },
108
+ batchValueIsValid(batch) {
109
+ return typeof batch === 'boolean' || (typeof batch === 'number' && batch > 0);
110
+ },
97
111
  getAuctionUrl() {
98
112
  return this.propertyBag.whitelabel.auctionUrl;
99
113
  },
@@ -103,9 +117,17 @@ export const spec = {
103
117
  getRendererUrl() {
104
118
  return this.propertyBag.whitelabel.rendererUrl;
105
119
  },
106
- isBatchRequests() {
107
- logInfo('isBatchRequests going to return ', this.propertyBag.whitelabel.batchRequests);
108
- return this.propertyBag.whitelabel.batchRequests;
120
+ getVideoPlacementValue: function(context) {
121
+ if (['instream', 'outstream'].indexOf(context) < 0) return null;
122
+ return deepAccess(this.propertyBag, `whitelabel.videoParams.${context}`, null);
123
+ },
124
+ getBatchRequests() {
125
+ logInfo('getBatchRequests going to return ', this.propertyBag.whitelabel.batchRequests);
126
+ if (this.propertyBag.whitelabel.batchRequests === true) { return 10; }
127
+ if (typeof this.propertyBag.whitelabel.batchRequests === 'number' && this.propertyBag.whitelabel.batchRequests > 0) {
128
+ return this.propertyBag.whitelabel.batchRequests;
129
+ }
130
+ return false;
109
131
  },
110
132
  isBidRequestValid(bid) {
111
133
  this.loadWhitelabelData(bid);
@@ -182,9 +204,10 @@ export const spec = {
182
204
  if (this.blockTheRequest()) {
183
205
  return [];
184
206
  }
207
+ let fledgeEnabled = !!bidderRequest.fledgeEnabled; // IF true then this is added as each bid[].ext.ae=1
185
208
  let htmlParams = {'publisherId': '', 'siteId': ''};
186
209
  if (validBidRequests.length > 0) {
187
- this.cookieSyncBag.userIdObject = Object.assign(this.cookieSyncBag.userIdObject, this.findAllUserIds(validBidRequests[0]));
210
+ this.cookieSyncBag.userIdObject = Object.assign(this.cookieSyncBag.userIdObject, this.findAllUserIdsFromEids(validBidRequests[0]));
188
211
  this.cookieSyncBag.siteId = deepAccess(validBidRequests[0], 'params.siteId');
189
212
  this.cookieSyncBag.publisherId = deepAccess(validBidRequests[0], 'params.publisherId');
190
213
  htmlParams = validBidRequests[0].params;
@@ -306,6 +329,14 @@ export const spec = {
306
329
  if (gpid) {
307
330
  deepSetValue(obj, 'ext.gpid', gpid);
308
331
  }
332
+ if (fledgeEnabled) { // fledge is enabled at some config level - pbjs.setBidderConfig or pbjs.setConfig
333
+ const auctionEnvironment = deepAccess(ozoneBidRequest, 'ortb2Imp.ext.ae'); // this will be set for one of 3 reasons; adunit, setBidderConfig, setConfig
334
+ if (isInteger(auctionEnvironment)) {
335
+ deepSetValue(obj, 'ext.ae', auctionEnvironment);
336
+ } else {
337
+ logError('ortb2Imp.ext.ae is not an integer - ignoring it for obj.id=' + obj.id);
338
+ }
339
+ }
309
340
  return obj;
310
341
  });
311
342
  let extObj = {};
@@ -314,8 +345,8 @@ export const spec = {
314
345
  extObj[whitelabelBidder][whitelabelPrefix + '_rw'] = placementIdOverrideFromGetParam ? 1 : 0;
315
346
  if (validBidRequests.length > 0) {
316
347
  let userIds = this.cookieSyncBag.userIdObject; // 2021-01-06 - slight optimisation - we've already found this info
317
- if (userIds.hasOwnProperty('pubcid')) {
318
- extObj[whitelabelBidder].pubcid = userIds.pubcid;
348
+ if (userIds.hasOwnProperty('pubcid.org')) {
349
+ extObj[whitelabelBidder].pubcid = userIds['pubcid.org'];
319
350
  }
320
351
  }
321
352
  extObj[whitelabelBidder].pv = this.getPageId(); // attach the page ID that will be common to all auction calls for this page if refresh() is called
@@ -363,6 +394,10 @@ export const spec = {
363
394
  } else {
364
395
  logInfo('WILL NOT ADD USP consent info; no bidderRequest.uspConsent.');
365
396
  }
397
+ if (bidderRequest?.ortb2?.regs?.gpp) {
398
+ deepSetValue(ozoneRequest, 'regs.gpp', bidderRequest.ortb2.regs.gpp);
399
+ deepSetValue(ozoneRequest, 'regs.gpp_sid', bidderRequest.ortb2.regs.gpp_sid);
400
+ }
366
401
  if (schain) { // we set this while iterating over the bids
367
402
  logInfo('schain found');
368
403
  deepSetValue(ozoneRequest, 'source.ext.schain', schain);
@@ -370,15 +405,26 @@ export const spec = {
370
405
  if (config.getConfig('coppa') === true) {
371
406
  deepSetValue(ozoneRequest, 'regs.coppa', 1);
372
407
  }
408
+ extObj[whitelabelBidder].cookieDeprecationLabel = deepAccess(bidderRequest, 'ortb2.device.ext.cdep', 'none');
409
+ logInfo('cookieDeprecationLabel from bidderRequest object = ' + extObj[whitelabelBidder].cookieDeprecationLabel);
373
410
  let ozUuid = generateUUID();
374
- if (this.isBatchRequests()) {
411
+ let batchRequestsVal = this.getBatchRequests(); // false|numeric
412
+ if (typeof batchRequestsVal === 'number') {
375
413
  logInfo('going to batch the requests');
376
414
  let arrRet = []; // return an array of objects containing data describing max 10 bids
377
- for (let i = 0; i < tosendtags.length; i += 10) {
378
- ozoneRequest.id = ozUuid; // Unique ID of the bid request, provided by the exchange. (REQUIRED)
379
- ozoneRequest.imp = tosendtags.slice(i, i + 10);
380
- ozoneRequest.ext = extObj;
415
+ for (let i = 0; i < tosendtags.length; i += batchRequestsVal) {
416
+ if (bidderRequest.auctionId) {
417
+ logInfo('Found bidderRequest.auctionId - will pass these values through & not generate our own id');
418
+ ozoneRequest.id = bidderRequest.auctionId;
419
+ ozoneRequest.auctionId = bidderRequest.auctionId;
420
+ deepSetValue(ozoneRequest, 'source.tid', deepAccess(bidderRequest, 'ortb2.source.tid'));
421
+ } else {
422
+ logInfo('Did not find bidderRequest.auctionId - will generate our own id');
423
+ ozoneRequest.id = ozUuid; // Unique ID of the bid request, provided by the exchange. (REQUIRED)
424
+ }
381
425
  deepSetValue(ozoneRequest, 'user.ext.eids', userExtEids);
426
+ ozoneRequest.imp = tosendtags.slice(i, i + batchRequestsVal);
427
+ ozoneRequest.ext = extObj;
382
428
  if (ozoneRequest.imp.length > 0) {
383
429
  arrRet.push({
384
430
  method: 'POST',
@@ -394,7 +440,15 @@ export const spec = {
394
440
  logInfo('requests will not be batched.');
395
441
  if (singleRequest) {
396
442
  logInfo('buildRequests starting to generate response for a single request');
397
- ozoneRequest.id = ozUuid; // Unique ID of the bid request, provided by the exchange. (REQUIRED)
443
+ if (bidderRequest.auctionId) {
444
+ logInfo('Found bidderRequest.auctionId - will pass these values through & not generate our own id');
445
+ ozoneRequest.id = bidderRequest.auctionId;
446
+ ozoneRequest.auctionId = bidderRequest.auctionId;
447
+ deepSetValue(ozoneRequest, 'source.tid', deepAccess(bidderRequest, 'ortb2.source.tid'));
448
+ } else {
449
+ logInfo('Did not find bidderRequest.auctionId - will generate our own id');
450
+ ozoneRequest.id = ozUuid; // Unique ID of the bid request, provided by the exchange. (REQUIRED)
451
+ }
398
452
  ozoneRequest.imp = tosendtags;
399
453
  ozoneRequest.ext = extObj;
400
454
  deepSetValue(ozoneRequest, 'user.ext.eids', userExtEids);
@@ -522,6 +576,7 @@ export const spec = {
522
576
  adserverTargeting[whitelabelPrefix + '_' + bidderName + '_adv'] = String(allBidsForThisBidid[bidderName].adomain);
523
577
  adserverTargeting[whitelabelPrefix + '_' + bidderName + '_adId'] = String(allBidsForThisBidid[bidderName].adId);
524
578
  adserverTargeting[whitelabelPrefix + '_' + bidderName + '_pb_r'] = getRoundedBid(allBidsForThisBidid[bidderName].price, allBidsForThisBidid[bidderName].ext.prebid.type);
579
+ adserverTargeting[whitelabelPrefix + '_' + bidderName + '_size'] = String(allBidsForThisBidid[bidderName].width) + 'x' + String(allBidsForThisBidid[bidderName].height);
525
580
  if (allBidsForThisBidid[bidderName].hasOwnProperty('dealid')) {
526
581
  adserverTargeting[whitelabelPrefix + '_' + bidderName + '_dealid'] = String(allBidsForThisBidid[bidderName].dealid);
527
582
  }
@@ -572,10 +627,28 @@ export const spec = {
572
627
  arrAllBids.push(thisBid);
573
628
  }
574
629
  }
630
+ let ret = arrAllBids;
631
+ let fledgeAuctionConfigs = deepAccess(serverResponse, 'ext.igi') || []; // 20240606 standardising
632
+ if (Array.isArray(fledgeAuctionConfigs) && fledgeAuctionConfigs.length > 0) {
633
+ fledgeAuctionConfigs = fledgeAuctionConfigs.filter(config => {
634
+ if (!this.isValidAuctionConfig(config)) {
635
+ logWarn('Malformed auction config detected:', config);
636
+ return false;
637
+ }
638
+ return true;
639
+ });
640
+ ret = {
641
+ bids: arrAllBids,
642
+ fledgeAuctionConfigs,
643
+ };
644
+ }
575
645
  let endTime = new Date().getTime();
576
646
  logInfo(`interpretResponse going to return at time ${endTime} (took ${endTime - startTime}ms) Time from buildRequests Start -> interpretRequests End = ${endTime - this.propertyBag.buildRequestsStart}ms`);
577
- logInfo('interpretResponse arrAllBids (serialised): ', deepClone(arrAllBids)); // this is ok to log because the renderer has not been attached yet
578
- return arrAllBids;
647
+ logInfo('interpretResponse arrAllBids (serialised): ', deepClone(ret)); // this is ok to log because the renderer has not been attached yet
648
+ return ret;
649
+ },
650
+ isValidAuctionConfig(config) {
651
+ return typeof config === 'object' && config !== null;
579
652
  },
580
653
  setBidMediaTypeIfNotExist(thisBid, mediaType) {
581
654
  if (!thisBid.hasOwnProperty('mediaType')) {
@@ -614,11 +687,12 @@ export const spec = {
614
687
  }
615
688
  return ret;
616
689
  },
617
- getUserSyncs(optionsType, serverResponse, gdprConsent, usPrivacy) {
690
+ getUserSyncs(optionsType, serverResponse, gdprConsent, usPrivacy, gppConsent = {}) {
618
691
  logInfo('getUserSyncs optionsType', optionsType, 'serverResponse', serverResponse, 'gdprConsent', gdprConsent, 'usPrivacy', usPrivacy, 'cookieSyncBag', this.cookieSyncBag);
619
692
  if (!serverResponse || serverResponse.length === 0) {
620
693
  return [];
621
694
  }
695
+ let { gppString = '', applicableSections = [] } = gppConsent;
622
696
  if (optionsType.iframeEnabled) {
623
697
  var arrQueryString = [];
624
698
  if (config.getConfig('debug')) {
@@ -627,6 +701,10 @@ export const spec = {
627
701
  arrQueryString.push('gdpr=' + (deepAccess(gdprConsent, 'gdprApplies', false) ? '1' : '0'));
628
702
  arrQueryString.push('gdpr_consent=' + deepAccess(gdprConsent, 'consentString', ''));
629
703
  arrQueryString.push('usp_consent=' + (usPrivacy || ''));
704
+ arrQueryString.push('gpp=' + gppString);
705
+ if (Array.isArray(applicableSections)) {
706
+ arrQueryString.push(`gpp_sid=${applicableSections.join()}`);
707
+ }
630
708
  for (let keyname in this.cookieSyncBag.userIdObject) {
631
709
  arrQueryString.push(keyname + '=' + this.cookieSyncBag.userIdObject[keyname]);
632
710
  }
@@ -660,43 +738,26 @@ export const spec = {
660
738
  }
661
739
  return null;
662
740
  },
663
- findAllUserIds(bidRequest) {
664
- var ret = {};
665
- let searchKeysSingle = ['pubcid', 'tdid', 'idl_env', 'criteoId', 'lotamePanoramaId', 'fabrickId'];
666
- if (bidRequest.hasOwnProperty('userId')) {
667
- for (let arrayId in searchKeysSingle) {
668
- let key = searchKeysSingle[arrayId];
669
- if (bidRequest.userId.hasOwnProperty(key)) {
670
- if (typeof (bidRequest.userId[key]) == 'string') {
671
- ret[key] = bidRequest.userId[key];
672
- } else if (typeof (bidRequest.userId[key]) == 'object') {
673
- logError(`WARNING: findAllUserIds had to use first key in user object to get value for bid.userId key: ${key}. Prebid adapter should be updated.`);
674
- ret[key] = bidRequest.userId[key][Object.keys(bidRequest.userId[key])[0]]; // cannot use Object.values
675
- } else {
676
- logError(`failed to get string key value for userId : ${key}`);
677
- }
678
- }
679
- }
680
- let lipbid = deepAccess(bidRequest.userId, 'lipb.lipbid');
681
- if (lipbid) {
682
- ret['lipb'] = {'lipbid': lipbid};
683
- }
684
- let id5id = deepAccess(bidRequest.userId, 'id5id.uid');
685
- if (id5id) {
686
- ret['id5id'] = id5id;
687
- }
688
- let sharedid = deepAccess(bidRequest.userId, 'sharedid.id');
689
- if (sharedid) {
690
- ret['sharedid'] = sharedid;
691
- }
741
+ findAllUserIdsFromEids(bidRequest) {
742
+ let ret = {};
743
+ if (!bidRequest.hasOwnProperty('userIdAsEids')) {
744
+ logInfo('findAllUserIdsFromEids - no bidRequest.userIdAsEids object - will quit');
745
+ this.tryGetPubCidFromOldLocation(ret, bidRequest); // legacy
746
+ return ret;
747
+ }
748
+ for (let obj of bidRequest.userIdAsEids) {
749
+ ret[obj.source] = deepAccess(obj, 'uids.0.id');
692
750
  }
751
+ this.tryGetPubCidFromOldLocation(ret, bidRequest); // legacy
752
+ return ret;
753
+ },
754
+ tryGetPubCidFromOldLocation(ret, bidRequest) {
693
755
  if (!ret.hasOwnProperty('pubcid')) {
694
756
  let pubcid = deepAccess(bidRequest, 'crumbs.pubcid');
695
757
  if (pubcid) {
696
- ret['pubcid'] = pubcid; // if built with old pubCommonId module
758
+ ret['pubcid.org'] = pubcid; // if built with old pubCommonId module (use the new eid key)
697
759
  }
698
760
  }
699
- return ret;
700
761
  },
701
762
  getPlacementId(bidRequest) {
702
763
  return (bidRequest.params.placementId).toString();
@@ -792,11 +853,9 @@ export const spec = {
792
853
  return objRet;
793
854
  },
794
855
  _addVideoDefaults(objRet, objConfig, addIfMissing) {
795
- let context = deepAccess(objConfig, 'context');
796
- if (context === 'outstream') {
797
- objRet.placement = 3;
798
- } else if (context === 'instream') {
799
- objRet.placement = 1;
856
+ let placementValue = this.getVideoPlacementValue(deepAccess(objConfig, 'context'));
857
+ if (placementValue) {
858
+ objRet.placement = placementValue;
800
859
  }
801
860
  let skippable = deepAccess(objConfig, 'skippable', null);
802
861
  if (skippable == null) {
package/modules/paapi.js CHANGED
@@ -158,8 +158,9 @@ export function addPaapiConfigHook(next, request, paapiConfig) {
158
158
  const {config, igb} = paapiConfig;
159
159
  if (config) {
160
160
  config.auctionSignals = setFPD(config.auctionSignals || {}, request);
161
+ const pbs = config.perBuyerSignals = config.perBuyerSignals ?? {};
161
162
  (config.interestGroupBuyers || []).forEach(buyer => {
162
- deepSetValue(config, `perBuyerSignals.${buyer}`, setFPD(config.perBuyerSignals?.[buyer] || {}, request));
163
+ pbs[buyer] = setFPD(pbs[buyer] ?? {}, request);
163
164
  })
164
165
  storePendingData(pendingConfigsForAuction, config);
165
166
  }
@@ -50,9 +50,11 @@ export const pairIdSubmodule = {
50
50
  return value && Array.isArray(value) ? {'pairId': value} : undefined
51
51
  },
52
52
  /**
53
- * performs action to obtain id and return a value in the callback's response argument
54
- * @function
55
- * @returns {id: string | undefined }
53
+ * Performs action to obtain ID and return a value in the callback's response argument.
54
+ * @function getId
55
+ * @param {Object} config - The configuration object.
56
+ * @param {Object} config.params - The parameters from the configuration.
57
+ * @returns {{id: string[] | undefined}} The obtained IDs or undefined if no IDs are found.
56
58
  */
57
59
  getId(config) {
58
60
  const pairIdsString = pairIdFromLocalStorage(PAIR_ID_KEY) || pairIdFromCookie(PAIR_ID_KEY)
@@ -67,13 +69,28 @@ export const pairIdSubmodule = {
67
69
 
68
70
  const configParams = (config && config.params) || {};
69
71
  if (configParams && configParams.liveramp) {
70
- let LRStorageLocation = configParams.liveramp.storageKey || DEFAULT_LIVERAMP_PAIR_ID_KEY
71
- const liverampValue = pairIdFromLocalStorage(LRStorageLocation) || pairIdFromCookie(LRStorageLocation)
72
- try {
73
- const obj = JSON.parse(atob(liverampValue));
74
- ids = ids.concat(obj.envelope);
75
- } catch (error) {
76
- logInfo(error)
72
+ let LRStorageLocation = configParams.liveramp.storageKey || DEFAULT_LIVERAMP_PAIR_ID_KEY;
73
+ const liverampValue = pairIdFromLocalStorage(LRStorageLocation) || pairIdFromCookie(LRStorageLocation);
74
+
75
+ if (liverampValue) {
76
+ try {
77
+ const parsedValue = atob(liverampValue);
78
+ if (parsedValue) {
79
+ const obj = JSON.parse(parsedValue);
80
+
81
+ if (obj && typeof obj === 'object' && obj.envelope) {
82
+ ids = ids.concat(obj.envelope);
83
+ } else {
84
+ logInfo('Pairid: Parsed object is not valid or does not contain envelope');
85
+ }
86
+ } else {
87
+ logInfo('Pairid: Decoded value is empty');
88
+ }
89
+ } catch (error) {
90
+ logInfo('Pairid: Error parsing JSON: ', error);
91
+ }
92
+ } else {
93
+ logInfo('Pairid: liverampValue for pairId from storage is empty or null');
77
94
  }
78
95
  }
79
96
 
@@ -1,254 +1,19 @@
1
- import { isFn, deepAccess, logMessage, logError } from '../src/utils.js';
2
- import { convertOrtbRequestToProprietaryNative } from '../src/native.js';
3
-
4
1
  import { registerBidder } from '../src/adapters/bidderFactory.js';
5
2
  import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js';
6
- import { config } from '../src/config.js';
3
+ import { isBidRequestValid, buildRequests, interpretResponse, getUserSyncs } from '../libraries/teqblazeUtils/bidderUtils.js';
7
4
 
8
5
  const BIDDER_CODE = 'pgamssp';
9
6
  const AD_URL = 'https://us-east.pgammedia.com/pbjs';
10
7
  const SYNC_URL = 'https://cs.pgammedia.com';
11
8
 
12
- function isBidResponseValid(bid) {
13
- if (!bid.requestId || !bid.cpm || !bid.creativeId || !bid.ttl || !bid.currency) {
14
- return false;
15
- }
16
-
17
- switch (bid.mediaType) {
18
- case BANNER:
19
- return Boolean(bid.width && bid.height && bid.ad);
20
- case VIDEO:
21
- return Boolean(bid.vastUrl || bid.vastXml);
22
- case NATIVE:
23
- return Boolean(bid.native && bid.native.impressionTrackers && bid.native.impressionTrackers.length);
24
- default:
25
- return false;
26
- }
27
- }
28
-
29
- function getPlacementReqData(bid) {
30
- const { params, bidId, mediaTypes } = bid;
31
- const schain = bid.schain || {};
32
- const { placementId, endpointId } = params;
33
- const bidfloor = getBidFloor(bid);
34
-
35
- const placement = {
36
- bidId,
37
- schain,
38
- bidfloor,
39
- eids: []
40
- };
41
-
42
- if (bid.userId) {
43
- getUserId(placement.eids, bid.userId.uid2?.id, 'uidapi.com');
44
- getUserId(placement.eids, bid.userId.id5id?.uid, 'id5-sync.com');
45
- }
46
-
47
- if (placementId) {
48
- placement.placementId = placementId;
49
- placement.type = 'publisher';
50
- } else if (endpointId) {
51
- placement.endpointId = endpointId;
52
- placement.type = 'network';
53
- }
54
-
55
- if (mediaTypes && mediaTypes[BANNER]) {
56
- placement.adFormat = BANNER;
57
- placement.sizes = mediaTypes[BANNER].sizes;
58
- } else if (mediaTypes && mediaTypes[VIDEO]) {
59
- placement.adFormat = VIDEO;
60
- placement.playerSize = mediaTypes[VIDEO].playerSize;
61
- placement.minduration = mediaTypes[VIDEO].minduration;
62
- placement.maxduration = mediaTypes[VIDEO].maxduration;
63
- placement.mimes = mediaTypes[VIDEO].mimes;
64
- placement.protocols = mediaTypes[VIDEO].protocols;
65
- placement.startdelay = mediaTypes[VIDEO].startdelay;
66
- placement.placement = mediaTypes[VIDEO].placement;
67
- placement.plcmt = mediaTypes[VIDEO].plcmt;
68
- placement.skip = mediaTypes[VIDEO].skip;
69
- placement.skipafter = mediaTypes[VIDEO].skipafter;
70
- placement.minbitrate = mediaTypes[VIDEO].minbitrate;
71
- placement.maxbitrate = mediaTypes[VIDEO].maxbitrate;
72
- placement.delivery = mediaTypes[VIDEO].delivery;
73
- placement.playbackmethod = mediaTypes[VIDEO].playbackmethod;
74
- placement.api = mediaTypes[VIDEO].api;
75
- placement.linearity = mediaTypes[VIDEO].linearity;
76
- } else if (mediaTypes && mediaTypes[NATIVE]) {
77
- placement.native = mediaTypes[NATIVE];
78
- placement.adFormat = NATIVE;
79
- }
80
-
81
- return placement;
82
- }
83
-
84
- function getBidFloor(bid) {
85
- if (!isFn(bid.getFloor)) {
86
- return deepAccess(bid, 'params.bidfloor', 0);
87
- }
88
-
89
- try {
90
- const bidFloor = bid.getFloor({
91
- currency: 'USD',
92
- mediaType: '*',
93
- size: '*',
94
- });
95
- return bidFloor.floor;
96
- } catch (err) {
97
- logError(err);
98
- return 0;
99
- }
100
- }
101
- function getUserId(eids, id, source, uidExt) {
102
- if (id) {
103
- var uid = { id };
104
- if (uidExt) {
105
- uid.ext = uidExt;
106
- }
107
- eids.push({
108
- source,
109
- uids: [ uid ]
110
- });
111
- }
112
- }
113
-
114
9
  export const spec = {
115
10
  code: BIDDER_CODE,
116
11
  supportedMediaTypes: [BANNER, VIDEO, NATIVE],
117
12
 
118
- isBidRequestValid: (bid = {}) => {
119
- const { params, bidId, mediaTypes } = bid;
120
- let valid = Boolean(bidId && params && (params.placementId || params.endpointId));
121
-
122
- if (mediaTypes && mediaTypes[BANNER]) {
123
- valid = valid && Boolean(mediaTypes[BANNER] && mediaTypes[BANNER].sizes);
124
- } else if (mediaTypes && mediaTypes[VIDEO]) {
125
- valid = valid && Boolean(mediaTypes[VIDEO] && mediaTypes[VIDEO].playerSize);
126
- } else if (mediaTypes && mediaTypes[NATIVE]) {
127
- valid = valid && Boolean(mediaTypes[NATIVE]);
128
- } else {
129
- valid = false;
130
- }
131
- return valid;
132
- },
133
-
134
- buildRequests: (validBidRequests = [], bidderRequest = {}) => {
135
- // convert Native ORTB definition to old-style prebid native definition
136
- validBidRequests = convertOrtbRequestToProprietaryNative(validBidRequests);
137
-
138
- let deviceWidth = 0;
139
- let deviceHeight = 0;
140
-
141
- let winLocation;
142
- try {
143
- const winTop = window.top;
144
- deviceWidth = winTop.screen.width;
145
- deviceHeight = winTop.screen.height;
146
- winLocation = winTop.location;
147
- } catch (e) {
148
- logMessage(e);
149
- winLocation = window.location;
150
- }
151
-
152
- const refferUrl = bidderRequest.refererInfo && bidderRequest.refererInfo.page;
153
- let refferLocation;
154
- try {
155
- refferLocation = refferUrl && new URL(refferUrl);
156
- } catch (e) {
157
- logMessage(e);
158
- }
159
- // TODO: does the fallback make sense here?
160
- let location = refferLocation || winLocation;
161
- const language = (navigator && navigator.language) ? navigator.language.split('-')[0] : '';
162
- const host = location.host;
163
- const page = location.pathname;
164
- const secure = location.protocol === 'https:' ? 1 : 0;
165
- const placements = [];
166
- const request = {
167
- deviceWidth,
168
- deviceHeight,
169
- language,
170
- secure,
171
- host,
172
- page,
173
- placements,
174
- coppa: config.getConfig('coppa') === true ? 1 : 0,
175
- tmax: bidderRequest.timeout
176
- };
177
-
178
- if (bidderRequest.uspConsent) {
179
- request.ccpa = bidderRequest.uspConsent;
180
- }
181
-
182
- if (bidderRequest.gdprConsent) {
183
- request.gdpr = {
184
- consentString: bidderRequest.gdprConsent.consentString
185
- };
186
- }
187
-
188
- if (bidderRequest.gppConsent) {
189
- request.gpp = bidderRequest.gppConsent.gppString;
190
- request.gpp_sid = bidderRequest.gppConsent.applicableSections;
191
- } else if (bidderRequest.ortb2?.regs?.gpp) {
192
- request.gpp = bidderRequest.ortb2.regs.gpp;
193
- request.gpp_sid = bidderRequest.ortb2.regs.gpp_sid;
194
- }
195
-
196
- const len = validBidRequests.length;
197
- for (let i = 0; i < len; i++) {
198
- const bid = validBidRequests[i];
199
- placements.push(getPlacementReqData(bid));
200
- }
201
-
202
- return {
203
- method: 'POST',
204
- url: AD_URL,
205
- data: request
206
- };
207
- },
208
-
209
- interpretResponse: (serverResponse) => {
210
- let response = [];
211
- for (let i = 0; i < serverResponse.body.length; i++) {
212
- let resItem = serverResponse.body[i];
213
- if (isBidResponseValid(resItem)) {
214
- const advertiserDomains = resItem.adomain && resItem.adomain.length ? resItem.adomain : [];
215
- resItem.meta = { ...resItem.meta, advertiserDomains };
216
-
217
- response.push(resItem);
218
- }
219
- }
220
- return response;
221
- },
222
-
223
- getUserSyncs: (syncOptions, serverResponses, gdprConsent, uspConsent, gppConsent) => {
224
- let syncType = syncOptions.iframeEnabled ? 'iframe' : 'image';
225
- let syncUrl = SYNC_URL + `/${syncType}?pbjs=1`;
226
-
227
- if (gdprConsent && gdprConsent.consentString) {
228
- if (typeof gdprConsent.gdprApplies === 'boolean') {
229
- syncUrl += `&gdpr=${Number(gdprConsent.gdprApplies)}&gdpr_consent=${gdprConsent.consentString}`;
230
- } else {
231
- syncUrl += `&gdpr=0&gdpr_consent=${gdprConsent.consentString}`;
232
- }
233
- }
234
-
235
- if (uspConsent && uspConsent.consentString) {
236
- syncUrl += `&ccpa_consent=${uspConsent.consentString}`;
237
- }
238
-
239
- if (gppConsent?.gppString && gppConsent?.applicableSections?.length) {
240
- syncUrl += '&gpp=' + gppConsent.gppString;
241
- syncUrl += '&gpp_sid=' + gppConsent.applicableSections.join(',');
242
- }
243
-
244
- const coppa = config.getConfig('coppa') ? 1 : 0;
245
- syncUrl += `&coppa=${coppa}`;
246
-
247
- return [{
248
- type: syncType,
249
- url: syncUrl
250
- }];
251
- }
13
+ isBidRequestValid: isBidRequestValid(),
14
+ buildRequests: buildRequests(AD_URL),
15
+ interpretResponse,
16
+ getUserSyncs: getUserSyncs(SYNC_URL)
252
17
  };
253
18
 
254
19
  registerBidder(spec);
@@ -5,7 +5,6 @@ import {config} from '../src/config.js';
5
5
  import {find, includes} from '../src/polyfill.js';
6
6
  import {deepAccess, isArray, isFn, isNumber, isPlainObject} from '../src/utils.js';
7
7
  import {auctionManager} from '../src/auctionManager.js';
8
- import {getGlobal} from '../src/prebidGlobal.js';
9
8
  import {getANKeywordParam} from '../libraries/appnexusUtils/anKeywords.js';
10
9
  import {convertCamelToUnderscore} from '../libraries/appnexusUtils/anUtils.js';
11
10
 
@@ -126,7 +125,7 @@ export const spec = {
126
125
  method: 'POST',
127
126
  options: {withCredentials: true},
128
127
  data: {
129
- v: getGlobal().version,
128
+ v: 'v' + '$prebid.version$',
130
129
  pageUrl: referer,
131
130
  bidId: bidRequest.bidId,
132
131
  // TODO: fix auctionId leak: https://github.com/prebid/Prebid.js/issues/9781