prebid.js 7.50.0 → 7.52.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/33acrossIdSystem.js +1 -1
- package/dist/adagioBidAdapter.js +1 -1
- package/dist/adbookpspBidAdapter.js +1 -1
- package/dist/adgenerationBidAdapter.js +1 -1
- package/dist/adhashBidAdapter.js +1 -1
- package/dist/adkernelBidAdapter.js +1 -1
- package/dist/admanBidAdapter.js +1 -1
- package/dist/adnuntiusBidAdapter.js +1 -1
- package/dist/adqueryBidAdapter.js +1 -1
- package/dist/adrelevantisBidAdapter.js +1 -1
- package/dist/adrinoBidAdapter.js +1 -1
- package/dist/adriverIdSystem.js +1 -1
- package/dist/adtelligentBidAdapter.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/allowActivities.js +1 -0
- package/dist/amxBidAdapter.js +1 -1
- package/dist/amxIdSystem.js +1 -1
- package/dist/appierAnalyticsAdapter.js +1 -1
- package/dist/appnexusBidAdapter.js +1 -1
- package/dist/asoBidAdapter.js +1 -1
- package/dist/axonixBidAdapter.js +1 -1
- package/dist/bidglassBidAdapter.js +1 -1
- package/dist/big-richmediaBidAdapter.js +1 -1
- package/dist/bridgewellBidAdapter.js +1 -1
- package/dist/brightMountainMediaBidAdapter.js +1 -1
- package/dist/carodaBidAdapter.js +1 -1
- package/dist/chtnwBidAdapter.js +1 -1
- 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/consumableBidAdapter.js +1 -1
- package/dist/conversantAnalyticsAdapter.js +1 -1
- package/dist/conversantBidAdapter.js +1 -1
- package/dist/craftBidAdapter.js +1 -1
- package/dist/criteoBidAdapter.js +1 -1
- package/dist/cwireBidAdapter.js +1 -1
- package/dist/dependencies.json +6 -0
- package/dist/dspxBidAdapter.js +1 -1
- package/dist/eplanningBidAdapter.js +1 -1
- package/dist/feedadBidAdapter.js +1 -1
- package/dist/finativeBidAdapter.js +1 -1
- package/dist/freewheel-sspBidAdapter.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/greenbidsAnalyticsAdapter.js +1 -1
- package/dist/greenbidsRtdProvider.js +1 -1
- package/dist/gridBidAdapter.js +1 -1
- package/dist/growthCodeRtdProvider.js +1 -0
- package/dist/gumgumBidAdapter.js +1 -1
- package/dist/h12mediaBidAdapter.js +1 -1
- package/dist/id5IdSystem.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/justpremiumBidAdapter.js +1 -1
- package/dist/kargoBidAdapter.js +1 -1
- package/dist/konduitAnalyticsAdapter.js +1 -1
- package/dist/kueezBidAdapter.js +1 -1
- package/dist/kueezRtbBidAdapter.js +1 -1
- package/dist/kulturemediaBidAdapter.js +1 -1
- 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/mediasquareBidAdapter.js +1 -1
- package/dist/mgidBidAdapter.js +1 -1
- package/dist/minutemediaBidAdapter.js +1 -1
- package/dist/minutemediaplusBidAdapter.js +1 -1
- package/dist/nexx360BidAdapter.js +1 -1
- package/dist/not-for-prod/prebid.js +144 -140
- package/dist/objectGuard.js +1 -0
- package/dist/oguryBidAdapter.js +1 -1
- package/dist/onetagBidAdapter.js +1 -1
- package/dist/ooloAnalyticsAdapter.js +1 -1
- package/dist/optidigitalBidAdapter.js +1 -1
- package/dist/outbrainBidAdapter.js +1 -1
- package/dist/oxxionAnalyticsAdapter.js +1 -0
- package/dist/pairIdSystem.js +1 -1
- package/dist/parrableIdSystem.js +1 -1
- package/dist/pixfutureBidAdapter.js +1 -1
- package/dist/prebid-core.js +1 -1
- package/dist/prebidServerBidAdapter.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/retailspotBidAdapter.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/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/stvBidAdapter.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/ttdBidAdapter.js +1 -1
- package/dist/ucfunnelAnalyticsAdapter.js +1 -1
- package/dist/uid2IdSystem.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/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/dist/zeta_global_sspBidAdapter.js +1 -1
- package/integrationExamples/gpt/growthcode.html +20 -9
- package/libraries/objectGuard/objectGuard.js +108 -0
- package/libraries/objectGuard/ortbGuard.js +88 -0
- package/modules/adgenerationBidAdapter.js +14 -5
- package/modules/adhashBidAdapter.js +28 -17
- package/modules/adkernelBidAdapter.js +2 -1
- package/modules/admanBidAdapter.js +30 -22
- package/modules/adnuntiusBidAdapter.js +98 -79
- package/modules/adnuntiusBidAdapter.md +2 -1
- package/modules/adqueryBidAdapter.js +7 -1
- package/modules/adrinoBidAdapter.js +1 -0
- package/modules/adriverIdSystem.js +1 -1
- package/modules/adtelligentBidAdapter.js +4 -2
- package/modules/allowActivities.js +74 -0
- package/modules/appnexusBidAdapter.js +1 -0
- package/modules/cleanioRtdProvider.js +2 -4
- package/modules/connectIdSystem.js +89 -13
- package/modules/connectIdSystem.md +4 -7
- package/modules/criteoBidAdapter.js +50 -3
- package/modules/freewheel-sspBidAdapter.js +10 -2
- package/modules/gdprEnforcement.js +98 -169
- package/modules/growthCodeRtdProvider.js +131 -0
- package/modules/growthCodeRtdProvider.md +55 -0
- package/modules/gumgumBidAdapter.js +5 -0
- package/modules/ixBidAdapter.js +5 -2
- package/modules/minutemediaBidAdapter.js +13 -3
- package/modules/oxxionAnalyticsAdapter.js +212 -0
- package/modules/oxxionAnalyticsAdapter.md +33 -0
- package/modules/pairIdSystem.js +6 -6
- package/modules/prebidServerBidAdapter/index.js +7 -8
- package/modules/pubmaticBidAdapter.js +1 -0
- package/modules/riseBidAdapter.js +13 -3
- package/modules/rtbhouseBidAdapter.md +24 -0
- package/modules/rtdModule/index.js +12 -1
- package/modules/sharethroughBidAdapter.js +2 -2
- package/modules/smartadserverBidAdapter.js +5 -0
- package/modules/stvBidAdapter.js +34 -1
- package/modules/undertoneBidAdapter.js +9 -1
- package/modules/userId/index.js +69 -41
- package/modules/yahoosspBidAdapter.js +45 -3
- package/modules/yahoosspBidAdapter.md +1 -1
- package/modules/zeta_global_sspBidAdapter.js +1 -0
- package/package.json +1 -1
- package/src/activities/activities.js +47 -0
- package/src/activities/activityParams.js +8 -0
- package/src/activities/modules.js +1 -1
- package/src/activities/params.js +59 -0
- package/src/activities/redactor.js +157 -0
- package/src/activities/rules.js +95 -0
- package/src/adapterManager.js +45 -8
- package/src/adloader.js +2 -1
- package/src/fpd/rootDomain.js +1 -1
- package/src/native.js +20 -4
- package/src/prebid.js +1 -1
- package/src/storageManager.js +57 -44
- package/src/userSync.js +35 -18
- package/test/spec/activities/allowActivites_spec.js +138 -0
- package/test/spec/activities/objectGuard_spec.js +144 -0
- package/test/spec/activities/ortbGuard_spec.js +140 -0
- package/test/spec/activities/params_spec.js +25 -0
- package/test/spec/activities/redactor_spec.js +296 -0
- package/test/spec/activities/rules_spec.js +135 -0
- package/test/spec/modules/adgenerationBidAdapter_spec.js +52 -12
- package/test/spec/modules/adhashBidAdapter_spec.js +51 -1
- package/test/spec/modules/admanBidAdapter_spec.js +1 -2
- package/test/spec/modules/adnuntiusBidAdapter_spec.js +535 -264
- package/test/spec/modules/adqueryBidAdapter_spec.js +9 -0
- package/test/spec/modules/adrinoBidAdapter_spec.js +4 -0
- package/test/spec/modules/adtelligentBidAdapter_spec.js +1 -0
- package/test/spec/modules/cleanioRtdProvider_spec.js +7 -8
- package/test/spec/modules/connectIdSystem_spec.js +291 -23
- package/test/spec/modules/criteoBidAdapter_spec.js +134 -2
- package/test/spec/modules/freewheel-sspBidAdapter_spec.js +5 -2
- package/test/spec/modules/gdprEnforcement_spec.js +127 -414
- package/test/spec/modules/growthCodeRtdProvider_spec.js +127 -0
- package/test/spec/modules/gumgumBidAdapter_spec.js +14 -0
- package/test/spec/modules/ixBidAdapter_spec.js +2 -1
- package/test/spec/modules/minutemediaBidAdapter_spec.js +69 -1
- package/test/spec/modules/oxxionAnalyticsAdapter_spec.js +324 -0
- package/test/spec/modules/pairIdSystem_spec.js +16 -3
- package/test/spec/modules/prebidServerBidAdapter_spec.js +3 -1
- package/test/spec/modules/pubmaticBidAdapter_spec.js +7 -0
- package/test/spec/modules/realTimeDataModule_spec.js +1 -1
- package/test/spec/modules/riseBidAdapter_spec.js +69 -1
- package/test/spec/modules/sharethroughBidAdapter_spec.js +1 -1
- package/test/spec/modules/smartadserverBidAdapter_spec.js +42 -0
- package/test/spec/modules/stvBidAdapter_spec.js +13 -1
- package/test/spec/modules/undertoneBidAdapter_spec.js +57 -1
- package/test/spec/modules/userId_spec.js +80 -21
- package/test/spec/modules/yahoosspBidAdapter_spec.js +103 -51
- package/test/spec/modules/zeta_global_sspBidAdapter_spec.js +4 -0
- package/test/spec/native_spec.js +12 -12
- package/test/spec/unit/core/adapterManager_spec.js +181 -1
- package/test/spec/unit/core/storageManager_spec.js +76 -68
- package/test/spec/unit/pbjs_api_spec.js +15 -25
- package/test/spec/userSync_spec.js +45 -16
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import {ruleRegistry} from '../../../src/activities/rules.js';
|
|
2
|
+
|
|
3
|
+
describe('Activity control rules', () => {
|
|
4
|
+
const MOCK_ACTIVITY = 'mockActivity';
|
|
5
|
+
const MOCK_RULE = 'mockRule';
|
|
6
|
+
|
|
7
|
+
let registerRule, isAllowed, logger;
|
|
8
|
+
|
|
9
|
+
beforeEach(() => {
|
|
10
|
+
logger = {
|
|
11
|
+
logInfo: sinon.stub(),
|
|
12
|
+
logWarn: sinon.stub(),
|
|
13
|
+
logError: sinon.stub(),
|
|
14
|
+
};
|
|
15
|
+
[registerRule, isAllowed] = ruleRegistry(logger);
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('allows by default', () => {
|
|
19
|
+
expect(isAllowed(MOCK_ACTIVITY, {})).to.be.true;
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('denies if a rule throws', () => {
|
|
23
|
+
registerRule(MOCK_ACTIVITY, MOCK_RULE, () => {
|
|
24
|
+
throw new Error('argh');
|
|
25
|
+
});
|
|
26
|
+
expect(isAllowed(MOCK_ACTIVITY, {})).to.be.false;
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it('denies if a rule denies', () => {
|
|
30
|
+
registerRule(MOCK_ACTIVITY, MOCK_RULE, () => ({allow: false}));
|
|
31
|
+
expect(isAllowed(MOCK_ACTIVITY, {})).to.be.false;
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it('partitions rules by activity', () => {
|
|
35
|
+
registerRule(MOCK_ACTIVITY, MOCK_RULE, () => ({allow: false}));
|
|
36
|
+
expect(isAllowed('other', {})).to.be.true;
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it('passes params to rules', () => {
|
|
40
|
+
registerRule(MOCK_ACTIVITY, MOCK_RULE, (params) => ({allow: params.foo !== 'bar'}));
|
|
41
|
+
expect(isAllowed(MOCK_ACTIVITY, {foo: 'notbar'})).to.be.true;
|
|
42
|
+
expect(isAllowed(MOCK_ACTIVITY, {foo: 'bar'})).to.be.false;
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it('allows if rules do not opine', () => {
|
|
46
|
+
registerRule(MOCK_ACTIVITY, MOCK_RULE, () => null);
|
|
47
|
+
expect(isAllowed(MOCK_ACTIVITY, {foo: 'bar'})).to.be.true;
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it('denies if any rule denies', () => {
|
|
51
|
+
registerRule(MOCK_ACTIVITY, MOCK_RULE, () => null);
|
|
52
|
+
registerRule(MOCK_ACTIVITY, MOCK_RULE, () => ({allow: true}));
|
|
53
|
+
registerRule(MOCK_ACTIVITY, MOCK_RULE, () => ({allow: false}));
|
|
54
|
+
expect(isAllowed(MOCK_ACTIVITY, {foo: 'bar'})).to.be.false;
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
it('allows if higher priority allow rule trumps a lower priority deny rule', () => {
|
|
58
|
+
registerRule(MOCK_ACTIVITY, MOCK_RULE, () => ({allow: false}));
|
|
59
|
+
registerRule(MOCK_ACTIVITY, MOCK_RULE, () => ({allow: true}), 0);
|
|
60
|
+
expect(isAllowed(MOCK_ACTIVITY, {})).to.be.true;
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it('denies if a higher priority deny rule trumps a lower priority allow rule', () => {
|
|
64
|
+
registerRule(MOCK_ACTIVITY, MOCK_RULE, () => ({allow: true}));
|
|
65
|
+
registerRule(MOCK_ACTIVITY, MOCK_RULE, () => ({allow: false}), 0);
|
|
66
|
+
expect(isAllowed(MOCK_ACTIVITY, {})).to.be.false;
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
it('can unregister rules', () => {
|
|
70
|
+
registerRule(MOCK_ACTIVITY, MOCK_RULE, () => ({allow: true}));
|
|
71
|
+
const r = registerRule(MOCK_ACTIVITY, MOCK_RULE, () => ({allow: false}), 0);
|
|
72
|
+
expect(isAllowed(MOCK_ACTIVITY, {})).to.be.false;
|
|
73
|
+
r();
|
|
74
|
+
expect(isAllowed(MOCK_ACTIVITY, {})).to.be.true;
|
|
75
|
+
})
|
|
76
|
+
|
|
77
|
+
it('logs INFO when explicit allow is found', () => {
|
|
78
|
+
registerRule(MOCK_ACTIVITY, MOCK_RULE, () => ({allow: true}));
|
|
79
|
+
isAllowed(MOCK_ACTIVITY, {});
|
|
80
|
+
sinon.assert.calledWithMatch(logger.logInfo, new RegExp(MOCK_RULE));
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
it('logs INFO with reason if the rule provides one', () => {
|
|
84
|
+
registerRule(MOCK_ACTIVITY, MOCK_RULE, () => ({allow: true, reason: 'because'}));
|
|
85
|
+
isAllowed(MOCK_ACTIVITY, {});
|
|
86
|
+
sinon.assert.calledWithMatch(logger.logInfo, new RegExp(MOCK_RULE), /because/);
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
it('logs WARN when a deny is found', () => {
|
|
90
|
+
registerRule(MOCK_ACTIVITY, MOCK_RULE, () => ({allow: false}));
|
|
91
|
+
isAllowed(MOCK_ACTIVITY, {});
|
|
92
|
+
sinon.assert.calledWithMatch(logger.logWarn, new RegExp(MOCK_RULE));
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
it('logs WARN with reason if the rule provides one', () => {
|
|
96
|
+
registerRule(MOCK_ACTIVITY, MOCK_RULE, () => ({allow: false, reason: 'fail'}));
|
|
97
|
+
isAllowed(MOCK_ACTIVITY, {});
|
|
98
|
+
sinon.assert.calledWithMatch(logger.logWarn, new RegExp(MOCK_RULE), /fail/);
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
describe('log message deduping', () => {
|
|
102
|
+
let clock, allow;
|
|
103
|
+
beforeEach(() => {
|
|
104
|
+
allow = false;
|
|
105
|
+
registerRule(MOCK_ACTIVITY, MOCK_RULE, () => ({ allow }));
|
|
106
|
+
clock = sinon.useFakeTimers();
|
|
107
|
+
});
|
|
108
|
+
afterEach(() => {
|
|
109
|
+
clock.restore();
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
it('is applied to identical messages that are close in time', () => {
|
|
113
|
+
isAllowed(MOCK_ACTIVITY, {});
|
|
114
|
+
clock.tick(100);
|
|
115
|
+
isAllowed(MOCK_ACTIVITY, {});
|
|
116
|
+
expect(logger.logWarn.callCount).to.equal(1);
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
it('not to messages that show different results', () => {
|
|
120
|
+
isAllowed(MOCK_ACTIVITY, {});
|
|
121
|
+
allow = true;
|
|
122
|
+
clock.tick(100);
|
|
123
|
+
isAllowed(MOCK_ACTIVITY, {});
|
|
124
|
+
expect(logger.logWarn.callCount).to.equal(1);
|
|
125
|
+
expect(logger.logInfo.callCount).to.equal(1);
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
it('not to messages that are further apart in time', () => {
|
|
129
|
+
isAllowed(MOCK_ACTIVITY, {});
|
|
130
|
+
clock.tick(2000);
|
|
131
|
+
isAllowed(MOCK_ACTIVITY, {});
|
|
132
|
+
expect(logger.logWarn.callCount).to.equal(2);
|
|
133
|
+
})
|
|
134
|
+
})
|
|
135
|
+
});
|
|
@@ -117,7 +117,7 @@ describe('AdgenerationAdapter', function () {
|
|
|
117
117
|
criteoId: 'criteo-id-test-1234567890'
|
|
118
118
|
}
|
|
119
119
|
},
|
|
120
|
-
{ //
|
|
120
|
+
{ // bannerWithAdgextIds
|
|
121
121
|
bidder: 'adg',
|
|
122
122
|
params: {
|
|
123
123
|
id: '58278', // banner
|
|
@@ -134,8 +134,48 @@ describe('AdgenerationAdapter', function () {
|
|
|
134
134
|
linkType: 2
|
|
135
135
|
},
|
|
136
136
|
uid: 'id5-id-test-1234567890'
|
|
137
|
+
},
|
|
138
|
+
imuid: 'i.KrAH6ZAZTJOnH5S4N2sogA',
|
|
139
|
+
uid2: {id: 'AgAAAAVacu1uAxgAxH+HJ8+nWlS2H4uVqr6i+HBDCNREHD8WKsio/x7D8xXFuq1cJycUU86yXfTH9Xe/4C8KkH+7UCiU7uQxhyD7Qxnv251pEs6K8oK+BPLYR+8BLY/sJKesa/koKwx1FHgUzIBum582tSy2Oo+7C6wYUaaV4QcLr/4LPA='},
|
|
140
|
+
},
|
|
141
|
+
ortb2Imp: {ext: {gpid: '/1111/homepage#300x250'}},
|
|
142
|
+
ortb2: {
|
|
143
|
+
site: {
|
|
144
|
+
domain: 'localhost:9999',
|
|
145
|
+
publisher: {'domain': 'localhost:9999'},
|
|
146
|
+
page: 'http://localhost:9999/integrationExamples/gpt/hello_world.html',
|
|
147
|
+
ref: 'http://localhost:9999/integrationExamples/gpt/hello_world.html'
|
|
148
|
+
},
|
|
149
|
+
device: {
|
|
150
|
+
w: 570,
|
|
151
|
+
h: 969,
|
|
152
|
+
dnt: 0,
|
|
153
|
+
ua: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML,like Gecko)Chrome / 112.0.0.0Safari / 537.36',
|
|
154
|
+
language: 'ja',
|
|
155
|
+
sua: {
|
|
156
|
+
source: 2,
|
|
157
|
+
platform: {
|
|
158
|
+
brand: 'macOS'
|
|
159
|
+
},
|
|
160
|
+
browsers: [
|
|
161
|
+
{
|
|
162
|
+
brand: 'Chromium',
|
|
163
|
+
version: ['112']
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
brand: 'Google Chrome',
|
|
167
|
+
version: ['112']
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
brand: 'Not:A-Brand',
|
|
171
|
+
version: ['99']
|
|
172
|
+
}
|
|
173
|
+
],
|
|
174
|
+
mobile: 0
|
|
175
|
+
}
|
|
137
176
|
}
|
|
138
|
-
}
|
|
177
|
+
},
|
|
178
|
+
schain: {ver: '1.0', complete: 1, nodes: [{asi: 'indirectseller.com', sid: '00001', hp: 1}]}
|
|
139
179
|
}
|
|
140
180
|
];
|
|
141
181
|
const bidderRequest = {
|
|
@@ -144,12 +184,12 @@ describe('AdgenerationAdapter', function () {
|
|
|
144
184
|
}
|
|
145
185
|
};
|
|
146
186
|
const data = {
|
|
147
|
-
banner: `posall=SSPLOC&id=58278&sdktype=0&hb=true&t=json3&sizes=300x250%2C320x100¤cy=JPY&pbver=${prebid.version}&sdkname=prebidjs&adapterver=1.
|
|
148
|
-
bannerUSD: `posall=SSPLOC&id=58278&sdktype=0&hb=true&t=json3&sizes=300x250%2C320x100¤cy=USD&pbver=${prebid.version}&sdkname=prebidjs&adapterver=1.
|
|
149
|
-
native: `posall=SSPLOC&id=58278&sdktype=0&hb=true&t=json3&sizes=1x1¤cy=JPY&pbver=${prebid.version}&sdkname=prebidjs&adapterver=1.
|
|
150
|
-
bannerWithHyperId: `posall=SSPLOC&id=58278&sdktype=0&hb=true&t=json3&sizes=320x100¤cy=JPY&pbver=${prebid.version}&sdkname=prebidjs&adapterver=1.
|
|
151
|
-
bannerWithAdgextCriteoId: `posall=SSPLOC&id=58278&sdktype=0&hb=true&t=json3&sizes=320x100¤cy=JPY&pbver=${prebid.version}&sdkname=prebidjs&adapterver=1.
|
|
152
|
-
|
|
187
|
+
banner: `posall=SSPLOC&id=58278&sdktype=0&hb=true&t=json3&sizes=300x250%2C320x100¤cy=JPY&pbver=${prebid.version}&sdkname=prebidjs&adapterver=1.6.0&imark=1&tp=https%3A%2F%2Fexample.com`,
|
|
188
|
+
bannerUSD: `posall=SSPLOC&id=58278&sdktype=0&hb=true&t=json3&sizes=300x250%2C320x100¤cy=USD&pbver=${prebid.version}&sdkname=prebidjs&adapterver=1.6.0&imark=1&tp=https%3A%2F%2Fexample.com`,
|
|
189
|
+
native: `posall=SSPLOC&id=58278&sdktype=0&hb=true&t=json3&sizes=1x1¤cy=JPY&pbver=${prebid.version}&sdkname=prebidjs&adapterver=1.6.0&tp=https%3A%2F%2Fexample.com`,
|
|
190
|
+
bannerWithHyperId: `posall=SSPLOC&id=58278&sdktype=0&hb=true&t=json3&sizes=320x100¤cy=JPY&pbver=${prebid.version}&sdkname=prebidjs&adapterver=1.6.0&imark=1&tp=https%3A%2F%2Fexample.com&hyper_id=novatiqId`,
|
|
191
|
+
bannerWithAdgextCriteoId: `posall=SSPLOC&id=58278&sdktype=0&hb=true&t=json3&sizes=320x100¤cy=JPY&pbver=${prebid.version}&sdkname=prebidjs&adapterver=1.6.0&adgext_criteo_id=criteo-id-test-1234567890&imark=1&tp=https%3A%2F%2Fexample.com`,
|
|
192
|
+
bannerWithAdgextIds: `posall=SSPLOC&id=58278&sdktype=0&hb=true&t=json3&sizes=320x100¤cy=JPY&pbver=${prebid.version}&sdkname=prebidjs&adapterver=1.6.0&adgext_id5_id=id5-id-test-1234567890&adgext_id5_id_link_type=2&adgext_imuid=i.KrAH6ZAZTJOnH5S4N2sogA&adgext_uid2=%5Bobject%20Object%5D&gpid=%252F1111%252Fhomepage%2523300x250&uach=%7B%22source%22%3A2%2C%22platform%22%3A%7B%22brand%22%3A%22macOS%22%7D%2C%22browsers%22%3A%5B%7B%22brand%22%3A%22Chromium%22%2C%22version%22%3A%5B%22112%22%5D%7D%2C%7B%22brand%22%3A%22Google%20Chrome%22%2C%22version%22%3A%5B%22112%22%5D%7D%2C%7B%22brand%22%3A%22Not%3AA-Brand%22%2C%22version%22%3A%5B%2299%22%5D%7D%5D%2C%22mobile%22%3A0%7D&schain=%257B%2522ver%2522%253A%25221.0%2522%252C%2522complete%2522%253A1%252C%2522nodes%2522%253A%255B%257B%2522asi%2522%253A%2522indirectseller.com%2522%252C%2522sid%2522%253A%252200001%2522%252C%2522hp%2522%253A1%257D%255D%257D&imark=1&tp=https%3A%2F%2Fexample.com`,
|
|
153
193
|
};
|
|
154
194
|
it('sends bid request to ENDPOINT via GET', function () {
|
|
155
195
|
const request = spec.buildRequests(bidRequests, bidderRequest)[0];
|
|
@@ -176,12 +216,12 @@ describe('AdgenerationAdapter', function () {
|
|
|
176
216
|
|
|
177
217
|
it('should attache params to the bannerWithHyperId request', function () {
|
|
178
218
|
const defaultUA = window.navigator.userAgent;
|
|
179
|
-
window.navigator.__defineGetter__('userAgent', function() {
|
|
219
|
+
window.navigator.__defineGetter__('userAgent', function () {
|
|
180
220
|
return 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Mobile/15E148 Safari/604.1';
|
|
181
221
|
});
|
|
182
222
|
const request = spec.buildRequests(bidRequests, bidderRequest)[2];
|
|
183
223
|
|
|
184
|
-
window.navigator.__defineGetter__('userAgent', function() {
|
|
224
|
+
window.navigator.__defineGetter__('userAgent', function () {
|
|
185
225
|
return defaultUA;
|
|
186
226
|
});
|
|
187
227
|
expect(request.data).to.equal(data.bannerWithHyperId);
|
|
@@ -192,9 +232,9 @@ describe('AdgenerationAdapter', function () {
|
|
|
192
232
|
expect(request.data).to.equal(data.bannerWithAdgextCriteoId);
|
|
193
233
|
});
|
|
194
234
|
|
|
195
|
-
it('should attache params to the
|
|
235
|
+
it('should attache params to the bannerWithAdgextIds request', function () {
|
|
196
236
|
const request = spec.buildRequests(bidRequests, bidderRequest)[4];
|
|
197
|
-
expect(request.data).to.equal(data.
|
|
237
|
+
expect(request.data).to.equal(data.bannerWithAdgextIds);
|
|
198
238
|
});
|
|
199
239
|
|
|
200
240
|
it('allows setConfig to set bidder currency for JPY', function () {
|
|
@@ -74,7 +74,12 @@ describe('adhashBidAdapter', function () {
|
|
|
74
74
|
publisherId: '0xc3b09b27e9c6ef73957901aa729b9e69e5bbfbfb'
|
|
75
75
|
},
|
|
76
76
|
sizes: [[300, 250]],
|
|
77
|
-
adUnitCode: 'adUnitCode'
|
|
77
|
+
adUnitCode: 'adUnitCode',
|
|
78
|
+
mediaTypes: {
|
|
79
|
+
banner: {
|
|
80
|
+
sizes: [[300, 250]]
|
|
81
|
+
}
|
|
82
|
+
}
|
|
78
83
|
};
|
|
79
84
|
it('should build the request correctly', function () {
|
|
80
85
|
const result = spec.buildRequests(
|
|
@@ -122,6 +127,11 @@ describe('adhashBidAdapter', function () {
|
|
|
122
127
|
sizes: [[300, 250]],
|
|
123
128
|
params: {
|
|
124
129
|
platformURL: 'https://adhash.com/p/struma/'
|
|
130
|
+
},
|
|
131
|
+
mediaTypes: {
|
|
132
|
+
banner: {
|
|
133
|
+
sizes: [[300, 250]]
|
|
134
|
+
}
|
|
125
135
|
}
|
|
126
136
|
}
|
|
127
137
|
};
|
|
@@ -267,5 +277,45 @@ describe('adhashBidAdapter', function () {
|
|
|
267
277
|
it('should return empty array when something is not right', function () {
|
|
268
278
|
expect(spec.interpretResponse(null, request).length).to.equal(0);
|
|
269
279
|
});
|
|
280
|
+
|
|
281
|
+
it('should interpret the video response correctly', function () {
|
|
282
|
+
const result = spec.interpretResponse({
|
|
283
|
+
body: {
|
|
284
|
+
creatives: [{ costEUR: 1.234, vastURL: 'https://example.com/vast' }],
|
|
285
|
+
advertiserDomains: 'adhash.com'
|
|
286
|
+
}
|
|
287
|
+
}, {
|
|
288
|
+
data: { some: 'data' },
|
|
289
|
+
bidRequest: {
|
|
290
|
+
bidId: '12345678901234',
|
|
291
|
+
adUnitCode: 'adunit-code',
|
|
292
|
+
sizes: [[300, 250]],
|
|
293
|
+
params: {
|
|
294
|
+
platformURL: 'https://adhash.com/p/struma/'
|
|
295
|
+
},
|
|
296
|
+
mediaTypes: {
|
|
297
|
+
video: {
|
|
298
|
+
context: 'instream',
|
|
299
|
+
playerSize: [300, 250],
|
|
300
|
+
mimes: ['video/mp4'],
|
|
301
|
+
protocols: [1, 2, 3, 4, 5, 6, 7, 8],
|
|
302
|
+
playbackmethod: [2],
|
|
303
|
+
skip: 1
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
});
|
|
308
|
+
expect(result.length).to.equal(1);
|
|
309
|
+
expect(result[0].requestId).to.equal('12345678901234');
|
|
310
|
+
expect(result[0].cpm).to.equal(1.234);
|
|
311
|
+
expect(result[0].width).to.equal(300);
|
|
312
|
+
expect(result[0].height).to.equal(250);
|
|
313
|
+
expect(result[0].creativeId).to.equal('adunit-code');
|
|
314
|
+
expect(result[0].netRevenue).to.equal(true);
|
|
315
|
+
expect(result[0].currency).to.equal('EUR');
|
|
316
|
+
expect(result[0].ttl).to.equal(60);
|
|
317
|
+
expect(result[0].meta.advertiserDomains).to.eql(['adhash.com']);
|
|
318
|
+
expect(result[0].vastUrl).to.equal('https://example.com/vast');
|
|
319
|
+
});
|
|
270
320
|
});
|
|
271
321
|
});
|
|
@@ -130,14 +130,13 @@ describe('AdmanAdapter', function () {
|
|
|
130
130
|
let placements = data['placements'];
|
|
131
131
|
for (let i = 0; i < placements.length; i++) {
|
|
132
132
|
let placement = placements[i];
|
|
133
|
-
expect(placement).to.have.all.keys('placementId', 'eids', 'bidId', 'traffic', '
|
|
133
|
+
expect(placement).to.have.all.keys('placementId', 'eids', 'bidId', 'traffic', 'schain', 'bidFloor',
|
|
134
134
|
'playerSize', 'minduration', 'maxduration', 'mimes', 'protocols', 'startdelay', 'placement', 'skip',
|
|
135
135
|
'skipafter', 'minbitrate', 'maxbitrate', 'delivery', 'playbackmethod', 'api', 'linearity');
|
|
136
136
|
expect(placement.schain).to.be.an('object')
|
|
137
137
|
expect(placement.placementId).to.be.a('number');
|
|
138
138
|
expect(placement.bidId).to.be.a('string');
|
|
139
139
|
expect(placement.traffic).to.be.a('string');
|
|
140
|
-
expect(placement.sizes).to.be.an('array');
|
|
141
140
|
expect(placement.bidFloor).to.be.an('number');
|
|
142
141
|
}
|
|
143
142
|
});
|