prebid.js 9.2.0 → 9.4.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 (279) hide show
  1. package/creative/constants.js +2 -1
  2. package/creative/crossDomain.js +16 -4
  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/adagioAnalyticsAdapter.js +1 -1
  8. package/dist/adagioBidAdapter.js +1 -1
  9. package/dist/adagioRtdProvider.js +1 -1
  10. package/dist/adagioUtils.js +1 -1
  11. package/dist/addefendBidAdapter.js +1 -1
  12. package/dist/adfBidAdapter.js +1 -1
  13. package/dist/adgenerationBidAdapter.js +1 -1
  14. package/dist/adlooxRtdProvider.js +1 -1
  15. package/dist/adnuntiusBidAdapter.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/adxcgAnalyticsAdapter.js +1 -1
  21. package/dist/adxcgBidAdapter.js +1 -1
  22. package/dist/adyoulikeBidAdapter.js +1 -1
  23. package/dist/agmaAnalyticsAdapter.js +1 -1
  24. package/dist/ajaBidAdapter.js +1 -1
  25. package/dist/amxBidAdapter.js +1 -1
  26. package/dist/amxIdSystem.js +1 -1
  27. package/dist/appierAnalyticsAdapter.js +1 -1
  28. package/dist/appnexusBidAdapter.js +1 -1
  29. package/dist/asoBidAdapter.js +1 -1
  30. package/dist/axonixBidAdapter.js +1 -1
  31. package/dist/bidglassBidAdapter.js +1 -1
  32. package/dist/big-richmediaBidAdapter.js +1 -1
  33. package/dist/bridBidAdapter.js +1 -1
  34. package/dist/bridgewellBidAdapter.js +1 -1
  35. package/dist/brightMountainMediaBidAdapter.js +1 -1
  36. package/dist/carodaBidAdapter.js +1 -1
  37. package/dist/chtnwBidAdapter.js +1 -1
  38. package/dist/chunk-core.js +1 -1
  39. package/dist/codefuelBidAdapter.js +1 -1
  40. package/dist/concertBidAdapter.js +1 -1
  41. package/dist/connectadBidAdapter.js +1 -1
  42. package/dist/consentManagement.js +1 -0
  43. package/dist/consentManagementGpp.js +1 -1
  44. package/dist/consentManagementTcf.js +1 -1
  45. package/dist/consumableBidAdapter.js +1 -1
  46. package/dist/conversantAnalyticsAdapter.js +1 -1
  47. package/dist/conversantBidAdapter.js +1 -1
  48. package/dist/copper6sspBidAdapter.js +1 -0
  49. package/dist/cpmstarBidAdapter.js +1 -1
  50. package/dist/craftBidAdapter.js +1 -1
  51. package/dist/criteoBidAdapter.js +1 -1
  52. package/dist/cwireBidAdapter.js +1 -1
  53. package/dist/dailymotionBidAdapter.js +1 -1
  54. package/dist/deltaprojectsBidAdapter.js +1 -1
  55. package/dist/dependencies.json +51 -13
  56. package/dist/dianomiBidAdapter.js +1 -1
  57. package/dist/dspxBidAdapter.js +1 -1
  58. package/dist/dxkultureBidAdapter.js +1 -1
  59. package/dist/eplanningBidAdapter.js +1 -1
  60. package/dist/euidIdSystem.js +1 -1
  61. package/dist/exadsBidAdapter.js +1 -1
  62. package/dist/feedadBidAdapter.js +1 -1
  63. package/dist/finativeBidAdapter.js +1 -1
  64. package/dist/freewheel-sspBidAdapter.js +1 -1
  65. package/dist/gmosspBidAdapter.js +1 -1
  66. package/dist/goldbachBidAdapter.js +1 -1
  67. package/dist/greenbidsAnalyticsAdapter.js +1 -1
  68. package/dist/greenbidsRtdProvider.js +1 -1
  69. package/dist/gridBidAdapter.js +1 -1
  70. package/dist/gumgumBidAdapter.js +1 -1
  71. package/dist/h12mediaBidAdapter.js +1 -1
  72. package/dist/hypelabBidAdapter.js +1 -1
  73. package/dist/id5AnalyticsAdapter.js +1 -1
  74. package/dist/id5IdSystem.js +1 -1
  75. package/dist/illuminBidAdapter.js +1 -1
  76. package/dist/imdsBidAdapter.js +1 -1
  77. package/dist/improvedigitalBidAdapter.js +1 -1
  78. package/dist/insticatorBidAdapter.js +1 -1
  79. package/dist/intentIqIdSystem.js +1 -1
  80. package/dist/ixBidAdapter.js +1 -1
  81. package/dist/jixieBidAdapter.js +1 -1
  82. package/dist/justpremiumBidAdapter.js +1 -1
  83. package/dist/kargoBidAdapter.js +1 -1
  84. package/dist/kimberliteBidAdapter.js +1 -1
  85. package/dist/konduitAnalyticsAdapter.js +1 -1
  86. package/dist/kueezBidAdapter.js +1 -1
  87. package/dist/kueezRtbBidAdapter.js +1 -1
  88. package/dist/lassoBidAdapter.js +1 -1
  89. package/dist/lifestreetBidAdapter.js +1 -1
  90. package/dist/liveIntentIdSystem.js +1 -1
  91. package/dist/logicadBidAdapter.js +1 -1
  92. package/dist/loglyliftBidAdapter.js +1 -1
  93. package/dist/luceadBidAdapter.js +1 -1
  94. package/dist/luponmediaBidAdapter.js +1 -1
  95. package/dist/mabidderBidAdapter.js +1 -1
  96. package/dist/magniteAnalyticsAdapter.js +1 -1
  97. package/dist/malltvAnalyticsAdapter.js +1 -1
  98. package/dist/marsmediaBidAdapter.js +1 -1
  99. package/dist/mediafuseBidAdapter.js +1 -1
  100. package/dist/medianetAnalyticsAdapter.js +1 -1
  101. package/dist/medianetBidAdapter.js +1 -1
  102. package/dist/mediasquareBidAdapter.js +1 -1
  103. package/dist/mgidBidAdapter.js +1 -1
  104. package/dist/minutemediaBidAdapter.js +1 -1
  105. package/dist/missenaBidAdapter.js +1 -1
  106. package/dist/nexx360BidAdapter.js +1 -1
  107. package/dist/nobidAnalyticsAdapter.js +1 -1
  108. package/dist/nobidBidAdapter.js +1 -1
  109. package/dist/not-for-prod/prebid.js +184 -178
  110. package/dist/oguryBidAdapter.js +1 -1
  111. package/dist/onetagBidAdapter.js +1 -1
  112. package/dist/ooloAnalyticsAdapter.js +1 -1
  113. package/dist/openwebBidAdapter.js +1 -1
  114. package/dist/openxBidAdapter.js +1 -1
  115. package/dist/optidigitalBidAdapter.js +1 -1
  116. package/dist/orakiBidAdapter.js +1 -0
  117. package/dist/orbidderBidAdapter.js +1 -1
  118. package/dist/outbrainBidAdapter.js +1 -1
  119. package/dist/ozoneBidAdapter.js +1 -1
  120. package/dist/pairIdSystem.js +1 -1
  121. package/dist/pixfutureBidAdapter.js +1 -1
  122. package/dist/prebidServerBidAdapter.js +1 -1
  123. package/dist/processResponse.js +1 -0
  124. package/dist/publinkIdSystem.js +1 -1
  125. package/dist/publirBidAdapter.js +1 -1
  126. package/dist/pubmaticAnalyticsAdapter.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/readpeakBidAdapter.js +1 -1
  132. package/dist/relaidoBidAdapter.js +1 -1
  133. package/dist/retailspotBidAdapter.js +1 -1
  134. package/dist/rhythmoneBidAdapter.js +1 -1
  135. package/dist/riseBidAdapter.js +1 -1
  136. package/dist/rubiconBidAdapter.js +1 -1
  137. package/dist/seedingAllianceBidAdapter.js +1 -1
  138. package/dist/seedtagBidAdapter.js +1 -1
  139. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  140. package/dist/sharethroughBidAdapter.js +1 -1
  141. package/dist/shinezBidAdapter.js +1 -1
  142. package/dist/shinezRtbBidAdapter.js +1 -1
  143. package/dist/smaatoBidAdapter.js +1 -1
  144. package/dist/smartadserverBidAdapter.js +1 -1
  145. package/dist/smartxBidAdapter.js +1 -1
  146. package/dist/smartyadsBidAdapter.js +1 -1
  147. package/dist/smartyadsUtils.js +1 -0
  148. package/dist/smilewantedBidAdapter.js +1 -1
  149. package/dist/snigelBidAdapter.js +1 -1
  150. package/dist/sonobiBidAdapter.js +1 -1
  151. package/dist/sovrnBidAdapter.js +1 -1
  152. package/dist/sspBCBidAdapter.js +1 -1
  153. package/dist/stnBidAdapter.js +1 -1
  154. package/dist/stvBidAdapter.js +1 -1
  155. package/dist/sublimeBidAdapter.js +1 -1
  156. package/dist/taboolaBidAdapter.js +1 -1
  157. package/dist/tagorasBidAdapter.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/terceptAnalyticsAdapter.js +1 -1
  162. package/dist/themoneytizerBidAdapter.js +1 -1
  163. package/dist/trionBidAdapter.js +1 -1
  164. package/dist/tripleliftBidAdapter.js +1 -1
  165. package/dist/ttdBidAdapter.js +1 -1
  166. package/dist/twistDigitalBidAdapter.js +1 -1
  167. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  168. package/dist/uid2IdSystem.js +1 -1
  169. package/dist/underdogmediaBidAdapter.js +1 -1
  170. package/dist/undertoneBidAdapter.js +1 -1
  171. package/dist/unrulyBidAdapter.js +1 -1
  172. package/dist/userId.js +1 -1
  173. package/dist/viantOrtbBidAdapter.js +1 -1
  174. package/dist/vidazooBidAdapter.js +1 -1
  175. package/dist/vidazooUtils.js +1 -0
  176. package/dist/videobyteBidAdapter.js +1 -1
  177. package/dist/visxBidAdapter.js +1 -1
  178. package/dist/vuukleBidAdapter.js +1 -1
  179. package/dist/widespaceBidAdapter.js +1 -1
  180. package/dist/winrBidAdapter.js +1 -1
  181. package/dist/yahooAdsBidAdapter.js +1 -1
  182. package/dist/yieldmoBidAdapter.js +1 -1
  183. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  184. package/dist/yuktamediaAnalyticsAdapter.js +1 -1
  185. package/dist/zeta_global_sspBidAdapter.js +1 -1
  186. package/integrationExamples/gpt/x-domain/creative.html +1 -1
  187. package/libraries/consentManagement/cmUtils.js +38 -0
  188. package/libraries/processResponse/index.js +12 -0
  189. package/libraries/smartyadsUtils/getAdUrlByRegion.js +32 -0
  190. package/libraries/vidazooUtils/bidderUtils.js +480 -0
  191. package/libraries/vidazooUtils/constants.js +7 -0
  192. package/modules/adagioRtdProvider.js +9 -7
  193. package/modules/addefendBidAdapter.js +1 -2
  194. package/modules/adfBidAdapter.js +1 -10
  195. package/modules/adlooxRtdProvider.js +1 -1
  196. package/modules/adnuntiusBidAdapter.js +1 -0
  197. package/modules/adxcgAnalyticsAdapter.js +1 -2
  198. package/modules/carodaBidAdapter.js +3 -8
  199. package/modules/codefuelBidAdapter.js +1 -10
  200. package/modules/consentManagementGpp.js +2 -38
  201. package/modules/consentManagementTcf.js +7 -38
  202. package/modules/conversantAnalyticsAdapter.js +1 -2
  203. package/modules/copper6sspBidAdapter.js +19 -0
  204. package/modules/copper6sspBidAdapter.md +79 -0
  205. package/modules/cpmstarBidAdapter.js +52 -36
  206. package/modules/cpmstarBidAdapter.md +1 -4
  207. package/modules/criteoBidAdapter.js +10 -3
  208. package/modules/dailymotionBidAdapter.js +1 -1
  209. package/modules/deltaprojectsBidAdapter.js +2 -11
  210. package/modules/dianomiBidAdapter.js +1 -9
  211. package/modules/finativeBidAdapter.js +1 -10
  212. package/modules/gridBidAdapter.js +2 -12
  213. package/modules/id5AnalyticsAdapter.js +1 -2
  214. package/modules/illuminBidAdapter.js +9 -304
  215. package/modules/intentIqIdSystem.js +408 -50
  216. package/modules/intentIqIdSystem.md +92 -0
  217. package/modules/kueezRtbBidAdapter.js +17 -312
  218. package/modules/liveIntentIdSystem.js +2 -2
  219. package/modules/luponmediaBidAdapter.js +4 -10
  220. package/modules/mabidderBidAdapter.js +1 -2
  221. package/modules/medianetAnalyticsAdapter.js +1 -2
  222. package/modules/medianetBidAdapter.js +1 -1
  223. package/modules/mgidBidAdapter.js +1 -10
  224. package/modules/orakiBidAdapter.js +19 -0
  225. package/modules/orakiBidAdapter.md +79 -0
  226. package/modules/orbidderBidAdapter.js +4 -2
  227. package/modules/outbrainBidAdapter.js +8 -43
  228. package/modules/ozoneBidAdapter.js +9 -7
  229. package/modules/pairIdSystem.js +27 -10
  230. package/modules/pixfutureBidAdapter.js +1 -2
  231. package/modules/prebidServerBidAdapter/index.js +1 -1
  232. package/modules/seedtagBidAdapter.js +4 -0
  233. package/modules/shinezRtbBidAdapter.js +12 -304
  234. package/modules/smartadserverBidAdapter.js +3 -0
  235. package/modules/smartyadsBidAdapter.js +6 -110
  236. package/modules/snigelBidAdapter.js +1 -2
  237. package/modules/tagorasBidAdapter.js +13 -316
  238. package/modules/tappxBidAdapter.js +1 -2
  239. package/modules/terceptAnalyticsAdapter.js +1 -2
  240. package/modules/twistDigitalBidAdapter.js +9 -433
  241. package/modules/userId/index.js +31 -21
  242. package/modules/viantOrtbBidAdapter.js +20 -0
  243. package/modules/vidazooBidAdapter.js +26 -468
  244. package/modules/visxBidAdapter.js +27 -29
  245. package/modules/yahooAdsBidAdapter.js +4 -1
  246. package/modules/yuktamediaAnalyticsAdapter.js +1 -2
  247. package/modules/zeta_global_sspBidAdapter.js +2 -2
  248. package/package.json +1 -1
  249. package/src/adRendering.js +25 -2
  250. package/src/constants.js +2 -0
  251. package/src/prebid.js +2 -1
  252. package/src/utils.js +19 -1
  253. package/test/spec/creative/crossDomainCreative_spec.js +38 -2
  254. package/test/spec/fpd/gdpr_spec.js +24 -2
  255. package/test/spec/libraries/processResponse_spec.js +60 -0
  256. package/test/spec/modules/adagioRtdProvider_spec.js +12 -0
  257. package/test/spec/modules/adnuntiusBidAdapter_spec.js +6 -3
  258. package/test/spec/modules/conversantAnalyticsAdapter_spec.js +1 -1
  259. package/test/spec/modules/copper6sspBidAdapter_spec.js +514 -0
  260. package/test/spec/modules/cpmstarBidAdapter_spec.js +1 -1
  261. package/test/spec/modules/dailymotionBidAdapter_spec.js +18 -14
  262. package/test/spec/modules/illuminBidAdapter_spec.js +26 -13
  263. package/test/spec/modules/intentIqIdSystem_spec.js +264 -36
  264. package/test/spec/modules/kueezRtbBidAdapter_spec.js +26 -15
  265. package/test/spec/modules/orakiBidAdapter_spec.js +510 -0
  266. package/test/spec/modules/outbrainBidAdapter_spec.js +32 -1
  267. package/test/spec/modules/seedtagBidAdapter_spec.js +27 -0
  268. package/test/spec/modules/shinezRtbBidAdapter_spec.js +26 -14
  269. package/test/spec/modules/smartadserverBidAdapter_spec.js +7 -0
  270. package/test/spec/modules/smartyadsBidAdapter_spec.js +6 -83
  271. package/test/spec/modules/tagorasBidAdapter_spec.js +26 -15
  272. package/test/spec/modules/twistDigitalBidAdapter_spec.js +19 -22
  273. package/test/spec/modules/userId_spec.js +86 -47
  274. package/test/spec/modules/viantOrtbBidAdapter_spec.js +87 -6
  275. package/test/spec/modules/vidazooBidAdapter_spec.js +21 -23
  276. package/test/spec/modules/visxBidAdapter_spec.js +180 -0
  277. package/test/spec/modules/yahooAdsBidAdapter_spec.js +1 -1
  278. package/test/spec/modules/zeta_global_sspBidAdapter_spec.js +11 -0
  279. package/test/spec/unit/pbjs_api_spec.js +6 -1
