prebid.js 7.31.0 → 7.32.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 (180) 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/adlooxRtdProvider.js +1 -1
  7. package/dist/adrelevantisBidAdapter.js +1 -1
  8. package/dist/adtrgtmeBidAdapter.js +1 -1
  9. package/dist/adxcgBidAdapter.js +1 -1
  10. package/dist/aidemBidAdapter.js +1 -1
  11. package/dist/ajaBidAdapter.js +1 -1
  12. package/dist/alkimiBidAdapter.js +1 -1
  13. package/dist/amxBidAdapter.js +1 -1
  14. package/dist/amxIdSystem.js +1 -1
  15. package/dist/aolBidAdapter.js +1 -1
  16. package/dist/appierAnalyticsAdapter.js +1 -1
  17. package/dist/appnexusBidAdapter.js +1 -1
  18. package/dist/appushBidAdapter.js +1 -0
  19. package/dist/asoBidAdapter.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/carodaBidAdapter.js +1 -1
  26. package/dist/chtnwBidAdapter.js +1 -1
  27. package/dist/concertBidAdapter.js +1 -1
  28. package/dist/connectIdSystem.js +1 -1
  29. package/dist/connectadBidAdapter.js +1 -1
  30. package/dist/consumableBidAdapter.js +1 -1
  31. package/dist/conversantBidAdapter.js +1 -1
  32. package/dist/craftBidAdapter.js +1 -1
  33. package/dist/criteoBidAdapter.js +1 -1
  34. package/dist/dspxBidAdapter.js +1 -1
  35. package/dist/eplanningBidAdapter.js +1 -1
  36. package/dist/feedadBidAdapter.js +1 -1
  37. package/dist/finativeBidAdapter.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/holidBidAdapter.js +1 -0
  46. package/dist/id5IdSystem.js +1 -1
  47. package/dist/improvedigitalBidAdapter.js +1 -1
  48. package/dist/inmarBidAdapter.js +1 -1
  49. package/dist/insticatorBidAdapter.js +1 -1
  50. package/dist/ixBidAdapter.js +1 -1
  51. package/dist/justpremiumBidAdapter.js +1 -1
  52. package/dist/jwplayerVideoProvider.js +1 -1
  53. package/dist/konduitAnalyticsAdapter.js +1 -1
  54. package/dist/kueezBidAdapter.js +1 -1
  55. package/dist/kueezRtbBidAdapter.js +1 -1
  56. package/dist/lassoBidAdapter.js +1 -1
  57. package/dist/lifestreetBidAdapter.js +1 -1
  58. package/dist/liveyieldAnalyticsAdapter.js +1 -1
  59. package/dist/logicadBidAdapter.js +1 -1
  60. package/dist/loglyliftBidAdapter.js +1 -1
  61. package/dist/magniteAnalyticsAdapter.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/medianetRtdProvider.js +1 -1
  66. package/dist/mediasquareBidAdapter.js +1 -1
  67. package/dist/mgidBidAdapter.js +1 -1
  68. package/dist/minutemediaBidAdapter.js +1 -1
  69. package/dist/nexx360BidAdapter.js +1 -1
  70. package/dist/not-for-prod/prebid.js +126 -123
  71. package/dist/oguryBidAdapter.js +1 -1
  72. package/dist/onetagBidAdapter.js +1 -1
  73. package/dist/ooloAnalyticsAdapter.js +1 -1
  74. package/dist/orbitsoftBidAdapter.js +1 -0
  75. package/dist/outbrainBidAdapter.js +1 -1
  76. package/dist/parrableIdSystem.js +1 -1
  77. package/dist/permutiveRtdProvider.js +1 -1
  78. package/dist/pixfutureBidAdapter.js +1 -1
  79. package/dist/prebid-core.js +1 -1
  80. package/dist/publinkIdSystem.js +1 -1
  81. package/dist/pubmaticBidAdapter.js +1 -1
  82. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  83. package/dist/pxyzBidAdapter.js +1 -1
  84. package/dist/quantcastBidAdapter.js +1 -1
  85. package/dist/readpeakBidAdapter.js +1 -1
  86. package/dist/relaidoBidAdapter.js +1 -1
  87. package/dist/rhythmoneBidAdapter.js +1 -1
  88. package/dist/riseBidAdapter.js +1 -1
  89. package/dist/rubiconAnalyticsAdapter.js +1 -1
  90. package/dist/rubiconBidAdapter.js +1 -1
  91. package/dist/seedingAllianceBidAdapter.js +1 -1
  92. package/dist/seedtagBidAdapter.js +1 -1
  93. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  94. package/dist/sharethroughBidAdapter.js +1 -1
  95. package/dist/shinezBidAdapter.js +1 -1
  96. package/dist/smaatoBidAdapter.js +1 -1
  97. package/dist/smartadserverBidAdapter.js +1 -1
  98. package/dist/smartxBidAdapter.js +1 -1
  99. package/dist/smilewantedBidAdapter.js +1 -1
  100. package/dist/sonobiBidAdapter.js +1 -1
  101. package/dist/sovrnAnalyticsAdapter.js +1 -1
  102. package/dist/sovrnBidAdapter.js +1 -1
  103. package/dist/sspBCBidAdapter.js +1 -1
  104. package/dist/sublimeBidAdapter.js +1 -1
  105. package/dist/synacormediaBidAdapter.js +1 -1
  106. package/dist/taboolaBidAdapter.js +1 -1
  107. package/dist/targetVideoBidAdapter.js +1 -1
  108. package/dist/teadsBidAdapter.js +1 -1
  109. package/dist/trionBidAdapter.js +1 -1
  110. package/dist/tripleliftBidAdapter.js +1 -1
  111. package/dist/ttdBidAdapter.js +1 -1
  112. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  113. package/dist/uid2IdSystem.js +1 -1
  114. package/dist/underdogmediaBidAdapter.js +1 -1
  115. package/dist/undertoneBidAdapter.js +1 -1
  116. package/dist/vidazooBidAdapter.js +1 -1
  117. package/dist/videobyteBidAdapter.js +1 -1
  118. package/dist/visxBidAdapter.js +1 -1
  119. package/dist/vuukleBidAdapter.js +1 -1
  120. package/dist/widespaceBidAdapter.js +1 -1
  121. package/dist/winrBidAdapter.js +1 -1
  122. package/dist/yahoosspBidAdapter.js +1 -1
  123. package/dist/yieldlabBidAdapter.js +1 -1
  124. package/dist/yieldmoBidAdapter.js +1 -1
  125. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  126. package/integrationExamples/gpt/adloox.html +5 -0
  127. package/modules/adagioBidAdapter.js +0 -4
  128. package/modules/adagioBidAdapter.md +4 -22
  129. package/modules/adlooxAnalyticsAdapter.md +5 -3
  130. package/modules/adlooxRtdProvider.js +82 -278
  131. package/modules/adlooxRtdProvider.md +6 -6
  132. package/modules/aidemBidAdapter.js +4 -0
  133. package/modules/aidemBidAdapter.md +1 -0
  134. package/modules/alkimiBidAdapter.js +23 -6
  135. package/modules/aolBidAdapter.js +12 -0
  136. package/modules/appnexusBidAdapter.js +2 -2
  137. package/modules/appushBidAdapter.js +188 -0
  138. package/modules/appushBidAdapter.md +79 -0
  139. package/modules/asoBidAdapter.js +8 -5
  140. package/modules/confiantRtdProvider.js +1 -1
  141. package/modules/connectIdSystem.js +15 -1
  142. package/modules/feedadBidAdapter.js +7 -5
  143. package/modules/holidBidAdapter.js +170 -0
  144. package/modules/holidBidAdapter.md +36 -0
  145. package/modules/jwplayerVideoProvider.js +10 -3
  146. package/modules/kueezRtbBidAdapter.js +21 -8
  147. package/modules/medianetRtdProvider.js +4 -4
  148. package/modules/nexx360BidAdapter.js +5 -7
  149. package/modules/orbitsoftBidAdapter.js +150 -0
  150. package/modules/permutiveRtdProvider.js +1 -1
  151. package/modules/riseBidAdapter.js +2 -1
  152. package/modules/riseBidAdapter.md +2 -0
  153. package/modules/seedtagBidAdapter.js +12 -0
  154. package/modules/smartxBidAdapter.js +6 -0
  155. package/modules/taboolaBidAdapter.js +61 -14
  156. package/modules/yahoosspBidAdapter.js +5 -0
  157. package/modules/yieldlabBidAdapter.js +150 -134
  158. package/modules/yieldmoBidAdapter.js +1 -12
  159. package/package.json +1 -1
  160. package/test/spec/modules/adagioBidAdapter_spec.js +1 -28
  161. package/test/spec/modules/adlooxRtdProvider_spec.js +28 -120
  162. package/test/spec/modules/aidemBidAdapter_spec.js +10 -2
  163. package/test/spec/modules/alkimiBidAdapter_spec.js +15 -3
  164. package/test/spec/modules/aolBidAdapter_spec.js +22 -0
  165. package/test/spec/modules/appnexusBidAdapter_spec.js +7 -3
  166. package/test/spec/modules/appushBidAdapter_spec.js +372 -0
  167. package/test/spec/modules/connectIdSystem_spec.js +17 -5
  168. package/test/spec/modules/feedadBidAdapter_spec.js +23 -1
  169. package/test/spec/modules/holidBidAdapter_spec.js +165 -0
  170. package/test/spec/modules/kueezRtbBidAdapter_spec.js +147 -24
  171. package/test/spec/modules/medianetRtdProvider_spec.js +3 -3
  172. package/test/spec/modules/orbitsoftBidAdapter_spec.js +255 -0
  173. package/test/spec/modules/riseBidAdapter_spec.js +7 -0
  174. package/test/spec/modules/seedtagBidAdapter_spec.js +56 -10
  175. package/test/spec/modules/smartxBidAdapter_spec.js +10 -0
  176. package/test/spec/modules/taboolaBidAdapter_spec.js +142 -5
  177. package/test/spec/modules/videoModule/submodules/jwplayerVideoProvider_spec.js +45 -10
  178. package/test/spec/modules/yahoosspBidAdapter_spec.js +16 -1
  179. package/test/spec/modules/yieldlabBidAdapter_spec.js +311 -301
  180. package/test/spec/modules/yieldmoBidAdapter_spec.js +70 -0
