8000 [pull] master from prebid:master by pull[bot] · Pull Request #29 · adhese/Prebid.js · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[pull] master from prebid:master #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

8000
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,12 @@ To lint the code:
gulp lint
```

To lint and only show errors

```bash
gulp lint --no-lint-warnings
```

To run the unit tests:

```bash
Expand All @@ -245,7 +251,7 @@ gulp test

To run the unit tests for a particular file (example for pubmaticBidAdapter_spec.js):
```bash
gulp test --file "test/spec/modules/pubmaticBidAdapter_spec.js"
gulp test --file "test/spec/modules/pubmaticBidAdapter_spec.js" --nolint
```

To generate and view the code coverage reports:
Expand Down
14 changes: 7 additions & 7 deletions creative/constants.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// eslint-disable-next-line prebid/validate-imports
import CONSTANTS from '../src/constants.json';
import { AD_RENDER_FAILED_REASON, EVENTS, MESSAGES } from '../src/constants.js';

export const MESSAGE_REQUEST = CONSTANTS.MESSAGES.REQUEST;
export const MESSAGE_RESPONSE = CONSTANTS.MESSAGES.RESPONSE;
export const MESSAGE_EVENT = CONSTANTS.MESSAGES.EVENT;
export const EVENT_AD_RENDER_FAILED = CONSTANTS.EVENTS.AD_RENDER_FAILED;
export const EVENT_AD_RENDER_SUCCEEDED = CONSTANTS.EVENTS.AD_RENDER_SUCCEEDED;
export const ERROR_EXCEPTION = CONSTANTS.AD_RENDER_FAILED_REASON.EXCEPTION;
export const MESSAGE_REQUEST = MESSAGES.REQUEST;
export const MESSAGE_RESPONSE = MESSAGES.RESPONSE;
export const MESSAGE_EVENT = MESSAGES.EVENT;
export const EVENT_AD_RENDER_FAILED = EVENTS.AD_RENDER_FAILED;
export const EVENT_AD_RENDER_SUCCEEDED = EVENTS.AD_RENDER_SUCCEEDED;
export const ERROR_EXCEPTION = AD_RENDER_FAILED_REASON.EXCEPTION;
4 changes: 2 additions & 2 deletions creative/renderers/display/constants.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// eslint-disable-next-line prebid/validate-imports
import CONSTANTS from '../../../src/constants.json';
import { AD_RENDER_FAILED_REASON } from '../../../src/constants.js';

export const ERROR_NO_AD = CONSTANTS.AD_RENDER_FAILED_REASON.NO_AD;
export const ERROR_NO_AD = AD_RENDER_FAILED_REASON.NO_AD;
4 changes: 2 additions & 2 deletions creative/renderers/native/constants.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// eslint-disable-next-line prebid/validate-imports
import CONSTANTS from '../../../src/constants.json';
import { MESSAGES } from '../../../src/constants.js';

export const MESSAGE_NATIVE = CONSTANTS.MESSAGES.NATIVE;
export const MESSAGE_NATIVE = MESSAGES.NATIVE;
export const ACTION_RESIZE = 'resizeNativeHeight';
export const ACTION_CLICK = 'click';
export const ACTION_IMP = 'fireNativeImpressionTrackers';
Expand Down
8 changes: 7 additions & 1 deletion integrationExamples/gpt/adnuntius_example.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
bidder: 'adnuntius',
params: {
auId: "201208",
network: "adnuntius",
network: "1287",
bidType: 'netBid'
}
}]
Expand Down Expand Up @@ -50,6 +50,12 @@
}
});

pbjs.bidderSettings = {
standard: {
storageAllowed: true
}
};