@@ -2,31 +2,61 @@ import { expect } from 'chai';
2
2
  import { intentIqIdSubmodule, storage } from 'modules/intentIqIdSystem.js';
3
3
  import * as utils from 'src/utils.js';
4
4
  import { server } from 'test/mocks/xhr.js';
5
- import {clearAllCookies} from '../../helpers/cookies.js';
5
+ import { CLIENT_HINTS_KEY, FIRST_PARTY_KEY, decryptData, detectBrowserFromUserAgent, detectBrowserFromUserAgentData, handleClientHints, handleGPPData, readData } from '../../../modules/intentIqIdSystem';
6
+ import { gppDataHandler, uspDataHandler } from '../../../src/consentHandler';
7
+ import { clearAllCookies } from '../../helpers/cookies';
6
8
 
7
9
  const partner = 10;
8
10
  const pai = '11';
9
11
  const pcid = '12';
10
- const enableCookieStorage = true;
11
12
  const defaultConfigParams = { params: { partner: partner } };
12
13
  const paiConfigParams = { params: { partner: partner, pai: pai } };
13
14
  const pcidConfigParams = { params: { partner: partner, pcid: pcid } };
14
- const enableCookieConfigParams = { params: { partner: partner, enableCookieStorage: enableCookieStorage } };
15
- const allConfigParams = { params: { partner: partner, pai: pai, pcid: pcid, enableCookieStorage: enableCookieStorage } };
15
+ const allConfigParams = { params: { partner: partner, pai: pai, pcid: pcid } };
16
16
  const responseHeader = { 'Content-Type': 'application/json' }