@@ -1,17 +1,17 @@
1
- import { _each, deepAccess, isArray, isFn, isPlainObject, timestamp } from '../src/utils.js'
2
- import { registerBidder } from '../src/adapters/bidderFactory.js'
3
- import { find } from '../src/polyfill.js'
4
- import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js'
5
- import { Renderer } from '../src/Renderer.js'
1
+ import { _each, deepAccess, isArray, isFn, isPlainObject, timestamp } from '../src/utils.js';
2
+ import { registerBidder } from '../src/adapters/bidderFactory.js';
3
+ import { find } from '../src/polyfill.js';
4
+ import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js';
5
+ import { Renderer } from '../src/Renderer.js';
6
6
  import { convertOrtbRequestToProprietaryNative } from '../src/native.js';
7
7
 
8
- const ENDPOINT = 'https://ad.yieldlab.net'
9
- const BIDDER_CODE = 'yieldlab'
10
- const BID_RESPONSE_TTL_SEC = 300
11
- const CURRENCY_CODE = 'EUR'
12
- const OUTSTREAMPLAYER_URL = 'https://ad.adition.com/dynamic.ad?a=o193092&ma_loadEvent=ma-start-event'
13
- const GVLID = 70
14
- const DIMENSION_SIGN = 'x'
8
+ const ENDPOINT = 'https://ad.yieldlab.net';
9
+ const BIDDER_CODE = 'yieldlab';
10
+ const BID_RESPONSE_TTL_SEC = 300;
11
+ const CURRENCY_CODE = 'EUR';
12
+ const OUTSTREAMPLAYER_URL = 'https://ad.adition.com/dynamic.ad?a=o193092&ma_loadEvent=ma-start-event';
13
+ const GVLID = 70;
14
+ const DIMENSION_SIGN = 'x';
15
15
 
