prebid.js 6.6.0 → 6.10.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.
- package/.eslintrc.js +8 -1
- package/allowedModules.js +4 -7
- package/integrationExamples/gpt/amp/creative.html +11 -33
- package/integrationExamples/gpt/{haloRtdProvider_example.html → hadronRtdProvider_example.html} +9 -9
- package/integrationExamples/gpt/idImportLibrary_example.html +2 -2
- package/integrationExamples/gpt/userId_example.html +2 -2
- package/integrationExamples/gpt/weboramaRtdProvider_example.html +154 -115
- package/integrationExamples/gpt/x-domain/creative.html +63 -29
- package/modules/.submodules.json +3 -0
- package/modules/adagioBidAdapter.js +1 -9
- package/modules/adagioBidAdapter.md +1 -1
- package/modules/adbookpspBidAdapter.js +29 -12
- package/modules/adhashBidAdapter.js +4 -4
- package/modules/adkernelBidAdapter.js +2 -2
- package/modules/adlooxAnalyticsAdapter.js +1 -1
- package/modules/adlooxRtdProvider.js +1 -1
- package/modules/adnowBidAdapter.js +1 -1
- package/modules/adnuntiusRtdProvider.js +96 -0
- package/modules/adnuntiusRtdProvider.md +41 -0
- package/modules/adomikAnalyticsAdapter.js +2 -2
- package/modules/adotBidAdapter.js +1 -1
- package/modules/adpod.js +14 -17
- package/modules/adrelevantisBidAdapter.js +2 -2
- package/modules/adtargetBidAdapter.js +1 -1
- package/modules/adtelligentBidAdapter.js +1 -1
- package/modules/advangelistsBidAdapter.js +2 -2
- package/modules/adxpremiumAnalyticsAdapter.js +1 -1
- package/modules/adyoulikeBidAdapter.js +1 -1
- package/modules/afpBidAdapter.js +1 -1
- package/modules/appnexusBidAdapter.js +16 -4
- package/modules/asealBidAdapter.js +58 -0
- package/modules/asealBidAdapter.md +52 -0
- package/modules/beachfrontBidAdapter.js +2 -2
- package/modules/betweenBidAdapter.js +1 -1
- package/modules/bidViewability.js +1 -1
- package/modules/bluebillywigBidAdapter.js +1 -1
- package/modules/brandmetricsRtdProvider.js +168 -0
- package/modules/brandmetricsRtdProvider.md +40 -0
- package/modules/bridgewellBidAdapter.js +1 -1
- package/modules/browsiRtdProvider.js +2 -2
- package/modules/cleanmedianetBidAdapter.js +1 -1
- package/modules/colossussspBidAdapter.js +12 -8
- package/modules/colossussspBidAdapter.md +15 -1
- package/modules/compassBidAdapter.js +1 -1
- package/modules/connectIdSystem.js +1 -1
- package/modules/consentManagement.js +2 -3
- package/modules/consumableBidAdapter.md +1 -1
- package/modules/conversantBidAdapter.js +7 -0
- package/modules/craftBidAdapter.js +2 -2
- package/modules/criteoBidAdapter.js +10 -1
- package/modules/currency.js +27 -5
- package/modules/cwireBidAdapter.js +1 -1
- package/modules/dailyhuntBidAdapter.js +1 -1
- package/modules/dchain.js +1 -1
- package/modules/displayioBidAdapter.js +157 -0
- package/modules/displayioBidAdapter.md +148 -0
- package/modules/dspxBidAdapter.js +69 -29
- package/modules/dspxBidAdapter.md +2 -1
- package/modules/e_volutionBidAdapter.js +158 -0
- package/modules/emx_digitalBidAdapter.js +2 -2
- package/modules/fluctBidAdapter.js +0 -1
- package/modules/gamoshiBidAdapter.js +1 -1
- package/modules/gdprEnforcement.js +2 -2
- package/modules/glomexBidAdapter.js +1 -1
- package/modules/gnetBidAdapter.js +3 -3
- package/modules/gnetBidAdapter.md +4 -4
- package/modules/goldbachBidAdapter.js +2 -2
- package/modules/gptPreAuction.js +1 -1
- package/modules/gridBidAdapter.js +15 -1
- package/modules/gumgumBidAdapter.js +57 -43
- package/modules/hadronIdSystem.js +96 -0
- package/modules/hadronIdSystem.md +35 -0
- package/modules/hadronRtdProvider.js +254 -0
- package/modules/hadronRtdProvider.md +126 -0
- package/modules/haloIdSystem.md +4 -35
- package/modules/haloRtdProvider.md +3 -126
- package/modules/hybridBidAdapter.js +1 -1
- package/modules/improvedigitalBidAdapter.js +6 -1
- package/modules/insticatorBidAdapter.js +1 -1
- package/modules/interactiveOffersBidAdapter.js +9 -6
- package/modules/intersectionRtdProvider.js +1 -1
- package/modules/ixBidAdapter.js +2 -2
- package/modules/jwplayerRtdProvider.js +72 -7
- package/modules/jwplayerRtdProvider.md +27 -11
- package/modules/kargoBidAdapter.js +2 -2
- package/modules/livewrappedBidAdapter.js +1 -1
- package/modules/lunamediahbBidAdapter.js +32 -4
- package/modules/malltvBidAdapter.js +7 -3
- package/modules/malltvBidAdapter.md +64 -51
- package/modules/mass.js +3 -5
- package/modules/mediakeysBidAdapter.js +2 -2
- package/modules/medianetAnalyticsAdapter.js +2 -2
- package/modules/medianetRtdProvider.js +1 -1
- package/modules/mediasquareBidAdapter.js +1 -0
- package/modules/nextMillenniumBidAdapter.js +1 -0
- package/modules/nextrollBidAdapter.js +1 -1
- package/modules/oguryBidAdapter.js +7 -14
- package/modules/onetagBidAdapter.js +1 -1
- package/modules/openwebBidAdapter.js +1 -1
- package/modules/openxAnalyticsAdapter.js +2 -2
- package/modules/openxBidAdapter.js +1 -1
- package/modules/parrableIdSystem.js +1 -1
- package/modules/permutiveRtdProvider.js +1 -1
- package/modules/pilotxBidAdapter.js +147 -0
- package/modules/pilotxBidAdapter.md +50 -0
- package/modules/pixfutureBidAdapter.js +2 -2
- package/modules/prebidServerBidAdapter/index.js +63 -41
- package/modules/priceFloors.js +15 -14
- package/modules/pubmaticBidAdapter.js +1 -1
- package/modules/quantcastBidAdapter.js +1 -1
- package/modules/reconciliationRtdProvider.js +1 -1
- package/modules/richaudienceBidAdapter.js +7 -2
- package/modules/riseBidAdapter.js +17 -6
- package/modules/roxotAnalyticsAdapter.js +1 -1
- package/modules/rtbhouseBidAdapter.js +1 -1
- package/modules/rtdModule/index.js +9 -11
- package/modules/rubiconAnalyticsAdapter.js +8 -2
- package/modules/rubiconBidAdapter.js +1 -1
- package/modules/saambaaBidAdapter.js +420 -420
- package/modules/seedingAllianceBidAdapter.js +3 -3
- package/modules/sharethroughBidAdapter.js +12 -17
- package/modules/sigmoidAnalyticsAdapter.js +1 -1
- package/modules/sirdataRtdProvider.js +1 -1
- package/modules/sizeMappingV2.js +2 -9
- package/modules/smarticoBidAdapter.js +1 -1
- package/modules/sortableAnalyticsAdapter.js +5 -4
- package/modules/sovrnAnalyticsAdapter.js +2 -2
- package/modules/sovrnBidAdapter.js +93 -18
- package/modules/sovrnBidAdapter.md +80 -2
- package/modules/sspBCBidAdapter.js +54 -21
- package/modules/synacormediaBidAdapter.js +32 -11
- package/modules/targetVideoBidAdapter.js +1 -1
- package/modules/telariaBidAdapter.js +22 -29
- package/modules/trustpidSystem.js +197 -0
- package/modules/trustpidSystem.md +45 -0
- package/modules/undertoneBidAdapter.js +17 -1
- package/modules/userId/eids.js +16 -1
- package/modules/userId/eids.md +10 -2
- package/modules/userId/index.js +2 -2
- package/modules/userId/userId.md +17 -2
- package/modules/ventesBidAdapter.js +1 -1
- package/modules/verizonMediaIdSystem.js +1 -1
- package/modules/vibrantmediaBidAdapter.js +220 -0
- package/modules/vibrantmediaBidAdapter.md +92 -0
- package/modules/viewability.js +177 -0
- package/modules/viewability.md +87 -0
- package/modules/viewdeosDXBidAdapter.js +1 -1
- package/modules/voxBidAdapter.js +1 -1
- package/modules/waardexBidAdapter.js +1 -1
- package/modules/weboramaRtdProvider.js +264 -34
- package/modules/weboramaRtdProvider.md +110 -40
- package/modules/widespaceBidAdapter.js +2 -2
- package/modules/winrBidAdapter.js +7 -7
- package/modules/yahoosspBidAdapter.js +3 -1
- package/modules/yieldlabBidAdapter.js +1 -1
- package/modules/yieldmoBidAdapter.js +2 -2
- package/modules/yieldoneBidAdapter.js +6 -0
- package/modules/yuktamediaAnalyticsAdapter.js +1 -1
- package/package.json +3 -1
- package/plugins/poly/arrayFrom.js +3 -0
- package/plugins/poly/find.js +3 -0
- package/plugins/poly/findIndex.js +3 -0
- package/plugins/poly/includes.js +3 -0
- package/plugins/poly/package.json +8 -0
- package/src/Renderer.js +1 -1
- package/src/adRendering.js +38 -0
- package/src/adapterManager.js +33 -28
- package/src/adapters/bidderFactory.js +13 -11
- package/src/adloader.js +3 -2
- package/src/auction.js +140 -117
- package/src/auctionIndex.js +85 -0
- package/src/auctionManager.js +4 -1
- package/src/bidderSettings.js +69 -0
- package/src/bidfactory.js +18 -6
- package/src/config.js +3 -4
- package/src/cpmBucketManager.js +1 -1
- package/src/native.js +30 -22
- package/src/prebid.js +4 -20
- package/src/secureCreatives.js +133 -49
- package/src/sizeMapping.js +1 -1
- package/src/storageManager.js +1 -1
- package/src/targeting.js +13 -4
- package/src/userSync.js +1 -1
- package/src/utils.js +16 -19
- package/src/video.js +11 -12
- package/src/videoCache.js +10 -9
- package/test/fixtures/fixtures.js +2 -1
- package/test/helpers/indexStub.js +28 -0
- package/test/helpers/syncPromise.js +71 -0
- package/test/spec/auctionmanager_spec.js +269 -90
- package/test/spec/config_spec.js +24 -1
- package/test/spec/e2e/longform/basic_w_bidderSettings.spec.js +1 -1
- package/test/spec/e2e/longform/basic_w_custom_adserver_translation.spec.js +1 -1
- package/test/spec/e2e/longform/basic_w_priceGran.spec.js +1 -1
- package/test/spec/e2e/longform/basic_w_requireExactDuration.spec.js +1 -1
- package/test/spec/e2e/longform/basic_wo_brandCategoryExclusion.spec.js +1 -1
- package/test/spec/e2e/longform/basic_wo_requireExactDuration.spec.js +1 -1
- package/test/spec/modules/adagioBidAdapter_spec.js +0 -10
- package/test/spec/modules/adbookpspBidAdapter_spec.js +17 -3
- package/test/spec/modules/adhashBidAdapter_spec.js +2 -2
- package/test/spec/modules/adnuntiusRtdProvider_spec.js +145 -0
- package/test/spec/modules/adpod_spec.js +91 -156
- package/test/spec/modules/afpBidAdapter_spec.js +1 -1
- package/test/spec/modules/appnexusBidAdapter_spec.js +27 -0
- package/test/spec/modules/asealBidAdapter_spec.js +144 -0
- package/test/spec/modules/brandmetricsRtdProvider_spec.js +191 -0
- package/test/spec/modules/colossussspBidAdapter_spec.js +5 -2
- package/test/spec/modules/conversantBidAdapter_spec.js +54 -2
- package/test/spec/modules/criteoBidAdapter_spec.js +21 -0
- package/test/spec/modules/currency_spec.js +36 -15
- package/test/spec/modules/deepintentDpesIdsystem_spec.js +1 -1
- package/test/spec/modules/displayioBidAdapter_spec.js +239 -0
- package/test/spec/modules/dspxBidAdapter_spec.js +20 -15
- package/test/spec/modules/e_volutionBidAdapter_spec.js +242 -0
- package/test/spec/modules/eids_spec.js +2 -2
- package/test/spec/modules/eplanningAnalyticsAdapter_spec.js +1 -1
- package/test/spec/modules/fintezaAnalyticsAdapter_spec.js +1 -1
- package/test/spec/modules/gnetBidAdapter_spec.js +6 -6
- package/test/spec/modules/gridBidAdapter_spec.js +18 -0
- package/test/spec/modules/gumgumBidAdapter_spec.js +49 -3
- package/test/spec/modules/hadronIdSystem_spec.js +57 -0
- package/test/spec/modules/hadronRtdProvider_spec.js +762 -0
- package/test/spec/modules/idxIdSystem_spec.js +1 -1
- package/test/spec/modules/improvedigitalBidAdapter_spec.js +19 -0
- package/test/spec/modules/jwplayerRtdProvider_spec.js +195 -2
- package/test/spec/modules/kargoBidAdapter_spec.js +1 -1
- package/test/spec/modules/lunamediahbBidAdapter_spec.js +27 -1
- package/test/spec/modules/mass_spec.js +2 -14
- package/test/spec/modules/mediakeysBidAdapter_spec.js +1 -1
- package/test/spec/modules/multibid_spec.js +1 -1
- package/test/spec/modules/oguryBidAdapter_spec.js +63 -5
- package/test/spec/modules/onetagBidAdapter_spec.js +1 -1
- package/test/spec/modules/openxAnalyticsAdapter_spec.js +1 -1
- package/test/spec/modules/parrableIdSystem_spec.js +1 -1
- package/test/spec/modules/pilotxBidAdapter_spec.js +244 -0
- package/test/spec/modules/prebidServerBidAdapter_spec.js +43 -6
- package/test/spec/modules/priceFloors_spec.js +37 -24
- package/test/spec/modules/pubmaticBidAdapter_spec.js +40 -0
- package/test/spec/modules/realTimeDataModule_spec.js +51 -2
- package/test/spec/modules/riseBidAdapter_spec.js +30 -4
- package/test/spec/modules/rubiconAnalyticsAdapter_spec.js +61 -1
- package/test/spec/modules/rubiconBidAdapter_spec.js +1 -1
- package/test/spec/modules/sharethroughBidAdapter_spec.js +91 -6
- package/test/spec/modules/sortableAnalyticsAdapter_spec.js +2 -3
- package/test/spec/modules/sovrnBidAdapter_spec.js +413 -333
- package/test/spec/modules/sspBCBidAdapter_spec.js +7 -7
- package/test/spec/modules/stroeerCoreBidAdapter_spec.js +1 -1
- package/test/spec/modules/synacormediaBidAdapter_spec.js +70 -0
- package/test/spec/modules/telariaBidAdapter_spec.js +1 -3
- package/test/spec/modules/trustpidSystem_spec.js +232 -0
- package/test/spec/modules/undertoneBidAdapter_spec.js +55 -2
- package/test/spec/modules/userId_spec.js +40 -40
- package/test/spec/modules/vibrantmediaBidAdapter_spec.js +1237 -0
- package/test/spec/modules/viewability_spec.js +280 -0
- package/test/spec/modules/weboramaRtdProvider_spec.js +536 -20
- package/test/spec/modules/widespaceBidAdapter_spec.js +1 -1
- package/test/spec/modules/yahoosspBidAdapter_spec.js +10 -0
- package/test/spec/modules/yieldoneBidAdapter_spec.js +33 -0
- package/test/spec/modules/zeotapIdPlusIdSystem_spec.js +1 -1
- package/test/spec/native_spec.js +62 -40
- package/test/spec/sizeMapping_spec.js +1 -1
- package/test/spec/unit/core/adapterManager_spec.js +24 -2
- package/test/spec/unit/core/auctionIndex_spec.js +129 -0
- package/test/spec/unit/core/bidderFactory_spec.js +65 -12
- package/test/spec/unit/core/bidderSettings_spec.js +123 -0
- package/test/spec/unit/core/targeting_spec.js +93 -0
- package/test/spec/unit/pbjs_api_spec.js +81 -43
- package/test/spec/unit/secureCreatives_spec.js +143 -24
- package/test/spec/videoCache_spec.js +18 -19
- package/test/spec/video_spec.js +51 -61
- package/webpack.conf.js +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { _each, isPlainObject, isArray, deepAccess } from '../src/utils.js';
|
|
2
2
|
import { registerBidder } from '../src/adapters/bidderFactory.js'
|
|
3
|
-
import find from '
|
|
3
|
+
import find from 'prebidjs-polyfill/find.js'
|
|
4
4
|
import { VIDEO, BANNER, NATIVE } from '../src/mediaTypes.js'
|
|
5
5
|
import { Renderer } from '../src/Renderer.js'
|
|
6
6
|
import { config } from '../src/config.js';
|
|
@@ -2,8 +2,8 @@ import { isNumber, isStr, isInteger, isBoolean, isArray, isEmpty, isArrayOfNums,
|
|
|
2
2
|
import { BANNER, VIDEO } from '../src/mediaTypes.js';
|
|
3
3
|
import { registerBidder } from '../src/adapters/bidderFactory.js';
|
|
4
4
|
import { Renderer } from '../src/Renderer.js';
|
|
5
|
-
import includes from '
|
|
6
|
-
import find from '
|
|
5
|
+
import includes from 'prebidjs-polyfill/includes.js';
|
|
6
|
+
import find from 'prebidjs-polyfill/find.js';
|
|
7
7
|
import { createEidsArray } from './userId/eids.js';
|
|
8
8
|
|
|
9
9
|
const BIDDER_CODE = 'yieldmo';
|
|
@@ -62,6 +62,12 @@ export const spec = {
|
|
|
62
62
|
payload.lr_env = idlEnv;
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
+
// IMID
|
|
66
|
+
const imuid = deepAccess(bidRequest, 'userId.imuid');
|
|
67
|
+
if (isStr(imuid) && !isEmpty(imuid)) {
|
|
68
|
+
payload.imuid = imuid;
|
|
69
|
+
}
|
|
70
|
+
|
|
65
71
|
return {
|
|
66
72
|
method: 'GET',
|
|
67
73
|
url: ENDPOINT_URL,
|
|
@@ -5,7 +5,7 @@ import adapterManager from '../src/adapterManager.js';
|
|
|
5
5
|
import CONSTANTS from '../src/constants.json';
|
|
6
6
|
import { getStorageManager } from '../src/storageManager.js';
|
|
7
7
|
import { getRefererInfo } from '../src/refererDetection.js';
|
|
8
|
-
import strIncludes from '
|
|
8
|
+
import strIncludes from 'prebidjs-polyfill/includes.js';
|
|
9
9
|
|
|
10
10
|
const storage = getStorageManager();
|
|
11
11
|
const yuktamediaAnalyticsVersion = 'v3.1.0';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prebid.js",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.10.0",
|
|
4
4
|
"description": "Header Bidding Management Library",
|
|
5
5
|
"main": "src/prebid.js",
|
|
6
6
|
"scripts": {
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@babel/core": "^7.8.4",
|
|
33
|
+
"@babel/eslint-parser": "^7.16.5",
|
|
33
34
|
"@babel/preset-env": "^7.8.4",
|
|
34
35
|
"@jsdevtools/coverage-istanbul-loader": "^3.0.3",
|
|
35
36
|
"@wdio/browserstack-service": "^6.1.4",
|
|
@@ -96,6 +97,7 @@
|
|
|
96
97
|
"mocha": "^5.0.0",
|
|
97
98
|
"morgan": "^1.10.0",
|
|
98
99
|
"opn": "^5.4.0",
|
|
100
|
+
"prebidjs-polyfill": "file:./plugins/poly",
|
|
99
101
|
"resolve-from": "^5.0.0",
|
|
100
102
|
"sinon": "^4.1.3",
|
|
101
103
|
"through2": "^4.0.2",
|
package/src/Renderer.js
CHANGED
|
@@ -2,7 +2,7 @@ import { loadExternalScript } from './adloader.js';
|
|
|
2
2
|
import {
|
|
3
3
|
logError, logWarn, logMessage, deepAccess
|
|
4
4
|
} from './utils.js';
|
|
5
|
-
import find from '
|
|
5
|
+
import find from 'prebidjs-polyfill/find.js';
|
|
6
6
|
const moduleCode = 'outstream';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import {logError} from './utils.js';
|
|
2
|
+
import events from './events.js';
|
|
3
|
+
import CONSTANTS from './constants.json';
|
|
4
|
+
|
|
5
|
+
const {AD_RENDER_FAILED, AD_RENDER_SUCCEEDED} = CONSTANTS.EVENTS;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Emit the AD_RENDER_FAILED event.
|
|
9
|
+
*
|
|
10
|
+
* @param reason one of the values in CONSTANTS.AD_RENDER_FAILED_REASON
|
|
11
|
+
* @param message failure description
|
|
12
|
+
* @param bid? bid response object that failed to render
|
|
13
|
+
* @param id? adId that failed to render
|
|
14
|
+
*/
|
|
15
|
+
export function emitAdRenderFail({ reason, message, bid, id }) {
|
|
16
|
+
const data = { reason, message };
|
|
17
|
+
if (bid) data.bid = bid;
|
|
18
|
+
if (id) data.adId = id;
|
|
19
|
+
|
|
20
|
+
logError(message);
|
|
21
|
+
events.emit(AD_RENDER_FAILED, data);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Emit the AD_RENDER_SUCCEEDED event.
|
|
26
|
+
*
|
|
27
|
+
* @param doc document object that was used to `.write` the ad. Should be `null` if unavailable (e.g. for documents in
|
|
28
|
+
* a cross-origin frame).
|
|
29
|
+
* @param bid bid response object for the ad that was rendered
|
|
30
|
+
* @param id adId that was rendered.
|
|
31
|
+
*/
|
|
32
|
+
export function emitAdRenderSucceeded({ doc, bid, id }) {
|
|
33
|
+
const data = { doc };
|
|
34
|
+
if (bid) data.bid = bid;
|
|
35
|
+
if (id) data.adId = id;
|
|
36
|
+
|
|
37
|
+
events.emit(AD_RENDER_SUCCEEDED, data);
|
|
38
|
+
}
|
package/src/adapterManager.js
CHANGED
|
@@ -1,20 +1,36 @@
|
|
|
1
1
|
/** @module adaptermanger */
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
|
-
_each,
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
_each,
|
|
5
|
+
bind,
|
|
6
|
+
deepAccess,
|
|
7
|
+
deepClone,
|
|
8
|
+
flatten,
|
|
9
|
+
generateUUID,
|
|
10
|
+
getBidderCodes,
|
|
11
|
+
getDefinedParams,
|
|
12
|
+
getUniqueIdentifierStr,
|
|
13
|
+
getUserConfiguredParams,
|
|
14
|
+
groupBy,
|
|
15
|
+
isArray,
|
|
16
|
+
isValidMediaTypes,
|
|
17
|
+
logError,
|
|
18
|
+
logInfo,
|
|
19
|
+
logMessage,
|
|
20
|
+
logWarn,
|
|
21
|
+
shuffle,
|
|
22
|
+
timestamp
|
|
7
23
|
} from './utils.js';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import includes from '
|
|
15
|
-
import find from '
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
24
|
+
import {getLabels, resolveStatus} from './sizeMapping.js';
|
|
25
|
+
import {decorateAdUnitsWithNativeParams, nativeAdapters} from './native.js';
|
|
26
|
+
import {newBidder} from './adapters/bidderFactory.js';
|
|
27
|
+
import {ajaxBuilder} from './ajax.js';
|
|
28
|
+
import {config, RANDOM} from './config.js';
|
|
29
|
+
import {hook} from './hook.js';
|
|
30
|
+
import includes from 'prebidjs-polyfill/includes.js';
|
|
31
|
+
import find from 'prebidjs-polyfill/find.js';
|
|
32
|
+
import {adunitCounter} from './adUnits.js';
|
|
33
|
+
import {getRefererInfo} from './refererDetection.js';
|
|
18
34
|
|
|
19
35
|
var CONSTANTS = require('./constants.json');
|
|
20
36
|
var events = require('./events.js');
|
|
@@ -62,15 +78,8 @@ function getBids({bidderCode, auctionId, bidderRequestId, adUnits, labels, src})
|
|
|
62
78
|
if (active) {
|
|
63
79
|
result.push(adUnit.bids.filter(bid => bid.bidder === bidderCode)
|
|
64
80
|
.reduce((bids, bid) => {
|
|
65
|
-
const nativeParams =
|
|
66
|
-
adUnit.nativeParams || deepAccess(adUnit, 'mediaTypes.native');
|
|
67
|
-
if (nativeParams) {
|
|
68
|
-
bid = Object.assign({}, bid, {
|
|
69
|
-
nativeParams: processNativeAdUnitParams(nativeParams),
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
|
|
73
81
|
bid = Object.assign({}, bid, getDefinedParams(adUnit, [
|
|
82
|
+
'nativeParams',
|
|
74
83
|
'ortb2Imp',
|
|
75
84
|
'mediaType',
|
|
76
85
|
'renderer',
|
|
@@ -209,6 +218,7 @@ adapterManager.makeBidRequests = hook('sync', function (adUnits, auctionStart, a
|
|
|
209
218
|
* @see {@link https://github.com/prebid/Prebid.js/issues/4149|Issue}
|
|
210
219
|
*/
|
|
211
220
|
events.emit(CONSTANTS.EVENTS.BEFORE_REQUEST_BIDS, adUnits);
|
|
221
|
+
decorateAdUnitsWithNativeParams(adUnits);
|
|
212
222
|
|
|
213
223
|
let bidderCodes = getBidderCodes(adUnits);
|
|
214
224
|
if (config.getConfig('bidderSequence') === RANDOM) {
|
|
@@ -404,12 +414,7 @@ adapterManager.callBids = (adUnits, bidRequests, addBidResponse, doneCb, request
|
|
|
404
414
|
s2sAdapter.callBids(
|
|
405
415
|
s2sBidRequest,
|
|
406
416
|
serverBidRequests,
|
|
407
|
-
|
|
408
|
-
let bidderRequest = getBidderRequest(serverBidRequests, bid.bidderCode, adUnitCode);
|
|
409
|
-
if (bidderRequest) {
|
|
410
|
-
addBidResponse.call(bidderRequest, adUnitCode, bid)
|
|
411
|
-
}
|
|
412
|
-
},
|
|
417
|
+
addBidResponse,
|
|
413
418
|
() => doneCbs.forEach(done => done()),
|
|
414
419
|
s2sAjax
|
|
415
420
|
);
|
|
@@ -442,7 +447,7 @@ adapterManager.callBids = (adUnits, bidRequests, addBidResponse, doneCb, request
|
|
|
442
447
|
adapter.callBids,
|
|
443
448
|
adapter,
|
|
444
449
|
bidRequest,
|
|
445
|
-
addBidResponse
|
|
450
|
+
addBidResponse,
|
|
446
451
|
adapterDone,
|
|
447
452
|
ajax,
|
|
448
453
|
onTimelyResponse,
|
|
@@ -7,12 +7,13 @@ import { nativeBidIsValid } from '../native.js';
|
|
|
7
7
|
import { isValidVideoBid } from '../video.js';
|
|
8
8
|
import CONSTANTS from '../constants.json';
|
|
9
9
|
import events from '../events.js';
|
|
10
|
-
import includes from '
|
|
10
|
+
import includes from 'prebidjs-polyfill/includes.js';
|
|
11
11
|
import { ajax } from '../ajax.js';
|
|
12
|
-
import { logWarn, logError, parseQueryStringParameters, delayExecution, parseSizesInput,
|
|
12
|
+
import { logWarn, logError, parseQueryStringParameters, delayExecution, parseSizesInput, flatten, uniques, timestamp, deepAccess, isArray, isPlainObject } from '../utils.js';
|
|
13
13
|
import { ADPOD } from '../mediaTypes.js';
|
|
14
14
|
import { getHook, hook } from '../hook.js';
|
|
15
15
|
import { getCoreStorageManager } from '../storageManager.js';
|
|
16
|
+
import {auctionManager} from '../auctionManager.js';
|
|
16
17
|
|
|
17
18
|
export const storage = getCoreStorageManager('bidderFactory');
|
|
18
19
|
|
|
@@ -130,7 +131,7 @@ export const storage = getCoreStorageManager('bidderFactory');
|
|
|
130
131
|
*/
|
|
131
132
|
|
|
132
133
|
// common params for all mediaTypes
|
|
133
|
-
const COMMON_BID_RESPONSE_KEYS = ['
|
|
134
|
+
const COMMON_BID_RESPONSE_KEYS = ['cpm', 'ttl', 'creativeId', 'netRevenue', 'currency'];
|
|
134
135
|
|
|
135
136
|
const DEFAULT_REFRESHIN_DAYS = 1;
|
|
136
137
|
|
|
@@ -187,7 +188,7 @@ export function newBidder(spec) {
|
|
|
187
188
|
const adUnitCodesHandled = {};
|
|
188
189
|
function addBidWithCode(adUnitCode, bid) {
|
|
189
190
|
adUnitCodesHandled[adUnitCode] = true;
|
|
190
|
-
if (isValid(adUnitCode, bid
|
|
191
|
+
if (isValid(adUnitCode, bid)) {
|
|
191
192
|
addBidResponse(adUnitCode, bid);
|
|
192
193
|
}
|
|
193
194
|
}
|
|
@@ -451,16 +452,17 @@ export function getIabSubCategory(bidderCode, category) {
|
|
|
451
452
|
}
|
|
452
453
|
|
|
453
454
|
// check that the bid has a width and height set
|
|
454
|
-
function validBidSize(adUnitCode, bid,
|
|
455
|
+
function validBidSize(adUnitCode, bid, {index = auctionManager.index} = {}) {
|
|
455
456
|
if ((bid.width || parseInt(bid.width, 10) === 0) && (bid.height || parseInt(bid.height, 10) === 0)) {
|
|
456
457
|
bid.width = parseInt(bid.width, 10);
|
|
457
458
|
bid.height = parseInt(bid.height, 10);
|
|
458
459
|
return true;
|
|
459
460
|
}
|
|
460
461
|
|
|
461
|
-
const
|
|
462
|
+
const bidRequest = index.getBidRequest(bid);
|
|
463
|
+
const mediaTypes = index.getMediaTypes(bid);
|
|
462
464
|
|
|
463
|
-
const sizes =
|
|
465
|
+
const sizes = (bidRequest && bidRequest.sizes) || (mediaTypes && mediaTypes.banner && mediaTypes.banner.sizes);
|
|
464
466
|
const parsedSizes = parseSizesInput(sizes);
|
|
465
467
|
|
|
466
468
|
// if a banner impression has one valid size, we assign that size to any bid
|
|
@@ -476,7 +478,7 @@ function validBidSize(adUnitCode, bid, bidRequests) {
|
|
|
476
478
|
}
|
|
477
479
|
|
|
478
480
|
// Validate the arguments sent to us by the adapter. If this returns false, the bid should be totally ignored.
|
|
479
|
-
export function isValid(adUnitCode, bid,
|
|
481
|
+
export function isValid(adUnitCode, bid, {index = auctionManager.index} = {}) {
|
|
480
482
|
function hasValidKeys() {
|
|
481
483
|
let bidKeys = Object.keys(bid);
|
|
482
484
|
return COMMON_BID_RESPONSE_KEYS.every(key => includes(bidKeys, key) && !includes([undefined, null], bid[key]));
|
|
@@ -501,15 +503,15 @@ export function isValid(adUnitCode, bid, bidRequests) {
|
|
|
501
503
|
return false;
|
|
502
504
|
}
|
|
503
505
|
|
|
504
|
-
if (bid.mediaType === 'native' && !nativeBidIsValid(bid,
|
|
506
|
+
if (bid.mediaType === 'native' && !nativeBidIsValid(bid, {index})) {
|
|
505
507
|
logError(errorMessage('Native bid missing some required properties.'));
|
|
506
508
|
return false;
|
|
507
509
|
}
|
|
508
|
-
if (bid.mediaType === 'video' && !isValidVideoBid(bid,
|
|
510
|
+
if (bid.mediaType === 'video' && !isValidVideoBid(bid, {index})) {
|
|
509
511
|
logError(errorMessage(`Video bid does not have required vastUrl or renderer property`));
|
|
510
512
|
return false;
|
|
511
513
|
}
|
|
512
|
-
if (bid.mediaType === 'banner' && !validBidSize(adUnitCode, bid,
|
|
514
|
+
if (bid.mediaType === 'banner' && !validBidSize(adUnitCode, bid, {index})) {
|
|
513
515
|
logError(errorMessage(`Banner bids require a width and height`));
|
|
514
516
|
return false;
|
|
515
517
|
}
|
package/src/adloader.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import includes from '
|
|
1
|
+
import includes from 'prebidjs-polyfill/includes.js';
|
|
2
2
|
import { logError, logWarn, insertElement } from './utils.js';
|
|
3
3
|
|
|
4
4
|
const _requestCache = {};
|
|
@@ -8,7 +8,8 @@ const _approvedLoadExternalJSList = [
|
|
|
8
8
|
'criteo',
|
|
9
9
|
'outstream',
|
|
10
10
|
'adagio',
|
|
11
|
-
'browsi'
|
|
11
|
+
'browsi',
|
|
12
|
+
'brandmetrics'
|
|
12
13
|
]
|
|
13
14
|
|
|
14
15
|
/**
|