17
17
 
18
+ export const testClientHints = {
19
+ architecture: 'x86',
20
+ bitness: '64',
21
+ brands: [
22
+ {
23
+ brand: 'Not(A:Brand',
24
+ version: '24'
25
+ },
26
+ {
27
+ brand: 'Chromium',
28
+ version: '122'
29
+ }
30
+ ],
31
+ fullVersionList: [
32
+ {
33
+ brand: 'Not(A:Brand',
34
+ version: '24.0.0.0'
35
+ },
36
+ {
37
+ brand: 'Chromium',
38
+ version: '122.0.6261.128'
39
+ }
40
+ ],
41
+ mobile: false,
42
+ model: '',
43
+ platform: 'Linux',
44
+ platformVersion: '6.5.0',
45
+ wow64: false
46
+ };
47
+
18
48
  describe('IntentIQ tests', function () {
19
49
  let logErrorStub;
20
50
  let testLSValue = {
21
- 'date': 1651945280759,
51
+ 'date': Date.now(),
22
52
  'cttl': 2000,
23
53
  'rrtt': 123
24
54
  }
25
55
  let testLSValueWithData = {
26
- 'date': 1651945280759,
56
+ 'date': Date.now(),
27
57
  'cttl': 9999999999999,
28
58
  'rrtt': 123,
29
- 'data': 'previousTestData'
59
+ 'data': 'U2FsdGVkX18AKRyhEPdiL9kuxSigBrlqLaDJWvwSird2O5TdBW67gX+xbL4nYxHDjdS5G5FpdhtpouZiBFw2FBjyUyobZheM857G5q4BapdiA8z3K6j0W+r0im30Ak2SSn2NBfFwxcCgP/UAF5/ddxIIaeWl1yBMZBO+Gic6us2JUg86paAtp3Sk4unCvg1G+4myYYSKgGi/Vrw51ye/jAGn4AdAbFOCojENhV+Ts/XyVK0AQGdC3wqnQUId9MZpB2VoTA9wgXeYEzjpDDJmcKQ18V3WTKnK/H1FBVZa1vovOj13ZUeuMUZbZL83NFE/PkCrzJjRy14orcdnGbDUaxXUBBulDCr21gNnc0mLbYj7b18OQQ75/GhX80HroxbMEyc5tiECBrE/JsW+2sQ4MwoqePPPj/f5Bf4wJ4z3UphjK6maypoWaXsZCZTp2mJYmsf0XsNHLpt1MUrBeAmy6Bewkb+WEAeVe6/b53DQDlo2LQXpSzDPVucMn3CQOWFv1Bvz5cLIZRD8/NtDjgYzWNXHRRAGhhN19yew0ZyeS09x3UBiwER6A6ppv2qQVGs8QNsif3z7pkhkNoETcXQKyv1xa5X87tLvXkO4FYDQQvXEGInyPuNmkFtsZS5FJl+TYrdyaEiCOwRgkshwCU4s93WrfRUtPHtd4zNiA1LWAKGKeBEK6woeFn1YU1YIqsvx9wXfkCbqNkHTi2mD1Eb85a2niSK9BzDdbxwv6EzZ+f9j6esEVdBUIiYmsUuOfTp/ftOHKjBKi1lbeC5imAzZfV/AKvqS5opAVGp7Y9pq976sYblCrPBQ0PYI+Cm2ZNhG1vKc2Pa0rjwJwvusZp2Wvw9zSbnoZUeBi1O+XGYqGhkqYVvH3rXvrFiSmA7pk5Buz6vPd6YV1d55PVahv/4u3jksEI/ZN8QNshrM0foJ4tE/q4x8EKx22txb6433QQybwFfExdmA/XaPqM0rwqTm4qyK0mbX984A8niQka5T5pPkEfL4ALqlIgJ2Fo7X/s6FRU/sZq72JWKcVET4edebD0w5mjeotsjUz5EGT0jRSWRba0yxe4myNaAyY7Y0NTNY9J9Q0JLDFh9Hb05Ejt0Jeoq4Olv8/zFWObBoQtkQyeeRB8L7XIari/xgl191J6euhe5+8vu3ta3tX+XGk+gqdfip1R11tEYpW/XPsV+6DBEfS/8icDHiwK7sPpAgTx7GuJGL1U3Hbg7P/2zUU6xMSR5In/Oa5i1B9FtayGd+utiqrGJsqg8IyFlAt1B9B11k/wJFnWWevMly+y+Ko75ShF7UzfcNR2s41doov+2DEz/YiKH1qHjVOXjslBTYjceB3xqa8sSPDt/vQDDUIX5CPLyVBZj7AeeB/IKDFjZVovBDH92Xl8JTNILRuDHsWmSwNI1DUzgus6ox4u9Mi439caK6KnpNYso+ksLXNEQCm0m15WV2NC+fjkEwLV6hGNbz'
30
60
  }
31
61
  let testResponseWithValues = {
32
62
  'abPercentage': 90,
@@ -40,6 +70,10 @@ describe('IntentIQ tests', function () {
40
70
  }
41
71
 
42
72
  beforeEach(function () {
73
+ localStorage.clear();
74
+ const expiredDate = new Date(0).toUTCString();
75
+ storage.setCookie(FIRST_PARTY_KEY, '', expiredDate, 'Lax');
76
+ storage.setCookie(FIRST_PARTY_KEY + '_' + partner, '', expiredDate, 'Lax');
43
77
  logErrorStub = sinon.stub(utils, 'logError');
44
78
  });
45
79
 
@@ -67,7 +101,7 @@ describe('IntentIQ tests', function () {
67
101
  expect(submodule).to.be.undefined;
68
102
  });
69
103
 
70
- it('should not save data in cookie if enableCookieStorage configParam not set', function () {
104
+ it('should not save data in cookie if relevant type not set', function () {
71
105
  let callBackSpy = sinon.spy();
72
106
  let submoduleCallback = intentIqIdSubmodule.getId(defaultConfigParams).callback;
73
107
  submoduleCallback(callBackSpy);
@@ -82,9 +116,9 @@ describe('IntentIQ tests', function () {
82
116
  expect(storage.getCookie('_iiq_fdata_' + partner)).to.equal(null);
83
117
  });
84
118
 
85
- it('should save data in cookie if enableCookieStorage configParam set to true', function () {
119
+ it('should save data in cookie if storage type is "cookie"', function () {
86
120
  let callBackSpy = sinon.spy();
87
- let submoduleCallback = intentIqIdSubmodule.getId(allConfigParams).callback;
121
+ let submoduleCallback = intentIqIdSubmodule.getId({ ...allConfigParams, enabledStorageTypes: ['cookie'] }).callback;
88
122
  submoduleCallback(callBackSpy);
89
123
  let request = server.requests[0];
90
124
  expect(request.url).to.contain('https://api.intentiq.com/profiles_engine/ProfilesEngineServlet?at=39&mi=10&dpi=10&pt=17&dpn=1&pcid=12&pai=11&iiqidtype=2&iiqpcid=');
@@ -94,9 +128,10 @@ describe('IntentIQ tests', function () {
94
128
  JSON.stringify({ pid: 'test_pid', data: 'test_personid', ls: true })
95
129
  );
96
130
  expect(callBackSpy.calledOnce).to.be.true;
97
- const cookieValue = storage.getCookie('_iiq_fdata_' + partner)
98
- expect(cookieValue).to.not.equal(null)
99
- expect(JSON.parse(cookieValue).data).to.be.equal('test_personid');
131
+ const cookieValue = storage.getCookie('_iiq_fdata_' + partner);
132
+ expect(cookieValue).to.not.equal(null);
133
+ const decryptedData = JSON.parse(decryptData(JSON.parse(cookieValue).data));
134
+ expect(decryptedData).to.deep.equal(['test_personid']);
100
135
  });
101
136
 
102
137
  it('should call the IntentIQ endpoint with only partner', function () {
@@ -114,8 +149,6 @@ describe('IntentIQ tests', function () {
114
149
  });
115
150
 
116
151
  it('should ignore INVALID_ID and invalid responses in decode', function () {
117
- // let resp = JSON.stringify({'RESULT': 'NA'});
118
- // expect(intentIqIdSubmodule.decode(resp)).to.equal(undefined);
119
152
  expect(intentIqIdSubmodule.decode('INVALID_ID')).to.equal(undefined);
120
153
  expect(intentIqIdSubmodule.decode('')).to.equal(undefined);
121
154
  expect(intentIqIdSubmodule.decode(undefined)).to.equal(undefined);
@@ -202,7 +235,7 @@ describe('IntentIQ tests', function () {
202
235
  JSON.stringify({ pid: 'test_pid', data: 'test_personid', ls: true })
203
236
  );
204
237
  expect(callBackSpy.calledOnce).to.be.true;
205
- expect(callBackSpy.args[0][0]).to.be.eq('test_personid');
238
+ expect(callBackSpy.args[0][0]).to.deep.equal(['test_personid']);
206
239
  });
207
240
 
208
241
  it('dont save result if ls=false', function () {
@@ -220,21 +253,6 @@ describe('IntentIQ tests', function () {
220
253
  expect(callBackSpy.args[0][0]).to.be.undefined;
221
254
  });
222
255
 
223
- it('save result as INVALID_ID on empty data and ls=true ', function () {
224
- let callBackSpy = sinon.spy();
225
- let submoduleCallback = intentIqIdSubmodule.getId(allConfigParams).callback;
226
- submoduleCallback(callBackSpy);
227
- let request = server.requests[0];
228
- expect(request.url).to.contain('https://api.intentiq.com/profiles_engine/ProfilesEngineServlet?at=39&mi=10&dpi=10&pt=17&dpn=1&pcid=12&pai=11&iiqidtype=2&iiqpcid=');
229
- request.respond(
230
- 200,
231
- responseHeader,
232
- JSON.stringify({ pid: 'test_pid', data: '', ls: true })
233
- );
234
- expect(callBackSpy.calledOnce).to.be.true;
235
- expect(callBackSpy.args[0][0]).to.be.eq('INVALID_ID');
236
- });
237
-
238
256
  it('send addition parameters if were found in localstorage', function () {
239
257
  localStorage.setItem('_iiq_fdata_' + partner, JSON.stringify(testLSValue))
240
258
  let callBackSpy = sinon.spy();
@@ -251,16 +269,226 @@ describe('IntentIQ tests', function () {
251
269
  JSON.stringify(testResponseWithValues)
252
270
  );
253
271
  expect(callBackSpy.calledOnce).to.be.true;
254
- expect(callBackSpy.args[0][0]).to.be.eq(testResponseWithValues.data);
272
+ expect(callBackSpy.args[0][0]).to.deep.equal([testResponseWithValues.data]);
255
273
  });
256
274
 
257
275
  it('return data stored in local storage ', function () {
258
- localStorage.setItem('_iiq_fdata_' + partner, JSON.stringify(testLSValueWithData))
276
+ localStorage.setItem('_iiq_fdata_' + partner, JSON.stringify(testLSValueWithData));
277
+ let returnedValue = intentIqIdSubmodule.getId(allConfigParams);
278
+ expect(JSON.stringify(returnedValue.id)).to.equal(decryptData(testLSValueWithData.data));
279
+ });
280
+
281
+ it('should handle browser blacklisting', function () {
282
+ let configParamsWithBlacklist = {
283
+ params: { partner: partner, browserBlackList: 'chrome' }
284
+ };
285
+ sinon.stub(navigator, 'userAgent').value('Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36');
286
+ let submoduleCallback = intentIqIdSubmodule.getId(configParamsWithBlacklist);
287
+ expect(logErrorStub.calledOnce).to.be.true;
288
+ expect(submoduleCallback).to.be.undefined;
289
+ });
290
+
291
+ it('should handle invalid JSON in readData', function () {
292
+ localStorage.setItem('_iiq_fdata_' + partner, 'invalid_json');
259
293
  let callBackSpy = sinon.spy();
260
- let submoduleCallback = intentIqIdSubmodule.getId(allConfigParams).callback;
294
+ let submoduleCallback = intentIqIdSubmodule.getId(defaultConfigParams).callback;
261
295
  submoduleCallback(callBackSpy);
262
- expect(server.requests.length).to.be.equal(0);
296
+ let request = server.requests[0];
297
+ expect(request.url).to.contain('https://api.intentiq.com/profiles_engine/ProfilesEngineServlet?at=39&mi=10&dpi=10&pt=17&dpn=1&iiqidtype=2&iiqpcid=');
298
+ request.respond(
299
+ 200,
300
+ responseHeader,
301
+ JSON.stringify({})
302
+ );
263
303
  expect(callBackSpy.calledOnce).to.be.true;
264
- expect(callBackSpy.args[0][0]).to.be.equal(testLSValueWithData.data);
304
+ expect(logErrorStub.called).to.be.true;
305
+ });
306
+
307
+ describe('handleGPPData', function () {
308
+ it('should convert array of objects to a single JSON string', function () {
309
+ const input = [
310
+ { key1: 'value1' },
311
+ { key2: 'value2' }
312
+ ];
313
+ const expectedOutput = JSON.stringify({ key1: 'value1', key2: 'value2' });
314
+ const result = handleGPPData(input);
315
+ expect(result).to.equal(expectedOutput);
316
+ });
317
+
318
+ it('should convert a single object to a JSON string', function () {
319
+ const input = { key1: 'value1', key2: 'value2' };
320
+ const expectedOutput = JSON.stringify(input);
321
+ const result = handleGPPData(input);
322
+ expect(result).to.equal(expectedOutput);
323
+ });
324
+
325
+ it('should handle empty object', function () {
326
+ const input = {};
327
+ const expectedOutput = JSON.stringify(input);
328
+ const result = handleGPPData(input);
329
+ expect(result).to.equal(expectedOutput);
330
+ });
331
+
332
+ it('should handle empty array', function () {
333
+ const input = [];
334
+ const expectedOutput = JSON.stringify({});
335
+ const result = handleGPPData(input);
336
+ expect(result).to.equal(expectedOutput);
337
+ });
338
+ });
339
+
340
+ describe('detectBrowserFromUserAgent', function () {
341
+ it('should detect Chrome browser', function () {
342
+ const userAgent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36';
343
+ const result = detectBrowserFromUserAgent(userAgent);
344
+ expect(result).to.equal('chrome');
345
+ });
346
+
347
+ it('should detect Safari browser', function () {
348
+ const userAgent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.3 Safari/605.1.15';
349
+ const result = detectBrowserFromUserAgent(userAgent);
350
+ expect(result).to.equal('safari');
351
+ });
352
+
353
+ it('should detect Firefox browser', function () {
354
+ const userAgent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0';
355
+ const result = detectBrowserFromUserAgent(userAgent);
356
+ expect(result).to.equal('firefox');
357
+ });
358
+ });
359
+
360
+ describe('detectBrowserFromUserAgentData', function () {
361
+ it('should detect Microsoft Edge browser', function () {
362
+ const userAgentData = {
363
+ brands: [
364
+ { brand: 'Microsoft Edge', version: '91' },
365
+ { brand: 'Chromium', version: '91' }
366
+ ]
367
+ };
368
+ const result = detectBrowserFromUserAgentData(userAgentData);
369
+ expect(result).to.equal('edge');
370
+ });
371
+
372
+ it('should detect Chrome browser', function () {
373
+ const userAgentData = {
374
+ brands: [
375
+ { brand: 'Google Chrome', version: '91' },
376
+ { brand: 'Chromium', version: '91' }
377
+ ]
378
+ };
379
+ const result = detectBrowserFromUserAgentData(userAgentData);
380
+ expect(result).to.equal('chrome');
381
+ });
382
+
383
+ it('should return unknown for unrecognized user agent data', function () {
384
+ const userAgentData = {
385
+ brands: [
386
+ { brand: 'Unknown Browser', version: '1.0' }
387
+ ]
388
+ };
389
+ const result = detectBrowserFromUserAgentData(userAgentData);
390
+ expect(result).to.equal('unknown');
391
+ });
392
+ });
393
+
394
+ describe('IntentIQ consent management within getId', function () {
395
+ let uspDataHandlerStub;
396
+ let gppDataHandlerStub;
397
+
398
+ beforeEach(function () {
399
+ localStorage.clear();
400
+ const expiredDate = new Date(0).toUTCString();
401
+ storage.setCookie(FIRST_PARTY_KEY, '', expiredDate, 'Lax');
402
+ storage.setCookie(FIRST_PARTY_KEY + '_' + partner, '', expiredDate, 'Lax');
403
+ uspDataHandlerStub = sinon.stub(uspDataHandler, 'getConsentData');
404
+ gppDataHandlerStub = sinon.stub(gppDataHandler, 'getConsentData');
405
+ });
406
+
407
+ afterEach(function () {
408
+ uspDataHandlerStub.restore();
409
+ gppDataHandlerStub.restore();
410
+ });
411
+
412
+ it('should set cmpData.us_privacy if uspData exists', function () {
413
+ const uspData = '1NYN';
414
+ uspDataHandlerStub.returns(uspData);
415
+ let callBackSpy = sinon.spy();
416
+ let submoduleCallback = intentIqIdSubmodule.getId(defaultConfigParams).callback;
417
+ submoduleCallback(callBackSpy);
418
+ let request = server.requests[0];
419
+ expect(request.url).to.contain('https://api.intentiq.com/profiles_engine/ProfilesEngineServlet?at=39&mi=10&dpi=10&pt=17&dpn=1&iiqidtype=2&iiqpcid=');
420
+ request.respond(
421
+ 200,
422
+ responseHeader,
423
+ JSON.stringify({ pid: 'test_pid', data: 'test_personid', ls: false, isOptedOut: false })
424
+ );
425
+ expect(callBackSpy.calledOnce).to.be.true;
426
+
427
+ // Check the local storage directly to see if cmpData.us_privacy was set correctly
428
+ const firstPartyData = JSON.parse(localStorage.getItem(FIRST_PARTY_KEY));
429
+ expect(firstPartyData.uspapi_value).to.equal(uspData);
430
+ });
431
+
432
+ it('should set cmpData.gpp and cmpData.gpp_sid if gppData exists and has parsedSections with usnat', function () {
433
+ const gppData = {
434
+ parsedSections: {
435
+ usnat: { key1: 'value1', key2: 'value2' }
436
+ },
437
+ applicableSections: ['usnat']
438
+ };
439
+ gppDataHandlerStub.returns(gppData);
440
+
441
+ let callBackSpy = sinon.spy();
442
+ let submoduleCallback = intentIqIdSubmodule.getId(defaultConfigParams).callback;
443
+ submoduleCallback(callBackSpy);
444
+ let request = server.requests[0];
445
+ expect(request.url).to.contain('https://api.intentiq.com/profiles_engine/ProfilesEngineServlet?at=39&mi=10&dpi=10&pt=17&dpn=1&iiqidtype=2&iiqpcid=');
446
+ request.respond(
447
+ 200,
448
+ responseHeader,
449
+ JSON.stringify({ pid: 'test_pid', data: 'test_personid', ls: false, isOptedOut: false })
450
+ );
451
+ expect(callBackSpy.calledOnce).to.be.true;
452
+
453
+ const firstPartyData = JSON.parse(localStorage.getItem(FIRST_PARTY_KEY));
454
+ expect(firstPartyData.gpp_value).to.equal(JSON.stringify({ key1: 'value1', key2: 'value2' }));
455
+ });
456
+
457
+ it('should handle gppData without usnat in parsedSections', function () {
458
+ const gppData = {
459
+ parsedSections: {
460
+ euconsent: { key1: 'value1' }
461
+ },
462
+ applicableSections: ['euconsent']
463
+ };
464
+ gppDataHandlerStub.returns(gppData);
465
+
466
+ let callBackSpy = sinon.spy();
467
+ let submoduleCallback = intentIqIdSubmodule.getId(defaultConfigParams).callback;
468
+ submoduleCallback(callBackSpy);
469
+ let request = server.requests[0];
470
+ expect(request.url).to.contain('https://api.intentiq.com/profiles_engine/ProfilesEngineServlet?at=39&mi=10&dpi=10&pt=17&dpn=1&iiqidtype=2&iiqpcid=');
471
+ request.respond(
472
+ 200,
473
+ responseHeader,
474
+ JSON.stringify({ pid: 'test_pid', data: 'test_personid', ls: false, isOptedOut: true })
475
+ );
476
+ expect(callBackSpy.calledOnce).to.be.true;
477
+
478
+ const firstPartyData = JSON.parse(localStorage.getItem(FIRST_PARTY_KEY));
479
+ expect(firstPartyData.gpp_value).to.equal('');
480
+ });
481
+ });
482
+
483
+ it('should get and save client hints to storge', async () => {
484
+ // Client hints are async function, thats why async/await is using
485
+ localStorage.clear();
486
+ Object.defineProperty(navigator, 'userAgentData', {
487
+ value: { getHighEntropyValues: async () => testClientHints },
488
+ configurable: true
489
+ });
490
+ await intentIqIdSubmodule.getId(defaultConfigParams);
491
+ const savedClientHints = readData(CLIENT_HINTS_KEY, ['html5']);
492
+ expect(savedClientHints).to.equal(handleClientHints(testClientHints));
265
493
  });
266
494
  });
@@ -2,6 +2,14 @@ import {expect} from 'chai';
2
2
  import {
3
3
  spec as adapter,
4
4
  createDomain,
5
+ storage
6
+ } from 'modules/kueezRtbBidAdapter.js';
7
+ import * as utils from 'src/utils.js';
8
+ import {version} from 'package.json';
9
+ import {useFakeTimers} from 'sinon';
10
+ import {BANNER, VIDEO} from '../../../src/mediaTypes';
11
+ import {config} from '../../../src/config';
12
+ import {
5
13
  hashCode,
6
14
  extractPID,
7
15
  extractCID,
@@ -10,12 +18,7 @@ import {
10
18
  setStorageItem,
11
19
  tryParseJSON,
12
20
  getUniqueDealId,
13
- } from 'modules/kueezRtbBidAdapter.js';
14
- import * as utils from 'src/utils.js';
15
- import {version} from 'package.json';
16
- import {useFakeTimers} from 'sinon';
17
- import {BANNER, VIDEO} from '../../../src/mediaTypes';
18
- import {config} from '../../../src/config';
21
+ } from '../../../libraries/vidazooUtils/bidderUtils.js';
19
22
 
20
23
  export const TEST_ID_SYSTEMS = ['britepoolid', 'criteoId', 'id5id', 'idl_env', 'lipb', 'netId', 'parrableId', 'pubcid', 'tdid', 'pubProvidedId'];
21
24
 
@@ -322,7 +325,12 @@ describe('KueezRtbBidAdapter', function () {
322
325
  startdelay: 0
323
326
  }
324
327
  },
325
- gpid: ''
328
+ gpid: '',
329
+ cat: [],
330
+ contentData: [],
331
+ isStorageAllowed: true,
332
+ pagecat: [],
333
+ userData: []
326
334
  }
327
335
  });
328
336
  });
@@ -384,6 +392,11 @@ describe('KueezRtbBidAdapter', function () {
384
392
  uqs: getTopWindowQueryParams(),
385
393
  'ext.param1': 'loremipsum',
386
394
  'ext.param2': 'dolorsitamet',
395
+ cat: [],
396
+ contentData: [],
397
+ isStorageAllowed: true,
398
+ pagecat: [],
399
+ userData: []
387
400
  }
388
401
  });
389
402
  });
@@ -526,8 +539,6 @@ describe('KueezRtbBidAdapter', function () {
526
539
  switch (idSystemProvider) {
527
540
  case 'lipb':
528
541
  return {lipbid: id};
529
- case 'parrableId':
530
- return {eid: id};
531
542
  case 'id5id':
532
543
  return {uid: id};
533
544
  default:
@@ -580,13 +591,13 @@ describe('KueezRtbBidAdapter', function () {
580
591
  const key = 'myKey';
581
592
  let uniqueDealId;
582
593
  beforeEach(() => {
583
- uniqueDealId = getUniqueDealId(key, 0);
594
+ uniqueDealId = getUniqueDealId(storage, key, 0);
584
595
  })
585
596
 
586
597
  it('should get current unique deal id', function (done) {
587
598
  // waiting some time so `now` will become past
588
599
  setTimeout(() => {
589
- const current = getUniqueDealId(key);
600
+ const current = getUniqueDealId(storage, key);
590
601
  expect(current).to.be.equal(uniqueDealId);
591
602
  done();
592
603
  }, 200);
@@ -594,7 +605,7 @@ describe('KueezRtbBidAdapter', function () {
594
605
 
595
606
  it('should get new unique deal id on expiration', function (done) {
596
607
  setTimeout(() => {
597
- const current = getUniqueDealId(key, 100);
608
+ const current = getUniqueDealId(storage, key, 100);
598
609
  expect(current).to.not.be.equal(uniqueDealId);
599
610
  done();
600
611
  }, 200)
@@ -618,8 +629,8 @@ describe('KueezRtbBidAdapter', function () {
618
629
  shouldAdvanceTime: true,
619
630
  now
620
631
  });
621
- setStorageItem('myKey', 2020);
622
- const {value, created} = getStorageItem('myKey');
632
+ setStorageItem(storage, 'myKey', 2020);
633
+ const {value, created} = getStorageItem(storage, 'myKey');
623
634
  expect(created).to.be.equal(now);
624
635
  expect(value).to.be.equal(2020);
625
636
  expect(typeof value).to.be.equal('number');
@@ -630,7 +641,7 @@ describe('KueezRtbBidAdapter', function () {
630
641
  it('should get external stored value', function () {
631
642
  const value = 'superman'
632
643
  window.localStorage.setItem('myExternalKey', value);
633
- const item = getStorageItem('myExternalKey');
644
+ const item = getStorageItem(storage, 'myExternalKey');
634
645
  expect(item).to.be.equal(value);
635
646
  });
636
647