prebid.js 8.4.0 → 8.6.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 (332) hide show
  1. package/dist/33acrossBidAdapter.js +1 -1
  2. package/dist/33acrossIdSystem.js +1 -1
  3. package/dist/a1MediaRtdProvider.js +1 -0
  4. package/dist/adagioBidAdapter.js +1 -1
  5. package/dist/adbookpspBidAdapter.js +1 -1
  6. package/dist/adfBidAdapter.js +1 -1
  7. package/dist/adgenerationBidAdapter.js +1 -1
  8. package/dist/adkernelAdnBidAdapter.js +1 -1
  9. package/dist/adkernelBidAdapter.js +1 -1
  10. package/dist/admixerIdSystem.js +1 -1
  11. package/dist/adnuntiusBidAdapter.js +1 -1
  12. package/dist/adqueryBidAdapter.js +1 -1
  13. package/dist/adqueryIdSystem.js +1 -1
  14. package/dist/adrelevantisBidAdapter.js +1 -1
  15. package/dist/adsinteractiveBidAdapter.js +1 -1
  16. package/dist/adtelligentIdSystem.js +1 -1
  17. package/dist/adtrgtmeBidAdapter.js +1 -1
  18. package/dist/adxcgBidAdapter.js +1 -1
  19. package/dist/adyoulikeBidAdapter.js +1 -1
  20. package/dist/ajaBidAdapter.js +1 -1
  21. package/dist/amxBidAdapter.js +1 -1
  22. package/dist/amxIdSystem.js +1 -1
  23. package/dist/appierAnalyticsAdapter.js +1 -1
  24. package/dist/appnexusBidAdapter.js +1 -1
  25. package/dist/asoBidAdapter.js +1 -1
  26. package/dist/axonixBidAdapter.js +1 -1
  27. package/dist/beachfrontBidAdapter.js +1 -1
  28. package/dist/bidglassBidAdapter.js +1 -1
  29. package/dist/big-richmediaBidAdapter.js +1 -1
  30. package/dist/bridBidAdapter.js +1 -1
  31. package/dist/bridgewellBidAdapter.js +1 -1
  32. package/dist/brightMountainMediaBidAdapter.js +1 -1
  33. package/dist/britepoolIdSystem.js +1 -1
  34. package/dist/carodaBidAdapter.js +1 -1
  35. package/dist/chtnwBidAdapter.js +1 -1
  36. package/dist/concertBidAdapter.js +1 -1
  37. package/dist/connectIdSystem.js +1 -1
  38. package/dist/connectadBidAdapter.js +1 -1
  39. package/dist/consentManagementGpp.js +1 -1
  40. package/dist/consumableBidAdapter.js +1 -1
  41. package/dist/conversantAnalyticsAdapter.js +1 -1
  42. package/dist/conversantBidAdapter.js +1 -1
  43. package/dist/craftBidAdapter.js +1 -1
  44. package/dist/criteoBidAdapter.js +1 -1
  45. package/dist/criteoIdSystem.js +1 -1
  46. package/dist/cwireBidAdapter.js +1 -1
  47. package/dist/czechAdIdSystem.js +1 -1
  48. package/dist/dacIdSystem.js +1 -1
  49. package/dist/deepintentDpesIdSystem.js +1 -1
  50. package/dist/dependencies.json +6 -0
  51. package/dist/dmdIdSystem.js +1 -1
  52. package/dist/dspxBidAdapter.js +1 -1
  53. package/dist/eplanningBidAdapter.js +1 -1
  54. package/dist/euidIdSystem.js +1 -1
  55. package/dist/fabrickIdSystem.js +1 -1
  56. package/dist/feedadBidAdapter.js +1 -1
  57. package/dist/finativeBidAdapter.js +1 -1
  58. package/dist/freewheel-sspBidAdapter.js +1 -1
  59. package/dist/ftrackIdSystem.js +1 -1
  60. package/dist/geolocationRtdProvider.js +1 -0
  61. package/dist/gmosspBidAdapter.js +1 -1
  62. package/dist/goldbachBidAdapter.js +1 -1
  63. package/dist/gravitoIdSystem.js +1 -1
  64. package/dist/greenbidsAnalyticsAdapter.js +1 -1
  65. package/dist/greenbidsRtdProvider.js +1 -1
  66. package/dist/gridBidAdapter.js +1 -1
  67. package/dist/growthCodeAnalyticsAdapter.js +1 -1
  68. package/dist/growthCodeIdSystem.js +1 -1
  69. package/dist/gumgumBidAdapter.js +1 -1
  70. package/dist/h12mediaBidAdapter.js +1 -1
  71. package/dist/hadronIdSystem.js +1 -1
  72. package/dist/hypelabBidAdapter.js +1 -1
  73. package/dist/id5IdSystem.js +1 -1
  74. package/dist/identityLinkIdSystem.js +1 -1
  75. package/dist/idxIdSystem.js +1 -1
  76. package/dist/imdsBidAdapter.js +1 -1
  77. package/dist/improvedigitalBidAdapter.js +1 -1
  78. package/dist/imuIdSystem.js +1 -1
  79. package/dist/insticatorBidAdapter.js +1 -1
  80. package/dist/intentIqIdSystem.js +1 -1
  81. package/dist/invibesBidAdapter.js +1 -1
  82. package/dist/ixBidAdapter.js +1 -1
  83. package/dist/justIdSystem.js +1 -1
  84. package/dist/justpremiumBidAdapter.js +1 -1
  85. package/dist/kargoBidAdapter.js +1 -1
  86. package/dist/kinessoIdSystem.js +1 -1
  87. package/dist/konduitAnalyticsAdapter.js +1 -1
  88. package/dist/kueezBidAdapter.js +1 -1
  89. package/dist/kueezRtbBidAdapter.js +1 -1
  90. package/dist/kulturemediaBidAdapter.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/lotamePanoramaIdSystem.js +1 -1
  97. package/dist/magniteAnalyticsAdapter.js +1 -1
  98. package/dist/malltvAnalyticsAdapter.js +1 -1
  99. package/dist/marsmediaBidAdapter.js +1 -1
  100. package/dist/mediafuseBidAdapter.js +1 -1
  101. package/dist/mediasquareBidAdapter.js +1 -1
  102. package/dist/merkleIdSystem.js +1 -1
  103. package/dist/mgidBidAdapter.js +1 -1
  104. package/dist/minutemediaBidAdapter.js +1 -1
  105. package/dist/minutemediaplusBidAdapter.js +1 -1
  106. package/dist/mspa.js +1 -1
  107. package/dist/mwOpenLinkIdSystem.js +1 -1
  108. package/dist/naveggIdSystem.js +1 -1
  109. package/dist/netIdSystem.js +1 -1
  110. package/dist/newspassidBidAdapter.js +1 -1
  111. package/dist/nexx360BidAdapter.js +1 -1
  112. package/dist/not-for-prod/prebid.js +186 -181
  113. package/dist/novatiqIdSystem.js +1 -1
  114. package/dist/oguryBidAdapter.js +1 -1
  115. package/dist/oneKeyIdSystem.js +1 -1
  116. package/dist/onetagBidAdapter.js +1 -1
  117. package/dist/ooloAnalyticsAdapter.js +1 -1
  118. package/dist/optidigitalBidAdapter.js +1 -1
  119. package/dist/outbrainBidAdapter.js +1 -1
  120. package/dist/ozoneBidAdapter.js +1 -1
  121. package/dist/pairIdSystem.js +1 -1
  122. package/dist/parrableIdSystem.js +1 -1
  123. package/dist/pixfutureBidAdapter.js +1 -1
  124. package/dist/prebid-core.js +1 -1
  125. package/dist/pubCircleBidAdapter.js +1 -0
  126. package/dist/publinkIdSystem.js +1 -1
  127. package/dist/pubmaticBidAdapter.js +1 -1
  128. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  129. package/dist/pxyzBidAdapter.js +1 -1
  130. package/dist/quantcastBidAdapter.js +1 -1
  131. package/dist/quantcastIdSystem.js +1 -1
  132. package/dist/readpeakBidAdapter.js +1 -1
  133. package/dist/relaidoBidAdapter.js +1 -1
  134. package/dist/relevadRtdProvider.js +1 -1
  135. package/dist/retailspotBidAdapter.js +1 -1
  136. package/dist/rhythmoneBidAdapter.js +1 -1
  137. package/dist/riseBidAdapter.js +1 -1
  138. package/dist/rubiconBidAdapter.js +1 -1
  139. package/dist/seedingAllianceBidAdapter.js +1 -1
  140. package/dist/seedtagBidAdapter.js +1 -1
  141. package/dist/sharedIdSystem.js +1 -1
  142. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  143. package/dist/sharethroughBidAdapter.js +1 -1
  144. package/dist/shinezBidAdapter.js +1 -1
  145. package/dist/silverpushBidAdapter.js +1 -1
  146. package/dist/smaatoBidAdapter.js +1 -1
  147. package/dist/smartadserverBidAdapter.js +1 -1
  148. package/dist/smartxBidAdapter.js +1 -1
  149. package/dist/smilewantedBidAdapter.js +1 -1
  150. package/dist/sonobiBidAdapter.js +1 -1
  151. package/dist/sovrnAnalyticsAdapter.js +1 -1
  152. package/dist/sovrnBidAdapter.js +1 -1
  153. package/dist/ssmasBidAdapter.js +1 -0
  154. package/dist/sspBCBidAdapter.js +1 -1
  155. package/dist/stvBidAdapter.js +1 -1
  156. package/dist/sublimeBidAdapter.js +1 -1
  157. package/dist/tapadIdSystem.js +1 -1
  158. package/dist/tappxBidAdapter.js +1 -1
  159. package/dist/targetVideoBidAdapter.js +1 -1
  160. package/dist/teadsBidAdapter.js +1 -1
  161. package/dist/tncIdSystem.js +1 -1
  162. package/dist/topicsFpdModule.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/unifiedIdSystem.js +1 -1
  171. package/dist/userId.js +1 -1
  172. package/dist/utiqSystem.js +1 -1
  173. package/dist/verizonMediaIdSystem.js +1 -1
  174. package/dist/viantOrtbBidAdapter.js +1 -0
  175. package/dist/vidazooBidAdapter.js +1 -1
  176. package/dist/videobyteBidAdapter.js +1 -1
  177. package/dist/videojsVideoProvider.js +1 -1
  178. package/dist/visxBidAdapter.js +1 -1
  179. package/dist/vrtcalBidAdapter.js +1 -1
  180. package/dist/vuukleBidAdapter.js +1 -1
  181. package/dist/widespaceBidAdapter.js +1 -1
  182. package/dist/winrBidAdapter.js +1 -1
  183. package/dist/yahoosspBidAdapter.js +1 -1
  184. package/dist/yieldmoBidAdapter.js +1 -1
  185. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  186. package/dist/zeotapIdPlusIdSystem.js +1 -1
  187. package/integrationExamples/gpt/adUnitFloors.html +0 -1
  188. package/integrationExamples/videoModule/jwplayer/bidMarkedAsUsed.html +1 -1
  189. package/integrationExamples/videoModule/jwplayer/bidRequestScheduling.html +1 -1
  190. package/integrationExamples/videoModule/jwplayer/bidsBackHandlerOverride.html +137 -0
  191. package/integrationExamples/videoModule/jwplayer/eventListeners.html +1 -1
  192. package/integrationExamples/videoModule/jwplayer/eventsUI.html +1 -1
  193. package/integrationExamples/videoModule/jwplayer/gamAdServerMediation.html +1 -1
  194. package/integrationExamples/videoModule/jwplayer/mediaMetadata.html +1 -1
  195. package/integrationExamples/videoModule/jwplayer/playlist.html +1 -1
  196. package/integrationExamples/videoModule/videojs/bidsBackHandlerOverride.html +164 -0
  197. package/libraries/mspa/activityControls.js +51 -32
  198. package/modules/.submodules.json +1 -0
  199. package/modules/33acrossIdSystem.js +9 -0
  200. package/modules/a1MediaRtdProvider.js +92 -0
  201. package/modules/a1MediaRtdProvider.md +46 -0
  202. package/modules/adfBidAdapter.js +4 -1
  203. package/modules/adgenerationBidAdapter.js +3 -3
  204. package/modules/adkernelAdnBidAdapter.js +1 -1
  205. package/modules/adkernelBidAdapter.js +10 -3
  206. package/modules/admixerIdSystem.js +6 -0
  207. package/modules/adnuntiusBidAdapter.js +5 -13
  208. package/modules/adqueryIdSystem.js +6 -0
  209. package/modules/adsinteractiveBidAdapter.js +2 -2
  210. package/modules/adtelligentIdSystem.js +6 -0
  211. package/modules/adyoulikeBidAdapter.js +6 -3
  212. package/modules/amxIdSystem.js +6 -0
  213. package/modules/appnexusBidAdapter.js +1 -1
  214. package/modules/beachfrontBidAdapter.js +32 -6
  215. package/modules/britepoolIdSystem.js +6 -0
  216. package/modules/connectIdSystem.js +6 -0
  217. package/modules/consentManagementGpp.js +10 -1
  218. package/modules/consumableBidAdapter.js +9 -1
  219. package/modules/criteoBidAdapter.js +18 -0
  220. package/modules/criteoIdSystem.js +6 -0
  221. package/modules/cwireBidAdapter.js +19 -0
  222. package/modules/czechAdIdSystem.js +6 -0
  223. package/modules/dacIdSystem.js +6 -0
  224. package/modules/deepintentDpesIdSystem.js +7 -2
  225. package/modules/dmdIdSystem.js +6 -0
  226. package/modules/euidIdSystem.js +9 -0
  227. package/modules/fabrickIdSystem.js +6 -0
  228. package/modules/ftrackIdSystem.js +16 -0
  229. package/modules/geolocationRtdProvider.js +65 -0
  230. package/modules/gravitoIdSystem.js +6 -0
  231. package/modules/greenbidsRtdProvider.js +1 -1
  232. package/modules/growthCodeAnalyticsAdapter.js +7 -2
  233. package/modules/growthCodeIdSystem.js +20 -1
  234. package/modules/hadronIdSystem.js +6 -0
  235. package/modules/id5IdSystem.js +34 -8
  236. package/modules/identityLinkIdSystem.js +6 -0
  237. package/modules/idxIdSystem.js +6 -0
  238. package/modules/imdsBidAdapter.js +38 -14
  239. package/modules/imuIdSystem.js +10 -0
  240. package/modules/intentIqIdSystem.js +6 -0
  241. package/modules/invibesBidAdapter.js +5 -5
  242. package/modules/ixBidAdapter.js +16 -0
  243. package/modules/justIdSystem.js +6 -0
  244. package/modules/kinessoIdSystem.js +7 -2
  245. package/modules/liveIntentIdSystem.js +53 -0
  246. package/modules/lotamePanoramaIdSystem.js +6 -0
  247. package/modules/merkleIdSystem.js +24 -0
  248. package/modules/mwOpenLinkIdSystem.js +6 -0
  249. package/modules/naveggIdSystem.js +6 -0
  250. package/modules/netIdSystem.js +6 -0
  251. package/modules/newspassid.md +76 -0
  252. package/modules/newspassidBidAdapter.js +44 -18
  253. package/modules/novatiqIdSystem.js +12 -0
  254. package/modules/oneKeyIdSystem.js +26 -0
  255. package/modules/ozoneBidAdapter.js +65 -18
  256. package/modules/ozoneBidAdapter.md +3 -1
  257. package/modules/pairIdSystem.js +6 -0
  258. package/modules/parrableIdSystem.js +38 -2
  259. package/modules/pubCircleBidAdapter.js +231 -0
  260. package/modules/pubCircleBidAdapter.md +79 -0
  261. package/modules/publinkIdSystem.js +7 -1
  262. package/modules/quantcastIdSystem.js +6 -0
  263. package/modules/relevadRtdProvider.js +6 -7
  264. package/modules/rubiconBidAdapter.js +9 -0
  265. package/modules/sharedIdSystem.js +6 -0
  266. package/modules/silverpushBidAdapter.js +2 -2
  267. package/modules/ssmasBidAdapter.js +126 -0
  268. package/modules/ssmasBidAdapter.md +35 -0
  269. package/modules/sspBCBidAdapter.js +36 -13
  270. package/modules/tapadIdSystem.js +6 -0
  271. package/modules/tappxBidAdapter.js +10 -1
  272. package/modules/tappxBidAdapter.md +17 -0
  273. package/modules/tncIdSystem.js +6 -0
  274. package/modules/topicsFpdModule.js +21 -48
  275. package/modules/tripleliftBidAdapter.js +5 -0
  276. package/modules/uid2IdSystem.js +14 -0
  277. package/modules/unifiedIdSystem.js +11 -0
  278. package/modules/userId/eids.js +6 -445
  279. package/modules/userId/index.js +36 -24
  280. package/modules/utiqSystem.js +9 -0
  281. package/modules/verizonMediaIdSystem.js +6 -0
  282. package/modules/viantOrtbBidAdapter.js +113 -0
  283. package/modules/viantOrtbBidAdapter.md +54 -0
  284. package/modules/vidazooBidAdapter.js +9 -2
  285. package/modules/videojsVideoProvider.js +9 -2
  286. package/modules/vrtcalBidAdapter.js +10 -6
  287. package/modules/zeotapIdPlusIdSystem.js +6 -0
  288. package/package.json +1 -1
  289. package/src/adapters/bidderFactory.js +15 -6
  290. package/src/adloader.js +2 -1
  291. package/test/spec/libraries/mspa/activityControls_spec.js +145 -212
  292. package/test/spec/modules/a1MediaRtdProvider_spec.js +105 -0
  293. package/test/spec/modules/adfBidAdapter_spec.js +47 -0
  294. package/test/spec/modules/adgenerationBidAdapter_spec.js +6 -6
  295. package/test/spec/modules/adkernelAdnBidAdapter_spec.js +1 -2
  296. package/test/spec/modules/adkernelBidAdapter_spec.js +7 -2
  297. package/test/spec/modules/adnuntiusBidAdapter_spec.js +116 -64
  298. package/test/spec/modules/adyoulikeBidAdapter_spec.js +13 -24
  299. package/test/spec/modules/appnexusBidAdapter_spec.js +12 -1
  300. package/test/spec/modules/beachfrontBidAdapter_spec.js +35 -2
  301. package/test/spec/modules/consentManagementGpp_spec.js +16 -0
  302. package/test/spec/modules/consumableBidAdapter_spec.js +15 -0
  303. package/test/spec/modules/criteoBidAdapter_spec.js +31 -3
  304. package/test/spec/modules/cwireBidAdapter_spec.js +47 -0
  305. package/test/spec/modules/freewheel-sspBidAdapter_spec.js +5 -5
  306. package/test/spec/modules/geolocationRtdProvider_spec.js +119 -0
  307. package/test/spec/modules/greenbidsRtdProvider_spec.js +1 -1
  308. package/test/spec/modules/id5IdSystem_spec.js +18 -0
  309. package/test/spec/modules/imdsBidAdapter_spec.js +98 -17
  310. package/test/spec/modules/invibesBidAdapter_spec.js +123 -32
  311. package/test/spec/modules/ixBidAdapter_spec.js +23 -5
  312. package/test/spec/modules/medianetBidAdapter_spec.js +117 -0
  313. package/test/spec/modules/newspassidBidAdapter_spec.js +6 -0
  314. package/test/spec/modules/outbrainBidAdapter_spec.js +3 -5
  315. package/test/spec/modules/ozoneBidAdapter_spec.js +27 -1
  316. package/test/spec/modules/prebidServerBidAdapter_spec.js +2 -20
  317. package/test/spec/modules/priceFloors_spec.js +14 -0
  318. package/test/spec/modules/pubCircleBidAdapter_spec.js +399 -0
  319. package/test/spec/modules/pubmaticBidAdapter_spec.js +6 -373
  320. package/test/spec/modules/rubiconBidAdapter_spec.js +220 -9
  321. package/test/spec/modules/smaatoBidAdapter_spec.js +4 -6
  322. package/test/spec/modules/ssmasBidAdapter_spec.js +244 -0
  323. package/test/spec/modules/sspBCBidAdapter_spec.js +18 -19
  324. package/test/spec/modules/topicsFpdModule_spec.js +343 -365
  325. package/test/spec/modules/tripleliftBidAdapter_spec.js +40 -0
  326. package/test/spec/modules/userId_spec.js +116 -7
  327. package/test/spec/modules/viantOrtbBidAdapter_spec.js +432 -0
  328. package/test/spec/modules/vrtcalBidAdapter_spec.js +12 -4
  329. package/test/spec/modules/xeBidAdapter_spec.js +366 -368
  330. package/test/spec/modules/yahoosspBidAdapter_spec.js +5 -18
  331. package/test/spec/unit/core/bidderFactory_spec.js +61 -14
  332. package/integrationExamples/gpt/pbjs_video_adUnit.html +0 -109
