prebid.js 9.46.0 → 9.48.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 (325) hide show
  1. package/.github/codeql/queries/jsonRequestContentType.ql +18 -0
  2. package/AGENTS.md +42 -0
  3. package/CLAUDE.md +1 -0
  4. package/babelConfig.js +1 -1
  5. package/dist/33acrossAnalyticsAdapter.js +1 -1
  6. package/dist/33acrossBidAdapter.js +1 -1
  7. package/dist/33acrossIdSystem.js +1 -1
  8. package/dist/BTBidAdapter.js +1 -1
  9. package/dist/adagioAnalyticsAdapter.js +1 -1
  10. package/dist/adagioBidAdapter.js +1 -1
  11. package/dist/adagioUtils.js +1 -1
  12. package/dist/addefendBidAdapter.js +1 -1
  13. package/dist/adgenerationBidAdapter.js +1 -1
  14. package/dist/adlooxRtdProvider.js +1 -1
  15. package/dist/adqueryBidAdapter.js +1 -1
  16. package/dist/adrelevantisBidAdapter.js +1 -1
  17. package/dist/adstirBidAdapter.js +1 -1
  18. package/dist/adtrgtmeBidAdapter.js +1 -1
  19. package/dist/advangUtils.js +1 -1
  20. package/dist/adverxoBidAdapter.js +1 -1
  21. package/dist/adxcgAnalyticsAdapter.js +1 -1
  22. package/dist/adxcgBidAdapter.js +1 -1
  23. package/dist/adyoulikeBidAdapter.js +1 -1
  24. package/dist/agmaAnalyticsAdapter.js +1 -1
  25. package/dist/ajaBidAdapter.js +1 -1
  26. package/dist/amxBidAdapter.js +1 -1
  27. package/dist/amxIdSystem.js +1 -1
  28. package/dist/aniviewBidAdapter.js +1 -1
  29. package/dist/appierAnalyticsAdapter.js +1 -1
  30. package/dist/appnexusBidAdapter.js +1 -1
  31. package/dist/asoBidAdapter.js +1 -1
  32. package/dist/axonixBidAdapter.js +1 -1
  33. package/dist/beopBidAdapter.js +1 -1
  34. package/dist/bidglassBidAdapter.js +1 -1
  35. package/dist/big-richmediaBidAdapter.js +1 -1
  36. package/dist/bitmediaBidAdapter.js +1 -1
  37. package/dist/blueBidAdapter.js +1 -1
  38. package/dist/blueUtils.js +1 -0
  39. package/dist/bmsBidAdapter.js +1 -1
  40. package/dist/bridBidAdapter.js +1 -1
  41. package/dist/bridgeuppBidAdapter.js +1 -1
  42. package/dist/bridgewellBidAdapter.js +1 -1
  43. package/dist/brightMountainMediaBidAdapter.js +1 -1
  44. package/dist/browsiUtils.js +1 -1
  45. package/dist/carodaBidAdapter.js +1 -1
  46. package/dist/chtnwBidAdapter.js +1 -1
  47. package/dist/chunk-core.js +1 -1
  48. package/dist/concertBidAdapter.js +1 -1
  49. package/dist/connectadBidAdapter.js +1 -1
  50. package/dist/consumableBidAdapter.js +1 -1
  51. package/dist/contxtfulBidAdapter.js +1 -1
  52. package/dist/conversantAnalyticsAdapter.js +1 -1
  53. package/dist/conversantBidAdapter.js +1 -1
  54. package/dist/craftBidAdapter.js +1 -1
  55. package/dist/criteoBidAdapter.js +1 -1
  56. package/dist/cwireBidAdapter.js +1 -1
  57. package/dist/czechAdIdSystem.js +1 -1
  58. package/dist/dailymotionBidAdapter.js +1 -1
  59. package/dist/debugging-standalone.js +1 -1
  60. package/dist/dependencies.json +16 -2
  61. package/dist/dspxBidAdapter.js +1 -1
  62. package/dist/dxkultureBidAdapter.js +1 -1
  63. package/dist/dynamicAdBoostRtdProvider.js +1 -1
  64. package/dist/eplanningBidAdapter.js +1 -1
  65. package/dist/eskimiBidAdapter.js +1 -1
  66. package/dist/euidIdSystem.js +1 -1
  67. package/dist/exadsBidAdapter.js +1 -1
  68. package/dist/excoBidAdapter.js +1 -1
  69. package/dist/feedadBidAdapter.js +1 -1
  70. package/dist/finativeBidAdapter.js +1 -1
  71. package/dist/freewheel-sspBidAdapter.js +1 -1
  72. package/dist/gmosspBidAdapter.js +1 -1
  73. package/dist/gptUtils.js +1 -1
  74. package/dist/greenbidsAnalyticsAdapter.js +1 -1
  75. package/dist/greenbidsBidAdapter.js +1 -1
  76. package/dist/greenbidsRtdProvider.js +1 -1
  77. package/dist/gridBidAdapter.js +1 -1
  78. package/dist/gumgumBidAdapter.js +1 -1
  79. package/dist/h12mediaBidAdapter.js +1 -1
  80. package/dist/hypelabBidAdapter.js +1 -1
  81. package/dist/id5AnalyticsAdapter.js +1 -1
  82. package/dist/id5IdSystem.js +1 -1
  83. package/dist/imdsBidAdapter.js +1 -1
  84. package/dist/improvedigitalBidAdapter.js +1 -1
  85. package/dist/inmobiBidAdapter.js +1 -1
  86. package/dist/insticatorBidAdapter.js +1 -1
  87. package/dist/intentIqAnalyticsAdapter.js +1 -1
  88. package/dist/ixBidAdapter.js +1 -1
  89. package/dist/jixieBidAdapter.js +1 -1
  90. package/dist/justpremiumBidAdapter.js +1 -1
  91. package/dist/kargoBidAdapter.js +1 -1
  92. package/dist/kimberliteBidAdapter.js +1 -1
  93. package/dist/konduitAnalyticsAdapter.js +1 -1
  94. package/dist/kueezBidAdapter.js +1 -1
  95. package/dist/lassoBidAdapter.js +1 -1
  96. package/dist/lifestreetBidAdapter.js +1 -1
  97. package/dist/liveIntentId.js +1 -1
  98. package/dist/logicadBidAdapter.js +1 -1
  99. package/dist/loglyliftBidAdapter.js +1 -1
  100. package/dist/luceadBidAdapter.js +1 -1
  101. package/dist/luponmediaBidAdapter.js +1 -1
  102. package/dist/mabidderBidAdapter.js +1 -1
  103. package/dist/madsenseBidAdapter.js +1 -1
  104. package/dist/magniteAnalyticsAdapter.js +1 -1
  105. package/dist/malltvAnalyticsAdapter.js +1 -1
  106. package/dist/marsmediaBidAdapter.js +1 -1
  107. package/dist/mediafuseBidAdapter.js +1 -1
  108. package/dist/medianetBidAdapter.js +1 -1
  109. package/dist/medianetUtils.js +1 -1
  110. package/dist/mediasquareBidAdapter.js +1 -1
  111. package/dist/mgidBidAdapter.js +1 -1
  112. package/dist/missenaBidAdapter.js +1 -1
  113. package/dist/mobilefuseBidAdapter.js +1 -1
  114. package/dist/nativeryBidAdapter.js +1 -0
  115. package/dist/nextMillenniumBidAdapter.js +1 -1
  116. package/dist/nexx360Utils.js +1 -1
  117. package/dist/nobidAnalyticsAdapter.js +1 -1
  118. package/dist/nobidBidAdapter.js +1 -1
  119. package/dist/nodalsAiRtdProvider.js +1 -1
  120. package/dist/not-for-prod/prebid.js +187 -184
  121. package/dist/oguryBidAdapter.js +1 -1
  122. package/dist/onetagBidAdapter.js +1 -1
  123. package/dist/ooloAnalyticsAdapter.js +1 -1
  124. package/dist/openxBidAdapter.js +1 -1
  125. package/dist/optidigitalBidAdapter.js +1 -1
  126. package/dist/orbidderBidAdapter.js +1 -1
  127. package/dist/outbrainBidAdapter.js +1 -1
  128. package/dist/pinkLionBidAdapter.js +1 -0
  129. package/dist/pixfutureBidAdapter.js +1 -1
  130. package/dist/prebidServerBidAdapter.js +1 -1
  131. package/dist/priceFloors.js +1 -1
  132. package/dist/publinkIdSystem.js +1 -1
  133. package/dist/pubmaticAnalyticsAdapter.js +1 -1
  134. package/dist/pubmaticBidAdapter.js +1 -1
  135. package/dist/pubmaticRtdProvider.js +1 -1
  136. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  137. package/dist/pubxaiAnalyticsAdapter.js +1 -1
  138. package/dist/pubxaiRtdProvider.js +1 -1
  139. package/dist/pxyzBidAdapter.js +1 -1
  140. package/dist/quantcastBidAdapter.js +1 -1
  141. package/dist/readpeakBidAdapter.js +1 -1
  142. package/dist/relaidoBidAdapter.js +1 -1
  143. package/dist/retailspotBidAdapter.js +1 -1
  144. package/dist/rhythmoneBidAdapter.js +1 -1
  145. package/dist/riseUtils.js +1 -1
  146. package/dist/rtbhouseBidAdapter.js +1 -1
  147. package/dist/rubiconBidAdapter.js +1 -1
  148. package/dist/seedingAllianceBidAdapter.js +1 -1
  149. package/dist/seedtagBidAdapter.js +1 -1
  150. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  151. package/dist/sharethroughBidAdapter.js +1 -1
  152. package/dist/showheroes-bsBidAdapter.js +1 -1
  153. package/dist/smaatoBidAdapter.js +1 -1
  154. package/dist/smartadserverBidAdapter.js +1 -1
  155. package/dist/smartxBidAdapter.js +1 -1
  156. package/dist/smilewantedBidAdapter.js +1 -1
  157. package/dist/snigelBidAdapter.js +1 -1
  158. package/dist/sonobiBidAdapter.js +1 -1
  159. package/dist/sovrnBidAdapter.js +1 -1
  160. package/dist/sparteoBidAdapter.js +1 -1
  161. package/dist/sspBCBidAdapter.js +1 -1
  162. package/dist/stroeerCoreBidAdapter.js +1 -1
  163. package/dist/stvBidAdapter.js +1 -1
  164. package/dist/sublimeBidAdapter.js +1 -1
  165. package/dist/taboolaBidAdapter.js +1 -1
  166. package/dist/tappxBidAdapter.js +1 -1
  167. package/dist/targetVideoBidAdapter.js +1 -1
  168. package/dist/teadsBidAdapter.js +1 -1
  169. package/dist/terceptAnalyticsAdapter.js +1 -1
  170. package/dist/themoneytizerBidAdapter.js +1 -1
  171. package/dist/trionBidAdapter.js +1 -1
  172. package/dist/tripleliftBidAdapter.js +1 -1
  173. package/dist/ttdBidAdapter.js +1 -1
  174. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  175. package/dist/uid2IdSystem.js +1 -1
  176. package/dist/underdogmediaBidAdapter.js +1 -1
  177. package/dist/undertoneBidAdapter.js +1 -1
  178. package/dist/unifiedIdSystem.js +1 -1
  179. package/dist/unrulyBidAdapter.js +1 -1
  180. package/dist/userId.js +1 -1
  181. package/dist/vidazooUtils.js +1 -1
  182. package/dist/videobyteBidAdapter.js +1 -1
  183. package/dist/visxBidAdapter.js +1 -1
  184. package/dist/vuukleBidAdapter.js +1 -1
  185. package/dist/weboramaRtdProvider.js +1 -1
  186. package/dist/widespaceBidAdapter.js +1 -1
  187. package/dist/winrBidAdapter.js +1 -1
  188. package/dist/xeUtils.js +1 -1
  189. package/dist/yahooAdsBidAdapter.js +1 -1
  190. package/dist/yandexBidAdapter.js +1 -1
  191. package/dist/yieldmoBidAdapter.js +1 -1
  192. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  193. package/eslint.config.js +1 -3
  194. package/gulpHelpers.js +3 -6
  195. package/gulpfile.js +25 -24
  196. package/karma.conf.maker.js +1 -3
  197. package/libraries/advangUtils/index.js +3 -4
  198. package/libraries/blueUtils/bidderUtils.js +113 -0
  199. package/libraries/browsiUtils/browsiUtils.js +1 -2
  200. package/libraries/gptUtils/gptUtils.js +1 -2
  201. package/libraries/liveIntentId/shared.js +4 -0
  202. package/libraries/xeUtils/bidderUtils.js +3 -4
  203. package/modules/adagioBidAdapter.js +1 -2
  204. package/modules/addefendBidAdapter.md +1 -1
  205. package/modules/adtrgtmeBidAdapter.js +6 -8
  206. package/modules/aduptechBidAdapter.md +1 -1
  207. package/modules/adverxoBidAdapter.js +3 -3
  208. package/modules/blueBidAdapter.js +24 -104
  209. package/modules/bmsBidAdapter.js +25 -105
  210. package/modules/concertBidAdapter.md +1 -1
  211. package/modules/contxtfulBidAdapter.js +56 -10
  212. package/modules/conversantBidAdapter.js +0 -58
  213. package/modules/cwireBidAdapter.js +8 -0
  214. package/modules/czechAdIdSystem.js +13 -3
  215. package/modules/dynamicAdBoostRtdProvider.js +16 -33
  216. package/modules/dynamicAdBoostRtdProvider.md +1 -6
  217. package/modules/ixBidAdapter.js +2 -3
  218. package/modules/luponmediaBidAdapter.js +117 -522
  219. package/modules/luponmediaBidAdapter.md +2 -3
  220. package/modules/mediasquareBidAdapter.js +14 -20
  221. package/modules/microadBidAdapter.js +0 -1
  222. package/modules/nativeryBidAdapter.js +135 -0
  223. package/modules/nativeryBidAdapter.md +95 -0
  224. package/modules/nativoBidAdapter.js +3 -3
  225. package/modules/onetagBidAdapter.js +0 -1
  226. package/modules/pinkLionBidAdapter.js +17 -0
  227. package/modules/pinkLionBidAdapter.md +79 -0
  228. package/modules/prebidServerBidAdapter/ortbConverter.js +1 -1
  229. package/modules/priceFloors.js +2 -2
  230. package/modules/pubmaticBidAdapter.js +4 -1
  231. package/modules/qortexRtdProvider.md +1 -1
  232. package/modules/reconciliationRtdProvider.md +4 -4
  233. package/modules/rtbhouseBidAdapter.js +4 -83
  234. package/modules/rubiconBidAdapter.js +1 -1
  235. package/modules/sspBCBidAdapter.js +1 -1
  236. package/modules/stroeerCoreBidAdapter.js +3 -3
  237. package/modules/stvBidAdapter.js +19 -14
  238. package/modules/topicsFpdModule.md +1 -1
  239. package/modules/unifiedIdSystem.js +8 -1
  240. package/modules/userId/eids.js +15 -0
  241. package/modules/videoModule/index.js +0 -1
  242. package/modules/videoModule/videoImpressionVerifier.js +0 -1
  243. package/modules/yieldlabBidAdapter.js +1 -2
  244. package/modules/yieldmoBidAdapter.js +1 -2
  245. package/package.json +13 -20
  246. package/src/Renderer.js +1 -2
  247. package/src/adapterManager.js +14 -4
  248. package/src/auction.js +2 -3
  249. package/src/config.js +1 -2
  250. package/src/cpmBucketManager.js +1 -2
  251. package/src/secureCreatives.js +2 -3
  252. package/src/targeting.js +1 -2
  253. package/test/fake-server/README.md +3 -3
  254. package/test/helpers/index_adapter_utils.js +2 -2
  255. package/test/helpers/testing-utils.js +1 -1
  256. package/test/spec/auctionmanager_spec.js +2 -3
  257. package/test/spec/fpd/enrichment_spec.js +1 -1
  258. package/test/spec/libraries/greedy/greedyPromise_spec.js +2 -2
  259. package/test/spec/modules/adfBidAdapter_spec.js +1 -1
  260. package/test/spec/modules/adnuntiusBidAdapter_spec.js +25 -9
  261. package/test/spec/modules/adtrgtmeBidAdapter_spec.js +2 -4
  262. package/test/spec/modules/adverxoBidAdapter_spec.js +25 -1
  263. package/test/spec/modules/afpBidAdapter_spec.js +0 -1
  264. package/test/spec/modules/bliinkBidAdapter_spec.js +15 -7
  265. package/test/spec/modules/contxtfulBidAdapter_spec.js +606 -82
  266. package/test/spec/modules/conversantBidAdapter_spec.js +1 -139
  267. package/test/spec/modules/cwireBidAdapter_spec.js +2 -2
  268. package/test/spec/modules/czechAdIdSystem_spec.js +4 -4
  269. package/test/spec/modules/displayioBidAdapter_spec.js +1 -1
  270. package/test/spec/modules/dynamicAdBoostRtdProvider_spec.js +0 -42
  271. package/test/spec/modules/enrichmentLiftMeasurement_spec.js +8 -8
  272. package/test/spec/modules/hypelabBidAdapter_spec.js +17 -11
  273. package/test/spec/modules/iasRtdProvider_spec.js +2 -2
  274. package/test/spec/modules/id5IdSystem_spec.js +1 -1
  275. package/test/spec/modules/idxIdSystem_spec.js +1 -2
  276. package/test/spec/modules/intentIqAnalyticsAdapter_spec.js +25 -25
  277. package/test/spec/modules/intentIqIdSystem_spec.js +32 -32
  278. package/test/spec/modules/kargoBidAdapter_spec.js +11 -5
  279. package/test/spec/modules/liveIntentIdSystem_spec.js +14 -0
  280. package/test/spec/modules/lmpIdSystem_spec.js +1 -2
  281. package/test/spec/modules/lockrAIMIdSystem_spec.js +2 -2
  282. package/test/spec/modules/luceadBidAdapter_spec.js +1 -1
  283. package/test/spec/modules/luponmediaBidAdapter_spec.js +186 -324
  284. package/test/spec/modules/mediaeyesBidAdapter_spec.js +1 -1
  285. package/test/spec/modules/mediakeysBidAdapter_spec.js +1 -2
  286. package/test/spec/modules/mediasquareBidAdapter_spec.js +13 -2
  287. package/test/spec/modules/missenaBidAdapter_spec.js +1 -1
  288. package/test/spec/modules/nativeryBidAdapter_spec.js +195 -0
  289. package/test/spec/modules/nexx360BidAdapter_spec.js +6 -6
  290. package/test/spec/modules/oguryBidAdapter_spec.js +2 -2
  291. package/test/spec/modules/omsBidAdapter_spec.js +1 -1
  292. package/test/spec/modules/onetagBidAdapter_spec.js +1 -2
  293. package/test/spec/modules/onomagicBidAdapter_spec.js +2 -2
  294. package/test/spec/modules/overtoneRtdProvider_spec.mjs +1 -1
  295. package/test/spec/modules/permutiveIdentityManagerIdSystem_spec.js +17 -14
  296. package/test/spec/modules/pinkLionBidAdapter_spec.js +480 -0
  297. package/test/spec/modules/prebidServerBidAdapter_spec.js +2 -2
  298. package/test/spec/modules/previousAuctionInfo_spec.js +2 -2
  299. package/test/spec/modules/pubmaticAnalyticsAdapter_spec.js +1 -1
  300. package/test/spec/modules/pubmaticBidAdapter_spec.js +19 -1
  301. package/test/spec/modules/pubmaticRtdProvider_spec.js +16 -17
  302. package/test/spec/modules/pubwiseAnalyticsAdapter_spec.js +2 -2
  303. package/test/spec/modules/rtbhouseBidAdapter_spec.js +0 -182
  304. package/test/spec/modules/rubiconBidAdapter_spec.js +3 -4
  305. package/test/spec/modules/sizeMappingV2_spec.js +1 -1
  306. package/test/spec/modules/sizeMapping_spec.js +2 -3
  307. package/test/spec/modules/stroeerCoreBidAdapter_spec.js +36 -26
  308. package/test/spec/modules/stvBidAdapter_spec.js +108 -40
  309. package/test/spec/modules/topLevelPaapi_spec.js +1 -1
  310. package/test/spec/modules/tpmnBidAdapter_spec.js +1 -1
  311. package/test/spec/modules/ttdBidAdapter_spec.js +1 -1
  312. package/test/spec/modules/unifiedIdSystem_spec.js +20 -0
  313. package/test/spec/modules/userId_spec.js +1 -1
  314. package/test/spec/modules/vibrantmediaBidAdapter_spec.js +1 -1
  315. package/test/spec/modules/videoModule/submodules/videojsVideoProvider_spec.js +1 -1
  316. package/test/spec/modules/yieldmoBidAdapter_spec.js +2 -2
  317. package/test/spec/modules/zeotapIdPlusIdSystem_spec.js +1 -2
  318. package/test/spec/unit/core/adapterManager_spec.js +29 -17
  319. package/test/spec/unit/core/targeting_spec.js +1 -1
  320. package/test/spec/unit/pbjs_api_spec.js +4 -5
  321. package/test/spec/utils_spec.js +20 -12
  322. package/test/test_deps.js +1 -1
  323. package/nightwatch.browserstack.json +0 -46
  324. package/nightwatch.conf.js +0 -36
  325. package/nightwatch.json +0 -40
