Skip to content

Commit 1c14dbe

Browse files
authored
Merge branch 'prebid:master' into setupad-adapter
2 parents 7fe9ea5 + 07962d6 commit 1c14dbe

File tree

829 files changed

+72475
-20089
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

829 files changed

+72475
-20089
lines changed

.devcontainer/devcontainer.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
},
1010

1111
"postCreateCommand": "bash .devcontainer/postCreate.sh",
12-
12+
// Make is-docker work again
13+
"postStartCommand": "test -f /.dockerenv || sudo touch /.dockerenv",
14+
1315
// Set *default* container specific settings.json values on container create.
1416
"settings": {},
1517

.eslintrc.js

+33-2
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,25 @@ module.exports = {
1111
node: {
1212
moduleDirectory: ['node_modules', './']
1313
}
14+
},
15+
'jsdoc': {
16+
mode: 'typescript',
17+
tagNamePreference: {
18+
'tag constructor': 'constructor',
19+
extends: 'extends',
20+
method: 'method',
21+
return: 'return',
22+
}
1423
}
1524
},
16-
extends: 'standard',
25+
extends: [
26+
'standard',
27+
'plugin:jsdoc/recommended'
28+
],
1729
plugins: [
1830
'prebid',
19-
'import'
31+
'import',
32+
'jsdoc'
2033
],
2134
globals: {
2235
'BROWSERSTACK_USERNAME': false,
@@ -46,6 +59,24 @@ module.exports = {
4659
'no-undef': 2,
4760
'no-useless-escape': 'off',
4861
'no-console': 'error',
62+
'jsdoc/check-types': 'off',
63+
'jsdoc/newline-after-description': 'off',
64+
'jsdoc/require-jsdoc': 'off',
65+
'jsdoc/require-param': 'off',
66+
'jsdoc/require-param-description': 'off',
67+
'jsdoc/require-param-name': 'off',
68+
'jsdoc/require-param-type': 'off',
69+
'jsdoc/require-property': 'off',
70+
'jsdoc/require-property-description': 'off',
71+
'jsdoc/require-property-name': 'off',
72+
'jsdoc/require-property-type': 'off',
73+
'jsdoc/require-returns': 'off',
74+
'jsdoc/require-returns-check': 'off',
75+
'jsdoc/require-returns-description': 'off',
76+
'jsdoc/require-returns-type': 'off',
77+
'jsdoc/require-yields': 'off',
78+
'jsdoc/require-yields-check': 'off',
79+
'jsdoc/tag-lines': 'off'
4980
},
5081
overrides: Object.keys(allowedModules).map((key) => ({
5182
files: key + '/**/*.js',

.github/workflows/codeql-analysis.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ jobs:
3838

3939
steps:
4040
- name: Checkout repository
41-
uses: actions/checkout@v3
41+
uses: actions/checkout@v4
4242

4343
# Initializes the CodeQL tools for scanning.
4444
- name: Initialize CodeQL
45-
uses: github/codeql-action/init@v2
45+
uses: github/codeql-action/init@v3
4646
with:
4747
languages: ${{ matrix.language }}
4848
config-file: ./.github/codeql/codeql-config.yml
@@ -57,7 +57,7 @@ jobs:
5757
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5858
# If this step fails, then you should remove it and run the build manually (see below)
5959
- name: Autobuild
60-
uses: github/codeql-action/autobuild@v2
60+
uses: github/codeql-action/autobuild@v3
6161

6262
# ℹ️ Command-line programs to run using the OS shell.
6363
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -70,4 +70,4 @@ jobs:
7070
# ./location_of_script_within_repo/buildscript.sh
7171

7272
- name: Perform CodeQL Analysis
73-
uses: github/codeql-action/analyze@v2
73+
uses: github/codeql-action/analyze@v3

.github/workflows/issue_tracker.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
steps:
1515
- name: Generate token
1616
id: generate_token
17-
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92
17+
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a
1818
with:
1919
app_id: ${{ secrets.ISSUE_APP_ID }}
2020
private_key: ${{ secrets.ISSUE_APP_PEM }}

PR_REVIEW.md

-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ Follow steps above for general review process. In addition, please verify the fo
5555
- Adapters that accept a floor parameter must also support the [floors module](https://docs.prebid.org/dev-docs/modules/floors.html) -- look for a call to the `getFloor()` function.
5656
- Adapters cannot accept an schain parameter. Rather, they must look for the schain parameter at bidRequest.schain.
5757
- The bidderRequest.refererInfo.referer must be checked in addition to any bidder-specific parameter.
58-
- If they're getting the COPPA flag, it must come from config.getConfig('coppa');
5958
- Page position must come from bidrequest.mediaTypes.banner.pos or bidrequest.mediaTypes.video.pos
6059
- Global OpenRTB fields should come from [getConfig('ortb2');](https://docs.prebid.org/dev-docs/publisher-api-reference/setConfig.html#setConfig-fpd):
6160
- bcat, battr, badv

features.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[
22
"NATIVE",
3-
"VIDEO"
3+
"VIDEO",
4+
"UID2_CSTG"
45
]

gulpfile.js

+22-5
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,20 @@ function makeWebpackPkg(extraConfig = {}) {
158158
}
159159
}
160160

161+
function buildCreative() {
162+
return gulp.src(['**/*'])
163+
.pipe(webpackStream(require('./webpack.creative.js')))
164+
.pipe(gulp.dest('build/creative'))
165+
}
166+
167+
function updateCreativeExample(cb) {
168+
const CREATIVE_EXAMPLE = 'integrationExamples/gpt/x-domain/creative.html';
169+
const root = require('node-html-parser').parse(fs.readFileSync(CREATIVE_EXAMPLE));
170+
root.querySelectorAll('script')[0].textContent = fs.readFileSync('build/creative/creative.js')
171+
fs.writeFileSync(CREATIVE_EXAMPLE, root.toString())
172+
cb();
173+
}
174+
161175
function getModulesListToAddInBanner(modules) {
162176
if (!modules || modules.length === helpers.getModuleNames().length) {
163177
return 'All available modules for this version.'
@@ -405,6 +419,7 @@ function watchTaskMaker(options = {}) {
405419
return function watch(done) {
406420
var mainWatcher = gulp.watch([
407421
'src/**/*.js',
422+
'libraries/**/*.js',
408423
'modules/**/*.js',
409424
].concat(options.alsoWatch));
410425

@@ -415,8 +430,8 @@ function watchTaskMaker(options = {}) {
415430
}
416431
}
417432

418-
const watch = watchTaskMaker({alsoWatch: ['test/**/*.js'], task: () => gulp.series(clean, gulp.parallel(lint, 'build-bundle-dev', test))});
419-
const watchFast = watchTaskMaker({livereload: false, task: () => gulp.series('build-bundle-dev')});
433+
const watch = watchTaskMaker({alsoWatch: ['test/**/*.js'], task: () => gulp.series(clean, gulp.parallel(lint, 'build-bundle-dev', test, buildCreative))});
434+
const watchFast = watchTaskMaker({livereload: false, task: () => gulp.parallel('build-bundle-dev', buildCreative)});
420435

421436
// support tasks
422437
gulp.task(lint);
@@ -447,21 +462,23 @@ gulp.task('build-bundle-verbose', gulp.series(makeWebpackPkg({
447462
}
448463
}), gulpBundle.bind(null, false)));
449464

465+
gulp.task('build-creative', gulp.series(buildCreative, updateCreativeExample));
466+
450467
// public tasks (dependencies are needed for each task since they can be ran on their own)
451468
gulp.task('test-only', test);
452469
gulp.task('test-all-features-disabled', testTaskMaker({disableFeatures: require('./features.json'), oneBrowser: 'chrome', watch: false}));
453-
gulp.task('test', gulp.series(clean, lint, gulp.series('test-all-features-disabled', 'test-only')));
470+
gulp.task('test', gulp.series(clean, lint, gulp.parallel('build-creative', gulp.series('test-all-features-disabled', 'test-only'))));
454471

455472
gulp.task('test-coverage', gulp.series(clean, testCoverage));
456473
gulp.task(viewCoverage);
457474

458475
gulp.task('coveralls', gulp.series('test-coverage', coveralls));
459476

460-
gulp.task('build', gulp.series(clean, 'build-bundle-prod'));
477+
gulp.task('build', gulp.series(clean, 'build-bundle-prod', 'build-creative'));
461478
gulp.task('build-postbid', gulp.series(escapePostbidConfig, buildPostbid));
462479

463480
gulp.task('serve', gulp.series(clean, lint, gulp.parallel('build-bundle-dev', watch, test)));
464-
gulp.task('serve-fast', gulp.series(clean, gulp.parallel('build-bundle-dev', watchFast)));
481+
gulp.task('serve-fast', gulp.series(clean, gulp.parallel('build-bundle-dev', buildCreative, watchFast)));
465482
gulp.task('serve-prod', gulp.series(clean, gulp.parallel('build-bundle-prod', startLocalServer)));
466483
gulp.task('serve-and-test', gulp.series(clean, gulp.parallel('build-bundle-dev', watchFast, testTaskMaker({watch: true}))));
467484
gulp.task('serve-e2e', gulp.series(clean, 'build-bundle-prod', gulp.parallel(() => startIntegServer(), startLocalServer)));

integrationExamples/gpt/adUnitFloors.html

-1
Original file line numberDiff line numberDiff line change
@@ -109,4 +109,3 @@ <h5>Div-1</h5>
109109
</body>
110110

111111
</html>
112-
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
<html>
2+
<head>
3+
<script async src="https://www.googletagservices.com/tag/js/gpt.js"></script>
4+
<script async src="../../build/dev/prebid.js"></script>
5+
<script>
6+
var FAILSAFE_TIMEOUT = 3000;
7+
8+
var adUnits = [
9+
{
10+
code: 'div-gpt-ad-1683695049516-0',
11+
mediaTypes: {
12+
banner: {
13+
sizes: [[320, 320]]
14+
}
15+
},
16+
bids: [{
17+
bidder: 'adnuntius',
18+
params: {
19+
auId: "201208",
20+
network: "adnuntius",
21+
bidType: 'netBid'
22+
}
23+
}]
24+
},
25+
];
26+
var googletag = googletag || {};
27+
googletag.cmd = googletag.cmd || [];
28+
googletag.cmd.push(function() {
29+
googletag.pubads().disableInitialLoad();
30+
});
31+
32+
var pbjs = pbjs || {};
33+
pbjs.que = pbjs.que || [];
34+
35+
pbjs.que.push(function() {
36+
pbjs.setConfig({
37+
enableSendAllBids: true,
38+
targetingControls: {
39+
alwaysIncludeDeals: true
40+
},
41+
userSync: {
42+
syncEnabled: false
43+
}
44+
});
45+
46+
pbjs.setBidderConfig({
47+
bidders: ['adnuntius'],
48+
config: {
49+
bidType: 'netBid'
50+
}
51+
});
52+
53+
pbjs.addAdUnits(adUnits);
54+
pbjs.requestBids({bidsBackHandler: initAdserver});
55+
});
56+
57+
function initAdserver() {
58+
if (pbjs.initAdserverSet) return;
59+
pbjs.initAdserverSet = true;
60+
googletag.cmd.push(function() {
61+
pbjs.que.push(function() {
62+
pbjs.setTargetingForGPTAsync('div-gpt-ad-1683695049516-0');
63+
googletag.pubads().refresh();
64+
});
65+
});
66+
}
67+
68+
// in case PBJS doesn't load
69+
setTimeout(function() {
70+
initAdserver();
71+
}, FAILSAFE_TIMEOUT);
72+
73+
window.googletag = window.googletag || {cmd: []};
74+
googletag.cmd.push(function() {
75+
googletag.defineSlot('/19660636/320x320', [320, 320], 'div-gpt-ad-1683695049516-0').addService(googletag.pubads());
76+
googletag.pubads().enableSingleRequest();
77+
googletag.enableServices();
78+
});
79+
</script>
80+
</head>
81+
<body>
82+
<h2>Adnuntius Prebid Adaptor Test</h2>
83+
<h5>Ad Slot 1</h5>
84+
85+
<!-- /19660636/320x320 -->
86+
<div id='div-gpt-ad-1683695049516-0' style='min-width: 320px; min-height: 320px;'>
87+
<script>
88+
googletag.cmd.push(function() {
89+
googletag.display('div-gpt-ad-1683695049516-0');
90+
});
91+
</script>
92+
</div>
93+
94+
</body>
95+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
<html>
2+
3+
<head>
4+
<script src="http://localhost:9999/build/dev/prebid.js" async></script>
5+
<script async src="https://www.googletagservices.com/tag/js/gpt.js"></script>
6+
<script async>
7+
const FAILSAFE_TIMEOUT = 8000;
8+
const PREBID_TIMEOUT = 5000;
9+
10+
const bidders = [
11+
{
12+
bidder: 'appnexus',
13+
params: {
14+
placementId: 13144370
15+
}
16+
}
17+
];
18+
19+
var adUnits = [
20+
{
21+
code: 'div-gpt-ad-1460505748561-0',
22+
mediaTypes: {
23+
banner: {
24+
sizes: [[300, 250], [300, 600]],
25+
}
26+
},
27+
bids: bidders,
28+
}
29+
];
30+
31+
32+
var pbjs = pbjs || {};
33+
pbjs.que = pbjs.que || [];
34+
var googletag = googletag || {};
35+
googletag.cmd = googletag.cmd || [];
36+
googletag.cmd.push(function () {
37+
googletag.pubads().disableInitialLoad();
38+
googletag.defineSlot('/19968336/header-bid-tag-0', [[300, 250], [300, 600]], 'div-gpt-ad-1460505748561-0').addService(googletag.pubads());
39+
googletag.pubads().enableSingleRequest();
40+
googletag.enableServices();
41+
});
42+
43+
pbjs.que.push(function () {
44+
pbjs.setConfig({
45+
debug: true,
46+
realTimeData: {
47+
auctionDelay: 100,
48+
dataProviders: [
49+
{
50+
name: "contxtful",
51+
waitForIt: true,
52+
params: {
53+
version: "Contact [email protected] for the API version",
54+
customer: "Contact [email protected] for the customer ID"
55+
}
56+
}
57+
]
58+
}
59+
});
60+
pbjs.addAdUnits(adUnits);
61+
pbjs.requestBids({
62+
bidsBackHandler: sendAdserverRequest,
63+
timeout: PREBID_TIMEOUT
64+
});
65+
});
66+
67+
function sendAdserverRequest() {
68+
if (pbjs.adserverRequestSent) return;
69+
pbjs.adserverRequestSent = true;
70+
googletag.cmd.push(function () {
71+
pbjs.que.push(function () {
72+
pbjs.setTargetingForGPTAsync();
73+
googletag.pubads().refresh();
74+
});
75+
});
76+
}
77+
78+
setTimeout(function () {
79+
sendAdserverRequest();
80+
}, FAILSAFE_TIMEOUT);
81+
82+
</script>
83+
</head>
84+
85+
<body>
86+
<h2>Contxtful RTD Provider</h2>
87+
<div id='div-gpt-ad-1460505748561-0'></div>
88+
</div>
89+
</body>
90+
91+
</html>

0 commit comments

Comments
 (0)