@@ -9,11 +9,12 @@ import {
9
9
  } from 'modules/criteoBidAdapter.js';
10
10
  import * as utils from 'src/utils.js';
11
11
  import * as refererDetection from 'src/refererDetection.js';
12
+ import * as ajax from 'src/ajax.js';
12
13
  import { config } from '../../../src/config.js';
13
14
  import { BANNER, NATIVE, VIDEO } from '../../../src/mediaTypes.js';
14
15
 
15
16
  describe('The Criteo bidding adapter', function () {
16
- let utilsMock, sandbox;
17
+ let utilsMock, sandbox, ajaxStub;
17
18
 
18
19
  beforeEach(function () {
19
20
  $$PREBID_GLOBAL$$.bidderSettings = {
@@ -26,6 +27,7 @@ describe('The Criteo bidding adapter', function () {
26
27
  utilsMock = sinon.mock(utils);
27
28
 
28
29
  sandbox = sinon.sandbox.create();
30
+ ajaxStub = sandbox.stub(ajax, 'ajax');
29
31
  });
30
32
 
31
33
  afterEach(function () {
@@ -33,6 +35,7 @@ describe('The Criteo bidding adapter', function () {
33
35
  global.Criteo = undefined;
34
36
  utilsMock.restore();
35
37
  sandbox.restore();
38
+ ajaxStub.restore();
36
39
  });
37
40
 
38
41
  describe('getUserSyncs', function () {
@@ -56,7 +59,9 @@ describe('The Criteo bidding adapter', function () {
56
59
  cookiesAreEnabledStub,
57
60
  localStorageIsEnabledStub,
58
61
  getCookieStub,
59
- getDataFromLocalStorageStub;
62
+ setCookieStub,
63
+ getDataFromLocalStorageStub,
64
+ removeDataFromLocalStorageStub;
60
65
 
61
66
  beforeEach(function () {
62
67
  getConfigStub = sinon.stub(config, 'getConfig');
@@ -75,8 +80,10 @@ describe('The Criteo bidding adapter', function () {
75
80
  localStorageIsEnabledStub = sinon.stub(storage, 'localStorageIsEnabled');
76
81
  localStorageIsEnabledStub.returns(true);
77
82
 
78
- getCookieStub = sinon.stub(storage, 'getCookie')
83
+ getCookieStub = sinon.stub(storage, 'getCookie');
84
+ setCookieStub = sinon.stub(storage, 'setCookie');
79
85
  getDataFromLocalStorageStub = sinon.stub(storage, 'getDataFromLocalStorage');
86
+ removeDataFromLocalStorageStub = sinon.stub(storage, 'removeDataFromLocalStorage');
80
87
  });
81
88
 
82
89
  afterEach(function () {
@@ -86,7 +93,9 @@ describe('The Criteo bidding adapter', function () {
86
93
  cookiesAreEnabledStub.restore();
87
94
  localStorageIsEnabledStub.restore();
88
95
  getCookieStub.restore();
96
+ setCookieStub.restore();
89
97
  getDataFromLocalStorageStub.restore();
98
+ removeDataFromLocalStorageStub.restore();
90
99
  });
91
100
 
92
101
  it('should not trigger sync if publisher is using fast bid', function () {
@@ -198,6 +207,25 @@ describe('The Criteo bidding adapter', function () {
198
207
  url: `https://gum.criteo.com/syncframe?origin=criteoPrebidAdapter&topUrl=www.abc.com&us_privacy=ABC#${JSON.stringify(expectedHash).replace(/"/g, '%22')}`
199
208
  }]);
200
209
  });
210
+
211
+ it('should delete user data when calling onDataDeletionRequest', () => {
212
+ const cookieData = {
213
+ 'cto_bundle': 'a'
214
+ };
215
+ const lsData = {
216
+ 'cto_bundle': 'a'
217
+ }
218
+ getCookieStub.callsFake(cookieName => cookieData[cookieName]);
219
+ setCookieStub.callsFake((cookieName, value, expires) => cookieData[cookieName] = value);
220
+ removeDataFromLocalStorageStub.callsFake(name => lsData[name] = '');
221
+ spec.onDataDeletionRequest([]);
222
+ expect(getCookieStub.calledOnce).to.equal(true);
223
+ expect(setCookieStub.calledOnce).to.equal(true);
224
+ expect(removeDataFromLocalStorageStub.calledOnce).to.equal(true);
225
+ expect(cookieData.cto_bundle).to.equal('');
226
+ expect(lsData.cto_bundle).to.equal('');
227
+ expect(ajaxStub.calledOnce).to.equal(true);
228
+ });
201
229
  });
202
230
 
203
231
  describe('isBidRequestValid', function () {
@@ -293,4 +293,51 @@ describe('C-WIRE bid adapter', () => {
293
293
  expect(bids[0].ad).to.exist;
294
294
  })
295
295
  });
296
+
297
+ describe('add user-syncs', function () {
298
+ it('empty user-syncs if no consent given', function () {
299
+ const userSyncs = spec.getUserSyncs({}, {}, {}, {});
300
+
301
+ expect(userSyncs).to.be.empty
302
+ })
303
+ it('empty user-syncs if no syncOption enabled', function () {
304
+ let gdprConsent = {
305
+ vendorData: {
306
+ purpose: {
307
+ consents: 1
308
+ }
309
+ }};
310
+ const userSyncs = spec.getUserSyncs({}, {}, gdprConsent, {});
311
+
312
+ expect(userSyncs).to.be.empty
313
+ })
314
+
315
+ it('user-syncs with enabled pixel option', function () {
316
+ let gdprConsent = {
317
+ vendorData: {
318
+ purpose: {
319
+ consents: 1
320
+ }
321
+ }};
322
+ let synOptions = {pixelEnabled: true, iframeEnabled: true};
323
+ const userSyncs = spec.getUserSyncs(synOptions, {}, gdprConsent, {});
324
+
325
+ expect(userSyncs[0].type).to.equal('image');
326
+ expect(userSyncs[0].url).to.equal('https://ib.adnxs.com/getuid?https://prebid.cwi.re/v1/cookiesync?xandrId=$UID');
327
+ })
328
+
329
+ it('user-syncs with enabled iframe option', function () {
330
+ let gdprConsent = {
331
+ vendorData: {
332
+ purpose: {
333
+ consents: 1
334
+ }
335
+ }};
336
+ let synOptions = {iframeEnabled: true};
337
+ const userSyncs = spec.getUserSyncs(synOptions, {}, gdprConsent, {});
338
+
339
+ expect(userSyncs[0].type).to.equal('iframe');
340
+ expect(userSyncs[0].url).to.equal('https://ib.adnxs.com/getuid?https://prebid.cwi.re/v1/cookiesync?xandrId=$UID');
341
+ })
342
+ })
296
343
  });
@@ -135,11 +135,11 @@ describe('freewheelSSP BidAdapter Test', () => {
135
135
 
136
136
  it('should pass 3rd party IDs with the request when present', function () {
137
137
  const bidRequest = bidRequests[0];
138
- bidRequest.userIdAsEids = createEidsArray({
139
- tdid: 'TTD_ID_FROM_USER_ID_MODULE',
140
- admixerId: 'admixerId_FROM_USER_ID_MODULE',
141
- adtelligentId: 'adtelligentId_FROM_USER_ID_MODULE'
142
- });
138
+ bidRequest.userIdAsEids = [
139
+ {source: 'adserver.org', uids: [{id: 'TTD_ID_FROM_USER_ID_MODULE', atype: 1, ext: {rtiPartner: 'TDID'}}]},
140
+ {source: 'admixer.net', uids: [{id: 'admixerId_FROM_USER_ID_MODULE', atype: 3}]},
141
+ {source: 'adtelligent.com', uids: [{id: 'adtelligentId_FROM_USER_ID_MODULE', atype: 3}]},
142
+ ];
143
143
  const request = spec.buildRequests(bidRequests);
144
144
  const payload = request[0].data;
145
145
  expect(payload._fw_prebid_3p_UID).to.deep.equal(JSON.stringify([
@@ -0,0 +1,119 @@
1
+ import {config as _config, config} from 'src/config.js';
2
+ import { expect } from 'chai';
3
+ import * as events from 'src/events.js';
4
+ import * as prebidGlobal from 'src/prebidGlobal.js';
5
+ import { geolocationSubmodule } from 'modules/geolocationRtdProvider.js';
6
+ import * as utils from 'src/utils.js';
7
+ import {getGlobal} from 'src/prebidGlobal.js';
8
+ import 'src/prebid.js';
9
+
10
+ describe('Geolocation RTD Provider', function () {
11
+ let sandbox;
12
+ let placeholder;
13
+ const pbjs = getGlobal();
14
+ const adUnit = {
15
+ code: 'ad-slot-1',
16
+ mediaTypes: {
17
+ banner: {
18
+ sizes: [ [300, 250] ]
19
+ }
20
+ },
21
+ bids: [
22
+ {
23
+ bidder: 'fake'
24
+ }
25
+ ]
26
+ };
27
+ const providerConfig = {name: 'geolocation', waitForIt: true};
28
+ const rtdConfig = {realTimeData: {auctionDelay: 200, dataProviders: [providerConfig]}}
29
+ describe('Geolocation not supported', function() {
30
+ beforeEach(function() {
31
+ sandbox = sinon.sandbox.create();
32
+ });
33
+ afterEach(function() {
34
+ sandbox.restore();
35
+ sandbox = undefined;
36
+ });
37
+ it('init should return false', function () {
38
+ if (navigator.permissions) { sandbox.stub(navigator.permissions, 'query').value(undefined); expect(geolocationSubmodule.init({})).is.false; }
39
+ });
40
+ });
41
+ describe('Geolocation supported', function() {
42
+ beforeEach(function() {
43
+ sandbox = sinon.sandbox.create();
44
+ // placeholder = createDiv();
45
+ // append();
46
+ const __config = {};
47
+ sandbox.stub(_config, 'getConfig').callsFake(function (path) {
48
+ return utils.deepAccess(__config, path);
49
+ });
50
+ sandbox.stub(_config, 'setConfig').callsFake(function (obj) {
51
+ utils.mergeDeep(__config, obj);
52
+ });
53
+ });
54
+ afterEach(function() {
55
+ sandbox.restore();
56
+ // remove();
57
+ sandbox = undefined;
58
+ placeholder = undefined;
59
+ pbjs.removeAdUnit();
60
+ });
61
+ it('init should return true', function () {
62
+ navigator.permissions && expect(geolocationSubmodule.init({})).is.true;
63
+ });
64
+ it('should set geolocation. (request all)', function(done) {
65
+ navigator.permissions && sandbox.stub(navigator.permissions, 'query').value(() => Promise.resolve({
66
+ state: 'granted',
67
+ }));
68
+ navigator.geolocation && sandbox.stub(navigator.geolocation, 'getCurrentPosition').value((cb) => {
69
+ // eslint-disable-next-line standard/no-callback-literal
70
+ cb({coords: {latitude: 1, longitude: 1}});
71
+ });
72
+ pbjs.addAdUnits([utils.deepClone(adUnit)]);
73
+ config.setConfig(rtdConfig);
74
+ const onDone = sandbox.stub();
75
+ const requestBidObject = {};
76
+ geolocationSubmodule.init({});
77
+ geolocationSubmodule.getBidRequestData(
78
+ requestBidObject,
79
+ onDone,
80
+ providerConfig
81
+ );
82
+ expect(pbjs.adUnits.length).to.eq(1);
83
+ setTimeout(function() {
84
+ // expect(requestBidObject?.ortb2Fragments?.global.device.geo?.type).to.eq(1);
85
+ done();
86
+ }, 300);
87
+ });
88
+ it('should call done due timeout', function(done) {
89
+ // sandbox.stub(navigator.permissions, 'query').value(() => new Promise(() => {}));
90
+ // sandbox.stub(navigator.geolocation, 'getCurrentPosition').value((cb) => {});
91
+ config.setConfig(rtdConfig);
92
+ // remove();
93
+ const onDone = sandbox.stub();
94
+ const requestBidObject = {adUnits: [utils.deepClone(adUnit)]};
95
+ geolocationSubmodule.init({});
96
+ geolocationSubmodule.getBidRequestData(
97
+ requestBidObject,
98
+ onDone,
99
+ {...providerConfig, test: 1}
100
+ );
101
+ setTimeout(function() {
102
+ sinon.assert.calledOnce(onDone);
103
+ expect(requestBidObject).to.not.have.property('ortb2Fragments.global.device.geo');
104
+ done();
105
+ }, 300);
106
+ });
107
+ });
108
+ // function createDiv() {
109
+ // const div = document.createElement('div');
110
+ // div.id = adUnit.code;
111
+ // return div;
112
+ // }
113
+ // function append() {
114
+ // placeholder && document.body.appendChild(placeholder);
115
+ // }
116
+ // function remove() {
117
+ // placeholder && placeholder.parentElement && placeholder.parentElement.removeChild(placeholder);
118
+ // }
119
+ });
@@ -18,7 +18,7 @@ describe('greenbidsRtdProvider', () => {
18
18
  server.restore();
19
19
  });
20
20
 
21
- const endPoint = 'europe-west1-greenbids-357713.cloudfunctions.net';
21
+ const endPoint = 't.greenbids.ai';
22
22
 
23
23
  const SAMPLE_MODULE_CONFIG = {
24
24
  params: {
@@ -407,6 +407,24 @@ describe('ID5 ID System', function () {
407
407
  })
408
408
  });
409
409
 
410
+ it('should call the ID5 server for config with partner id being a string', function () {
411
+ let xhrServerMock = new XhrServerMock(sinon.createFakeServer())
412
+ let id5FetchConfig = getId5FetchConfig();
413
+ id5FetchConfig.params.partner = '173';
414
+ let submoduleResponse = callSubmoduleGetId(id5FetchConfig, undefined, undefined);
415
+
416
+ return xhrServerMock.expectConfigRequest()
417
+ .then(configRequest => {
418
+ let requestBody = JSON.parse(configRequest.requestBody)
419
+ expect(requestBody.params.partner).is.eq(173)
420
+ return xhrServerMock.respondWithConfigAndExpectNext(configRequest)
421
+ })
422
+ .then(fetchRequest => {
423
+ fetchRequest.respond(200, responseHeader, JSON.stringify(ID5_JSON_RESPONSE));
424
+ return submoduleResponse
425
+ })
426
+ });
427
+
410
428
  it('should call the ID5 server for config with overridden url', function () {
411
429
  let xhrServerMock = new XhrServerMock(sinon.createFakeServer())
412
430
  let id5FetchConfig = getId5FetchConfig();
@@ -192,12 +192,45 @@ describe('imdsBidAdapter ', function () {
192
192
  timeout: 3000
193
193
  };
194
194
 
195
- let bidderRequestWithCCPA = {
195
+ let bidderRequestWithUSPInExt = {
196
196
  bidderRequestId: 'xyz123',
197
197
  refererInfo: {
198
198
  referer: 'https://test.com/foo/bar'
199
199
  },
200
- uspConsent: '1YYY'
200
+ ortb2: {
201
+ regs: {
202
+ ext: {
203
+ us_privacy: '1YYY'
204
+ }
205
+ }
206
+ }
207
+ };
208
+
209
+ let bidderRequestWithUSPInRegs = {
210
+ bidderRequestId: 'xyz123',
211
+ refererInfo: {
212
+ referer: 'https://test.com/foo/bar'
213
+ },
214
+ ortb2: {
215
+ regs: {
216
+ us_privacy: '1YYY'
217
+ }
218
+ }
219
+ };
220
+
221
+ let bidderRequestWithUSPAndOthersInExt = {
222
+ bidderRequestId: 'xyz123',
223
+ refererInfo: {
224
+ referer: 'https://test.com/foo/bar'
225
+ },
226
+ ortb2: {
227
+ regs: {
228
+ ext: {
229
+ extra: 'extra item',
230
+ us_privacy: '1YYY'
231
+ }
232
+ }
233
+ }
201
234
  };
202
235
 
203
236
  let validBidRequestWithUserIds = {
@@ -391,7 +424,7 @@ describe('imdsBidAdapter ', function () {
391
424
  let req = spec.buildRequests([badFloorBidRequest], bidderRequest);
392
425
  expect(req).to.have.property('method', 'POST');
393
426
  expect(req).to.have.property('url');
394
- expect(req.url).to.contain('https://prebid.technoratimedia.com/openrtb/bids/prebid?src=$$REPO_AND_VERSION$$');
427
+ expect(req.url).to.contain('https://prebid.technoratimedia.com/openrtb/bids/prebid?src=pbjs%2F$prebid.version$');
395
428
  expect(req.data.id).to.equal('xyz123');
396
429
  expect(req.data.imp).to.eql([
397
430
  {
@@ -422,7 +455,7 @@ describe('imdsBidAdapter ', function () {
422
455
  let req = spec.buildRequests([badFloorBidRequest], bidderRequest);
423
456
  expect(req).to.have.property('method', 'POST');
424
457
  expect(req).to.have.property('url');
425
- expect(req.url).to.contain('https://prebid.technoratimedia.com/openrtb/bids/prebid?src=$$REPO_AND_VERSION$$');
458
+ expect(req.url).to.contain('https://prebid.technoratimedia.com/openrtb/bids/prebid?src=pbjs%2F$prebid.version$');
426
459
  expect(req.data.id).to.equal('xyz123');
427
460
  expect(req.data.imp).to.eql([
428
461
  {
@@ -454,7 +487,7 @@ describe('imdsBidAdapter ', function () {
454
487
  let req = spec.buildRequests([newPosBidRequest], bidderRequest);
455
488
  expect(req).to.have.property('method', 'POST');
456
489
  expect(req).to.have.property('url');
457
- expect(req.url).to.contain('https://prebid.technoratimedia.com/openrtb/bids/prebid?src=$$REPO_AND_VERSION$$');
490
+ expect(req.url).to.contain('https://prebid.technoratimedia.com/openrtb/bids/prebid?src=pbjs%2F$prebid.version$');
458
491
  expect(req.data.id).to.equal('xyz123');
459
492
  expect(req.data.imp).to.eql([
460
493
  {
@@ -485,7 +518,7 @@ describe('imdsBidAdapter ', function () {
485
518
  let req = spec.buildRequests([newPosBidRequest], bidderRequest);
486
519
  expect(req).to.have.property('method', 'POST');
487
520
  expect(req).to.have.property('url');
488
- expect(req.url).to.contain('https://prebid.technoratimedia.com/openrtb/bids/prebid?src=$$REPO_AND_VERSION$$');
521
+ expect(req.url).to.contain('https://prebid.technoratimedia.com/openrtb/bids/prebid?src=pbjs%2F$prebid.version$');
489
522
  expect(req.data.id).to.equal('xyz123');
490
523
  expect(req.data.imp).to.eql([
491
524
  {
@@ -577,7 +610,7 @@ describe('imdsBidAdapter ', function () {
577
610
  let req = spec.buildRequests([validBidRequestVideo], bidderRequest);
578
611
  expect(req).to.have.property('method', 'POST');
579
612
  expect(req).to.have.property('url');
580
- expect(req.url).to.contain('https://prebid.technoratimedia.com/openrtb/bids/prebid?src=$$REPO_AND_VERSION$$');
613
+ expect(req.url).to.contain('https://prebid.technoratimedia.com/openrtb/bids/prebid?src=pbjs%2F$prebid.version$');
581
614
  expect(req.data.id).to.equal('xyz123');
582
615
  expect(req.data.imp).to.eql([
583
616
  {
@@ -635,7 +668,7 @@ describe('imdsBidAdapter ', function () {
635
668
  let req = spec.buildRequests([validBidRequestVideo], bidderRequest);
636
669
  expect(req).to.have.property('method', 'POST');
637
670
  expect(req).to.have.property('url');
638
- expect(req.url).to.contain('https://prebid.technoratimedia.com/openrtb/bids/prebid?src=$$REPO_AND_VERSION$$');
671
+ expect(req.url).to.contain('https://prebid.technoratimedia.com/openrtb/bids/prebid?src=pbjs%2F$prebid.version$');
639
672
  expect(req.data.id).to.equal('xyz123');
640
673
  expect(req.data.imp).to.eql([
641
674
  {
@@ -701,16 +734,42 @@ describe('imdsBidAdapter ', function () {
701
734
  }
702
735
  ]);
703
736
  });
704
- it('should contain the CCPA privacy string when UspConsent is in bidder request', function () {
737
+ it('should have us_privacy string in regs instead of regs.ext bidder request', function () {
738
+ let req = spec.buildRequests([validBidRequest], bidderRequestWithUSPInExt);
739
+ expect(req).be.an('object');
740
+ expect(req).to.have.property('method', 'POST');
741
+ expect(req).to.have.property('url');
742
+ expect(req.url).to.contain('https://prebid.technoratimedia.com/openrtb/bids/prebid?');
743
+ expect(req.data).to.exist.and.to.be.an('object');
744
+ expect(req.data.id).to.equal('xyz123');
745
+ expect(req.data.regs.us_privacy).to.equal('1YYY');
746
+ expect(req.data.regs.ext).to.not.exist;
747
+ expect(req.data.imp).to.eql([expectedDataImp1]);
748
+ });
749
+ it('should accept us_privacy string in regs', function () {
750
+ // banner test
751
+ let req = spec.buildRequests([validBidRequest], bidderRequestWithUSPInRegs);
752
+ expect(req).be.an('object');
753
+ expect(req).to.have.property('method', 'POST');
754
+ expect(req).to.have.property('url');
755
+ expect(req.url).to.contain('https://prebid.technoratimedia.com/openrtb/bids/prebid?');
756
+ expect(req.data).to.exist.and.to.be.an('object');
757
+ expect(req.data.id).to.equal('xyz123');
758
+ expect(req.data.regs.us_privacy).to.equal('1YYY');
759
+ expect(req.data.regs.ext).to.not.exist;
760
+ expect(req.data.imp).to.eql([expectedDataImp1]);
761
+ });
762
+ it('should not remove regs.ext when moving us_privacy if there are other things in regs.ext', function () {
705
763
  // banner test
706
- let req = spec.buildRequests([validBidRequest], bidderRequestWithCCPA);
764
+ let req = spec.buildRequests([validBidRequest], bidderRequestWithUSPAndOthersInExt);
707
765
  expect(req).be.an('object');
708
766
  expect(req).to.have.property('method', 'POST');
709
767
  expect(req).to.have.property('url');
710
768
  expect(req.url).to.contain('https://prebid.technoratimedia.com/openrtb/bids/prebid?');
711
769
  expect(req.data).to.exist.and.to.be.an('object');
712
770
  expect(req.data.id).to.equal('xyz123');
713
- expect(req.data.regs.ext.us_privacy).to.equal('1YYY');
771
+ expect(req.data.regs.us_privacy).to.equal('1YYY');
772
+ expect(req.data.regs.ext.extra).to.equal('extra item');
714
773
  expect(req.data.imp).to.eql([expectedDataImp1]);
715
774
  });
716
775
  it('should contain user object when user ids are present in the bidder request', function () {
@@ -780,14 +839,14 @@ describe('imdsBidAdapter ', function () {
780
839
  let req = spec.buildRequests([validBannerBidRequest], bidderRequest);
781
840
  expect(req).to.have.property('method', 'POST');
782
841
  expect(req).to.have.property('url');
783
- expect(req.url).to.contain('//prebid.technoratimedia.com/openrtb/bids/prebid?src=$$REPO_AND_VERSION$$');
842
+ expect(req.url).to.contain('//prebid.technoratimedia.com/openrtb/bids/prebid?src=pbjs%2F$prebid.version$');
784
843
  });
785
844
 
786
845
  it('should return valid bid request for video impression', function () {
787
846
  let req = spec.buildRequests([validVideoBidReq], bidderRequest);
788
847
  expect(req).to.have.property('method', 'POST');
789
848
  expect(req).to.have.property('url');
790
- expect(req.url).to.contain('//prebid.technoratimedia.com/openrtb/bids/prebid?src=$$REPO_AND_VERSION$$');
849
+ expect(req.url).to.contain('//prebid.technoratimedia.com/openrtb/bids/prebid?src=pbjs%2F$prebid.version$');
791
850
  });
792
851
  });
793
852
 
@@ -887,7 +946,7 @@ describe('imdsBidAdapter ', function () {
887
946
  let req = spec.buildRequests([validBidReq], bidderRequest);
888
947
  expect(req).to.have.property('method', 'POST');
889
948
  expect(req).to.have.property('url');
890
- expect(req.url).to.contain('//prebid.technoratimedia.com/openrtb/bids/prebid?src=$$REPO_AND_VERSION$$');
949
+ expect(req.url).to.contain('//prebid.technoratimedia.com/openrtb/bids/prebid?src=pbjs%2F$prebid.version$');
891
950
  expect(req.data).to.have.property('source');
892
951
  expect(req.data.source).to.have.property('ext');
893
952
  expect(req.data.source.ext).to.have.property('schain');
@@ -1293,20 +1352,42 @@ describe('imdsBidAdapter ', function () {
1293
1352
  });
1294
1353
  });
1295
1354
  describe('getUserSyncs', function () {
1296
- it('should return a usersync when iframes is enabled', function () {
1355
+ it('should return an iframe usersync when iframes is enabled', function () {
1297
1356
  let usersyncs = spec.getUserSyncs({
1298
1357
  iframeEnabled: true
1299
1358
  }, null);
1300
- expect(usersyncs).to.be.an('array').that.is.not.empty;
1359
+ expect(usersyncs).to.be.an('array').with.lengthOf(1);
1301
1360
  expect(usersyncs[0]).to.have.property('type', 'iframe');
1302
1361
  expect(usersyncs[0]).to.have.property('url');
1303
1362
  expect(usersyncs[0].url).to.contain('https://ad-cdn.technoratimedia.com/html/usersync.html');
1304
1363
  });
1305
1364
 
1306
- it('should not return a usersync when iframes are not enabled', function () {
1365
+ it('should return a pixel usersync when pixels is enabled', function () {
1307
1366
  let usersyncs = spec.getUserSyncs({
1308
1367
  pixelEnabled: true
1309
1368
  }, null);
1369
+ expect(usersyncs).to.be.an('array').with.lengthOf(1);
1370
+ expect(usersyncs[0]).to.have.property('type', 'pixel');
1371
+ expect(usersyncs[0]).to.have.property('url');
1372
+ expect(usersyncs[0].url).to.contain('https://sync.technoratimedia.com/services');
1373
+ });
1374
+
1375
+ it('should return an iframe usersync when both iframe and pixels is enabled', function () {
1376
+ let usersyncs = spec.getUserSyncs({
1377
+ iframeEnabled: true,
1378
+ pixelEnabled: true
1379
+ }, null);
1380
+ expect(usersyncs).to.be.an('array').with.lengthOf(1);
1381
+ expect(usersyncs[0]).to.have.property('type', 'iframe');
1382
+ expect(usersyncs[0]).to.have.property('url');
1383
+ expect(usersyncs[0].url).to.contain('https://ad-cdn.technoratimedia.com/html/usersync.html');
1384
+ });
1385
+
1386
+ it('should not return a usersync when neither iframes nor pixel are enabled', function () {
1387
+ let usersyncs = spec.getUserSyncs({
1388
+ iframeEnabled: false,
1389
+ pixelEnabled: false
1390
+ }, null);
1310
1391
  expect(usersyncs).to.be.an('array').that.is.empty;
1311
1392
  });
1312
1393
  });