@@ -1,572 +1,167 @@
1
- import {
2
- _each,
3
- deepAccess,
4
- deepSetValue,
5
- generateUUID,
6
- isArray,
7
- isEmpty,
8
- isFn,
9
- isPlainObject,
10
- logError,
11
- logMessage,
12
- logWarn,
13
- parseSizesInput,
14
- sizeTupleToRtbSize,
15
- sizesToSizeTuples
16
- } from '../src/utils.js';
1
+ import {logError, logMessage, logWarn, deepSetValue} from '../src/utils.js';
17
2
  import {registerBidder} from '../src/adapters/bidderFactory.js';
18
- import {config} from '../src/config.js';
19
3
  import {BANNER} from '../src/mediaTypes.js';
4
+ import {ortbConverter} from '../libraries/ortbConverter/converter.js';
5
+ import {config} from '../src/config.js';
20
6
 
21
7
  const BIDDER_CODE = 'luponmedia';
22
- const ENDPOINT_URL = 'https://rtb.adxpremium.services/openrtb2/auction';
23
-
24
- const DIGITRUST_PROP_NAMES = {
25
- PREBID_SERVER: {
26
- id: 'id',
27
- keyv: 'keyv'
28
- }
29
- };
30
-
31
- var sizeMap = {
32
- 1: '468x60',
33
- 2: '728x90',
34
- 5: '120x90',
35
- 7: '125x125',
36
- 8: '120x600',
37
- 9: '160x600',
38
- 10: '300x600',
39
- 13: '200x200',
40
- 14: '250x250',
41
- 15: '300x250',
42
- 16: '336x280',
43
- 17: '240x400',
44
- 19: '300x100',
45
- 31: '980x120',
46
- 32: '250x360',
47
- 33: '180x500',
48
- 35: '980x150',
49
- 37: '468x400',
50
- 38: '930x180',
51
- 39: '750x100',
52
- 40: '750x200',
53
- 41: '750x300',
54
- 42: '2x4',
55
- 43: '320x50',
56
- 44: '300x50',
57
- 48: '300x300',
58
- 53: '1024x768',
59
- 54: '300x1050',
60
- 55: '970x90',
61
- 57: '970x250',
62
- 58: '1000x90',
63
- 59: '320x80',
64
- 60: '320x150',
65
- 61: '1000x1000',
66
- 64: '580x500',
67
- 65: '640x480',
68
- 66: '930x600',
69
- 67: '320x480',
70
- 68: '1800x1000',
71
- 72: '320x320',
72
- 73: '320x160',
73
- 78: '980x240',
74
- 79: '980x300',
75
- 80: '980x400',
76
- 83: '480x300',
77
- 85: '300x120',
78
- 90: '548x150',
79
- 94: '970x310',
80
- 95: '970x100',
81
- 96: '970x210',
82
- 101: '480x320',
83
- 102: '768x1024',
84
- 103: '480x280',
85
- 105: '250x800',
86
- 108: '320x240',
87
- 113: '1000x300',
88
- 117: '320x100',
89
- 125: '800x250',
90
- 126: '200x600',
91
- 144: '980x600',
92
- 145: '980x150',
93
- 152: '1000x250',
94
- 156: '640x320',
95
- 159: '320x250',
96
- 179: '250x600',
97
- 195: '600x300',
98
- 198: '640x360',
99
- 199: '640x200',
100
- 213: '1030x590',
101
- 214: '980x360',
102
- 221: '1x1',
103
- 229: '320x180',
104
- 230: '2000x1400',
105
- 232: '580x400',
106
- 234: '6x6',
107
- 251: '2x2',
108
- 256: '480x820',
109
- 257: '400x600',
110
- 258: '500x200',
111
- 259: '998x200',
112
- 264: '970x1000',
113
- 265: '1920x1080',
114
- 274: '1800x200',
115
- 278: '320x500',
116
- 282: '320x400',
117
- 288: '640x380',
118
- 548: '500x1000',
119
- 550: '980x480',
120
- 552: '300x200',
121
- 558: '640x640'
122
- };
123
-
124
- _each(sizeMap, (item, key) => sizeMap[item] = key);
125
-
126
- export const spec = {
127
- code: BIDDER_CODE,
128
- supportedMediaTypes: [BANNER],
129
- isBidRequestValid: function (bid) {
130
- return !!(bid.params && bid.params.siteId && bid.params.keyId); // TODO: check for siteId and keyId
131
- },
132
- buildRequests: function (bidRequests, bidderRequest) {
133
- const bRequest = {
134
- method: 'POST',
135
- url: ENDPOINT_URL,
136
- data: null,
137
- options: {},
138
- bidderRequest
139
- };
140
-
141
- let currentImps = [];
142
-
143
- for (let i = 0, len = bidRequests.length; i < len; i++) {
144
- let newReq = newOrtbBidRequest(bidRequests[i], bidderRequest, currentImps);
145
- currentImps = newReq.imp;
146
- bRequest.data = JSON.stringify(newReq);
147
- }
8
+ const keyIdRegex = /^uid(?:@[\w-]+)?_.*$/;
148
9
 
149
- return bRequest;
150
- },
151
- interpretResponse: (response, request) => {
152
- const bidResponses = [];
153
- var respCur = 'USD';
154
- let parsedRequest = JSON.parse(request.data);
155
- let parsedReferrer = parsedRequest.site && parsedRequest.site.ref ? parsedRequest.site.ref : '';
156
- try {
157
- if (response.body && response.body.seatbid && isArray(response.body.seatbid)) {
158
- // Supporting multiple bid responses for same adSize
159
- respCur = response.body.cur || respCur;
160
- response.body.seatbid.forEach(seatbidder => {
161
- seatbidder.bid &&
162
- isArray(seatbidder.bid) &&
163
- seatbidder.bid.forEach(bid => {
164
- let newBid = {
165
- requestId: bid.impid,
166
- cpm: (parseFloat(bid.price) || 0).toFixed(2),
167
- width: bid.w,
168
- height: bid.h,
169
- creativeId: bid.crid || bid.id,
170
- dealId: bid.dealid,
171
- currency: respCur,
172
- netRevenue: false,
173
- ttl: 300,
174
- referrer: parsedReferrer,
175
- ad: bid.adm,
176
- adomain: bid.adomain || [],
177
- meta: {
178
- advertiserDomains: bid && bid.adomain ? bid.adomain : []
179
- }
180
- };
181
-
182
- bidResponses.push(newBid);
183
- });
184
- });
185
- }
186
- } catch (error) {
187
- logError(error);
188
- }
189
- return bidResponses;
190
- },
191
- getUserSyncs: function (syncOptions, responses, gdprConsent, uspConsent) {
192
- let allUserSyncs = [];
193
- if (!hasSynced && (syncOptions.iframeEnabled || syncOptions.pixelEnabled)) {
194
- responses.forEach(csResp => {
195
- if (csResp.body && csResp.body.ext && csResp.body.ext.usersyncs) {
196
- try {
197
- let response = csResp.body.ext.usersyncs;
198
- let bidders = response.bidder_status;
199
- for (let synci in bidders) {
200
- let thisSync = bidders[synci];
201
- if (thisSync.no_cookie) {
202
- let url = thisSync.usersync.url;
203
- let type = thisSync.usersync.type;
204
-
205
- if (!url) {
206
- logError(`No sync url for bidder luponmedia.`);
207
- } else if ((type === 'image' || type === 'redirect') && syncOptions.pixelEnabled) {
208
- logMessage(`Invoking image pixel user sync for luponmedia`);
209
- allUserSyncs.push({type: 'image', url: url});
210
- } else if (type == 'iframe' && syncOptions.iframeEnabled) {
211
- logMessage(`Invoking iframe user sync for luponmedia`);
212
- allUserSyncs.push({type: 'iframe', url: url});
213
- } else {
214
- logError(`User sync type "${type}" not supported for luponmedia`);
215
- }
216
- }
217
- }
218
- } catch (e) {
219
- logError(e);
220
- }
221
- }
222
- });
223
- } else {
224
- logWarn('Luponmedia: Please enable iframe/pixel based user sync.');
225
- }
10
+ const buildServerUrl = (keyId) => {
11
+ const match = String(keyId).match(/@([^_]+)_/);
12
+ let host = 'rtb';
226
13
 
227
- hasSynced = true;
228
- return allUserSyncs;
14
+ if (match) {
15
+ host = match[1];
229
16
  }
230
- };
231
17
 
232
- export function hasValidSupplyChainParams(schain) {
233
- let isValid = false;
234
- const requiredFields = ['asi', 'sid', 'hp'];
235
- if (!schain.nodes) return isValid;
236
- isValid = schain.nodes.reduce((status, node) => {
237
- if (!status) return status;
238
- return requiredFields.every(field => node[field]);
239
- }, true);
240
- if (!isValid) logError('LuponMedia: required schain params missing');
241
- return isValid;
18
+ return `https://${host}.adxpremium.services/openrtb2/auction`
242
19
  }
243
20
 
244
- var hasSynced = false;
21
+ function hasRtd() {
22
+ const rtdConfigs = config.getConfig('realTimeData.dataProviders') || [];
245
23
 
246
- export function resetUserSync() {
247
- hasSynced = false;
24
+ return Boolean(rtdConfigs.find(provider => provider.name === 'dynamicAdBoost'));
248
25
  }
249
26
 
250
- export function masSizeOrdering(sizes) {
251
- const MAS_SIZE_PRIORITY = [15, 2, 9];
252
-
253
- return sizes.sort((first, second) => {
254
- // sort by MAS_SIZE_PRIORITY priority order
255
- const firstPriority = MAS_SIZE_PRIORITY.indexOf(first);
256
- const secondPriority = MAS_SIZE_PRIORITY.indexOf(second);
257
-
258
- if (firstPriority > -1 || secondPriority > -1) {
259
- if (firstPriority === -1) {
260
- return 1;
261
- }
262
- if (secondPriority === -1) {
263
- return -1;
264
- }
265
- return firstPriority - secondPriority;
266
- }
267
-
268
- // and finally ascending order
269
- return first - second;
270
- });
271
- }
272
-
273
- function newOrtbBidRequest(bidRequest, bidderRequest, currentImps) {
274
- bidRequest.startTime = new Date().getTime();
275
-
276
- const bannerParams = deepAccess(bidRequest, 'mediaTypes.banner');
277
-
278
- let bannerSizes = [];
279
-
280
- if (bannerParams && bannerParams.sizes) {
281
- // get banner sizes in form [{ w: <int>, h: <int> }, ...]
282
- const format = sizesToSizeTuples(bannerParams.sizes).map(sizeTupleToRtbSize);
283
- bannerSizes = format;
284
- }
285
-
286
- const data = {
287
- id: bidderRequest.bidderRequestId,
288
- test: config.getConfig('debug') ? 1 : 0,
289
- source: {
290
- tid: bidderRequest.ortb2?.source?.tid,
291
- },
292
- tmax: bidderRequest.timeout,
293
- imp: currentImps.concat([{
294
- id: bidRequest.bidId,
295
- secure: 1,
296
- ext: {
297
- [bidRequest.bidder]: bidRequest.params
298
- },
299
- banner: {
300
- format: bannerSizes
301
- }
302
- }]),
303
- ext: {
304
- prebid: {
305
- targeting: {
306
- includewinners: true,
307
- // includebidderkeys always false for openrtb
308
- includebidderkeys: false
309
- }
310
- }
311
- },
312
- user: {
313
- }
314
- };
315
-
316
- let bidFloor;
317
- if (isFn(bidRequest.getFloor) && !config.getConfig('disableFloors')) {
318
- let floorInfo;
319
- try {
320
- floorInfo = bidRequest.getFloor({
321
- currency: 'USD',
322
- mediaType: 'video',
323
- size: parseSizes(bidRequest, 'video')
324
- });
325
- } catch (e) {
326
- logError('LuponMedia: getFloor threw an error: ', e);
327
- }
328
- bidFloor = isPlainObject(floorInfo) && floorInfo.currency === 'USD' && !isNaN(parseInt(floorInfo.floor)) ? parseFloat(floorInfo.floor) : undefined;
329
- } else {
330
- bidFloor = parseFloat(deepAccess(bidRequest, 'params.floor'));
331
- }
332
- if (!isNaN(bidFloor)) {
333
- data.imp[0].bidfloor = bidFloor;
334
- }
27
+ export const converter = ortbConverter({
28
+ context: {
29
+ netRevenue: false,
30
+ ttl: 300,
31
+ mediaType: BANNER,
32
+ },
33
+ imp(buildImp, bidRequest, context) {
34
+ const imp = buildImp(bidRequest, context);
335
35
 
336
- appendSiteAppDevice(data, bidRequest, bidderRequest);
36
+ imp.ext = imp.ext || {};
337
37
 
338
- const digiTrust = _getDigiTrustQueryParams(bidRequest, 'PREBID_SERVER');
339
- if (digiTrust) {
340
- deepSetValue(data, 'user.ext.digitrust', digiTrust);
341
- }
38
+ const hasRtdEnabled = hasRtd();
342
39
 
343
- if (bidderRequest.gdprConsent) {
344
- // note - gdprApplies & consentString may be undefined in certain use-cases for consentManagement module
345
- let gdprApplies;
346
- if (typeof bidderRequest.gdprConsent.gdprApplies === 'boolean') {
347
- gdprApplies = bidderRequest.gdprConsent.gdprApplies ? 1 : 0;
40
+ if (!hasRtdEnabled) {
41
+ logWarn('LuponMedia: Enable the DynamicAdBoost RTD Module to optimize revenue and performance.')
348
42
  }
349
43
 
350
- deepSetValue(data, 'regs.ext.gdpr', gdprApplies);
351
- deepSetValue(data, 'user.ext.consent', bidderRequest.gdprConsent.consentString);
352
- }
353
-
354
- if (bidderRequest.uspConsent) {
355
- deepSetValue(data, 'regs.ext.us_privacy', bidderRequest.uspConsent);
356
- }
357
-
358
- // Set user uuid
359
- deepSetValue(data, 'user.id', generateUUID());
44
+ imp.ext.luponmedia = imp.ext.luponmedia || {};
45
+ imp.ext.luponmedia.placement_id = bidRequest.adUnitCode;
46
+ imp.ext.luponmedia.keyId = bidRequest.params.keyId;
47
+ imp.ext.luponmedia.siteId = bidRequest.params.siteId;
48
+ imp.ext.luponmedia.rtd = hasRtdEnabled;
360
49
 
361
- // set crumbs
362
- if (bidRequest.crumbs && bidRequest.crumbs.pubcid) {
363
- deepSetValue(data, 'user.buyeruid', bidRequest.crumbs.pubcid);
364
- } else {
365
- deepSetValue(data, 'user.buyeruid', generateUUID());
366
- }
50
+ return imp;
51
+ },
52
+ bidResponse(buildBidResponse, bid, context) {
53
+ const bidResponse = buildBidResponse(bid, context);
367
54
 
368
- if (bidRequest.userId && typeof bidRequest.userId === 'object' &&
369
- (bidRequest.userId.tdid || bidRequest.userId.pubcid || bidRequest.userId.lipb || bidRequest.userId.idl_env)) {
370
- deepSetValue(data, 'user.ext.eids', []);
371
-
372
- if (bidRequest.userId.tdid) {
373
- data.user.ext.eids.push({
374
- source: 'adserver.org',
375
- uids: [{
376
- id: bidRequest.userId.tdid,
377
- ext: {
378
- rtiPartner: 'TDID'
379
- }
380
- }]
381
- });
55
+ if (!bidResponse.creativeId) {
56
+ bidResponse.creativeId = bid.crid || bid.id;
382
57
  }
383
58
 
384
- if (bidRequest.userId.pubcid) {
385
- data.user.ext.eids.push({
386
- source: 'pubcommon',
387
- uids: [{
388
- id: bidRequest.userId.pubcid,
389
- }]
390
- });
59
+ if (!bidResponse.dealId && bid.dealid) {
60
+ bidResponse.dealId = bid.dealid;
391
61
  }
392
62
 
393
- // support liveintent ID
394
- if (bidRequest.userId.lipb && bidRequest.userId.lipb.lipbid) {
395
- data.user.ext.eids.push({
396
- source: 'liveintent.com',
397
- uids: [{
398
- id: bidRequest.userId.lipb.lipbid
399
- }]
400
- });
401
-
402
- data.user.ext.tpid = {
403
- source: 'liveintent.com',
404
- uid: bidRequest.userId.lipb.lipbid
405
- };
406
-
407
- if (Array.isArray(bidRequest.userId.lipb.segments) && bidRequest.userId.lipb.segments.length) {
408
- deepSetValue(data, 'rp.target.LIseg', bidRequest.userId.lipb.segments);
409
- }
63
+ if (context.bidRequest?.ortb2?.site?.ref) {
64
+ bidResponse.referrer = context.bidRequest.ortb2.site.ref;
410
65
  }
411
66
 
412
- // support identityLink (aka LiveRamp)
413
- if (bidRequest.userId.idl_env) {
414
- data.user.ext.eids.push({
415
- source: 'liveramp.com',
416
- uids: [{
417
- id: bidRequest.userId.idl_env
418
- }]
419
- });
420
- }
421
- }
422
-
423
- if (config.getConfig('coppa') === true) {
424
- deepSetValue(data, 'regs.coppa', 1);
425
- }
67
+ return bidResponse;
68
+ },
69
+ });
70
+ export const spec = {
71
+ code: BIDDER_CODE,
72
+ supportedMediaTypes: [BANNER],
73
+ isBidRequestValid: function (bid) {
74
+ return keyIdRegex.test(bid?.params?.keyId);
75
+ },
76
+ buildRequests: function (bidRequests, bidderRequest) {
77
+ const data = converter.toORTB({ bidderRequest, bidRequests });
426
78
 
427
- if (bidRequest.schain && hasValidSupplyChainParams(bidRequest.schain)) {
428
- deepSetValue(data, 'source.ext.schain', bidRequest.schain);
429
- }
79
+ if (bidderRequest.gdprConsent) {
80
+ let gdprApplies;
430
81
 
431
- // TODO: getConfig('fpd.context') should not have worked even with legacy FPD support - 'fpd' gets translated
432
- // into 'ortb2' by `setConfig`
433
- // Unclear what the intent was here - maybe `const {context: siteData, user: userData} = getLegacyFpd(config.getConfig('ortb2'))` ?
434
- // (with PB7 `config.getConfig('ortb2')` should be replaced by `bidderRequest.ortb2`)
435
- const siteData = Object.assign({}, bidRequest.params.inventory, config.getConfig('fpd.context'));
436
- const userData = Object.assign({}, bidRequest.params.visitor, config.getConfig('fpd.user'));
437
-
438
- if (!isEmpty(siteData) || !isEmpty(userData)) {
439
- const bidderData = {
440
- bidders: [ bidderRequest.bidderCode ],
441
- config: {
442
- fpd: {}
82
+ if (typeof bidderRequest.gdprConsent.gdprApplies === 'boolean') {
83
+ gdprApplies = bidderRequest.gdprConsent.gdprApplies ? 1 : 0;
443
84
  }
444
- };
445
85
 
446
- if (!isEmpty(siteData)) {
447
- bidderData.config.fpd.site = siteData;
86
+ deepSetValue(data, 'regs.ext.gdpr', gdprApplies);
87
+ deepSetValue(data, 'user.ext.consent', bidderRequest.gdprConsent.consentString);
448
88
  }
449
89
 
450
- if (!isEmpty(userData)) {
451
- bidderData.config.fpd.user = userData;
90
+ if (bidderRequest.uspConsent) {
91
+ deepSetValue(data, 'regs.ext.us_privacy', bidderRequest.uspConsent);
452
92
  }
453
93
 
454
- deepSetValue(data, 'ext.prebid.bidderconfig.0', bidderData);
455
- }
456
-
457
- const pbAdSlot = deepAccess(bidRequest, 'ortb2Imp.ext.data.pbadslot');
458
- if (typeof pbAdSlot === 'string' && pbAdSlot) {
459
- deepSetValue(data.imp[0].ext, 'context.data.adslot', pbAdSlot);
460
- }
94
+ const serverUrl = buildServerUrl(bidRequests[0].params.keyId);
461
95
 
462
- return data;
463
- }
464
-
465
- function _getDigiTrustQueryParams(bidRequest = {}, endpointName) {
466
- if (!endpointName || !DIGITRUST_PROP_NAMES[endpointName]) {
467
- return null;
468
- }
469
- const propNames = DIGITRUST_PROP_NAMES[endpointName];
96
+ return {
97
+ method: 'POST',
98
+ url: serverUrl,
99
+ data,
100
+ };
101
+ },
102
+ interpretResponse: (response, request) => {
103
+ return converter.fromORTB({response: response.body, request: request.data}).bids;
104
+ },
105
+ getUserSyncs: function (syncOptions, responses) {
106
+ let allUserSyncs = [];
470
107
 
471
- function getDigiTrustId() {
472
- const bidRequestDigitrust = deepAccess(bidRequest, 'userId.digitrustid.data');
473
- if (bidRequestDigitrust) {
474
- return bidRequestDigitrust;
108
+ if (hasSynced) {
109
+ return allUserSyncs;
475
110
  }
476
111
 
477
- let digiTrustUser = (window.DigiTrust && (config.getConfig('digiTrustId') || window.DigiTrust.getUser({member: 'T9QSFKPDN9'})));
478
- return (digiTrustUser && digiTrustUser.success && digiTrustUser.identity) || null;
479
- }
480
-
481
- let digiTrustId = getDigiTrustId();
482
- // Verify there is an ID and this user has not opted out
483
- if (!digiTrustId || (digiTrustId.privacy && digiTrustId.privacy.optout)) {
484
- return null;
485
- }
112
+ if (!syncOptions.iframeEnabled && !syncOptions.pixelEnabled) {
113
+ logWarn('Luponmedia: Please enable iframe/pixel based user sync.');
114
+ hasSynced = true;
115
+ return allUserSyncs;
116
+ }
486
117
 
487
- const digiTrustQueryParams = {
488
- [propNames.id]: digiTrustId.id,
489
- [propNames.keyv]: digiTrustId.keyv
490
- };
491
- if (propNames.pref) {
492
- digiTrustQueryParams[propNames.pref] = 0;
493
- }
494
- return digiTrustQueryParams;
495
- }
118
+ responses.forEach(csResp => {
119
+ if (!csResp?.body?.ext?.usersyncs) {
120
+ return;
121
+ }
496
122
 
497
- function _getPageUrl(bidRequest, bidderRequest) {
498
- // TODO: do the fallbacks make sense here?
499
- let pageUrl = bidderRequest.refererInfo.page;
500
- if (bidRequest.params.referrer) {
501
- pageUrl = bidRequest.params.referrer;
502
- } else if (!pageUrl) {
503
- pageUrl = bidderRequest.refererInfo.topmostLocation;
504
- }
505
- return bidRequest.params.secure ? pageUrl.replace(/^http:/i, 'https:') : pageUrl;
506
- }
123
+ try {
124
+ const response = csResp.body.ext.usersyncs;
125
+ const bidders = response.bidder_status;
507
126
 
508
- function appendSiteAppDevice(data, bidRequest, bidderRequest) {
509
- if (!data) return;
127
+ for (let synci in bidders) {
128
+ const thisSync = bidders[synci];
510
129
 
511
- // ORTB specifies app OR site
512
- if (typeof config.getConfig('app') === 'object') {
513
- data.app = config.getConfig('app');
514
- } else {
515
- data.site = {
516
- page: _getPageUrl(bidRequest, bidderRequest)
517
- }
518
- }
519
- if (typeof config.getConfig('device') === 'object') {
520
- data.device = config.getConfig('device');
521
- }
522
- }
130
+ if (!thisSync.no_cookie) {
131
+ continue;
132
+ }
523
133
 
524
- /**
525
- * @param sizes
526
- * @returns {*}
527
- */
528
- function mapSizes(sizes) {
529
- return parseSizesInput(sizes)
530
- // map sizes while excluding non-matches
531
- .reduce((result, size) => {
532
- let mappedSize = parseInt(sizeMap[size], 10);
533
- if (mappedSize) {
534
- result.push(mappedSize);
134
+ const url = thisSync.usersync.url;
135
+ const type = thisSync.usersync.type;
136
+
137
+ if (!url) {
138
+ logError(`No sync url for bidder luponmedia.`);
139
+ } else if ((type === 'image' || type === 'redirect') && syncOptions.pixelEnabled) {
140
+ logMessage(`Invoking image pixel user sync for luponmedia`);
141
+ allUserSyncs.push({ type: 'image', url: url });
142
+ } else if (type === 'iframe' && syncOptions.iframeEnabled) {
143
+ logMessage(`Invoking iframe user sync for luponmedia`);
144
+ allUserSyncs.push({ type: 'iframe', url: url });
145
+ } else {
146
+ logError(`User sync type "${type}" not supported for luponmedia`);
147
+ }
148
+ }
149
+ } catch (e) {
150
+ logError(e);
535
151
  }
536
- return result;
537
- }, []);
538
- }
152
+ });
539
153
 
540
- function parseSizes(bid, mediaType) {
541
- let params = bid.params;
542
- if (mediaType === 'video') {
543
- let size = [];
544
- if (params.video && params.video.playerWidth && params.video.playerHeight) {
545
- size = [
546
- params.video.playerWidth,
547
- params.video.playerHeight
548
- ];
549
- } else if (Array.isArray(deepAccess(bid, 'mediaTypes.video.playerSize')) && bid.mediaTypes.video.playerSize.length === 1) {
550
- size = bid.mediaTypes.video.playerSize[0];
551
- } else if (Array.isArray(bid.sizes) && bid.sizes.length > 0 && Array.isArray(bid.sizes[0]) && bid.sizes[0].length > 1) {
552
- size = bid.sizes[0];
553
- }
554
- return size;
555
- }
154
+ hasSynced = true;
556
155
 
557
- // Deprecated: temp legacy support
558
- let sizes = [];
559
- if (Array.isArray(params.sizes)) {
560
- sizes = params.sizes;
561
- } else if (typeof deepAccess(bid, 'mediaTypes.banner.sizes') !== 'undefined') {
562
- sizes = mapSizes(bid.mediaTypes.banner.sizes);
563
- } else if (Array.isArray(bid.sizes) && bid.sizes.length > 0) {
564
- sizes = mapSizes(bid.sizes);
565
- } else {
566
- logWarn('LuponMedia: no sizes are setup or found');
567
- }
156
+ return allUserSyncs;
157
+ },
158
+ };
568
159
 
569
- return masSizeOrdering(sizes);
160
+ let hasSynced = false;
161
+
162
+ // we need this for tests
163
+ export function resetUserSync() {
164
+ hasSynced = false;
570
165
  }
571
166
 
572
167
  registerBidder(spec);