16
16
  export const spec = {
17
17
  code: BIDDER_CODE,
@@ -22,11 +22,11 @@ export const spec = {
22
22
  * @param {object} bid
23
23
  * @returns {boolean}
24
24
  */
25
- isBidRequestValid: function (bid) {
25
+ isBidRequestValid(bid) {
26
26
  if (bid && bid.params && bid.params.adslotId && bid.params.supplyId) {
27
- return true
27
+ return true;
28
28
  }
29
- return false
29
+ return false;
30
30
  },
31
31
 
32
32
  /**
@@ -35,84 +35,85 @@ export const spec = {
35
35
  * @param [bidderRequest]
36
36
  * @returns {ServerRequest|ServerRequest[]}
37
37
  */
38
- buildRequests: function (validBidRequests, bidderRequest) {
38
+ buildRequests(validBidRequests, bidderRequest) {
39
39
  // convert Native ORTB definition to old-style prebid native definition
40
40
  validBidRequests = convertOrtbRequestToProprietaryNative(validBidRequests);
41
41
 
42
- const adslotIds = []
42
+ const adslotIds = [];
43
43
  const adslotSizes = [];
44
44
  const adslotFloors = [];
45
- const timestamp = Date.now()
45
+ const timestamp = Date.now();
46
46
  const query = {
47
47
  ts: timestamp,
48
- json: true
49
- }
48
+ json: true,
49
+ };
50
50
 
51
51
  _each(validBidRequests, function (bid) {
52
- adslotIds.push(bid.params.adslotId)
53
- const sizes = extractSizes(bid)
52
+ adslotIds.push(bid.params.adslotId);
53
+ const sizes = extractSizes(bid);
54
54
  if (sizes.length > 0) {
55
- adslotSizes.push(bid.params.adslotId + ':' + sizes.join('|'))
55
+ adslotSizes.push(bid.params.adslotId + ':' + sizes.join('|'));
56
56
  }
57
57
  if (bid.params.extId) {
58
58
  query.id = bid.params.extId;
59
59
  }
60
60
  if (bid.params.targeting) {
61
- query.t = createTargetingString(bid.params.targeting)
61
+ query.t = createTargetingString(bid.params.targeting);
62
62
  }
63
63
  if (bid.userIdAsEids && Array.isArray(bid.userIdAsEids)) {
64
- query.ids = createUserIdString(bid.userIdAsEids)
64
+ query.ids = createUserIdString(bid.userIdAsEids);
65
+ query.atypes = createUserIdAtypesString(bid.userIdAsEids);
65
66
  }
66
67
  if (bid.params.customParams && isPlainObject(bid.params.customParams)) {
67
68
  for (const prop in bid.params.customParams) {
68
- query[prop] = bid.params.customParams[prop]
69
+ query[prop] = bid.params.customParams[prop];
69
70
  }
70
71
  }
71
72
  if (bid.schain && isPlainObject(bid.schain) && Array.isArray(bid.schain.nodes)) {
72
- query.schain = createSchainString(bid.schain)
73
+ query.schain = createSchainString(bid.schain);
73
74
  }
74
75
 
75
- const iabContent = getContentObject(bid)
76
+ const iabContent = getContentObject(bid);
76
77
  if (iabContent) {
77
- query.iab_content = createIabContentString(iabContent)
78
+ query.iab_content = createIabContentString(iabContent);
78
79
  }
79
- const floor = getBidFloor(bid, sizes)
80
+ const floor = getBidFloor(bid, sizes);
80
81
  if (floor) {
81
82
  adslotFloors.push(bid.params.adslotId + ':' + floor);
82
83
  }
83
- })
84
+ });
84
85
 
85
86
  if (bidderRequest) {
86
87
  if (bidderRequest.refererInfo && bidderRequest.refererInfo.page) {
87
88
  // TODO: is 'page' the right value here?
88
- query.pubref = bidderRequest.refererInfo.page
89
+ query.pubref = bidderRequest.refererInfo.page;
89
90
  }
90
91
 
91
92
  if (bidderRequest.gdprConsent) {
92
- query.gdpr = (typeof bidderRequest.gdprConsent.gdprApplies === 'boolean') ? bidderRequest.gdprConsent.gdprApplies : true
93
+ query.gdpr = (typeof bidderRequest.gdprConsent.gdprApplies === 'boolean') ? bidderRequest.gdprConsent.gdprApplies : true;
93
94
  if (query.gdpr) {
94
- query.consent = bidderRequest.gdprConsent.consentString
95
+ query.consent = bidderRequest.gdprConsent.consentString;
95
96
  }
96
97
  }
97
98
  }
98
99
 
99
- const adslots = adslotIds.join(',')
100
+ const adslots = adslotIds.join(',');
100
101
  if (adslotSizes.length > 0) {
101
- query.sizes = adslotSizes.join(',')
102
+ query.sizes = adslotSizes.join(',');
102
103
  }
103
104
 
104
105
  if (adslotFloors.length > 0) {
105
- query.floor = adslotFloors.join(',')
106
+ query.floor = adslotFloors.join(',');
106
107
  }
107
108
 
108
- const queryString = createQueryString(query)
109
+ const queryString = createQueryString(query);
109
110
 
110
111
  return {
111
112
  method: 'GET',
112
113
  url: `${ENDPOINT}/yp/${adslots}?${queryString}`,
113
114
  validBidRequests: validBidRequests,
114
- queryParams: query
115
- }
115
+ queryParams: query,
116
+ };
116
117
  },
