Skip to content

Commit

Permalink
Merge pull request #1586 from prebid/master
Browse files Browse the repository at this point in the history
[pull] master from prebid:master
  • Loading branch information
jefftmahoney committed Jan 9, 2024
2 parents 6275c00 + 2b25ec4 commit 1659209
Show file tree
Hide file tree
Showing 149 changed files with 7,073 additions and 2,511 deletions.
35 changes: 33 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,25 @@ module.exports = {
node: {
moduleDirectory: ['node_modules', './']
}
},
'jsdoc': {
mode: 'typescript',
tagNamePreference: {
'tag constructor': 'constructor',
extends: 'extends',
method: 'method',
return: 'return',
}
}
},
extends: 'standard',
extends: [
'standard',
'plugin:jsdoc/recommended'
],
plugins: [
'prebid',
'import'
'import',
'jsdoc'
],
globals: {
'BROWSERSTACK_USERNAME': false,
Expand Down Expand Up @@ -46,6 +59,24 @@ module.exports = {
'no-undef': 2,
'no-useless-escape': 'off',
'no-console': 'error',
'jsdoc/check-types': 'off',
'jsdoc/newline-after-description': 'off',
'jsdoc/require-jsdoc': 'off',
'jsdoc/require-param': 'off',
'jsdoc/require-param-description': 'off',
'jsdoc/require-param-name': 'off',
'jsdoc/require-param-type': 'off',
'jsdoc/require-property': 'off',
'jsdoc/require-property-description': 'off',
'jsdoc/require-property-name': 'off',
'jsdoc/require-property-type': 'off',
'jsdoc/require-returns': 'off',
'jsdoc/require-returns-check': 'off',
'jsdoc/require-returns-description': 'off',
'jsdoc/require-returns-type': 'off',
'jsdoc/require-yields': 'off',
'jsdoc/require-yields-check': 'off',
'jsdoc/tag-lines': 'off'
},
overrides: Object.keys(allowedModules).map((key) => ({
files: key + '/**/*.js',
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:

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

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

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
9 changes: 4 additions & 5 deletions libraries/ortbConverter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@ However, there are two restrictions (to avoid them, use the [other customization
)
```

<a id="fine-customization" />
### Fine grained customization - imp, request, bidResponse, response
### <a id="fine-customization" /> Fine grained customization - imp, request, bidResponse, response

When invoked, `toORTB({bidRequests, bidderRequest})` first loops through each request in `bidRequests`, converting them into ORTB `imp` objects.
It then packages them into a single ORTB request, adding other parameters that are not imp-specific (such as for example `request.tmax`).
Expand All @@ -91,7 +90,7 @@ a single return value.

You can customize each of these steps using the `ortbConverter` arguments `imp`, `request`, `bidResponse` and `response`:

### <a id="imp" />Customizing imps: `imp(buildImp, bidRequest, context)`
### <a id="imp" /> Customizing imps: `imp(buildImp, bidRequest, context)`

Invoked once for each input `bidRequest`; should return the ORTB `imp` object to include in the request.
The arguments are:
Expand All @@ -101,7 +100,7 @@ The arguments are:
- `context`: a [context object](#context) that contains at least:
- `bidderRequest`: the `bidderRequest` argument passed to `toORTB`.

#### <a id="params" />Example: attaching custom bid params
#### <a id="params" /> Example: attaching custom bid params

```javascript
const converter = ortbConverter({
Expand Down Expand Up @@ -351,7 +350,7 @@ const converter = ortbConverter({
- the `context` argument of `ortbConverter`: e.g. `ortbConverter({context: {ttl: 30}})`. This will set `context.ttl = 30` globally for the converter.
- the `context` argument of `toORTB`: e.g. `converter.toORTB({bidRequests, bidderRequest, context: {ttl: 30}})`. This will set `context.ttl = 30` only for this request.

### <a id="special-context"/> Special `context` properties
### <a id="special-context" /> Special `context` properties

For ease of use, the conversion logic gives special meaning to some context properties:

Expand Down
3 changes: 2 additions & 1 deletion modules/.submodules.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@
"adqueryIdSystem",
"gravitoIdSystem",
"freepassIdSystem",
"operaadsIdSystem"
"operaadsIdSystem",
"mygaruIdSystem"
],
"adpod": [
"freeWheelAdserverVideo",
Expand Down
28 changes: 16 additions & 12 deletions modules/adagioAnalyticsAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const enc = window.encodeURIComponent;

/**
/* BEGIN ADAGIO.JS CODE
*/
*/

function canAccessTopWindow() {
try {
Expand All @@ -71,12 +71,12 @@ const adagioEnqueue = function adagioEnqueue(action, data) {
};

/**
* END ADAGIO.JS CODE
*/
* END ADAGIO.JS CODE
*/

/**
* UTILS FUNCTIONS
*/
* UTILS FUNCTIONS
*/

const guard = {
adagio: (value) => isAdagio(value),
Expand All @@ -97,6 +97,10 @@ function getAdapterNameForAlias(aliasName) {
};

function isAdagio(value) {
if (!value) {
return false
}

return value.toLowerCase().includes('adagio') ||
getAdapterNameForAlias(value).toLowerCase().includes('adagio');
};
Expand Down Expand Up @@ -126,9 +130,9 @@ function addKeyPrefix(obj, prefix) {
}

/**
* sendRequest to Adagio. It filter null values and encode each query param.
* @param {Object} qp
*/
* sendRequest to Adagio. It filter null values and encode each query param.
* @param {Object} qp
*/
function sendRequest(qp) {
// Removing null values
qp = Object.keys(qp).reduce((acc, key) => {
Expand Down Expand Up @@ -160,7 +164,7 @@ function getTargetedAuctionId(bid) {

/**
* END UTILS FUNCTIONS
*/
*/

/**
* HANDLERS
Expand All @@ -171,7 +175,7 @@ function getTargetedAuctionId(bid) {
* - handlerAdRender
*
* Each handler is called when the event is fired.
*/
*/

function handlerAuctionInit(event) {
const w = getCurrentWindow();
Expand Down Expand Up @@ -267,7 +271,7 @@ function handlerAuctionInit(event) {
* handlerBidResponse allow to track the adagio bid response
* and to update the auction cache with the seat ID.
* No beacon is sent here.
*/
*/
function handlerBidResponse(event) {
if (!guard.adagio(event.bidder)) {
return;
Expand Down Expand Up @@ -368,7 +372,7 @@ function handlerAdRender(event, isSuccess) {

/**
* END HANDLERS
*/
*/

let adagioAdapter = Object.assign(adapter({ emptyUrl, analyticsType }), {
track: function(event) {
Expand Down
10 changes: 5 additions & 5 deletions modules/adagioBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -700,9 +700,9 @@ function getPageDimensions() {
}

/**
* @todo Move to prebid Core as Utils.
* @returns
*/
* @todo Move to prebid Core as Utils.
* @returns
*/
function getViewPortDimensions() {
if (!isSafeFrameWindow() && !canAccessTopWindow()) {
return '';
Expand Down Expand Up @@ -832,8 +832,8 @@ function getPrintNumber(adUnitCode, bidderRequest) {
}

/**
* domLoading feature is computed on window.top if reachable.
*/
* domLoading feature is computed on window.top if reachable.
*/
function getDomLoadingDuration() {
let domLoadingDuration = -1;
let performance;
Expand Down
Loading

0 comments on commit 1659209

Please sign in to comment.