prebid.js 7.33.0 → 7.34.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 (164) hide show
  1. package/.github/workflows/issue_tracker.yml +26 -15
  2. package/dist/33acrossBidAdapter.js +1 -1
  3. package/dist/33acrossIdSystem.js +1 -1
  4. package/dist/adagioBidAdapter.js +1 -1
  5. package/dist/adbookpspBidAdapter.js +1 -1
  6. package/dist/adgenerationBidAdapter.js +1 -1
  7. package/dist/admaticBidAdapter.js +1 -1
  8. package/dist/admixerBidAdapter.js +1 -1
  9. package/dist/adnuntiusBidAdapter.js +1 -1
  10. package/dist/adrelevantisBidAdapter.js +1 -1
  11. package/dist/adtrgtmeBidAdapter.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/arcspanRtdProvider.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/bliinkBidAdapter.js +1 -1
  24. package/dist/bridgewellBidAdapter.js +1 -1
  25. package/dist/brightMountainMediaBidAdapter.js +1 -1
  26. package/dist/carodaBidAdapter.js +1 -1
  27. package/dist/chtnwBidAdapter.js +1 -1
  28. package/dist/concertBidAdapter.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/emx_digitalBidAdapter.js +1 -1
  36. package/dist/eplanningBidAdapter.js +1 -1
  37. package/dist/feedadBidAdapter.js +1 -1
  38. package/dist/finativeBidAdapter.js +1 -1
  39. package/dist/glimpseBidAdapter.js +1 -1
  40. package/dist/gmosspBidAdapter.js +1 -1
  41. package/dist/goldbachBidAdapter.js +1 -1
  42. package/dist/gridBidAdapter.js +1 -1
  43. package/dist/gridNMBidAdapter.js +1 -1
  44. package/dist/gumgumBidAdapter.js +1 -1
  45. package/dist/h12mediaBidAdapter.js +1 -1
  46. package/dist/holidBidAdapter.js +1 -1
  47. package/dist/id5IdSystem.js +1 -1
  48. package/dist/improvedigitalBidAdapter.js +1 -1
  49. package/dist/inmarBidAdapter.js +1 -1
  50. package/dist/insticatorBidAdapter.js +1 -1
  51. package/dist/ixBidAdapter.js +1 -1
  52. package/dist/justpremiumBidAdapter.js +1 -1
  53. package/dist/kargoBidAdapter.js +1 -1
  54. package/dist/konduitAnalyticsAdapter.js +1 -1
  55. package/dist/kueezBidAdapter.js +1 -1
  56. package/dist/kueezRtbBidAdapter.js +1 -1
  57. package/dist/lassoBidAdapter.js +1 -1
  58. package/dist/lifestreetBidAdapter.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/lotamePanoramaIdSystem.js +1 -1
  63. package/dist/magniteAnalyticsAdapter.js +1 -1
  64. package/dist/malltvAnalyticsAdapter.js +1 -1
  65. package/dist/marsmediaBidAdapter.js +1 -1
  66. package/dist/mediafuseBidAdapter.js +1 -1
  67. package/dist/mediasquareBidAdapter.js +1 -1
  68. package/dist/mgidBidAdapter.js +1 -1
  69. package/dist/minutemediaBidAdapter.js +1 -1
  70. package/dist/nextMillenniumBidAdapter.js +1 -1
  71. package/dist/nexx360BidAdapter.js +1 -1
  72. package/dist/not-for-prod/prebid.js +126 -125
  73. package/dist/oguryBidAdapter.js +1 -1
  74. package/dist/onetagBidAdapter.js +1 -1
  75. package/dist/ooloAnalyticsAdapter.js +1 -1
  76. package/dist/openxBidAdapter.js +1 -1
  77. package/dist/ortbConverter.js +1 -1
  78. package/dist/outbrainBidAdapter.js +1 -1
  79. package/dist/parrableIdSystem.js +1 -1
  80. package/dist/pixfutureBidAdapter.js +1 -1
  81. package/dist/prebid-core.js +1 -1
  82. package/dist/prebidServerBidAdapter.js +1 -1
  83. package/dist/publinkIdSystem.js +1 -1
  84. package/dist/pubmaticBidAdapter.js +1 -1
  85. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  86. package/dist/pxyzBidAdapter.js +1 -1
  87. package/dist/quantcastBidAdapter.js +1 -1
  88. package/dist/readpeakBidAdapter.js +1 -1
  89. package/dist/relaidoBidAdapter.js +1 -1
  90. package/dist/rhythmoneBidAdapter.js +1 -1
  91. package/dist/riseBidAdapter.js +1 -1
  92. package/dist/rubiconAnalyticsAdapter.js +1 -1
  93. package/dist/rubiconBidAdapter.js +1 -1
  94. package/dist/seedingAllianceBidAdapter.js +1 -1
  95. package/dist/seedtagBidAdapter.js +1 -1
  96. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  97. package/dist/sharethroughBidAdapter.js +1 -1
  98. package/dist/shinezBidAdapter.js +1 -1
  99. package/dist/smaatoBidAdapter.js +1 -1
  100. package/dist/smartadserverBidAdapter.js +1 -1
  101. package/dist/smartxBidAdapter.js +1 -1
  102. package/dist/smilewantedBidAdapter.js +1 -1
  103. package/dist/sonobiBidAdapter.js +1 -1
  104. package/dist/sovrnAnalyticsAdapter.js +1 -1
  105. package/dist/sovrnBidAdapter.js +1 -1
  106. package/dist/sspBCBidAdapter.js +1 -1
  107. package/dist/sublimeBidAdapter.js +1 -1
  108. package/dist/synacormediaBidAdapter.js +1 -1
  109. package/dist/targetVideoBidAdapter.js +1 -1
  110. package/dist/teadsBidAdapter.js +1 -1
  111. package/dist/trionBidAdapter.js +1 -1
  112. package/dist/tripleliftBidAdapter.js +1 -1
  113. package/dist/ttdBidAdapter.js +1 -1
  114. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  115. package/dist/uid2IdSystem.js +1 -1
  116. package/dist/underdogmediaBidAdapter.js +1 -1
  117. package/dist/undertoneBidAdapter.js +1 -1
  118. package/dist/vidazooBidAdapter.js +1 -1
  119. package/dist/videobyteBidAdapter.js +1 -1
  120. package/dist/visxBidAdapter.js +1 -1
  121. package/dist/vuukleBidAdapter.js +1 -1
  122. package/dist/widespaceBidAdapter.js +1 -1
  123. package/dist/winrBidAdapter.js +1 -1
  124. package/dist/yahoosspBidAdapter.js +1 -1
  125. package/dist/yieldmoBidAdapter.js +1 -1
  126. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  127. package/libraries/ortbConverter/processors/default.js +19 -1
  128. package/modules/.submodules.json +1 -0
  129. package/modules/admaticBidAdapter.js +2 -1
  130. package/modules/admixerBidAdapter.js +26 -4
  131. package/modules/adnuntiusBidAdapter.js +36 -38
  132. package/modules/arcspanRtdProvider.js +73 -0
  133. package/modules/arcspanRtdProvider.md +11 -0
  134. package/modules/bliinkBidAdapter.js +1 -1
  135. package/modules/consumableBidAdapter.js +20 -2
  136. package/modules/criteoBidAdapter.js +1 -1
  137. package/modules/emx_digitalBidAdapter.js +9 -2
  138. package/modules/holidBidAdapter.js +9 -4
  139. package/modules/kargoBidAdapter.js +5 -1
  140. package/modules/lotamePanoramaIdSystem.js +9 -1
  141. package/modules/nextMillenniumBidAdapter.js +19 -9
  142. package/modules/openxBidAdapter.js +5 -0
  143. package/modules/prebidServerBidAdapter/index.js +14 -1
  144. package/modules/prebidServerBidAdapter/ortbConverter.js +1 -1
  145. package/modules/seedingAllianceBidAdapter.js +129 -116
  146. package/modules/tripleliftBidAdapter.js +4 -0
  147. package/package.json +1 -1
  148. package/src/adloader.js +2 -1
  149. package/test/spec/modules/admixerBidAdapter_spec.js +140 -60
  150. package/test/spec/modules/adnuntiusBidAdapter_spec.js +120 -120
  151. package/test/spec/modules/arcspanRtdProvider_spec.js +187 -0
  152. package/test/spec/modules/bliinkBidAdapter_spec.js +7 -7
  153. package/test/spec/modules/consumableBidAdapter_spec.js +46 -0
  154. package/test/spec/modules/emx_digitalBidAdapter_spec.js +30 -1
  155. package/test/spec/modules/holidBidAdapter_spec.js +29 -0
  156. package/test/spec/modules/kargoBidAdapter_spec.js +32 -0
  157. package/test/spec/modules/lotamePanoramaIdSystem_spec.js +16 -10
  158. package/test/spec/modules/nextMillenniumBidAdapter_spec.js +14 -2
  159. package/test/spec/modules/openxBidAdapter_spec.js +41 -0
  160. package/test/spec/modules/openxOrtbBidAdapter_spec.js +41 -0
  161. package/test/spec/modules/prebidServerBidAdapter_spec.js +138 -0
  162. package/test/spec/modules/seedingAllianceAdapter_spec.js +66 -23
  163. package/test/spec/modules/tripleliftBidAdapter_spec.js +13 -0
  164. package/test/spec/ortbConverter/default_processors_spec.js +23 -0