117
118
 
118
119
  /**
@@ -121,29 +122,29 @@ export const spec = {
121
122
  * @param {BidRequest} originalBidRequest
122
123
  * @returns {Bid[]}
123
124
  */
124
- interpretResponse: function (serverResponse, originalBidRequest) {
125
- const bidResponses = []
126
- const timestamp = Date.now()
127
- const reqParams = originalBidRequest.queryParams
125
+ interpretResponse(serverResponse, originalBidRequest) {
126
+ const bidResponses = [];
127
+ const timestamp = Date.now();
128
+ const reqParams = originalBidRequest.queryParams;
128
129
 
129
130
  originalBidRequest.validBidRequests.forEach(function (bidRequest) {
130
131
  if (!serverResponse.body) {
131
- return
132
+ return;
132
133
  }
133
134
 
134
135
  const matchedBid = find(serverResponse.body, function (bidResponse) {
135
- return bidRequest.params.adslotId == bidResponse.id
136
- })
136
+ return bidRequest.params.adslotId == bidResponse.id;
137
+ });
137
138
 
138
139
  if (matchedBid) {
139
- const adUnitSize = bidRequest.sizes.length === 2 && !isArray(bidRequest.sizes[0]) ? bidRequest.sizes : bidRequest.sizes[0]
140
- const adSize = bidRequest.params.adSize !== undefined ? parseSize(bidRequest.params.adSize) : (matchedBid.adsize !== undefined) ? parseSize(matchedBid.adsize) : adUnitSize
141
- const extId = bidRequest.params.extId !== undefined ? '&id=' + bidRequest.params.extId : ''
142
- const adType = matchedBid.adtype !== undefined ? matchedBid.adtype : ''
143
- const gdprApplies = reqParams.gdpr ? '&gdpr=' + reqParams.gdpr : ''
144
- const gdprConsent = reqParams.consent ? '&consent=' + reqParams.consent : ''
145
- const pvId = matchedBid.pvid !== undefined ? '&pvid=' + matchedBid.pvid : ''
146
- const iabContent = reqParams.iab_content ? '&iab_content=' + reqParams.iab_content : ''
140
+ const adUnitSize = bidRequest.sizes.length === 2 && !isArray(bidRequest.sizes[0]) ? bidRequest.sizes : bidRequest.sizes[0];
141
+ const adSize = bidRequest.params.adSize !== undefined ? parseSize(bidRequest.params.adSize) : (matchedBid.adsize !== undefined) ? parseSize(matchedBid.adsize) : adUnitSize;
142
+ const extId = bidRequest.params.extId !== undefined ? '&id=' + bidRequest.params.extId : '';
143
+ const adType = matchedBid.adtype !== undefined ? matchedBid.adtype : '';
144
+ const gdprApplies = reqParams.gdpr ? '&gdpr=' + reqParams.gdpr : '';
145
+ const gdprConsent = reqParams.consent ? '&consent=' + reqParams.consent : '';
146
+ const pvId = matchedBid.pvid !== undefined ? '&pvid=' + matchedBid.pvid : '';
147
+ const iabContent = reqParams.iab_content ? '&iab_content=' + reqParams.iab_content : '';
147
148
 
148
149
  const bidResponse = {
149
150
  requestId: bidRequest.bidId,
@@ -158,38 +159,38 @@ export const spec = {
158
159
  referrer: '',
159
160
  ad: `<script src="${ENDPOINT}/d/${matchedBid.id}/${bidRequest.params.supplyId}/?ts=${timestamp}${extId}${gdprApplies}${gdprConsent}${pvId}${iabContent}"></script>`,
160
161
  meta: {
161
- advertiserDomains: (matchedBid.advertiser) ? matchedBid.advertiser : 'n/a'
162
- }
163
- }
162
+ advertiserDomains: (matchedBid.advertiser) ? matchedBid.advertiser : 'n/a',
163
+ },
164
+ };
164
165
 
165
166
  if (isVideo(bidRequest, adType)) {
166
- const playersize = getPlayerSize(bidRequest)
167
+ const playersize = getPlayerSize(bidRequest);
167
168
  if (playersize) {
168
- bidResponse.width = playersize[0]
169
- bidResponse.height = playersize[1]
169
+ bidResponse.width = playersize[0];
170
+ bidResponse.height = playersize[1];
170
171
  }
171
- bidResponse.mediaType = VIDEO
172
- bidResponse.vastUrl = `${ENDPOINT}/d/${matchedBid.id}/${bidRequest.params.supplyId}/?ts=${timestamp}${extId}${gdprApplies}${gdprConsent}${pvId}${iabContent}`
172
+ bidResponse.mediaType = VIDEO;
173
+ bidResponse.vastUrl = `${ENDPOINT}/d/${matchedBid.id}/${bidRequest.params.supplyId}/?ts=${timestamp}${extId}${gdprApplies}${gdprConsent}${pvId}${iabContent}`;
173
174
  if (isOutstream(bidRequest)) {
174
175
  const renderer = Renderer.install({
175
176
  id: bidRequest.bidId,
176
177
  url: OUTSTREAMPLAYER_URL,
177
- loaded: false
178
- })
179
- renderer.setRender(outstreamRender)
180
- bidResponse.renderer = renderer
178
+ loaded: false,
179
+ });
180
+ renderer.setRender(outstreamRender);
181
+ bidResponse.renderer = renderer;
181
182
  }
182
183
  }
