prebid.js 7.44.0 → 7.46.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 (309) hide show
  1. package/dist/33acrossBidAdapter.js +1 -1
  2. package/dist/33acrossIdSystem.js +1 -1
  3. package/dist/acuityAdsBidAdapter.js +1 -1
  4. package/dist/adagioBidAdapter.js +1 -1
  5. package/dist/adbookpspBidAdapter.js +1 -1
  6. package/dist/adgenerationBidAdapter.js +1 -1
  7. package/dist/admaticBidAdapter.js +1 -1
  8. package/dist/adnuntiusBidAdapter.js +1 -1
  9. package/dist/adrelevantisBidAdapter.js +1 -1
  10. package/dist/adtrgtmeBidAdapter.js +1 -1
  11. package/dist/adxcgBidAdapter.js +1 -1
  12. package/dist/adyoulikeBidAdapter.js +1 -1
  13. package/dist/ajaBidAdapter.js +1 -1
  14. package/dist/amxBidAdapter.js +1 -1
  15. package/dist/amxIdSystem.js +1 -1
  16. package/dist/appierAnalyticsAdapter.js +1 -1
  17. package/dist/appnexusBidAdapter.js +1 -1
  18. package/dist/appushBidAdapter.js +1 -1
  19. package/dist/asoBidAdapter.js +1 -1
  20. package/dist/axonixBidAdapter.js +1 -1
  21. package/dist/beyondmediaBidAdapter.js +1 -1
  22. package/dist/bidglassBidAdapter.js +1 -1
  23. package/dist/bidwatchAnalyticsAdapter.js +1 -1
  24. package/dist/big-richmediaBidAdapter.js +1 -1
  25. package/dist/braveBidAdapter.js +1 -1
  26. package/dist/bridgewellBidAdapter.js +1 -1
  27. package/dist/brightMountainMediaBidAdapter.js +1 -1
  28. package/dist/brightcomBidAdapter.js +1 -1
  29. package/dist/brightcomSSPBidAdapter.js +1 -1
  30. package/dist/carodaBidAdapter.js +1 -1
  31. package/dist/chtnwBidAdapter.js +1 -1
  32. package/dist/coinzillaBidAdapter.js +1 -1
  33. package/dist/compassBidAdapter.js +1 -1
  34. package/dist/concertBidAdapter.js +1 -1
  35. package/dist/connectIdSystem.js +1 -1
  36. package/dist/connectadBidAdapter.js +1 -1
  37. package/dist/consumableBidAdapter.js +1 -1
  38. package/dist/contentexchangeBidAdapter.js +1 -1
  39. package/dist/conversantAnalyticsAdapter.js +1 -1
  40. package/dist/conversantBidAdapter.js +1 -1
  41. package/dist/craftBidAdapter.js +1 -1
  42. package/dist/criteoBidAdapter.js +1 -1
  43. package/dist/cwireBidAdapter.js +1 -1
  44. package/dist/debugging-standalone.js +1 -1
  45. package/dist/dependencies.json +15 -0
  46. package/dist/domainOverrideToRootDomain.js +1 -0
  47. package/dist/dspxBidAdapter.js +1 -1
  48. package/dist/eplanningBidAdapter.js +1 -1
  49. package/dist/eskimiBidAdapter.js +1 -0
  50. package/dist/feedadBidAdapter.js +1 -1
  51. package/dist/finativeBidAdapter.js +1 -1
  52. package/dist/freewheel-sspBidAdapter.js +1 -1
  53. package/dist/glimpseBidAdapter.js +1 -1
  54. package/dist/globalsunBidAdapter.js +1 -1
  55. package/dist/gmosspBidAdapter.js +1 -1
  56. package/dist/goldbachBidAdapter.js +1 -1
  57. package/dist/greenbidsAnalyticsAdapter.js +1 -1
  58. package/dist/gridBidAdapter.js +1 -1
  59. package/dist/growthCodeIdSystem.js +1 -1
  60. package/dist/gumgumBidAdapter.js +1 -1
  61. package/dist/h12mediaBidAdapter.js +1 -1
  62. package/dist/id5IdSystem.js +1 -1
  63. package/dist/improvedigitalBidAdapter.js +1 -1
  64. package/dist/inmarBidAdapter.js +1 -1
  65. package/dist/insticatorBidAdapter.js +1 -1
  66. package/dist/iqzoneBidAdapter.js +1 -1
  67. package/dist/ivsBidAdapter.js +1 -0
  68. package/dist/ixBidAdapter.js +1 -1
  69. package/dist/justpremiumBidAdapter.js +1 -1
  70. package/dist/jwplayerVideoProvider.js +1 -1
  71. package/dist/kargoBidAdapter.js +1 -1
  72. package/dist/koblerBidAdapter.js +1 -1
  73. package/dist/konduitAnalyticsAdapter.js +1 -1
  74. package/dist/kueezBidAdapter.js +1 -1
  75. package/dist/kueezRtbBidAdapter.js +1 -1
  76. package/dist/kulturemediaBidAdapter.js +1 -1
  77. package/dist/lassoBidAdapter.js +1 -1
  78. package/dist/lifestreetBidAdapter.js +1 -1
  79. package/dist/liveIntentIdSystem.js +1 -1
  80. package/dist/liveyieldAnalyticsAdapter.js +1 -1
  81. package/dist/logicadBidAdapter.js +1 -1
  82. package/dist/loglyliftBidAdapter.js +1 -1
  83. package/dist/luponmediaBidAdapter.js +1 -1
  84. package/dist/magniteAnalyticsAdapter.js +1 -1
  85. package/dist/malltvAnalyticsAdapter.js +1 -1
  86. package/dist/marsmediaBidAdapter.js +1 -1
  87. package/dist/mathildeadsBidAdapter.js +1 -1
  88. package/dist/mediafuseBidAdapter.js +1 -1
  89. package/dist/medianetBidAdapter.js +1 -1
  90. package/dist/mediasquareBidAdapter.js +1 -1
  91. package/dist/mgidBidAdapter.js +1 -1
  92. package/dist/minutemediaBidAdapter.js +1 -1
  93. package/dist/minutemediaplusBidAdapter.js +1 -1
  94. package/dist/nativoBidAdapter.js +1 -1
  95. package/dist/neuwoRtdProvider.js +1 -1
  96. package/dist/nexx360BidAdapter.js +1 -1
  97. package/dist/not-for-prod/prebid.js +165 -162
  98. package/dist/oguryBidAdapter.js +1 -1
  99. package/dist/onetagBidAdapter.js +1 -1
  100. package/dist/onomagicBidAdapter.js +1 -1
  101. package/dist/ooloAnalyticsAdapter.js +1 -1
  102. package/dist/openxBidAdapter.js +1 -1
  103. package/dist/openxOrtbBidAdapter.js +1 -1
  104. package/dist/operaadsBidAdapter.js +1 -1
  105. package/dist/optidigitalBidAdapter.js +1 -1
  106. package/dist/ortbConverter.js +1 -1
  107. package/dist/outbrainBidAdapter.js +1 -1
  108. package/dist/pairIdSystem.js +1 -0
  109. package/dist/parrableIdSystem.js +1 -1
  110. package/dist/pixfutureBidAdapter.js +1 -1
  111. package/dist/prebid-core.js +1 -1
  112. package/dist/publinkIdSystem.js +1 -1
  113. package/dist/pubmaticBidAdapter.js +1 -1
  114. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  115. package/dist/pubxBidAdapter.js +1 -1
  116. package/dist/pxyzBidAdapter.js +1 -1
  117. package/dist/quantcastBidAdapter.js +1 -1
  118. package/dist/readpeakBidAdapter.js +1 -1
  119. package/dist/relaidoBidAdapter.js +1 -1
  120. package/dist/rhythmoneBidAdapter.js +1 -1
  121. package/dist/riseBidAdapter.js +1 -1
  122. package/dist/rubiconAnalyticsAdapter.js +1 -1
  123. package/dist/rubiconBidAdapter.js +1 -1
  124. package/dist/seedingAllianceBidAdapter.js +1 -1
  125. package/dist/seedtagBidAdapter.js +1 -1
  126. package/dist/sharedIdSystem.js +1 -1
  127. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  128. package/dist/sharethroughBidAdapter.js +1 -1
  129. package/dist/shinezBidAdapter.js +1 -1
  130. package/dist/smaatoBidAdapter.js +1 -1
  131. package/dist/smartadserverBidAdapter.js +1 -1
  132. package/dist/smarthubBidAdapter.js +1 -1
  133. package/dist/smartxBidAdapter.js +1 -1
  134. package/dist/smilewantedBidAdapter.js +1 -1
  135. package/dist/sonobiBidAdapter.js +1 -1
  136. package/dist/sovrnAnalyticsAdapter.js +1 -1
  137. package/dist/sovrnBidAdapter.js +1 -1
  138. package/dist/sspBCBidAdapter.js +1 -1
  139. package/dist/stvBidAdapter.js +1 -1
  140. package/dist/sublimeBidAdapter.js +1 -1
  141. package/dist/synacormediaBidAdapter.js +1 -1
  142. package/dist/targetVideoBidAdapter.js +1 -1
  143. package/dist/teadsBidAdapter.js +1 -1
  144. package/dist/trionBidAdapter.js +1 -1
  145. package/dist/tripleliftBidAdapter.js +1 -1
  146. package/dist/truereachBidAdapter.js +1 -1
  147. package/dist/ttdBidAdapter.js +1 -1
  148. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  149. package/dist/uid2IdSystem.js +1 -1
  150. package/dist/underdogmediaBidAdapter.js +1 -1
  151. package/dist/undertoneBidAdapter.js +1 -1
  152. package/dist/userId.js +1 -1
  153. package/dist/vidazooBidAdapter.js +1 -1
  154. package/dist/videobyteBidAdapter.js +1 -1
  155. package/dist/videoheroesBidAdapter.js +1 -1
  156. package/dist/vidoomyBidAdapter.js +1 -1
  157. package/dist/visiblemeasuresBidAdapter.js +1 -1
  158. package/dist/visxBidAdapter.js +1 -1
  159. package/dist/vrtcalBidAdapter.js +1 -1
  160. package/dist/vuukleBidAdapter.js +1 -1
  161. package/dist/widespaceBidAdapter.js +1 -1
  162. package/dist/winrBidAdapter.js +1 -1
  163. package/dist/yahoosspBidAdapter.js +1 -1
  164. package/dist/yieldmoBidAdapter.js +1 -1
  165. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  166. package/dist/yieldoneBidAdapter.js +1 -1
  167. package/integrationExamples/gpt/fledge_example.html +103 -0
  168. package/integrationExamples/gpt/prebidServer_fledge_example.html +111 -0
  169. package/libraries/domainOverrideToRootDomain/index.js +39 -0
  170. package/libraries/ortbConverter/processors/video.js +1 -0
  171. package/modules/acuityAdsBidAdapter.js +1 -1
  172. package/modules/admaticBidAdapter.js +7 -2
  173. package/modules/adnuntiusBidAdapter.js +3 -1
  174. package/modules/amxBidAdapter.js +1 -1
  175. package/modules/amxIdSystem.js +23 -20
  176. package/modules/amxIdSystem.md +7 -7
  177. package/modules/appnexusBidAdapter.js +108 -102
  178. package/modules/appushBidAdapter.js +1 -1
  179. package/modules/beyondmediaBidAdapter.js +1 -1
  180. package/modules/bidwatchAnalyticsAdapter.js +2 -0
  181. package/modules/braveBidAdapter.js +1 -1
  182. package/modules/brightcomBidAdapter.js +1 -1
  183. package/modules/brightcomSSPBidAdapter.js +1 -1
  184. package/modules/coinzillaBidAdapter.js +1 -2
  185. package/modules/compassBidAdapter.js +1 -1
  186. package/modules/connectIdSystem.js +96 -21
  187. package/modules/connectIdSystem.md +6 -5
  188. package/modules/contentexchangeBidAdapter.js +1 -1
  189. package/modules/conversantBidAdapter.js +3 -0
  190. package/modules/criteoBidAdapter.js +5 -1
  191. package/modules/eskimiBidAdapter.js +72 -0
  192. package/modules/eskimiBidAdapter.md +34 -0
  193. package/modules/freewheel-sspBidAdapter.js +8 -0
  194. package/modules/glimpseBidAdapter.js +1 -2
  195. package/modules/globalsunBidAdapter.js +1 -1
  196. package/modules/gridBidAdapter.js +43 -20
  197. package/modules/growthCodeIdSystem.js +18 -15
  198. package/modules/gumgumBidAdapter.js +1 -1
  199. package/modules/iqzoneBidAdapter.js +1 -1
  200. package/modules/ivsBidAdapter.js +85 -0
  201. package/modules/ivsBidAdapter.md +34 -0
  202. package/modules/ixBidAdapter.js +72 -105
  203. package/modules/jwplayerVideoProvider.js +25 -32
  204. package/modules/kargoBidAdapter.js +473 -246
  205. package/modules/koblerBidAdapter.js +1 -2
  206. package/modules/kueezBidAdapter.js +1 -1
  207. package/modules/kueezRtbBidAdapter.js +16 -4
  208. package/modules/liveIntentIdSystem.js +8 -0
  209. package/modules/luponmediaBidAdapter.js +1 -1
  210. package/modules/magniteAnalyticsAdapter.js +76 -3
  211. package/modules/mathildeadsBidAdapter.js +1 -1
  212. package/modules/medianetBidAdapter.js +1 -1
  213. package/modules/mediasquareBidAdapter.js +2 -1
  214. package/modules/mgidBidAdapter.js +178 -26
  215. package/modules/minutemediaBidAdapter.js +1 -1
  216. package/modules/minutemediaplusBidAdapter.js +16 -4
  217. package/modules/nativoBidAdapter.js +110 -21
  218. package/modules/neuwoRtdProvider.js +0 -2
  219. package/modules/oguryBidAdapter.js +3 -2
  220. package/modules/onomagicBidAdapter.js +1 -2
  221. package/modules/openxBidAdapter.js +192 -563
  222. package/modules/openxBidAdapter.md +22 -20
  223. package/modules/openxOrtbBidAdapter.js +13 -11
  224. package/modules/openxOrtbBidAdapter.md +5 -3
  225. package/modules/operaadsBidAdapter.js +1 -1
  226. package/modules/pairIdSystem.js +79 -0
  227. package/modules/pubmaticBidAdapter.js +13 -10
  228. package/modules/pubxBidAdapter.js +5 -2
  229. package/modules/riseBidAdapter.js +1 -1
  230. package/modules/sharedIdSystem.js +4 -27
  231. package/modules/sharethroughBidAdapter.js +1 -1
  232. package/modules/shinezBidAdapter.js +1 -1
  233. package/modules/smarthubBidAdapter.js +1 -1
  234. package/modules/synacormediaBidAdapter.js +1 -3
  235. package/modules/truereachBidAdapter.js +1 -2
  236. package/modules/userId/eids.js +24 -0
  237. package/modules/userId/eids.md +16 -0
  238. package/modules/videoheroesBidAdapter.js +1 -1
  239. package/modules/vidoomyBidAdapter.js +33 -4
  240. package/modules/visiblemeasuresBidAdapter.js +1 -1
  241. package/modules/vrtcalBidAdapter.js +1 -1
  242. package/modules/yieldmoBidAdapter.js +15 -5
  243. package/modules/yieldoneBidAdapter.js +1 -1
  244. package/package.json +1 -1
  245. package/src/Renderer.js +2 -1
  246. package/src/config.js +78 -127
  247. package/src/native.js +5 -1
  248. package/test/spec/auctionmanager_spec.js +2 -2
  249. package/test/spec/libraries/domainOverrideToRootDomain/index_spec.js +77 -0
  250. package/test/spec/modules/1plusXRtdProvider_spec.js +8 -7
  251. package/test/spec/modules/acuityAdsBidAdapter_spec.js +2 -1
  252. package/test/spec/modules/adagioBidAdapter_spec.js +0 -25
  253. package/test/spec/modules/admaticBidAdapter_spec.js +1 -1
  254. package/test/spec/modules/adnuntiusBidAdapter_spec.js +2 -1
  255. package/test/spec/modules/amxIdSystem_spec.js +13 -26
  256. package/test/spec/modules/appnexusBidAdapter_spec.js +464 -448
  257. package/test/spec/modules/appushBidAdapter_spec.js +2 -1
  258. package/test/spec/modules/axonixBidAdapter_spec.js +0 -27
  259. package/test/spec/modules/beyondmediaBidAdapter_spec.js +2 -1
  260. package/test/spec/modules/big-richmediaBidAdapter_spec.js +68 -64
  261. package/test/spec/modules/compassBidAdapter_spec.js +2 -1
  262. package/test/spec/modules/connectIdSystem_spec.js +420 -242
  263. package/test/spec/modules/contentexchangeBidAdapter_spec.js +2 -1
  264. package/test/spec/modules/conversantBidAdapter_spec.js +1 -0
  265. package/test/spec/modules/criteoBidAdapter_spec.js +33 -1
  266. package/test/spec/modules/eids_spec.js +30 -0
  267. package/test/spec/modules/eskimiBidAdapter_spec.js +155 -0
  268. package/test/spec/modules/freewheel-sspBidAdapter_spec.js +37 -0
  269. package/test/spec/modules/globalsunBidAdapter_spec.js +2 -1
  270. package/test/spec/modules/gridBidAdapter_spec.js +8 -0
  271. package/test/spec/modules/iqzoneBidAdapter_spec.js +2 -1
  272. package/test/spec/modules/ivsBidAdapter_spec.js +197 -0
  273. package/test/spec/modules/ixBidAdapter_spec.js +141 -71
  274. package/test/spec/modules/kargoBidAdapter_spec.js +297 -140
  275. package/test/spec/modules/koblerBidAdapter_spec.js +0 -20
  276. package/test/spec/modules/kueezRtbBidAdapter_spec.js +22 -2
  277. package/test/spec/modules/liveIntentIdSystem_spec.js +10 -0
  278. package/test/spec/modules/luponmediaBidAdapter_spec.js +1 -1
  279. package/test/spec/modules/magniteAnalyticsAdapter_spec.js +129 -1
  280. package/test/spec/modules/mathildeadsBidAdapter_spec.js +2 -1
  281. package/test/spec/modules/mgidBidAdapter_spec.js +184 -36
  282. package/test/spec/modules/minutemediaplusBidAdapter_spec.js +22 -2
  283. package/test/spec/modules/nativoBidAdapter_spec.js +101 -0
  284. package/test/spec/modules/neuwoRtdProvider_spec.js +0 -1
  285. package/test/spec/modules/oguryBidAdapter_spec.js +19 -4
  286. package/test/spec/modules/ooloAnalyticsAdapter_spec.js +1 -1
  287. package/test/spec/modules/openxBidAdapter_spec.js +1157 -1936
  288. package/test/spec/modules/openxOrtbBidAdapter_spec.js +12 -39
  289. package/test/spec/modules/pairIdSystem_spec.js +68 -0
  290. package/test/spec/modules/pubCommonId_spec.js +0 -17
  291. package/test/spec/modules/pubmaticBidAdapter_spec.js +868 -867
  292. package/test/spec/modules/pubxBidAdapter_spec.js +10 -2
  293. package/test/spec/modules/realvuAnalyticsAdapter_spec.js +0 -5
  294. package/test/spec/modules/sharedIdSystem_spec.js +0 -46
  295. package/test/spec/modules/sharethroughBidAdapter_spec.js +2 -1
  296. package/test/spec/modules/smarthubBidAdapter_spec.js +2 -1
  297. package/test/spec/modules/synacormediaBidAdapter_spec.js +0 -26
  298. package/test/spec/modules/videoModule/submodules/jwplayerVideoProvider_spec.js +17 -4
  299. package/test/spec/modules/vidoomyBidAdapter_spec.js +58 -0
  300. package/test/spec/modules/visiblemeasuresBidAdapter_spec.js +2 -1
  301. package/test/spec/modules/vrtcalBidAdapter_spec.js +3 -2
  302. package/test/spec/modules/yieldmoBidAdapter_spec.js +19 -1
  303. package/test/spec/renderer_spec.js +1 -2
  304. package/test/spec/unit/pbjs_api_spec.js +19 -3
  305. package/test/test_index.js +13 -3
  306. package/dist/gridNMBidAdapter.js +0 -1
  307. package/modules/gridNMBidAdapter.js +0 -422
  308. package/modules/gridNMBidAdapter.md +0 -39
  309. package/test/spec/modules/gridNMBidAdapter_spec.js +0 -636
