prebid.js 9.0.0 → 9.2.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 (307) hide show
  1. package/.nvmrc +1 -1
  2. package/browsers.json +3 -3
  3. package/dist/33acrossAnalyticsAdapter.js +1 -1
  4. package/dist/33acrossBidAdapter.js +1 -1
  5. package/dist/33acrossIdSystem.js +1 -1
  6. package/dist/BTBidAdapter.js +1 -1
  7. package/dist/acuityadsBidAdapter.js +1 -1
  8. package/dist/adagioAnalyticsAdapter.js +1 -1
  9. package/dist/adagioBidAdapter.js +1 -1
  10. package/dist/adagioRtdProvider.js +1 -1
  11. package/dist/adagioUtils.js +1 -0
  12. package/dist/adgenerationBidAdapter.js +1 -1
  13. package/dist/admanBidAdapter.js +1 -1
  14. package/dist/adpod.js +1 -1
  15. package/dist/adprimeBidAdapter.js +1 -1
  16. package/dist/adqueryBidAdapter.js +1 -1
  17. package/dist/adrelevantisBidAdapter.js +1 -1
  18. package/dist/adstirBidAdapter.js +1 -1
  19. package/dist/adtrgtmeBidAdapter.js +1 -1
  20. package/dist/adxcgBidAdapter.js +1 -1
  21. package/dist/adyoulikeBidAdapter.js +1 -1
  22. package/dist/agmaAnalyticsAdapter.js +1 -1
  23. package/dist/ajaBidAdapter.js +1 -1
  24. package/dist/amxBidAdapter.js +1 -1
  25. package/dist/amxIdSystem.js +1 -1
  26. package/dist/appierAnalyticsAdapter.js +1 -1
  27. package/dist/appnexusBidAdapter.js +1 -1
  28. package/dist/appnexusUtils.js +1 -1
  29. package/dist/asoBidAdapter.js +1 -1
  30. package/dist/autoplayDetection.js +1 -1
  31. package/dist/axisBidAdapter.js +1 -1
  32. package/dist/axonixBidAdapter.js +1 -1
  33. package/dist/beyondmediaBidAdapter.js +1 -1
  34. package/dist/bidglassBidAdapter.js +1 -1
  35. package/dist/big-richmediaBidAdapter.js +1 -1
  36. package/dist/bliinkBidAdapter.js +1 -1
  37. package/dist/boldwinBidAdapter.js +1 -1
  38. package/dist/bridBidAdapter.js +1 -1
  39. package/dist/bridgewellBidAdapter.js +1 -1
  40. package/dist/brightMountainMediaBidAdapter.js +1 -1
  41. package/dist/carodaBidAdapter.js +1 -1
  42. package/dist/chtnwBidAdapter.js +1 -1
  43. package/dist/chunk-core.js +1 -1
  44. package/dist/compassBidAdapter.js +1 -1
  45. package/dist/concertBidAdapter.js +1 -1
  46. package/dist/connectadBidAdapter.js +1 -1
  47. package/dist/consumableBidAdapter.js +1 -1
  48. package/dist/contentexchangeBidAdapter.js +1 -1
  49. package/dist/conversantAnalyticsAdapter.js +1 -1
  50. package/dist/conversantBidAdapter.js +1 -1
  51. package/dist/craftBidAdapter.js +1 -1
  52. package/dist/criteoBidAdapter.js +1 -1
  53. package/dist/cwireBidAdapter.js +1 -1
  54. package/dist/dailymotionBidAdapter.js +1 -1
  55. package/dist/dependencies.json +83 -4
  56. package/dist/dspxBidAdapter.js +1 -1
  57. package/dist/dxkultureBidAdapter.js +1 -1
  58. package/dist/e_volutionBidAdapter.js +1 -1
  59. package/dist/emtvBidAdapter.js +1 -1
  60. package/dist/eplanningBidAdapter.js +1 -1
  61. package/dist/euidIdSystem.js +1 -1
  62. package/dist/exadsBidAdapter.js +1 -1
  63. package/dist/feedadBidAdapter.js +1 -1
  64. package/dist/finativeBidAdapter.js +1 -1
  65. package/dist/freewheel-sspBidAdapter.js +1 -1
  66. package/dist/globalsunBidAdapter.js +1 -1
  67. package/dist/gmosspBidAdapter.js +1 -1
  68. package/dist/goldbachBidAdapter.js +1 -1
  69. package/dist/greenbidsAnalyticsAdapter.js +1 -1
  70. package/dist/greenbidsRtdProvider.js +1 -1
  71. package/dist/gridBidAdapter.js +1 -1
  72. package/dist/gumgumBidAdapter.js +1 -1
  73. package/dist/h12mediaBidAdapter.js +1 -1
  74. package/dist/hypelabBidAdapter.js +1 -1
  75. package/dist/id5IdSystem.js +1 -1
  76. package/dist/illuminBidAdapter.js +1 -1
  77. package/dist/imdsBidAdapter.js +1 -1
  78. package/dist/improvedigitalBidAdapter.js +1 -1
  79. package/dist/insticatorBidAdapter.js +1 -1
  80. package/dist/iqzoneBidAdapter.js +1 -1
  81. package/dist/ixBidAdapter.js +1 -1
  82. package/dist/jixieBidAdapter.js +1 -1
  83. package/dist/justpremiumBidAdapter.js +1 -1
  84. package/dist/kargoBidAdapter.js +1 -1
  85. package/dist/kimberliteBidAdapter.js +1 -1
  86. package/dist/kiviadsBidAdapter.js +1 -1
  87. package/dist/konduitAnalyticsAdapter.js +1 -1
  88. package/dist/krushmediaBidAdapter.js +1 -1
  89. package/dist/kueezBidAdapter.js +1 -1
  90. package/dist/kueezRtbBidAdapter.js +1 -1
  91. package/dist/lassoBidAdapter.js +1 -1
  92. package/dist/lifestreetBidAdapter.js +1 -1
  93. package/dist/liveIntentIdSystem.js +1 -1
  94. package/dist/logicadBidAdapter.js +1 -1
  95. package/dist/loglyliftBidAdapter.js +1 -1
  96. package/dist/loyalBidAdapter.js +1 -1
  97. package/dist/luceadBidAdapter.js +1 -1
  98. package/dist/lunamediahbBidAdapter.js +1 -1
  99. package/dist/magniteAnalyticsAdapter.js +1 -1
  100. package/dist/malltvAnalyticsAdapter.js +1 -1
  101. package/dist/marsmediaBidAdapter.js +1 -1
  102. package/dist/mathildeadsBidAdapter.js +1 -1
  103. package/dist/mediafuseBidAdapter.js +1 -1
  104. package/dist/mediasquareBidAdapter.js +1 -1
  105. package/dist/mgidBidAdapter.js +1 -1
  106. package/dist/mgidXBidAdapter.js +1 -1
  107. package/dist/minutemediaBidAdapter.js +1 -1
  108. package/dist/missenaBidAdapter.js +1 -1
  109. package/dist/mobfoxpbBidAdapter.js +1 -1
  110. package/dist/mobianRtdProvider.js +1 -0
  111. package/dist/nexx360BidAdapter.js +1 -1
  112. package/dist/nobidAnalyticsAdapter.js +1 -1
  113. package/dist/nobidBidAdapter.js +1 -1
  114. package/dist/not-for-prod/prebid.js +190 -186
  115. package/dist/oguryBidAdapter.js +1 -1
  116. package/dist/onetagBidAdapter.js +1 -1
  117. package/dist/ooloAnalyticsAdapter.js +1 -1
  118. package/dist/openwebBidAdapter.js +1 -1
  119. package/dist/openxBidAdapter.js +1 -1
  120. package/dist/optidigitalBidAdapter.js +1 -1
  121. package/dist/ortbConverter.js +1 -1
  122. package/dist/outbrainBidAdapter.js +1 -1
  123. package/dist/ozoneBidAdapter.js +1 -1
  124. package/dist/paapi.js +1 -1
  125. package/dist/pgamsspBidAdapter.js +1 -1
  126. package/dist/pixfutureBidAdapter.js +1 -1
  127. package/dist/playdigoBidAdapter.js +1 -1
  128. package/dist/prebidServerBidAdapter.js +1 -1
  129. package/dist/pubCircleBidAdapter.js +1 -1
  130. package/dist/publinkIdSystem.js +1 -1
  131. package/dist/publirBidAdapter.js +1 -1
  132. package/dist/pubmaticAnalyticsAdapter.js +1 -1
  133. package/dist/pubmaticBidAdapter.js +1 -1
  134. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  135. package/dist/pubxaiAnalyticsAdapter.js +1 -1
  136. package/dist/pxyzBidAdapter.js +1 -1
  137. package/dist/qtBidAdapter.js +1 -1
  138. package/dist/quantcastBidAdapter.js +1 -1
  139. package/dist/raynRtdProvider.js +1 -1
  140. package/dist/readpeakBidAdapter.js +1 -1
  141. package/dist/relaidoBidAdapter.js +1 -1
  142. package/dist/retailspotBidAdapter.js +1 -1
  143. package/dist/rhythmoneBidAdapter.js +1 -1
  144. package/dist/richaudienceBidAdapter.js +1 -0
  145. package/dist/ringieraxelspringerBidAdapter.js +1 -1
  146. package/dist/riseBidAdapter.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/setupadBidAdapter.js +1 -1
  151. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  152. package/dist/sharethroughBidAdapter.js +1 -1
  153. package/dist/shinezBidAdapter.js +1 -1
  154. package/dist/shinezRtbBidAdapter.js +1 -1
  155. package/dist/smaatoBidAdapter.js +1 -1
  156. package/dist/smartadserverBidAdapter.js +1 -1
  157. package/dist/smartxBidAdapter.js +1 -1
  158. package/dist/smartytechBidAdapter.js +1 -1
  159. package/dist/smilewantedBidAdapter.js +1 -1
  160. package/dist/sonobiBidAdapter.js +1 -1
  161. package/dist/sovrnBidAdapter.js +1 -1
  162. package/dist/sspBCBidAdapter.js +1 -1
  163. package/dist/stnBidAdapter.js +1 -1
  164. package/dist/stvBidAdapter.js +1 -1
  165. package/dist/sublimeBidAdapter.js +1 -1
  166. package/dist/taboolaBidAdapter.js +1 -1
  167. package/dist/tagorasBidAdapter.js +1 -1
  168. package/dist/targetVideoBidAdapter.js +1 -1
  169. package/dist/teadsBidAdapter.js +1 -1
  170. package/dist/teqblazeUtils.js +1 -0
  171. package/dist/themoneytizerBidAdapter.js +1 -1
  172. package/dist/topicsFpdModule.js +1 -1
  173. package/dist/trionBidAdapter.js +1 -1
  174. package/dist/tripleliftBidAdapter.js +1 -1
  175. package/dist/ttdBidAdapter.js +1 -1
  176. package/dist/twistDigitalBidAdapter.js +1 -1
  177. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  178. package/dist/uid2IdSystem.js +1 -1
  179. package/dist/underdogmediaBidAdapter.js +1 -1
  180. package/dist/undertoneBidAdapter.js +1 -1
  181. package/dist/unrulyBidAdapter.js +1 -1
  182. package/dist/vidazooBidAdapter.js +1 -1
  183. package/dist/videobyteBidAdapter.js +1 -1
  184. package/dist/visiblemeasuresBidAdapter.js +1 -1
  185. package/dist/visxBidAdapter.js +1 -1
  186. package/dist/vuukleBidAdapter.js +1 -1
  187. package/dist/widespaceBidAdapter.js +1 -1
  188. package/dist/winrBidAdapter.js +1 -1
  189. package/dist/yahooAdsBidAdapter.js +1 -1
  190. package/dist/yieldmoBidAdapter.js +1 -1
  191. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  192. package/dist/zeta_global_sspAnalyticsAdapter.js +1 -1
  193. package/integrationExamples/gpt/raynRtdProvider_example.html +1 -0
  194. package/libraries/adagioUtils/adagioUtils.js +35 -0
  195. package/libraries/appnexusUtils/anUtils.js +1 -0
  196. package/libraries/autoplayDetection/autoplay.js +8 -1
  197. package/libraries/ortbConverter/converter.js +1 -1
  198. package/libraries/teqblazeUtils/bidderUtils.js +253 -0
  199. package/modules/.submodules.json +1 -0
  200. package/modules/acuityadsBidAdapter.js +5 -203
  201. package/modules/adagioBidAdapter.js +1 -17
  202. package/modules/adagioRtdProvider.js +41 -51
  203. package/modules/adagioRtdProvider.md +1 -0
  204. package/modules/admanBidAdapter.js +31 -188
  205. package/modules/adprimeBidAdapter.js +28 -165
  206. package/modules/axisBidAdapter.js +33 -165
  207. package/modules/beyondmediaBidAdapter.js +5 -189
  208. package/modules/bliinkBidAdapter.js +3 -31
  209. package/modules/boldwinBidAdapter.js +21 -159
  210. package/modules/ceeIdSystem.js +1 -1
  211. package/modules/compassBidAdapter.js +5 -198
  212. package/modules/contentexchangeBidAdapter.js +5 -200
  213. package/modules/conversantBidAdapter.js +1 -0
  214. package/modules/dailymotionBidAdapter.js +1 -1
  215. package/modules/e_volutionBidAdapter.js +4 -186
  216. package/modules/emtvBidAdapter.js +5 -198
  217. package/modules/globalsunBidAdapter.js +5 -199
  218. package/modules/id5IdSystem.js +31 -2
  219. package/modules/id5IdSystem.md +67 -2
  220. package/modules/iqzoneBidAdapter.js +5 -224
  221. package/modules/kiviadsBidAdapter.js +5 -199
  222. package/modules/krushmediaBidAdapter.js +25 -143
  223. package/modules/loyalBidAdapter.js +4 -178
  224. package/modules/lunamediahbBidAdapter.js +5 -118
  225. package/modules/mathildeadsBidAdapter.js +5 -198
  226. package/modules/mgidXBidAdapter.js +14 -209
  227. package/modules/mobfoxpbBidAdapter.js +4 -135
  228. package/modules/mobianRtdProvider.js +52 -0
  229. package/modules/mobianRtdProvider.md +11 -0
  230. package/modules/nobidAnalyticsAdapter.js +2 -3
  231. package/modules/novatiqIdSystem.md +2 -3
  232. package/modules/ozoneBidAdapter.js +117 -58
  233. package/modules/paapi.js +2 -1
  234. package/modules/pgamsspBidAdapter.js +5 -240
  235. package/modules/playdigoBidAdapter.js +4 -186
  236. package/modules/prebidServerBidAdapter/index.js +9 -2
  237. package/modules/pubCircleBidAdapter.js +5 -218
  238. package/modules/pubmaticAnalyticsAdapter.js +21 -8
  239. package/modules/pubxaiAnalyticsAdapter.js +1 -5
  240. package/modules/qtBidAdapter.js +5 -224
  241. package/modules/raynRtdProvider.js +36 -3
  242. package/modules/richaudienceBidAdapter.js +375 -0
  243. package/modules/richaudienceBidAdapter.md +1 -1
  244. package/modules/seedtagBidAdapter.js +1 -0
  245. package/modules/setupadBidAdapter.js +76 -153
  246. package/modules/setupadBidAdapter.md +1 -1
  247. package/modules/smaatoBidAdapter.js +17 -6
  248. package/modules/smartytechBidAdapter.js +7 -2
  249. package/modules/topicsFpdModule.js +1 -1
  250. package/modules/uid2IdSystem.js +0 -1
  251. package/modules/uid2IdSystem_shared.js +0 -1
  252. package/modules/visiblemeasuresBidAdapter.js +5 -199
  253. package/modules/zeta_global_sspAnalyticsAdapter.js +8 -4
  254. package/package.json +1 -1
  255. package/src/auction.js +5 -63
  256. package/src/utils/focusTimeout.js +41 -0
  257. package/src/utils/ttlCollection.js +2 -1
  258. package/src/utils.js +42 -0
  259. package/src/videoCache.js +72 -0
  260. package/test/mocks/videoCacheStub.js +1 -1
  261. package/test/spec/auctionmanager_spec.js +16 -1
  262. package/test/spec/libraries/teqblazeUtils/bidderUtils_spec.js +519 -0
  263. package/test/spec/modules/acuityadsBidAdapter_spec.js +79 -43
  264. package/test/spec/modules/adagioRtdProvider_spec.js +62 -1
  265. package/test/spec/modules/admanBidAdapter_spec.js +370 -247
  266. package/test/spec/modules/adprimeBidAdapter_spec.js +225 -78
  267. package/test/spec/modules/axisBidAdapter_spec.js +78 -14
  268. package/test/spec/modules/beyondmediaBidAdapter_spec.js +80 -18
  269. package/test/spec/modules/bliinkBidAdapter_spec.js +8 -2
  270. package/test/spec/modules/boldwinBidAdapter_spec.js +221 -75
  271. package/test/spec/modules/compassBidAdapter_spec.js +130 -16
  272. package/test/spec/modules/contentexchangeBidAdapter_spec.js +134 -21
  273. package/test/spec/modules/conversantBidAdapter_spec.js +7 -0
  274. package/test/spec/modules/dailymotionBidAdapter_spec.js +3 -3
  275. package/test/spec/modules/e_volutionBidAdapter_spec.js +65 -3
  276. package/test/spec/modules/emtvBidAdapter_spec.js +131 -16
  277. package/test/spec/modules/globalsunBidAdapter_spec.js +130 -16
  278. package/test/spec/modules/id5IdSystem_spec.js +79 -3
  279. package/test/spec/modules/iqzoneBidAdapter_spec.js +66 -12
  280. package/test/spec/modules/kiviadsBidAdapter_spec.js +131 -20
  281. package/test/spec/modules/krushmediaBidAdapter_spec.js +272 -90
  282. package/test/spec/modules/loyalBidAdapter_spec.js +114 -14
  283. package/test/spec/modules/lunamediahbBidAdapter_spec.js +221 -87
  284. package/test/spec/modules/mathildeadsBidAdapter_spec.js +87 -18
  285. package/test/spec/modules/mgidXBidAdapter_spec.js +11 -3
  286. package/test/spec/modules/mobfoxpbBidAdapter_spec.js +229 -91
  287. package/test/spec/modules/mobianRtdProvider_spec.js +107 -0
  288. package/test/spec/modules/ozoneBidAdapter_spec.js +192 -22
  289. package/test/spec/modules/paapi_spec.js +5 -5
  290. package/test/spec/modules/pgamsspBidAdapter_spec.js +83 -16
  291. package/test/spec/modules/playdigoBidAdapter_spec.js +38 -9
  292. package/test/spec/modules/prebidServerBidAdapter_spec.js +14 -0
  293. package/test/spec/modules/pubCircleBidAdapter_spec.js +82 -17
  294. package/test/spec/modules/pubmaticAnalyticsAdapter_spec.js +52 -5
  295. package/test/spec/modules/qtBidAdapter_spec.js +15 -3
  296. package/test/spec/modules/raynRtdProvider_spec.js +25 -0
  297. package/test/spec/modules/richaudienceBidAdapter_spec.js +1304 -0
  298. package/test/spec/modules/seedtagBidAdapter_spec.js +2 -0
  299. package/test/spec/modules/setupadBidAdapter_spec.js +139 -97
  300. package/test/spec/modules/smaatoBidAdapter_spec.js +27 -0
  301. package/test/spec/modules/smartytechBidAdapter_spec.js +5 -1
  302. package/test/spec/modules/topicsFpdModule_spec.js +43 -59
  303. package/test/spec/modules/visiblemeasuresBidAdapter_spec.js +130 -16
  304. package/test/spec/modules/zeta_global_sspAnalyticsAdapter_spec.js +4 -0
  305. package/test/spec/ortbConverter/converter_spec.js +7 -3
  306. package/test/spec/unit/utils/focusTimeout_spec.js +60 -0
  307. package/test/spec/videoCache_spec.js +56 -53
