prebid.js 7.50.0 → 7.52.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 (240) hide show
  1. package/dist/33acrossBidAdapter.js +1 -1
  2. package/dist/33acrossIdSystem.js +1 -1
  3. package/dist/adagioBidAdapter.js +1 -1
  4. package/dist/adbookpspBidAdapter.js +1 -1
  5. package/dist/adgenerationBidAdapter.js +1 -1
  6. package/dist/adhashBidAdapter.js +1 -1
  7. package/dist/adkernelBidAdapter.js +1 -1
  8. package/dist/admanBidAdapter.js +1 -1
  9. package/dist/adnuntiusBidAdapter.js +1 -1
  10. package/dist/adqueryBidAdapter.js +1 -1
  11. package/dist/adrelevantisBidAdapter.js +1 -1
  12. package/dist/adrinoBidAdapter.js +1 -1
  13. package/dist/adriverIdSystem.js +1 -1
  14. package/dist/adtelligentBidAdapter.js +1 -1
  15. package/dist/adtrgtmeBidAdapter.js +1 -1
  16. package/dist/adxcgBidAdapter.js +1 -1
  17. package/dist/adyoulikeBidAdapter.js +1 -1
  18. package/dist/ajaBidAdapter.js +1 -1
  19. package/dist/allowActivities.js +1 -0
  20. package/dist/amxBidAdapter.js +1 -1
  21. package/dist/amxIdSystem.js +1 -1
  22. package/dist/appierAnalyticsAdapter.js +1 -1
  23. package/dist/appnexusBidAdapter.js +1 -1
  24. package/dist/asoBidAdapter.js +1 -1
  25. package/dist/axonixBidAdapter.js +1 -1
  26. package/dist/bidglassBidAdapter.js +1 -1
  27. package/dist/big-richmediaBidAdapter.js +1 -1
  28. package/dist/bridgewellBidAdapter.js +1 -1
  29. package/dist/brightMountainMediaBidAdapter.js +1 -1
  30. package/dist/carodaBidAdapter.js +1 -1
  31. package/dist/chtnwBidAdapter.js +1 -1
  32. package/dist/cleanioRtdProvider.js +1 -1
  33. package/dist/concertBidAdapter.js +1 -1
  34. package/dist/connectIdSystem.js +1 -1
  35. package/dist/connectadBidAdapter.js +1 -1
  36. package/dist/consumableBidAdapter.js +1 -1
  37. package/dist/conversantAnalyticsAdapter.js +1 -1
  38. package/dist/conversantBidAdapter.js +1 -1
  39. package/dist/craftBidAdapter.js +1 -1
  40. package/dist/criteoBidAdapter.js +1 -1
  41. package/dist/cwireBidAdapter.js +1 -1
  42. package/dist/dependencies.json +6 -0
  43. package/dist/dspxBidAdapter.js +1 -1
  44. package/dist/eplanningBidAdapter.js +1 -1
  45. package/dist/feedadBidAdapter.js +1 -1
  46. package/dist/finativeBidAdapter.js +1 -1
  47. package/dist/freewheel-sspBidAdapter.js +1 -1
  48. package/dist/gdprEnforcement.js +1 -1
  49. package/dist/glimpseBidAdapter.js +1 -1
  50. package/dist/gmosspBidAdapter.js +1 -1
  51. package/dist/goldbachBidAdapter.js +1 -1
  52. package/dist/greenbidsAnalyticsAdapter.js +1 -1
  53. package/dist/greenbidsRtdProvider.js +1 -1
  54. package/dist/gridBidAdapter.js +1 -1
  55. package/dist/growthCodeRtdProvider.js +1 -0
  56. package/dist/gumgumBidAdapter.js +1 -1
  57. package/dist/h12mediaBidAdapter.js +1 -1
  58. package/dist/id5IdSystem.js +1 -1
  59. package/dist/improvedigitalBidAdapter.js +1 -1
  60. package/dist/inmarBidAdapter.js +1 -1
  61. package/dist/insticatorBidAdapter.js +1 -1
  62. package/dist/ixBidAdapter.js +1 -1
  63. package/dist/justpremiumBidAdapter.js +1 -1
  64. package/dist/kargoBidAdapter.js +1 -1
  65. package/dist/konduitAnalyticsAdapter.js +1 -1
  66. package/dist/kueezBidAdapter.js +1 -1
  67. package/dist/kueezRtbBidAdapter.js +1 -1
  68. package/dist/kulturemediaBidAdapter.js +1 -1
  69. package/dist/lassoBidAdapter.js +1 -1
  70. package/dist/lifestreetBidAdapter.js +1 -1
  71. package/dist/liveyieldAnalyticsAdapter.js +1 -1
  72. package/dist/logicadBidAdapter.js +1 -1
  73. package/dist/loglyliftBidAdapter.js +1 -1
  74. package/dist/magniteAnalyticsAdapter.js +1 -1
  75. package/dist/malltvAnalyticsAdapter.js +1 -1
  76. package/dist/marsmediaBidAdapter.js +1 -1
  77. package/dist/mediafuseBidAdapter.js +1 -1
  78. package/dist/mediasquareBidAdapter.js +1 -1
  79. package/dist/mgidBidAdapter.js +1 -1
  80. package/dist/minutemediaBidAdapter.js +1 -1
  81. package/dist/minutemediaplusBidAdapter.js +1 -1
  82. package/dist/nexx360BidAdapter.js +1 -1
  83. package/dist/not-for-prod/prebid.js +144 -140
  84. package/dist/objectGuard.js +1 -0
  85. package/dist/oguryBidAdapter.js +1 -1
  86. package/dist/onetagBidAdapter.js +1 -1
  87. package/dist/ooloAnalyticsAdapter.js +1 -1
  88. package/dist/optidigitalBidAdapter.js +1 -1
  89. package/dist/outbrainBidAdapter.js +1 -1
  90. package/dist/oxxionAnalyticsAdapter.js +1 -0
  91. package/dist/pairIdSystem.js +1 -1
  92. package/dist/parrableIdSystem.js +1 -1
  93. package/dist/pixfutureBidAdapter.js +1 -1
  94. package/dist/prebid-core.js +1 -1
  95. package/dist/prebidServerBidAdapter.js +1 -1
  96. package/dist/publinkIdSystem.js +1 -1
  97. package/dist/pubmaticBidAdapter.js +1 -1
  98. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  99. package/dist/pxyzBidAdapter.js +1 -1
  100. package/dist/quantcastBidAdapter.js +1 -1
  101. package/dist/readpeakBidAdapter.js +1 -1
  102. package/dist/relaidoBidAdapter.js +1 -1
  103. package/dist/retailspotBidAdapter.js +1 -1
  104. package/dist/rhythmoneBidAdapter.js +1 -1
  105. package/dist/riseBidAdapter.js +1 -1
  106. package/dist/rtdModule.js +1 -1
  107. package/dist/rubiconAnalyticsAdapter.js +1 -1
  108. package/dist/rubiconBidAdapter.js +1 -1
  109. package/dist/seedingAllianceBidAdapter.js +1 -1
  110. package/dist/seedtagBidAdapter.js +1 -1
  111. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  112. package/dist/sharethroughBidAdapter.js +1 -1
  113. package/dist/shinezBidAdapter.js +1 -1
  114. package/dist/smaatoBidAdapter.js +1 -1
  115. package/dist/smartadserverBidAdapter.js +1 -1
  116. package/dist/smartxBidAdapter.js +1 -1
  117. package/dist/smilewantedBidAdapter.js +1 -1
  118. package/dist/sonobiBidAdapter.js +1 -1
  119. package/dist/sovrnAnalyticsAdapter.js +1 -1
  120. package/dist/sovrnBidAdapter.js +1 -1
  121. package/dist/sspBCBidAdapter.js +1 -1
  122. package/dist/stvBidAdapter.js +1 -1
  123. package/dist/sublimeBidAdapter.js +1 -1
  124. package/dist/synacormediaBidAdapter.js +1 -1
  125. package/dist/targetVideoBidAdapter.js +1 -1
  126. package/dist/teadsBidAdapter.js +1 -1
  127. package/dist/trionBidAdapter.js +1 -1
  128. package/dist/tripleliftBidAdapter.js +1 -1
  129. package/dist/ttdBidAdapter.js +1 -1
  130. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  131. package/dist/uid2IdSystem.js +1 -1
  132. package/dist/underdogmediaBidAdapter.js +1 -1
  133. package/dist/undertoneBidAdapter.js +1 -1
  134. package/dist/userId.js +1 -1
  135. package/dist/vidazooBidAdapter.js +1 -1
  136. package/dist/videobyteBidAdapter.js +1 -1
  137. package/dist/visxBidAdapter.js +1 -1
  138. package/dist/vuukleBidAdapter.js +1 -1
  139. package/dist/widespaceBidAdapter.js +1 -1
  140. package/dist/winrBidAdapter.js +1 -1
  141. package/dist/yahoosspBidAdapter.js +1 -1
  142. package/dist/yieldmoBidAdapter.js +1 -1
  143. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  144. package/dist/zeta_global_sspBidAdapter.js +1 -1
  145. package/integrationExamples/gpt/growthcode.html +20 -9
  146. package/libraries/objectGuard/objectGuard.js +108 -0
  147. package/libraries/objectGuard/ortbGuard.js +88 -0
  148. package/modules/adgenerationBidAdapter.js +14 -5
  149. package/modules/adhashBidAdapter.js +28 -17
  150. package/modules/adkernelBidAdapter.js +2 -1
  151. package/modules/admanBidAdapter.js +30 -22
  152. package/modules/adnuntiusBidAdapter.js +98 -79
  153. package/modules/adnuntiusBidAdapter.md +2 -1
  154. package/modules/adqueryBidAdapter.js +7 -1
  155. package/modules/adrinoBidAdapter.js +1 -0
  156. package/modules/adriverIdSystem.js +1 -1
  157. package/modules/adtelligentBidAdapter.js +4 -2
  158. package/modules/allowActivities.js +74 -0
  159. package/modules/appnexusBidAdapter.js +1 -0
  160. package/modules/cleanioRtdProvider.js +2 -4
  161. package/modules/connectIdSystem.js +89 -13
  162. package/modules/connectIdSystem.md +4 -7
  163. package/modules/criteoBidAdapter.js +50 -3
  164. package/modules/freewheel-sspBidAdapter.js +10 -2
  165. package/modules/gdprEnforcement.js +98 -169
  166. package/modules/growthCodeRtdProvider.js +131 -0
  167. package/modules/growthCodeRtdProvider.md +55 -0
  168. package/modules/gumgumBidAdapter.js +5 -0
  169. package/modules/ixBidAdapter.js +5 -2
  170. package/modules/minutemediaBidAdapter.js +13 -3
  171. package/modules/oxxionAnalyticsAdapter.js +212 -0
  172. package/modules/oxxionAnalyticsAdapter.md +33 -0
  173. package/modules/pairIdSystem.js +6 -6
  174. package/modules/prebidServerBidAdapter/index.js +7 -8
  175. package/modules/pubmaticBidAdapter.js +1 -0
  176. package/modules/riseBidAdapter.js +13 -3
  177. package/modules/rtbhouseBidAdapter.md +24 -0
  178. package/modules/rtdModule/index.js +12 -1
  179. package/modules/sharethroughBidAdapter.js +2 -2
  180. package/modules/smartadserverBidAdapter.js +5 -0
  181. package/modules/stvBidAdapter.js +34 -1
  182. package/modules/undertoneBidAdapter.js +9 -1
  183. package/modules/userId/index.js +69 -41
  184. package/modules/yahoosspBidAdapter.js +45 -3
  185. package/modules/yahoosspBidAdapter.md +1 -1
  186. package/modules/zeta_global_sspBidAdapter.js +1 -0
  187. package/package.json +1 -1
  188. package/src/activities/activities.js +47 -0
  189. package/src/activities/activityParams.js +8 -0
  190. package/src/activities/modules.js +1 -1
  191. package/src/activities/params.js +59 -0
  192. package/src/activities/redactor.js +157 -0
  193. package/src/activities/rules.js +95 -0
  194. package/src/adapterManager.js +45 -8
  195. package/src/adloader.js +2 -1
  196. package/src/fpd/rootDomain.js +1 -1
  197. package/src/native.js +20 -4
  198. package/src/prebid.js +1 -1
  199. package/src/storageManager.js +57 -44
  200. package/src/userSync.js +35 -18
  201. package/test/spec/activities/allowActivites_spec.js +138 -0
  202. package/test/spec/activities/objectGuard_spec.js +144 -0
  203. package/test/spec/activities/ortbGuard_spec.js +140 -0
  204. package/test/spec/activities/params_spec.js +25 -0
  205. package/test/spec/activities/redactor_spec.js +296 -0
  206. package/test/spec/activities/rules_spec.js +135 -0
  207. package/test/spec/modules/adgenerationBidAdapter_spec.js +52 -12
  208. package/test/spec/modules/adhashBidAdapter_spec.js +51 -1
  209. package/test/spec/modules/admanBidAdapter_spec.js +1 -2
  210. package/test/spec/modules/adnuntiusBidAdapter_spec.js +535 -264
  211. package/test/spec/modules/adqueryBidAdapter_spec.js +9 -0
  212. package/test/spec/modules/adrinoBidAdapter_spec.js +4 -0
  213. package/test/spec/modules/adtelligentBidAdapter_spec.js +1 -0
  214. package/test/spec/modules/cleanioRtdProvider_spec.js +7 -8
  215. package/test/spec/modules/connectIdSystem_spec.js +291 -23
  216. package/test/spec/modules/criteoBidAdapter_spec.js +134 -2
  217. package/test/spec/modules/freewheel-sspBidAdapter_spec.js +5 -2
  218. package/test/spec/modules/gdprEnforcement_spec.js +127 -414
  219. package/test/spec/modules/growthCodeRtdProvider_spec.js +127 -0
  220. package/test/spec/modules/gumgumBidAdapter_spec.js +14 -0
  221. package/test/spec/modules/ixBidAdapter_spec.js +2 -1
  222. package/test/spec/modules/minutemediaBidAdapter_spec.js +69 -1
  223. package/test/spec/modules/oxxionAnalyticsAdapter_spec.js +324 -0
  224. package/test/spec/modules/pairIdSystem_spec.js +16 -3
  225. package/test/spec/modules/prebidServerBidAdapter_spec.js +3 -1
  226. package/test/spec/modules/pubmaticBidAdapter_spec.js +7 -0
  227. package/test/spec/modules/realTimeDataModule_spec.js +1 -1
  228. package/test/spec/modules/riseBidAdapter_spec.js +69 -1
  229. package/test/spec/modules/sharethroughBidAdapter_spec.js +1 -1
  230. package/test/spec/modules/smartadserverBidAdapter_spec.js +42 -0
  231. package/test/spec/modules/stvBidAdapter_spec.js +13 -1
  232. package/test/spec/modules/undertoneBidAdapter_spec.js +57 -1
  233. package/test/spec/modules/userId_spec.js +80 -21
  234. package/test/spec/modules/yahoosspBidAdapter_spec.js +103 -51
  235. package/test/spec/modules/zeta_global_sspBidAdapter_spec.js +4 -0
  236. package/test/spec/native_spec.js +12 -12
  237. package/test/spec/unit/core/adapterManager_spec.js +181 -1
  238. package/test/spec/unit/core/storageManager_spec.js +76 -68
  239. package/test/spec/unit/pbjs_api_spec.js +15 -25
  240. package/test/spec/userSync_spec.js +45 -16