@@ -1,636 +0,0 @@
1
- import { expect } from 'chai';
2
- import { spec, resetUserSync, getSyncUrl } from 'modules/gridNMBidAdapter.js';
3
- import { newBidder } from 'src/adapters/bidderFactory.js';
4
-
5
- describe('TheMediaGridNM Adapter', function () {
6
- const adapter = newBidder(spec);
7
-
8
- describe('inherited functions', function () {
9
- it('exists and is a function', function () {
10
- expect(adapter.callBids).to.exist.and.to.be.a('function');
11
- });
12
- });
13
-
14
- describe('isBidRequestValid', function () {
15
- let bid = {
16
- 'bidder': 'gridNM',
17
- 'params': {
18
- 'source': 'jwp',
19
- 'secid': '11',
20
- 'pubid': '22',
21
- 'video': {
22
- 'mimes': ['video/mp4', 'video/x-ms-wmv'],
23
- 'protocols': [1, 2, 3, 4, 5, 6]
24
- }
25
- },
26
- 'adUnitCode': 'adunit-code',
27
- 'sizes': [[300, 250], [300, 600]],
28
- 'bidId': '30b31c1838de1e',
29
- 'bidderRequestId': '22edbae2733bf6',
30
- 'auctionId': '1d1a030790a475',
31
- };
32
-
33
- it('should return true when required params found', function () {
34
- expect(spec.isBidRequestValid(bid)).to.equal(true);
35
- });
36
-
37
- it('should return false when required params are not passed', function () {
38
- const paramsList = [
39
- {
40
- 'source': 'jwp',
41
- 'secid': '11',
42
- 'pubid': '22',
43
- 'video': {
44
- 'protocols': [1, 2, 3, 4, 5, 6]
45
- }
46
- },
47
- {
48
- 'source': 'jwp',
49
- 'secid': '11',
50
- 'pubid': '22',
51
- 'video': {
52
- 'mimes': ['video/mp4', 'video/x-ms-wmv'],
53
- }
54
- },
55
- {
56
- 'secid': '11',
57
- 'pubid': '22',
58
- 'video': {
59
- 'mimes': ['video/mp4', 'video/x-ms-wmv'],
60
- 'protocols': [1, 2, 3, 4, 5, 6]
61
- }
62
- },
63
- {
64
- 'source': 'jwp',
65
- 'pubid': '22',
66
- 'video': {
67
- 'mimes': ['video/mp4', 'video/x-ms-wmv'],
68
- 'protocols': [1, 2, 3, 4, 5, 6]
69
- }
70
- },
71
- {
72
- 'source': 'jwp',
73
- 'secid': '11',
74
- 'video': {
75
- 'mimes': ['video/mp4', 'video/x-ms-wmv'],
76
- 'protocols': [1, 2, 3, 4, 5, 6]
77
- }
78
- }
79
- ];
80
- paramsList.forEach((params) => {
81
- const invalidBid = Object.assign({}, bid);
82
- delete invalidBid.params;
83
- invalidBid.params = params;
84
- expect(spec.isBidRequestValid(invalidBid)).to.equal(false);
85
- });
86
- });
87
-
88
- it('should return false when required params has invalid values', function () {
89
- const paramsList = [
90
- {
91
- 'source': 'jwp',
92
- 'secid': '11',
93
- 'pubid': '22',
94
- 'video': {
95
- 'mimes': ['video/mp4', 'video/x-ms-wmv'],
96
- 'protocols': '1,2,3,4,5'
97
- }
98
- },
99
- {
100
- 'source': 'jwp',
101
- 'secid': '11',
102
- 'pubid': '22',
103
- 'video': {
104
- 'mimes': [1, 2],
105
- 'protocols': [1, 2, 3, 4, 5]
106
- }
107
- },
108
- {
109
- 'source': 'jwp',
110
- 'secid': 11,
111
- 'pubid': '22',
112
- 'video': {
113
- 'mimes': ['video/mp4', 'video/x-ms-wmv'],
114
- 'protocols': [1, 2, 3, 4, 5]
115
- }
116
- },
117
- {
118
- 'source': 111,
119
- 'secid': '11',
120
- 'pubid': '22',
121
- 'video': {
122
- 'mimes': ['video/mp4', 'video/x-ms-wmv'],
123
- 'protocols': [1, 2, 3, 4, 5]
124
- }
125
- }
126
- ];
127
-
128
- paramsList.forEach((params) => {
129
- const invalidBid = Object.assign({}, bid);
130
- delete invalidBid.params;
131
- invalidBid.params = params;
132
- expect(spec.isBidRequestValid(invalidBid)).to.equal(false);
133
- });
134
- });
135
-
136
- it('should return true when required params is absent, but available in mediaTypes', function () {
137
- const paramsList = [
138
- {
139
- 'source': 'jwp',
140
- 'secid': '11',
141
- 'pubid': '22',
142
- 'video': {
143
- 'protocols': [1, 2, 3, 4, 5, 6]
144
- }
145
- },
146
- {
147
- 'source': 'jwp',
148
- 'secid': '11',
149
- 'pubid': '22',
150
- 'video': {
151
- 'mimes': ['video/mp4', 'video/x-ms-wmv'],
152
- }
153
- }
154
- ];
155
-
156
- const mediaTypes = {
157
- video: {
158
- mimes: ['video/mp4', 'video/x-ms-wmv'],
159
- playerSize: [200, 300],
160
- protocols: [1, 2, 3, 4, 5, 6]
161
- }
162
- };
163
-
164
- paramsList.forEach((params) => {
165
- const validBid = Object.assign({}, bid);
166
- delete validBid.params;
167
- validBid.params = params;
168
- validBid.mediaTypes = mediaTypes;
169
- expect(spec.isBidRequestValid(validBid)).to.equal(true);
170
- });
171
- });
172
- });
173
-
174
- describe('buildRequests', function () {
175
- function parseRequestUrl(url) {
176
- const res = {};
177
- url.replace(/^[^\?]+\?/, '').split('&').forEach((it) => {
178
- const couple = it.split('=');
179
- res[couple[0]] = decodeURIComponent(couple[1]);
180
- });
181
- return res;
182
- }
183
- const bidderRequest = {
184
- bidderRequestId: '22edbae2733bf6',
185
- auctionId: '1d1a030790a475',
186
- timeout: 3000,
187
- refererInfo: { page: 'https://example.com' }
188
- };
189
- const referrer = encodeURIComponent(bidderRequest.refererInfo.page);
190
- let bidRequests = [
191
- {
192
- 'bidder': 'gridNM',
193
- 'params': {
194
- 'source': 'jwp',
195
- 'floorcpm': 2,
196
- 'secid': '11',
197
- 'pubid': '22',
198
- 'video': {
199
- 'mimes': ['video/mp4', 'video/x-ms-wmv'],
200
- 'protocols': [1, 2, 3, 4, 5, 6]
201
- }
202
- },
203
- 'adUnitCode': 'adunit-code-1',
204
- 'sizes': [[300, 250], [300, 600]],
205
- 'bidId': '30b31c1838de1e',
206
- 'bidderRequestId': '22edbae2733bf6',
207
- 'auctionId': '1d1a030790a475',
208
- },
209
- {
210
- 'bidder': 'gridNM',
211
- 'params': {
212
- 'source': 'jwp',
213
- 'secid': '11',
214
- 'pubid': '22',
215
- 'video': {
216
- 'mimes': ['video/mp4'],
217
- 'protocols': [1, 2, 3],
218
- 'skip': 1
219
- }
220
- },
221
- 'adUnitCode': 'adunit-code-2',
222
- 'sizes': [[728, 90]],
223
- 'bidId': '3150ccb55da321',
224
- 'bidderRequestId': '22edbae2733bf6',
225
- 'auctionId': '1d1a030790a475',
226
- }
227
- ];
228
-
229
- it('if content and segment is present in jwTargeting, payload must have right params', function () {
230
- const jsContent = {id: 'test_jw_content_id'};
231
- const jsSegments = ['test_seg_1', 'test_seg_2'];
232
- const bidRequestsWithJwTargeting = bidRequests.map((bid) => {
233
- return Object.assign({
234
- rtd: {
235
- jwplayer: {
236
- targeting: {
237
- segments: jsSegments,
238
- content: jsContent
239
- }
240
- }
241
- }
242
- }, bid);
243
- });
244
- const requests = spec.buildRequests(bidRequestsWithJwTargeting, bidderRequest);
245
- requests.forEach((req, i) => {
246
- const payload = req.data;
247
- expect(req).to.have.property('data');
248
- expect(payload).to.have.property('site');
249
- expect(payload.site.content).to.deep.equal(jsContent);
250
- });
251
- });
252
-
253
- it('should attach valid params to the tag', function () {
254
- const requests = spec.buildRequests(bidRequests, bidderRequest);
255
- const requestsSizes = ['300x250,300x600', '728x90'];
256
- requests.forEach((req, i) => {
257
- expect(req.url).to.be.an('string');
258
- const payload = parseRequestUrl(req.url);
259
- expect(payload).to.have.property('no_mapping', '1');
260
- expect(payload).to.have.property('sp', 'jwp');
261
-
262
- const sizes = { w: bidRequests[i].sizes[0][0], h: bidRequests[i].sizes[0][1] };
263
- const impObj = {
264
- 'id': bidRequests[i].bidId,
265
- 'tagid': bidRequests[i].params.secid,
266
- 'ext': {'divid': bidRequests[i].adUnitCode},
267
- 'video': Object.assign(sizes, bidRequests[i].params.video)
268
- };
269
-
270
- if (bidRequests[i].params.floorcpm) {
271
- impObj.bidfloor = bidRequests[i].params.floorcpm;
272
- }
273
-
274
- expect(req.data).to.deep.equal({
275
- 'id': bidderRequest.bidderRequestId,
276
- 'site': {
277
- 'page': referrer,
278
- 'publisher': {
279
- 'id': bidRequests[i].params.pubid
280
- }
281
- },
282
- 'tmax': bidderRequest.timeout,
283
- 'source': {
284
- 'tid': bidderRequest.auctionId,
285
- 'ext': {'wrapper': 'Prebid_js', 'wrapper_version': '$prebid.version$'}
286
- },
287
- 'imp': [impObj]
288
- });
289
- });
290
- });
291
-
292
- it('should attach valid params from mediaTypes', function () {
293
- const mediaTypes = {
294
- video: {
295
- skipafter: 10,
296
- minduration: 10,
297
- maxduration: 100,
298
- protocols: [1, 3, 4],
299
- playerSize: [[300, 250]]
300
- }
301
- };
302
- const bidRequest = Object.assign({ mediaTypes }, bidRequests[0]);
303
- const req = spec.buildRequests([bidRequest], bidderRequest)[0];
304
- const expectedVideo = {
305
- 'skipafter': 10,
306
- 'minduration': 10,
307
- 'maxduration': 100,
308
- 'mimes': ['video/mp4', 'video/x-ms-wmv'],
309
- 'protocols': [1, 2, 3, 4, 5, 6],
310
- 'w': 300,
311
- 'h': 250
312
- };
313
-
314
- expect(req.url).to.be.an('string');
315
- const payload = parseRequestUrl(req.url);
316
- expect(payload).to.have.property('no_mapping', '1');
317
- expect(payload).to.have.property('sp', 'jwp');
318
- expect(req.data).to.deep.equal({
319
- 'id': bidderRequest.bidderRequestId,
320
- 'site': {
321
- 'page': referrer,
322
- 'publisher': {
323
- 'id': bidRequest.params.pubid
324
- }
325
- },
326
- 'tmax': bidderRequest.timeout,
327
- 'source': {
328
- 'tid': bidderRequest.auctionId,
329
- 'ext': {'wrapper': 'Prebid_js', 'wrapper_version': '$prebid.version$'}
330
- },
331
- 'imp': [{
332
- 'id': bidRequest.bidId,
333
- 'bidfloor': bidRequest.params.floorcpm,
334
- 'tagid': bidRequest.params.secid,
335
- 'ext': {'divid': bidRequest.adUnitCode},
336
- 'video': expectedVideo
337
- }]
338
- });
339
- });
340
-
341
- it('if gdprConsent is present payload must have gdpr params', function () {
342
- const gdprBidderRequest = Object.assign({gdprConsent: {consentString: 'AAA', gdprApplies: true}}, bidderRequest);
343
- const request = spec.buildRequests([bidRequests[0]], gdprBidderRequest)[0];
344
- const payload = request.data;
345
- expect(request).to.have.property('data');
346
- expect(payload).to.have.property('user');
347
- expect(payload.user).to.have.property('ext');
348
- expect(payload.user.ext).to.have.property('consent', 'AAA');
349
- expect(payload).to.have.property('regs');
350
- expect(payload.regs).to.have.property('ext');
351
- expect(payload.regs.ext).to.have.property('gdpr', 1);
352
- });
353
-
354
- it('if usPrivacy is present payload must have us_privacy param', function () {
355
- const bidderRequestWithUSP = Object.assign({uspConsent: '1YNN'}, bidderRequest);
356
- const request = spec.buildRequests([bidRequests[0]], bidderRequestWithUSP)[0];
357
- const payload = request.data;
358
- expect(payload).to.have.property('regs');
359
- expect(payload.regs).to.have.property('ext');
360
- expect(payload.regs.ext).to.have.property('us_privacy', '1YNN');
361
- });
362
- });
363
-
364
- describe('interpretResponse', function () {
365
- const responses = [
366
- {'bid': [{'price': 1.15, 'adm': '<VAST version=\"3.0\">\n<Ad id=\"21341234\"><\/Ad>\n<\/VAST>', 'content_type': 'video', 'h': 250, 'w': 300, 'dealid': 11}], 'seat': '2'},
367
- {'bid': [{'price': 0.5, 'adm': '<VAST version=\"3.0\">\n<Ad id=\"21341235\"><\/Ad>\n<\/VAST>', 'content_type': 'video', 'h': 600, 'w': 300, adomain: ['my_domain.ru']}], 'seat': '2'},
368
- {'bid': [{'price': 2.00, 'nurl': 'https://some_test_vast_url.com', 'content_type': 'video', 'adomain': ['example.com'], 'w': 300, 'h': 600}], 'seat': '2'},
369
- {'bid': [{'price': 0, 'h': 250, 'w': 300}], 'seat': '2'},
370
- {'bid': [{'price': 0, 'adm': '<VAST version=\"3.0\">\n<Ad id=\"21341237\"><\/Ad>\n<\/VAST>', 'h': 250, 'w': 300}], 'seat': '2'},
371
- undefined,
372
- {'bid': [], 'seat': '2'},
373
- {'seat': '2'},
374
- ];
375
-
376
- it('should get correct video bid response', function () {
377
- const bidRequests = [
378
- {
379
- 'bidder': 'gridNM',
380
- 'params': {
381
- 'source': 'jwp',
382
- 'secid': '11',
383
- 'pubid': '22',
384
- 'video': {
385
- 'mimes': ['video/mp4', 'video/x-ms-wmv'],
386
- 'protocols': [1, 2, 3, 4, 5, 6]
387
- }
388
- },
389
- 'adUnitCode': 'adunit-code-1',
390
- 'sizes': [[300, 250], [300, 600]],
391
- 'bidId': '659423fff799cb',
392
- 'bidderRequestId': '5f2009617a7c0a',
393
- 'auctionId': '1cbd2feafe5e8b',
394
- 'mediaTypes': {
395
- 'video': {
396
- 'context': 'instream'
397
- }
398
- }
399
- },
400
- {
401
- 'bidder': 'gridNM',
402
- 'params': {
403
- 'source': 'jwp',
404
- 'secid': '11',
405
- 'pubid': '22',
406
- 'video': {
407
- 'mimes': ['video/mp4'],
408
- 'protocols': [1, 2, 3, 4, 5],
409
- 'skip': 1
410
- }
411
- },
412
- 'adUnitCode': 'adunit-code-1',
413
- 'sizes': [[300, 250], [300, 600]],
414
- 'bidId': '2bc598e42b6a',
415
- 'bidderRequestId': '1e8b5a465f404',
416
- 'auctionId': '1cbd2feafe5e8b',
417
- 'mediaTypes': {
418
- 'video': {
419
- 'context': 'instream'
420
- }
421
- }
422
- },
423
- {
424
- 'bidder': 'gridNM',
425
- 'params': {
426
- 'source': 'jwp',
427
- 'secid': '11',
428
- 'pubid': '22',
429
- 'video': {
430
- 'mimes': ['video/mp4'],
431
- 'protocols': [1, 2, 3],
432
- }
433
- },
434
- 'adUnitCode': 'adunit-code-1',
435
- 'sizes': [[300, 250], [300, 600]],
436
- 'bidId': '127f4b12a432c',
437
- 'bidderRequestId': 'a75bc868f32',
438
- 'auctionId': '1cbd2feafe5e8b',
439
- 'mediaTypes': {
440
- 'video': {
441
- 'context': 'instream'
442
- }
443
- }
444
- }
445
- ];
446
- const requests = spec.buildRequests(bidRequests);
447
- const expectedResponse = [
448
- {
449
- 'requestId': '659423fff799cb',
450
- 'cpm': 1.15,
451
- 'creativeId': '5f2009617a7c0a',
452
- 'dealId': 11,
453
- 'width': 300,
454
- 'height': 250,
455
- 'currency': 'USD',
456
- 'mediaType': 'video',
457
- 'netRevenue': true,
458
- 'ttl': 360,
459
- 'vastXml': '<VAST version=\"3.0\">\n<Ad id=\"21341234\"><\/Ad>\n<\/VAST>',
460
- 'meta': {
461
- 'advertiserDomains': []
462
- },
463
- 'adResponse': {
464
- 'content': '<VAST version=\"3.0\">\n<Ad id=\"21341234\"><\/Ad>\n<\/VAST>'
465
- }
466
- },
467
- {
468
- 'requestId': '2bc598e42b6a',
469
- 'cpm': 0.5,
470
- 'creativeId': '1e8b5a465f404',
471
- 'dealId': undefined,
472
- 'width': 300,
473
- 'height': 600,
474
- 'currency': 'USD',
475
- 'mediaType': 'video',
476
- 'netRevenue': true,
477
- 'ttl': 360,
478
- 'vastXml': '<VAST version=\"3.0\">\n<Ad id=\"21341235\"><\/Ad>\n<\/VAST>',
479
- 'meta': {
480
- 'advertiserDomains': ['my_domain.ru']
481
- },
482
- 'adResponse': {
483
- 'content': '<VAST version=\"3.0\">\n<Ad id=\"21341235\"><\/Ad>\n<\/VAST>'
484
- }
485
- },
486
- {
487
- 'requestId': '127f4b12a432c',
488
- 'cpm': 2.00,
489
- 'creativeId': 'a75bc868f32',
490
- 'dealId': undefined,
491
- 'width': 300,
492
- 'height': 600,
493
- 'currency': 'USD',
494
- 'mediaType': 'video',
495
- 'netRevenue': true,
496
- 'ttl': 360,
497
- 'meta': {
498
- advertiserDomains: ['example.com']
499
- },
500
- 'vastUrl': 'https://some_test_vast_url.com',
501
- }
502
- ];
503
-
504
- requests.forEach((req, i) => {
505
- const result = spec.interpretResponse({'body': {'seatbid': [responses[i]]}}, req);
506
- expect(result[0]).to.deep.equal(expectedResponse[i]);
507
- });
508
- });
509
-
510
- it('handles wrong and nobid responses', function () {
511
- responses.slice(3).forEach((resp) => {
512
- const request = spec.buildRequests([{
513
- 'bidder': 'gridNM',
514
- 'params': {
515
- 'source': 'jwp',
516
- 'secid': '11',
517
- 'pubid': '22',
518
- 'video': {
519
- 'mimes': ['video/mp4'],
520
- 'protocols': [1, 2, 3, 4, 5],
521
- 'skip': 1
522
- }
523
- },
524
- 'adUnitCode': 'adunit-code-1',
525
- 'sizes': [[300, 250], [300, 600]],
526
- 'bidId': '2bc598e42b6a',
527
- 'bidderRequestId': '39d74f5b71464',
528
- 'auctionId': '1cbd2feafe5e8b',
529
- 'meta': {
530
- 'advertiserDomains': []
531
- },
532
- 'mediaTypes': {
533
- 'video': {
534
- 'context': 'instream'
535
- }
536
- }
537
- }]);
538
- const result = spec.interpretResponse({'body': {'seatbid': [resp]}}, request[0]);
539
- expect(result.length).to.equal(0);
540
- });
541
- });
542
- });
543
-
544
- describe('user sync', function () {
545
- const syncUrl = getSyncUrl();
546
-
547
- beforeEach(function () {
548
- resetUserSync();
549
- });
550
-
551
- it('should register the Emily iframe', function () {
552
- let syncs = spec.getUserSyncs({
553
- pixelEnabled: true
554
- });
555
-
556
- expect(syncs).to.deep.equal({type: 'image', url: syncUrl});
557
- });
558
-
559
- it('should not register the Emily iframe more than once', function () {
560
- let syncs = spec.getUserSyncs({
561
- pixelEnabled: true
562
- });
563
- expect(syncs).to.deep.equal({type: 'image', url: syncUrl});
564
-
565
- // when called again, should still have only been called once
566
- syncs = spec.getUserSyncs();
567
- expect(syncs).to.equal(undefined);
568
- });
569
-
570
- it('should pass gdpr params if consent is true', function () {
571
- expect(spec.getUserSyncs({ pixelEnabled: true }, {}, {
572
- gdprApplies: true, consentString: 'foo'
573
- })).to.deep.equal({
574
- type: 'image', url: `${syncUrl}&gdpr=1&gdpr_consent=foo`
575
- });
576
- });
577
-
578
- it('should pass gdpr params if consent is false', function () {
579
- expect(spec.getUserSyncs({ pixelEnabled: true }, {}, {
580
- gdprApplies: false, consentString: 'foo'
581
- })).to.deep.equal({
582
- type: 'image', url: `${syncUrl}&gdpr=0&gdpr_consent=foo`
583
- });
584
- });
585
-
586
- it('should pass gdpr param gdpr_consent only when gdprApplies is undefined', function () {
587
- expect(spec.getUserSyncs({ pixelEnabled: true }, {}, {
588
- consentString: 'foo'
589
- })).to.deep.equal({
590
- type: 'image', url: `${syncUrl}&gdpr_consent=foo`
591
- });
592
- });
593
-
594
- it('should pass no params if gdpr consentString is not defined', function () {
595
- expect(spec.getUserSyncs({ pixelEnabled: true }, {}, {})).to.deep.equal({
596
- type: 'image', url: syncUrl
597
- });
598
- });
599
-
600
- it('should pass no params if gdpr consentString is a number', function () {
601
- expect(spec.getUserSyncs({ pixelEnabled: true }, {}, {
602
- consentString: 0
603
- })).to.deep.equal({
604
- type: 'image', url: syncUrl
605
- });
606
- });
607
-
608
- it('should pass no params if gdpr consentString is null', function () {
609
- expect(spec.getUserSyncs({ pixelEnabled: true }, {}, {
610
- consentString: null
611
- })).to.deep.equal({
612
- type: 'image', url: syncUrl
613
- });
614
- });
615
-
616
- it('should pass no params if gdpr consentString is a object', function () {
617
- expect(spec.getUserSyncs({ pixelEnabled: true }, {}, {
618
- consentString: {}
619
- })).to.deep.equal({
620
- type: 'image', url: syncUrl
621
- });
622
- });
623
-
624
- it('should pass no params if gdpr is not defined', function () {
625
- expect(spec.getUserSyncs({ pixelEnabled: true }, {}, undefined)).to.deep.equal({
626
- type: 'image', url: syncUrl
627
- });
628
- });
629
-
630
- it('should pass usPrivacy param if it is available', function() {
631
- expect(spec.getUserSyncs({ pixelEnabled: true }, {}, {}, '1YNN')).to.deep.equal({
632
- type: 'image', url: `${syncUrl}&us_privacy=1YNN`
633
- });
634
- });
635
- });
636
- });