prebid.js 9.7.0 → 9.9.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 (255) hide show
  1. package/.github/codeql/codeql-config.yml +3 -0
  2. package/.github/codeql/queries/deviceMemory.ql +14 -0
  3. package/.github/codeql/queries/hardwareConcurrency.ql +14 -0
  4. package/.github/codeql/queries/prebid.qll +36 -0
  5. package/.github/codeql/queries/qlpack.yml +8 -0
  6. package/.github/workflows/jscpd.yml +1 -1
  7. package/dist/33acrossAnalyticsAdapter.js +1 -1
  8. package/dist/33acrossBidAdapter.js +1 -1
  9. package/dist/33acrossIdSystem.js +1 -1
  10. package/dist/BTBidAdapter.js +1 -1
  11. package/dist/adagioAnalyticsAdapter.js +1 -1
  12. package/dist/adagioBidAdapter.js +1 -1
  13. package/dist/adagioUtils.js +1 -1
  14. package/dist/addefendBidAdapter.js +1 -1
  15. package/dist/adgenerationBidAdapter.js +1 -1
  16. package/dist/adlooxRtdProvider.js +1 -1
  17. package/dist/admixerBidAdapter.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/asoBidAdapter.js +1 -1
  32. package/dist/axonixBidAdapter.js +1 -1
  33. package/dist/bidglassBidAdapter.js +1 -1
  34. package/dist/big-richmediaBidAdapter.js +1 -1
  35. package/dist/bridBidAdapter.js +1 -1
  36. package/dist/bridgewellBidAdapter.js +1 -1
  37. package/dist/brightMountainMediaBidAdapter.js +1 -1
  38. package/dist/carodaBidAdapter.js +1 -1
  39. package/dist/ccxBidAdapter.js +1 -1
  40. package/dist/chtnwBidAdapter.js +1 -1
  41. package/dist/chunk-core.js +1 -1
  42. package/dist/concertBidAdapter.js +1 -1
  43. package/dist/connectadBidAdapter.js +1 -1
  44. package/dist/consumableBidAdapter.js +1 -1
  45. package/dist/contxtfulRtdProvider.js +1 -1
  46. package/dist/conversantAnalyticsAdapter.js +1 -1
  47. package/dist/conversantBidAdapter.js +1 -1
  48. package/dist/craftBidAdapter.js +1 -1
  49. package/dist/criteoBidAdapter.js +1 -1
  50. package/dist/cwireBidAdapter.js +1 -1
  51. package/dist/dailymotionBidAdapter.js +1 -1
  52. package/dist/dependencies.json +19 -4
  53. package/dist/discoveryBidAdapter.js +1 -1
  54. package/dist/docereeAdManagerBidAdapter.js +1 -1
  55. package/dist/dspxBidAdapter.js +1 -1
  56. package/dist/dxkultureBidAdapter.js +1 -1
  57. package/dist/eclickadsBidAdapter.js +1 -0
  58. package/dist/eightPodAnalyticsAdapter.js +1 -1
  59. package/dist/eplanningBidAdapter.js +1 -1
  60. package/dist/euidIdSystem.js +1 -1
  61. package/dist/exadsBidAdapter.js +1 -1
  62. package/dist/feedadBidAdapter.js +1 -1
  63. package/dist/finativeBidAdapter.js +1 -1
  64. package/dist/freewheel-sspBidAdapter.js +1 -1
  65. package/dist/gmosspBidAdapter.js +1 -1
  66. package/dist/goldbachBidAdapter.js +1 -1
  67. package/dist/greenbidsAnalyticsAdapter.js +1 -1
  68. package/dist/greenbidsRtdProvider.js +1 -1
  69. package/dist/gridBidAdapter.js +1 -1
  70. package/dist/gumgumBidAdapter.js +1 -1
  71. package/dist/h12mediaBidAdapter.js +1 -1
  72. package/dist/hypelabBidAdapter.js +1 -1
  73. package/dist/id5AnalyticsAdapter.js +1 -1
  74. package/dist/id5IdSystem.js +1 -1
  75. package/dist/imdsBidAdapter.js +1 -1
  76. package/dist/improvedigitalBidAdapter.js +1 -1
  77. package/dist/insticatorBidAdapter.js +1 -1
  78. package/dist/intentIqAnalyticsAdapter.js +1 -1
  79. package/dist/ixBidAdapter.js +1 -1
  80. package/dist/jixieBidAdapter.js +1 -1
  81. package/dist/justpremiumBidAdapter.js +1 -1
  82. package/dist/kargoBidAdapter.js +1 -1
  83. package/dist/kimberliteBidAdapter.js +1 -1
  84. package/dist/konduitAnalyticsAdapter.js +1 -1
  85. package/dist/kueezBidAdapter.js +1 -1
  86. package/dist/lassoBidAdapter.js +1 -1
  87. package/dist/lifestreetBidAdapter.js +1 -1
  88. package/dist/limelightDigitalBidAdapter.js +1 -1
  89. package/dist/liveIntentIdSystem.js +1 -1
  90. package/dist/logicadBidAdapter.js +1 -1
  91. package/dist/loglyliftBidAdapter.js +1 -1
  92. package/dist/luceadBidAdapter.js +1 -1
  93. package/dist/mabidderBidAdapter.js +1 -1
  94. package/dist/magniteAnalyticsAdapter.js +1 -1
  95. package/dist/malltvAnalyticsAdapter.js +1 -1
  96. package/dist/marsmediaBidAdapter.js +1 -1
  97. package/dist/mediafuseBidAdapter.js +1 -1
  98. package/dist/mediagoBidAdapter.js +1 -1
  99. package/dist/medianetAnalyticsAdapter.js +1 -1
  100. package/dist/medianetBidAdapter.js +1 -1
  101. package/dist/mediasquareBidAdapter.js +1 -1
  102. package/dist/mgidBidAdapter.js +1 -1
  103. package/dist/mgidUtils.js +1 -0
  104. package/dist/mgidXBidAdapter.js +1 -1
  105. package/dist/missenaBidAdapter.js +1 -1
  106. package/dist/mobianRtdProvider.js +1 -1
  107. package/dist/naveggIdSystem.js +1 -1
  108. package/dist/navigatorData.js +1 -0
  109. package/dist/nexx360BidAdapter.js +1 -1
  110. package/dist/nobidAnalyticsAdapter.js +1 -1
  111. package/dist/nobidBidAdapter.js +1 -1
  112. package/dist/not-for-prod/prebid.js +174 -169
  113. package/dist/oguryBidAdapter.js +1 -1
  114. package/dist/omsBidAdapter.js +1 -1
  115. package/dist/onetagBidAdapter.js +1 -1
  116. package/dist/ooloAnalyticsAdapter.js +1 -1
  117. package/dist/openxBidAdapter.js +1 -1
  118. package/dist/optidigitalBidAdapter.js +1 -1
  119. package/dist/orbidderBidAdapter.js +1 -1
  120. package/dist/outbrainBidAdapter.js +1 -1
  121. package/dist/pixfutureBidAdapter.js +1 -1
  122. package/dist/pstudioBidAdapter.js +1 -1
  123. package/dist/publinkIdSystem.js +1 -1
  124. package/dist/pubmaticAnalyticsAdapter.js +1 -1
  125. package/dist/pubmaticBidAdapter.js +1 -1
  126. package/dist/pubriseBidAdapter.js +1 -0
  127. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  128. package/dist/pubxaiAnalyticsAdapter.js +1 -1
  129. package/dist/pubxaiRtdProvider.js +1 -1
  130. package/dist/pxyzBidAdapter.js +1 -1
  131. package/dist/quantcastBidAdapter.js +1 -1
  132. package/dist/readpeakBidAdapter.js +1 -1
  133. package/dist/redtramBidAdapter.js +1 -1
  134. package/dist/relaidoBidAdapter.js +1 -1
  135. package/dist/retailspotBidAdapter.js +1 -1
  136. package/dist/rhythmoneBidAdapter.js +1 -1
  137. package/dist/richaudienceBidAdapter.js +1 -1
  138. package/dist/riseUtils.js +1 -1
  139. package/dist/rubiconBidAdapter.js +1 -1
  140. package/dist/seedingAllianceBidAdapter.js +1 -1
  141. package/dist/seedtagBidAdapter.js +1 -1
  142. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  143. package/dist/sharethroughBidAdapter.js +1 -1
  144. package/dist/smaatoBidAdapter.js +1 -1
  145. package/dist/smartadserverBidAdapter.js +1 -1
  146. package/dist/smarthubBidAdapter.js +1 -1
  147. package/dist/smartxBidAdapter.js +1 -1
  148. package/dist/smilewantedBidAdapter.js +1 -1
  149. package/dist/snigelBidAdapter.js +1 -1
  150. package/dist/sonobiBidAdapter.js +1 -1
  151. package/dist/sovrnBidAdapter.js +1 -1
  152. package/dist/sspBCBidAdapter.js +1 -1
  153. package/dist/stvBidAdapter.js +1 -1
  154. package/dist/sublimeBidAdapter.js +1 -1
  155. package/dist/taboolaBidAdapter.js +1 -1
  156. package/dist/tappxBidAdapter.js +1 -1
  157. package/dist/targetVideoAdServerVideo.js +1 -0
  158. package/dist/targetVideoBidAdapter.js +1 -1
  159. package/dist/teadsBidAdapter.js +1 -1
  160. package/dist/teqblazeUtils.js +1 -1
  161. package/dist/terceptAnalyticsAdapter.js +1 -1
  162. package/dist/themoneytizerBidAdapter.js +1 -1
  163. package/dist/trionBidAdapter.js +1 -1
  164. package/dist/tripleliftBidAdapter.js +1 -1
  165. package/dist/ttdBidAdapter.js +1 -1
  166. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  167. package/dist/uid2IdSystem.js +1 -1
  168. package/dist/underdogmediaBidAdapter.js +1 -1
  169. package/dist/undertoneBidAdapter.js +1 -1
  170. package/dist/unrulyBidAdapter.js +1 -1
  171. package/dist/userId.js +1 -1
  172. package/dist/vidazooUtils.js +1 -1
  173. package/dist/videobyteBidAdapter.js +1 -1
  174. package/dist/visxBidAdapter.js +1 -1
  175. package/dist/vuukleBidAdapter.js +1 -1
  176. package/dist/widespaceBidAdapter.js +1 -1
  177. package/dist/winrBidAdapter.js +1 -1
  178. package/dist/yahooAdsBidAdapter.js +1 -1
  179. package/dist/yieldmoBidAdapter.js +1 -1
  180. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  181. package/libraries/mgidUtils/mgidUtils.js +73 -0
  182. package/{src/fpd/navigator.js → libraries/navigatorData/navigatorData.js} +1 -1
  183. package/libraries/riseUtils/index.js +1 -1
  184. package/libraries/teqblazeUtils/bidderUtils.js +1 -1
  185. package/modules/admixerBidAdapter.js +12 -5
  186. package/modules/appnexusBidAdapter.js +1 -1
  187. package/modules/ccxBidAdapter.js +6 -2
  188. package/modules/contxtfulRtdProvider.js +15 -12
  189. package/modules/cwireBidAdapter.js +13 -9
  190. package/modules/cwireBidAdapter.md +29 -10
  191. package/modules/dailymotionBidAdapter.js +1 -1
  192. package/modules/dailymotionBidAdapter.md +11 -7
  193. package/modules/discoveryBidAdapter.js +1 -3
  194. package/modules/docereeAdManagerBidAdapter.js +14 -8
  195. package/modules/eclickadsBidAdapter.js +80 -0
  196. package/modules/eclickadsBidAdapter.md +55 -0
  197. package/modules/eightPodAnalyticsAdapter.js +13 -1
  198. package/modules/gumgumBidAdapter.js +6 -2
  199. package/modules/ixBidAdapter.js +0 -1
  200. package/modules/limelightDigitalBidAdapter.js +1 -1
  201. package/modules/mediagoBidAdapter.js +2 -4
  202. package/modules/mgidBidAdapter.js +30 -109
  203. package/modules/mgidXBidAdapter.js +2 -66
  204. package/modules/mobianRtdProvider.js +12 -8
  205. package/modules/naveggIdSystem.js +62 -58
  206. package/modules/naveggIdSystem.md +8 -0
  207. package/modules/oguryBidAdapter.js +5 -2
  208. package/modules/omsBidAdapter.js +1 -1
  209. package/modules/openxBidAdapter.js +1 -6
  210. package/modules/pstudioBidAdapter.js +5 -8
  211. package/modules/pstudioBidAdapter.md +6 -4
  212. package/modules/pubriseBidAdapter.js +19 -0
  213. package/modules/pubriseBidAdapter.md +79 -0
  214. package/modules/pubxaiAnalyticsAdapter.js +9 -4
  215. package/modules/pubxaiRtdProvider.js +38 -18
  216. package/modules/pubxaiRtdProvider.md +2 -2
  217. package/modules/redtramBidAdapter.js +2 -6
  218. package/modules/richaudienceBidAdapter.js +8 -1
  219. package/modules/rubiconBidAdapter.js +3 -3
  220. package/modules/smarthubBidAdapter.js +2 -0
  221. package/modules/targetVideoAdServerVideo.js +96 -0
  222. package/modules/targetVideoAdServerVideo.md +26 -0
  223. package/modules/teadsBidAdapter.js +4 -3
  224. package/modules/undertoneBidAdapter.js +1 -19
  225. package/modules/userId/index.js +1 -1
  226. package/package.json +1 -1
  227. package/src/adRendering.js +3 -0
  228. package/src/adapterManager.js +4 -0
  229. package/src/utils/focusTimeout.js +17 -6
  230. package/src/utils/ttlCollection.js +1 -1
  231. package/src/utils.js +28 -0
  232. package/test/spec/modules/admixerBidAdapter_spec.js +2 -2
  233. package/test/spec/modules/ccxBidAdapter_spec.js +81 -0
  234. package/test/spec/modules/contxtfulRtdProvider_spec.js +19 -19
  235. package/test/spec/modules/dailymotionBidAdapter_spec.js +12 -12
  236. package/test/spec/modules/discoveryBidAdapter_spec.js +1 -47
  237. package/test/spec/modules/docereeAdManagerBidAdapter_spec.js +87 -9
  238. package/test/spec/modules/eclickadsBidAdapter_spec.js +214 -0
  239. package/test/spec/modules/ixBidAdapter_spec.js +8 -1
  240. package/test/spec/modules/mobianRtdProvider_spec.js +32 -15
  241. package/test/spec/modules/naveggIdSystem_spec.js +141 -31
  242. package/test/spec/modules/oguryBidAdapter_spec.js +50 -4
  243. package/test/spec/modules/openxBidAdapter_spec.js +16 -49
  244. package/test/spec/modules/pstudioBidAdapter_spec.js +5 -5
  245. package/test/spec/modules/pubriseBidAdapter_spec.js +514 -0
  246. package/test/spec/modules/pubxaiAnalyticsAdapter_spec.js +9 -4
  247. package/test/spec/modules/pubxaiRtdProvider_spec.js +37 -5
  248. package/test/spec/modules/richaudienceBidAdapter_spec.js +62 -0
  249. package/test/spec/modules/rubiconBidAdapter_spec.js +10 -0
  250. package/test/spec/modules/targetVideoAdServerVideo_spec.js +179 -0
  251. package/test/spec/modules/trafficgateBidAdapter_spec.js +1 -1
  252. package/test/spec/ortbConverter/userId_spec.js +23 -2
  253. package/test/spec/unit/adRendering_spec.js +27 -1
  254. package/test/spec/unit/core/adapterManager_spec.js +10 -0
  255. package/test/spec/unit/utils/focusTimeout_spec.js +33 -6