183
184
 
184
185
  if (isNative(bidRequest, adType)) {
185
186
  // there may be publishers still rely on it
186
- const url = `${ENDPOINT}/d/${matchedBid.id}/${bidRequest.params.supplyId}/?ts=${timestamp}${extId}${gdprApplies}${gdprConsent}${pvId}`
187
- bidResponse.adUrl = url
188
- bidResponse.mediaType = NATIVE
189
- const nativeImageAssetObj = find(matchedBid.native.assets, e => e.id === 2)
187
+ const url = `${ENDPOINT}/d/${matchedBid.id}/${bidRequest.params.supplyId}/?ts=${timestamp}${extId}${gdprApplies}${gdprConsent}${pvId}`;
188
+ bidResponse.adUrl = url;
189
+ bidResponse.mediaType = NATIVE;
190
+ const nativeImageAssetObj = find(matchedBid.native.assets, e => e.id === 2);
190
191
  const nativeImageAsset = nativeImageAssetObj ? nativeImageAssetObj.img : { url: '', w: 0, h: 0 };
191
- const nativeTitleAsset = find(matchedBid.native.assets, e => e.id === 1)
192
- const nativeBodyAsset = find(matchedBid.native.assets, e => e.id === 3)
192
+ const nativeTitleAsset = find(matchedBid.native.assets, e => e.id === 1);
193
+ const nativeBodyAsset = find(matchedBid.native.assets, e => e.id === 3);
193
194
  bidResponse.native = {
194
195
  title: nativeTitleAsset ? nativeTitleAsset.title.text : '',
195
196
  body: nativeBodyAsset ? nativeBodyAsset.data.value : '',
@@ -203,10 +204,10 @@ export const spec = {
203
204
  };
204
205
  }
205
206
 
206
- bidResponses.push(bidResponse)
207
+ bidResponses.push(bidResponse);
207
208
  }
208
- })
209
- return bidResponses
209
+ });
210
+ return bidResponses;
210
211
  },
211
212
 
212
213
  /**
@@ -218,13 +219,13 @@ export const spec = {
218
219
  * @param {string} uspConsent Is the US Privacy Consent string.
219
220
  * @return {UserSync[]} The user syncs which should be dropped.
220
221
  */
