prebid.js 9.52.0 → 9.53.2

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 (235) hide show
  1. package/.circleci/config.yml +27 -4
  2. package/creative/crossDomain.js +4 -2
  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/adagioUtils.js +1 -1
  10. package/dist/addefendBidAdapter.js +1 -1
  11. package/dist/adgenerationBidAdapter.js +1 -1
  12. package/dist/adlooxRtdProvider.js +1 -1
  13. package/dist/adqueryBidAdapter.js +1 -1
  14. package/dist/adrelevantisBidAdapter.js +1 -1
  15. package/dist/adstirBidAdapter.js +1 -1
  16. package/dist/adtrgtmeBidAdapter.js +1 -1
  17. package/dist/adxcgAnalyticsAdapter.js +1 -1
  18. package/dist/adxcgBidAdapter.js +1 -1
  19. package/dist/adyoulikeBidAdapter.js +1 -1
  20. package/dist/agmaAnalyticsAdapter.js +1 -1
  21. package/dist/ajaBidAdapter.js +1 -1
  22. package/dist/amxBidAdapter.js +1 -1
  23. package/dist/amxIdSystem.js +1 -1
  24. package/dist/aniviewBidAdapter.js +1 -1
  25. package/dist/appierAnalyticsAdapter.js +1 -1
  26. package/dist/appnexusBidAdapter.js +1 -1
  27. package/dist/asoBidAdapter.js +1 -1
  28. package/dist/axonixBidAdapter.js +1 -1
  29. package/dist/beopBidAdapter.js +1 -1
  30. package/dist/bidglassBidAdapter.js +1 -1
  31. package/dist/big-richmediaBidAdapter.js +1 -1
  32. package/dist/bitmediaBidAdapter.js +1 -1
  33. package/dist/bridBidAdapter.js +1 -1
  34. package/dist/bridgeuppBidAdapter.js +1 -1
  35. package/dist/bridgewellBidAdapter.js +1 -1
  36. package/dist/brightMountainMediaBidAdapter.js +1 -1
  37. package/dist/carodaBidAdapter.js +1 -1
  38. package/dist/chromeAiRtdProvider.js +1 -0
  39. package/dist/chtnwBidAdapter.js +1 -1
  40. package/dist/chunk-core.js +1 -1
  41. package/dist/concertBidAdapter.js +1 -1
  42. package/dist/connectadBidAdapter.js +1 -1
  43. package/dist/consumableBidAdapter.js +1 -1
  44. package/dist/contxtfulBidAdapter.js +1 -1
  45. package/dist/conversantAnalyticsAdapter.js +1 -1
  46. package/dist/conversantBidAdapter.js +1 -1
  47. package/dist/craftBidAdapter.js +1 -1
  48. package/dist/criteoBidAdapter.js +1 -1
  49. package/dist/cwireBidAdapter.js +1 -1
  50. package/dist/dailymotionBidAdapter.js +1 -1
  51. package/dist/debugging-standalone.js +1 -1
  52. package/dist/dependencies.json +10 -2
  53. package/dist/dspxBidAdapter.js +1 -1
  54. package/dist/dxkultureBidAdapter.js +1 -1
  55. package/dist/eplanningBidAdapter.js +1 -1
  56. package/dist/equativBidAdapter.js +1 -1
  57. package/dist/eskimiBidAdapter.js +1 -1
  58. package/dist/euidIdSystem.js +1 -1
  59. package/dist/exadsBidAdapter.js +1 -1
  60. package/dist/excoBidAdapter.js +1 -1
  61. package/dist/fanAdapter.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/greenbidsAnalyticsAdapter.js +1 -1
  67. package/dist/greenbidsBidAdapter.js +1 -1
  68. package/dist/greenbidsRtdProvider.js +1 -1
  69. package/dist/gridBidAdapter.js +1 -1
  70. package/dist/gumgumBidAdapter.js +1 -1
  71. package/dist/h12mediaBidAdapter.js +1 -1
  72. package/dist/hypelabBidAdapter.js +1 -1
  73. package/dist/id5AnalyticsAdapter.js +1 -1
  74. package/dist/id5IdSystem.js +1 -1
  75. package/dist/imdsBidAdapter.js +1 -1
  76. package/dist/improvedigitalBidAdapter.js +1 -1
  77. package/dist/inmobiBidAdapter.js +1 -1
  78. package/dist/insticatorBidAdapter.js +1 -1
  79. package/dist/intentIqAnalyticsAdapter.js +1 -1
  80. package/dist/ixBidAdapter.js +1 -1
  81. package/dist/jixieBidAdapter.js +1 -1
  82. package/dist/jixieIdSystem.js +1 -0
  83. package/dist/justpremiumBidAdapter.js +1 -1
  84. package/dist/kargoBidAdapter.js +1 -1
  85. package/dist/kimberliteBidAdapter.js +1 -1
  86. package/dist/konduitAnalyticsAdapter.js +1 -1
  87. package/dist/kueezBidAdapter.js +1 -1
  88. package/dist/lassoBidAdapter.js +1 -1
  89. package/dist/lifestreetBidAdapter.js +1 -1
  90. package/dist/liveIntentId.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/mabidderBidAdapter.js +1 -1
  95. package/dist/madsenseBidAdapter.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/medianetBidAdapter.js +1 -1
  101. package/dist/medianetUtils.js +1 -1
  102. package/dist/mediasquareBidAdapter.js +1 -1
  103. package/dist/mgidBidAdapter.js +1 -1
  104. package/dist/missenaBidAdapter.js +1 -1
  105. package/dist/mobilefuseBidAdapter.js +1 -1
  106. package/dist/nextMillenniumBidAdapter.js +1 -1
  107. package/dist/nexx360Utils.js +1 -1
  108. package/dist/nobidAnalyticsAdapter.js +1 -1
  109. package/dist/nobidBidAdapter.js +1 -1
  110. package/dist/nodalsAiRtdProvider.js +1 -1
  111. package/dist/not-for-prod/prebid.js +175 -173
  112. package/dist/oguryBidAdapter.js +1 -1
  113. package/dist/onetagBidAdapter.js +1 -1
  114. package/dist/ooloAnalyticsAdapter.js +1 -1
  115. package/dist/openxBidAdapter.js +1 -1
  116. package/dist/optidigitalBidAdapter.js +1 -1
  117. package/dist/orbidderBidAdapter.js +1 -1
  118. package/dist/ortb2.5Translator.js +1 -1
  119. package/dist/outbrainBidAdapter.js +1 -1
  120. package/dist/ozoneBidAdapter.js +1 -1
  121. package/dist/pixfutureBidAdapter.js +1 -1
  122. package/dist/prebidServerBidAdapter.js +1 -1
  123. package/dist/publinkIdSystem.js +1 -1
  124. package/dist/pubmaticAnalyticsAdapter.js +1 -1
  125. package/dist/pubmaticBidAdapter.js +1 -1
  126. package/dist/pubmaticRtdProvider.js +1 -1
  127. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  128. package/dist/pubxaiAnalyticsAdapter.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/relevatehealthBidAdapter.js +1 -1
  134. package/dist/retailspotBidAdapter.js +1 -1
  135. package/dist/rhythmoneBidAdapter.js +1 -1
  136. package/dist/riseUtils.js +1 -1
  137. package/dist/rubiconBidAdapter.js +1 -1
  138. package/dist/seedingAllianceBidAdapter.js +1 -1
  139. package/dist/seedtagBidAdapter.js +1 -1
  140. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  141. package/dist/sharethroughBidAdapter.js +1 -1
  142. package/dist/showheroes-bsBidAdapter.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/smilewantedBidAdapter.js +1 -1
  147. package/dist/snigelBidAdapter.js +1 -1
  148. package/dist/sonobiBidAdapter.js +1 -1
  149. package/dist/sovrnBidAdapter.js +1 -1
  150. package/dist/sparteoBidAdapter.js +1 -1
  151. package/dist/sspBCBidAdapter.js +1 -1
  152. package/dist/stvBidAdapter.js +1 -1
  153. package/dist/sublimeBidAdapter.js +1 -1
  154. package/dist/taboolaBidAdapter.js +1 -1
  155. package/dist/tappxBidAdapter.js +1 -1
  156. package/dist/targetVideoBidAdapter.js +1 -1
  157. package/dist/teadsBidAdapter.js +1 -1
  158. package/dist/terceptAnalyticsAdapter.js +1 -1
  159. package/dist/themoneytizerBidAdapter.js +1 -1
  160. package/dist/trionBidAdapter.js +1 -1
  161. package/dist/tripleliftBidAdapter.js +1 -1
  162. package/dist/ttdBidAdapter.js +1 -1
  163. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  164. package/dist/uid2IdSystem.js +1 -1
  165. package/dist/underdogmediaBidAdapter.js +1 -1
  166. package/dist/undertoneBidAdapter.js +1 -1
  167. package/dist/unrulyBidAdapter.js +1 -1
  168. package/dist/userId.js +1 -1
  169. package/dist/vidazooUtils.js +1 -1
  170. package/dist/videobyteBidAdapter.js +1 -1
  171. package/dist/visxBidAdapter.js +1 -1
  172. package/dist/vuukleBidAdapter.js +1 -1
  173. package/dist/widespaceBidAdapter.js +1 -1
  174. package/dist/winrBidAdapter.js +1 -1
  175. package/dist/yahooAdsBidAdapter.js +1 -1
  176. package/dist/yandexBidAdapter.js +1 -1
  177. package/dist/yieldmoBidAdapter.js +1 -1
  178. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  179. package/gulpfile.js +12 -6
  180. package/integrationExamples/chromeai/japanese.html +224 -0
  181. package/integrationExamples/gpt/x-domain/creative.html +1 -1
  182. package/karma.conf.maker.js +7 -7
  183. package/karmaRunner.js +3 -3
  184. package/libraries/liveIntentId/shared.js +16 -0
  185. package/modules/.submodules.json +1 -0
  186. package/modules/aniviewBidAdapter.js +32 -23
  187. package/modules/chromeAiRtdProvider.js +421 -0
  188. package/modules/chromeAiRtdProvider.md +230 -0
  189. package/modules/fanAdapter.js +318 -124
  190. package/modules/ixBidAdapter.js +5 -0
  191. package/modules/jixieIdSystem.js +186 -0
  192. package/modules/ozoneBidAdapter.js +214 -336
  193. package/modules/prebidServerBidAdapter/index.js +59 -35
  194. package/modules/pubmaticRtdProvider.js +418 -4
  195. package/modules/pubmaticRtdProvider.md +12 -2
  196. package/modules/relevatehealthBidAdapter.js +20 -130
  197. package/modules/relevatehealthBidAdapter.md +1 -2
  198. package/modules/sovrnBidAdapter.js +4 -4
  199. package/modules/teadsBidAdapter.js +5 -0
  200. package/modules/ttdBidAdapter.js +5 -4
  201. package/modules/userId/index.js +30 -31
  202. package/package.json +5 -4
  203. package/src/adapterManager.js +3 -0
  204. package/test/spec/libraries/cmUtils_spec.js +17 -12
  205. package/test/spec/modules/aniviewBidAdapter_spec.js +15 -2
  206. package/test/spec/modules/chromeAiRtdProvider_spec.js +393 -0
  207. package/test/spec/modules/dgkeywordRtdProvider_spec.js +5 -2
  208. package/test/spec/modules/euidIdSystem_spec.js +9 -3
  209. package/test/spec/modules/fanAdapter_spec.js +264 -268
  210. package/test/spec/modules/id5IdSystem_spec.js +57 -101
  211. package/test/spec/modules/identityLinkIdSystem_spec.js +1 -0
  212. package/test/spec/modules/idxIdSystem_spec.js +2 -75
  213. package/test/spec/modules/instreamTracking_spec.js +15 -18
  214. package/test/spec/modules/ixBidAdapter_spec.js +26 -0
  215. package/test/spec/modules/jixieIdSystem_spec.js +303 -0
  216. package/test/spec/modules/liveIntentExternalIdSystem_spec.js +5 -0
  217. package/test/spec/modules/liveIntentIdMinimalSystem_spec.js +5 -0
  218. package/test/spec/modules/liveIntentIdSystem_spec.js +38 -0
  219. package/test/spec/modules/lmpIdSystem_spec.js +2 -81
  220. package/test/spec/modules/ozoneBidAdapter_spec.js +511 -658
  221. package/test/spec/modules/prebidServerBidAdapter_spec.js +72 -2
  222. package/test/spec/modules/pubmaticBidAdapter_spec.js +411 -126
  223. package/test/spec/modules/pubmaticRtdProvider_spec.js +946 -2
  224. package/test/spec/modules/raynRtdProvider_spec.js +18 -22
  225. package/test/spec/modules/relevatehealthBidAdapter_spec.js +9 -39
  226. package/test/spec/modules/sharedIdSystem_spec.js +3 -3
  227. package/test/spec/modules/sovrnBidAdapter_spec.js +71 -3
  228. package/test/spec/modules/teadsBidAdapter_spec.js +9 -4
  229. package/test/spec/modules/ttdBidAdapter_spec.js +24 -2
  230. package/test/spec/modules/uid2IdSystem_helpers.js +5 -2
  231. package/test/spec/modules/userId_spec.js +142 -387
  232. package/test/spec/modules/yieldoneAnalyticsAdapter_spec.js +13 -12
  233. package/test/spec/modules/zeotapIdPlusIdSystem_spec.js +3 -69
  234. package/wdio.shared.conf.js +2 -2
  235. package/CLAUDE.md +0 -1
