prebid.js 7.3.0 → 7.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 (225) hide show
  1. package/.circleci/config.yml +11 -6
  2. package/dist/33acrossBidAdapter.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/adnuntiusBidAdapter.js +1 -1
  7. package/dist/adotBidAdapter.js +1 -1
  8. package/dist/adpod.js +1 -1
  9. package/dist/adrelevantisBidAdapter.js +1 -1
  10. package/dist/adrinoBidAdapter.js +1 -1
  11. package/dist/adtelligentBidAdapter.js +1 -1
  12. package/dist/adxcgBidAdapter.js +1 -1
  13. package/dist/ajaBidAdapter.js +1 -1
  14. package/dist/amxBidAdapter.js +1 -1
  15. package/dist/amxIdSystem.js +1 -1
  16. package/dist/appierAnalyticsAdapter.js +1 -1
  17. package/dist/appnexusBidAdapter.js +1 -1
  18. package/dist/asoBidAdapter.js +1 -1
  19. package/dist/atsAnalyticsAdapter.js +1 -1
  20. package/dist/axonixBidAdapter.js +1 -1
  21. package/dist/bidglassBidAdapter.js +1 -1
  22. package/dist/big-richmediaBidAdapter.js +1 -1
  23. package/dist/bridgewellBidAdapter.js +1 -1
  24. package/dist/brightMountainMediaBidAdapter.js +1 -1
  25. package/dist/byDataAnalyticsAdapter.js +1 -1
  26. package/dist/concertBidAdapter.js +1 -1
  27. package/dist/connectadBidAdapter.js +1 -1
  28. package/dist/consumableBidAdapter.js +1 -1
  29. package/dist/conversantBidAdapter.js +1 -1
  30. package/dist/craftBidAdapter.js +1 -1
  31. package/dist/criteoBidAdapter.js +1 -1
  32. package/dist/debugging-standalone.js +1 -1
  33. package/dist/debugging.js +1 -1
  34. package/dist/dspxBidAdapter.js +1 -1
  35. package/dist/eplanningBidAdapter.js +1 -1
  36. package/dist/finativeBidAdapter.js +1 -1
  37. package/dist/gdprEnforcement.js +1 -1
  38. package/dist/glimpseBidAdapter.js +1 -1
  39. package/dist/gmosspBidAdapter.js +1 -1
  40. package/dist/goldbachBidAdapter.js +1 -1
  41. package/dist/gridBidAdapter.js +1 -1
  42. package/dist/gridNMBidAdapter.js +1 -1
  43. package/dist/gumgumBidAdapter.js +1 -1
  44. package/dist/h12mediaBidAdapter.js +1 -1
  45. package/dist/hadronIdSystem.js +1 -1
  46. package/dist/hadronRtdProvider.js +1 -1
  47. package/dist/id5IdSystem.js +1 -1
  48. package/dist/imRtdProvider.js +1 -1
  49. package/dist/improvedigitalBidAdapter.js +1 -1
  50. package/dist/inmarBidAdapter.js +1 -1
  51. package/dist/insticatorBidAdapter.js +1 -1
  52. package/dist/ixBidAdapter.js +1 -1
  53. package/dist/justpremiumBidAdapter.js +1 -1
  54. package/dist/kargoAnalyticsAdapter.js +1 -1
  55. package/dist/kargoBidAdapter.js +1 -1
  56. package/dist/konduitAnalyticsAdapter.js +1 -1
  57. package/dist/kueezBidAdapter.js +1 -1
  58. package/dist/lassoBidAdapter.js +1 -1
  59. package/dist/liveyieldAnalyticsAdapter.js +1 -1
  60. package/dist/logicadBidAdapter.js +1 -1
  61. package/dist/loglyliftBidAdapter.js +1 -1
  62. package/dist/malltvAnalyticsAdapter.js +1 -1
  63. package/dist/marsmediaBidAdapter.js +1 -1
  64. package/dist/mediafuseBidAdapter.js +1 -1
  65. package/dist/mediasquareBidAdapter.js +1 -1
  66. package/dist/mgidBidAdapter.js +1 -1
  67. package/dist/minutemediaBidAdapter.js +1 -1
  68. package/dist/missenaBidAdapter.js +1 -1
  69. package/dist/newspassidBidAdapter.js +1 -0
  70. package/dist/nextMillenniumBidAdapter.js +1 -1
  71. package/dist/not-for-prod/prebid.js +131 -127
  72. package/dist/oguryBidAdapter.js +1 -1
  73. package/dist/onetagBidAdapter.js +1 -1
  74. package/dist/ooloAnalyticsAdapter.js +1 -1
  75. package/dist/openxOrtbBidAdapter.js +1 -0
  76. package/dist/outbrainBidAdapter.js +1 -1
  77. package/dist/parrableIdSystem.js +1 -1
  78. package/dist/pixfutureBidAdapter.js +1 -1
  79. package/dist/prebid-core.js +2 -2
  80. package/dist/priceFloors.js +1 -1
  81. package/dist/pubCommonId.js +1 -1
  82. package/dist/publinkIdSystem.js +1 -1
  83. package/dist/pubmaticBidAdapter.js +1 -1
  84. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  85. package/dist/pubxaiAnalyticsAdapter.js +1 -1
  86. package/dist/pxyzBidAdapter.js +1 -1
  87. package/dist/quantcastBidAdapter.js +1 -1
  88. package/dist/rasBidAdapter.js +1 -0
  89. package/dist/readpeakBidAdapter.js +1 -1
  90. package/dist/relaidoBidAdapter.js +1 -1
  91. package/dist/rhythmoneBidAdapter.js +1 -1
  92. package/dist/riseBidAdapter.js +1 -1
  93. package/dist/rubiconAnalyticsAdapter.js +1 -1
  94. package/dist/rubiconBidAdapter.js +1 -1
  95. package/dist/seedingAllianceBidAdapter.js +1 -1
  96. package/dist/seedtagBidAdapter.js +1 -1
  97. package/dist/sharedIdSystem.js +1 -1
  98. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  99. package/dist/sharethroughBidAdapter.js +1 -1
  100. package/dist/shinezBidAdapter.js +1 -0
  101. package/dist/sizeMappingV2.js +1 -1
  102. package/dist/smaatoBidAdapter.js +1 -1
  103. package/dist/smartadserverBidAdapter.js +1 -1
  104. package/dist/smartxBidAdapter.js +1 -1
  105. package/dist/smilewantedBidAdapter.js +1 -1
  106. package/dist/sonobiBidAdapter.js +1 -1
  107. package/dist/sovrnAnalyticsAdapter.js +1 -1
  108. package/dist/sovrnBidAdapter.js +1 -1
  109. package/dist/sspBCBidAdapter.js +1 -1
  110. package/dist/sublimeBidAdapter.js +1 -1
  111. package/dist/synacormediaBidAdapter.js +1 -1
  112. package/dist/taboolaBidAdapter.js +1 -1
  113. package/dist/targetVideoBidAdapter.js +1 -1
  114. package/dist/teadsBidAdapter.js +1 -1
  115. package/dist/trionBidAdapter.js +1 -1
  116. package/dist/tripleliftBidAdapter.js +1 -1
  117. package/dist/ttdBidAdapter.js +1 -1
  118. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  119. package/dist/underdogmediaBidAdapter.js +1 -1
  120. package/dist/undertoneBidAdapter.js +1 -1
  121. package/dist/ventesBidAdapter.js +1 -1
  122. package/dist/vidazooBidAdapter.js +1 -1
  123. package/dist/videobyteBidAdapter.js +1 -1
  124. package/dist/visxBidAdapter.js +1 -1
  125. package/dist/vrtcalBidAdapter.js +1 -1
  126. package/dist/vuukleBidAdapter.js +1 -1
  127. package/dist/widespaceBidAdapter.js +1 -1
  128. package/dist/winrBidAdapter.js +1 -1
  129. package/dist/yahoosspBidAdapter.js +1 -1
  130. package/dist/yieldmoBidAdapter.js +1 -1
  131. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  132. package/gulpfile.js +1 -1
  133. package/karma.conf.maker.js +3 -1
  134. package/modules/adgenerationBidAdapter.js +24 -1
  135. package/modules/adnuntiusBidAdapter.js +26 -8
  136. package/modules/adotBidAdapter.js +13 -4
  137. package/modules/adrinoBidAdapter.js +10 -2
  138. package/modules/adrinoBidAdapter.md +6 -0
  139. package/modules/adtelligentBidAdapter.js +2 -1
  140. package/modules/appnexusBidAdapter.js +3 -3
  141. package/modules/atsAnalyticsAdapter.js +4 -5
  142. package/modules/byDataAnalyticsAdapter.js +172 -74
  143. package/modules/byDataAnalyticsAdapter.md +5 -6
  144. package/modules/consumableBidAdapter.js +12 -1
  145. package/modules/criteoBidAdapter.js +7 -1
  146. package/modules/cwireBidAdapter.md +1 -1
  147. package/modules/debugging/bidInterceptor.js +1 -1
  148. package/modules/debugging/index.js +2 -1
  149. package/modules/eplanningBidAdapter.js +82 -97
  150. package/modules/gdprEnforcement.js +8 -14
  151. package/modules/gridNMBidAdapter.js +45 -4
  152. package/modules/hadronAnalyticsAdapter.md +5 -5
  153. package/modules/hadronIdSystem.js +18 -5
  154. package/modules/hadronIdSystem.md +15 -11
  155. package/modules/hadronRtdProvider.js +14 -1
  156. package/modules/hadronRtdProvider.md +17 -13
  157. package/modules/imRtdProvider.js +0 -8
  158. package/modules/insticatorBidAdapter.js +9 -0
  159. package/modules/ixBidAdapter.js +462 -58
  160. package/modules/ixBidAdapter.md +95 -5
  161. package/modules/kargoAnalyticsAdapter.js +88 -6
  162. package/modules/kargoAnalyticsAdapter.md +33 -0
  163. package/modules/kargoBidAdapter.js +1 -2
  164. package/modules/minutemediaBidAdapter.js +1 -0
  165. package/modules/missenaBidAdapter.js +20 -2
  166. package/modules/newspassidBidAdapter.js +649 -0
  167. package/modules/nextMillenniumBidAdapter.js +17 -1
  168. package/modules/oguryBidAdapter.js +2 -0
  169. package/modules/openxBidAdapter.md +3 -1
  170. package/modules/openxOrtbBidAdapter.js +349 -0
  171. package/modules/openxOrtbBidAdapter.md +105 -0
  172. package/modules/priceFloors.js +1 -1
  173. package/modules/pubCommonId.js +1 -2
  174. package/modules/pubxaiAnalyticsAdapter.js +6 -1
  175. package/modules/rasBidAdapter.js +149 -0
  176. package/modules/rasBidAdapter.md +50 -0
  177. package/modules/readpeakBidAdapter.js +15 -6
  178. package/modules/relaidoBidAdapter.js +19 -4
  179. package/modules/seedtagBidAdapter.js +37 -1
  180. package/modules/sharedIdSystem.js +11 -5
  181. package/modules/sharethroughBidAdapter.js +9 -24
  182. package/modules/shinezBidAdapter.js +435 -0
  183. package/modules/shinezBidAdapter.md +76 -0
  184. package/modules/taboolaBidAdapter.js +1 -1
  185. package/modules/taboolaBidAdapter.md +3 -3
  186. package/modules/ventesBidAdapter.js +1 -1
  187. package/modules/ventesBidAdapter.md +1 -1
  188. package/modules/vrtcalBidAdapter.js +35 -0
  189. package/package.json +1 -1
  190. package/plugins/pbjsGlobals.js +2 -1
  191. package/src/storageManager.js +4 -5
  192. package/test/spec/modules/adgenerationBidAdapter_spec.js +52 -4
  193. package/test/spec/modules/adnuntiusBidAdapter_spec.js +126 -14
  194. package/test/spec/modules/adotBidAdapter_spec.js +12 -9
  195. package/test/spec/modules/adrinoBidAdapter_spec.js +22 -0
  196. package/test/spec/modules/appnexusBidAdapter_spec.js +165 -156
  197. package/test/spec/modules/byDataAnalyticsAdapter_spec.js +74 -24
  198. package/test/spec/modules/consumableBidAdapter_spec.js +75 -0
  199. package/test/spec/modules/criteoBidAdapter_spec.js +15 -5
  200. package/test/spec/modules/debugging_mod_spec.js +7 -0
  201. package/test/spec/modules/eplanningBidAdapter_spec.js +58 -18
  202. package/test/spec/modules/gdprEnforcement_spec.js +53 -100
  203. package/test/spec/modules/gridNMBidAdapter_spec.js +32 -0
  204. package/test/spec/modules/hadronIdSystem_spec.js +2 -2
  205. package/test/spec/modules/imRtdProvider_spec.js +0 -1
  206. package/test/spec/modules/insticatorBidAdapter_spec.js +22 -1
  207. package/test/spec/modules/ixBidAdapter_spec.js +470 -10
  208. package/test/spec/modules/kargoAnalyticsAdapter_spec.js +42 -0
  209. package/test/spec/modules/kargoBidAdapter_spec.js +1 -0
  210. package/test/spec/modules/minutemediaBidAdapter_spec.js +3 -0
  211. package/test/spec/modules/missenaBidAdapter_spec.js +36 -14
  212. package/test/spec/modules/newspassidBidAdapter_spec.js +1793 -0
  213. package/test/spec/modules/nextMillenniumBidAdapter_spec.js +20 -0
  214. package/test/spec/modules/openxOrtbBidAdapter_spec.js +1303 -0
  215. package/test/spec/modules/pubxaiAnalyticsAdapter_spec.js +5 -0
  216. package/test/spec/modules/rasBidAdapter_spec.js +190 -0
  217. package/test/spec/modules/readpeakBidAdapter_spec.js +1 -0
  218. package/test/spec/modules/relaidoBidAdapter_spec.js +29 -2
  219. package/test/spec/modules/seedtagBidAdapter_spec.js +29 -0
  220. package/test/spec/modules/sharethroughBidAdapter_spec.js +4 -4
  221. package/test/spec/modules/shinezBidAdapter_spec.js +479 -0
  222. package/test/spec/modules/taboolaBidAdapter_spec.js +1 -1
  223. package/test/spec/modules/ventesBidAdapter_spec.js +2 -2
  224. package/test/spec/modules/vrtcalBidAdapter_spec.js +17 -0
  225. package/webpack.conf.js +1 -1