@@ -29,6 +29,7 @@ const DAY_MS = 60 * 60 * 24 * 1000;
29
29
  const MISSING_CORE_CONSENT = 111;
30
30
  const GVLID = 95;
31
31
  const ID_HOST = 'id.crwdcntrl.net';
32
+ const ID_HOST_COOKIELESS = 'c.ltmsphrcl.net';
32
33
 
33
34
  export const storage = getStorageManager({gvlid: GVLID, moduleName: MODULE_NAME});
34
35
  let cookieDomain;
@@ -252,6 +253,13 @@ export const lotamePanoramaIdSubmodule = {
252
253
  usPrivacy = getFromStorage('us_privacy');
253
254
  }
254
255
 
256
+ const getRequestHost = function() {
257
+ if (navigator.userAgent && navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1) {
258
+ return ID_HOST_COOKIELESS;
259
+ }
260
+ return ID_HOST;
261
+ }
262
+
255
263
  const resolveIdFunction = function (callback) {
256
264
  let queryParams = {};
257
265
  if (storedUserId) {
@@ -288,7 +296,7 @@ export const lotamePanoramaIdSubmodule = {
288
296
 
289
297
  const url = buildUrl({
290
298
  protocol: 'https',
291
- host: ID_HOST,
299
+ host: getRequestHost(),
292
300
  pathname: '/id',
293
301
  search: isEmpty(queryParams) ? undefined : queryParams,
294
302
  });
@@ -271,15 +271,25 @@ export const spec = {
271
271
  };
272
272
 
273
273
  function replaceUsersyncMacros(url, gdprConsent, uspConsent) {
274
- const { consentString, gdprApplies } = gdprConsent;
275
-
276
- return url.replace(
277
- '{{.GDPR}}', Number(gdprApplies)
278
- ).replace(
279
- '{{.GDPRConsent}}', consentString
280
- ).replace(
281
- '{{.USPrivacy}}', uspConsent
282
- );
274
+ const { consentString, gdprApplies } = gdprConsent || {};
275
+
276
+ if (gdprApplies) {
277
+ const gdpr = Number(gdprApplies);
278
+ url = url.replace('{{.GDPR}}', gdpr);
279
+
280
+ if (gdpr == 1 && consentString && consentString.length > 0) {
281
+ url = url.replace('{{.GDPRConsent}}', consentString);
282
+ }
283
+ } else {
284
+ url = url.replace('{{.GDPR}}', 0);
285
+ url = url.replace('{{.GDPRConsent}}', '');
286
+ }
287
+
288
+ if (uspConsent) {
289
+ url = url.replace('{{.USPrivacy}}', uspConsent);
290
+ }
291
+
292
+ return url;
283
293
  };
284
294
 
285
295
  function getAdEl(bid) {
@@ -268,6 +268,11 @@ function buildCommonQueryParamsFromBids(bids, bidderRequest) {
268
268
  nocache: new Date().getTime()
269
269
  };
270
270
 
271
+ const userAgentClientHints = deepAccess(bidderRequest, 'ortb2.device.sua');
272
+ if (userAgentClientHints) {
273
+ defaultParams.sua = JSON.stringify(userAgentClientHints);
274
+ }
275
+
271
276
  const userDataSegments = buildFpdQueryParams('user.data', bidderRequest.ortb2);
272
277
  if (userDataSegments.length > 0) {
273
278
  defaultParams.sm = userDataSegments;
@@ -222,10 +222,23 @@ function queueSync(bidderCodes, gdprConsent, uspConsent, gppConsent, s2sConfig)
222
222
  }
223
223
  _syncCount++;
224
224
 
225
+ let filterSettings = {};
226
+ const userSyncFilterSettings = getConfig('userSync.filterSettings');
227
+
228
+ if (userSyncFilterSettings) {
229
+ const { all, iframe, image } = userSyncFilterSettings;
230
+ const ifrm = iframe || all;
231
+ const img = image || all;
232
+
233
+ if (ifrm) filterSettings = Object.assign({ iframe: ifrm }, filterSettings);
234
+ if (img) filterSettings = Object.assign({ image: img }, filterSettings);
235
+ }
236
+
225
237
  const payload = {
226
238
  uuid: generateUUID(),
227
239
  bidders: bidderCodes,
228
- account: s2sConfig.accountId
240
+ account: s2sConfig.accountId,
241
+ filterSettings
229
242
  };
230
243
 
231
244
  let userSyncLimit = s2sConfig.userSyncLimit;
@@ -47,7 +47,7 @@ const PBS_CONVERTER = ortbConverter({
47
47
  request.tmax = s2sBidRequest.s2sConfig.timeout;
48
48
  deepSetValue(request, 'source.tid', proxyBidderRequest.auctionId);
49
49
 
50
- [request.app, request.site].forEach(section => {
50
+ [request.app, request.dooh, request.site].forEach(section => {
51
51
  if (section && !section.publisher?.id) {
52
52
  deepSetValue(section, 'publisher.id', s2sBidRequest.s2sConfig.accountId);
53
53
  }
@@ -2,120 +2,111 @@
2
2
  'use strict';
3
3
 
4
4
  import { registerBidder } from '../src/adapters/bidderFactory.js';
5
- import { NATIVE } from '../src/mediaTypes.js';
6
- import { _map, deepSetValue, isEmpty, deepAccess } from '../src/utils.js';
5
+ import { NATIVE, BANNER } from '../src/mediaTypes.js';
6
+ import { _map, isArray, isEmpty, deepSetValue, replaceAuctionPrice } from '../src/utils.js';
7
7
  import { config } from '../src/config.js';
8
8
  import { convertOrtbRequestToProprietaryNative } from '../src/native.js';
9
9
 
10
- const BIDDER_CODE = 'seedingAlliance';
11
10
  const GVL_ID = 371;
11
+ const BIDDER_CODE = 'seedingAlliance';
12
12
  const DEFAULT_CUR = 'EUR';
13
13
  const ENDPOINT_URL = 'https://b.nativendo.de/cds/rtb/bid?format=openrtb2.5&ssp=pb';
14
14
 
15
- const NATIVE_ASSET_IDS = {0: 'title', 1: 'body', 2: 'sponsoredBy', 3: 'image', 4: 'cta', 5: 'icon'};
15
+ const NATIVE_ASSET_IDS = { 0: 'title', 1: 'body', 2: 'sponsoredBy', 3: 'image', 4: 'cta', 5: 'icon' };
16
16
 
17
17
  const NATIVE_PARAMS = {
18
- title: {
19
- id: 0,
20
- name: 'title'
21
- },
22
-
23
- body: {
24
- id: 1,
25
- name: 'data',
26
- type: 2
27
- },
28
-
29
- sponsoredBy: {
30
- id: 2,
31
- name: 'data',
32
- type: 1
33
- },
34
-
35
- image: {
36
- id: 3,
37
- type: 3,
38
- name: 'img'
39
- },
40
-
41
- cta: {
42
- id: 4,
43
- type: 12,
44
- name: 'data'
45
- },
46
-
47
- icon: {
48
- id: 5,
49
- type: 1,
50
- name: 'img'
51
- }
18
+ title: { id: 0, name: 'title' },
19
+ body: { id: 1, name: 'data', type: 2 },
20
+ sponsoredBy: { id: 2, name: 'data', type: 1 },
21
+ image: { id: 3, type: 3, name: 'img' },
22
+ cta: { id: 4, type: 12, name: 'data' },
23
+ icon: { id: 5, type: 1, name: 'img' }
52
24
  };
53
25
 
54
26
  export const spec = {
55
27
  code: BIDDER_CODE,
56
-
57
28
  gvlid: GVL_ID,
29
+ supportedMediaTypes: [NATIVE, BANNER],
58
30
 
59
- supportedMediaTypes: [NATIVE],
60
-
61
- isBidRequestValid: function(bid) {
31
+ isBidRequestValid: function (bid) {
62
32
  return !!bid.params.adUnitId;
63
33
  },
64
34
 
65
- buildRequests: (validBidRequests, bidderRequest) => {
35
+ buildRequests: (validBidRequests = [], bidderRequest) => {
66
36
  // convert Native ORTB definition to old-style prebid native definition
67
37
  validBidRequests = convertOrtbRequestToProprietaryNative(validBidRequests);
68
38
 
69
- const pt = setOnAny(validBidRequests, 'params.pt') || setOnAny(validBidRequests, 'params.priceType') || 'net';
70
- const tid = bidderRequest.auctionId;
71
- const cur = [config.getConfig('currency.adServerCurrency') || DEFAULT_CUR];
72
39
  let url = bidderRequest.refererInfo.page;
73
40
 
74
- const imp = validBidRequests.map((bid, id) => {
75
- const assets = _map(bid.nativeParams, (bidParams, key) => {
76
- const props = NATIVE_PARAMS[key];
77
-
78
- const asset = {
79
- required: bidParams.required & 1
80
- };
41
+ const imps = validBidRequests.map((bidRequest, id) => {
42
+ const imp = {
43
+ id: String(id + 1),
44
+ tagid: bidRequest.params.adUnitId
45
+ };
81
46
 
82
- if (props) {
83
- asset.id = props.id;
47
+ /**
48
+ * Native Ad
49
+ */
50
+ if (bidRequest.nativeParams) {
51
+ const assets = _map(bidRequest.nativeParams, (nativeAsset, key) => {
52
+ const props = NATIVE_PARAMS[key];
53
+
54
+ if (props) {
55
+ let wmin, hmin, w, h;
56
+ let aRatios = nativeAsset.aspect_ratios;
57
+
58
+ if (aRatios && aRatios[0]) {
59
+ aRatios = aRatios[0];
60
+ wmin = aRatios.min_width || 0;
61
+ hmin = aRatios.ratio_height * wmin / aRatios.ratio_width | 0;
62
+ }
84
63
 
85
- let w, h;
64
+ if (nativeAsset.sizes) {
65
+ const sizes = flatten(nativeAsset.sizes);
66
+ w = parseInt(sizes[0], 10);
67
+ h = parseInt(sizes[1], 10);
68
+ }
86
69
 
87
- if (bidParams.sizes) {
88
- w = bidParams.sizes[0];
89
- h = bidParams.sizes[1];
70
+ const asset = {
71
+ id: props.id,
72
+ required: nativeAsset.required & 1
73
+ };
74
+
75
+ asset[props.name] = {
76
+ len: nativeAsset.len,
77
+ type: props.type,
78
+ wmin,
79
+ hmin,
80
+ w,
81
+ h
82
+ };
83
+
84
+ return asset;
85
+ } else {
86
+ // TODO Filter impressions with required assets we don't support
90
87
  }
88
+ }).filter(Boolean);
91
89
 
92
- asset[props.name] = {
93
- len: bidParams.len,
94
- type: props.type,
95
- w,
96
- h
97
- };
90
+ imp.native = {
91
+ request: {
92
+ assets
93
+ }
94
+ };
95
+ } else {
96
+ let sizes = transformSizes(bidRequest.sizes);
98
97
 
99
- return asset;
98
+ imp.banner = {
99
+ format: sizes,
100
+ w: sizes[0] ? sizes[0].w : 0,
101
+ h: sizes[0] ? sizes[0].h : 0
100
102
  }
101
- })
102
- .filter(Boolean);
103
+ }
103
104
 
104
- if (bid.params.url) {
105
- url = bid.params.url;
105
+ if (bidRequest.params.url) {
106
+ url = bidRequest.params.url;
106
107
  }
107
108
 
108
- return {
109
- id: String(id + 1),
110
- tagid: bid.params.adUnitId,
111
- tid: tid,
112
- pt: pt,
113
- native: {
114
- request: {
115
- assets
116
- }
117
- }
118
- };
109
+ return imp;
119
110
  });
120
111
 
121
112
  const request = {
@@ -123,12 +114,9 @@ export const spec = {
123
114
  site: {
124
115
  page: url
125
116
  },
126
- device: {
127
- ua: navigator.userAgent
128
- },
129
- cur,
130
- imp,
131
- user: {},
117
+ cur: [config.getConfig('currency.adServerCurrency') || DEFAULT_CUR],
118
+ imp: imps,
119
+ tmax: bidderRequest.timeout,
132
120
  regs: {
133
121
  ext: {
134
122
  gdpr: 0,
@@ -137,23 +125,22 @@ export const spec = {
137
125
  }
138
126
  };
139
127
 
140
- if (bidderRequest && bidderRequest.gdprConsent) {
128
+ if (bidderRequest.gdprConsent) {
129
+ request.user = {};
130
+
141
131
  deepSetValue(request, 'user.ext.consent', bidderRequest.gdprConsent.consentString);
142
132
  deepSetValue(request, 'regs.ext.gdpr', (typeof bidderRequest.gdprConsent.gdprApplies === 'boolean' && bidderRequest.gdprConsent.gdprApplies) ? 1 : 0);
143
133
  }
144
134
 
145
135
  return {
146
136
  method: 'POST',
147
- url: ENDPOINT_URL,
137
+ url: config.getConfig('seedingAlliance.endpoint') || ENDPOINT_URL,
148
138
  data: JSON.stringify(request),
149
- options: {
150
- contentType: 'application/json'
151
- },
152
- bids: validBidRequests
139
+ bidRequests: validBidRequests
153
140
  };
154
141
  },
155
142
 
156
- interpretResponse: function(serverResponse, { bids }) {
143
+ interpretResponse: function (serverResponse, { bidRequests }) {
157
144
  if (isEmpty(serverResponse.body)) {
158
145
  return [];
159
146
  }
@@ -165,35 +152,72 @@ export const spec = {
165
152
  return result;
166
153
  }, []) : [];
167
154
 
168
- return bids
169
- .map((bid, id) => {
155
+ return bidRequests
156
+ .map((bidRequest, id) => {
170
157
  const bidResponse = bidResponses[id];
171
158
 
159
+ const type = bidRequest.nativeParams ? NATIVE : BANNER;
160
+
172
161
  if (bidResponse) {
173
- return {
174
- requestId: bid.bidId,
162
+ const bidObject = {
163
+ requestId: bidRequest.bidId, // TODO get this value from response?
175
164
  cpm: bidResponse.price,
176
165
  creativeId: bidResponse.crid,
177
- ttl: 1000,
178
- netRevenue: (!bid.netRevenue || bid.netRevenue === 'net'),
166
+ ttl: 600,
167
+ netRevenue: true,
179
168
  currency: cur,
180
- mediaType: NATIVE,
169
+ mediaType: type,
181
170
  bidderCode: BIDDER_CODE,
182
- native: parseNative(bidResponse),
183
171
  meta: {
184
172
  advertiserDomains: bidResponse.adomain && bidResponse.adomain.length > 0 ? bidResponse.adomain : []
185
173
  }
186
174
  };
175
+
176
+ if (type === NATIVE) {
177
+ bidObject.native = parseNative(bidResponse);
178
+ bidObject.mediaType = NATIVE;
179
+ }
180
+
181
+ if (type === BANNER) {
182
+ bidObject.ad = replaceAuctionPrice(bidResponse.adm, bidResponse.price);
183
+ bidObject.width = bidResponse.w;
184
+ bidObject.height = bidResponse.h;
185
+ bidObject.mediaType = BANNER;
186
+ }
187
+
188
+ return bidObject;
187
189
  }
188
190
  })
189
191
  .filter(Boolean);
190
192
  }
191
193
  };
192
194
 
193
- registerBidder(spec);
195
+ function transformSizes(requestSizes) {
196
+ if (!isArray(requestSizes)) {
197
+ return [];
198
+ }
199
+
200
+ if (requestSizes.length === 2 && !isArray(requestSizes[0])) {
201
+ return [{
202
+ w: parseInt(requestSizes[0], 10),
203
+ h: parseInt(requestSizes[1], 10)
204
+ }];
205
+ } else if (isArray(requestSizes[0])) {
206
+ return requestSizes.map(item => ({
207
+ w: parseInt(item[0], 10),
208
+ h: parseInt(item[1], 10)
209
+ }));
210
+ }
211
+
212
+ return [];
213
+ }
214
+
215
+ function flatten(arr) {
216
+ return [].concat(...arr);
217
+ }
194
218
 
195
219
  function parseNative(bid) {
196
- const {assets, link, imptrackers} = bid.adm.native;
220
+ const { assets, link, imptrackers } = bid.adm.native;
197
221
 
198
222
  let clickUrl = link.url.replace(/\$\{AUCTION_PRICE\}/g, bid.price);
199
223
 
@@ -228,15 +252,4 @@ function parseNative(bid) {
228
252
  return result;
229
253
  }
230
254
 
231
- function setOnAny(collection, key) {
232
- for (let i = 0, result; i < collection.length; i++) {
233
- result = deepAccess(collection[i], key);
234
- if (result) {
235
- return result;
236
- }
237
- }
238
- }
239
-
240
- function flatten(arr) {
241
- return [].concat(...arr);
242
- }
255
+ registerBidder(spec);
@@ -154,6 +154,10 @@ function _buildPostBody(bidRequests, bidderRequest) {
154
154
  if (!isEmpty(ext)) {
155
155
  data.ext = ext;
156
156
  }
157
+
158
+ if (bidderRequest?.ortb2?.regs?.gpp) {
159
+ data.regs = Object.assign({}, bidderRequest.ortb2.regs);
160
+ }
157
161
  return data;
158
162
  }
159
163
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prebid.js",
3
- "version": "7.33.0",
3
+ "version": "7.34.0",
4
4
  "description": "Header Bidding Management Library",
5
5
  "main": "src/prebid.js",
6
6
  "scripts": {
package/src/adloader.js CHANGED
@@ -21,7 +21,8 @@ const _approvedLoadExternalJSList = [
21
21
  'medianet',
22
22
  'improvedigital',
23
23
  'aaxBlockmeter',
24
- 'confiant'
24
+ 'confiant',
25
+ 'arcspan'
25
26
  ]
26
27
 
27
28
  /**