@@ -116,11 +116,11 @@ describe('dailymotionBidAdapterTests', () => {
116
116
  title: 'test video',
117
117
  url: 'https://test.com/test',
118
118
  topics: 'topic_1, topic_2',
119
- xid: 'x123456',
120
119
  livestream: 1,
121
120
  isCreatedForKids: true,
122
121
  videoViewsInSession: 2,
123
122
  autoplay: true,
123
+ playerName: 'dailymotion',
124
124
  playerVolume: 8,
125
125
  },
126
126
  },
@@ -204,7 +204,6 @@ describe('dailymotionBidAdapterTests', () => {
204
204
  title: bidRequestData[0].params.video.title,
205
205
  url: bidRequestData[0].params.video.url,
206
206
  topics: bidRequestData[0].params.video.topics,
207
- xid: bidRequestData[0].params.video.xid,
208
207
  duration: bidRequestData[0].params.video.duration,
209
208
  livestream: !!bidRequestData[0].params.video.livestream,
210
209
  isCreatedForKids: bidRequestData[0].params.video.isCreatedForKids,
@@ -212,6 +211,7 @@ describe('dailymotionBidAdapterTests', () => {
212
211
  siteOrAppCat: [],
213
212
  videoViewsInSession: bidRequestData[0].params.video.videoViewsInSession,
214
213
  autoplay: bidRequestData[0].params.video.autoplay,
214
+ playerName: bidRequestData[0].params.video.playerName,
215
215
  playerVolume: bidRequestData[0].params.video.playerVolume,
216
216
  },
217
217
  });
@@ -254,11 +254,11 @@ describe('dailymotionBidAdapterTests', () => {
254
254
  title: 'test video',
255
255
  url: 'https://test.com/test',
256
256
  topics: 'topic_1, topic_2',
257
- xid: 'x123456',
258
257
  livestream: 1,
259
258
  isCreatedForKids: true,
260
259
  videoViewsInSession: 2,
261
260
  autoplay: true,
261
+ playerName: 'dailymotion',
262
262
  playerVolume: 8,
263
263
  },
264
264
  },
@@ -344,11 +344,11 @@ describe('dailymotionBidAdapterTests', () => {
344
344
  title: 'test video',
345
345
  url: 'https://test.com/test',
346
346
  topics: 'topic_1, topic_2',
347
- xid: 'x123456',
348
347
  livestream: 1,
349
348
  isCreatedForKids: true,
350
349
  videoViewsInSession: 2,
351
350
  autoplay: true,
351
+ playerName: 'dailymotion',
352
352
  playerVolume: 8,
353
353
  },
354
354
  },
@@ -431,11 +431,11 @@ describe('dailymotionBidAdapterTests', () => {
431
431
  title: 'test video',
432
432
  url: 'https://test.com/test',
433
433
  topics: 'topic_1, topic_2',
434
- xid: 'x123456',
435
434
  livestream: 1,
436
435
  isCreatedForKids: true,
437
436
  videoViewsInSession: 2,
438
437
  autoplay: true,
438
+ playerName: 'dailymotion',
439
439
  playerVolume: 8,
440
440
  },
441
441
  },
@@ -537,11 +537,11 @@ describe('dailymotionBidAdapterTests', () => {
537
537
  title: 'test video',
538
538
  url: 'https://test.com/test',
539
539
  topics: 'topic_1, topic_2',
540
- xid: 'x123456',
541
540
  livestream: 1,
542
541
  isCreatedForKids: true,
543
542
  videoViewsInSession: 2,
544
543
  autoplay: true,
544
+ playerName: 'dailymotion',
545
545
  playerVolume: 8,
546
546
  },
547
547
  },
@@ -645,11 +645,11 @@ describe('dailymotionBidAdapterTests', () => {
645
645
  title: 'test video',
646
646
  url: 'https://test.com/test',
647
647
  topics: 'topic_1, topic_2',
648
- xid: 'x123456',
649
648
  livestream: 1,
650
649
  isCreatedForKids: true,
651
650
  videoViewsInSession: 2,
652
651
  autoplay: true,
652
+ playerName: 'dailymotion',
653
653
  playerVolume: 8,
654
654
  },
655
655
  },
@@ -745,12 +745,12 @@ describe('dailymotionBidAdapterTests', () => {
745
745
  title: 'test video',
746
746
  url: 'https://test.com/test',
747
747
  topics: 'topic_1, topic_2',
748
- xid: 'x123456',
749
748
  livestream: 1,
750
749
  // Test invalid values
751
750
  isCreatedForKids: 'false',
752
751
  videoViewsInSession: -1,
753
752
  autoplay: 'true',
753
+ playerName: 'dailymotion',
754
754
  playerVolume: 12,
755
755
  },
756
756
  },
@@ -855,7 +855,6 @@ describe('dailymotionBidAdapterTests', () => {
855
855
  title: bidRequestData[0].params.video.title,
856
856
  url: bidRequestData[0].params.video.url,
857
857
  topics: bidRequestData[0].params.video.topics,
858
- xid: bidRequestData[0].params.video.xid,
859
858
  // Overriden through bidder params
860
859
  duration: bidderRequestData.ortb2.app.content.len,
861
860
  livestream: !!bidRequestData[0].params.video.livestream,
@@ -864,6 +863,7 @@ describe('dailymotionBidAdapterTests', () => {
864
863
  siteOrAppCat: [],
865
864
  videoViewsInSession: null,
866
865
  autoplay: null,
866
+ playerName: 'dailymotion',
867
867
  playerVolume: null,
868
868
  },
869
869
  });
@@ -889,10 +889,10 @@ describe('dailymotionBidAdapterTests', () => {
889
889
  private: false,
890
890
  title: 'test video',
891
891
  topics: 'topic_1, topic_2',
892
- xid: 'x123456',
893
892
  isCreatedForKids: false,
894
893
  videoViewsInSession: 10,
895
894
  autoplay: false,
895
+ playerName: 'dailymotion',
896
896
  playerVolume: 0,
897
897
  },
898
898
  },
@@ -1035,7 +1035,6 @@ describe('dailymotionBidAdapterTests', () => {
1035
1035
  title: bidderRequestData.ortb2.site.content.title,
1036
1036
  url: bidderRequestData.ortb2.site.content.url,
1037
1037
  topics: bidRequestData[0].params.video.topics,
1038
- xid: bidRequestData[0].params.video.xid,
1039
1038
  duration: bidRequestData[0].params.video.duration,
1040
1039
  livestream: !!bidderRequestData.ortb2.site.content.livestream,
1041
1040
  isCreatedForKids: bidRequestData[0].params.video.isCreatedForKids,
@@ -1043,6 +1042,7 @@ describe('dailymotionBidAdapterTests', () => {
1043
1042
  siteOrAppCat: bidderRequestData.ortb2.site.content.cat,
1044
1043
  videoViewsInSession: bidRequestData[0].params.video.videoViewsInSession,
1045
1044
  autoplay: bidRequestData[0].params.video.autoplay,
1045
+ playerName: bidRequestData[0].params.video.playerName,
1046
1046
  playerVolume: bidRequestData[0].params.video.playerVolume,
1047
1047
  },
1048
1048
  });
@@ -1127,13 +1127,13 @@ describe('dailymotionBidAdapterTests', () => {
1127
1127
  title: '',
1128
1128
  url: '',
1129
1129
  topics: '',
1130
- xid: '',
1131
1130
  livestream: false,
1132
1131
  isCreatedForKids: null,
1133
1132
  context: {
1134
1133
  siteOrAppCat: [],
1135
1134
  videoViewsInSession: null,
1136
1135
  autoplay: null,
1136
+ playerName: '',
1137
1137
  playerVolume: null,
1138
1138
  },
1139
1139
  });
@@ -10,7 +10,7 @@ import {
10
10
  } from 'modules/discoveryBidAdapter.js';
11
11
  import { getPageTitle, getPageDescription, getPageKeywords, getConnectionDownLink } from '../../../libraries/fpdUtils/pageInfo.js';
12
12
  import * as utils from 'src/utils.js';
13
- import { getHLen, getHC, getDM } from '../../../src/fpd/navigator.js';
13
+ import {getHLen} from '../../../libraries/navigatorData/navigatorData.js';
14
14
 
15
15
  describe('discovery:BidAdapterTests', function () {
16
16
  let sandbox;
@@ -660,51 +660,5 @@ describe('discovery Bid Adapter Tests', function () {
660
660
  expect(result).be.undefined;
661
661
  });
662
662
  });
663
-
664
- describe('getHC', () => {
665
- it('should return the correct value of hardwareConcurrency when accessible', () => {
666
- const mockWindow = {
667
- top: {
668
- navigator: {
669
- hardwareConcurrency: 4
670
- }
671
- }
672
- };
673
- const result = getHC(mockWindow);
674
- expect(result).to.equal(4);
675
- });
676
- it('should return undefined when accessing win.top.navigator.hardwareConcurrency throws an error', () => {
677
- const mockWindow = {
678
- get top() {
679
- throw new Error('Access denied');
680
- }
681
- };
682
- const result = getHC(mockWindow);
683
- expect(result).be.undefined;
684
- });
685
- });
686
-
687
- describe('getDM', () => {
688
- it('should return the correct value of deviceMemory when accessible', () => {
689
- const mockWindow = {
690
- top: {
691
- navigator: {
692
- deviceMemory: 4
693
- }
694
- }
695
- };
696
- const result = getDM(mockWindow);
697
- expect(result).to.equal(4);
698
- });
699
- it('should return undefined when accessing win.top.navigator.deviceMemory throws an error', () => {
700
- const mockWindow = {
701
- get top() {
702
- throw new Error('Access denied');
703
- }
704
- };
705
- const result = getDM(mockWindow);
706
- expect(result).be.undefined;
707
- });
708
- });
709
663
  });
710
664
  });