@@ -0,0 +1,135 @@
1
+ import {ruleRegistry} from '../../../src/activities/rules.js';
2
+
3
+ describe('Activity control rules', () => {
4
+ const MOCK_ACTIVITY = 'mockActivity';
5
+ const MOCK_RULE = 'mockRule';
6
+
7
+ let registerRule, isAllowed, logger;
8
+
9
+ beforeEach(() => {
10
+ logger = {
11
+ logInfo: sinon.stub(),
12
+ logWarn: sinon.stub(),
13
+ logError: sinon.stub(),
14
+ };
15
+ [registerRule, isAllowed] = ruleRegistry(logger);
16
+ });
17
+
18
+ it('allows by default', () => {
19
+ expect(isAllowed(MOCK_ACTIVITY, {})).to.be.true;
20
+ });
21
+
22
+ it('denies if a rule throws', () => {
23
+ registerRule(MOCK_ACTIVITY, MOCK_RULE, () => {
24
+ throw new Error('argh');
25
+ });
26
+ expect(isAllowed(MOCK_ACTIVITY, {})).to.be.false;
27
+ });
28
+
29
+ it('denies if a rule denies', () => {
30
+ registerRule(MOCK_ACTIVITY, MOCK_RULE, () => ({allow: false}));
31
+ expect(isAllowed(MOCK_ACTIVITY, {})).to.be.false;
32
+ });
33
+
34
+ it('partitions rules by activity', () => {
35
+ registerRule(MOCK_ACTIVITY, MOCK_RULE, () => ({allow: false}));
36
+ expect(isAllowed('other', {})).to.be.true;
37
+ });
38
+
39
+ it('passes params to rules', () => {
40
+ registerRule(MOCK_ACTIVITY, MOCK_RULE, (params) => ({allow: params.foo !== 'bar'}));
41
+ expect(isAllowed(MOCK_ACTIVITY, {foo: 'notbar'})).to.be.true;
42
+ expect(isAllowed(MOCK_ACTIVITY, {foo: 'bar'})).to.be.false;
43
+ });
44
+
45
+ it('allows if rules do not opine', () => {
46
+ registerRule(MOCK_ACTIVITY, MOCK_RULE, () => null);
47
+ expect(isAllowed(MOCK_ACTIVITY, {foo: 'bar'})).to.be.true;
48
+ });
49
+
50
+ it('denies if any rule denies', () => {
51
+ registerRule(MOCK_ACTIVITY, MOCK_RULE, () => null);
52
+ registerRule(MOCK_ACTIVITY, MOCK_RULE, () => ({allow: true}));
53
+ registerRule(MOCK_ACTIVITY, MOCK_RULE, () => ({allow: false}));
54
+ expect(isAllowed(MOCK_ACTIVITY, {foo: 'bar'})).to.be.false;
55
+ });
56
+
57
+ it('allows if higher priority allow rule trumps a lower priority deny rule', () => {
58
+ registerRule(MOCK_ACTIVITY, MOCK_RULE, () => ({allow: false}));
59
+ registerRule(MOCK_ACTIVITY, MOCK_RULE, () => ({allow: true}), 0);
60
+ expect(isAllowed(MOCK_ACTIVITY, {})).to.be.true;
61
+ });
62
+
63
+ it('denies if a higher priority deny rule trumps a lower priority allow rule', () => {
64
+ registerRule(MOCK_ACTIVITY, MOCK_RULE, () => ({allow: true}));
65
+ registerRule(MOCK_ACTIVITY, MOCK_RULE, () => ({allow: false}), 0);
66
+ expect(isAllowed(MOCK_ACTIVITY, {})).to.be.false;
67
+ });
68
+
69
+ it('can unregister rules', () => {
70
+ registerRule(MOCK_ACTIVITY, MOCK_RULE, () => ({allow: true}));
71
+ const r = registerRule(MOCK_ACTIVITY, MOCK_RULE, () => ({allow: false}), 0);
72
+ expect(isAllowed(MOCK_ACTIVITY, {})).to.be.false;
73
+ r();
74
+ expect(isAllowed(MOCK_ACTIVITY, {})).to.be.true;
75
+ })
76
+
77
+ it('logs INFO when explicit allow is found', () => {
78
+ registerRule(MOCK_ACTIVITY, MOCK_RULE, () => ({allow: true}));
79
+ isAllowed(MOCK_ACTIVITY, {});
80
+ sinon.assert.calledWithMatch(logger.logInfo, new RegExp(MOCK_RULE));
81
+ });
82
+
83
+ it('logs INFO with reason if the rule provides one', () => {
84
+ registerRule(MOCK_ACTIVITY, MOCK_RULE, () => ({allow: true, reason: 'because'}));
85
+ isAllowed(MOCK_ACTIVITY, {});
86
+ sinon.assert.calledWithMatch(logger.logInfo, new RegExp(MOCK_RULE), /because/);
87
+ });
88
+
89
+ it('logs WARN when a deny is found', () => {
90
+ registerRule(MOCK_ACTIVITY, MOCK_RULE, () => ({allow: false}));
91
+ isAllowed(MOCK_ACTIVITY, {});
92
+ sinon.assert.calledWithMatch(logger.logWarn, new RegExp(MOCK_RULE));
93
+ });
94
+
95
+ it('logs WARN with reason if the rule provides one', () => {
96
+ registerRule(MOCK_ACTIVITY, MOCK_RULE, () => ({allow: false, reason: 'fail'}));
97
+ isAllowed(MOCK_ACTIVITY, {});
98
+ sinon.assert.calledWithMatch(logger.logWarn, new RegExp(MOCK_RULE), /fail/);
99
+ });
100
+
101
+ describe('log message deduping', () => {
102
+ let clock, allow;
103
+ beforeEach(() => {
104
+ allow = false;
105
+ registerRule(MOCK_ACTIVITY, MOCK_RULE, () => ({ allow }));
106
+ clock = sinon.useFakeTimers();
107
+ });
108
+ afterEach(() => {
109
+ clock.restore();
110
+ });
111
+
112
+ it('is applied to identical messages that are close in time', () => {
113
+ isAllowed(MOCK_ACTIVITY, {});
114
+ clock.tick(100);
115
+ isAllowed(MOCK_ACTIVITY, {});
116
+ expect(logger.logWarn.callCount).to.equal(1);
117
+ });
118
+
119
+ it('not to messages that show different results', () => {
120
+ isAllowed(MOCK_ACTIVITY, {});
121
+ allow = true;
122
+ clock.tick(100);
123
+ isAllowed(MOCK_ACTIVITY, {});
124
+ expect(logger.logWarn.callCount).to.equal(1);
125
+ expect(logger.logInfo.callCount).to.equal(1);
126
+ });
127
+
128
+ it('not to messages that are further apart in time', () => {
129
+ isAllowed(MOCK_ACTIVITY, {});
130
+ clock.tick(2000);
131
+ isAllowed(MOCK_ACTIVITY, {});
132
+ expect(logger.logWarn.callCount).to.equal(2);
133
+ })
134
+ })
135
+ });
@@ -117,7 +117,7 @@ describe('AdgenerationAdapter', function () {
117
117
  criteoId: 'criteo-id-test-1234567890'
118
118
  }
119
119
  },