@@ -0,0 +1,435 @@
1
+ import { logWarn, logInfo, isArray, isFn, deepAccess, isEmpty, contains, timestamp, getBidIdParameter, triggerPixel, isInteger } from '../src/utils.js';
2
+ import {registerBidder} from '../src/adapters/bidderFactory.js';
3
+ import {BANNER, VIDEO} from '../src/mediaTypes.js';
4
+ import {config} from '../src/config.js';
5
+
6
+ const SUPPORTED_AD_TYPES = [BANNER, VIDEO];
7
+ const BIDDER_CODE = 'shinez';
8
+ const ADAPTER_VERSION = '1.0.0';
9
+ const TTL = 360;
10
+ const CURRENCY = 'USD';
11
+ const SELLER_ENDPOINT = 'https://hb.sweetgum.io/';
12
+ const MODES = {
13
+ PRODUCTION: 'hb-sz-multi',
14
+ TEST: 'hb-multi-sz-test'
15
+ }
16
+ const SUPPORTED_SYNC_METHODS = {
17
+ IFRAME: 'iframe',
18
+ PIXEL: 'pixel'
19
+ }
20
+
21
+ export const spec = {
22
+ code: BIDDER_CODE,
23
+ version: ADAPTER_VERSION,
24
+ supportedMediaTypes: SUPPORTED_AD_TYPES,
25
+ isBidRequestValid: function (bidRequest) {
26
+ if (!bidRequest.params) {
27
+ logWarn('no params have been set to Shinez adapter');
28
+ return false;
29
+ }
30
+
31
+ if (!bidRequest.params.org) {
32
+ logWarn('org is a mandatory param for Shinez adapter');
33
+ return false;
34
+ }
35
+
36
+ return true;
37
+ },
38
+ buildRequests: function (validBidRequests, bidderRequest) {
39
+ const combinedRequestsObject = {};
40
+
41
+ // use data from the first bid, to create the general params for all bids
42
+ const generalObject = validBidRequests[0];
43
+ const testMode = generalObject.params.testMode;
44
+
45
+ combinedRequestsObject.params = generateGeneralParams(generalObject, bidderRequest);
46
+ combinedRequestsObject.bids = generateBidsParams(validBidRequests, bidderRequest);
47
+
48
+ return {
49
+ method: 'POST',
50
+ url: getEndpoint(testMode),
51
+ data: combinedRequestsObject
52
+ }
53
+ },
54
+ interpretResponse: function ({body}) {
55
+ const bidResponses = [];
56
+
57
+ if (body.bids) {
58
+ body.bids.forEach(adUnit => {
59
+ const bidResponse = {
60
+ requestId: adUnit.requestId,
61
+ cpm: adUnit.cpm,
62
+ currency: adUnit.currency || CURRENCY,
63
+ width: adUnit.width,
64
+ height: adUnit.height,
65
+ ttl: adUnit.ttl || TTL,
66
+ creativeId: adUnit.requestId,
67
+ netRevenue: adUnit.netRevenue || true,
68
+ nurl: adUnit.nurl,
69
+ mediaType: adUnit.mediaType,
70
+ meta: {
71
+ mediaType: adUnit.mediaType
72
+ }
73
+ };
74
+
75
+ if (adUnit.mediaType === VIDEO) {
76
+ bidResponse.vastXml = adUnit.vastXml;
77
+ } else if (adUnit.mediaType === BANNER) {
78
+ bidResponse.ad = adUnit.ad;
79
+ }
80
+
81
+ if (adUnit.adomain && adUnit.adomain.length) {
82
+ bidResponse.meta.advertiserDomains = adUnit.adomain;
83
+ }
84
+
85
+ bidResponses.push(bidResponse);
86
+ });
87
+ }
88
+
89
+ return bidResponses;
90
+ },
91
+ getUserSyncs: function (syncOptions, serverResponses) {
92
+ const syncs = [];
93
+ for (const response of serverResponses) {
94
+ if (syncOptions.iframeEnabled && response.body.params.userSyncURL) {
95
+ syncs.push({
96
+ type: 'iframe',
97
+ url: response.body.params.userSyncURL
98
+ });
99
+ }
100
+ if (syncOptions.pixelEnabled && isArray(response.body.params.userSyncPixels)) {
101
+ const pixels = response.body.params.userSyncPixels.map(pixel => {
102
+ return {
103
+ type: 'image',
104
+ url: pixel
105
+ }
106
+ })
107
+ syncs.push(...pixels)
108
+ }
109
+ }
110
+ return syncs;
111
+ },
112
+ onBidWon: function (bid) {
113
+ if (bid == null) {
114
+ return;
115
+ }
116
+
117
+ logInfo('onBidWon:', bid);
118
+ if (bid.hasOwnProperty('nurl') && bid.nurl.length > 0) {
119
+ triggerPixel(bid.nurl);
120
+ }
121
+ }
122
+ };
123
+
124
+ registerBidder(spec);
125
+
126
+ /**
127
+ * Get floor price
128
+ * @param bid {bid}
129
+ * @returns {Number}
130
+ */
131
+ function getFloor(bid, mediaType) {
132
+ if (!isFn(bid.getFloor)) {
133
+ return 0;
134
+ }
135
+ let floorResult = bid.getFloor({
136
+ currency: CURRENCY,
137
+ mediaType: mediaType,
138
+ size: '*'
139
+ });
140
+ return floorResult.currency === CURRENCY && floorResult.floor ? floorResult.floor : 0;
141
+ }
142
+
143
+ /**
144
+ * Get the the ad sizes array from the bid
145
+ * @param bid {bid}
146
+ * @returns {Array}
147
+ */
148
+ function getSizesArray(bid, mediaType) {
149
+ let sizesArray = []
150
+
151
+ if (deepAccess(bid, `mediaTypes.${mediaType}.sizes`)) {
152
+ sizesArray = bid.mediaTypes[mediaType].sizes;
153
+ } else if (Array.isArray(bid.sizes) && bid.sizes.length > 0) {
154
+ sizesArray = bid.sizes;
155
+ }
156
+
157
+ return sizesArray;
158
+ }
159
+
160
+ /**
161
+ * Get schain string value
162
+ * @param schainObject {Object}
163
+ * @returns {string}
164
+ */
165
+ function getSupplyChain(schainObject) {
166
+ if (isEmpty(schainObject)) {
167
+ return '';
168
+ }
169
+ let scStr = `${schainObject.ver},${schainObject.complete}`;
170
+ schainObject.nodes.forEach((node) => {
171
+ scStr += '!';
172
+ scStr += `${getEncodedValIfNotEmpty(node.asi)},`;
173
+ scStr += `${getEncodedValIfNotEmpty(node.sid)},`;
174
+ scStr += `${node.hp ? encodeURIComponent(node.hp) : ''},`;
175
+ scStr += `${getEncodedValIfNotEmpty(node.rid)},`;
176
+ scStr += `${getEncodedValIfNotEmpty(node.name)},`;
177
+ scStr += `${getEncodedValIfNotEmpty(node.domain)}`;
178
+ });
179
+ return scStr;
180
+ }
181
+
182
+ /**
183
+ * Get encoded node value
184
+ * @param val {string}
185
+ * @returns {string}
186
+ */
187
+ function getEncodedValIfNotEmpty(val) {
188
+ return !isEmpty(val) ? encodeURIComponent(val) : '';
189
+ }
190
+
191
+ /**
192
+ * Get preferred user-sync method based on publisher configuration
193
+ * @param bidderCode {string}
194
+ * @returns {string}
195
+ */
196
+ function getAllowedSyncMethod(filterSettings, bidderCode) {
197
+ const iframeConfigsToCheck = ['all', 'iframe'];
198
+ const pixelConfigToCheck = 'image';
199
+ if (filterSettings && iframeConfigsToCheck.some(config => isSyncMethodAllowed(filterSettings[config], bidderCode))) {
200
+ return SUPPORTED_SYNC_METHODS.IFRAME;
201
+ }
202
+ if (!filterSettings || !filterSettings[pixelConfigToCheck] || isSyncMethodAllowed(filterSettings[pixelConfigToCheck], bidderCode)) {
203
+ return SUPPORTED_SYNC_METHODS.PIXEL;
204
+ }
205
+ }
206
+
207
+ /**
208
+ * Check if sync rule is supported
209
+ * @param syncRule {Object}
210
+ * @param bidderCode {string}
211
+ * @returns {boolean}
212
+ */
213
+ function isSyncMethodAllowed(syncRule, bidderCode) {
214
+ if (!syncRule) {
215
+ return false;
216
+ }
217
+ const isInclude = syncRule.filter === 'include';
218
+ const bidders = isArray(syncRule.bidders) ? syncRule.bidders : [bidderCode];
219
+ return isInclude && contains(bidders, bidderCode);
220
+ }
221
+
222
+ /**
223
+ * Get the seller endpoint
224
+ * @param testMode {boolean}
225
+ * @returns {string}
226
+ */
227
+ function getEndpoint(testMode) {
228
+ return testMode
229
+ ? SELLER_ENDPOINT + MODES.TEST
230
+ : SELLER_ENDPOINT + MODES.PRODUCTION;
231
+ }
232
+
233
+ /**
234
+ * get device type
235
+ * @param uad {ua}
236
+ * @returns {string}
237
+ */
238
+ function getDeviceType(ua) {
239
+ if (/ipad|android 3.0|xoom|sch-i800|playbook|tablet|kindle/i
240
+ .test(ua.toLowerCase())) {
241
+ return '5';
242
+ }
243
+ if (/iphone|ipod|android|blackberry|opera|mini|windows\sce|palm|smartphone|iemobile/i
244
+ .test(ua.toLowerCase())) {
245
+ return '4';
246
+ }
247
+ if (/smart[-_\s]?tv|hbbtv|appletv|googletv|hdmi|netcast|viera|nettv|roku|\bdtv\b|sonydtv|inettvbrowser|\btv\b/i
248
+ .test(ua.toLowerCase())) {
249
+ return '3';
250
+ }
251
+ return '1';
252
+ }
253
+
254
+ function generateBidsParams(validBidRequests, bidderRequest) {
255
+ const bidsArray = [];
256
+
257
+ if (validBidRequests.length) {
258
+ validBidRequests.forEach(bid => {
259
+ bidsArray.push(generateBidParameters(bid, bidderRequest));
260
+ });
261
+ }
262
+
263
+ return bidsArray;
264
+ }
265
+
266
+ /**
267
+ * Generate bid specific parameters
268
+ * @param {bid} bid
269
+ * @param {bidderRequest} bidderRequest
270
+ * @returns {Object} bid specific params object
271
+ */
272
+ function generateBidParameters(bid, bidderRequest) {
273
+ const {params} = bid;
274
+ const mediaType = isBanner(bid) ? BANNER : VIDEO;
275
+ const sizesArray = getSizesArray(bid, mediaType);
276
+
277
+ // fix floor price in case of NAN
278
+ if (isNaN(params.floorPrice)) {
279
+ params.floorPrice = 0;
280
+ }
281
+
282
+ const bidObject = {
283
+ mediaType,
284
+ adUnitCode: getBidIdParameter('adUnitCode', bid),
285
+ sizes: sizesArray,
286
+ floorPrice: Math.max(getFloor(bid, mediaType), params.floorPrice),
287
+ bidId: getBidIdParameter('bidId', bid),
288
+ bidderRequestId: getBidIdParameter('bidderRequestId', bid),
289
+ transactionId: getBidIdParameter('transactionId', bid),
290
+ };
291
+
292
+ const pos = deepAccess(bid, `mediaTypes.${mediaType}.pos`);
293
+ if (pos) {
294
+ bidObject.pos = pos;
295
+ }
296
+
297
+ const gpid = deepAccess(bid, `ortb2Imp.ext.gpid`);
298
+ if (gpid) {
299
+ bidObject.gpid = gpid;
300
+ }
301
+
302
+ const placementId = params.placementId || deepAccess(bid, `mediaTypes.${mediaType}.name`);
303
+ if (placementId) {
304
+ bidObject.placementId = placementId;
305
+ }
306
+
307
+ if (mediaType === VIDEO) {
308
+ const playbackMethod = deepAccess(bid, `mediaTypes.video.playbackmethod`);
309
+ let playbackMethodValue;
310
+
311
+ // verify playbackMethod is of type integer array, or integer only.
312
+ if (Array.isArray(playbackMethod) && isInteger(playbackMethod[0])) {
313
+ // only the first playbackMethod in the array will be used, according to OpenRTB 2.5 recommendation
314
+ playbackMethodValue = playbackMethod[0];
315
+ } else if (isInteger(playbackMethod)) {
316
+ playbackMethodValue = playbackMethod;
317
+ }
318
+
319
+ if (playbackMethodValue) {
320
+ bidObject.playbackMethod = playbackMethodValue;
321
+ }
322
+
323
+ const placement = deepAccess(bid, `mediaTypes.video.placement`);
324
+ if (placement) {
325
+ bidObject.placement = placement;
326
+ }
327
+
328
+ const minDuration = deepAccess(bid, `mediaTypes.video.minduration`);
329
+ if (minDuration) {
330
+ bidObject.minDuration = minDuration;
331
+ }
332
+
333
+ const maxDuration = deepAccess(bid, `mediaTypes.video.maxduration`);
334
+ if (maxDuration) {
335
+ bidObject.maxDuration = maxDuration;
336
+ }
337
+
338
+ const skip = deepAccess(bid, `mediaTypes.video.skip`);
339
+ if (skip) {
340
+ bidObject.skip = skip;
341
+ }
342
+
343
+ const linearity = deepAccess(bid, `mediaTypes.video.linearity`);
344
+ if (linearity) {
345
+ bidObject.linearity = linearity;
346
+ }
347
+ }
348
+
349
+ return bidObject;
350
+ }
351
+
352
+ function isBanner(bid) {
353
+ return bid.mediaTypes && bid.mediaTypes.banner;
354
+ }
355
+
356
+ /**
357
+ * Generate params that are common between all bids
358
+ * @param {single bid object} generalObject
359
+ * @param {bidderRequest} bidderRequest
360
+ * @returns {object} the common params object
361
+ */
362
+ function generateGeneralParams(generalObject, bidderRequest) {
363
+ const domain = window.location.hostname;
364
+ const {syncEnabled, filterSettings} = config.getConfig('userSync') || {};
365
+ const {bidderCode} = bidderRequest;
366
+ const generalBidParams = generalObject.params;
367
+ const timeout = config.getConfig('bidderTimeout');
368
+
369
+ // these params are snake_case instead of camelCase to allow backwards compatability on the server.
370
+ // in the future, these will be converted to camelCase to match our convention.
371
+ const generalParams = {
372
+ wrapper_type: 'prebidjs',
373
+ wrapper_vendor: '$$PREBID_GLOBAL$$',
374
+ wrapper_version: '$prebid.version$',
375
+ adapter_version: ADAPTER_VERSION,
376
+ auction_start: timestamp(),
377
+ publisher_id: generalBidParams.org,
378
+ publisher_name: domain,
379
+ site_domain: domain,
380
+ dnt: (navigator.doNotTrack == 'yes' || navigator.doNotTrack == '1' || navigator.msDoNotTrack == '1') ? 1 : 0,
381
+ device_type: getDeviceType(navigator.userAgent),
382
+ ua: navigator.userAgent,
383
+ session_id: getBidIdParameter('auctionId', generalObject),
384
+ tmax: timeout
385
+ }
386
+
387
+ const userIdsParam = getBidIdParameter('userId', generalObject);
388
+ if (userIdsParam) {
389
+ generalParams.userIds = JSON.stringify(userIdsParam);
390
+ }
391
+
392
+ const ortb2Metadata = bidderRequest.ortb2 || {};
393
+ if (ortb2Metadata.site) {
394
+ generalParams.site_metadata = JSON.stringify(ortb2Metadata.site);
395
+ }
396
+ if (ortb2Metadata.user) {
397
+ generalParams.user_metadata = JSON.stringify(ortb2Metadata.user);
398
+ }
399
+
400
+ if (syncEnabled) {
401
+ const allowedSyncMethod = getAllowedSyncMethod(filterSettings, bidderCode);
402
+ if (allowedSyncMethod) {
403
+ generalParams.cs_method = allowedSyncMethod;
404
+ }
405
+ }
406
+
407
+ if (bidderRequest.uspConsent) {
408
+ generalParams.us_privacy = bidderRequest.uspConsent;
409
+ }
410
+
411
+ if (bidderRequest && bidderRequest.gdprConsent && bidderRequest.gdprConsent.gdprApplies) {
412
+ generalParams.gdpr = bidderRequest.gdprConsent.gdprApplies;
413
+ generalParams.gdpr_consent = bidderRequest.gdprConsent.consentString;
414
+ }
415
+
416
+ if (generalBidParams.ifa) {
417
+ generalParams.ifa = generalBidParams.ifa;
418
+ }
419
+
420
+ if (generalObject.schain) {
421
+ generalParams.schain = getSupplyChain(generalObject.schain);
422
+ }
423
+
424
+ if (bidderRequest.ortb2 && bidderRequest.ortb2.site) {
425
+ generalParams.referrer = bidderRequest.ortb2.site.ref;
426
+ generalParams.page_url = bidderRequest.ortb2.site.page;
427
+ }
428
+
429
+ if (bidderRequest && bidderRequest.refererInfo) {
430
+ generalParams.referrer = generalParams.referrer || deepAccess(bidderRequest, 'refererInfo.referer');
431
+ generalParams.page_url = generalParams.page_url || config.getConfig('pageUrl') || deepAccess(window, 'location.href');
432
+ }
433
+
434
+ return generalParams
435
+ }
@@ -0,0 +1,76 @@
1
+ #Overview
2
+
3
+ Module Name: Shinez Bidder Adapter
4
+
5
+ Module Type: Bidder Adapter
6
+
7
+ Maintainer: tech-team@shinez.io
8
+
9
+
10
+ # Description
11
+
12
+ Module that connects to Shinez's demand sources.
13
+
14
+ The Shinez adapter requires setup and approval from the Shinez. Please reach out to tech-team@shinez.io to create an Shinez account.
15
+
16
+ The adapter supports Video(instream) & Banner.
17
+
18
+ # Bid Parameters
19
+ ## Video
20
+
21
+ | Name | Scope | Type | Description | Example
22
+ | ---- | ----- | ---- | ----------- | -------
23
+ | `org` | required | String | Shinez publisher Id provided by your Shinez representative | "56f91cd4d3e3660002000033"
24
+ | `floorPrice` | optional | Number | Minimum price in USD. Misuse of this parameter can impact revenue | 2.00
25
+ | `placementId` | optional | String | A unique placement identifier | "12345678"
26
+ | `testMode` | optional | Boolean | This activates the test mode | false
27
+
28
+ # Test Parameters
29
+ ```javascript
30
+ var adUnits = [{
31
+ code: 'dfp-video-div',
32
+ sizes: [
33
+ [640, 480]
34
+ ],
35
+ mediaTypes: {
36
+ video: {
37
+ playerSize: [
38
+ [640, 480]
39
+ ],
40
+ context: 'instream'
41
+ }
42
+ },
43
+ bids: [{
44
+ bidder: 'shinez',
45
+ params: {
46
+ org: '56f91cd4d3e3660002000033', // Required
47
+ floorPrice: 2.00, // Optional
48
+ placementId: 'shinez-video-test', // Optional
49
+ testMode: true // Optional
50
+ }
51
+ }]
52
+ },
53
+ {
54
+ code: 'dfp-banner-div',
55
+ sizes: [
56
+ [640, 480]
57
+ ],
58
+ mediaTypes: {
59
+ banner: {
60
+ sizes: [
61
+ [640, 480]
62
+ ]
63
+ }
64
+ },
65
+ bids: [{
66
+ bidder: 'shinez',
67
+ params: {
68
+ org: '56f91cd4d3e3660002000033', // Required
69
+ floorPrice: 2.00, // Optional
70
+ placementId: 'shinez-banner-test', // Optional
71
+ testMode: true // Optional
72
+ }
73
+ }]
74
+ }
75
+ ];
76
+ ```
@@ -233,7 +233,7 @@ function getBid(requestId, currency, bidResponse) {
233
233
 
234
234
  return {
235
235
  requestId,
236
- ttl: 360,
236
+ ttl: 60,
237
237
  mediaType: BANNER,
238
238
  cpm,
239
239
  creativeId,
@@ -40,10 +40,10 @@ The Taboola Bidding adapter requires setup before beginning. Please contact us o
40
40
 
41
41
  | Name | Scope | Description | Example | Type |
42
42
  |----------------|----------|---------------------------------------------------------|----------------------------|--------------|
43
- | `tagId` | required | Tag ID / Placement Name <br>(as provided by Taboola) | `'Below The Article'` | `String` |
44
- | `publisherId` | required | Alphabetic Publisher ID <br>(as provided by Taboola) | `'acme-publishing'` | `String` |
43
+ | `tagId` | required | Tag ID / Placement Name <br> | `'Below The Article'` | `String` |
44
+ | `publisherId` | required | Numeric Publisher ID <br>(as provided by Taboola) | `'1234567'` | `String` |
45
45
  | `bcat` | optional | List of blocked advertiser categories (IAB) | `['IAB1-1']` | `Array` |
46
46
  | `badv` | optional | Blocked Advertiser Domains | `'example.com'` | `String Url` |
47
- | `bidfloor` | optional | CPM bid floor | `0.25` | `Integer` |
47
+ | `bidfloor` | optional | CPM bid floor | `0.25` | `Float` |
48
48
 
49
49
 
@@ -4,7 +4,7 @@ import {find} from '../src/polyfill.js';
4
4
  import {registerBidder} from '../src/adapters/bidderFactory.js';
5
5
 
6
6
  const BID_METHOD = 'POST';
7
- const BIDDER_URL = 'http://13.234.201.146:8088/va/ad';
7
+ const BIDDER_URL = 'https://ad.ventesavenues.in/va/ad';
8
8
 
9
9
  function groupBy(values, key) {
10
10
  const groups = values.reduce((acc, value) => {
@@ -2,7 +2,7 @@
2
2
  layout: bidder
3
3
  title: ventes
4
4
  description: Prebid ventes Bidder Adapter
5
- pbjs: false
5
+ pbjs: true
6
6
  biddercode: ventes
7
7
  gdpr_supported: false
8
8
  usp_supported: false
@@ -2,6 +2,7 @@ import {registerBidder} from '../src/adapters/bidderFactory.js';
2
2
  import { BANNER } from '../src/mediaTypes.js';
3
3
  import {ajax} from '../src/ajax.js';
4
4
  import {isFn, isPlainObject} from '../src/utils.js';
5
+ import { config } from '../src/config.js';
5
6
 
6
7
  export const spec = {
7
8
  code: 'vrtcal',
@@ -21,10 +22,32 @@ export const spec = {
21
22
  }
22
23
  }
23
24
 
25
+ let gdprApplies = 0;
26
+ let gdprConsent = '';
27
+ let ccpa = '';
28
+ let coppa = 0;
29
+ let tmax = 0;
30
+
31
+ if (bid && bid.gdprConsent) {
32
+ gdprApplies = bid.gdprConsent.gdprApplies ? 1 : 0;
33
+ gdprConsent = bid.gdprConsent.consentString;
34
+ }
35
+
36
+ if (bid && bid.uspConsent) {
37
+ ccpa = bid.uspConsent;
38
+ }
39
+
40
+ if (config.getConfig('coppa') === true) {
41
+ coppa = 1;
42
+ }
43
+
44
+ tmax = config.getConfig('bidderTimeout');
45
+
24
46
  const params = {
25
47
  prebidJS: 1,
26
48
  prebidAdUnitCode: bid.adUnitCode,
27
49
  id: bid.bidId,
50
+ tmax: tmax,
28
51
  imp: [{
29
52
  id: '1',
30
53
  banner: {
@@ -41,6 +64,18 @@ export const spec = {
41
64
  device: {
42
65
  ua: 'VRTCAL_FILLED',
43
66
  ip: 'VRTCAL_FILLED'
67
+ },
68
+ regs: {
69
+ coppa: coppa,
70
+ ext: {
71
+ gdpr: gdprApplies,
72
+ us_privacy: ccpa
73
+ }
74
+ },
75
+ user: {
76
+ ext: {
77
+ consent: gdprConsent
78
+ }
44
79
  }
45
80
  };
46
81
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prebid.js",
3
- "version": "7.3.0",
3
+ "version": "7.6.0",
4
4
  "description": "Header Bidding Management Library",
5
5
  "main": "src/prebid.js",
6
6
  "scripts": {
@@ -19,7 +19,8 @@ function featureMap(disable = []) {
19
19
 
20
20
  function getNpmVersion(version) {
21
21
  try {
22
- return /^(.*?)(-pre)?$/.exec(version)[1];
22
+ // only use "real" versions (that is, not the -pre ones, they won't be on jsDelivr)
23
+ return /^([\d.]+)$/.exec(version)[1];
23
24
  } catch (e) {
24
25
  return 'latest';
25
26
  }
@@ -48,7 +48,7 @@ export function newStorageManager({gvlid, moduleName, bidderCode, moduleType} =
48
48
  let hookDetails = {
49
49
  hasEnforcementHook: false
50
50
  }
51
- validateStorageEnforcement(gvlid, bidderCode || moduleName, moduleType, hookDetails, function(result) {
51
+ validateStorageEnforcement(gvlid, bidderCode || moduleName, hookDetails, function(result) {
52
52
  if (result && result.hasEnforcementHook) {
53
53
  value = cb(result);
54
54
  } else {
@@ -303,7 +303,7 @@ export function newStorageManager({gvlid, moduleName, bidderCode, moduleType} =
303
303
  /**
304
304
  * This hook validates the storage enforcement if gdprEnforcement module is included
305
305
  */
306
- export const validateStorageEnforcement = hook('async', function(gvlid, moduleName, moduleType, hookDetails, callback) {
306
+ export const validateStorageEnforcement = hook('async', function(gvlid, moduleName, hookDetails, callback) {
307
307
  callback(hookDetails);
308
308
  }, 'validateStorageEnforcement');
309
309
 
@@ -322,13 +322,12 @@ export function getCoreStorageManager(moduleName) {
322
322
  * @param {Number=} gvlid? Vendor id - required for proper GDPR integration
323
323
  * @param {string=} bidderCode? - required for bid adapters
324
324
  * @param {string=} moduleName? module name
325
- * @param {string=} moduleType? module type
326
325
  */
327
- export function getStorageManager({gvlid, moduleName, bidderCode, moduleType} = {}) {
326
+ export function getStorageManager({gvlid, moduleName, bidderCode} = {}) {
328
327
  if (arguments.length > 1 || (arguments.length > 0 && !isPlainObject(arguments[0]))) {
329
328
  throw new Error('Invalid invocation for getStorageManager')
330
329
  }
331
- return newStorageManager({gvlid, moduleName, bidderCode, moduleType});
330
+ return newStorageManager({gvlid, moduleName, bidderCode});
332
331
  }
333
332
 
334
333
  export function resetData() {