@@ -1,5 +1,5 @@
1
1
  import { expect } from 'chai';
2
- import { spec } from '../../../modules/docereeAdManagerBidAdapter.js';
2
+ import { spec, getPayload } from '../../../modules/docereeAdManagerBidAdapter.js';
3
3
  import { config } from '../../../src/config.js';
4
4
 
5
5
  describe('docereeadmanager', function () {
@@ -7,25 +7,25 @@ describe('docereeadmanager', function () {
7
7
  docereeadmanager: {
8
8
  user: {
9
9
  data: {
10
+ userId: '',
10
11
  email: '',
11
12
  firstname: '',
12
13
  lastname: '',
13
- mobile: '',
14
14
  specialization: '',
15
- organization: '',
16
15
  hcpid: '',
17
- dob: '',
18
16
  gender: '',
19
17
  city: '',
20
18
  state: '',
21
- country: '',
19
+ zipcode: '',
20
+ hashedNPI: '',
22
21
  hashedhcpid: '',
23
22
  hashedemail: '',
24
23
  hashedmobile: '',
25
- userid: '',
26
- zipcode: '',
27
- userconsent: '',
28
- platformUid: ''
24
+ country: '',
25
+ organization: '',
26
+ dob: '',
27
+ platformUid: '',
28
+ mobile: '',
29
29
  },
30
30
  },
31
31
  },
@@ -35,6 +35,7 @@ describe('docereeadmanager', function () {
35
35
  bidder: 'docereeadmanager',
36
36
  params: {
37
37
  placementId: 'DOC-19-1',
38
+ publisherUrl: 'xxxxxx.com/xxxx',
38
39
  gdpr: '1',
39
40
  gdprconsent:
40
41
  'CPQfU1jPQfU1jG0AAAENAwCAAAAAAAAAAAAAAAAAAAAA.IGLtV_T9fb2vj-_Z99_tkeYwf95y3p-wzhheMs-8NyZeH_B4Wv2MyvBX4JiQKGRgksjLBAQdtHGlcTQgBwIlViTLMYk2MjzNKJrJEilsbO2dYGD9Pn8HT3ZCY70-vv__7v3ff_3g',
@@ -123,4 +124,81 @@ describe('docereeadmanager', function () {
123
124
  .empty;
124
125
  });
125
126
  });
127
+
128
+ describe('payload', function() {
129
+ it('should return payload with the correct data', function() {
130
+ const data = {
131
+ userId: 'xxxxx',
132
+ email: 'xxxx@mail.com',
133
+ firstname: 'Xxxxx',
134
+ lastname: 'Xxxxxx',
135
+ specialization: 'Xxxxxxxxx',
136
+ hcpid: 'xxxxxxx',
137
+ gender: 'Xxxx',
138
+ city: 'Xxxxx',
139
+ state: 'Xxxxxx',
140
+ zipcode: 'XXXXXX',
141
+ hashedNPI: 'xxxxxx',
142
+ hashedhcpid: 'xxxxxxx',
143
+ hashedemail: 'xxxxxxx',
144
+ hashedmobile: 'xxxxxxx',
145
+ country: 'Xxxxxx',
146
+ organization: 'Xxxxxx',
147
+ dob: 'xx-xx-xxxx',
148
+ platformUid: 'Xx.xxx.xxxxxx',
149
+ mobile: 'XXXXXXXXXX',
150
+ }
151
+ bid = {...bid, params: {...bid.params, placementId: 'DOC-19-1'}}
152
+ const payload = getPayload(bid, data);
153
+ const payloadData = payload.data;
154
+ expect(payloadData).to.have.all.keys(
155
+ 'userid',
156
+ 'email',
157
+ 'firstname',
158
+ 'lastname',
159
+ 'specialization',
160
+ 'hcpid',
161
+ 'gender',
162
+ 'city',
163
+ 'state',
164
+ 'zipcode',
165
+ 'hashedNPI',
166
+ 'pb',
167
+ 'adunit',
168
+ 'requestId',
169
+ 'hashedhcpid',
170
+ 'hashedemail',
171
+ 'hashedmobile',
172
+ 'country',
173
+ 'organization',
174
+ 'dob',
175
+ 'userconsent',
176
+ 'mobile',
177
+ 'pageurl'
178
+ );
179
+ expect(payloadData.userid).to.equal('Xx.xxx.xxxxxx');
180
+ expect(payloadData.email).to.equal('xxxx@mail.com');
181
+ expect(payloadData.firstname).to.equal('Xxxxx');
182
+ expect(payloadData.lastname).to.equal('Xxxxxx');
183
+ expect(payloadData.specialization).to.equal('Xxxxxxxxx');
184
+ expect(payloadData.hcpid).to.equal('xxxxxxx');
185
+ expect(payloadData.gender).to.equal('Xxxx');
186
+ expect(payloadData.city).to.equal('Xxxxx');
187
+ expect(payloadData.state).to.equal('Xxxxxx');
188
+ expect(payloadData.zipcode).to.equal('XXXXXX');
189
+ expect(payloadData.hashedNPI).to.equal('xxxxxx');
190
+ expect(payloadData.pb).to.equal(1);
191
+ expect(payloadData.userconsent).to.equal(1);
192
+ expect(payloadData.dob).to.equal('xx-xx-xxxx');
193
+ expect(payloadData.organization).to.equal('Xxxxxx');
194
+ expect(payloadData.country).to.equal('Xxxxxx');
195
+ expect(payloadData.hashedmobile).to.equal('xxxxxxx');
196
+ expect(payloadData.hashedemail).to.equal('xxxxxxx');
197
+ expect(payloadData.hashedhcpid).to.equal('xxxxxxx');
198
+ expect(payloadData.requestId).to.equal('testing');
199
+ expect(payloadData.mobile).to.equal('XXXXXXXXXX');
200
+ expect(payloadData.adunit).to.equal('DOC-19-1');
201
+ expect(payloadData.pageurl).to.equal('xxxxxx.com/xxxx');
202
+ })
203
+ })
126
204
  });
@@ -0,0 +1,214 @@
1
+ import { expect } from 'chai';
2
+ import {
3
+ spec,
4
+ ENDPOINT,
5
+ BIDDER_CODE,
6
+ } from '../../../modules/eclickadsBidAdapter.js';
7
+ import { NATIVE, BANNER, VIDEO } from '../../../src/mediaTypes.js';
8
+ import { deepClone } from '../../../src/utils.js';
9
+ import { config } from '../../../src/config.js';
10
+
11
+ describe('eclickadsBidAdapter', () => {
12
+ const bidItem = {
13
+ bidder: BIDDER_CODE,
14
+ params: {
15
+ zid: '7096',
16
+ },
17
+ };
18
+ const eclickadsBidderConfigData = {
19
+ orig_aid: 'xqf7zdmg7the65ac.1718271138.des',
20
+ fosp_aid: '1013000403',
21
+ fosp_uid: '7aab24a4663258a2c1d76a08b20f7e6e',
22
+ id: '84b2a41c4299bb9b8924423e',
23
+ myvne_id: '1013000403',
24
+ };
25
+ const bidRequest = {
26
+ code: 'test-div',
27
+ size: [[320, 85]],
28
+ mediaTypes: {
29
+ [NATIVE]: {
30
+ title: {
31
+ required: true,
32
+ },
33
+ body: {
34
+ required: true,
35
+ },
36
+ image: {
37
+ required: true,
38
+ },
39
+ sponsoredBy: {
40
+ required: true,
41
+ },
42
+ icon: {
43
+ required: false,
44
+ },
45
+ },
46
+ },
47
+ ortb2: {
48
+ device: {
49
+ w: 980,
50
+ h: 1720,
51
+ dnt: 0,
52
+ ua: 'Mozilla/5.0 (iPhone; CPU iPhone OS 17_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/125.0.6422.80 Mobile/15E148 Safari/604.1',
53
+ language: 'en',
54
+ devicetype: 1,
55
+ make: 'Apple',
56
+ model: 'iPhone 12 Pro Max',
57
+ os: 'iOS',
58
+ osv: '17.4',
59
+ },
60
+ site: {
61
+ name: 'example',
62
+ domain: 'page.example.com',
63
+ page: 'https://page.example.com/here.html',
64
+ ref: 'https://ref.example.com',
65
+ ext: {
66
+ data: eclickadsBidderConfigData,
67
+ },
68
+ },
69
+ },
70
+ };
71
+
72
+ describe('isBidRequestValid', () => {
73
+ it('should return false when atleast one of required params is missing', () => {
74
+ const bid = deepClone(bidItem);
75
+ delete bid.params.zid;
76
+ expect(spec.isBidRequestValid(bid)).to.be.false;
77
+ });
78
+ it('should return true if there is correct required params and mediatype', () => {
79
+ bidItem.params.mediaTypes == NATIVE;
80
+ expect(spec.isBidRequestValid(bidItem)).to.be.true;
81
+ });
82
+ it('should return true if there is no size', () => {
83
+ const bid = deepClone(bidItem);
84
+ delete bid.params.size;
85
+ expect(spec.isBidRequestValid(bid)).to.be.true;
86
+ });
87
+ });
88
+
89
+ describe('buildRequests', () => {
90
+ const bidList = [bidItem];
91
+ const request = config.runWithBidder(BIDDER_CODE, () =>
92
+ spec.buildRequests(bidList, bidRequest)
93
+ );
94
+ const _data = request.data;
95
+
96
+ it('should be create a request to server with POST method, data, valid url', () => {
97
+ expect(request).to.be.exist;
98
+ expect(_data).to.be.exist;
99
+ expect(request.method).to.be.exist;
100
+ expect(request.method).equal('POST');
101
+ expect(request.url).to.be.exist;
102
+ expect(request.url).equal(ENDPOINT + eclickadsBidderConfigData.fosp_uid);
103
+ });
104
+ it('should return valid data format if bid array is valid', () => {
105
+ expect(_data).to.be.an('object');
106
+ expect(_data).to.has.all.keys(
107
+ 'deviceWidth',
108
+ 'deviceHeight',
109
+ 'language',
110
+ 'host',
111
+ 'ua',
112
+ 'page',
113
+ 'imp',
114
+ 'device',
115
+ 'myvne_id',
116
+ 'orig_aid',
117
+ 'fosp_aid',
118
+ 'fosp_uid',
119
+ 'id'
120
+ );
121
+ expect(_data.deviceWidth).to.be.an('number');
122
+ expect(_data.deviceHeight).to.be.an('number');
123
+ expect(_data.device).to.be.an('string');
124
+ expect(_data.language).to.be.an('string');
125
+ expect(_data.host).to.be.an('string').that.is.equal('page.example.com');
126
+ expect(_data.page)
127
+ .to.be.an('string')
128
+ .that.is.equal('https://page.example.com/here.html');
129
+ expect(_data.imp).to.be.an('array');
130
+ expect(_data.myvne_id).to.be.an('string');
131
+ expect(_data.orig_aid).to.be.an('string');
132
+ expect(_data.fosp_aid).to.be.an('string');
133
+ expect(_data.myvne_id).to.be.an('string');
134
+ expect(_data.fosp_uid).to.be.an('string');
135
+ expect(_data.id).to.be.an('string');
136
+ });
137
+
138
+ it('should return empty array if there is no bidItem passed', () => {
139
+ const request = config.runWithBidder(BIDDER_CODE, () =>
140
+ spec.buildRequests([], bidRequest)
141
+ );
142
+ const _data = request.data;
143
+ expect(_data.imp).to.be.an('array').that.is.empty;
144
+ });
145
+
146
+ it('should return the number of imp equal to the number of bidItem', () => {
147
+ expect(_data.imp).to.have.lengthOf(bidList.length);
148
+ });
149
+
150
+ it('have to contain required params and correct format for sending to EClickAds', () => {
151
+ const item = _data.imp[0];
152
+ expect(item.zid).to.be.an('string');
153
+ });
154
+ });
155
+
156
+ describe('interpretResponse', () => {
157
+ const expectedResponse = {
158
+ id: '84b2a41c4299bb9b8924423e',
159
+ seat: '35809',
160
+ seatbid: [
161
+ {
162
+ id: 'DBCCDFD5-AACC-424E-8225-4160D35CBE5D',
163
+ impid: '35ea1073c745d6c',
164
+ adUnitCode: '8871826dc92e',
165
+ requestId: '1122839202z3v',
166
+ creativeId: '112233ss921v',
167
+ netRevenue: true,
168
+ currency: ['VND'],
169
+ cpm: 0.1844,
170
+ ad: 'eclickads_ad_p',
171
+ },
172
+ ],
173
+ };
174
+
175
+ const response = spec.interpretResponse({ body: expectedResponse });
176
+
177
+ it('should return an array of offers', () => {
178
+ expect(response).to.be.an('array');
179
+ });
180
+
181
+ it('should return empty array if there is no offer from server response', () => {
182
+ const emptyOfferResponse = deepClone(expectedResponse);
183
+ emptyOfferResponse.seatbid = [];
184
+ const response = spec.interpretResponse({ body: emptyOfferResponse });
185
+ expect(response).to.be.an('array').that.is.empty;
186
+ });
187
+
188
+ it('should return empty array if seatbid from server response is null or missing', () => {
189
+ const nullOfferResponse = deepClone(expectedResponse);
190
+ nullOfferResponse.seatbid = null;
191
+ const response = spec.interpretResponse({ body: nullOfferResponse });
192
+ expect(response).to.be.an('array').that.is.empty;
193
+ });
194
+
195
+ it('should return empty array if server response is get error - empty', () => {
196
+ const response = spec.interpretResponse({ body: undefined });
197
+ expect(response).to.be.an('array').that.is.empty;
198
+ });
199
+
200
+ it('should return correct format, params for each of offers from server response', () => {
201
+ const offer = response[0];
202
+ expect(offer.id).to.be.an('string').that.is.not.empty;
203
+ expect(offer.impid).to.be.an('string').that.is.not.empty;
204
+ expect(offer.requestId).to.be.an('string').that.is.not.empty;
205
+ expect(offer.creativeId).to.be.an('string').that.is.not.empty;
206
+ expect(offer.netRevenue).to.be.an('boolean');
207
+ expect(offer.ttl).to.be.an('number');
208
+ expect(offer.cpm).to.be.an('number').greaterThan(0);
209
+ expect(offer.adserverTargeting).to.be.an('object');
210
+ expect(offer.adserverTargeting['hb_ad_eclickads']).to.be.an('string').that
211
+ .is.not.empty;
212
+ });
213
+ });
214
+ });
@@ -856,7 +856,8 @@ describe('IndexexchangeAdapter', function () {
856
856
  source: 'identityinc.com',
857
857
  uids: [
858
858
  {
859
- id: 'identityid'
859
+ id: 'identityid',
860
+ atype: 1
860
861
  }
861
862
  ]
862
863
  }
@@ -1383,8 +1384,14 @@ describe('IndexexchangeAdapter', function () {
1383
1384
 
1384
1385
  it('identity data in impression should have correct format and value (single identity partner)', function () {
1385
1386
  const impression = payload.user.eids;
1387
+ expect(impression).to.be.an('array');
1388
+ expect(impression).to.have.lengthOf(1);
1386
1389
  expect(impression[0].source).to.equal(testCopy.IdentityIp.data.source);
1390
+ expect(impression[0].uids).to.be.an('array');
1391
+ expect(impression[0].uids).to.have.lengthOf(1);
1387
1392
  expect(impression[0].uids[0].id).to.equal(testCopy.IdentityIp.data.uids[0].id);
1393
+ expect(impression[0].uids[0].atype).to.exist;
1394
+ expect(impression[0].uids[0].atype).to.equal(testCopy.IdentityIp.data.uids[0].atype);
1388
1395
  });
1389
1396
  });
1390
1397