prebid.js 7.44.0 → 7.45.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/acuityAdsBidAdapter.js +1 -1
- 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/appierAnalyticsAdapter.js +1 -1
- package/dist/appnexusBidAdapter.js +1 -1
- package/dist/appushBidAdapter.js +1 -1
- package/dist/asoBidAdapter.js +1 -1
- package/dist/axonixBidAdapter.js +1 -1
- package/dist/beyondmediaBidAdapter.js +1 -1
- package/dist/bidglassBidAdapter.js +1 -1
- package/dist/big-richmediaBidAdapter.js +1 -1
- package/dist/braveBidAdapter.js +1 -1
- package/dist/bridgewellBidAdapter.js +1 -1
- package/dist/brightMountainMediaBidAdapter.js +1 -1
- package/dist/brightcomBidAdapter.js +1 -1
- package/dist/brightcomSSPBidAdapter.js +1 -1
- package/dist/carodaBidAdapter.js +1 -1
- package/dist/chtnwBidAdapter.js +1 -1
- package/dist/coinzillaBidAdapter.js +1 -1
- package/dist/compassBidAdapter.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/contentexchangeBidAdapter.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 +12 -0
- package/dist/domainOverrideToRootDomain.js +1 -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/glimpseBidAdapter.js +1 -1
- package/dist/globalsunBidAdapter.js +1 -1
- package/dist/gmosspBidAdapter.js +1 -1
- package/dist/goldbachBidAdapter.js +1 -1
- package/dist/greenbidsAnalyticsAdapter.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/id5IdSystem.js +1 -1
- package/dist/improvedigitalBidAdapter.js +1 -1
- package/dist/inmarBidAdapter.js +1 -1
- package/dist/insticatorBidAdapter.js +1 -1
- package/dist/iqzoneBidAdapter.js +1 -1
- package/dist/ivsBidAdapter.js +1 -0
- package/dist/ixBidAdapter.js +1 -1
- package/dist/justpremiumBidAdapter.js +1 -1
- package/dist/jwplayerVideoProvider.js +1 -1
- package/dist/kargoBidAdapter.js +1 -1
- package/dist/koblerBidAdapter.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/liveIntentIdSystem.js +1 -1
- package/dist/liveyieldAnalyticsAdapter.js +1 -1
- package/dist/logicadBidAdapter.js +1 -1
- package/dist/loglyliftBidAdapter.js +1 -1
- package/dist/luponmediaBidAdapter.js +1 -1
- package/dist/magniteAnalyticsAdapter.js +1 -1
- package/dist/malltvAnalyticsAdapter.js +1 -1
- package/dist/marsmediaBidAdapter.js +1 -1
- package/dist/mathildeadsBidAdapter.js +1 -1
- package/dist/mediafuseBidAdapter.js +1 -1
- package/dist/medianetBidAdapter.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 +158 -156
- package/dist/oguryBidAdapter.js +1 -1
- package/dist/onetagBidAdapter.js +1 -1
- package/dist/onomagicBidAdapter.js +1 -1
- package/dist/ooloAnalyticsAdapter.js +1 -1
- package/dist/openxBidAdapter.js +1 -1
- package/dist/openxOrtbBidAdapter.js +1 -1
- package/dist/operaadsBidAdapter.js +1 -1
- package/dist/optidigitalBidAdapter.js +1 -1
- package/dist/outbrainBidAdapter.js +1 -1
- package/dist/parrableIdSystem.js +1 -1
- package/dist/pixfutureBidAdapter.js +1 -1
- package/dist/prebid-core.js +1 -1
- package/dist/publinkIdSystem.js +1 -1
- package/dist/pubmaticBidAdapter.js +1 -1
- package/dist/pubwiseAnalyticsAdapter.js +1 -1
- package/dist/pubxBidAdapter.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/rubiconAnalyticsAdapter.js +1 -1
- package/dist/rubiconBidAdapter.js +1 -1
- package/dist/seedingAllianceBidAdapter.js +1 -1
- package/dist/seedtagBidAdapter.js +1 -1
- package/dist/sharedIdSystem.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/smarthubBidAdapter.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/truereachBidAdapter.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/videoheroesBidAdapter.js +1 -1
- package/dist/vidoomyBidAdapter.js +1 -1
- package/dist/visiblemeasuresBidAdapter.js +1 -1
- package/dist/visxBidAdapter.js +1 -1
- package/dist/vrtcalBidAdapter.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/yieldoneBidAdapter.js +1 -1
- package/libraries/domainOverrideToRootDomain/index.js +39 -0
- package/modules/acuityAdsBidAdapter.js +1 -1
- package/modules/amxBidAdapter.js +1 -1
- package/modules/amxIdSystem.js +23 -20
- package/modules/amxIdSystem.md +7 -7
- package/modules/appushBidAdapter.js +1 -1
- package/modules/beyondmediaBidAdapter.js +1 -1
- package/modules/braveBidAdapter.js +1 -1
- package/modules/brightcomBidAdapter.js +1 -1
- package/modules/brightcomSSPBidAdapter.js +1 -1
- package/modules/coinzillaBidAdapter.js +1 -2
- package/modules/compassBidAdapter.js +1 -1
- package/modules/connectIdSystem.js +96 -21
- package/modules/connectIdSystem.md +6 -5
- package/modules/contentexchangeBidAdapter.js +1 -1
- package/modules/freewheel-sspBidAdapter.js +8 -0
- package/modules/glimpseBidAdapter.js +1 -2
- package/modules/globalsunBidAdapter.js +1 -1
- package/modules/gridBidAdapter.js +1 -1
- package/modules/gridNMBidAdapter.js +1 -1
- package/modules/growthCodeIdSystem.js +18 -15
- package/modules/gumgumBidAdapter.js +1 -1
- package/modules/iqzoneBidAdapter.js +1 -1
- package/modules/ivsBidAdapter.js +85 -0
- package/modules/ivsBidAdapter.md +34 -0
- package/modules/ixBidAdapter.js +42 -105
- package/modules/jwplayerVideoProvider.js +25 -32
- package/modules/koblerBidAdapter.js +1 -2
- package/modules/kueezBidAdapter.js +1 -1
- package/modules/liveIntentIdSystem.js +8 -0
- package/modules/luponmediaBidAdapter.js +1 -1
- package/modules/magniteAnalyticsAdapter.js +76 -3
- package/modules/mathildeadsBidAdapter.js +1 -1
- package/modules/medianetBidAdapter.js +1 -1
- package/modules/mgidBidAdapter.js +178 -26
- package/modules/minutemediaBidAdapter.js +1 -1
- package/modules/oguryBidAdapter.js +3 -2
- package/modules/onomagicBidAdapter.js +1 -2
- package/modules/openxBidAdapter.js +192 -563
- package/modules/openxBidAdapter.md +22 -20
- package/modules/openxOrtbBidAdapter.js +13 -11
- package/modules/openxOrtbBidAdapter.md +5 -3
- package/modules/operaadsBidAdapter.js +1 -1
- package/modules/pubmaticBidAdapter.js +1 -1
- package/modules/pubxBidAdapter.js +5 -2
- package/modules/riseBidAdapter.js +1 -1
- package/modules/sharedIdSystem.js +4 -27
- package/modules/sharethroughBidAdapter.js +1 -1
- package/modules/shinezBidAdapter.js +1 -1
- package/modules/smarthubBidAdapter.js +1 -1
- package/modules/synacormediaBidAdapter.js +1 -3
- package/modules/truereachBidAdapter.js +1 -2
- package/modules/userId/eids.js +18 -0
- package/modules/userId/eids.md +16 -0
- package/modules/videoheroesBidAdapter.js +1 -1
- package/modules/vidoomyBidAdapter.js +22 -1
- package/modules/visiblemeasuresBidAdapter.js +1 -1
- package/modules/vrtcalBidAdapter.js +1 -1
- package/modules/yieldoneBidAdapter.js +1 -1
- package/package.json +1 -1
- package/src/Renderer.js +2 -1
- package/src/native.js +5 -1
- package/test/spec/auctionmanager_spec.js +2 -2
- package/test/spec/libraries/domainOverrideToRootDomain/index_spec.js +77 -0
- package/test/spec/modules/acuityAdsBidAdapter_spec.js +2 -1
- package/test/spec/modules/amxIdSystem_spec.js +13 -26
- package/test/spec/modules/appushBidAdapter_spec.js +2 -1
- package/test/spec/modules/beyondmediaBidAdapter_spec.js +2 -1
- package/test/spec/modules/compassBidAdapter_spec.js +2 -1
- package/test/spec/modules/connectIdSystem_spec.js +420 -242
- package/test/spec/modules/contentexchangeBidAdapter_spec.js +2 -1
- package/test/spec/modules/eids_spec.js +30 -0
- package/test/spec/modules/freewheel-sspBidAdapter_spec.js +37 -0
- package/test/spec/modules/globalsunBidAdapter_spec.js +2 -1
- package/test/spec/modules/iqzoneBidAdapter_spec.js +2 -1
- package/test/spec/modules/ivsBidAdapter_spec.js +197 -0
- package/test/spec/modules/ixBidAdapter_spec.js +84 -71
- package/test/spec/modules/koblerBidAdapter_spec.js +0 -20
- package/test/spec/modules/liveIntentIdSystem_spec.js +10 -0
- package/test/spec/modules/luponmediaBidAdapter_spec.js +1 -1
- package/test/spec/modules/magniteAnalyticsAdapter_spec.js +129 -1
- package/test/spec/modules/mathildeadsBidAdapter_spec.js +2 -1
- package/test/spec/modules/mgidBidAdapter_spec.js +184 -36
- package/test/spec/modules/oguryBidAdapter_spec.js +19 -4
- package/test/spec/modules/openxBidAdapter_spec.js +1157 -1936
- package/test/spec/modules/openxOrtbBidAdapter_spec.js +12 -39
- package/test/spec/modules/pubxBidAdapter_spec.js +10 -2
- package/test/spec/modules/sharedIdSystem_spec.js +0 -46
- package/test/spec/modules/sharethroughBidAdapter_spec.js +2 -1
- package/test/spec/modules/smarthubBidAdapter_spec.js +2 -1
- package/test/spec/modules/synacormediaBidAdapter_spec.js +0 -26
- package/test/spec/modules/videoModule/submodules/jwplayerVideoProvider_spec.js +17 -4
- package/test/spec/modules/vidoomyBidAdapter_spec.js +35 -0
- package/test/spec/modules/visiblemeasuresBidAdapter_spec.js +2 -1
- package/test/spec/modules/vrtcalBidAdapter_spec.js +3 -2
- package/test/spec/renderer_spec.js +1 -2
|
@@ -9,30 +9,31 @@ Maintainer: team-openx@openx.com
|
|
|
9
9
|
# Description
|
|
10
10
|
|
|
11
11
|
Module that connects to OpenX's demand sources.
|
|
12
|
-
Note
|
|
13
|
-
|
|
12
|
+
Note that this adapter mirrors openxOrtbBidAdapter and any updates must be
|
|
13
|
+
completed in both adapters.
|
|
14
|
+
openxOrtbBidAdapter will be removed in a future release and should not be used.
|
|
15
|
+
Please note you should only include either openxBidAdapter or openxOrtbBidAdapter in your build.
|
|
14
16
|
|
|
15
17
|
# Bid Parameters
|
|
16
18
|
## Banner
|
|
17
19
|
|
|
18
|
-
| Name
|
|
19
|
-
|
|
20
|
-
| `delDomain`
|
|
21
|
-
| `unit`
|
|
22
|
-
| `customParams`
|
|
23
|
-
| `customFloor`
|
|
24
|
-
| `doNotTrack`
|
|
25
|
-
| `coppa`
|
|
26
|
-
|
|
27
|
-
** platform is deprecated. Please use delDomain instead. If you have any questions please contact your representative.
|
|
20
|
+
| Name | Scope | Type | Description | Example
|
|
21
|
+
| ---- | ----- | ---- | ----------- | -------
|
|
22
|
+
| `delDomain` or `platform` | required | String | OpenX delivery domain or platform id provided by your OpenX representative. | "PUBLISHER-d.openx.net" or "555not5a-real-plat-form-id0123456789"
|
|
23
|
+
| `unit` | required | String | OpenX ad unit ID provided by your OpenX representative. | "1611023122"
|
|
24
|
+
| `customParams` | optional | Object | User-defined targeting key-value pairs. customParams applies to a specific unit. | `{key1: "v1", key2: ["v2","v3"]}`
|
|
25
|
+
| `customFloor` | optional | Number | Minimum price in USD. customFloor applies to a specific unit. For example, use the following value to set a $1.50 floor: 1.50 <br/><br/> **WARNING:**<br/> Misuse of this parameter can impact revenue | 1.50
|
|
26
|
+
| `doNotTrack` | optional | Boolean | Prevents advertiser from using data for this user. <br/><br/> **WARNING:**<br/> Request-level setting. May impact revenue. | true
|
|
27
|
+
| `coppa` | optional | Boolean | Enables Child's Online Privacy Protection Act (COPPA) regulations. Use of `pbjs.setConfig({coppa: true});` is now preferred. | true
|
|
28
28
|
|
|
29
29
|
## Video
|
|
30
30
|
|
|
31
|
-
| Name
|
|
32
|
-
|
|
33
|
-
| `unit`
|
|
34
|
-
| `delDomain` | required | String
|
|
35
|
-
| `
|
|
31
|
+
| Name | Scope | Type | Description | Example
|
|
32
|
+
| ---- | ----- | ---- | ----------- | -------
|
|
33
|
+
| `unit` | required | String | OpenX ad unit ID provided by your OpenX representative. | "1611023122"
|
|
34
|
+
| `delDomain` | required | String | OpenX delivery domain provided by your OpenX representative. | "PUBLISHER-d.openx.net"
|
|
35
|
+
| `video` | optional | OpenRTB video subtypes | Use of adUnit.mediaTypes.video is now preferred. | `{ video: {mimes: ['video/mp4']}`
|
|
36
|
+
|
|
36
37
|
|
|
37
38
|
# Example
|
|
38
39
|
```javascript
|
|
@@ -70,7 +71,8 @@ var adUnits = [
|
|
|
70
71
|
mediaTypes: {
|
|
71
72
|
video: {
|
|
72
73
|
playerSize: [640, 480],
|
|
73
|
-
context: 'instream'
|
|
74
|
+
context: 'instream',
|
|
75
|
+
mimes: ['video/x-ms-wmv, video/mp4']
|
|
74
76
|
}
|
|
75
77
|
},
|
|
76
78
|
bids: [{
|
|
@@ -79,10 +81,10 @@ var adUnits = [
|
|
|
79
81
|
unit: '1611023124',
|
|
80
82
|
delDomain: 'PUBLISHER-d.openx.net',
|
|
81
83
|
video: {
|
|
82
|
-
mimes: ['video/x-ms-wmv, video/mp4']
|
|
84
|
+
mimes: ['video/x-ms-wmv, video/mp4'] // mediaTypes.video preferred
|
|
83
85
|
}
|
|
84
86
|
}
|
|
85
|
-
}]
|
|
87
|
+
}]p
|
|
86
88
|
}
|
|
87
89
|
];
|
|
88
90
|
```
|
|
@@ -29,9 +29,6 @@ const converter = ortbConverter({
|
|
|
29
29
|
},
|
|
30
30
|
imp(buildImp, bidRequest, context) {
|
|
31
31
|
const imp = buildImp(bidRequest, context);
|
|
32
|
-
if (bidRequest.mediaTypes[VIDEO]?.context === 'outstream') {
|
|
33
|
-
imp.video.placement = imp.video.placement || 4;
|
|
34
|
-
}
|
|
35
32
|
mergeDeep(imp, {
|
|
36
33
|
tagid: bidRequest.params.unit,
|
|
37
34
|
ext: {
|
|
@@ -132,15 +129,20 @@ const converter = ortbConverter({
|
|
|
132
129
|
}
|
|
133
130
|
},
|
|
134
131
|
video(orig, imp, bidRequest, context) {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
132
|
+
if (FEATURES.VIDEO) {
|
|
133
|
+
// `orig` is the video imp processor, which looks at bidRequest.mediaTypes[VIDEO]
|
|
134
|
+
// to populate imp.video
|
|
135
|
+
// alter its input `bidRequest` to also pick up parameters from `bidRequest.params`
|
|
136
|
+
let videoParams = bidRequest.mediaTypes[VIDEO];
|
|
137
|
+
if (videoParams) {
|
|
138
|
+
videoParams = Object.assign({}, videoParams, bidRequest.params.video);
|
|
139
|
+
bidRequest = {...bidRequest, mediaTypes: {[VIDEO]: videoParams}}
|
|
140
|
+
}
|
|
141
|
+
orig(imp, bidRequest, context);
|
|
142
|
+
if (imp.video && videoParams?.context === 'outstream') {
|
|
143
|
+
imp.video.placement = imp.video.placement || 4;
|
|
144
|
+
}
|
|
142
145
|
}
|
|
143
|
-
orig(imp, bidRequest, context);
|
|
144
146
|
}
|
|
145
147
|
}
|
|
146
148
|
}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
# Overview
|
|
2
2
|
|
|
3
3
|
```
|
|
4
|
-
Module Name: OpenX
|
|
4
|
+
Module Name: OpenX Bidder Adapter
|
|
5
5
|
Module Type: Bidder Adapter
|
|
6
6
|
Maintainer: team-openx@openx.com
|
|
7
7
|
```
|
|
8
8
|
|
|
9
9
|
# Description
|
|
10
|
+
DEPRECATED. Use openxBidAdapter.
|
|
10
11
|
|
|
11
|
-
This
|
|
12
|
-
|
|
12
|
+
This adapter was originally an adapter used to test OpenX serving architecture changes.
|
|
13
|
+
This adapter now mirrors openxBidAdapter and this adapter will be removed in a future release. Please use openxBidAdapter.
|
|
14
|
+
Please note you should only include either openxBidAdapter or openxOrtbBidAdapter in your build.
|
|
13
15
|
|
|
14
16
|
# Bid Parameters
|
|
15
17
|
## Banner
|
|
@@ -228,7 +228,7 @@ function buildOpenRtbBidRequest(bidRequest, bidderRequest) {
|
|
|
228
228
|
// build OpenRTB request body
|
|
229
229
|
const payload = {
|
|
230
230
|
id: bidderRequest.auctionId,
|
|
231
|
-
tmax: bidderRequest.timeout
|
|
231
|
+
tmax: bidderRequest.timeout,
|
|
232
232
|
test: config.getConfig('debug') ? 1 : 0,
|
|
233
233
|
imp: createImp(bidRequest),
|
|
234
234
|
device: getDevice(),
|
|
@@ -1211,7 +1211,7 @@ export const spec = {
|
|
|
1211
1211
|
// bidderRequest has timeout property if publisher sets during calling requestBids function from page
|
|
1212
1212
|
// if not bidderRequest contains global value set by Prebid
|
|
1213
1213
|
if (bidderRequest?.timeout) {
|
|
1214
|
-
payload.tmax = bidderRequest.timeout
|
|
1214
|
+
payload.tmax = bidderRequest.timeout;
|
|
1215
1215
|
} else {
|
|
1216
1216
|
payload.tmax = window?.PWT?.versionDetails?.timeout;
|
|
1217
1217
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { deepSetValue } from '../src/utils.js';
|
|
1
|
+
import { deepSetValue, deepAccess } from '../src/utils.js';
|
|
2
2
|
import { registerBidder } from '../src/adapters/bidderFactory.js';
|
|
3
3
|
|
|
4
4
|
const BIDDER_CODE = 'pubx';
|
|
@@ -16,8 +16,11 @@ export const spec = {
|
|
|
16
16
|
const bidId = bidRequest.bidId;
|
|
17
17
|
const params = bidRequest.params;
|
|
18
18
|
const sid = params.sid;
|
|
19
|
+
const pageUrl = deepAccess(bidRequest, 'ortb2.site.page').replace(/\?.*$/, '');
|
|
20
|
+
const pageEnc = encodeURIComponent(pageUrl);
|
|
19
21
|
const payload = {
|
|
20
|
-
sid: sid
|
|
22
|
+
sid: sid,
|
|
23
|
+
pu: pageEnc,
|
|
21
24
|
};
|
|
22
25
|
return {
|
|
23
26
|
id: bidId,
|
|
@@ -384,7 +384,7 @@ function generateGeneralParams(generalObject, bidderRequest) {
|
|
|
384
384
|
const {syncEnabled, filterSettings} = config.getConfig('userSync') || {};
|
|
385
385
|
const {bidderCode} = bidderRequest;
|
|
386
386
|
const generalBidParams = generalObject.params;
|
|
387
|
-
const timeout =
|
|
387
|
+
const timeout = bidderRequest.timeout;
|
|
388
388
|
|
|
389
389
|
// these params are snake_case instead of camelCase to allow backwards compatability on the server.
|
|
390
390
|
// in the future, these will be converted to camelCase to match our convention.
|
|
@@ -5,12 +5,13 @@
|
|
|
5
5
|
* @requires module:modules/userId
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import {parseUrl, buildUrl, triggerPixel, logInfo, hasDeviceAccess, generateUUID} from '../src/utils.js';
|
|
9
9
|
import {submodule} from '../src/hook.js';
|
|
10
|
-
import {
|
|
10
|
+
import {coppaDataHandler} from '../src/adapterManager.js';
|
|
11
11
|
import {getStorageManager} from '../src/storageManager.js';
|
|
12
12
|
import {VENDORLESS_GVLID} from '../src/consentHandler.js';
|
|
13
13
|
import {MODULE_TYPE_UID} from '../src/activities/modules.js';
|
|
14
|
+
import {domainOverrideToRootDomain} from '../libraries/domainOverrideToRootDomain/index.js';
|
|
14
15
|
|
|
15
16
|
export const storage = getStorageManager({moduleType: MODULE_TYPE_UID, moduleName: 'pubCommonId'});
|
|
16
17
|
const COOKIE = 'cookie';
|
|
@@ -172,31 +173,7 @@ export const sharedIdSystemSubmodule = {
|
|
|
172
173
|
}
|
|
173
174
|
},
|
|
174
175
|
|
|
175
|
-
domainOverride:
|
|
176
|
-
const domainElements = document.domain.split('.');
|
|
177
|
-
const cookieName = `_gd${Date.now()}`;
|
|
178
|
-
for (let i = 0, topDomain, testCookie; i < domainElements.length; i++) {
|
|
179
|
-
const nextDomain = domainElements.slice(i).join('.');
|
|
180
|
-
|
|
181
|
-
// write test cookie
|
|
182
|
-
storage.setCookie(cookieName, '1', undefined, undefined, nextDomain);
|
|
183
|
-
|
|
184
|
-
// read test cookie to verify domain was valid
|
|
185
|
-
testCookie = storage.getCookie(cookieName);
|
|
186
|
-
|
|
187
|
-
// delete test cookie
|
|
188
|
-
storage.setCookie(cookieName, '', 'Thu, 01 Jan 1970 00:00:01 GMT', undefined, nextDomain);
|
|
189
|
-
|
|
190
|
-
if (testCookie === '1') {
|
|
191
|
-
// cookie was written successfully using test domain so the topDomain is updated
|
|
192
|
-
topDomain = nextDomain;
|
|
193
|
-
} else {
|
|
194
|
-
// cookie failed to write using test domain so exit by returning the topDomain
|
|
195
|
-
return topDomain;
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
|
|
176
|
+
domainOverride: domainOverrideToRootDomain(storage, 'sharedId'),
|
|
200
177
|
};
|
|
201
178
|
|
|
202
179
|
submodule('userId', sharedIdSystemSubmodule);
|
|
@@ -21,7 +21,7 @@ export const sharethroughAdapterSpec = {
|
|
|
21
21
|
isBidRequestValid: bid => !!bid.params.pkey && bid.bidder === BIDDER_CODE,
|
|
22
22
|
|
|
23
23
|
buildRequests: (bidRequests, bidderRequest) => {
|
|
24
|
-
const timeout =
|
|
24
|
+
const timeout = bidderRequest.timeout;
|
|
25
25
|
const firstPartyData = bidderRequest.ortb2 || {};
|
|
26
26
|
|
|
27
27
|
const nonHttp = sharethroughInternal.getProtocol().indexOf('http') < 0;
|
|
@@ -364,7 +364,7 @@ function generateGeneralParams(generalObject, bidderRequest) {
|
|
|
364
364
|
const {syncEnabled, filterSettings} = config.getConfig('userSync') || {};
|
|
365
365
|
const {bidderCode} = bidderRequest;
|
|
366
366
|
const generalBidParams = generalObject.params;
|
|
367
|
-
const timeout =
|
|
367
|
+
const timeout = bidderRequest.timeout;
|
|
368
368
|
|
|
369
369
|
// these params are snake_case instead of camelCase to allow backwards compatability on the server.
|
|
370
370
|
// in the future, these will be converted to camelCase to match our convention.
|
|
@@ -125,7 +125,7 @@ function buildRequestParams(bidderRequest = {}, placements = []) {
|
|
|
125
125
|
coppa: config.getConfig('coppa') === true ? 1 : 0,
|
|
126
126
|
ccpa: bidderRequest.uspConsent || undefined,
|
|
127
127
|
gdpr: bidderRequest.gdprConsent || undefined,
|
|
128
|
-
tmax:
|
|
128
|
+
tmax: bidderRequest.timeout
|
|
129
129
|
};
|
|
130
130
|
}
|
|
131
131
|
|
|
@@ -49,9 +49,7 @@ export const spec = {
|
|
|
49
49
|
imp: []
|
|
50
50
|
};
|
|
51
51
|
|
|
52
|
-
const
|
|
53
|
-
const globalTimeout = config.getConfig('bidderTimeout');
|
|
54
|
-
const tmax = globalTimeout ? Math.min(globalTimeout, callbackTimeout) : callbackTimeout;
|
|
52
|
+
const tmax = bidderRequest.timeout;
|
|
55
53
|
if (tmax) {
|
|
56
54
|
openRtbBidRequest.tmax = tmax;
|
|
57
55
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { deepAccess, getUniqueIdentifierStr } from '../src/utils.js';
|
|
2
2
|
import { registerBidder } from '../src/adapters/bidderFactory.js';
|
|
3
|
-
import { config } from '../src/config.js';
|
|
4
3
|
import { BANNER } from '../src/mediaTypes.js';
|
|
5
4
|
|
|
6
5
|
const SUPPORTED_AD_TYPES = [BANNER];
|
|
@@ -140,7 +139,7 @@ function buildCommonQueryParamsFromBids(validBidRequests, bidderRequest) {
|
|
|
140
139
|
device: {
|
|
141
140
|
ua: window.navigator.userAgent
|
|
142
141
|
},
|
|
143
|
-
tmax:
|
|
142
|
+
tmax: bidderRequest.timeout
|
|
144
143
|
};
|
|
145
144
|
|
|
146
145
|
return defaultParams;
|
package/modules/userId/eids.js
CHANGED
|
@@ -146,6 +146,24 @@ export const USER_IDS_CONFIG = {
|
|
|
146
146
|
}
|
|
147
147
|
},
|
|
148
148
|
|
|
149
|
+
// bidswitchId
|
|
150
|
+
'bidswitch': {
|
|
151
|
+
source: 'bidswitch.net',
|
|
152
|
+
atype: 3,
|
|
153
|
+
getValue: function(data) {
|
|
154
|
+
return data.id;
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
|
|
158
|
+
// medianetId
|
|
159
|
+
'medianet': {
|
|
160
|
+
source: 'media.net',
|
|
161
|
+
atype: 3,
|
|
162
|
+
getValue: function(data) {
|
|
163
|
+
return data.id;
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
|
|
149
167
|
// britepoolId
|
|
150
168
|
'britepoolid': {
|
|
151
169
|
source: 'britepool.com',
|
package/modules/userId/eids.md
CHANGED
|
@@ -105,6 +105,22 @@ userIdAsEids = [
|
|
|
105
105
|
segments: ['s1', 's2']
|
|
106
106
|
}
|
|
107
107
|
},
|
|
108
|
+
|
|
109
|
+
{
|
|
110
|
+
source: 'bidswitch.net',
|
|
111
|
+
uids: [{
|
|
112
|
+
id: 'some-random-id-value',
|
|
113
|
+
atype: 3
|
|
114
|
+
}]
|
|
115
|
+
},
|
|
116
|
+
|
|
117
|
+
{
|
|
118
|
+
source: 'media.net',
|
|
119
|
+
uids: [{
|
|
120
|
+
id: 'some-random-id-value',
|
|
121
|
+
atype: 3
|
|
122
|
+
}]
|
|
123
|
+
},
|
|
108
124
|
|
|
109
125
|
{
|
|
110
126
|
source: 'merkleinc.com',
|
|
@@ -74,6 +74,26 @@ function serializeSupplyChainObj(schainObj) {
|
|
|
74
74
|
return serializedSchain;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
+
/**
|
|
78
|
+
* Gets highest floor between getFloor.floor and params.bidfloor
|
|
79
|
+
* @param {Object} bid
|
|
80
|
+
* @param {Object} mediaType
|
|
81
|
+
* @param {Array} sizes
|
|
82
|
+
* @param {Number} bidfloor
|
|
83
|
+
* @returns {Number} floor
|
|
84
|
+
*/
|
|
85
|
+
function getBidFloor(bid, mediaType, sizes, bidfloor) {
|
|
86
|
+
let floor = bidfloor;
|
|
87
|
+
var size = sizes && sizes.length > 0 ? sizes[0] : '*';
|
|
88
|
+
if (typeof bid.getFloor === 'function') {
|
|
89
|
+
const floorInfo = bid.getFloor({currency: 'USD', mediaType, size});
|
|
90
|
+
if (typeof floorInfo === 'object' && floorInfo.currency === 'USD' && !isNaN(parseFloat(floorInfo.floor))) {
|
|
91
|
+
floor = Math.max(bidfloor, parseFloat(floorInfo.floor));
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return floor;
|
|
95
|
+
}
|
|
96
|
+
|
|
77
97
|
const isBidResponseValid = bid => {
|
|
78
98
|
if (!bid || !bid.requestId || !bid.cpm || !bid.ttl || !bid.currency) {
|
|
79
99
|
return false;
|
|
@@ -106,6 +126,7 @@ const buildRequests = (validBidRequests, bidderRequest) => {
|
|
|
106
126
|
|
|
107
127
|
const videoContext = deepAccess(bid, 'mediaTypes.video.context');
|
|
108
128
|
const bidfloor = deepAccess(bid, `params.bidfloor`, 0);
|
|
129
|
+
const floor = getBidFloor(bid, adType, sizes, bidfloor);
|
|
109
130
|
|
|
110
131
|
const queryParams = {
|
|
111
132
|
id: bid.params.id,
|
|
@@ -120,7 +141,7 @@ const buildRequests = (validBidRequests, bidderRequest) => {
|
|
|
120
141
|
pid: bid.params.pid,
|
|
121
142
|
requestId: bid.bidId,
|
|
122
143
|
schain: serializeSupplyChainObj(bid.schain) || '',
|
|
123
|
-
bidfloor,
|
|
144
|
+
bidfloor: floor,
|
|
124
145
|
d: getDomainWithoutSubdomain(hostname), // 'vidoomy.com',
|
|
125
146
|
// TODO: does the fallback make sense here?
|
|
126
147
|
sp: encodeURIComponent(bidderRequest.refererInfo.page || bidderRequest.refererInfo.topmostLocation),
|
|
@@ -155,7 +155,7 @@ export const spec = {
|
|
|
155
155
|
coppa: config.getConfig('coppa') === true ? 1 : 0,
|
|
156
156
|
ccpa: bidderRequest.uspConsent || undefined,
|
|
157
157
|
gdpr: bidderRequest.gdprConsent || undefined,
|
|
158
|
-
tmax:
|
|
158
|
+
tmax: bidderRequest.timeout
|
|
159
159
|
};
|
|
160
160
|
|
|
161
161
|
const len = validBidRequests.length;
|
|
@@ -53,7 +53,7 @@ export const spec = {
|
|
|
53
53
|
const bidId = bidRequest.bidId;
|
|
54
54
|
const transactionId = bidRequest.transactionId;
|
|
55
55
|
const unitCode = bidRequest.adUnitCode;
|
|
56
|
-
const timeout =
|
|
56
|
+
const timeout = bidderRequest.timeout;
|
|
57
57
|
const language = window.navigator.language;
|
|
58
58
|
const screenSize = window.screen.width + 'x' + window.screen.height;
|
|
59
59
|
const payload = {
|
package/package.json
CHANGED
package/src/Renderer.js
CHANGED
|
@@ -22,6 +22,7 @@ export function Renderer(options) {
|
|
|
22
22
|
this.config = config;
|
|
23
23
|
this.handlers = {};
|
|
24
24
|
this.id = id;
|
|
25
|
+
this.renderNow = renderNow;
|
|
25
26
|
|
|
26
27
|
// a renderer may push to the command queue to delay rendering until the
|
|
27
28
|
// render function is loaded by loadExternalScript, at which point the the command
|
|
@@ -110,7 +111,7 @@ Renderer.prototype.process = function() {
|
|
|
110
111
|
* @returns {Boolean}
|
|
111
112
|
*/
|
|
112
113
|
export function isRendererRequired(renderer) {
|
|
113
|
-
return !!(renderer && renderer.url);
|
|
114
|
+
return !!(renderer && (renderer.url || renderer.renderNow));
|
|
114
115
|
}
|
|
115
116
|
|
|
116
117
|
/**
|
package/src/native.js
CHANGED
|
@@ -750,7 +750,11 @@ export function toLegacyResponse(ortbResponse, ortbRequest) {
|
|
|
750
750
|
if (asset.title) {
|
|
751
751
|
legacyResponse.title = asset.title.text;
|
|
752
752
|
} else if (asset.img) {
|
|
753
|
-
legacyResponse[requestAsset.img.type === NATIVE_IMAGE_TYPES.MAIN ? 'image' : 'icon'] =
|
|
753
|
+
legacyResponse[requestAsset.img.type === NATIVE_IMAGE_TYPES.MAIN ? 'image' : 'icon'] = {
|
|
754
|
+
url: asset.img.url,
|
|
755
|
+
width: asset.img.w,
|
|
756
|
+
height: asset.img.h
|
|
757
|
+
};
|
|
754
758
|
} else if (asset.data) {
|
|
755
759
|
legacyResponse[PREBID_NATIVE_DATA_KEYS_TO_ORTB_INVERSE[NATIVE_ASSET_TYPES_INVERSE[requestAsset.data.type]]] = asset.data.value;
|
|
756
760
|
}
|
|
@@ -1403,8 +1403,8 @@ describe('auctionmanager.js', function () {
|
|
|
1403
1403
|
assert.equal(addedBid.native.title, 'Sample title')
|
|
1404
1404
|
assert.equal(addedBid.native.sponsoredBy, 'Sample sponsoredBy')
|
|
1405
1405
|
assert.equal(addedBid.native.clickUrl, 'http://www.click.com')
|
|
1406
|
-
assert.equal(addedBid.native.image, 'https://www.example.com/image.png')
|
|
1407
|
-
assert.equal(addedBid.native.icon, 'https://www.example.com/icon.png')
|
|
1406
|
+
assert.equal(addedBid.native.image.url, 'https://www.example.com/image.png')
|
|
1407
|
+
assert.equal(addedBid.native.icon.url, 'https://www.example.com/icon.png')
|
|
1408
1408
|
assert.equal(addedBid.native.impressionTrackers[0], 'http://www.imptracker.com')
|
|
1409
1409
|
assert.equal(addedBid.native.javascriptTrackers, '<script async src="http://www.jstracker.com/file.js"></script>')
|
|
1410
1410
|
});
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import {domainOverrideToRootDomain} from 'libraries/domainOverrideToRootDomain/index.js';
|
|
2
|
+
import {getStorageManager} from 'src/storageManager.js';
|
|
3
|
+
import {MODULE_TYPE_UID} from '../../../../src/activities/modules';
|
|
4
|
+
|
|
5
|
+
const storage = getStorageManager({ moduleName: 'test', moduleType: MODULE_TYPE_UID });
|
|
6
|
+
const domainOverride = domainOverrideToRootDomain(storage, 'test');
|
|
7
|
+
|
|
8
|
+
describe('domainOverride', () => {
|
|
9
|
+
let sandbox, domain, cookies, rejectCookiesFor;
|
|
10
|
+
let setCookieStub;
|
|
11
|
+
|
|
12
|
+
beforeEach(() => {
|
|
13
|
+
sandbox = sinon.createSandbox();
|
|
14
|
+
sandbox.stub(document, 'domain').get(() => domain);
|
|
15
|
+
cookies = {};
|
|
16
|
+
sandbox.stub(storage, 'getCookie').callsFake((key) => cookies[key]);
|
|
17
|
+
rejectCookiesFor = null;
|
|
18
|
+
setCookieStub = sandbox.stub(storage, 'setCookie').callsFake((key, value, expires, sameSite, domain) => {
|
|
19
|
+
if (domain !== rejectCookiesFor) {
|
|
20
|
+
if (expires != null) {
|
|
21
|
+
expires = new Date(expires);
|
|
22
|
+
}
|
|
23
|
+
if (expires == null || expires > Date.now()) {
|
|
24
|
+
cookies[key] = value;
|
|
25
|
+
} else {
|
|
26
|
+
delete cookies[key];
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
afterEach(() => sandbox.restore())
|
|
33
|
+
|
|
34
|
+
it('test cookies include the module name', () => {
|
|
35
|
+
domain = 'greatpublisher.com'
|
|
36
|
+
rejectCookiesFor = 'greatpublisher.com'
|
|
37
|
+
|
|
38
|
+
// stub Date.now() to return a constant value
|
|
39
|
+
sandbox.stub(Date, 'now').returns(1234567890)
|
|
40
|
+
|
|
41
|
+
const randomName = `adapterV${(Math.random() * 1e8).toString(16)}`
|
|
42
|
+
const localDomainOverride = domainOverrideToRootDomain(storage, randomName)
|
|
43
|
+
|
|
44
|
+
const time = Date.now();
|
|
45
|
+
localDomainOverride();
|
|
46
|
+
|
|
47
|
+
sandbox.assert.callCount(setCookieStub, 2)
|
|
48
|
+
sandbox.assert.calledWith(setCookieStub, `_gd${time}_${randomName}`, '1', undefined, undefined, 'greatpublisher.com')
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it('will return the root domain when given a subdomain', () => {
|
|
52
|
+
const test_domains = [
|
|
53
|
+
'deeply.nested.subdomain.for.greatpublisher.com',
|
|
54
|
+
'greatpublisher.com',
|
|
55
|
+
'subdomain.greatpublisher.com',
|
|
56
|
+
'a-subdomain.greatpublisher.com',
|
|
57
|
+
];
|
|
58
|
+
|
|
59
|
+
test_domains.forEach((testDomain) => {
|
|
60
|
+
domain = testDomain
|
|
61
|
+
rejectCookiesFor = 'com'
|
|
62
|
+
expect(domainOverride()).to.equal('greatpublisher.com');
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it(`If we can't set cookies on the root domain, we'll return the subdomain`, () => {
|
|
67
|
+
domain = 'subdomain.greatpublisher.com'
|
|
68
|
+
rejectCookiesFor = 'greatpublisher.com'
|
|
69
|
+
expect(domainOverride()).to.equal('subdomain.greatpublisher.com');
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
it('Will return undefined if we can\'t set cookies on the root domain or the subdomain', () => {
|
|
73
|
+
domain = 'subdomain.greatpublisher.com'
|
|
74
|
+
rejectCookiesFor = 'subdomain.greatpublisher.com'
|
|
75
|
+
expect(domainOverride()).to.equal(undefined);
|
|
76
|
+
});
|
|
77
|
+
});
|
|
@@ -76,7 +76,8 @@ describe('AcuityAdsBidAdapter', function () {
|
|
|
76
76
|
gdprConsent: 'COvFyGBOvFyGBAbAAAENAPCAAOAAAAAAAAAAAEEUACCKAAA.IFoEUQQgAIQwgIwQABAEAAAAOIAACAIAAAAQAIAgEAACEAAAAAgAQBAAAAAAAGBAAgAAAAAAAFAAECAAAgAAQARAEQAAAAAJAAIAAgAAAYQEAAAQmAgBC3ZAYzUw',
|
|
77
77
|
refererInfo: {
|
|
78
78
|
referer: 'https://test.com'
|
|
79
|
-
}
|
|
79
|
+
},
|
|
80
|
+
timeout: 500
|
|
80
81
|
};
|
|
81
82
|
|
|
82
83
|
describe('isBidRequestValid', function () {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { amxIdSubmodule } from 'modules/amxIdSystem.js';
|
|
1
|
+
import { amxIdSubmodule, storage } from 'modules/amxIdSystem.js';
|
|
2
2
|
import { server } from 'test/mocks/xhr.js';
|
|
3
3
|
import * as utils from 'src/utils.js';
|
|
4
4
|
|
|
@@ -48,38 +48,17 @@ describe('validateConfig', () => {
|
|
|
48
48
|
logErrorSpy.restore();
|
|
49
49
|
});
|
|
50
50
|
|
|
51
|
-
it('should
|
|
51
|
+
it('should allow configuration with no storage', () => {
|
|
52
52
|
expect(
|
|
53
53
|
amxIdSubmodule.getId(
|
|
54
54
|
{
|
|
55
55
|
...config,
|
|
56
|
-
storage:
|
|
56
|
+
storage: undefined
|
|
57
57
|
},
|
|
58
58
|
null,
|
|
59
59
|
null
|
|
60
60
|
)
|
|
61
|
-
).to.equal(undefined);
|
|
62
|
-
|
|
63
|
-
expect(logErrorSpy.calledOnce).to.be.true;
|
|
64
|
-
expect(logErrorSpy.lastCall.lastArg).to.contain('storage is required');
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
it('should return undefined if config.storage.type !== "html5"', () => {
|
|
68
|
-
expect(
|
|
69
|
-
amxIdSubmodule.getId(
|
|
70
|
-
{
|
|
71
|
-
...config,
|
|
72
|
-
storage: {
|
|
73
|
-
type: 'cookie',
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
|
-
null,
|
|
77
|
-
null
|
|
78
|
-
)
|
|
79
|
-
).to.equal(undefined);
|
|
80
|
-
|
|
81
|
-
expect(logErrorSpy.calledOnce).to.be.true;
|
|
82
|
-
expect(logErrorSpy.lastCall.lastArg).to.contain('cookie');
|
|
61
|
+
).to.not.equal(undefined);
|
|
83
62
|
});
|
|
84
63
|
|
|
85
64
|
it('should return undefined if expires > 30', () => {
|
|
@@ -111,10 +90,18 @@ describe('getId', () => {
|
|
|
111
90
|
});
|
|
112
91
|
|
|
113
92
|
it('should call the sync endpoint and accept a valid response', () => {
|
|
93
|
+
storage.setDataInLocalStorage('__amuidpb', TEST_ID);
|
|
94
|
+
|
|
114
95
|
const { callback } = amxIdSubmodule.getId(config, null, null);
|
|
115
96
|
callback(spy);
|
|
116
97
|
|
|
117
98
|
const [request] = server.requests;
|
|
99
|
+
expect(request.withCredentials).to.be.true
|
|
100
|
+
expect(request.requestHeaders['Content-Type']).to.match(/text\/plain/)
|
|
101
|
+
|
|
102
|
+
const { search } = utils.parseUrl(request.url);
|
|
103
|
+
expect(search.av).to.equal(amxIdSubmodule.version);
|
|
104
|
+
expect(search.am).to.equal(TEST_ID);
|
|
118
105
|
expect(request.method).to.equal('GET');
|
|
119
106
|
|
|
120
107
|
request.respond(
|
|
@@ -187,7 +174,7 @@ describe('getId', () => {
|
|
|
187
174
|
);
|
|
188
175
|
|
|
189
176
|
const [, secondRequest] = server.requests;
|
|
190
|
-
expect(secondRequest.url).to.
|
|
177
|
+
expect(secondRequest.url).to.match(new RegExp(`^${intermediateValue}\?`));
|
|
191
178
|
secondRequest.respond(
|
|
192
179
|
200,
|
|
193
180
|
{},
|