221
- getUserSyncs: function (syncOptions, serverResponses, gdprConsent, uspConsent) {
222
+ getUserSyncs(syncOptions, serverResponses, gdprConsent, uspConsent) {
222
223
  const syncs = [];
223
224
 
224
225
  if (syncOptions.iframeEnabled) {
225
226
  const params = [];
226
227
  params.push(`ts=${timestamp()}`);
227
- params.push(`type=h`)
228
+ params.push(`type=h`);
228
229
  if (gdprConsent && (typeof gdprConsent.gdprApplies === 'boolean')) {
229
230
  params.push(`gdpr=${Number(gdprConsent.gdprApplies)}`);
230
231
  }
@@ -233,12 +234,12 @@ export const spec = {
233
234
  }
234
235
  syncs.push({
235
236
  type: 'iframe',
236
- url: `${ENDPOINT}/d/6846326/766/2x2?${params.join('&')}`
237
+ url: `${ENDPOINT}/d/6846326/766/2x2?${params.join('&')}`,
237
238
  });
238
239
  }
239
240
 
240
241
  return syncs;
241
- }
242
+ },
242
243
  };
243
244
 
244
245
  /**
@@ -248,7 +249,7 @@ export const spec = {
248
249
  * @returns {Boolean}
249
250
  */
250
251
  function isVideo(format, adtype) {
251
- return deepAccess(format, 'mediaTypes.video') && adtype.toLowerCase() === 'video'
252
+ return deepAccess(format, 'mediaTypes.video') && adtype.toLowerCase() === 'video';
252
253
  }
253
254
 
254
255
  /**
@@ -258,7 +259,7 @@ function isVideo(format, adtype) {
258
259
  * @returns {Boolean}
259
260
  */
260
261
  function isNative(format, adtype) {
261
- return deepAccess(format, 'mediaTypes.native') && adtype.toLowerCase() === 'native'
262
+ return deepAccess(format, 'mediaTypes.native') && adtype.toLowerCase() === 'native';
262
263
  }
263
264
 
264
265
  /**
@@ -267,8 +268,8 @@ function isNative(format, adtype) {
267
268
  * @returns {Boolean}
268
269
  */
269
270
  function isOutstream(format) {
270
- const context = deepAccess(format, 'mediaTypes.video.context')
271
- return (context === 'outstream')
271
+ const context = deepAccess(format, 'mediaTypes.video.context');
272
+ return (context === 'outstream');
272
273
  }
273
274
 
274
275
  /**
@@ -277,30 +278,45 @@ function isOutstream(format) {
277
278
  * @returns {Array}
278
279
  */
279
280
  function getPlayerSize(format) {
280
- const playerSize = deepAccess(format, 'mediaTypes.video.playerSize')
281
- return (playerSize && isArray(playerSize[0])) ? playerSize[0] : playerSize
281
+ const playerSize = deepAccess(format, 'mediaTypes.video.playerSize');
282
+ return (playerSize && isArray(playerSize[0])) ? playerSize[0] : playerSize;
282
283
  }
283
284
 
284
285
  /**
285
- * Expands a 'WxH' string as a 2-element [W, H] array
286
+ * Expands a 'WxH' string to a 2-element [W, H] array
286
287
  * @param {String} size
287
288
  * @returns {Array}
288
289
  */
289
290
  function parseSize(size) {
290
- return size.split(DIMENSION_SIGN).map(Number)
291
+ return size.split(DIMENSION_SIGN).map(Number);
291
292
  }
292
293
 
293
294
  /**
294
295
  * Creates a string out of an array of eids with source and uid
295
- * @param {Array} eids
296
+ * @param {Array.<{source: String, uids: Array.<{id: String, atype: Number, ext: Object}>}>} eids
296
297
  * @returns {String}
297
298
  */
298
299
  function createUserIdString(eids) {
299
- const str = []
300
+ const str = [];
300
301
  for (let i = 0; i < eids.length; i++) {
301
- str.push(eids[i].source + ':' + eids[i].uids[0].id)
302
+ str.push(eids[i].source + ':' + eids[i].uids[0].id);
302
303
  }
303
- return str.join(',')
304
+ return str.join(',');
305
+ }
306
+
307
+ /**
308
+ * Creates a string from an array of eids with ID provider and atype if atype exists
309
+ * @param {Array.<{source: String, uids: Array.<{id: String, atype: Number, ext: Object}>}>} eids
310
+ * @returns {String} idprovider:atype,idprovider2:atype2,...
311
+ */
312
+ function createUserIdAtypesString(eids) {
313
+ const str = [];
314
+ for (let i = 0; i < eids.length; i++) {
315
+ if (eids[i].uids[0].atype) {
316
+ str.push(eids[i].source + ':' + eids[i].uids[0].atype);
317
+ }
318
+ }
319
+ return str.join(',');
304
320
  }
305
321
 
306
322
  /**
@@ -309,18 +325,18 @@ function createUserIdString(eids) {
309
325
  * @returns {String}
310
326
  */
311
327
  function createQueryString(obj) {
312
- const str = []
328
+ const str = [];
313
329
  for (const p in obj) {
314
330
  if (obj.hasOwnProperty(p)) {
315
- const val = obj[p]
331
+ const val = obj[p];
316
332
  if (p !== 'schain' && p !== 'iab_content') {
317
- str.push(encodeURIComponent(p) + '=' + encodeURIComponent(val))
333
+ str.push(encodeURIComponent(p) + '=' + encodeURIComponent(val));
318
334
  } else {
319
- str.push(p + '=' + val)
335
+ str.push(p + '=' + val);
320
336
  }
321
337
  }
322
338
  }
323
- return str.join('&')
339
+ return str.join('&');
324
340
  }