pbjs.addAdUnits(adUnits);
pbjs.requestBids({bidsBackHandler: initAdserver});
});
Expand Down
8 changes: 4 additions & 4 deletions libraries/analyticsAdapter/AnalyticsAdapter.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import CONSTANTS from '../../src/constants.json';
import { EVENTS } from '../../src/constants.js';
import {ajax} from '../../src/ajax.js';
import {logError, logMessage} from '../../src/utils.js';
import * as events from '../../src/events.js';
Expand All @@ -9,8 +9,8 @@ export const _internal = {
const ENDPOINT = 'endpoint';
const BUNDLE = 'bundle';

export const DEFAULT_INCLUDE_EVENTS = Object.values(CONSTANTS.EVENTS)
.filter(ev => ev !== CONSTANTS.EVENTS.AUCTION_DEBUG);
export const DEFAULT_INCLUDE_EVENTS = Object.values(EVENTS)
.filter(ev => ev !== EVENTS.AUCTION_DEBUG);

let debounceDelay = 100;

Expand Down Expand Up @@ -114,7 +114,7 @@ export default function AnalyticsAdapter({ url, analyticsType, global, handler }
const trackedEvents = (() => {
const {includeEvents = DEFAULT_INCLUDE_EVENTS, excludeEvents = []} = (config || {});
return new Set(
Object.values(CONSTANTS.EVENTS)
Object.values(EVENTS)
.filter(ev => includeEvents.includes(ev))
.filter(ev => !excludeEvents.includes(ev))
);
Expand Down
6 changes: 2 additions & 4 deletions modules/33acrossAnalyticsAdapter.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { deepAccess, logInfo, logWarn, logError, deepClone } from '../src/utils.js';
import buildAdapter from '../libraries/analyticsAdapter/AnalyticsAdapter.js';
import adapterManager, { coppaDataHandler, gdprDataHandler, gppDataHandler, uspDataHandler } from '../src/adapterManager.js';
import CONSTANTS from '../src/constants.json';

/**
* @typedef {typeof import('../src/constants.json').EVENTS} EVENTS
* @typedef {typeof import('../src/constants.js').EVENTS} EVENTS
*/
const { EVENTS } = CONSTANTS;
import { EVENTS } from '../src/constants.js';

/** @typedef {'pending'|'available'|'targetingSet'|'rendered'|'timeout'|'rejected'|'noBid'|'error'} BidStatus */
/**
Expand Down
20 changes: 9 additions & 11 deletions modules/adWMGAnalyticsAdapter.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
import adapter from '../libraries/analyticsAdapter/AnalyticsAdapter.js';
import adapterManager from '../src/adapterManager.js';
import CONSTANTS from '../src/constants.json';
import { EVENTS } from '../src/constants.js';
import { ajax } from '../src/ajax.js';
const analyticsType = 'endpoint';
const url = 'https://analytics.wmgroup.us/analytic/collection';
const {
EVENTS: {
AUCTION_INIT,
AUCTION_END,
BID_REQUESTED,
BID_WON,
BID_TIMEOUT,
NO_BID,
BID_RESPONSE
}
} = CONSTANTS;
AUCTION_INIT,
AUCTION_END,
BID_REQUESTED,
BID_WON,
BID_TIMEOUT,
NO_BID,
BID_RESPONSE
} = EVENTS;

let timestampInit = null;

Expand Down
16 changes: 8 additions & 8 deletions modules/adagioAnalyticsAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

import adapter from '../libraries/analyticsAdapter/AnalyticsAdapter.js';
import adapterManager from '../src/adapterManager.js';
import CONSTANTS from '../src/constants.json';
import { EVENTS } from '../src/constants.js';
import { ajax } from '../src/ajax.js';
import { BANNER } from '../src/mediaTypes.js';
import { getWindowTop, getWindowSelf, deepAccess, logInfo, logError } from '../src/utils.js';
import { getGlobal } from '../src/prebidGlobal.js';

const emptyUrl = '';
const analyticsType = 'endpoint';
const events = Object.keys(CONSTANTS.EVENTS).map(key => CONSTANTS.EVENTS[key]);
const events = Object.keys(EVENTS).map(key => EVENTS[key]);
const ADAGIO_GVLID = 617;
const VERSION = '3.0.0';
const PREBID_VERSION = '$prebid.version$';
Expand Down Expand Up @@ -383,22 +383,22 @@ let adagioAdapter = Object.assign(adapter({ emptyUrl, analyticsType }), {

try {
switch (eventType) {
case CONSTANTS.EVENTS.AUCTION_INIT:
case EVENTS.AUCTION_INIT:
handlerAuctionInit(args);
break;
case CONSTANTS.EVENTS.BID_RESPONSE:
case EVENTS.BID_RESPONSE:
handlerBidResponse(args);
break;
case CONSTANTS.EVENTS.AUCTION_END:
case EVENTS.AUCTION_END:
handlerAuctionEnd(args);
break;
case CONSTANTS.EVENTS.BID_WON:
case EVENTS.BID_WON:
handlerBidWon(args);
break;
// AD_RENDER_SUCCEEDED seems redundant with BID_WON.
// case CONSTANTS.EVENTS.AD_RENDER_SUCCEEDED:
case CONSTANTS.EVENTS.AD_RENDER_FAILED:
handlerAdRender(args, eventType === CONSTANTS.EVENTS.AD_RENDER_SUCCEEDED);
case EVENTS.AD_RENDER_FAILED:
handlerAdRender(args, eventType === EVENTS.AD_RENDER_SUCCEEDED);
break;
}
} catch (error) {
Expand Down
16 changes: 8 additions & 8 deletions modules/adkernelAdnAnalyticsAdapter.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import adapter from '../libraries/analyticsAdapter/AnalyticsAdapter.js';
import CONSTANTS from '../src/constants.json';
import {EVENTS} from '../src/constants.js';
import adapterManager from '../src/adapterManager.js';
import { logError, parseUrl, _each } from '../src/utils.js';
import {ajax} from '../src/ajax.js';
Expand Down Expand Up @@ -51,26 +51,26 @@ let analyticsAdapter = Object.assign(adapter({analyticsType: 'endpoint'}),
}
let handler = null;
switch (eventType) {
case CONSTANTS.EVENTS.AUCTION_INIT:
case EVENTS.AUCTION_INIT:
if (analyticsAdapter.context.queue) {
analyticsAdapter.context.queue.init();
}
initPrivacy(analyticsAdapter.context.requestTemplate, args.bidderRequests);
handler = trackAuctionInit;
break;
case CONSTANTS.EVENTS.BID_REQUESTED:
case EVENTS.BID_REQUESTED:
handler = trackBidRequest;
break;
case CONSTANTS.EVENTS.BID_RESPONSE:
case EVENTS.BID_RESPONSE:
handler = trackBidResponse;
break;
case CONSTANTS.EVENTS.BID_WON:
case EVENTS.BID_WON:
handler = trackBidWon;
break;
case CONSTANTS.EVENTS.BID_TIMEOUT:
case EVENTS.BID_TIMEOUT:
handler = trackBidTimeout;
break;
case CONSTANTS.EVENTS.AUCTION_END:
case EVENTS.AUCTION_END:
handler = trackAuctionEnd;
break;
}
Expand All @@ -79,7 +79,7 @@ let analyticsAdapter = Object.assign(adapter({analyticsType: 'endpoint'}),
if (analyticsAdapter.context.queue) {
analyticsAdapter.context.queue.push(events);
}
if (eventType === CONSTANTS.EVENTS.AUCTION_END) {
if (eventType === EVENTS.AUCTION_END) {
sendAll();
}
}
Expand Down
4 changes: 2 additions & 2 deletions modules/adlooxAdServerVideo.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import { registerVideoSupport } from '../src/adServerManager.js';
import { command as analyticsCommand, COMMAND } from './adlooxAnalyticsAdapter.js';
import { ajax } from '../src/ajax.js';
import CONSTANTS from '../src/constants.json';
import { EVENTS } from '../src/constants.js';
import { targeting } from '../src/targeting.js';
import { logInfo, isFn, logError, isPlainObject, isStr, isBoolean, deepSetValue, deepClone, timestamp, logWarn } from '../src/utils.js';

Expand Down Expand Up @@ -74,7 +74,7 @@ function track(options, callback) {
bid.ext.adloox.video.adserver = false;

analyticsCommand(COMMAND.TRACK, {
eventType: CONSTANTS.EVENTS.BID_WON,
eventType: EVENTS.BID_WON,
args: bid
});
}
Expand Down
8 changes: 4 additions & 4 deletions modules/adlooxAnalyticsAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import adapter from '../libraries/analyticsAdapter/AnalyticsAdapter.js';
import {loadExternalScript} from '../src/adloader.js';
import {auctionManager} from '../src/auctionManager.js';
import {AUCTION_COMPLETED} from '../src/auction.js';
import CONSTANTS from '../src/constants.json';
import {EVENTS} from '../src/constants.js';
import {find} from '../src/polyfill.js';
import {getRefererInfo} from '../src/refererDetection.js';
import {
Expand Down Expand Up @@ -220,9 +220,9 @@ analyticsAdapter.url = function(url, args, bid) {
return url + a2qs(args);
}

analyticsAdapter[`handle_${CONSTANTS.EVENTS.AUCTION_END}`] = function(auctionDetails) {
analyticsAdapter[`handle_${EVENTS.AUCTION_END}`] = function(auctionDetails) {
if (!(auctionDetails.auctionStatus == AUCTION_COMPLETED && auctionDetails.bidsReceived.length > 0)) return;
analyticsAdapter[`handle_${CONSTANTS.EVENTS.AUCTION_END}`] = NOOP;
analyticsAdapter[`handle_${EVENTS.AUCTION_END}`] = NOOP;

logMessage(MODULE, 'preloading verification JS');

Expand All @@ -235,7 +235,7 @@ analyticsAdapter[`handle_${CONSTANTS.EVENTS.AUCTION_END}`] = function(auctionDet
insertElement(link);
}

analyticsAdapter[`handle_${CONSTANTS.EVENTS.BID_WON}`] = function(bid) {
analyticsAdapter[`handle_${EVENTS.BID_WON}`] = function(bid) {
if (deepAccess(bid, 'ext.adloox.video.adserver')) {
logMessage(MODULE, `measuring '${bid.mediaType}' ad unit code '${bid.adUnitCode}' via Ad Server module`);
return;
Expand Down
Loading
0