120
- { // bannerWithAdgextId5Id
120
+ { // bannerWithAdgextIds
121
121
  bidder: 'adg',
122
122
  params: {
123
123
  id: '58278', // banner
@@ -134,8 +134,48 @@ describe('AdgenerationAdapter', function () {
134
134
  linkType: 2
135
135
  },
136
136
  uid: 'id5-id-test-1234567890'
137
+ },
138
+ imuid: 'i.KrAH6ZAZTJOnH5S4N2sogA',
139
+ uid2: {id: 'AgAAAAVacu1uAxgAxH+HJ8+nWlS2H4uVqr6i+HBDCNREHD8WKsio/x7D8xXFuq1cJycUU86yXfTH9Xe/4C8KkH+7UCiU7uQxhyD7Qxnv251pEs6K8oK+BPLYR+8BLY/sJKesa/koKwx1FHgUzIBum582tSy2Oo+7C6wYUaaV4QcLr/4LPA='},
140
+ },
141
+ ortb2Imp: {ext: {gpid: '/1111/homepage#300x250'}},
142
+ ortb2: {
143
+ site: {
144
+ domain: 'localhost:9999',
145
+ publisher: {'domain': 'localhost:9999'},
146
+ page: 'http://localhost:9999/integrationExamples/gpt/hello_world.html',
147
+ ref: 'http://localhost:9999/integrationExamples/gpt/hello_world.html'
148
+ },
149
+ device: {
150
+ w: 570,
151
+ h: 969,
152
+ dnt: 0,
153
+ ua: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML,like Gecko)Chrome / 112.0.0.0Safari / 537.36',
154
+ language: 'ja',
155
+ sua: {
156
+ source: 2,
157
+ platform: {
158
+ brand: 'macOS'
159
+ },
160
+ browsers: [
161
+ {
162
+ brand: 'Chromium',
163
+ version: ['112']
164
+ },
165
+ {
166
+ brand: 'Google Chrome',
167
+ version: ['112']
168
+ },
169
+ {
170
+ brand: 'Not:A-Brand',
171
+ version: ['99']
172
+ }
173
+ ],
174
+ mobile: 0
175
+ }
137
176
  }
138
- }
177
+ },
178
+ schain: {ver: '1.0', complete: 1, nodes: [{asi: 'indirectseller.com', sid: '00001', hp: 1}]}
139
179
  }