325
341
 
326
342
  /**
@@ -329,15 +345,15 @@ function createQueryString(obj) {
329
345
  * @returns {String}
330
346
  */
331
347
  function createTargetingString(obj) {
332
- const str = []
348
+ const str = [];
333
349
  for (const p in obj) {
334
350
  if (obj.hasOwnProperty(p)) {
335
- const key = p
336
- const val = obj[p]
337
- str.push(key + '=' + val)
351
+ const key = p;
352
+ const val = obj[p];
353
+ str.push(key + '=' + val);
338
354
  }
339
355
  }
340
- return str.join('&')
356
+ return str.join('&');
341
357
  }
342
358
 
343
359
  /**
@@ -346,13 +362,13 @@ function createTargetingString(obj) {
346
362
  * @returns {String}
347
363
  */
348
364
  function createSchainString(schain) {
349
- const ver = schain.ver || ''
350
- const complete = (schain.complete === 1 || schain.complete === 0) ? schain.complete : ''
351
- const keys = ['asi', 'sid', 'hp', 'rid', 'name', 'domain', 'ext']
365
+ const ver = schain.ver || '';
366
+ const complete = (schain.complete === 1 || schain.complete === 0) ? schain.complete : '';
367
+ const keys = ['asi', 'sid', 'hp', 'rid', 'name', 'domain', 'ext'];
352
368
  const nodesString = schain.nodes.reduce((acc, node) => {
353
- return acc += `!${keys.map(key => node[key] ? encodeURIComponentWithBangIncluded(node[key]) : '').join(',')}`
354
- }, '')
355
- return `${ver},${complete}${nodesString}`
369
+ return acc += `!${keys.map(key => node[key] ? encodeURIComponentWithBangIncluded(node[key]) : '').join(',')}`;
370
+ }, '');
371
+ return `${ver},${complete}${nodesString}`;
356
372
  }
357
373
 
358
374
  /**
@@ -364,15 +380,15 @@ function createSchainString(schain) {
364
380
  */
365
381
  function getContentObject(bid) {
366
382
  if (bid.params.iabContent && isPlainObject(bid.params.iabContent)) {
367
- return bid.params.iabContent
383
+ return bid.params.iabContent;
368
384
  }
369
385
 
370
386
  const globalContent = deepAccess(bid, 'ortb2.site') ? deepAccess(bid, 'ortb2.site.content')
371
- : deepAccess(bid, 'ortb2.app.content')
387
+ : deepAccess(bid, 'ortb2.app.content');
372
388
  if (globalContent && isPlainObject(globalContent)) {
373
- return globalContent
389
+ return globalContent;
374
390
  }
375
- return undefined
391
+ return undefined;
376
392
  }
377
393
 
378
394
  /**
@@ -385,15 +401,15 @@ function getContentObject(bid) {
385
401
  * @returns {String}
386
402
  */
