prebid.js 7.22.0 → 7.24.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/dist/33acrossBidAdapter.js +1 -1
- package/dist/aaxBlockmeterRtdProvider.js +1 -0
- package/dist/adagioBidAdapter.js +1 -1
- package/dist/adbookpspBidAdapter.js +1 -1
- package/dist/adgenerationBidAdapter.js +1 -1
- package/dist/admaticBidAdapter.js +1 -0
- package/dist/adrelevantisBidAdapter.js +1 -1
- package/dist/adtrgtmeBidAdapter.js +1 -1
- package/dist/adxcgBidAdapter.js +1 -1
- package/dist/adyoulikeBidAdapter.js +1 -1
- package/dist/ajaBidAdapter.js +1 -1
- package/dist/amxBidAdapter.js +1 -1
- package/dist/amxIdSystem.js +1 -1
- package/dist/analyticsAdapter.js +1 -1
- package/dist/appierAnalyticsAdapter.js +1 -1
- package/dist/appnexusBidAdapter.js +1 -1
- package/dist/asoBidAdapter.js +1 -1
- package/dist/audiencerunBidAdapter.js +1 -1
- package/dist/axonixBidAdapter.js +1 -1
- package/dist/bidViewability.js +1 -1
- package/dist/bidViewabilityIO.js +1 -1
- package/dist/bidglassBidAdapter.js +1 -1
- package/dist/big-richmediaBidAdapter.js +1 -1
- package/dist/bluebillywigBidAdapter.js +1 -1
- package/dist/bridgewellBidAdapter.js +1 -1
- package/dist/brightMountainMediaBidAdapter.js +1 -1
- package/dist/browsiRtdProvider.js +1 -1
- package/dist/carodaBidAdapter.js +1 -1
- package/dist/chtnwBidAdapter.js +1 -0
- package/dist/cleanioRtdProvider.js +1 -1
- package/dist/concertBidAdapter.js +1 -1
- package/dist/connectIdSystem.js +1 -1
- package/dist/connectadBidAdapter.js +1 -1
- package/dist/consentManagement.js +1 -1
- package/dist/consentManagementUsp.js +1 -1
- package/dist/consumableBidAdapter.js +1 -1
- package/dist/conversantBidAdapter.js +1 -1
- package/dist/craftBidAdapter.js +1 -1
- package/dist/criteoBidAdapter.js +1 -1
- package/dist/currency.js +1 -1
- package/dist/dependencies.json +19 -0
- package/dist/dfpAdServerVideo.js +1 -1
- package/dist/dgkeywordRtdProvider.js +1 -1
- package/dist/dspxBidAdapter.js +1 -1
- package/dist/eplanningBidAdapter.js +1 -1
- package/dist/finativeBidAdapter.js +1 -1
- package/dist/gdprEnforcement.js +1 -1
- package/dist/glimpseBidAdapter.js +1 -1
- package/dist/gmosspBidAdapter.js +1 -1
- package/dist/goldbachBidAdapter.js +1 -1
- package/dist/googleAnalyticsAdapter.js +1 -1
- package/dist/gridBidAdapter.js +1 -1
- package/dist/gridNMBidAdapter.js +1 -1
- package/dist/growthCodeIdSystem.js +1 -1
- package/dist/gumgumBidAdapter.js +1 -1
- package/dist/h12mediaBidAdapter.js +1 -1
- package/dist/id5AnalyticsAdapter.js +1 -1
- package/dist/id5IdSystem.js +1 -1
- package/dist/impactifyBidAdapter.js +1 -1
- package/dist/improvedigitalBidAdapter.js +1 -1
- package/dist/inmarBidAdapter.js +1 -1
- package/dist/insticatorBidAdapter.js +1 -1
- package/dist/instreamTracking.js +1 -1
- package/dist/ixBidAdapter.js +1 -1
- package/dist/jixieBidAdapter.js +1 -1
- package/dist/justpremiumBidAdapter.js +1 -1
- package/dist/jwplayerVideoProvider.js +1 -0
- package/dist/kargoBidAdapter.js +1 -1
- package/dist/konduitAnalyticsAdapter.js +1 -1
- package/dist/kueezBidAdapter.js +1 -1
- package/dist/kueezRtbBidAdapter.js +1 -0
- package/dist/lassoBidAdapter.js +1 -1
- package/dist/lifestreetBidAdapter.js +1 -1
- package/dist/liveyieldAnalyticsAdapter.js +1 -1
- package/dist/logicadBidAdapter.js +1 -1
- package/dist/loglyliftBidAdapter.js +1 -1
- package/dist/magniteAnalyticsAdapter.js +1 -1
- package/dist/malltvAnalyticsAdapter.js +1 -1
- package/dist/marsmediaBidAdapter.js +1 -1
- package/dist/mediafuseBidAdapter.js +1 -1
- package/dist/mediakeysBidAdapter.js +1 -1
- package/dist/mediasquareBidAdapter.js +1 -1
- package/dist/mgidBidAdapter.js +1 -1
- package/dist/mgidRtdProvider.js +1 -0
- package/dist/minutemediaBidAdapter.js +1 -1
- package/dist/multibid.js +1 -1
- package/dist/not-for-prod/prebid.js +153 -141
- package/dist/oguryBidAdapter.js +1 -1
- package/dist/onetagBidAdapter.js +1 -1
- package/dist/ooloAnalyticsAdapter.js +1 -1
- package/dist/openxOrtbBidAdapter.js +1 -1
- package/dist/ortbConverter.js +1 -0
- package/dist/outbrainBidAdapter.js +1 -1
- package/dist/oxxionRtdProvider.js +1 -0
- package/dist/parrableIdSystem.js +1 -1
- package/dist/pbsExtensions.js +1 -0
- package/dist/permutiveRtdProvider.js +1 -1
- package/dist/pixfutureBidAdapter.js +1 -1
- package/dist/prebid-core.js +1 -1
- package/dist/prebidServerBidAdapter.js +1 -1
- package/dist/priceFloors.js +1 -1
- package/dist/pubCommonId.js +1 -1
- package/dist/publinkIdSystem.js +1 -1
- package/dist/pubmaticBidAdapter.js +1 -1
- package/dist/pubwiseAnalyticsAdapter.js +1 -1
- package/dist/pxyzBidAdapter.js +1 -1
- package/dist/quantcastBidAdapter.js +1 -1
- package/dist/readpeakBidAdapter.js +1 -1
- package/dist/relaidoBidAdapter.js +1 -1
- package/dist/rhythmoneBidAdapter.js +1 -1
- package/dist/riseBidAdapter.js +1 -1
- package/dist/rtdModule.js +1 -1
- package/dist/rubiconAnalyticsAdapter.js +1 -1
- package/dist/rubiconBidAdapter.js +1 -1
- package/dist/schain.js +1 -1
- package/dist/seedingAllianceBidAdapter.js +1 -1
- package/dist/seedtagBidAdapter.js +1 -1
- package/dist/sharethroughAnalyticsAdapter.js +1 -1
- package/dist/sharethroughBidAdapter.js +1 -1
- package/dist/shinezBidAdapter.js +1 -1
- package/dist/smaatoBidAdapter.js +1 -1
- package/dist/smartadserverBidAdapter.js +1 -1
- package/dist/smartxBidAdapter.js +1 -1
- package/dist/smilewantedBidAdapter.js +1 -1
- package/dist/sonobiBidAdapter.js +1 -1
- package/dist/sovrnAnalyticsAdapter.js +1 -1
- package/dist/sovrnBidAdapter.js +1 -1
- package/dist/spotxBidAdapter.js +1 -1
- package/dist/sspBCBidAdapter.js +1 -1
- package/dist/sublimeBidAdapter.js +1 -1
- package/dist/synacormediaBidAdapter.js +1 -1
- package/dist/targetVideoBidAdapter.js +1 -1
- package/dist/teadsBidAdapter.js +1 -1
- package/dist/teadsIdSystem.js +1 -1
- package/dist/trionBidAdapter.js +1 -1
- package/dist/tripleliftBidAdapter.js +1 -1
- package/dist/ttdBidAdapter.js +1 -1
- package/dist/ucfunnelAnalyticsAdapter.js +1 -1
- package/dist/underdogmediaBidAdapter.js +1 -1
- package/dist/undertoneBidAdapter.js +1 -1
- package/dist/userId.js +1 -1
- package/dist/vidazooBidAdapter.js +1 -1
- package/dist/video.js +1 -0
- package/dist/videoModule.js +1 -0
- package/dist/videobyteBidAdapter.js +1 -1
- package/dist/videojsVideoProvider.js +1 -0
- package/dist/visxBidAdapter.js +1 -1
- package/dist/vuukleBidAdapter.js +1 -1
- package/dist/widespaceBidAdapter.js +1 -1
- package/dist/winrBidAdapter.js +1 -1
- package/dist/yahoosspBidAdapter.js +1 -1
- package/dist/yieldmoBidAdapter.js +1 -1
- package/dist/yieldoneAnalyticsAdapter.js +1 -1
- package/integrationExamples/gpt/mgidRtdProvider_example.html +143 -0
- package/integrationExamples/videoModule/jwplayer/bidMarkedAsUsed.html +98 -0
- package/integrationExamples/videoModule/jwplayer/bidRequestScheduling.html +89 -0
- package/integrationExamples/videoModule/jwplayer/eventListeners.html +244 -0
- package/integrationExamples/videoModule/jwplayer/gamAdServerMediation.html +122 -0
- package/integrationExamples/videoModule/jwplayer/mediaMetadata.html +80 -0
- package/integrationExamples/videoModule/jwplayer/playlist.html +122 -0
- package/integrationExamples/videoModule/videojs/bidMarkedAsUsed.html +126 -0
- package/integrationExamples/videoModule/videojs/bidRequestScheduling.html +132 -0
- package/integrationExamples/videoModule/videojs/eventListeners.html +238 -0
- package/integrationExamples/videoModule/videojs/gamAdServerMediation.html +138 -0
- package/integrationExamples/videoModule/videojs/mediaMetadata.html +103 -0
- package/integrationExamples/videoModule/videojs/playlist.html +151 -0
- package/libraries/ortbConverter/README.md +378 -0
- package/libraries/ortbConverter/converter.js +135 -0
- package/libraries/ortbConverter/lib/composer.js +43 -0
- package/libraries/ortbConverter/lib/mergeProcessors.js +9 -0
- package/libraries/ortbConverter/lib/sizes.js +14 -0
- package/libraries/ortbConverter/processors/banner.js +40 -0
- package/libraries/ortbConverter/processors/default.js +167 -0
- package/libraries/ortbConverter/processors/mediaType.js +21 -0
- package/libraries/ortbConverter/processors/native.js +37 -0
- package/libraries/ortbConverter/processors/video.js +66 -0
- package/libraries/pbsExtensions/pbsExtensions.js +12 -0
- package/libraries/pbsExtensions/processors/aliases.js +17 -0
- package/libraries/pbsExtensions/processors/mediaType.js +23 -0
- package/libraries/pbsExtensions/processors/params.js +22 -0
- package/libraries/pbsExtensions/processors/pbs.js +99 -0
- package/libraries/pbsExtensions/processors/requestExtPrebid.js +30 -0
- package/libraries/pbsExtensions/processors/video.js +23 -0
- package/libraries/video/constants/enums.js +5 -0
- package/libraries/video/constants/events.js +97 -0
- package/libraries/video/constants/ortb.js +169 -0
- package/libraries/video/constants/vendorCodes.js +6 -0
- package/libraries/video/shared/eventHandler.js +18 -0
- package/libraries/video/shared/parentModule.js +82 -0
- package/libraries/video/shared/state.js +47 -0
- package/libraries/video/shared/vastXmlBuilder.js +77 -0
- package/libraries/video/shared/vastXmlEditor.js +115 -0
- package/modules/.submodules.json +7 -1
- package/modules/aaxBlockmeterRtdProvider.js +59 -0
- package/modules/aaxBlockmeterRtdProvider.md +48 -0
- package/modules/admaticBidAdapter.js +147 -0
- package/modules/admaticBidAdapter.md +48 -0
- package/modules/amxBidAdapter.js +1 -0
- package/modules/appnexusBidAdapter.js +38 -1
- package/modules/chtnwBidAdapter.js +110 -0
- package/modules/chtnwBidAdapter.md +31 -0
- package/modules/concertBidAdapter.js +44 -2
- package/modules/connectIdSystem.js +36 -23
- package/modules/connectIdSystem.md +3 -2
- package/modules/consentManagement.js +22 -1
- package/modules/consentManagementUsp.js +29 -7
- package/modules/criteoBidAdapter.js +25 -5
- package/modules/currency.js +9 -0
- package/modules/dgkeywordRtdProvider.js +3 -3
- package/modules/gridNMBidAdapter.js +10 -14
- package/modules/growthCodeIdSystem.js +9 -5
- package/modules/gumgumBidAdapter.js +4 -0
- package/modules/improvedigitalBidAdapter.js +191 -470
- package/modules/ixBidAdapter.js +54 -71
- package/modules/jwplayerVideoProvider.js +929 -0
- package/modules/jwplayerVideoProvider.md +25 -0
- package/modules/kargoBidAdapter.js +1 -1
- package/modules/kueezRtbBidAdapter.js +278 -0
- package/modules/kueezRtbBidAdapter.md +35 -0
- package/modules/magniteAnalyticsAdapter.js +6 -1
- package/modules/mgidRtdProvider.js +190 -0
- package/modules/mgidRtdProvider.md +51 -0
- package/modules/multibid/index.js +12 -0
- package/modules/openxOrtbBidAdapter.js +120 -275
- package/modules/oxxionRtdProvider.js +119 -0
- package/modules/oxxionRtdProvider.md +48 -0
- package/modules/permutiveRtdProvider.js +2 -1
- package/modules/permutiveRtdProvider.md +36 -1
- package/modules/prebidServerBidAdapter/index.js +19 -716
- package/modules/prebidServerBidAdapter/ortbConverter.js +274 -0
- package/modules/priceFloors.js +73 -1
- package/modules/pubmaticBidAdapter.js +21 -29
- package/modules/rtdModule/index.js +22 -1
- package/modules/schain.js +24 -1
- package/modules/spotxBidAdapter.js +16 -15
- package/modules/synacormediaBidAdapter.js +1 -1
- package/modules/teadsIdSystem.js +5 -0
- package/modules/tripleliftBidAdapter.js +1 -1
- package/modules/userId/eids.js +3 -10
- package/modules/userId/index.js +64 -6
- package/modules/videoModule/addingSubmodule.md +521 -0
- package/modules/videoModule/coreVideo.js +234 -0
- package/modules/videoModule/gamAdServerSubmodule.js +27 -0
- package/modules/videoModule/index.js +244 -0
- package/modules/videoModule/videoImpressionVerifier.js +206 -0
- package/modules/videojsVideoProvider.js +854 -0
- package/modules/videojsVideoProvider.md +17 -0
- package/package.json +12 -8
- package/src/adRendering.js +1 -1
- package/src/adapterManager.js +56 -7
- package/src/adloader.js +3 -1
- package/src/auction.js +6 -1
- package/src/events.js +5 -1
- package/src/pbjsORTB.js +35 -0
- package/src/prebid.js +137 -112
- package/src/targeting.js +10 -2
- package/src/utils/currency.js +16 -0
- package/src/utils.js +21 -0
- package/test/spec/auctionmanager_spec.js +15 -0
- package/test/spec/modules/aaxBlockmeter_spec.js +58 -0
- package/test/spec/modules/admaticBidAdapter_spec.js +46 -0
- package/test/spec/modules/chtnwBidAdapter_spec.js +105 -0
- package/test/spec/modules/concertBidAdapter_spec.js +56 -0
- package/test/spec/modules/connectIdSystem_spec.js +175 -5
- package/test/spec/modules/consentManagementUsp_spec.js +64 -18
- package/test/spec/modules/criteoBidAdapter_spec.js +28 -0
- package/test/spec/modules/dgkeywordRtdProvider_spec.js +3 -3
- package/test/spec/modules/eids_spec.js +10 -7
- package/test/spec/modules/ftrackIdSystem_spec.js +34 -22
- package/test/spec/modules/gumgumBidAdapter_spec.js +15 -0
- package/test/spec/modules/improvedigitalBidAdapter_spec.js +231 -211
- package/test/spec/modules/ixBidAdapter_spec.js +412 -350
- package/test/spec/modules/kueezRtbBidAdapter_spec.js +396 -0
- package/test/spec/modules/magniteAnalyticsAdapter_spec.js +26 -0
- package/test/spec/modules/mgidRtdProvider_spec.js +366 -0
- package/test/spec/modules/openxOrtbBidAdapter_spec.js +77 -49
- package/test/spec/modules/oxxionRtdProvider_spec.js +142 -0
- package/test/spec/modules/permutiveRtdProvider_spec.js +64 -5
- package/test/spec/modules/prebidServerBidAdapter_spec.js +139 -137
- package/test/spec/modules/realTimeDataModule_spec.js +65 -0
- package/test/spec/modules/tripleliftBidAdapter_spec.js +14 -0
- package/test/spec/modules/userId_spec.js +67 -1
- package/test/spec/modules/videoModule/coreVideo_spec.js +98 -0
- package/test/spec/modules/videoModule/pbVideo_spec.js +362 -0
- package/test/spec/modules/videoModule/shared/parentModule_spec.js +73 -0
- package/test/spec/modules/videoModule/shared/state_spec.js +26 -0
- package/test/spec/modules/videoModule/shared/vastXmlBuilder_spec.js +103 -0
- package/test/spec/modules/videoModule/shared/vastXmlEditor_spec.js +209 -0
- package/test/spec/modules/videoModule/submodules/jwplayerVideoProvider_spec.js +846 -0
- package/test/spec/modules/videoModule/submodules/videojsVideoProvider_spec.js +391 -0
- package/test/spec/modules/videoModule/videoImpressionVerifier_spec.js +112 -0
- package/test/spec/ortbConverter/banner_spec.js +203 -0
- package/test/spec/ortbConverter/composer_spec.js +69 -0
- package/test/spec/ortbConverter/converter_spec.js +283 -0
- package/test/spec/ortbConverter/currency_spec.js +40 -0
- package/test/spec/ortbConverter/default_processors_spec.js +61 -0
- package/test/spec/ortbConverter/gdpr_spec.js +38 -0
- package/test/spec/ortbConverter/mediaTypes_spec.js +67 -0
- package/test/spec/ortbConverter/mergeProcessors_spec.js +59 -0
- package/test/spec/ortbConverter/multibid_spec.js +35 -0
- package/test/spec/ortbConverter/native_spec.js +95 -0
- package/test/spec/ortbConverter/pbjsORTB_spec.js +67 -0
- package/test/spec/ortbConverter/pbsExtensions/aliases_spec.js +57 -0
- package/test/spec/ortbConverter/pbsExtensions/params_spec.js +96 -0
- package/test/spec/ortbConverter/pbsExtensions/video_spec.js +52 -0
- package/test/spec/ortbConverter/priceFloors_spec.js +143 -0
- package/test/spec/ortbConverter/schain_spec.js +33 -0
- package/test/spec/ortbConverter/userId_spec.js +21 -0
- package/test/spec/ortbConverter/usp_spec.js +15 -0
- package/test/spec/ortbConverter/video_spec.js +189 -0
- package/test/spec/unit/core/adapterManager_spec.js +102 -0
- package/test/spec/unit/core/targeting_spec.js +34 -0
- package/test/spec/unit/pbjs_api_spec.js +124 -45
- package/test/spec/utils_spec.js +45 -1
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
import {expect} from 'chai';
|
|
2
|
+
import {
|
|
3
|
+
spec as adapter,
|
|
4
|
+
SUPPORTED_ID_SYSTEMS,
|
|
5
|
+
createDomain,
|
|
6
|
+
hashCode,
|
|
7
|
+
extractPID,
|
|
8
|
+
extractCID,
|
|
9
|
+
extractSubDomain,
|
|
10
|
+
getStorageItem,
|
|
11
|
+
setStorageItem,
|
|
12
|
+
tryParseJSON,
|
|
13
|
+
getUniqueDealId,
|
|
14
|
+
} from 'modules/kueezRtbBidAdapter.js';
|
|
15
|
+
import * as utils from 'src/utils.js';
|
|
16
|
+
import {version} from 'package.json';
|
|
17
|
+
import {useFakeTimers} from 'sinon';
|
|
18
|
+
|
|
19
|
+
const SUB_DOMAIN = 'exchange';
|
|
20
|
+
|
|
21
|
+
const BID = {
|
|
22
|
+
'bidId': '2d52001cabd527',
|
|
23
|
+
'adUnitCode': 'div-gpt-ad-12345-0',
|
|
24
|
+
'params': {
|
|
25
|
+
'subDomain': SUB_DOMAIN,
|
|
26
|
+
'cId': '59db6b3b4ffaa70004f45cdc',
|
|
27
|
+
'pId': '59ac17c192832d0011283fe3',
|
|
28
|
+
'bidFloor': 0.1,
|
|
29
|
+
'ext': {
|
|
30
|
+
'param1': 'loremipsum',
|
|
31
|
+
'param2': 'dolorsitamet'
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
'placementCode': 'div-gpt-ad-1460505748561-0',
|
|
35
|
+
'transactionId': 'c881914b-a3b5-4ecf-ad9c-1c2f37c6aabf',
|
|
36
|
+
'sizes': [[300, 250], [300, 600]],
|
|
37
|
+
'bidderRequestId': '1fdb5ff1b6eaa7',
|
|
38
|
+
'requestId': 'b0777d85-d061-450e-9bc7-260dd54bbb7a',
|
|
39
|
+
'schain': 'a0819c69-005b-41ed-af06-1be1e0aefefc'
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const BIDDER_REQUEST = {
|
|
43
|
+
'gdprConsent': {
|
|
44
|
+
'consentString': 'consent_string',
|
|
45
|
+
'gdprApplies': true
|
|
46
|
+
},
|
|
47
|
+
'uspConsent': 'consent_string',
|
|
48
|
+
'refererInfo': {
|
|
49
|
+
'page': 'https://www.greatsite.com',
|
|
50
|
+
'ref': 'https://www.somereferrer.com'
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const SERVER_RESPONSE = {
|
|
55
|
+
body: {
|
|
56
|
+
cid: 'testcid123',
|
|
57
|
+
results: [{
|
|
58
|
+
'ad': '<iframe>console.log("hello world")</iframe>',
|
|
59
|
+
'price': 0.8,
|
|
60
|
+
'creativeId': '12610997325162499419',
|
|
61
|
+
'exp': 30,
|
|
62
|
+
'width': 300,
|
|
63
|
+
'height': 250,
|
|
64
|
+
'advertiserDomains': ['securepubads.g.doubleclick.net'],
|
|
65
|
+
'cookies': [{
|
|
66
|
+
'src': 'https://sync.com',
|
|
67
|
+
'type': 'iframe'
|
|
68
|
+
}, {
|
|
69
|
+
'src': 'https://sync.com',
|
|
70
|
+
'type': 'img'
|
|
71
|
+
}]
|
|
72
|
+
}]
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
const REQUEST = {
|
|
77
|
+
data: {
|
|
78
|
+
width: 300,
|
|
79
|
+
height: 250,
|
|
80
|
+
bidId: '2d52001cabd527'
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
function getTopWindowQueryParams() {
|
|
85
|
+
try {
|
|
86
|
+
const parsedUrl = utils.parseUrl(window.top.document.URL, {decodeSearchAsString: true});
|
|
87
|
+
return parsedUrl.search;
|
|
88
|
+
} catch (e) {
|
|
89
|
+
return '';
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
describe('KueezRtbBidAdapter', function () {
|
|
94
|
+
describe('validtae spec', function () {
|
|
95
|
+
it('exists and is a function', function () {
|
|
96
|
+
expect(adapter.isBidRequestValid).to.exist.and.to.be.a('function');
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
it('exists and is a function', function () {
|
|
100
|
+
expect(adapter.buildRequests).to.exist.and.to.be.a('function');
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
it('exists and is a function', function () {
|
|
104
|
+
expect(adapter.interpretResponse).to.exist.and.to.be.a('function');
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
it('exists and is a function', function () {
|
|
108
|
+
expect(adapter.getUserSyncs).to.exist.and.to.be.a('function');
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
it('exists and is a string', function () {
|
|
112
|
+
expect(adapter.code).to.exist.and.to.be.a('string');
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
describe('validate bid requests', function () {
|
|
117
|
+
it('should require cId', function () {
|
|
118
|
+
const isValid = adapter.isBidRequestValid({
|
|
119
|
+
params: {
|
|
120
|
+
pId: 'pid'
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
expect(isValid).to.be.false;
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
it('should require pId', function () {
|
|
127
|
+
const isValid = adapter.isBidRequestValid({
|
|
128
|
+
params: {
|
|
129
|
+
cId: 'cid'
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
expect(isValid).to.be.false;
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
it('should validate correctly', function () {
|
|
136
|
+
const isValid = adapter.isBidRequestValid({
|
|
137
|
+
params: {
|
|
138
|
+
cId: 'cid',
|
|
139
|
+
pId: 'pid'
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
expect(isValid).to.be.true;
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
describe('build requests', function () {
|
|
147
|
+
let sandbox;
|
|
148
|
+
before(function () {
|
|
149
|
+
$$PREBID_GLOBAL$$.bidderSettings = {
|
|
150
|
+
kueezrtb: {
|
|
151
|
+
storageAllowed: true
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
sandbox = sinon.sandbox.create();
|
|
155
|
+
sandbox.stub(Date, 'now').returns(1000);
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
it('should build request for each size', function () {
|
|
159
|
+
const hashUrl = hashCode(BIDDER_REQUEST.refererInfo.page);
|
|
160
|
+
const requests = adapter.buildRequests([BID], BIDDER_REQUEST);
|
|
161
|
+
expect(requests).to.have.length(1);
|
|
162
|
+
expect(requests[0]).to.deep.equal({
|
|
163
|
+
method: 'POST',
|
|
164
|
+
url: `${createDomain(SUB_DOMAIN)}/prebid/multi/59db6b3b4ffaa70004f45cdc`,
|
|
165
|
+
data: {
|
|
166
|
+
gdprConsent: 'consent_string',
|
|
167
|
+
gdpr: 1,
|
|
168
|
+
usPrivacy: 'consent_string',
|
|
169
|
+
sizes: ['300x250', '300x600'],
|
|
170
|
+
url: 'https%3A%2F%2Fwww.greatsite.com',
|
|
171
|
+
referrer: 'https://www.somereferrer.com',
|
|
172
|
+
cb: 1000,
|
|
173
|
+
bidFloor: 0.1,
|
|
174
|
+
bidId: '2d52001cabd527',
|
|
175
|
+
adUnitCode: 'div-gpt-ad-12345-0',
|
|
176
|
+
publisherId: '59ac17c192832d0011283fe3',
|
|
177
|
+
uniqueDealId: `${hashUrl}_${Date.now().toString()}`,
|
|
178
|
+
bidderVersion: adapter.version,
|
|
179
|
+
prebidVersion: version,
|
|
180
|
+
schain: BID.schain,
|
|
181
|
+
res: `${window.top.screen.width}x${window.top.screen.height}`,
|
|
182
|
+
uqs: getTopWindowQueryParams(),
|
|
183
|
+
'ext.param1': 'loremipsum',
|
|
184
|
+
'ext.param2': 'dolorsitamet',
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
after(function () {
|
|
190
|
+
$$PREBID_GLOBAL$$.bidderSettings = {};
|
|
191
|
+
sandbox.restore();
|
|
192
|
+
});
|
|
193
|
+
});
|
|
194
|
+
describe('getUserSyncs', function () {
|
|
195
|
+
it('should have valid user sync with iframeEnabled', function () {
|
|
196
|
+
const result = adapter.getUserSyncs({iframeEnabled: true}, [SERVER_RESPONSE]);
|
|
197
|
+
|
|
198
|
+
expect(result).to.deep.equal([{
|
|
199
|
+
type: 'iframe',
|
|
200
|
+
url: 'https://sync.kueezrtb.com/api/sync/iframe/?cid=testcid123&gdpr=0&gdpr_consent=&us_privacy='
|
|
201
|
+
}]);
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
it('should have valid user sync with cid on response', function () {
|
|
205
|
+
const result = adapter.getUserSyncs({iframeEnabled: true}, [SERVER_RESPONSE]);
|
|
206
|
+
expect(result).to.deep.equal([{
|
|
207
|
+
type: 'iframe',
|
|
208
|
+
url: 'https://sync.kueezrtb.com/api/sync/iframe/?cid=testcid123&gdpr=0&gdpr_consent=&us_privacy='
|
|
209
|
+
}]);
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
it('should have valid user sync with pixelEnabled', function () {
|
|
213
|
+
const result = adapter.getUserSyncs({pixelEnabled: true}, [SERVER_RESPONSE]);
|
|
214
|
+
|
|
215
|
+
expect(result).to.deep.equal([{
|
|
216
|
+
'url': 'https://sync.kueezrtb.com/api/sync/image/?cid=testcid123&gdpr=0&gdpr_consent=&us_privacy=',
|
|
217
|
+
'type': 'image'
|
|
218
|
+
}]);
|
|
219
|
+
})
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
describe('interpret response', function () {
|
|
223
|
+
it('should return empty array when there is no response', function () {
|
|
224
|
+
const responses = adapter.interpretResponse(null);
|
|
225
|
+
expect(responses).to.be.empty;
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
it('should return empty array when there is no ad', function () {
|
|
229
|
+
const responses = adapter.interpretResponse({price: 1, ad: ''});
|
|
230
|
+
expect(responses).to.be.empty;
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
it('should return empty array when there is no price', function () {
|
|
234
|
+
const responses = adapter.interpretResponse({price: null, ad: 'great ad'});
|
|
235
|
+
expect(responses).to.be.empty;
|
|
236
|
+
});
|
|
237
|
+
|
|
238
|
+
it('should return an array of interpreted responses', function () {
|
|
239
|
+
const responses = adapter.interpretResponse(SERVER_RESPONSE, REQUEST);
|
|
240
|
+
expect(responses).to.have.length(1);
|
|
241
|
+
expect(responses[0]).to.deep.equal({
|
|
242
|
+
requestId: '2d52001cabd527',
|
|
243
|
+
cpm: 0.8,
|
|
244
|
+
width: 300,
|
|
245
|
+
height: 250,
|
|
246
|
+
creativeId: '12610997325162499419',
|
|
247
|
+
currency: 'USD',
|
|
248
|
+
netRevenue: true,
|
|
249
|
+
ttl: 30,
|
|
250
|
+
ad: '<iframe>console.log("hello world")</iframe>',
|
|
251
|
+
meta: {
|
|
252
|
+
advertiserDomains: ['securepubads.g.doubleclick.net']
|
|
253
|
+
}
|
|
254
|
+
});
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
it('should take default TTL', function () {
|
|
258
|
+
const serverResponse = utils.deepClone(SERVER_RESPONSE);
|
|
259
|
+
delete serverResponse.body.results[0].exp;
|
|
260
|
+
const responses = adapter.interpretResponse(serverResponse, REQUEST);
|
|
261
|
+
expect(responses).to.have.length(1);
|
|
262
|
+
expect(responses[0].ttl).to.equal(300);
|
|
263
|
+
});
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
describe('user id system', function () {
|
|
267
|
+
Object.keys(SUPPORTED_ID_SYSTEMS).forEach((idSystemProvider) => {
|
|
268
|
+
const id = Date.now().toString();
|
|
269
|
+
const bid = utils.deepClone(BID);
|
|
270
|
+
|
|
271
|
+
const userId = (function () {
|
|
272
|
+
switch (idSystemProvider) {
|
|
273
|
+
case 'lipb':
|
|
274
|
+
return {lipbid: id};
|
|
275
|
+
case 'parrableId':
|
|
276
|
+
return {eid: id};
|
|
277
|
+
case 'id5id':
|
|
278
|
+
return {uid: id};
|
|
279
|
+
default:
|
|
280
|
+
return id;
|
|
281
|
+
}
|
|
282
|
+
})();
|
|
283
|
+
|
|
284
|
+
bid.userId = {
|
|
285
|
+
[idSystemProvider]: userId
|
|
286
|
+
};
|
|
287
|
+
|
|
288
|
+
it(`should include 'uid.${idSystemProvider}' in request params`, function () {
|
|
289
|
+
const requests = adapter.buildRequests([bid], BIDDER_REQUEST);
|
|
290
|
+
expect(requests[0].data[`uid.${idSystemProvider}`]).to.equal(id);
|
|
291
|
+
});
|
|
292
|
+
});
|
|
293
|
+
});
|
|
294
|
+
|
|
295
|
+
describe('alternate param names extractors', function () {
|
|
296
|
+
it('should return undefined when param not supported', function () {
|
|
297
|
+
const cid = extractCID({'c_id': '1'});
|
|
298
|
+
const pid = extractPID({'p_id': '1'});
|
|
299
|
+
const subDomain = extractSubDomain({'sub_domain': 'prebid'});
|
|
300
|
+
expect(cid).to.be.undefined;
|
|
301
|
+
expect(pid).to.be.undefined;
|
|
302
|
+
expect(subDomain).to.be.undefined;
|
|
303
|
+
});
|
|
304
|
+
|
|
305
|
+
it('should return value when param supported', function () {
|
|
306
|
+
const cid = extractCID({'cID': '1'});
|
|
307
|
+
const pid = extractPID({'Pid': '2'});
|
|
308
|
+
const subDomain = extractSubDomain({'subDOMAIN': 'prebid'});
|
|
309
|
+
expect(cid).to.be.equal('1');
|
|
310
|
+
expect(pid).to.be.equal('2');
|
|
311
|
+
expect(subDomain).to.be.equal('prebid');
|
|
312
|
+
});
|
|
313
|
+
});
|
|
314
|
+
|
|
315
|
+
describe('unique deal id', function () {
|
|
316
|
+
before(function () {
|
|
317
|
+
$$PREBID_GLOBAL$$.bidderSettings = {
|
|
318
|
+
kueezrtb: {
|
|
319
|
+
storageAllowed: true
|
|
320
|
+
}
|
|
321
|
+
};
|
|
322
|
+
});
|
|
323
|
+
after(function () {
|
|
324
|
+
$$PREBID_GLOBAL$$.bidderSettings = {};
|
|
325
|
+
});
|
|
326
|
+
const key = 'myKey';
|
|
327
|
+
let uniqueDealId;
|
|
328
|
+
beforeEach(() => {
|
|
329
|
+
uniqueDealId = getUniqueDealId(key, 0);
|
|
330
|
+
})
|
|
331
|
+
|
|
332
|
+
it('should get current unique deal id', function (done) {
|
|
333
|
+
// waiting some time so `now` will become past
|
|
334
|
+
setTimeout(() => {
|
|
335
|
+
const current = getUniqueDealId(key);
|
|
336
|
+
expect(current).to.be.equal(uniqueDealId);
|
|
337
|
+
done();
|
|
338
|
+
}, 200);
|
|
339
|
+
});
|
|
340
|
+
|
|
341
|
+
it('should get new unique deal id on expiration', function (done) {
|
|
342
|
+
setTimeout(() => {
|
|
343
|
+
const current = getUniqueDealId(key, 100);
|
|
344
|
+
expect(current).to.not.be.equal(uniqueDealId);
|
|
345
|
+
done();
|
|
346
|
+
}, 200)
|
|
347
|
+
});
|
|
348
|
+
});
|
|
349
|
+
|
|
350
|
+
describe('storage utils', function () {
|
|
351
|
+
before(function () {
|
|
352
|
+
$$PREBID_GLOBAL$$.bidderSettings = {
|
|
353
|
+
kueezrtb: {
|
|
354
|
+
storageAllowed: true
|
|
355
|
+
}
|
|
356
|
+
};
|
|
357
|
+
});
|
|
358
|
+
after(function () {
|
|
359
|
+
$$PREBID_GLOBAL$$.bidderSettings = {};
|
|
360
|
+
});
|
|
361
|
+
it('should get value from storage with create param', function () {
|
|
362
|
+
const now = Date.now();
|
|
363
|
+
const clock = useFakeTimers({
|
|
364
|
+
shouldAdvanceTime: true,
|
|
365
|
+
now
|
|
366
|
+
});
|
|
367
|
+
setStorageItem('myKey', 2020);
|
|
368
|
+
const {value, created} = getStorageItem('myKey');
|
|
369
|
+
expect(created).to.be.equal(now);
|
|
370
|
+
expect(value).to.be.equal(2020);
|
|
371
|
+
expect(typeof value).to.be.equal('number');
|
|
372
|
+
expect(typeof created).to.be.equal('number');
|
|
373
|
+
clock.restore();
|
|
374
|
+
});
|
|
375
|
+
|
|
376
|
+
it('should get external stored value', function () {
|
|
377
|
+
const value = 'superman'
|
|
378
|
+
window.localStorage.setItem('myExternalKey', value);
|
|
379
|
+
const item = getStorageItem('myExternalKey');
|
|
380
|
+
expect(item).to.be.equal(value);
|
|
381
|
+
});
|
|
382
|
+
|
|
383
|
+
it('should parse JSON value', function () {
|
|
384
|
+
const data = JSON.stringify({event: 'send'});
|
|
385
|
+
const {event} = tryParseJSON(data);
|
|
386
|
+
expect(event).to.be.equal('send');
|
|
387
|
+
});
|
|
388
|
+
|
|
389
|
+
it('should get original value on parse fail', function () {
|
|
390
|
+
const value = 21;
|
|
391
|
+
const parsed = tryParseJSON(value);
|
|
392
|
+
expect(typeof parsed).to.be.equal('number');
|
|
393
|
+
expect(parsed).to.be.equal(value);
|
|
394
|
+
});
|
|
395
|
+
});
|
|
396
|
+
});
|
|
@@ -602,6 +602,32 @@ describe('magnite analytics adapter', function () {
|
|
|
602
602
|
let message = JSON.parse(server.requests[0].requestBody);
|
|
603
603
|
expect(message.auctions[0].adUnits[0].bids[0].bidResponse.adomains).to.deep.equal(test.expected);
|
|
604
604
|
});
|
|
605
|
+
|
|
606
|
+
// Network Id tests
|
|
607
|
+
[
|
|
608
|
+
{ input: 'magnite.com', expected: 'magnite.com' },
|
|
609
|
+
{ input: 12345, expected: '12345' },
|
|
610
|
+
{ input: ['magnite.com', 12345], expected: 'magnite.com,12345' }
|
|
611
|
+
].forEach((test, index) => {
|
|
612
|
+
it(`should handle networkId correctly - #${index + 1}`, function () {
|
|
613
|
+
events.emit(AUCTION_INIT, MOCK.AUCTION_INIT);
|
|
614
|
+
events.emit(BID_REQUESTED, MOCK.BID_REQUESTED);
|
|
615
|
+
|
|
616
|
+
let bidResponse = utils.deepClone(MOCK.BID_RESPONSE);
|
|
617
|
+
bidResponse.meta = {
|
|
618
|
+
networkId: test.input
|
|
619
|
+
};
|
|
620
|
+
|
|
621
|
+
events.emit(BID_RESPONSE, bidResponse);
|
|
622
|
+
events.emit(BIDDER_DONE, MOCK.BIDDER_DONE);
|
|
623
|
+
events.emit(AUCTION_END, MOCK.AUCTION_END);
|
|
624
|
+
events.emit(BID_WON, MOCK.BID_WON);
|
|
625
|
+
clock.tick(rubiConf.analyticsBatchTimeout + 1000);
|
|
626
|
+
|
|
627
|
+
let message = JSON.parse(server.requests[0].requestBody);
|
|
628
|
+
expect(message.auctions[0].adUnits[0].bids[0].bidResponse.networkId).to.equal(test.expected);
|
|
629
|
+
});
|
|
630
|
+
});
|
|
605
631
|
});
|
|
606
632
|
|
|
607
633
|
describe('with session handling', function () {
|