140
180
  ];
141
181
  const bidderRequest = {
@@ -144,12 +184,12 @@ describe('AdgenerationAdapter', function () {
144
184
  }
145
185
  };
146
186
  const data = {
147
- banner: `posall=SSPLOC&id=58278&sdktype=0&hb=true&t=json3&sizes=300x250%2C320x100&currency=JPY&pbver=${prebid.version}&sdkname=prebidjs&adapterver=1.5.0&imark=1&tp=https%3A%2F%2Fexample.com`,
148
- bannerUSD: `posall=SSPLOC&id=58278&sdktype=0&hb=true&t=json3&sizes=300x250%2C320x100&currency=USD&pbver=${prebid.version}&sdkname=prebidjs&adapterver=1.5.0&imark=1&tp=https%3A%2F%2Fexample.com`,
149
- native: `posall=SSPLOC&id=58278&sdktype=0&hb=true&t=json3&sizes=1x1&currency=JPY&pbver=${prebid.version}&sdkname=prebidjs&adapterver=1.5.0&tp=https%3A%2F%2Fexample.com`,
150
- bannerWithHyperId: `posall=SSPLOC&id=58278&sdktype=0&hb=true&t=json3&sizes=320x100&currency=JPY&pbver=${prebid.version}&sdkname=prebidjs&adapterver=1.5.0&imark=1&tp=https%3A%2F%2Fexample.com&hyper_id=novatiqId`,
151
- bannerWithAdgextCriteoId: `posall=SSPLOC&id=58278&sdktype=0&hb=true&t=json3&sizes=320x100&currency=JPY&pbver=${prebid.version}&sdkname=prebidjs&adapterver=1.5.0&adgext_criteo_id=criteo-id-test-1234567890&imark=1&tp=https%3A%2F%2Fexample.com`,
152
- bannerWithAdgextId5Id: `posall=SSPLOC&id=58278&sdktype=0&hb=true&t=json3&sizes=320x100&currency=JPY&pbver=${prebid.version}&sdkname=prebidjs&adapterver=1.5.0&adgext_id5_id=id5-id-test-1234567890&adgext_id5_id_link_type=2&imark=1&tp=https%3A%2F%2Fexample.com`,
187
+ banner: `posall=SSPLOC&id=58278&sdktype=0&hb=true&t=json3&sizes=300x250%2C320x100&currency=JPY&pbver=${prebid.version}&sdkname=prebidjs&adapterver=1.6.0&imark=1&tp=https%3A%2F%2Fexample.com`,
188
+ bannerUSD: `posall=SSPLOC&id=58278&sdktype=0&hb=true&t=json3&sizes=300x250%2C320x100&currency=USD&pbver=${prebid.version}&sdkname=prebidjs&adapterver=1.6.0&imark=1&tp=https%3A%2F%2Fexample.com`,
189
+ native: `posall=SSPLOC&id=58278&sdktype=0&hb=true&t=json3&sizes=1x1&currency=JPY&pbver=${prebid.version}&sdkname=prebidjs&adapterver=1.6.0&tp=https%3A%2F%2Fexample.com`,
190
+ bannerWithHyperId: `posall=SSPLOC&id=58278&sdktype=0&hb=true&t=json3&sizes=320x100&currency=JPY&pbver=${prebid.version}&sdkname=prebidjs&adapterver=1.6.0&imark=1&tp=https%3A%2F%2Fexample.com&hyper_id=novatiqId`,
191
+ bannerWithAdgextCriteoId: `posall=SSPLOC&id=58278&sdktype=0&hb=true&t=json3&sizes=320x100&currency=JPY&pbver=${prebid.version}&sdkname=prebidjs&adapterver=1.6.0&adgext_criteo_id=criteo-id-test-1234567890&imark=1&tp=https%3A%2F%2Fexample.com`,
192
+ bannerWithAdgextIds: `posall=SSPLOC&id=58278&sdktype=0&hb=true&t=json3&sizes=320x100&currency=JPY&pbver=${prebid.version}&sdkname=prebidjs&adapterver=1.6.0&adgext_id5_id=id5-id-test-1234567890&adgext_id5_id_link_type=2&adgext_imuid=i.KrAH6ZAZTJOnH5S4N2sogA&adgext_uid2=%5Bobject%20Object%5D&gpid=%252F1111%252Fhomepage%2523300x250&uach=%7B%22source%22%3A2%2C%22platform%22%3A%7B%22brand%22%3A%22macOS%22%7D%2C%22browsers%22%3A%5B%7B%22brand%22%3A%22Chromium%22%2C%22version%22%3A%5B%22112%22%5D%7D%2C%7B%22brand%22%3A%22Google%20Chrome%22%2C%22version%22%3A%5B%22112%22%5D%7D%2C%7B%22brand%22%3A%22Not%3AA-Brand%22%2C%22version%22%3A%5B%2299%22%5D%7D%5D%2C%22mobile%22%3A0%7D&schain=%257B%2522ver%2522%253A%25221.0%2522%252C%2522complete%2522%253A1%252C%2522nodes%2522%253A%255B%257B%2522asi%2522%253A%2522indirectseller.com%2522%252C%2522sid%2522%253A%252200001%2522%252C%2522hp%2522%253A1%257D%255D%257D&imark=1&tp=https%3A%2F%2Fexample.com`,
153
193
  };
154
194
  it('sends bid request to ENDPOINT via GET', function () {
155
195
  const request = spec.buildRequests(bidRequests, bidderRequest)[0];
@@ -176,12 +216,12 @@ describe('AdgenerationAdapter', function () {
176
216
 
177
217
  it('should attache params to the bannerWithHyperId request', function () {
178
218
  const defaultUA = window.navigator.userAgent;
179
- window.navigator.__defineGetter__('userAgent', function() {
219
+ window.navigator.__defineGetter__('userAgent', function () {
180
220
  return 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Mobile/15E148 Safari/604.1';
181
221
  });
182
222
  const request = spec.buildRequests(bidRequests, bidderRequest)[2];
183
223
 
184
- window.navigator.__defineGetter__('userAgent', function() {
224
+ window.navigator.__defineGetter__('userAgent', function () {
185
225
  return defaultUA;
186
226
  });
187
227
  expect(request.data).to.equal(data.bannerWithHyperId);
@@ -192,9 +232,9 @@ describe('AdgenerationAdapter', function () {
192
232
  expect(request.data).to.equal(data.bannerWithAdgextCriteoId);
193
233
  });
194
234
 
195
- it('should attache params to the bannerWithAdgextId5Id request', function () {
235
+ it('should attache params to the bannerWithAdgextIds request', function () {
196
236
  const request = spec.buildRequests(bidRequests, bidderRequest)[4];
197
- expect(request.data).to.equal(data.bannerWithAdgextId5Id);
237
+ expect(request.data).to.equal(data.bannerWithAdgextIds);
198
238
  });
199
239
 
200
240
  it('allows setConfig to set bidder currency for JPY', function () {
@@ -74,7 +74,12 @@ describe('adhashBidAdapter', function () {
74
74
  publisherId: '0xc3b09b27e9c6ef73957901aa729b9e69e5bbfbfb'
75
75
  },
76
76
  sizes: [[300, 250]],
77
- adUnitCode: 'adUnitCode'
77
+ adUnitCode: 'adUnitCode',
78
+ mediaTypes: {
79
+ banner: {
80
+ sizes: [[300, 250]]
81
+ }
82
+ }
78
83
  };
79
84
  it('should build the request correctly', function () {
80
85
  const result = spec.buildRequests(
@@ -122,6 +127,11 @@ describe('adhashBidAdapter', function () {
122
127
  sizes: [[300, 250]],
123
128
  params: {
124
129
  platformURL: 'https://adhash.com/p/struma/'
130
+ },
131
+ mediaTypes: {
132
+ banner: {
133
+ sizes: [[300, 250]]
134
+ }
125
135
  }
126
136
  }
127
137
  };
@@ -267,5 +277,45 @@ describe('adhashBidAdapter', function () {
267
277
  it('should return empty array when something is not right', function () {
268
278
  expect(spec.interpretResponse(null, request).length).to.equal(0);
269
279
  });
280
+
281
+ it('should interpret the video response correctly', function () {
282
+ const result = spec.interpretResponse({
283
+ body: {
284
+ creatives: [{ costEUR: 1.234, vastURL: 'https://example.com/vast' }],
285
+ advertiserDomains: 'adhash.com'
286
+ }
287
+ }, {
288
+ data: { some: 'data' },
289
+ bidRequest: {
290
+ bidId: '12345678901234',
291
+ adUnitCode: 'adunit-code',
292
+ sizes: [[300, 250]],
293
+ params: {
294
+ platformURL: 'https://adhash.com/p/struma/'
295
+ },
296
+ mediaTypes: {
297
+ video: {
298
+ context: 'instream',
299
+ playerSize: [300, 250],
300
+ mimes: ['video/mp4'],
301
+ protocols: [1, 2, 3, 4, 5, 6, 7, 8],
302
+ playbackmethod: [2],
303
+ skip: 1
304
+ }
305
+ }
306
+ }
307
+ });
308
+ expect(result.length).to.equal(1);
309
+ expect(result[0].requestId).to.equal('12345678901234');
310
+ expect(result[0].cpm).to.equal(1.234);
311
+ expect(result[0].width).to.equal(300);
312
+ expect(result[0].height).to.equal(250);
313
+ expect(result[0].creativeId).to.equal('adunit-code');
314
+ expect(result[0].netRevenue).to.equal(true);
315
+ expect(result[0].currency).to.equal('EUR');
316
+ expect(result[0].ttl).to.equal(60);
317
+ expect(result[0].meta.advertiserDomains).to.eql(['adhash.com']);
318
+ expect(result[0].vastUrl).to.equal('https://example.com/vast');
319
+ });
270
320
  });
271
321
  });
@@ -130,14 +130,13 @@ describe('AdmanAdapter', function () {
130
130
  let placements = data['placements'];
131
131
  for (let i = 0; i < placements.length; i++) {
132
132
  let placement = placements[i];
133
- expect(placement).to.have.all.keys('placementId', 'eids', 'bidId', 'traffic', 'sizes', 'schain', 'bidFloor',
133
+ expect(placement).to.have.all.keys('placementId', 'eids', 'bidId', 'traffic', 'schain', 'bidFloor',
134
134
  'playerSize', 'minduration', 'maxduration', 'mimes', 'protocols', 'startdelay', 'placement', 'skip',
135
135
  'skipafter', 'minbitrate', 'maxbitrate', 'delivery', 'playbackmethod', 'api', 'linearity');
136
136
  expect(placement.schain).to.be.an('object')
137
137
  expect(placement.placementId).to.be.a('number');
138
138
  expect(placement.bidId).to.be.a('string');
139
139
  expect(placement.traffic).to.be.a('string');
140
- expect(placement.sizes).to.be.an('array');
141
140
  expect(placement.bidFloor).to.be.an('number');
142
141
  }
143
142
  });