prebid.js 7.12.0 → 7.13.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/.github/PULL_REQUEST_TEMPLATE.md +16 -10
- package/.github/codeql/codeql-config.yml +4 -0
- package/.github/workflows/codeql-analysis.yml +73 -0
- package/dist/33acrossBidAdapter.js +1 -1
- package/dist/acuityAdsBidAdapter.js +1 -0
- package/dist/adagioBidAdapter.js +1 -1
- package/dist/adbookpspBidAdapter.js +1 -1
- package/dist/adgenerationBidAdapter.js +1 -1
- 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/aolBidAdapter.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/beopBidAdapter.js +1 -1
- package/dist/bidglassBidAdapter.js +1 -1
- package/dist/big-richmediaBidAdapter.js +1 -1
- package/dist/bluebillywigBidAdapter.js +1 -1
- package/dist/brandmetricsRtdProvider.js +1 -1
- package/dist/bridgewellBidAdapter.js +1 -1
- package/dist/brightMountainMediaBidAdapter.js +1 -1
- package/dist/browsiRtdProvider.js +1 -1
- package/dist/cleanioRtdProvider.js +1 -1
- package/dist/concertBidAdapter.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/debugging-standalone.js +1 -1
- package/dist/dspxBidAdapter.js +1 -1
- package/dist/enrichmentFpdModule.js +1 -1
- package/dist/eplanningBidAdapter.js +1 -1
- package/dist/finativeBidAdapter.js +1 -1
- package/dist/glimpseBidAdapter.js +1 -1
- package/dist/gmosspBidAdapter.js +1 -1
- package/dist/goldbachBidAdapter.js +1 -1
- package/dist/gridBidAdapter.js +1 -1
- package/dist/gridNMBidAdapter.js +1 -1
- package/dist/gumgumBidAdapter.js +1 -1
- package/dist/h12mediaBidAdapter.js +1 -1
- package/dist/id5IdSystem.js +1 -1
- package/dist/imRtdProvider.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/ixBidAdapter.js +1 -1
- package/dist/jixieBidAdapter.js +1 -1
- package/dist/justpremiumBidAdapter.js +1 -1
- package/dist/konduitAnalyticsAdapter.js +1 -1
- package/dist/kueezBidAdapter.js +1 -1
- package/dist/lassoBidAdapter.js +1 -1
- package/dist/lifestreetBidAdapter.js +1 -0
- package/dist/limelightDigitalBidAdapter.js +1 -1
- package/dist/liveyieldAnalyticsAdapter.js +1 -1
- package/dist/logicadBidAdapter.js +1 -1
- package/dist/loglyliftBidAdapter.js +1 -1
- package/dist/mabidderBidAdapter.js +1 -0
- 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/minutemediaBidAdapter.js +1 -1
- package/dist/not-for-prod/prebid.js +132 -127
- package/dist/oguryBidAdapter.js +1 -1
- package/dist/oneKeyIdSystem.js +1 -0
- package/dist/oneKeyRtdProvider.js +1 -0
- package/dist/onetagBidAdapter.js +1 -1
- package/dist/ooloAnalyticsAdapter.js +1 -1
- package/dist/outbrainBidAdapter.js +1 -1
- package/dist/parrableIdSystem.js +1 -1
- package/dist/permutiveRtdProvider.js +1 -1
- package/dist/pixfutureBidAdapter.js +1 -1
- package/dist/prebid-core.js +2 -2
- 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/rtbhouseBidAdapter.js +1 -1
- package/dist/rubiconAnalyticsAdapter.js +1 -1
- package/dist/rubiconBidAdapter.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/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/trionBidAdapter.js +1 -1
- package/dist/tripleliftBidAdapter.js +1 -1
- package/dist/trustpidSystem.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/videobyteBidAdapter.js +1 -1
- package/dist/viewability.js +1 -1
- 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/modules/.submodules.json +2 -0
- package/modules/acuityAdsBidAdapter.js +207 -0
- package/modules/acuityAdsBidAdapter.md +79 -0
- package/modules/adgenerationBidAdapter.js +2 -2
- package/modules/adriverBidAdapter.js +1 -1
- package/modules/appnexusBidAdapter.js +13 -93
- package/modules/beopBidAdapter.js +4 -4
- package/modules/browsiRtdProvider.js +1 -1
- package/modules/consentManagement.js +1 -1
- package/modules/consentManagementUsp.js +1 -1
- package/modules/consumableBidAdapter.js +23 -1
- package/modules/currency.js +1 -0
- package/modules/datawrkzBidAdapter.js +13 -13
- package/modules/enrichmentFpdModule.js +11 -0
- package/modules/id5IdSystem.js +2 -2
- package/modules/imRtdProvider.js +20 -7
- package/modules/imRtdProvider.md +3 -1
- package/modules/insticatorBidAdapter.js +1 -1
- package/modules/ixBidAdapter.js +8 -22
- package/modules/ixBidAdapter.md +1 -19
- package/modules/lifestreetBidAdapter.js +143 -0
- package/modules/limelightDigitalBidAdapter.js +2 -1
- package/modules/mabidderBidAdapter.js +60 -0
- package/modules/mabidderBidAdapter.md +31 -0
- package/modules/oneKeyIdSystem.js +78 -0
- package/modules/oneKeyIdSystem.md +109 -0
- package/modules/oneKeyRtdProvider.js +98 -0
- package/modules/oneKeyRtdProvider.md +127 -0
- package/modules/permutiveRtdProvider.js +55 -8
- package/modules/pubmaticBidAdapter.js +14 -0
- package/modules/rtbhouseBidAdapter.js +24 -0
- package/modules/seedtagBidAdapter.md +25 -56
- package/modules/tripleliftBidAdapter.js +20 -1
- package/modules/trustpidSystem.js +6 -42
- package/modules/trustpidSystem.md +10 -10
- package/modules/userId/eids.js +26 -0
- package/modules/userId/userId.md +2 -2
- package/modules/viewability.js +14 -14
- package/modules/yahoosspBidAdapter.js +1 -1
- package/package.json +1 -1
- package/src/auction.js +2 -1
- package/src/native.js +22 -3
- package/src/sizeMapping.js +4 -6
- package/src/utils/promise.js +3 -1
- package/src/utils.js +27 -0
- package/src/video.js +5 -4
- package/test/pages/instream.html +2 -2
- package/test/spec/modules/acuityAdsBidAdapter_spec.js +398 -0
- package/test/spec/modules/appnexusBidAdapter_spec.js +1 -0
- package/test/spec/modules/beopBidAdapter_spec.js +11 -0
- package/test/spec/modules/big-richmediaBidAdapter_spec.js +1 -0
- package/test/spec/modules/consumableBidAdapter_spec.js +19 -0
- package/test/spec/modules/currency_spec.js +22 -0
- package/test/spec/modules/enrichmentFpdModule_spec.js +14 -0
- package/test/spec/modules/imRtdProvider_spec.js +10 -5
- package/test/spec/modules/ixBidAdapter_spec.js +6 -19
- package/test/spec/modules/lifestreetBidAdapter_spec.js +232 -0
- package/test/spec/modules/limelightDigitalBidAdapter_spec.js +59 -7
- package/test/spec/modules/mabidderBidAdapter_spec.js +125 -0
- package/test/spec/modules/oneKeyIdSystem_spec.js +107 -0
- package/test/spec/modules/oneKeyRtdProvider_spec.js +152 -0
- package/test/spec/modules/permutiveRtdProvider_spec.js +152 -2
- package/test/spec/modules/pubmaticBidAdapter_spec.js +16 -0
- package/test/spec/modules/tripleliftBidAdapter_spec.js +18 -0
- package/test/spec/modules/trustpidSystem_spec.js +27 -45
- package/test/spec/native_spec.js +17 -2
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import {oneKeyDataSubmodule} from 'modules/oneKeyRtdProvider.js';
|
|
2
|
+
import {getAdUnits} from '../../fixtures/fixtures.js';
|
|
3
|
+
|
|
4
|
+
const defaultSeed = {
|
|
5
|
+
version: '0.1',
|
|
6
|
+
transaction_ids: [
|
|
7
|
+
'd566b02a-a6e2-4c87-98dc-f5623cd9e828',
|
|
8
|
+
'f7ffe3cc-0d58-4ec4-b687-1d3d410a48fe'
|
|
9
|
+
],
|
|
10
|
+
publisher: 'cmp.pafdemopublisher.com',
|
|
11
|
+
source: {
|
|
12
|
+
domain: 'cmp.pafdemopublisher.com',
|
|
13
|
+
timestamp: 1657116880,
|
|
14
|
+
signature: '6OmdrSGwagPpugGFuQ4VGjzqYadHxWIXPaLItk0vA1lmi/EQyRvNF5seXStfwKWRnC7HZlOIGSjA6g7HAuofWw=='
|
|
15
|
+
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const defaultOrb2WithTransmission = {
|
|
20
|
+
user: {
|
|
21
|
+
ext: {
|
|
22
|
+
paf: {
|
|
23
|
+
transmission: {
|
|
24
|
+
seed: defaultSeed
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const defaultRtdConfig = {
|
|
32
|
+
params: {
|
|
33
|
+
proxyHostName: 'host'
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
describe('oneKeyDataSubmodule', () => {
|
|
38
|
+
var bidsConfig;
|
|
39
|
+
beforeEach(() => {
|
|
40
|
+
// Fresh bidsConfig because it can be altered
|
|
41
|
+
// during the tests.
|
|
42
|
+
bidsConfig = getReqBidsConfig();
|
|
43
|
+
setUpOneKey();
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it('successfully instantiates', () => {
|
|
47
|
+
expect(oneKeyDataSubmodule.init()).to.equal(true);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it('call OneKey API once it is loaded', () => {
|
|
51
|
+
const done = sinon.spy();
|
|
52
|
+
|
|
53
|
+
oneKeyDataSubmodule.getBidRequestData(bidsConfig, done, defaultRtdConfig);
|
|
54
|
+
|
|
55
|
+
expect(bidsConfig).to.eql(getReqBidsConfig());
|
|
56
|
+
expect(done.callCount).to.equal(0);
|
|
57
|
+
expect(window.OneKey.queue.length).to.equal(1);
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
it('don\'t change anything without a seed', () => {
|
|
61
|
+
window.OneKey.generateSeed = (_transactionIds) => {
|
|
62
|
+
return Promise.resolve(undefined);
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
// Act
|
|
66
|
+
return new Promise(resolve => {
|
|
67
|
+
oneKeyDataSubmodule.getBidRequestData(bidsConfig, resolve, defaultRtdConfig);
|
|
68
|
+
executeOneKeyQueue();
|
|
69
|
+
})
|
|
70
|
+
|
|
71
|
+
// Assert
|
|
72
|
+
.then(() => {
|
|
73
|
+
expect(bidsConfig).to.eql(getReqBidsConfig());
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
[ // Test cases
|
|
78
|
+
{
|
|
79
|
+
description: 'global orb2',
|
|
80
|
+
rtdConfig: defaultRtdConfig,
|
|
81
|
+
expectedFragment: {
|
|
82
|
+
global: {
|
|
83
|
+
...defaultOrb2WithTransmission
|
|
84
|
+
},
|
|
85
|
+
bidder: {}
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
|
|
89
|
+
{
|
|
90
|
+
description: 'bidder-specific orb2',
|
|
91
|
+
rtdConfig: {
|
|
92
|
+
params: {
|
|
93
|
+
proxyHostName: 'host',
|
|
94
|
+
bidders: [ 'bidder42', 'bidder24' ]
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
expectedFragment: {
|
|
98
|
+
global: { },
|
|
99
|
+
bidder: {
|
|
100
|
+
bidder42: {
|
|
101
|
+
...defaultOrb2WithTransmission
|
|
102
|
+
},
|
|
103
|
+
bidder24: {
|
|
104
|
+
...defaultOrb2WithTransmission
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
].forEach(testCase => {
|
|
110
|
+
it(`update adUnits with transaction-ids and transmission in ${testCase.description}`, () => {
|
|
111
|
+
// Act
|
|
112
|
+
return new Promise(resolve => {
|
|
113
|
+
oneKeyDataSubmodule.getBidRequestData(bidsConfig, resolve, testCase.rtdConfig);
|
|
114
|
+
executeOneKeyQueue();
|
|
115
|
+
})
|
|
116
|
+
|
|
117
|
+
// Assert
|
|
118
|
+
.then(() => {
|
|
119
|
+
// Verify transaction-ids without equality
|
|
120
|
+
// because they are generated UUID.
|
|
121
|
+
bidsConfig.adUnits.forEach((adUnit) => {
|
|
122
|
+
expect(adUnit.ortb2Imp.ext.data.paf.transaction_id).to.not.be.undefined;
|
|
123
|
+
});
|
|
124
|
+
expect(bidsConfig.ortb2Fragments).to.eql(testCase.expectedFragment);
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
const getReqBidsConfig = () => {
|
|
131
|
+
return {
|
|
132
|
+
adUnits: getAdUnits(),
|
|
133
|
+
ortb2Fragments: {
|
|
134
|
+
global: {},
|
|
135
|
+
bidder: {}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const setUpOneKey = () => {
|
|
141
|
+
window.OneKey.queue = [];
|
|
142
|
+
OneKey.generateSeed = (_transactionIds) => {
|
|
143
|
+
return Promise.resolve(defaultSeed);
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
const executeOneKeyQueue = () => {
|
|
148
|
+
while (window.OneKey.queue.length > 0) {
|
|
149
|
+
window.OneKey.queue[0]();
|
|
150
|
+
window.OneKey.queue.shift();
|
|
151
|
+
}
|
|
152
|
+
}
|
|
@@ -5,9 +5,11 @@ import {
|
|
|
5
5
|
initSegments,
|
|
6
6
|
isAcEnabled,
|
|
7
7
|
isPermutiveOnPage,
|
|
8
|
-
setBidderRtb
|
|
8
|
+
setBidderRtb,
|
|
9
|
+
getModuleConfig,
|
|
10
|
+
PERMUTIVE_SUBMODULE_CONFIG_KEY,
|
|
9
11
|
} from 'modules/permutiveRtdProvider.js'
|
|
10
|
-
import { deepAccess } from '../../../src/utils.js'
|
|
12
|
+
import { deepAccess, deepSetValue, mergeDeep } from '../../../src/utils.js'
|
|
11
13
|
import { config } from 'src/config.js'
|
|
12
14
|
|
|
13
15
|
describe('permutiveRtdProvider', function () {
|
|
@@ -29,6 +31,154 @@ describe('permutiveRtdProvider', function () {
|
|
|
29
31
|
})
|
|
30
32
|
})
|
|
31
33
|
|
|
34
|
+
describe('getModuleConfig', function () {
|
|
35
|
+
beforeEach(function () {
|
|
36
|
+
// Reads data from the cache
|
|
37
|
+
permutiveSubmodule.init()
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
const liftToParams = (params) => ({ params })
|
|
41
|
+
|
|
42
|
+
const getDefaultConfig = () => ({
|
|
43
|
+
waitForIt: false,
|
|
44
|
+
params: {
|
|
45
|
+
maxSegs: 500,
|
|
46
|
+
acBidders: [],
|
|
47
|
+
overwrites: {},
|
|
48
|
+
},
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
const storeConfigInCacheAndInit = (data) => {
|
|
52
|
+
const dataToStore = { [PERMUTIVE_SUBMODULE_CONFIG_KEY]: data }
|
|
53
|
+
setLocalStorage(dataToStore)
|
|
54
|
+
// Reads data from the cache
|
|
55
|
+
permutiveSubmodule.init()
|
|
56
|
+
|
|
57
|
+
// Cleanup
|
|
58
|
+
return () => removeLocalStorage(dataToStore)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const setWindowPermutivePrebid = (getPermutiveRtdConfig) => {
|
|
62
|
+
// Read from Permutive
|
|
63
|
+
const backup = window.permutive
|
|
64
|
+
|
|
65
|
+
deepSetValue(window, 'permutive.addons.prebid', {
|
|
66
|
+
getPermutiveRtdConfig,
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
// Cleanup
|
|
70
|
+
return () => window.permutive = backup
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
it('should return default values', function () {
|
|
74
|
+
const config = getModuleConfig({})
|
|
75
|
+
expect(config).to.deep.equal(getDefaultConfig())
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
it('should override deeply on custom config', function () {
|
|
79
|
+
const defaultConfig = getDefaultConfig()
|
|
80
|
+
|
|
81
|
+
const customModuleConfig = { waitForIt: true, params: { acBidders: ['123'] } }
|
|
82
|
+
const config = getModuleConfig(customModuleConfig)
|
|
83
|
+
|
|
84
|
+
expect(config).to.deep.equal(mergeDeep(defaultConfig, customModuleConfig))
|
|
85
|
+
})
|
|
86
|
+
|
|
87
|
+
it('should override deeply on cached config', function () {
|
|
88
|
+
const defaultConfig = getDefaultConfig()
|
|
89
|
+
|
|
90
|
+
const cachedParamsConfig = { acBidders: ['123'] }
|
|
91
|
+
const cleanupCache = storeConfigInCacheAndInit(cachedParamsConfig)
|
|
92
|
+
|
|
93
|
+
const config = getModuleConfig({})
|
|
94
|
+
|
|
95
|
+
expect(config).to.deep.equal(mergeDeep(defaultConfig, liftToParams(cachedParamsConfig)))
|
|
96
|
+
|
|
97
|
+
// Cleanup
|
|
98
|
+
cleanupCache()
|
|
99
|
+
})
|
|
100
|
+
|
|
101
|
+
it('should override deeply on Permutive Rtd config', function () {
|
|
102
|
+
const defaultConfig = getDefaultConfig()
|
|
103
|
+
|
|
104
|
+
const permutiveRtdConfigParams = { acBidders: ['123'], overwrites: { '123': true } }
|
|
105
|
+
const cleanupPermutive = setWindowPermutivePrebid(function () {
|
|
106
|
+
return permutiveRtdConfigParams
|
|
107
|
+
})
|
|
108
|
+
|
|
109
|
+
const config = getModuleConfig({})
|
|
110
|
+
|
|
111
|
+
expect(config).to.deep.equal(mergeDeep(defaultConfig, liftToParams(permutiveRtdConfigParams)))
|
|
112
|
+
|
|
113
|
+
// Cleanup
|
|
114
|
+
cleanupPermutive()
|
|
115
|
+
})
|
|
116
|
+
|
|
117
|
+
it('should NOT use cached Permutive Rtd config if window.permutive is available', function () {
|
|
118
|
+
const defaultConfig = getDefaultConfig()
|
|
119
|
+
|
|
120
|
+
// As Permutive is available on the window object, this value won't be used.
|
|
121
|
+
const cachedParamsConfig = { acBidders: ['123'] }
|
|
122
|
+
const cleanupCache = storeConfigInCacheAndInit(cachedParamsConfig)
|
|
123
|
+
|
|
124
|
+
const permutiveRtdConfigParams = { acBidders: ['456'], overwrites: { '123': true } }
|
|
125
|
+
const cleanupPermutive = setWindowPermutivePrebid(function () {
|
|
126
|
+
return permutiveRtdConfigParams
|
|
127
|
+
})
|
|
128
|
+
|
|
129
|
+
const config = getModuleConfig({})
|
|
130
|
+
|
|
131
|
+
expect(config).to.deep.equal(mergeDeep(defaultConfig, liftToParams(permutiveRtdConfigParams)))
|
|
132
|
+
|
|
133
|
+
// Cleanup
|
|
134
|
+
cleanupCache()
|
|
135
|
+
cleanupPermutive()
|
|
136
|
+
})
|
|
137
|
+
|
|
138
|
+
it('should handle calling Permutive method throwing error', function () {
|
|
139
|
+
const defaultConfig = getDefaultConfig()
|
|
140
|
+
|
|
141
|
+
const cleanupPermutive = setWindowPermutivePrebid(function () {
|
|
142
|
+
throw new Error()
|
|
143
|
+
})
|
|
144
|
+
|
|
145
|
+
const config = getModuleConfig({})
|
|
146
|
+
|
|
147
|
+
expect(config).to.deep.equal(defaultConfig)
|
|
148
|
+
|
|
149
|
+
// Cleanup
|
|
150
|
+
cleanupPermutive()
|
|
151
|
+
})
|
|
152
|
+
|
|
153
|
+
it('should override deeply in priority order', function () {
|
|
154
|
+
const defaultConfig = getDefaultConfig()
|
|
155
|
+
|
|
156
|
+
// As Permutive is available on the window object, this value won't be used.
|
|
157
|
+
const cachedConfig = { acBidders: ['123'] }
|
|
158
|
+
const cleanupCache = storeConfigInCacheAndInit(cachedConfig)
|
|
159
|
+
|
|
160
|
+
// Read from Permutive
|
|
161
|
+
const permutiveRtdConfig = { acBidders: ['456'] }
|
|
162
|
+
const cleanupPermutive = setWindowPermutivePrebid(function () {
|
|
163
|
+
return permutiveRtdConfig
|
|
164
|
+
})
|
|
165
|
+
|
|
166
|
+
const customModuleConfig = { params: { acBidders: ['789'], maxSegs: 499 } }
|
|
167
|
+
const config = getModuleConfig(customModuleConfig)
|
|
168
|
+
|
|
169
|
+
// The configs are in reverse priority order as configs are merged left to right. So the priority is,
|
|
170
|
+
// 1. customModuleConfig <- set by publisher with pbjs.setConfig
|
|
171
|
+
// 2. permutiveRtdConfig <- set by the publisher using Permutive.
|
|
172
|
+
// 3. defaultConfig
|
|
173
|
+
const configMergedInPriorityOrder = mergeDeep(defaultConfig, liftToParams(permutiveRtdConfig), customModuleConfig)
|
|
174
|
+
expect(config).to.deep.equal(configMergedInPriorityOrder)
|
|
175
|
+
|
|
176
|
+
// Cleanup
|
|
177
|
+
cleanupCache()
|
|
178
|
+
cleanupPermutive()
|
|
179
|
+
})
|
|
180
|
+
})
|
|
181
|
+
|
|
32
182
|
describe('ortb2 config', function () {
|
|
33
183
|
beforeEach(function () {
|
|
34
184
|
config.resetConfig()
|
|
@@ -1103,8 +1103,24 @@ describe('PubMatic adapter', function () {
|
|
|
1103
1103
|
expect(data.imp[0].ext.key_val).to.exist.and.to.equal(bidRequests[0].params.dctr);
|
|
1104
1104
|
expect(data.imp[0].bidfloorcur).to.equal(bidRequests[0].params.currency);
|
|
1105
1105
|
expect(data.source.ext.schain).to.deep.equal(bidRequests[0].schain);
|
|
1106
|
+
expect(data.ext.epoch).to.exist;
|
|
1106
1107
|
});
|
|
1107
1108
|
|
|
1109
|
+
it('Set tmax from global config if not set by requestBids method', function() {
|
|
1110
|
+
let sandbox = sinon.sandbox.create();
|
|
1111
|
+
sandbox.stub(config, 'getConfig').callsFake((key) => {
|
|
1112
|
+
var config = {
|
|
1113
|
+
bidderTimeout: 3000
|
|
1114
|
+
};
|
|
1115
|
+
return config[key];
|
|
1116
|
+
});
|
|
1117
|
+
let request = spec.buildRequests(bidRequests, {
|
|
1118
|
+
auctionId: 'new-auction-id', timeout: 3000
|
|
1119
|
+
});
|
|
1120
|
+
let data = JSON.parse(request.data);
|
|
1121
|
+
expect(data.tmax).to.deep.equal(3000);
|
|
1122
|
+
sandbox.restore();
|
|
1123
|
+
});
|
|
1108
1124
|
describe('Marketplace parameters', function() {
|
|
1109
1125
|
let bidderSettingStub;
|
|
1110
1126
|
beforeEach(function() {
|
|
@@ -714,6 +714,24 @@ describe('triplelift adapter', function () {
|
|
|
714
714
|
expect(payload.user).to.deep.equal({ext: {eids: [{source: 'criteo.com', uids: [{id, ext: {rtiPartner: 'criteoId'}}]}]}});
|
|
715
715
|
});
|
|
716
716
|
|
|
717
|
+
it('should add adqueryId to the payload if included', function () {
|
|
718
|
+
const id = '%7B%22qid%22%3A%229c985f8cc31d9b3c000d%22%7D';
|
|
719
|
+
bidRequests[0].userIdAsEids = [{ source: 'adquery.io', uids: [{ id }] }];
|
|
720
|
+
const request = tripleliftAdapterSpec.buildRequests(bidRequests, bidderRequest);
|
|
721
|
+
const payload = request.data;
|
|
722
|
+
expect(payload).to.exist;
|
|
723
|
+
expect(payload.user).to.deep.equal({ext: {eids: [{source: 'adquery.io', uids: [{id, ext: {rtiPartner: 'adquery.io'}}]}]}});
|
|
724
|
+
});
|
|
725
|
+
|
|
726
|
+
it('should add amxRtbId to the payload if included', function () {
|
|
727
|
+
const id = 'Ok9JQkBM-UFlAXEZQ-UUNBQlZOQzgrUFhW-UUNBQkRQTUBPQVpVWVxNXlZUUF9AUFhAUF9PXFY/';
|
|
728
|
+
bidRequests[0].userIdAsEids = [{ source: 'amxrtb.com', uids: [{ id }] }];
|
|
729
|
+
const request = tripleliftAdapterSpec.buildRequests(bidRequests, bidderRequest);
|
|
730
|
+
const payload = request.data;
|
|
731
|
+
expect(payload).to.exist;
|
|
732
|
+
expect(payload.user).to.deep.equal({ext: {eids: [{source: 'amxrtb.com', uids: [{id, ext: {rtiPartner: 'amxrtb.com'}}]}]}});
|
|
733
|
+
});
|
|
734
|
+
|
|
717
735
|
it('should add tdid, idl_env and criteoId to the payload if both are included', function () {
|
|
718
736
|
const tdidId = '6bca7f6b-a98a-46c0-be05-6020f7604598';
|
|
719
737
|
const idlEnvId = 'XY6104gr0njcH9UDIR7ysFFJcm2XNpqeJTYslleJ_cMlsFOfZI';
|
|
@@ -22,14 +22,6 @@ describe('trustpid System', () => {
|
|
|
22
22
|
});
|
|
23
23
|
|
|
24
24
|
describe('trustpid getId()', () => {
|
|
25
|
-
before(() => {
|
|
26
|
-
window.FC_CONF = {
|
|
27
|
-
TELCO_ACRONYM: {
|
|
28
|
-
'domain.with.acronym': 'acronymValue',
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
});
|
|
32
|
-
|
|
33
25
|
afterEach(() => {
|
|
34
26
|
storage.removeDataFromLocalStorage(connectDataKey);
|
|
35
27
|
storage.removeDataFromLocalStorage(connectDomainKey);
|
|
@@ -52,7 +44,7 @@ describe('trustpid System', () => {
|
|
|
52
44
|
it('tests if localstorage & JSON works properly ', () => {
|
|
53
45
|
const idGraph = {
|
|
54
46
|
'domain': 'domainValue',
|
|
55
|
-
'
|
|
47
|
+
'atid': 'atidValue',
|
|
56
48
|
};
|
|
57
49
|
storage.setDataInLocalStorage(connectDataKey, JSON.stringify(getStorageData(idGraph)));
|
|
58
50
|
expect(JSON.parse(storage.getDataFromLocalStorage(connectDataKey))).to.have.property('connectId');
|
|
@@ -61,7 +53,7 @@ describe('trustpid System', () => {
|
|
|
61
53
|
it('returns {callback: func} if domains don\'t match', () => {
|
|
62
54
|
const idGraph = {
|
|
63
55
|
'domain': 'domainValue',
|
|
64
|
-
'
|
|
56
|
+
'atid': 'atidValue',
|
|
65
57
|
};
|
|
66
58
|
storage.setDataInLocalStorage(connectDomainKey, JSON.stringify('differentDomainValue'));
|
|
67
59
|
storage.setDataInLocalStorage(connectDataKey, JSON.stringify(getStorageData(idGraph)));
|
|
@@ -70,33 +62,33 @@ describe('trustpid System', () => {
|
|
|
70
62
|
|
|
71
63
|
it('returns {id: {trustpid: data.trustpid}} if we have the right data stored in the localstorage ', () => {
|
|
72
64
|
const idGraph = {
|
|
73
|
-
'domain': 'domain
|
|
74
|
-
'
|
|
65
|
+
'domain': 'test.domain',
|
|
66
|
+
'atid': 'atidValue',
|
|
75
67
|
};
|
|
76
|
-
storage.setDataInLocalStorage(connectDomainKey, JSON.stringify('domain
|
|
68
|
+
storage.setDataInLocalStorage(connectDomainKey, JSON.stringify('test.domain'));
|
|
77
69
|
storage.setDataInLocalStorage(connectDataKey, JSON.stringify(getStorageData(idGraph)));
|
|
78
70
|
const response = trustpidSubmodule.getId();
|
|
79
71
|
expect(response).to.have.property('id');
|
|
80
72
|
expect(response.id).to.have.property('trustpid');
|
|
81
|
-
expect(response.id.trustpid).to.be.equal('
|
|
73
|
+
expect(response.id.trustpid).to.be.equal('atidValue');
|
|
82
74
|
});
|
|
83
75
|
|
|
84
76
|
it('returns {trustpid: data.trustpid} if we have the right data stored in the localstorage right after the callback is called', (done) => {
|
|
85
77
|
const idGraph = {
|
|
86
|
-
'domain': 'domain
|
|
87
|
-
'
|
|
78
|
+
'domain': 'test.domain',
|
|
79
|
+
'atid': 'atidValue',
|
|
88
80
|
};
|
|
89
81
|
const response = trustpidSubmodule.getId();
|
|
90
82
|
expect(response).to.have.property('callback');
|
|
91
83
|
expect(response.callback.toString()).contain('result(callback)');
|
|
92
84
|
|
|
93
85
|
if (typeof response.callback === 'function') {
|
|
94
|
-
storage.setDataInLocalStorage(connectDomainKey, JSON.stringify('domain
|
|
86
|
+
storage.setDataInLocalStorage(connectDomainKey, JSON.stringify('test.domain'));
|
|
95
87
|
storage.setDataInLocalStorage(connectDataKey, JSON.stringify(getStorageData(idGraph)));
|
|
96
88
|
response.callback(function (result) {
|
|
97
89
|
expect(result).to.not.be.null;
|
|
98
90
|
expect(result).to.have.property('trustpid');
|
|
99
|
-
expect(result.trustpid).to.be.equal('
|
|
91
|
+
expect(result.trustpid).to.be.equal('atidValue');
|
|
100
92
|
done()
|
|
101
93
|
})
|
|
102
94
|
}
|
|
@@ -104,8 +96,8 @@ describe('trustpid System', () => {
|
|
|
104
96
|
|
|
105
97
|
it('returns null if domains don\'t match', (done) => {
|
|
106
98
|
const idGraph = {
|
|
107
|
-
'domain': 'domain
|
|
108
|
-
'
|
|
99
|
+
'domain': 'test.domain',
|
|
100
|
+
'atid': 'atidValue',
|
|
109
101
|
};
|
|
110
102
|
storage.setDataInLocalStorage(connectDomainKey, JSON.stringify('differentDomainValue'));
|
|
111
103
|
storage.setDataInLocalStorage(connectDataKey, JSON.stringify(getStorageData(idGraph)));
|
|
@@ -127,8 +119,8 @@ describe('trustpid System', () => {
|
|
|
127
119
|
|
|
128
120
|
it('returns {trustpid: data.trustpid} if we have the right data stored in the localstorage right after 500ms delay', (done) => {
|
|
129
121
|
const idGraph = {
|
|
130
|
-
'domain': 'domain
|
|
131
|
-
'
|
|
122
|
+
'domain': 'test.domain',
|
|
123
|
+
'atid': 'atidValue',
|
|
132
124
|
};
|
|
133
125
|
|
|
134
126
|
const response = trustpidSubmodule.getId();
|
|
@@ -137,13 +129,13 @@ describe('trustpid System', () => {
|
|
|
137
129
|
|
|
138
130
|
if (typeof response.callback === 'function') {
|
|
139
131
|
setTimeout(() => {
|
|
140
|
-
storage.setDataInLocalStorage(connectDomainKey, JSON.stringify('domain
|
|
132
|
+
storage.setDataInLocalStorage(connectDomainKey, JSON.stringify('test.domain'));
|
|
141
133
|
storage.setDataInLocalStorage(connectDataKey, JSON.stringify(getStorageData(idGraph)));
|
|
142
134
|
}, 500);
|
|
143
135
|
response.callback(function (result) {
|
|
144
136
|
expect(result).to.not.be.null;
|
|
145
137
|
expect(result).to.have.property('trustpid');
|
|
146
|
-
expect(result.trustpid).to.be.equal('
|
|
138
|
+
expect(result.trustpid).to.be.equal('atidValue');
|
|
147
139
|
done()
|
|
148
140
|
})
|
|
149
141
|
}
|
|
@@ -151,8 +143,8 @@ describe('trustpid System', () => {
|
|
|
151
143
|
|
|
152
144
|
it('returns null if we have the data stored in the localstorage after 500ms delay and the max (waiting) delay is only 200ms ', (done) => {
|
|
153
145
|
const idGraph = {
|
|
154
|
-
'domain': 'domain
|
|
155
|
-
'
|
|
146
|
+
'domain': 'test.domain',
|
|
147
|
+
'atid': 'atidValue',
|
|
156
148
|
};
|
|
157
149
|
|
|
158
150
|
const response = trustpidSubmodule.getId({params: {maxDelayTime: 200}});
|
|
@@ -161,7 +153,7 @@ describe('trustpid System', () => {
|
|
|
161
153
|
|
|
162
154
|
if (typeof response.callback === 'function') {
|
|
163
155
|
setTimeout(() => {
|
|
164
|
-
storage.setDataInLocalStorage(connectDomainKey, JSON.stringify('domain
|
|
156
|
+
storage.setDataInLocalStorage(connectDomainKey, JSON.stringify('test.domain'));
|
|
165
157
|
storage.setDataInLocalStorage(connectDataKey, JSON.stringify(getStorageData(idGraph)));
|
|
166
158
|
}, 500);
|
|
167
159
|
response.callback(function (result) {
|
|
@@ -202,17 +194,7 @@ describe('trustpid System', () => {
|
|
|
202
194
|
});
|
|
203
195
|
});
|
|
204
196
|
|
|
205
|
-
describe('trustpid messageHandler
|
|
206
|
-
before(() => {
|
|
207
|
-
window.FC_CONF = {
|
|
208
|
-
TELCO_ACRONYM: {
|
|
209
|
-
'domain1': 'abcd',
|
|
210
|
-
'domain2': 'efgh',
|
|
211
|
-
'domain3': 'ijkl',
|
|
212
|
-
}
|
|
213
|
-
};
|
|
214
|
-
});
|
|
215
|
-
|
|
197
|
+
describe('trustpid messageHandler', () => {
|
|
216
198
|
afterEach(() => {
|
|
217
199
|
storage.removeDataFromLocalStorage(connectDataKey);
|
|
218
200
|
storage.removeDataFromLocalStorage(connectDomainKey);
|
|
@@ -223,16 +205,16 @@ describe('trustpid System', () => {
|
|
|
223
205
|
})
|
|
224
206
|
|
|
225
207
|
const domains = [
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
208
|
+
'domain1',
|
|
209
|
+
'domain2',
|
|
210
|
+
'domain3',
|
|
229
211
|
];
|
|
230
212
|
|
|
231
|
-
domains.forEach(
|
|
232
|
-
it(`correctly sets trustpid value
|
|
213
|
+
domains.forEach(domain => {
|
|
214
|
+
it(`correctly sets trustpid value for domain name ${domain}`, (done) => {
|
|
233
215
|
const idGraph = {
|
|
234
216
|
'domain': domain,
|
|
235
|
-
'
|
|
217
|
+
'atid': 'atidValue',
|
|
236
218
|
};
|
|
237
219
|
|
|
238
220
|
storage.setDataInLocalStorage(connectDomainKey, JSON.stringify(domain));
|
|
@@ -247,7 +229,7 @@ describe('trustpid System', () => {
|
|
|
247
229
|
const response = trustpidSubmodule.getId();
|
|
248
230
|
expect(response).to.have.property('id');
|
|
249
231
|
expect(response.id).to.have.property('trustpid');
|
|
250
|
-
expect(response.id.trustpid).to.be.equal(
|
|
232
|
+
expect(response.id.trustpid).to.be.equal('atidValue');
|
|
251
233
|
done();
|
|
252
234
|
});
|
|
253
235
|
});
|
package/test/spec/native_spec.js
CHANGED
|
@@ -1212,8 +1212,8 @@ describe('fireClickTrackers', () => {
|
|
|
1212
1212
|
fetchURL = sinon.stub();
|
|
1213
1213
|
});
|
|
1214
1214
|
|
|
1215
|
-
function runTrackers(resp) {
|
|
1216
|
-
fireClickTrackers(resp, {fetchURL});
|
|
1215
|
+
function runTrackers(resp, assetId = null) {
|
|
1216
|
+
fireClickTrackers(resp, assetId, {fetchURL});
|
|
1217
1217
|
}
|
|
1218
1218
|
|
|
1219
1219
|
it('should load each URL in link.clicktrackers', () => {
|
|
@@ -1225,6 +1225,21 @@ describe('fireClickTrackers', () => {
|
|
|
1225
1225
|
});
|
|
1226
1226
|
urls.forEach(url => sinon.assert.calledWith(fetchURL, url));
|
|
1227
1227
|
})
|
|
1228
|
+
|
|
1229
|
+
it('should load each URL in asset.link.clicktrackers, when response is ORTB', () => {
|
|
1230
|
+
const urls = ['asset_url1', 'asset_url2'];
|
|
1231
|
+
runTrackers({
|
|
1232
|
+
assets: [
|
|
1233
|
+
{
|
|
1234
|
+
id: 1,
|
|
1235
|
+
link: {
|
|
1236
|
+
clicktrackers: urls
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
1239
|
+
],
|
|
1240
|
+
}, 1);
|
|
1241
|
+
urls.forEach(url => sinon.assert.calledWith(fetchURL, url));
|
|
1242
|
+
})
|
|
1228
1243
|
})
|
|
1229
1244
|
|
|
1230
1245
|
describe('toOrtbNativeResponse', () => {
|