@@ -37,6 +37,7 @@ function getSlotConfigs(mediaTypes, params) {
37
37
  ortb2Imp: {
38
38
  ext: {
39
39
  tid: 'd704d006-0d6e-4a09-ad6c-179e7e758096',
40
+ gpid: 'some-gpid'
40
41
  }
41
42
  },
42
43
  adUnitCode: adUnitCode,
@@ -299,6 +300,7 @@ describe('Seedtag Adapter', function () {
299
300
  expect(data.ttfb).to.be.greaterThanOrEqual(0);
300
301
 
301
302
  expect(data.bidRequests[0].adUnitCode).to.equal(adUnitCode);
303
+ expect(data.bidRequests[0].gpid).to.equal('some-gpid');
302
304
  });
303
305
 
304
306
  describe('GDPR params', function () {
@@ -1,4 +1,4 @@
1
- import { spec } from 'modules/setupadBidAdapter.js';
1
+ import { spec, biddersCreativeIds } from 'modules/setupadBidAdapter.js';
2
2
 
3
3
  describe('SetupadAdapter', function () {
4
4
  const userIdAsEids = [
@@ -42,9 +42,104 @@ describe('SetupadAdapter', function () {
42
42
  },
43
43
  userIdAsEids,
44
44
  },
45
+ {
46
+ adUnitCode: 'test-div-2',
47
+ auctionId: 'b06c5141-fe8f-4cdf-9d7d-54415490a917',
48
+ bidId: '22c4871113f461',
49
+ bidder: 'rubicon',
50
+ bidderRequestId: '15246a574e859f',
51
+ uspConsent: 'usp-context-string',
52
+ gdprConsent: {
53
+ consentString: 'BOtmiBKOtmiBKABABAENAFAAAAACeAAA',
54
+ gdprApplies: true,
55
+ },
56
+ params: {
57
+ placement_id: '123',
58
+ account_id: 'test-account-id',
59
+ },
60
+ sizes: [[300, 250]],
61
+ ortb2: {
62
+ device: {
63
+ w: 1500,
64
+ h: 1000,
65
+ },
66
+ site: {
67
+ domain: 'test.com',
68
+ page: 'http://test.com',
69
+ },
70
+ },
71
+ userIdAsEids,
72
+ },
45
73
  ];
46
74
 
47
75
  const bidderRequest = {
76
+ auctionId: 'b06c5141-fe8f-4cdf-9d7d-54415490a917',
77
+ auctionStart: 1579746300522,
78
+ bidderCode: 'setupad',
79
+ bidderRequestId: '15246a574e859f',
80
+ bids: [
81
+ {
82
+ adUnitCode: 'test-div',
83
+ auctionId: 'b06c5141-fe8f-4cdf-9d7d-54415490a917',
84
+ bidId: '22c4871113f461',
85
+ bidder: 'rubicon',
86
+ bidderRequestId: '15246a574e859f',
87
+ uspConsent: 'usp-context-string',
88
+ gdprConsent: {
89
+ consentString: 'BOtmiBKOtmiBKABABAENAFAAAAACeAAA',
90
+ gdprApplies: true,
91
+ },
92
+ params: {
93
+ placement_id: '123',
94
+ account_id: 'test-account-id',
95
+ },
96
+ sizes: [[300, 250]],
97
+ ortb2: {
98
+ device: {
99
+ w: 1500,
100
+ h: 1000,
101
+ },
102
+ site: {
103
+ domain: 'test.com',
104
+ page: 'http://test.com',
105
+ },
106
+ },
107
+ userIdAsEids,
108
+ },
109
+ {
110
+ adUnitCode: 'test-div-2',
111
+ auctionId: 'b06c5141-fe8f-4cdf-9d7d-54415490a917',
112
+ bidId: '22c4871113f461',
113
+ bidder: 'rubicon',
114
+ bidderRequestId: '15246a574e859f',
115
+ uspConsent: 'usp-context-string',
116
+ gdprConsent: {
117
+ consentString: 'BOtmiBKOtmiBKABABAENAFAAAAACeAAA',
118
+ gdprApplies: true,
119
+ },
120
+ params: {
121
+ placement_id: '123',
122
+ account_id: 'test-account-id',
123
+ },
124
+ sizes: [[300, 250]],
125
+ ortb2: {
126
+ device: {
127
+ w: 1500,
128
+ h: 1000,
129
+ },
130
+ site: {
131
+ domain: 'test.com',
132
+ page: 'http://test.com',
133
+ },
134
+ },
135
+ userIdAsEids,
136
+ },
137
+ ],
138
+ gdprConsent: {
139
+ consentString: 'BOtmiBKOtmiBKABABAENAFAAAAACeAAA',
140
+ vendorData: {},
141
+ gdprApplies: true,
142
+ },
48
143
  ortb2: {
49
144
  device: {
50
145
  w: 1500,
@@ -52,39 +147,27 @@ describe('SetupadAdapter', function () {
52
147
  },
53
148
  },
54
149
  refererInfo: {
150
+ canonicalUrl: null,
55
151
  domain: 'test.com',
56
152
  page: 'http://test.com',
57
- ref: '',
153
+ referer: null,
58
154
  },
59
155
  };
60
156
 
61
157
  const serverResponse = {
62
158
  body: {
63
- id: 'f7b3d2da-e762-410c-b069-424f92c4c4b2',
64
159
  seatbid: [
65
160
  {
66
- bid: [
67
- {
68
- id: 'test-bid-id',
69
- price: 0.8,
70
- adm: 'this is an ad',
71
- adid: 'test-ad-id',
72
- adomain: ['test.addomain.com'],
73
- w: 300,
74
- h: 250,
75
- },
76
- ],
77
- seat: 'testBidder',
161
+ bid: [{ crid: 123 }, { crid: 1234 }],
162
+ seat: 'pubmatic',
78
163
  },
79
- ],
80
- cur: 'USD',
81
- ext: {
82
- sync: {
83
- image: ['urlA?gdpr={{.GDPR}}'],
84
- iframe: ['urlB'],
164
+ {
165
+ bid: [{ crid: 12345 }],
166
+ seat: 'setupad',
85
167
  },
86
- },
168
+ ],
87
169
  },
170
+ testCase: 1,
88
171
  };
89
172
 
90
173
  describe('isBidRequestValid', function () {
@@ -92,11 +175,26 @@ describe('SetupadAdapter', function () {
92
175
  bidder: 'setupad',
93
176
  params: {
94
177
  placement_id: '123',
178
+ account_id: '123',
95
179
  },
96
180
  };
181
+
97
182
  it('should return true when required params found', function () {
98
183
  expect(spec.isBidRequestValid(bid)).to.equal(true);
99
184
  });
185
+
186
+ it('should return false when placement_id is missing', function () {
187
+ const bidWithoutPlacementId = { ...bid };
188
+ delete bidWithoutPlacementId.params.placement_id;
189
+ expect(spec.isBidRequestValid(bidWithoutPlacementId)).to.equal(false);
190
+ });
191
+
192
+ it('should return false when account_id is missing', function () {
193
+ const bidWithoutAccountId = { ...bid };
194
+ delete bidWithoutAccountId.params.account_id;
195
+ expect(spec.isBidRequestValid(bidWithoutAccountId)).to.equal(false);
196
+ });
197
+
100
198
  it('should return false when required params are not passed', function () {
101
199
  delete bid.params.placement_id;
102
200
  expect(spec.isBidRequestValid(bid)).to.equal(false);
@@ -104,77 +202,25 @@ describe('SetupadAdapter', function () {
104
202
  });
105
203
 
106
204
  describe('buildRequests', function () {
107
- it('check request params with GDPR and USP', function () {
108
- const request = spec.buildRequests(bidRequests, bidRequests[0]);
109
- expect(JSON.parse(request[0].data).user.ext.consent).to.equal(
110
- 'BOtmiBKOtmiBKABABAENAFAAAAACeAAA'
111
- );
112
- expect(JSON.parse(request[0].data).regs.ext.gdpr).to.equal(1);
113
- expect(JSON.parse(request[0].data).regs.ext.us_privacy).to.equal('usp-context-string');
114
- });
115
-
116
- it('check request params without GDPR', function () {
117
- let bidRequestsWithoutGDPR = Object.assign({}, bidRequests[0]);
118
- delete bidRequestsWithoutGDPR.gdprConsent;
119
- const request = spec.buildRequests([bidRequestsWithoutGDPR], bidRequestsWithoutGDPR);
120
- expect(JSON.parse(request[0].data).regs.ext.gdpr).to.be.undefined;
121
- expect(JSON.parse(request[0].data).regs.ext.us_privacy).to.equal('usp-context-string');
205
+ it('should return correct storedrequest id for bids if placement_id is provided', function () {
206
+ const request = spec.buildRequests(bidRequests, bidderRequest);
207
+ expect(request.data.imp[0].ext.prebid.storedrequest.id).to.equal('123');
122
208
  });
123
209
 
124
210
  it('should return correct storedrequest id if account_id is provided', function () {
125
- const request = spec.buildRequests(bidRequests, bidRequests[0]);
126
- expect(JSON.parse(request[0].data).ext.prebid.storedrequest.id).to.equal('test-account-id');
127
- });
128
-
129
- it('should return correct storedrequest id if account_id is not provided', function () {
130
- let bidRequestsWithoutAccountId = Object.assign({}, bidRequests[0]);
131
- delete bidRequestsWithoutAccountId.params.account_id;
132
- const request = spec.buildRequests(
133
- [bidRequestsWithoutAccountId],
134
- bidRequestsWithoutAccountId
135
- );
136
- expect(JSON.parse(request[0].data).ext.prebid.storedrequest.id).to.equal('default');
137
- });
138
-
139
- it('validate generated params', function () {
140
- const request = spec.buildRequests(bidRequests);
141
- expect(request[0].bidId).to.equal('22c4871113f461');
142
- expect(JSON.parse(request[0].data).id).to.equal('15246a574e859f');
143
- });
144
-
145
- it('check if correct site object was added', function () {
146
211
  const request = spec.buildRequests(bidRequests, bidderRequest);
147
- const siteObj = JSON.parse(request[0].data).site;
148
-
149
- expect(siteObj.domain).to.equal('test.com');
150
- expect(siteObj.page).to.equal('http://test.com');
151
- expect(siteObj.ref).to.equal('');
212
+ expect(request.data.ext.prebid.storedrequest.id).to.equal('test-account-id');
152
213
  });
153
214
 
154
- it('check if correct device object was added', function () {
215
+ it('should return setupad custom adapter param', function () {
155
216
  const request = spec.buildRequests(bidRequests, bidderRequest);
156
- const deviceObj = JSON.parse(request[0].data).device;
157
-
158
- expect(deviceObj.w).to.equal(1500);
159
- expect(deviceObj.h).to.equal(1000);
160
- });
161
-
162
- it('check if imp object was added', function () {
163
- const request = spec.buildRequests(bidRequests);
164
- expect(JSON.parse(request[0].data).imp).to.be.an('array');
165
- });
166
-
167
- it('should send "user.ext.eids" in the request for Prebid.js supported modules only', function () {
168
- const request = spec.buildRequests(bidRequests);
169
- expect(JSON.parse(request[0].data).user.ext.eids).to.deep.equal(userIdAsEids);
217
+ expect(request.data.setupad).to.equal('adapter');
170
218
  });
171
219
 
172
- it('should send an undefined "user.ext.eids" in the request if userId module is unsupported', function () {
173
- let bidRequestsUnsupportedUserIdModule = Object.assign({}, bidRequests[0]);
174
- delete bidRequestsUnsupportedUserIdModule.userIdAsEids;
175
- const request = spec.buildRequests(bidRequestsUnsupportedUserIdModule);
176
-
177
- expect(JSON.parse(request[0].data).user.ext.eids).to.be.undefined;
220
+ // Change this to 1 whenever TEST_REQUEST = 1. This is allowed only for testing requests locally
221
+ it('should return correct test attribute value from global value', function () {
222
+ const request = spec.buildRequests(bidRequests, bidderRequest);
223
+ expect(request.data.test).to.equal(0);
178
224
  });
179
225
  });
180
226
 
@@ -241,25 +287,21 @@ describe('SetupadAdapter', function () {
241
287
  describe('interpretResponse', function () {
242
288
  it('should return empty array if error during parsing', () => {
243
289
  const wrongServerResponse = 'wrong data';
244
- let request = spec.buildRequests(bidRequests, bidRequests[0]);
290
+ let request = spec.buildRequests(bidRequests, bidderRequest);
245
291
  let result = spec.interpretResponse(wrongServerResponse, request);
246
292
 
247
293
  expect(result).to.be.instanceof(Array);
248
294
  expect(result.length).to.equal(0);
249
295
  });
250
296
 
251
- it('should get correct bid response', function () {
252
- const result = spec.interpretResponse(serverResponse, bidRequests[0]);
253
- expect(result).to.be.an('array').with.lengthOf(1);
254
- expect(result[0].requestId).to.equal('22c4871113f461');
255
- expect(result[0].cpm).to.equal(0.8);
256
- expect(result[0].width).to.equal(300);
257
- expect(result[0].height).to.equal(250);
258
- expect(result[0].creativeId).to.equal('test-bid-id');
259
- expect(result[0].currency).to.equal('USD');
260
- expect(result[0].netRevenue).to.equal(true);
261
- expect(result[0].ttl).to.equal(360);
262
- expect(result[0].ad).to.equal('this is an ad');
297
+ it('should update biddersCreativeIds correctly', function () {
298
+ spec.interpretResponse(serverResponse, bidderRequest);
299
+
300
+ expect(biddersCreativeIds).to.deep.equal({
301
+ 123: 'pubmatic',
302
+ 1234: 'pubmatic',
303
+ 12345: 'setupad',
304
+ });
263
305
  });
264
306
  });
265
307
 
@@ -296,6 +296,33 @@ describe('smaatoBidAdapterTest', () => {
296
296
  expect(req.site.page).to.equal(page);
297
297
  expect(req.site.ref).to.equal(ref);
298
298
  expect(req.site.publisher.id).to.equal('publisherId');
299
+ expect(req.dooh).to.be.undefined;
300
+ })
301
+
302
+ it('sends correct dooh from ortb2', () => {
303
+ const name = 'name';
304
+ const domain = 'domain';
305
+ const keywords = 'keyword1,keyword2';
306
+ const venuetypetax = 1;
307
+ const ortb2 = {
308
+ dooh: {
309
+ name: name,
310
+ domain: domain,
311
+ keywords: keywords,
312
+ venuetypetax: venuetypetax
313
+ },
314
+ };
315
+
316
+ const reqs = spec.buildRequests([singleBannerBidRequest], {...defaultBidderRequest, ortb2});
317
+
318
+ const req = extractPayloadOfFirstAndOnlyRequest(reqs);
319
+ expect(req.dooh.id).to.exist.and.to.be.a('string');
320
+ expect(req.dooh.name).to.equal(name);
321
+ expect(req.dooh.domain).to.equal(domain);
322
+ expect(req.dooh.keywords).to.equal(keywords);
323
+ expect(req.dooh.venuetypetax).to.equal(venuetypetax);
324
+ expect(req.dooh.publisher.id).to.equal('publisherId');
325
+ expect(req.site).to.be.undefined;
299
326
  })
300
327
 
301
328
  it('sends correct device from ortb2', () => {
@@ -204,7 +204,11 @@ function mockResponseData(requestData) {
204
204
  creativeId: `creative-id-${index}`,
205
205
  cpm: Math.floor(Math.random() * 100),
206
206
  currency: `UAH-${rndIndex}`,
207
- mediaType: mediaType
207
+ mediaType: mediaType,
208
+ meta: {
209
+ primaryCatId: 'IAB2-2',
210
+ secondaryCatIds: ['IAB2-14', 'IAB2-6']
211
+ }
208
212
  };
209
213
  });
210
214
  return {
@@ -308,33 +308,6 @@ describe('topics', () => {
308
308
  }],
309
309
  name: 'ads.pubmatic.com'
310
310
  }];
311
- const consentString = 'CPi8wgAPi8wgAADABBENCrCsAP_AAH_AAAAAISNB7D==';
312
- const consentConfig = {
313
- consentString: consentString,
314
- gdprApplies: true,
315
- vendorData: {
316
- metadata: consentString,
317
- gdprApplies: true,
318
- purpose: {
319
- consents: {
320
- 1: true,
321
- 2: true,
322
- 3: true,
323
- 4: true
324
- }
325
- }
326
- }
327
- };
328
- const mockData = [
329
- {
330
- name: 'domain',
331
- segment: [{id: 123}]
332
- },
333
- {
334
- name: 'domain',
335
- segment: [{id: 321}],
336
- }
337
- ];
338
311
 
339
312
  const evt = {
340
313
  data: '{"segment":{"domain":"ads.pubmatic.com","topics":[{"configVersion":"chrome.1","modelVersion":"2206021246","taxonomyVersion":"1","topic":165,"version":"chrome.1:1:2206021246"}],"bidder":"pubmatic"},"date":1669743901858}',
@@ -345,49 +318,60 @@ describe('topics', () => {
345
318
  storage.removeDataFromLocalStorage(topicStorageName);
346
319
  });
347
320
 
348
- describe('when cached data is available and not expired', () => {
321
+ describe('caching', () => {
349
322
  let sandbox;
350
323
  beforeEach(() => {
351
324
  sandbox = sinon.sandbox.create();
352
- const storedSegments = JSON.stringify(
353
- [['pubmatic', {
354
- '2206021246': {
355
- 'ext': {'segtax': 600, 'segclass': '2206021246'},
356
- 'segment': [{'id': '243'}, {'id': '265'}],
357
- 'name': 'ads.pubmatic.com'
358
- },
359
- 'lastUpdated': new Date().getTime()
360
- }]]
361
- );
362
- storage.setDataInLocalStorage(topicStorageName, storedSegments);
363
- config.setConfig({
364
- userSync: {
365
- topics: {
366
- maxTopicCaller: 4,
367
- bidders: [{
368
- bidder: 'pubmatic',
369
- iframeURL: 'https://ads.pubmatic.com/AdServer/js/topics/topics_frame.html'
370
- }]
371
- }
372
- }
373
- })
374
- });
325
+ })
326
+
375
327
  afterEach(() => {
376
328
  sandbox.restore();
377
329
  config.resetConfig();
378
330
  });
379
331
 
380
- it('should return segments for bidder if transmitUfpd is allowed', () => {
381
- assert.deepEqual(getCachedTopics(), expected);
382
- });
332
+ it('should return no segments when not configured', () => {
333
+ config.setConfig({userSync: {}});
334
+ expect(getCachedTopics()).to.eql([]);
335
+ })
336
+
337
+ describe('when cached data is available and not expired', () => {
338
+ beforeEach(() => {
339
+ const storedSegments = JSON.stringify(
340
+ [['pubmatic', {
341
+ '2206021246': {
342
+ 'ext': {'segtax': 600, 'segclass': '2206021246'},
343
+ 'segment': [{'id': '243'}, {'id': '265'}],
344
+ 'name': 'ads.pubmatic.com'
345
+ },
346
+ 'lastUpdated': new Date().getTime()
347
+ }]]
348
+ );
349
+ storage.setDataInLocalStorage(topicStorageName, storedSegments);
350
+ config.setConfig({
351
+ userSync: {
352
+ topics: {
353
+ maxTopicCaller: 4,
354
+ bidders: [{
355
+ bidder: 'pubmatic',
356
+ iframeURL: 'https://ads.pubmatic.com/AdServer/js/topics/topics_frame.html'
357
+ }]
358
+ }
359
+ }
360
+ })
361
+ });
383
362
 
384
- it('should NOT return segments for bidder if enrichUfpd is NOT allowed', () => {
385
- sandbox.stub(activities, 'isActivityAllowed').callsFake((activity, params) => {
386
- return !(activity === ACTIVITY_ENRICH_UFPD && params.component === 'bidder.pubmatic');
363
+ it('should return segments for bidder if transmitUfpd is allowed', () => {
364
+ assert.deepEqual(getCachedTopics(), expected);
365
+ });
366
+
367
+ it('should NOT return segments for bidder if enrichUfpd is NOT allowed', () => {
368
+ sandbox.stub(activities, 'isActivityAllowed').callsFake((activity, params) => {
369
+ return !(activity === ACTIVITY_ENRICH_UFPD && params.component === 'bidder.pubmatic');
370
+ });
371
+ expect(getCachedTopics()).to.eql([]);
387
372
  });
388
- expect(getCachedTopics()).to.eql([]);
389
373
  });
390
- })
374
+ });
391
375
 
392
376
  it('should return empty segments for bidder if there is cached segments stored which is expired', () => {
393
377
  let storedSegments = '[["pubmatic",{"2206021246":{"ext":{"segtax":600,"segclass":"2206021246"},"segment":[{"id":"243"},{"id":"265"}],"name":"ads.pubmatic.com"},"lastUpdated":10}]]';