@@ -929,7 +929,7 @@ describe('ID5 ID System', function () {
929
929
  });
930
930
 
931
931
  describe('Request Bids Hook', function () {
932
- let adUnits;
932
+ let adUnits, ortb2Fragments;
933
933
  let sandbox;
934
934
 
935
935
  beforeEach(function () {
@@ -940,6 +940,9 @@ describe('ID5 ID System', function () {
940
940
  coreStorage.removeDataFromLocalStorage(`${id5System.ID5_STORAGE_NAME}_last`);
941
941
  coreStorage.setDataInLocalStorage(id5System.ID5_STORAGE_NAME + '_cst', getConsentHash());
942
942
  adUnits = [getAdUnitMock()];
943
+ ortb2Fragments = {
944
+ global: {}
945
+ }
943
946
  });
944
947
  afterEach(function () {
945
948
  events.getEvents.restore();
@@ -958,24 +961,18 @@ describe('ID5 ID System', function () {
958
961
  config.setConfig(getFetchLocalStorageConfig());
959
962
 
960
963
  startAuctionHook(wrapAsyncExpects(done, () => {
961
- adUnits.forEach(unit => {
962
- unit.bids.forEach(bid => {
963
- expect(bid).to.have.deep.nested.property(`userId.${ID5_EIDS_NAME}`);
964
- expect(bid.userId.id5id.uid).is.equal(ID5_STORED_ID);
965
- expect(bid.userIdAsEids[0]).is.eql({
966
- source: ID5_SOURCE,
967
- uids: [{
968
- id: ID5_STORED_ID,
969
- atype: 1,
970
- ext: {
971
- linkType: ID5_STORED_LINK_TYPE
972
- }
973
- }]
974
- });
975
- });
964
+ expect(ortb2Fragments.global.user.ext.eids[0]).is.eql({
965
+ source: ID5_SOURCE,
966
+ uids: [{
967
+ id: ID5_STORED_ID,
968
+ atype: 1,
969
+ ext: {
970
+ linkType: ID5_STORED_LINK_TYPE
971
+ }
972
+ }]
976
973
  });
977
974
  done();
978
- }), {adUnits});
975
+ }), {ortb2Fragments});
979
976
  });
980
977
 
981
978
  it('should add stored EUID from cache to bids', function (done) {
@@ -986,25 +983,19 @@ describe('ID5 ID System', function () {
986
983
  config.setConfig(getFetchLocalStorageConfig());
987
984
 
988
985
  startAuctionHook(function () {
989
- adUnits.forEach(unit => {
990
- unit.bids.forEach(bid => {
991
- expect(bid).to.have.deep.nested.property(`userId.euid`);
992
- expect(bid.userId.euid.uid).is.equal(EUID_STORED_ID);
993
- expect(bid.userIdAsEids[0].uids[0].id).is.equal(ID5_STORED_ID);
994
- expect(bid.userIdAsEids[1]).is.eql({
995
- source: EUID_SOURCE,
996
- uids: [{
997
- id: EUID_STORED_ID,
998
- atype: 3,
999
- ext: {
1000
- provider: ID5_SOURCE
1001
- }
1002
- }]
1003
- });
1004
- });
986
+ expect(ortb2Fragments.global.user.ext.eids[0].uids[0].id).is.equal(ID5_STORED_ID);
987
+ expect(ortb2Fragments.global.user.ext.eids[1]).is.eql({
988
+ source: EUID_SOURCE,
989
+ uids: [{
990
+ id: EUID_STORED_ID,
991
+ atype: 3,
992
+ ext: {
993
+ provider: ID5_SOURCE
994
+ }
995
+ }]
1005
996
  });
1006
997
  done();
1007
- }, {adUnits});
998
+ }, {ortb2Fragments});
1008
999
  });
1009
1000
 
1010
1001
  it('should add stored TRUE_LINK_ID from cache to bids', function (done) {
@@ -1015,21 +1006,15 @@ describe('ID5 ID System', function () {
1015
1006
  config.setConfig(getFetchLocalStorageConfig());
1016
1007
 
1017
1008
  startAuctionHook(wrapAsyncExpects(done, function () {
1018
- adUnits.forEach(unit => {
1019
- unit.bids.forEach(bid => {
1020
- expect(bid).to.have.deep.nested.property(`userId.trueLinkId`);
1021
- expect(bid.userId.trueLinkId.uid).is.equal(TRUE_LINK_STORED_ID);
1022
- expect(bid.userIdAsEids[1]).is.eql({
1023
- source: TRUE_LINK_SOURCE,
1024
- uids: [{
1025
- id: TRUE_LINK_STORED_ID,
1026
- atype: 1
1027
- }]
1028
- });
1029
- });
1009
+ expect(ortb2Fragments.global.user.ext.eids[1]).is.eql({
1010
+ source: TRUE_LINK_SOURCE,
1011
+ uids: [{
1012
+ id: TRUE_LINK_STORED_ID,
1013
+ atype: 1
1014
+ }]
1030
1015
  });
1031
1016
  done();
1032
- }), {adUnits});
1017
+ }), {ortb2Fragments});
1033
1018
  });
1034
1019
  });
1035
1020
 
@@ -1072,25 +1057,16 @@ describe('ID5 ID System', function () {
1072
1057
  config.setConfig(getFetchLocalStorageConfig());
1073
1058
  const id5IdEidUid = IDS_ID5ID.eid.uids[0];
1074
1059
  startAuctionHook(wrapAsyncExpects(done, () => {
1075
- adUnits.forEach(unit => {
1076
- unit.bids.forEach(bid => {
1077
- expect(bid).to.have.deep.nested.property(`userId.${ID5_EIDS_NAME}`);
1078
- expect(bid.userId.id5id).is.eql({
1079
- uid: id5IdEidUid.id,
1080
- ext: id5IdEidUid.ext
1081
- });
1082
- expect(bid.userIdAsEids[0]).is.eql({
1083
- source: IDS_ID5ID.eid.source,
1084
- uids: [{
1085
- id: id5IdEidUid.id,
1086
- atype: id5IdEidUid.atype,
1087
- ext: id5IdEidUid.ext
1088
- }]
1089
- });
1090
- });
1060
+ expect(ortb2Fragments.global.user.ext.eids[0]).is.eql({
1061
+ source: IDS_ID5ID.eid.source,
1062
+ uids: [{
1063
+ id: id5IdEidUid.id,
1064
+ atype: id5IdEidUid.atype,
1065
+ ext: id5IdEidUid.ext
1066
+ }]
1091
1067
  });
1092
1068
  done();
1093
- }), {adUnits});
1069
+ }), {ortb2Fragments});
1094
1070
  });
1095
1071
  it('should add stored EUID from cache to bids - from ids', function (done) {
1096
1072
  storeInStorage(id5System.ID5_STORAGE_NAME, JSON.stringify({
@@ -1106,19 +1082,11 @@ describe('ID5 ID System', function () {
1106
1082
  config.setConfig(getFetchLocalStorageConfig());
1107
1083
 
1108
1084
  startAuctionHook(wrapAsyncExpects(done, () => {
1109
- adUnits.forEach(unit => {
1110
- unit.bids.forEach(bid => {
1111
- expect(bid).to.have.deep.nested.property(`userId.euid`);
1112
- expect(bid.userId.euid).is.eql({
1113
- uid: IDS_EUID.eid.uids[0].id,
1114
- ext: IDS_EUID.eid.uids[0].ext
1115
- });
1116
- expect(bid.userIdAsEids[0]).is.eql(IDS_ID5ID.eid);
1117
- expect(bid.userIdAsEids[1]).is.eql(IDS_EUID.eid);
1118
- });
1119
- });
1085
+ const eids = ortb2Fragments.global.user.ext.eids;
1086
+ expect(eids[0]).is.eql(IDS_ID5ID.eid);
1087
+ expect(eids[1]).is.eql(IDS_EUID.eid);
1120
1088
  done();
1121
- }), {adUnits});
1089
+ }), {ortb2Fragments});
1122
1090
  });
1123
1091
 
1124
1092
  it('should add stored TRUE_LINK_ID from cache to bids - from ids', function (done) {
@@ -1135,15 +1103,9 @@ describe('ID5 ID System', function () {
1135
1103
  config.setConfig(getFetchLocalStorageConfig());
1136
1104
 
1137
1105
  startAuctionHook(wrapAsyncExpects(done, function () {
1138
- adUnits.forEach(unit => {
1139
- unit.bids.forEach(bid => {
1140
- expect(bid).to.have.deep.nested.property(`userId.trueLinkId`);
1141
- expect(bid.userId.trueLinkId.uid).is.eql(IDS_TRUE_LINK_ID.eid.uids[0].id);
1142
- expect(bid.userIdAsEids[1]).is.eql(IDS_TRUE_LINK_ID.eid);
1143
- });
1144
- });
1106
+ expect(ortb2Fragments.global.user.ext.eids[1]).is.eql(IDS_TRUE_LINK_ID.eid);
1145
1107
  done();
1146
- }), {adUnits});
1108
+ }), {ortb2Fragments});
1147
1109
  });
1148
1110
 
1149
1111
  it('should add other id from cache to bids', function (done) {
@@ -1176,25 +1138,19 @@ describe('ID5 ID System', function () {
1176
1138
  config.setConfig(getFetchLocalStorageConfig());
1177
1139
 
1178
1140
  startAuctionHook(wrapAsyncExpects(done, function () {
1179
- adUnits.forEach(unit => {
1180
- unit.bids.forEach(bid => {
1181
- expect(bid).to.have.deep.nested.property(`userId.otherId`);
1182
- expect(bid.userId.otherId.uid).is.eql('other-id-value');
1183
- expect(bid.userIdAsEids[1]).is.eql({
1184
- source: 'other-id.com',
1185
- inserter: 'id5-sync.com',
1186
- uids: [{
1187
- id: 'other-id-value',
1188
- atype: 2,
1189
- ext: {
1190
- provider: 'id5-sync.com'
1191
- }
1192
- }]
1193
- });
1194
- });
1141
+ expect(ortb2Fragments.global.user.ext.eids[1]).is.eql({
1142
+ source: 'other-id.com',
1143
+ inserter: 'id5-sync.com',
1144
+ uids: [{
1145
+ id: 'other-id-value',
1146
+ atype: 2,
1147
+ ext: {
1148
+ provider: 'id5-sync.com'
1149
+ }
1150
+ }]
1195
1151
  });
1196
1152
  done();
1197
- }), {adUnits});
1153
+ }), {ortb2Fragments});
1198
1154
  });
1199
1155
  });
1200
1156
  });
@@ -31,6 +31,7 @@ describe('IdentityLinkId tests', function () {
31
31
  // remove _lr_retry_request cookie before test
32
32
  storage.setCookie('_lr_retry_request', 'true', 'Thu, 01 Jan 1970 00:00:01 GMT');
33
33
  storage.setCookie('_lr_env', testEnvelope, 'Thu, 01 Jan 1970 00:00:01 GMT');
34
+ storage.removeDataFromLocalStorage('_lr_env');
34
35
  });
35
36
 
36
37
  afterEach(function () {
@@ -1,8 +1,5 @@
1
- import { expect } from 'chai';
2
- import { config } from 'src/config.js';
3
- import { init, startAuctionHook, setSubmoduleRegistry } from 'modules/userId/index.js';
4
- import { storage, idxIdSubmodule } from 'modules/idxIdSystem.js';
5
- import {mockGdprConsent} from '../../helpers/consentData.js';
1
+ import {expect} from 'chai';
2
+ import {idxIdSubmodule, storage} from 'modules/idxIdSystem.js';
6
3
  import 'src/prebid.js';
7
4
 
8
5
  const IDX_COOKIE_NAME = '_idx';
@@ -11,32 +8,6 @@ const IDX_COOKIE_STORED = '{ "idx": "' + IDX_DUMMY_VALUE + '" }';
11
8
  const ID_COOKIE_OBJECT = { id: IDX_DUMMY_VALUE };
12
9
  const IDX_COOKIE_OBJECT = { idx: IDX_DUMMY_VALUE };
13
10
 
14
- function getConfigMock() {
15
- return {
16
- userSync: {
17
- syncDelay: 0,
18
- userIds: [{
19
- name: 'idx'
20
- }]
21
- }
22
- }
23
- }
24
-
25
- function getAdUnitMock(code = 'adUnit-code') {
26
- return {
27
- code,
28
- mediaTypes: {banner: {}, native: {}},
29
- sizes: [
30
- [300, 200],
31
- [300, 600]
32
- ],
33
- bids: [{
34
- bidder: 'sampleBidder',
35
- params: { placementId: 'banner-only-bidder' }
36
- }]
37
- };
38
- }
39
-
40
11
  describe('IDx ID System', () => {
41
12
  let getDataFromLocalStorageStub, localStorageIsEnabledStub;
42
13
  let getCookieStub, cookiesAreEnabledStub;
@@ -83,48 +54,4 @@ describe('IDx ID System', () => {
83
54
  expect(idxIdSubmodule.decode(IDX_DUMMY_VALUE)).to.deep.equal(IDX_COOKIE_OBJECT);
84
55
  });
85
56
  });
86
-
87
- describe('requestBids hook', () => {
88
- let adUnits;
89
- let sandbox;
90
-
91
- beforeEach(() => {
92
- sandbox = sinon.createSandbox();
93
- mockGdprConsent(sandbox);
94
- adUnits = [getAdUnitMock()];
95
- init(config);
96
- setSubmoduleRegistry([idxIdSubmodule]);
97
- getCookieStub.withArgs(IDX_COOKIE_NAME).returns(IDX_COOKIE_STORED);
98
- config.setConfig(getConfigMock());
99
- });
100
-
101
- afterEach(() => {
102
- sandbox.restore();
103
- config.resetConfig();
104
- })
105
-
106
- after(() => {
107
- init(config);
108
- })
109
-
110
- it('when a stored IDx exists it is added to bids', (done) => {
111
- startAuctionHook(() => {
112
- adUnits.forEach(unit => {
113
- unit.bids.forEach(bid => {
114
- expect(bid).to.have.deep.nested.property('userId.idx');
115
- expect(bid.userId.idx).to.equal(IDX_DUMMY_VALUE);
116
- const idxIdAsEid = bid.userIdAsEids.find(e => e.source == 'idx.lat');
117
- expect(idxIdAsEid).to.deep.equal({
118
- source: 'idx.lat',
119
- uids: [{
120
- id: IDX_DUMMY_VALUE,
121
- atype: 1,
122
- }]
123
- });
124
- });
125
- });
126
- done();
127
- }, { adUnits });
128
- });
129
- });
130
57
  });
@@ -11,6 +11,7 @@ const VIDEO_CACHE_KEY = '4cf395af-8fee-4960-af0e-88d44e399f14';
11
11
 
12
12
  let sandbox;
13
13
 
14
+ let clock;
14
15
  function enableInstreamTracking(regex) {
15
16
  let configStub = sandbox.stub(config, 'getConfig');
16
17
  configStub.withArgs('instreamTracking').returns(Object.assign(
@@ -147,10 +148,12 @@ function getMockInput(mediaType) {
147
148
  describe('Instream Tracking', function () {
148
149
  beforeEach(function () {
149
150
  sandbox = sinon.createSandbox();
151
+ clock = sandbox.useFakeTimers();
150
152
  });
151
153
 
152
154
  afterEach(function () {
153
155
  sandbox.restore();
156
+ clock.restore();
154
157
  });
155
158
 
156
159
  describe('gaurd checks', function () {
@@ -168,13 +171,13 @@ describe('Instream Tracking', function () {
168
171
  assert.isNotOk(trackInstreamDeliveredImpressions({adUnits: [], bidsReceived: [], bidderRequests: []}));
169
172
  });
170
173
 
171
- it('checks for instream bids', function (done) {
174
+ it('checks for instream bids', function () {
172
175
  enableInstreamTracking();
173
176
  assert.isNotOk(trackInstreamDeliveredImpressions(getMockInput('banner')), 'should not start tracking when banner bids are present')
174
177
  assert.isNotOk(trackInstreamDeliveredImpressions(getMockInput(OUTSTREAM)), 'should not start tracking when outstream bids are present')
175
178
  mockPerformanceApi({});
176
179
  assert.isOk(trackInstreamDeliveredImpressions(getMockInput(INSTREAM)), 'should start tracking when instream bids are present')
177
- setTimeout(done, 10);
180
+ clock.tick(10);
178
181
  });
179
182
  });
180
183
 
@@ -185,37 +188,31 @@ describe('Instream Tracking', function () {
185
188
  spyEventsOn = sandbox.spy(events, 'emit');
186
189
  });
187
190
 
188
- it('BID WON event is not emitted when no video cache key entries are present', function (done) {
191
+ it('BID WON event is not emitted when no video cache key entries are present', function () {
189
192
  enableInstreamTracking();
190
193
  trackInstreamDeliveredImpressions(getMockInput(INSTREAM));
191
194
  mockPerformanceApi({});
192
- setTimeout(function () {
193
- assert.isNotOk(spyEventsOn.calledWith('bidWon'))
194
- done()
195
- }, 10);
195
+ clock.tick(10);
196
+ assert.isNotOk(spyEventsOn.calledWith('bidWon'));
196
197
  });
197
198
 
198
- it('BID WON event is not emitted when ad server call is sent', function (done) {
199
+ it('BID WON event is not emitted when ad server call is sent', function () {
199
200
  enableInstreamTracking();
200
201
  mockPerformanceApi({adServerCallSent: true});
201
- setTimeout(function () {
202
- assert.isNotOk(spyEventsOn.calledWith('bidWon'))
203
- done()
204
- }, 10);
202
+ clock.tick(10);
203
+ assert.isNotOk(spyEventsOn.calledWith('bidWon'));
205
204
  });
206
205
 
207
- it('BID WON event is emitted when video cache key is present', function (done) {
206
+ it('BID WON event is emitted when video cache key is present', function () {
208
207
  enableInstreamTracking(/cache/);
209
208
  const bidWonSpy = sandbox.spy();
210
209
  events.on('bidWon', bidWonSpy);
211
210
  mockPerformanceApi({adServerCallSent: true, videoPresent: true});
212
211
 
213
212
  trackInstreamDeliveredImpressions(getMockInput(INSTREAM));
214
- setTimeout(function () {
215
- assert.isOk(spyEventsOn.calledWith('bidWon'))
216
- assert(bidWonSpy.args[0][0].videoCacheKey, VIDEO_CACHE_KEY, 'Video cache key in bid won should be equal to video cache call');
217
- done()
218
- }, 10);
213
+ clock.tick(10);
214
+ assert.isOk(spyEventsOn.calledWith('bidWon'));
215
+ assert(bidWonSpy.args[0][0].videoCacheKey, VIDEO_CACHE_KEY, 'Video cache key in bid won should be equal to video cache call');
219
216
  });
220
217
  });
221
218
  });
@@ -5432,6 +5432,32 @@ describe('IndexexchangeAdapter', function () {
5432
5432
  expect(payload.device.ip).to.be.undefined;
5433
5433
  expect(payload.device.ip6).to.be.undefined;
5434
5434
  });
5435
+
5436
+ it('should add device.geo if available in fpd', () => {
5437
+ const ortb2 = {
5438
+ device: {
5439
+ geo: {
5440
+ lat: 1,
5441
+ lon: 2,
5442
+ lastfix: 1,
5443
+ type: 1
5444
+ }
5445
+ }
5446
+ };
5447
+ const request = spec.buildRequests(DEFAULT_BANNER_VALID_BID, { ortb2 })[0];
5448
+ const payload = extractPayload(request);
5449
+ expect(payload.device.geo.lat).to.equal(1);
5450
+ expect(payload.device.geo.lon).to.equal(2);
5451
+ expect(payload.device.geo.lastfix).to.equal(1);
5452
+ expect(payload.device.geo.type).to.equal(1);
5453
+ });
5454
+
5455
+ it('should not add device.geo if it does not exist', () => {
5456
+ const ortb2 = {device: {}};
5457
+ const request = spec.buildRequests(DEFAULT_BANNER_VALID_BID, { ortb2 })[0];
5458
+ const payload = extractPayload(request);
5459
+ expect(payload.device.geo).to.be.undefined;
5460
+ });
5435
5461
  });
5436
5462
 
5437
5463
  describe('fetch requests', function () {