387
403
  function createIabContentString(iabContent) {
388
- const arrKeys = ['keywords', 'cat']
389
- const str = []
404
+ const arrKeys = ['keywords', 'cat'];
405
+ const str = [];
390
406
  const transformObjToParam = (obj = {}, extraKey = '') => {
391
407
  for (const key in obj) {
392
408
  if ((arrKeys.indexOf(key) !== -1 && Array.isArray(obj[key]))) {
393
409
  // Array of defined keyword which have to be joined into one value from "key: [value1, value2, value3]" to "key:value1|value2|value3"
394
- str.push(''.concat(key, ':', obj[key].map(node => encodeURIComponent(node)).join('|')))
410
+ str.push(''.concat(key, ':', obj[key].map(node => encodeURIComponent(node)).join('|')));
395
411
  } else if (typeof obj[key] !== 'object') {
396
- str.push(''.concat(extraKey + key, ':', encodeURIComponent(obj[key])))
412
+ str.push(''.concat(extraKey + key, ':', encodeURIComponent(obj[key])));
397
413
  } else {
398
414
  // Object has to be further flattened
399
415
  transformObjToParam(obj[key], ''.concat(extraKey, key, '.'));
@@ -401,7 +417,7 @@ function createIabContentString(iabContent) {
401
417
  }
402
418
  return str.join(',');
403
419
  };
404
- return encodeURIComponent(transformObjToParam(iabContent))
420
+ return encodeURIComponent(transformObjToParam(iabContent));
405
421
  }
406
422
 
407
423
  /**
@@ -410,7 +426,7 @@ function createIabContentString(iabContent) {
410
426
  * @returns {String}
411
427
  */
412
428
  function encodeURIComponentWithBangIncluded(str) {
413
- return encodeURIComponent(str).replace(/!/g, '%21')
429
+ return encodeURIComponent(str).replace(/!/g, '%21');
414
430
  }
415
431
 
416
432
  /**
@@ -419,11 +435,11 @@ function encodeURIComponentWithBangIncluded(str) {
419
435
  */
420
436
  function outstreamRender(bid) {
421
437
  bid.renderer.push(() => {
422
- window.ma_width = bid.width
423
- window.ma_height = bid.height
424
- window.ma_vastUrl = bid.vastUrl
425
- window.ma_container = bid.adUnitCode
426
- window.document.dispatchEvent(new Event('ma-start-event'))
438
+ window.ma_width = bid.width;
439
+ window.ma_height = bid.height;
440
+ window.ma_vastUrl = bid.vastUrl;
441
+ window.ma_container = bid.adUnitCode;
442
+ window.document.dispatchEvent(new Event('ma-start-event'));
427
443
  });
428
444
  }
429
445
 
@@ -434,33 +450,33 @@ function outstreamRender(bid) {
434
450
  * @returns {string[]}
435
451
  */
436
452
  function extractSizes(bid) {
437
- const { mediaTypes } = bid // see https://docs.prebid.org/dev-docs/adunit-reference.html#examples
438
- const sizes = []
453
+ const { mediaTypes } = bid; // see https://docs.prebid.org/dev-docs/adunit-reference.html#examples
454
+ const sizes = [];
439
455
 
440
456
  if (isPlainObject(mediaTypes)) {
441
- const { [BANNER]: bannerType } = mediaTypes
457
+ const { [BANNER]: bannerType } = mediaTypes;
442
458
 
443
459
  // only applies for multi size Adslots -> BANNER
444
460
  if (bannerType && isArray(bannerType.sizes)) {
445
461
  if (isArray(bannerType.sizes[0])) { // multiple sizes given
446
- sizes.push(bannerType.sizes)
462
+ sizes.push(bannerType.sizes);
447
463
  } else { // just one size provided as array -> wrap to uniformly flatten later
448
- sizes.push([bannerType.sizes])
464
+ sizes.push([bannerType.sizes]);
449
465
  }
450
466
  }
451
467
  // The bid top level field `sizes` is deprecated and should not be used anymore. Keeping it for compatibility.
452
468
  } else if (isArray(bid.sizes)) {
453
469
  if (isArray(bid.sizes[0])) {
454
- sizes.push(bid.sizes)
470
+ sizes.push(bid.sizes);
455
471
  } else {
456
- sizes.push([bid.sizes])
472
+ sizes.push([bid.sizes]);
457
473
  }
458
474
  }
459
475
 
460
476
  /** @type {Set<string>} */
461
- const deduplicatedSizeStrings = new Set(sizes.flat().map(([width, height]) => width + DIMENSION_SIGN + height))
477
+ const deduplicatedSizeStrings = new Set(sizes.flat().map(([width, height]) => width + DIMENSION_SIGN + height));
462
478
 
463
- return Array.from(deduplicatedSizeStrings)
479
+ return Array.from(deduplicatedSizeStrings);
464
480
  }
465
481
 
466
482
  /**
@@ -481,7 +497,7 @@ function getBidFloor(bid, sizes) {
481
497
  const floor = bid.getFloor({
482
498
  currency: CURRENCY_CODE,
483
499
  mediaType: mediaType !== undefined && spec.supportedMediaTypes.includes(mediaType) ? mediaType : '*',
484
- size: sizes.length !== 1 ? '*' : sizes[0].split(DIMENSION_SIGN)
500
+ size: sizes.length !== 1 ? '*' : sizes[0].split(DIMENSION_SIGN),
485
501
  });
486
502
  if (floor.currency === CURRENCY_CODE) {
487
503
  return (floor.floor * 100).toFixed(0);
@@ -489,4 +505,4 @@ function getBidFloor(bid, sizes) {
489
505
  return undefined;
490
506
  }
491
507
 
492
- registerBidder(spec)
508
+ registerBidder(spec);
@@ -385,7 +385,7 @@ function openRtbRequest(bidRequests, bidderRequest) {
385
385
  at: 1,
386
386
  imp: bidRequests.map(bidRequest => openRtbImpression(bidRequest)),
387
387
  site: openRtbSite(bidRequests[0], bidderRequest),
388
- device: openRtbDevice(bidRequests[0]),
388
+ device: deepAccess(bidderRequest, 'ortb2.device'),
389
389
  badv: bidRequests[0].params.badv || [],
390
390
  bcat: deepAccess(bidderRequest, 'bcat') || bidRequests[0].params.bcat || [],
391
391
  ext: {
@@ -507,17 +507,6 @@ function openRtbSite(bidRequest, bidderRequest) {
507
507
  return result;
508
508
  }
509
509
 
510
- /**
511
- * @return Object OpenRTB's 'device' object
512
- */
513
- function openRtbDevice(bidRequest) {
514
- const deviceObj = {
515
- ua: navigator.userAgent,
516
- language: (navigator.language || navigator.browserLanguage || navigator.userLanguage || navigator.systemLanguage),
517
- };
518
- return deviceObj;
519
- }
520
-
521
510
  /**
522
511
  * Updates openRtbRequest with GDPR info from bidderRequest, if present.
523
512
  * @param {Object} openRtbRequest OpenRTB's request to update.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prebid.js",
3
- "version": "7.31.0",
3
+ "version": "7.32.0",
4
4
  "description": "Header Bidding Management Library",
5
5
  "main": "src/prebid.js",
6
6
  "scripts": {