diff --git a/.github/actions/load/action.yml b/.github/actions/load/action.yml index e3fc00dc6..b9d8b0e4d 100644 --- a/.github/actions/load/action.yml +++ b/.github/actions/load/action.yml @@ -39,4 +39,5 @@ runs: wdir="$(pwd)" parent="$(dirname "$wdir")" target="$(basename "$wdir")" + export MSYS=winsymlinks:lnk tar ${{ steps.platform.outputs.result == 'win32' && '--force-local' || '' }} -C "$parent" -xf '${{ runner.temp }}/${{ inputs.name }}.tar' "$target" diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index fdd765cdd..6646543eb 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -184,7 +184,7 @@ jobs: sessions: ${{ inputs.browserstack-sessions }} - name: Run tests - uses: nick-fields/retry@v3 + uses: nick-fields/retry@v4 with: timeout_minutes: ${{ inputs.timeout }} max_attempts: 3 diff --git a/metadata/core.json b/metadata/core.json index faacd3cee..01628d38c 100644 --- a/metadata/core.json +++ b/metadata/core.json @@ -41,12 +41,6 @@ "moduleName": "validationFpdModule", "disclosureURL": "local://prebid/sharedId-optout.json" }, - { - "componentType": "prebid", - "componentName": "categoryTranslation", - "moduleName": "categoryTranslation", - "disclosureURL": "local://prebid/categoryTranslation.json" - }, { "componentType": "prebid", "componentName": "userId", diff --git a/modules/adxcgAnalyticsAdapter.js b/modules/adxcgAnalyticsAdapter.js index 04ccc64c4..66f3dd071 100644 --- a/modules/adxcgAnalyticsAdapter.js +++ b/modules/adxcgAnalyticsAdapter.js @@ -79,7 +79,6 @@ function mapBidResponse (bidResponse, eventType) { bidderCode: bidResponse.bidder, transactionId: bidResponse.transactionId, adUnitCode: bidResponse.adUnitCode, - statusMessage: bidResponse.statusMessage, mediaType: bidResponse.mediaType, renderedSize: bidResponse.size, cpm: bidResponse.cpm, @@ -97,7 +96,6 @@ function mapBidWon (bidResponse) { return [{ bidderCode: bidResponse.bidder, adUnitCode: bidResponse.adUnitCode, - statusMessage: bidResponse.statusMessage, mediaType: bidResponse.mediaType, renderedSize: bidResponse.size, cpm: bidResponse.cpm, diff --git a/modules/consentManagementTcf.ts b/modules/consentManagementTcf.ts index 48fe05e17..025c8d932 100644 --- a/modules/consentManagementTcf.ts +++ b/modules/consentManagementTcf.ts @@ -45,7 +45,7 @@ export type TCFConsentData = { /** * The response from the CMP. */ - vendorData: Record; + vendorData: Record; /** * Additional consent string, if provided by the CMP. * @see https://support.google.com/admanager/answer/9681920?hl=en diff --git a/modules/drawbridge.ts b/modules/drawbridge.ts index 820d1c7f7..36dbb64c3 100644 --- a/modules/drawbridge.ts +++ b/modules/drawbridge.ts @@ -2,7 +2,8 @@ import { config } from '../src/config.js'; import { startAuction, addApiMethod, type StartAuctionOptions } from '../src/prebid.js'; import { getGlobal } from '../src/prebidGlobal.js'; import { PbPromise, delay } from '../src/utils/promise.js'; -import { deepClone, deepSetValue, isArray, isNumber, isPlainObject, logError, logWarn, logInfo } from '../src/utils.js'; +import { deepClone, deepSetValue, isArray, isPlainObject, logError, logWarn, logInfo } from '../src/utils.js'; +import { isNumber } from '../src/utils/objects.js'; import { ACTIVITY_ENRICH_EIDS } from '../src/activities/activities.js'; import { isActivityAllowed } from '../src/activities/rules.js'; import { activityParams } from '../src/activities/activityParams.js'; diff --git a/modules/magniteAnalyticsAdapter.js b/modules/magniteAnalyticsAdapter.js index bf28dab4f..82313d15b 100644 --- a/modules/magniteAnalyticsAdapter.js +++ b/modules/magniteAnalyticsAdapter.js @@ -830,15 +830,6 @@ magniteAdapter.track = ({ eventType, args }) => { auctionData.floors = addFloorData(floorData); } - // Identify chrome cookieless trafic - if (!cookieless) { - const cdep = deepAccess(args, 'bidderRequests.0.ortb2.device.ext.cdep'); - if (cdep && (cdep.indexOf('treatment') !== -1 || cdep.indexOf('control_2') !== -1)) { - cookieless = 1; - auctionData.cdep = 1; - } - } - // GDPR info const gdprData = deepAccess(args, 'bidderRequests.0.gdprConsent'); if (gdprData) { diff --git a/modules/mobkoiAnalyticsAdapter.js b/modules/mobkoiAnalyticsAdapter.js index 4d35149bf..08829b234 100644 --- a/modules/mobkoiAnalyticsAdapter.js +++ b/modules/mobkoiAnalyticsAdapter.js @@ -420,7 +420,6 @@ function pickKeyFields(objType, eventArgs) { 'requestTimestamp', 'responseTimestamp', 'seatBidId', - 'statusMessage', 'timeToRespond', 'rejectionReason', 'ortbId', diff --git a/modules/nobidAnalyticsAdapter.js b/modules/nobidAnalyticsAdapter.js index 484e4dc2b..4a09b2feb 100644 --- a/modules/nobidAnalyticsAdapter.js +++ b/modules/nobidAnalyticsAdapter.js @@ -82,7 +82,7 @@ function cleanupObjectAttributes (obj, attributes) { } function sendBidWonEvent (event, eventType) { const data = deepClone(event); - cleanupObjectAttributes(data, ['bidderCode', 'size', 'statusMessage', 'adId', 'requestId', 'mediaType', 'adUnitCode', 'cpm', 'currency', 'originalCpm', 'originalCurrency', 'timeToRespond']); + cleanupObjectAttributes(data, ['bidderCode', 'size', 'adId', 'requestId', 'mediaType', 'adUnitCode', 'cpm', 'currency', 'originalCpm', 'originalCurrency', 'timeToRespond']); if (nobidAnalytics.topLocation) data.topLocation = nobidAnalytics.topLocation; sendEvent(data, eventType); } @@ -94,7 +94,7 @@ function sendAuctionEndEvent (event, eventType) { cleanupObjectAttributes(data, ['timestamp', 'timeout', 'auctionId', 'bidderRequests', 'bidsReceived']); if (data) cleanupObjectAttributes(data.bidderRequests, ['bidderCode', 'bidderRequestId', 'bids', 'refererInfo']); - if (data) cleanupObjectAttributes(data.bidsReceived, ['bidderCode', 'width', 'height', 'adUnitCode', 'statusMessage', 'requestId', 'mediaType', 'cpm', 'currency', 'originalCpm', 'originalCurrency']); + if (data) cleanupObjectAttributes(data.bidsReceived, ['bidderCode', 'width', 'height', 'adUnitCode', 'requestId', 'mediaType', 'cpm', 'currency', 'originalCpm', 'originalCurrency']); if (data) cleanupObjectAttributes(data.noBids, ['bidder', 'sizes', 'bidId']); if (data.bidderRequests) { data.bidderRequests.forEach(bidderRequest => { diff --git a/modules/ooloAnalyticsAdapter.js b/modules/ooloAnalyticsAdapter.js index 2bcacd92d..17881cb58 100644 --- a/modules/ooloAnalyticsAdapter.js +++ b/modules/ooloAnalyticsAdapter.js @@ -350,7 +350,6 @@ function mapBid({ delete bidObj['bidderWinsCount'] delete bidObj['schain'] delete bidObj['refererInfo'] - delete bidObj['statusMessage'] delete bidObj['status'] delete bidObj['adUrl'] delete bidObj['ad'] diff --git a/modules/overtoneRtdProvider.js b/modules/overtoneRtdProvider.js index 4b16d7260..8f8b01cb8 100644 --- a/modules/overtoneRtdProvider.js +++ b/modules/overtoneRtdProvider.js @@ -1,45 +1,38 @@ import { submodule } from '../src/hook.js'; import { ajaxBuilder } from '../src/ajax.js'; -import { safeJSONParse, logMessage as _logMessage } from '../src/utils.js'; +import { mergeDeep, safeJSONParse, logMessage } from '../src/utils.js'; -export const OVERTONE_URL = 'https://prebid-1.overtone.ai/contextual'; +export const OVERTONE_URL = 'https://prebid-1.overtone.ai/VendorService'; -// eslint-disable-next-line no-restricted-syntax -const logMessage = (...args) => { - _logMessage('Overtone', ...args); -}; +function log(...args) { + logMessage('Overtone', ...args); +} export async function fetchContextData(url = window.location.href) { const pageUrl = encodeURIComponent(url); - const requestUrl = `${OVERTONE_URL}?URL=${pageUrl}&InApp=False`; + const requestUrl = `${OVERTONE_URL}?pageUrl=${pageUrl}`; const request = window.ajaxBuilder || ajaxBuilder(); return new Promise((resolve, reject) => { - logMessage('Sending request to:', requestUrl); + log('Sending request to:', requestUrl); request(requestUrl, { success: (response) => { const data = safeJSONParse(response); - logMessage('Fetched data:', data); + log('Fetched data:', data); - if (!data || typeof data.status !== 'number') { + if (!data || !data.vendor) { reject(new Error('Invalid response format')); return; } - switch (data.status) { - case 1: // Success - resolve({ categories: data.categories || [] }); - break; - case 3: // Fail - case 4: // Ignore - resolve({ categories: [] }); - break; - default: - reject(new Error(`Unexpected response status: ${data.status}`)); - } + const segments = (data.sources && data.sources[0] && data.sources[0].segments) + ? data.sources[0].segments.map(s => s.id) + : []; + + resolve({ categories: segments }); }, error: (err) => { - logMessage('Error during request:', err); + log('Error during request:', err); reject(err); }, }); @@ -47,7 +40,7 @@ export async function fetchContextData(url = window.location.href) { } function init(config) { - logMessage('init', config); + log('init', config); return true; } @@ -58,16 +51,15 @@ export const overtoneRtdProvider = { fetchContextData() .then((contextData) => { if (contextData) { - if (!bidReqConfig.ortb2Fragments.global.site.ext) { - bidReqConfig.ortb2Fragments.global.site.ext = {}; - } - - bidReqConfig.ortb2Fragments.global.site.ext.data = contextData; + log('Fetched context data', contextData); + mergeDeep(bidReqConfig.ortb2Fragments.global, { + site: { ext: { data: { overtone: contextData } } } + }); } callback(); }) .catch((error) => { - logMessage('Error fetching context data', error); + log('Error fetching context data', error); callback(); }); }, diff --git a/modules/pubwiseAnalyticsAdapter.js b/modules/pubwiseAnalyticsAdapter.js index 51cc3b413..9df173066 100644 --- a/modules/pubwiseAnalyticsAdapter.js +++ b/modules/pubwiseAnalyticsAdapter.js @@ -211,10 +211,6 @@ function filterBidResponse(data) { if (typeof modified.ts !== 'undefined') { modified.ts = ''; } - // clean up a property to make simpler - if (typeof modified.statusMessage !== 'undefined' && modified.statusMessage === 'Bid returned empty or error response') { - modified.statusMessage = 'eoe'; - } modified.auctionEnded = auctionEnded; return modified; } diff --git a/modules/pubxaiAnalyticsAdapter.js b/modules/pubxaiAnalyticsAdapter.js index b2f9af247..6becd6e73 100644 --- a/modules/pubxaiAnalyticsAdapter.js +++ b/modules/pubxaiAnalyticsAdapter.js @@ -136,7 +136,6 @@ const extractBid = (bidResponse) => { responseTimestamp: bidResponse.responseTimestamp, status: bidResponse.status, sizes: parseSizesInput(bidResponse.size).toString(), - statusMessage: bidResponse.statusMessage, timeToRespond: bidResponse.timeToRespond, transactionId: bidResponse.transactionId, bidId: bidResponse.bidId || bidResponse.requestId, @@ -180,9 +179,6 @@ const track = ({ eventType, args }) => { .map((i) => i?.bids.length && i.bids[0]?.floorData) .find((i) => i) || {} ); - auctionCache[args.auctionId].deviceDetail.cdep = args.bidderRequests - .map((bidRequest) => bidRequest.ortb2?.device?.ext?.cdep) - .find((i) => i); Object.assign(auctionCache[args.auctionId].auctionDetail, { adUnitCodes: args.adUnits.map((i) => i.code), timestamp: args.timestamp, diff --git a/modules/rubiconBidAdapter.js b/modules/rubiconBidAdapter.js index b5fe8dfb1..acf194bdf 100644 --- a/modules/rubiconBidAdapter.js +++ b/modules/rubiconBidAdapter.js @@ -428,7 +428,6 @@ export const spec = { 'l_pb_bid_id', 'p_screen_res', 'o_ae', - 'o_cdep', 'rp_floor', 'rp_secure', 'tk_user_key' @@ -502,7 +501,6 @@ export const spec = { 'x_source.tid': bidderRequest.ortb2?.source?.tid, 'x_imp.ext.tid': bidRequest.ortb2Imp?.ext?.tid, 'l_pb_bid_id': bidRequest.bidId, - 'o_cdep': bidRequest.ortb2?.device?.ext?.cdep, 'ip': bidRequest.ortb2?.device?.ip, 'ipv6': bidRequest.ortb2?.device?.ipv6, 'p_screen_res': _getScreenResolution(), diff --git a/modules/startioIdSystem.md b/modules/startioIdSystem.md index 5c3de1bf9..23ab0c594 100644 --- a/modules/startioIdSystem.md +++ b/modules/startioIdSystem.md @@ -4,6 +4,14 @@ The Start.io User ID submodule generates and persists a unique user identifier b For integration support, contact prebid@start.io. +## Build + +To build Prebid.js with the Start.io User ID submodule and bid adapter, include the following modules: + +```bash +gulp build --modules=startioBidAdapter,userId,startioIdSystem,consentManagementTcf,consentManagementGpp,consentManagementUsp,... +``` + ### Prebid Params Enabling User Sync To enable iframe-based user syncing for Start.io, include the `filterSettings` configuration in your `userSync` setup: diff --git a/modules/terceptAnalyticsAdapter.js b/modules/terceptAnalyticsAdapter.js index 4d4cdf6ff..6e96215e8 100644 --- a/modules/terceptAnalyticsAdapter.js +++ b/modules/terceptAnalyticsAdapter.js @@ -139,7 +139,6 @@ function mapBidResponse(bidResponse, status) { width: bid.width, height: bid.height, mediaType: bid.mediaType, - statusMessage: bid.statusMessage, status: bid.status, renderStatus: getRenderStatus(), timeToRespond: bid.timeToRespond, @@ -185,7 +184,6 @@ function mapBidResponse(bidResponse, status) { width: bidResponse.width, height: bidResponse.height, mediaType: bidResponse.mediaType, - statusMessage: bidResponse.statusMessage, status: bidResponse.status, renderStatus: 4, timeToRespond: bidResponse.timeToRespond, diff --git a/modules/userId/index.ts b/modules/userId/index.ts index 4946e96f5..9252b6169 100644 --- a/modules/userId/index.ts +++ b/modules/userId/index.ts @@ -368,6 +368,10 @@ function mkPriorityMaps() { const refreshing = new Set(addtlModules.map(mod => mod.submodule)); map.submodules = map.submodules.filter((mod) => !refreshing.has(mod.submodule)).concat(addtlModules); update(); + }, + reset() { + map.submodules = []; + update(); } } function update() { @@ -892,8 +896,24 @@ function updatePPID(priorityMaps) { } } +function hasOptedOut() { + if (coreStorage.getDataFromLocalStorage(PBJS_USER_ID_OPTOUT_NAME)) { + logInfo(`${MODULE_NAME} - opt-out localStorage found, userId disabled`); + return true; + } + if (coreStorage.getCookie(PBJS_USER_ID_OPTOUT_NAME)) { + logInfo(`${MODULE_NAME} - opt-out cookie found, userId disabled`); + return true; + } + return false; +} + function initSubmodules(priorityMaps, submodules, forceRefresh = false) { return uidMetrics().fork().measureTime('userId.init.modules', function () { + if (hasOptedOut()) { + priorityMaps.reset(); + return []; + } if (!submodules.length) return []; // to simplify log messages from here on submodules.forEach(submod => populateEnabledStorageTypes(submod)); @@ -987,12 +1007,6 @@ function canUseLocalStorage(submodule) { if (!submodule.storageMgr.localStorageIsEnabled()) { return false; } - - if (coreStorage.getDataFromLocalStorage(PBJS_USER_ID_OPTOUT_NAME)) { - logInfo(`${MODULE_NAME} - opt-out localStorage found, storage disabled`); - return false - } - return true; } @@ -1000,12 +1014,6 @@ function canUseCookies(submodule) { if (!submodule.storageMgr.cookiesAreEnabled()) { return false; } - - if (coreStorage.getCookie(PBJS_USER_ID_OPTOUT_NAME)) { - logInfo(`${MODULE_NAME} - opt-out cookie found, storage disabled`); - return false; - } - return true } diff --git a/package-lock.json b/package-lock.json index ff204effe..093f7fa94 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "openads.js", - "version": "11.2.0", + "version": "11.3.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "openads.js", - "version": "11.2.0", + "version": "11.3.0", "license": "Apache-2.0", "dependencies": { "@babel/core": "^7.28.4", @@ -3157,7 +3157,9 @@ } }, "node_modules/@stylistic/eslint-plugin/node_modules/picomatch": { - "version": "4.0.2", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.5.tgz", + "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==", "dev": true, "license": "MIT", "engines": { @@ -3625,16 +3627,16 @@ } }, "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { - "version": "5.0.6", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.6.tgz", - "integrity": "sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==", + "version": "5.0.9", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.9.tgz", + "integrity": "sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg==", "dev": true, "license": "MIT", "dependencies": { "balanced-match": "^4.0.2" }, "engines": { - "node": "18 || 20 || >=22" + "node": "20 || >=22" } }, "node_modules/@typescript-eslint/typescript-estree/node_modules/debug": { @@ -5303,9 +5305,10 @@ } }, "node_modules/@xmldom/xmldom": { - "version": "0.8.10", + "version": "0.8.12", + "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.8.12.tgz", + "integrity": "sha512-9k/gHF6n/pAi/9tqr3m3aqkuiNosYTurLLUtc7xQ9sxB/wm7WPygCv8GYa6mS0fLJEHhqMC1ATYhz++U/lRHqg==", "dev": true, - "license": "MIT", "engines": { "node": ">=10.0.0" } @@ -6579,9 +6582,9 @@ "license": "ISC" }, "node_modules/brace-expansion": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", - "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "version": "1.1.18", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.18.tgz", + "integrity": "sha512-Edep/X9fGqVNmzKBVsDYIOtD+z1tuezV70LBjdCst9Tqu76lsnvRiZ6oTic1n+/BIwX6QDGAO94PN4N2SADvtw==", "dev": true, "license": "MIT", "dependencies": { @@ -10262,6 +10265,12 @@ "version": "2.0.0", "license": "MIT" }, + "node_modules/express/node_modules/path-to-regexp": { + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz", + "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==", + "license": "MIT" + }, "node_modules/express/node_modules/raw-body": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", @@ -10544,9 +10553,9 @@ } }, "node_modules/filelist/node_modules/brace-expansion": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", - "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.4.tgz", + "integrity": "sha512-hGfVzPxthbf3+2yjg/RBs60cB0FhqBS/zvdV/4wn4/BmN0bNMMHPc4V/BbFieqf1TKAGGAHnY4eSjajCl0f2Xg==", "dev": true, "license": "MIT", "dependencies": { @@ -11238,9 +11247,9 @@ } }, "node_modules/glob/node_modules/brace-expansion": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", - "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.4.tgz", + "integrity": "sha512-hGfVzPxthbf3+2yjg/RBs60cB0FhqBS/zvdV/4wn4/BmN0bNMMHPc4V/BbFieqf1TKAGGAHnY4eSjajCl0f2Xg==", "dev": true, "license": "MIT", "dependencies": { @@ -12068,9 +12077,10 @@ } }, "node_modules/handlebars": { - "version": "4.7.8", + "version": "4.7.9", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.9.tgz", + "integrity": "sha512-4E71E0rpOaQuJR2A3xDZ+GM1HyWYv1clR58tC8emQNeQe3RH7MAzSbat+V0wG78LQBo6m6bzSG/L4pBuCsgnUQ==", "dev": true, - "license": "MIT", "dependencies": { "minimist": "^1.2.5", "neo-async": "^2.6.2", @@ -13648,9 +13658,9 @@ } }, "node_modules/jest-message-util/node_modules/picomatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", - "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.5.tgz", + "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==", "dev": true, "license": "MIT", "engines": { @@ -13790,9 +13800,9 @@ } }, "node_modules/jest-util/node_modules/picomatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", - "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.5.tgz", + "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==", "dev": true, "license": "MIT", "engines": { @@ -14398,9 +14408,9 @@ } }, "node_modules/karma-webpack/node_modules/minimatch/node_modules/brace-expansion": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", - "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.4.tgz", + "integrity": "sha512-hGfVzPxthbf3+2yjg/RBs60cB0FhqBS/zvdV/4wn4/BmN0bNMMHPc4V/BbFieqf1TKAGGAHnY4eSjajCl0f2Xg==", "dev": true, "license": "MIT", "dependencies": { @@ -14711,9 +14721,9 @@ } }, "node_modules/lodash": { - "version": "4.17.23", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.23.tgz", - "integrity": "sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w==" + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.18.1.tgz", + "integrity": "sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==" }, "node_modules/lodash.clone": { "version": "4.5.0", @@ -15134,9 +15144,9 @@ "license": "Python-2.0" }, "node_modules/mocha/node_modules/brace-expansion": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", - "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.4.tgz", + "integrity": "sha512-hGfVzPxthbf3+2yjg/RBs60cB0FhqBS/zvdV/4wn4/BmN0bNMMHPc4V/BbFieqf1TKAGGAHnY4eSjajCl0f2Xg==", "dev": true, "license": "MIT", "dependencies": { @@ -15524,10 +15534,11 @@ } }, "node_modules/multimatch/node_modules/brace-expansion": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", - "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.4.tgz", + "integrity": "sha512-hGfVzPxthbf3+2yjg/RBs60cB0FhqBS/zvdV/4wn4/BmN0bNMMHPc4V/BbFieqf1TKAGGAHnY4eSjajCl0f2Xg==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" } @@ -15753,11 +15764,13 @@ } }, "node_modules/nise/node_modules/path-to-regexp": { - "version": "8.2.0", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.4.0.tgz", + "integrity": "sha512-PuseHIvAnz3bjrM2rGJtSgo1zjgxapTLZ7x2pjhzWwlp4SJQgK3f3iZIQwkpEnBaKz6seKBADpM4B4ySkuYypg==", "dev": true, - "license": "MIT", - "engines": { - "node": ">=16" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" } }, "node_modules/node-domexception": { @@ -16476,10 +16489,6 @@ "dev": true, "license": "ISC" }, - "node_modules/path-to-regexp": { - "version": "0.1.12", - "license": "MIT" - }, "node_modules/pathe": { "version": "1.1.2", "dev": true, @@ -16511,7 +16520,9 @@ "license": "ISC" }, "node_modules/picomatch": { - "version": "2.3.1", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", + "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", "dev": true, "license": "MIT", "engines": { @@ -17120,9 +17131,9 @@ } }, "node_modules/readdir-glob/node_modules/brace-expansion": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", - "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.4.tgz", + "integrity": "sha512-hGfVzPxthbf3+2yjg/RBs60cB0FhqBS/zvdV/4wn4/BmN0bNMMHPc4V/BbFieqf1TKAGGAHnY4eSjajCl0f2Xg==", "dev": true, "license": "MIT", "dependencies": { @@ -19042,9 +19053,9 @@ } }, "node_modules/tinyglobby/node_modules/picomatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", - "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.5.tgz", + "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==", "dev": true, "license": "MIT", "engines": { @@ -19180,9 +19191,9 @@ } }, "node_modules/ts-declaration-location/node_modules/picomatch": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", - "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.5.tgz", + "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==", "dev": true, "license": "MIT", "engines": { @@ -23108,7 +23119,9 @@ "dev": true }, "picomatch": { - "version": "4.0.2", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.5.tgz", + "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==", "dev": true } } @@ -23431,9 +23444,9 @@ "dev": true }, "brace-expansion": { - "version": "5.0.6", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.6.tgz", - "integrity": "sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==", + "version": "5.0.9", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.9.tgz", + "integrity": "sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg==", "dev": true, "requires": { "balanced-match": "^4.0.2" @@ -24594,7 +24607,9 @@ } }, "@xmldom/xmldom": { - "version": "0.8.10", + "version": "0.8.12", + "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.8.12.tgz", + "integrity": "sha512-9k/gHF6n/pAi/9tqr3m3aqkuiNosYTurLLUtc7xQ9sxB/wm7WPygCv8GYa6mS0fLJEHhqMC1ATYhz++U/lRHqg==", "dev": true }, "@xtuc/ieee754": { @@ -25401,9 +25416,9 @@ "dev": true }, "brace-expansion": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", - "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "version": "1.1.18", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.18.tgz", + "integrity": "sha512-Edep/X9fGqVNmzKBVsDYIOtD+z1tuezV70LBjdCst9Tqu76lsnvRiZ6oTic1n+/BIwX6QDGAO94PN4N2SADvtw==", "dev": true, "requires": { "balanced-match": "^1.0.0", @@ -27799,6 +27814,11 @@ "ms": { "version": "2.0.0" }, + "path-to-regexp": { + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz", + "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==" + }, "raw-body": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", @@ -27983,9 +28003,9 @@ }, "dependencies": { "brace-expansion": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", - "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.4.tgz", + "integrity": "sha512-hGfVzPxthbf3+2yjg/RBs60cB0FhqBS/zvdV/4wn4/BmN0bNMMHPc4V/BbFieqf1TKAGGAHnY4eSjajCl0f2Xg==", "dev": true, "requires": { "balanced-match": "^1.0.0" @@ -28386,9 +28406,9 @@ }, "dependencies": { "brace-expansion": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", - "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.4.tgz", + "integrity": "sha512-hGfVzPxthbf3+2yjg/RBs60cB0FhqBS/zvdV/4wn4/BmN0bNMMHPc4V/BbFieqf1TKAGGAHnY4eSjajCl0f2Xg==", "dev": true, "requires": { "balanced-match": "^1.0.0" @@ -29028,7 +29048,9 @@ } }, "handlebars": { - "version": "4.7.8", + "version": "4.7.9", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.9.tgz", + "integrity": "sha512-4E71E0rpOaQuJR2A3xDZ+GM1HyWYv1clR58tC8emQNeQe3RH7MAzSbat+V0wG78LQBo6m6bzSG/L4pBuCsgnUQ==", "dev": true, "requires": { "minimist": "^1.2.5", @@ -29985,9 +30007,9 @@ "dev": true }, "picomatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", - "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.5.tgz", + "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==", "dev": true }, "slash": { @@ -30079,9 +30101,9 @@ "dev": true }, "picomatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", - "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.5.tgz", + "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==", "dev": true }, "supports-color": { @@ -30567,9 +30589,9 @@ }, "dependencies": { "brace-expansion": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", - "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.4.tgz", + "integrity": "sha512-hGfVzPxthbf3+2yjg/RBs60cB0FhqBS/zvdV/4wn4/BmN0bNMMHPc4V/BbFieqf1TKAGGAHnY4eSjajCl0f2Xg==", "dev": true, "requires": { "balanced-match": "^1.0.0" @@ -30696,9 +30718,9 @@ } }, "lodash": { - "version": "4.17.23", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.23.tgz", - "integrity": "sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w==" + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.18.1.tgz", + "integrity": "sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==" }, "lodash.clone": { "version": "4.5.0", @@ -30988,9 +31010,9 @@ "dev": true }, "brace-expansion": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", - "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.4.tgz", + "integrity": "sha512-hGfVzPxthbf3+2yjg/RBs60cB0FhqBS/zvdV/4wn4/BmN0bNMMHPc4V/BbFieqf1TKAGGAHnY4eSjajCl0f2Xg==", "dev": true, "requires": { "balanced-match": "^1.0.0" @@ -31231,9 +31253,9 @@ }, "dependencies": { "brace-expansion": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", - "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.4.tgz", + "integrity": "sha512-hGfVzPxthbf3+2yjg/RBs60cB0FhqBS/zvdV/4wn4/BmN0bNMMHPc4V/BbFieqf1TKAGGAHnY4eSjajCl0f2Xg==", "dev": true, "requires": { "balanced-match": "^1.0.0" @@ -31367,7 +31389,9 @@ }, "dependencies": { "path-to-regexp": { - "version": "8.2.0", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.4.0.tgz", + "integrity": "sha512-PuseHIvAnz3bjrM2rGJtSgo1zjgxapTLZ7x2pjhzWwlp4SJQgK3f3iZIQwkpEnBaKz6seKBADpM4B4ySkuYypg==", "dev": true } } @@ -31816,9 +31840,6 @@ } } }, - "path-to-regexp": { - "version": "0.1.12" - }, "pathe": { "version": "1.1.2", "dev": true @@ -31839,7 +31860,9 @@ "version": "1.1.1" }, "picomatch": { - "version": "2.3.1", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", + "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", "dev": true }, "pirates": { @@ -32231,9 +32254,9 @@ }, "dependencies": { "brace-expansion": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", - "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.4.tgz", + "integrity": "sha512-hGfVzPxthbf3+2yjg/RBs60cB0FhqBS/zvdV/4wn4/BmN0bNMMHPc4V/BbFieqf1TKAGGAHnY4eSjajCl0f2Xg==", "dev": true, "requires": { "balanced-match": "^1.0.0" @@ -33518,9 +33541,9 @@ "requires": {} }, "picomatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", - "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.5.tgz", + "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==", "dev": true } } @@ -33596,9 +33619,9 @@ }, "dependencies": { "picomatch": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", - "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.5.tgz", + "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==", "dev": true } } diff --git a/package.json b/package.json index 94cf2343e..4986fb170 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "openads.js", - "version": "11.2.0", + "version": "11.3.0", "oaVersion": "1.9.0", "description": "Header Bidding Management Library", "main": "dist/src/prebid.public.ts", diff --git a/src/activities/redactor.ts b/src/activities/redactor.ts index 6a87303cd..26acf43f7 100644 --- a/src/activities/redactor.ts +++ b/src/activities/redactor.ts @@ -18,7 +18,7 @@ export const ORTB_UFPD_PATHS = [ 'id', 'buyeruid', 'customdata' -].map(f => `user.${f}`).concat('device.ext.cdep', 'device.ifa'); +].map(f => `user.${f}`).concat('device.ifa'); export const ORTB_EIDS_PATHS = ['user.eids', 'user.ext.eids']; export const ORTB_GEO_PATHS = ['user.geo.lat', 'user.geo.lon', 'device.geo.lat', 'device.geo.lon']; export const ORTB_IPV4_PATHS = ['device.ip'] diff --git a/src/adapterManager.ts b/src/adapterManager.ts index c72efcb5a..0cb26b944 100644 --- a/src/adapterManager.ts +++ b/src/adapterManager.ts @@ -86,7 +86,7 @@ const _bidderRegistry = {}; const _aliasRegistry: { [aliasCode: BidderCode]: BidderCode } = {}; const _analyticsRegistry: { [P in AnalyticsProvider]?: { adapter: AnalyticsAdapter

, gvlid?: number } } = {}; -let _s2sConfigs = []; +let _s2sConfigs : any[] | any = []; config.getConfig('s2sConfig', config => { if (config && config.s2sConfig) { _s2sConfigs = isArray(config.s2sConfig) ? config.s2sConfig : [config.s2sConfig]; @@ -903,6 +903,7 @@ const adapterManager = { config: AnalyticsConfig | AnalyticsConfig | AnalyticsConfig[] + | any ) { if (!isArray(config)) { config = [config]; diff --git a/src/adapters/bidderFactory.ts b/src/adapters/bidderFactory.ts index 737c26117..a7fe8e702 100644 --- a/src/adapters/bidderFactory.ts +++ b/src/adapters/bidderFactory.ts @@ -41,7 +41,7 @@ import type { BidderCode, StorageDisclosure } from "../types/common.d.ts"; import type { Ajax, AjaxOptions, XHR } from "../ajax.ts"; import type { AddBidResponse } from "../auction.ts"; import type { MediaType } from "../mediaTypes.ts"; -import { CONSENT_GDPR, CONSENT_GPP, CONSENT_USP, type ConsentData } from "../consentHandler.ts"; +import { CONSENT_GDPR, CONSENT_GPP, CONSENT_USP, type ConsentDataForKey } from "../consentHandler.ts"; /** * This file aims to support Adapters during the Prebid 0.x -> 1.x transition. @@ -153,9 +153,9 @@ export interface BidderSpec extends StorageDisclosure pixelEnabled: boolean; }, responses: ServerResponse[], - gdprConsent: null | ConsentData[typeof CONSENT_GDPR], - uspConsent: null | ConsentData[typeof CONSENT_USP], - gppConsent: null | ConsentData[typeof CONSENT_GPP] + gdprConsent: null | ConsentDataForKey, + uspConsent: null | ConsentDataForKey, + gppConsent: null | ConsentDataForKey ) => ({ type: SyncType, url: string })[]; alwaysHasCapacity?: boolean; } diff --git a/src/bidfactory.ts b/src/bidfactory.ts index 576e97eb2..2df0b3791 100644 --- a/src/bidfactory.ts +++ b/src/bidfactory.ts @@ -167,6 +167,7 @@ export interface NativeBidProperties { export interface VideoBidProperties { mediaType: 'video' | 'audio'; + videoCacheKey?: string; } type BidFrom = BaseBid & Omit & PROPS; diff --git a/src/consentHandler.ts b/src/consentHandler.ts index 1c1ae7a03..ed033683b 100644 --- a/src/consentHandler.ts +++ b/src/consentHandler.ts @@ -22,6 +22,9 @@ export interface ConsentData { [CONSENT_COPPA]: boolean; } +/** Resolves to ConsentData[K] when module has augmented that key, else unknown (core-only build). */ +export type ConsentDataForKey = K extends keyof ConsentData ? ConsentData[K] : unknown; + type ConsentDataFor = T extends keyof ConsentData ? ConsentData[T] : null; // eslint-disable-next-line @typescript-eslint/no-empty-object-type diff --git a/src/events.ts b/src/events.ts index 2e9603f3e..b82e6d7c0 100644 --- a/src/events.ts +++ b/src/events.ts @@ -24,7 +24,12 @@ export interface Events extends AllEvents { } export type EventIDs = { - [K in Event]: K extends keyof typeof EVENT_ID_PATHS ? Events[K][0][(typeof EVENT_ID_PATHS)[K]] : undefined; + [K in Event]: + K extends keyof typeof EVENT_ID_PATHS + ? Events[K][0] extends { [P in (typeof EVENT_ID_PATHS)[K]]: infer V } + ? V + : unknown + : undefined; }; export type Event = keyof Events; diff --git a/src/fpd/enrichment.ts b/src/fpd/enrichment.ts index 4d3f8327e..69f30844c 100644 --- a/src/fpd/enrichment.ts +++ b/src/fpd/enrichment.ts @@ -16,10 +16,6 @@ import { config } from '../config.js'; import { getHighEntropySUA, getLowEntropySUA } from './sua.js'; import { PbPromise } from '../utils/promise.js'; import { CLIENT_SECTIONS, clientSectionChecker, hasSection } from './oneClient.js'; -import { isActivityAllowed } from '../activities/rules.js'; -import { activityParams } from '../activities/activityParams.js'; -import { ACTIVITY_ACCESS_DEVICE } from '../activities/activities.js'; -import { MODULE_TYPE_PREBID } from '../activities/modules.js'; import { getViewportSize } from '../../libraries/viewport/viewport.js'; export const dep = { @@ -67,10 +63,10 @@ declare module '../config' { * @returns {Promise} - A promise that resolves to an enriched ortb2 object. */ export const enrichFPD = hook('sync', (fpd) => { - const promArr = [fpd, getSUA().catch(() => null), tryToGetCdepLabel().catch(() => null)]; + const promArr = [fpd, getSUA().catch(() => null)]; return PbPromise.all(promArr) - .then(([ortb2, sua, cdep]) => { + .then(([ortb2, sua]) => { const ri = dep.getRefererInfo(); Object.entries(ENRICHMENTS).forEach(([section, getEnrichments]) => { const data = getEnrichments(ortb2, ri); @@ -83,13 +79,6 @@ export const enrichFPD = hook('sync', (fpd) => { deepSetValue(ortb2, 'device.sua', Object.assign({}, sua, ortb2.device.sua)); } - if (cdep) { - const ext = { - cdep - } - deepSetValue(ortb2, 'device.ext', Object.assign({}, ext, ortb2.device.ext)); - } - const documentLang = dep.getDocument().documentElement.lang; if (documentLang) { deepSetValue(ortb2, 'site.ext.data.documentLang', documentLang); @@ -130,10 +119,6 @@ function removeUndef(obj) { return getDefinedParams(obj, Object.keys(obj)) } -function tryToGetCdepLabel() { - return PbPromise.resolve('cookieDeprecationLabel' in navigator && isActivityAllowed(ACTIVITY_ACCESS_DEVICE, activityParams(MODULE_TYPE_PREBID, 'cdep')) && (navigator.cookieDeprecationLabel as any).getValue()); -} - const ENRICHMENTS = { site(ortb2, ri) { if (CLIENT_SECTIONS.filter(p => p !== 'site').some(hasSection.bind(null, ortb2))) { diff --git a/src/targeting.ts b/src/targeting.ts index e3c98465a..19038a821 100644 --- a/src/targeting.ts +++ b/src/targeting.ts @@ -134,7 +134,7 @@ export function sortByDealAndPriceBucketOrCpm(useCpm = false) { * @param adUnitCodes * @param getSlots */ -export function getGPTSlotsForAdUnits(adUnitCodes: AdUnitCode[], getSlots = () => window.googletag.pubads().getSlots()): ByAdUnit { +export function getGPTSlotsForAdUnits(adUnitCodes: AdUnitCode[], getSlots = () => (window as any).googletag.pubads().getSlots()): ByAdUnit { return getSlots().reduce((auToSlots, slot) => { Object.keys(auToSlots).filter(isAdUnitCodeMatchingSlot(slot)) .forEach(au => auToSlots[au].push(slot)); @@ -177,7 +177,7 @@ type TargetingValueLists = TargetingMap; type TargetingArray = ByAdUnit[]; type AdUnitPredicate = (adUnitCode: AdUnitCode) => boolean; -export type SlotMatchingFn = (slot: googletag.Slot) => AdUnitPredicate; +export type SlotMatchingFn = (slot: any) => AdUnitPredicate; declare module './events' { interface Events { diff --git a/test/fixtures/bid-responses-cloned.json b/test/fixtures/bid-responses-cloned.json index 188518b45..7080287c8 100644 --- a/test/fixtures/bid-responses-cloned.json +++ b/test/fixtures/bid-responses-cloned.json @@ -8,7 +8,6 @@ "bidderCode": "criteo", "width": 0, "height": 0, - "statusMessage": "Bid returned empty or error response", "adId": "83fb6a073", "requestTimestamp": 1454535718619, "responseTimestamp": 1454535720575, @@ -21,7 +20,6 @@ "bidderCode": "sovrn", "width": 0, "height": 0, - "statusMessage": "Bid returned empty or error response", "adId": "9d64dde8c", "requestTimestamp": 1454535718628, "responseTimestamp": 1454535721135, @@ -34,7 +32,6 @@ "bidderCode": "pulsepoint", "width": 0, "height": 0, - "statusMessage": "Bid returned empty or error response", "adId": "102e25872d", "requestTimestamp": 1454535718629, "responseTimestamp": 1454535721687, @@ -47,7 +44,6 @@ "bidderCode": "amazon", "width": 0, "height": 0, - "statusMessage": "Bid available", "adId": "112cdb3eff", "adUnitCode": "/123456/header-bid-tag-0", "bidder": "amazon" @@ -56,7 +52,6 @@ "bidderCode": "yieldbot", "width": 0, "height": 0, - "statusMessage": "Bid returned empty or error response", "adId": "1234cc92d8", "requestTimestamp": 1454535718624, "responseTimestamp": 1454535722273, @@ -69,7 +64,6 @@ "bidderCode": "openx", "width": 0, "height": 0, - "statusMessage": "Bid returned empty or error response", "adId": "1383ffde21", "requestTimestamp": 1454535718611, "responseTimestamp": 1454535724228, @@ -82,7 +76,6 @@ "bidderCode": "rubicon", "width": "300", "height": "250", - "statusMessage": "Bid available", "adId": "148018fe5e", "cpm": 0.537234, "ad": "", @@ -105,7 +98,6 @@ "bidderCode": "pubmatic", "width": "300", "height": "250", - "statusMessage": "Bid available", "adId": "15bea0b1db", "adSlot": "39620189@300x250", "cpm": 0.01, @@ -127,4 +119,4 @@ } ] } -} \ No newline at end of file +} diff --git a/test/fixtures/bid-responses.json b/test/fixtures/bid-responses.json index 35e55664c..366833ef4 100644 --- a/test/fixtures/bid-responses.json +++ b/test/fixtures/bid-responses.json @@ -10,7 +10,6 @@ "bidderCode": "criteo", "width": 0, "height": 0, - "statusMessage": "Bid returned empty or error response", "adId": "83fb6a073", "requestTimestamp": 1454535718619, "responseTimestamp": 1454535720575, @@ -26,7 +25,6 @@ "bidderCode": "sovrn", "width": 0, "height": 0, - "statusMessage": "Bid returned empty or error response", "adId": "9d64dde8c", "requestTimestamp": 1454535718628, "responseTimestamp": 1454535721135, @@ -42,7 +40,6 @@ "bidderCode": "pulsepoint", "width": 0, "height": 0, - "statusMessage": "Bid returned empty or error response", "adId": "102e25872d", "requestTimestamp": 1454535718629, "responseTimestamp": 1454535721687, @@ -58,7 +55,6 @@ "bidderCode": "amazon", "width": 0, "height": 0, - "statusMessage": "Bid available", "adId": "112cdb3eff", "adUnitCode": "/123456/header-bid-tag-0", "bidder": "amazon" @@ -67,7 +63,6 @@ "bidderCode": "yieldbot", "width": 0, "height": 0, - "statusMessage": "Bid returned empty or error response", "adId": "1234cc92d8", "requestTimestamp": 1454535718624, "responseTimestamp": 1454535722273, @@ -83,7 +78,6 @@ "bidderCode": "openx", "width": 0, "height": 0, - "statusMessage": "Bid returned empty or error response", "adId": "1383ffde21", "requestTimestamp": 1454535718611, "responseTimestamp": 1454535724228, @@ -99,7 +93,6 @@ "bidderCode": "rubicon", "width": "300", "height": "250", - "statusMessage": "Bid available", "adId": "148018fe5e", "cpm": 0.537234, "ad": "", @@ -125,7 +118,6 @@ "bidderCode": "pubmatic", "width": "300", "height": "250", - "statusMessage": "Bid available", "adId": "15bea0b1db", "adSlot": "39620189@300x250", "cpm": 0.01, diff --git a/test/fixtures/fixtures.js b/test/fixtures/fixtures.js index 1722bdb9a..7adcfdc3d 100644 --- a/test/fixtures/fixtures.js +++ b/test/fixtures/fixtures.js @@ -362,7 +362,6 @@ export function getBidResponses() { 'mediaType': 'banner', 'width': 0, 'height': 0, - 'statusMessage': 'Bid available', 'adId': '222bb26f9e8bd', 'cpm': 0.112256, 'ad': "", @@ -394,7 +393,6 @@ export function getBidResponses() { 'mediaType': 'banner', 'width': 300, 'height': 250, - 'statusMessage': 'Bid available', 'adId': '233bcbee889d46d', 'creative_id': 29681110, 'cpm': 10, @@ -428,7 +426,6 @@ export function getBidResponses() { 'mediaType': 'banner', 'width': 728, 'height': 90, - 'statusMessage': 'Bid available', 'adId': '24bd938435ec3fc', 'creative_id': 33989846, 'cpm': 10, @@ -462,7 +459,6 @@ export function getBidResponses() { 'mediaType': 'banner', 'width': 300, 'height': 250, - 'statusMessage': 'Bid available', 'adId': '25bedd4813632d7', 'creative_id': 29681110, 'cpm': 0.5, @@ -495,7 +491,6 @@ export function getBidResponses() { 'mediaType': 'banner', 'width': 300, 'height': 250, - 'statusMessage': 'Bid available', 'adId': '26e0795ab963896', 'cpm': 0.17, 'ad': "", @@ -527,7 +522,6 @@ export function getBidResponses() { 'mediaType': 'banner', 'width': 300, 'height': 250, - 'statusMessage': 'Bid available', 'adId': '275bd666f5a5a5d', 'creative_id': 29681110, 'cpm': 0.5, @@ -560,7 +554,6 @@ export function getBidResponses() { 'mediaType': 'banner', 'width': '300', 'height': '250', - 'statusMessage': 'Bid available', 'adId': '28f4039c636b6a7', 'adSlot': '39620189@300x250', 'cpm': 5.9396, @@ -594,7 +587,6 @@ export function getBidResponses() { 'mediaType': 'banner', 'width': 300, 'height': 600, - 'statusMessage': 'Bid available', 'adId': '29019e2ab586a5a', 'cpm': 2.74, 'ad': '', @@ -895,7 +887,6 @@ export function getBidResponsesFromAPI() { 'width': 300, 'height': 250, 'mediaType': 'banner', - 'statusMessage': 'Bid available', 'adId': '26e0795ab963896', 'cpm': 0.17, 'ad': "", @@ -927,7 +918,6 @@ export function getBidResponsesFromAPI() { 'width': 300, 'height': 250, 'mediaType': 'banner', - 'statusMessage': 'Bid available', 'adId': '275bd666f5a5a5d', 'creative_id': 29681110, 'cpm': 0.5, @@ -960,7 +950,6 @@ export function getBidResponsesFromAPI() { 'width': '300', 'height': '250', 'mediaType': 'banner', - 'statusMessage': 'Bid available', 'adId': '28f4039c636b6a7', 'adSlot': '39620189@300x250', 'cpm': 5.9396, @@ -994,7 +983,6 @@ export function getBidResponsesFromAPI() { 'width': 300, 'height': 600, 'mediaType': 'banner', - 'statusMessage': 'Bid available', 'adId': '29019e2ab586a5a', 'cpm': 2.74, 'ad': '', @@ -1294,7 +1282,6 @@ export function createBidReceived({ bidder, cpm, auctionId, responseTimestamp, a 'bidderCode': bidder, 'width': '300', 'height': '250', - 'statusMessage': 'Bid available', 'adId': adId, 'cpm': cpm, 'ad': 'markup', diff --git a/test/fixtures/liveIntentAuctionEvents.js b/test/fixtures/liveIntentAuctionEvents.js index 080ae5fc7..c89705eb3 100644 --- a/test/fixtures/liveIntentAuctionEvents.js +++ b/test/fixtures/liveIntentAuctionEvents.js @@ -2118,7 +2118,6 @@ export const BID_WON_EVENT = { 'bidderCode': 'appnexus', 'width': 728, 'height': 90, - 'statusMessage': 'Bid available', 'adId': '4e02072b881823', 'requestId': '3fae2718fd70f', 'transactionId': '6daa1dac-9eea-47ce-82ce-ce9681df1ec5', @@ -2239,7 +2238,6 @@ export const BID_WON_EVENT_UNDEFINED = { 'bidderCode': undefined, 'width': 728, 'height': 90, - 'statusMessage': 'Bid available', 'adId': '4e02072b881823', 'requestId': '3fae2718fd70f', 'transactionId': '6daa1dac-9eea-47ce-82ce-ce9681df1ec5', diff --git a/test/spec/fpd/enrichment_spec.js b/test/spec/fpd/enrichment_spec.js index 38fa8de6f..96ef4f8cf 100644 --- a/test/spec/fpd/enrichment_spec.js +++ b/test/spec/fpd/enrichment_spec.js @@ -4,10 +4,7 @@ import { expect } from 'chai/index.mjs'; import { config } from 'src/config.js'; import * as utils from 'src/utils.js'; import * as winDimensions from 'src/utils/winDimensions.js'; -import * as activities from 'src/activities/rules.js' import { CLIENT_SECTIONS } from '../../../src/fpd/oneClient.js'; -import { ACTIVITY_ACCESS_DEVICE } from '../../../src/activities/activities.js'; -import { ACTIVITY_PARAM_COMPONENT } from '../../../src/activities/params.js'; describe('FPD enrichment', () => { let sandbox; @@ -358,71 +355,6 @@ describe('FPD enrichment', () => { }); }); - describe('privacy sandbox cookieDeprecationLabel', () => { - let isAllowed; let cdep; let shouldCleanupNav = false; - - before(() => { - if (!navigator.cookieDeprecationLabel) { - navigator.cookieDeprecationLabel = {}; - shouldCleanupNav = true; - } - }); - - after(() => { - if (shouldCleanupNav) { - delete navigator.cookieDeprecationLabel; - } - }); - - beforeEach(() => { - isAllowed = true; - sandbox.stub(activities, 'isActivityAllowed').callsFake((activity, params) => { - if (activity === ACTIVITY_ACCESS_DEVICE && params[ACTIVITY_PARAM_COMPONENT] === 'prebid.cdep') { - return isAllowed; - } else { - throw new Error('Unexpected activity check'); - } - }); - sandbox.stub(window.navigator, 'cookieDeprecationLabel').value({ - getValue: sinon.stub().callsFake(() => cdep) - }) - }) - - it('enrichment sets device.ext.cdep when allowed and navigator.getCookieDeprecationLabel exists', () => { - cdep = Promise.resolve('example-test-label'); - return fpd().then(ortb2 => { - expect(ortb2.device.ext.cdep).to.eql('example-test-label'); - }) - }); - - Object.entries({ - 'not allowed'() { - isAllowed = false; - }, - 'not supported'() { - delete navigator.cookieDeprecationLabel - } - }).forEach(([t, setup]) => { - it(`if ${t}, the navigator API is not called and no enrichment happens`, () => { - setup(); - cdep = Promise.resolve('example-test-label'); - return fpd().then(ortb2 => { - expect(ortb2.device.ext?.cdep).to.not.exist; - if (navigator.cookieDeprecationLabel) { - sinon.assert.notCalled(navigator.cookieDeprecationLabel.getValue); - } - }) - }); - }) - - it('if the navigator API returns a promise that rejects, the enrichment does not halt forever', () => { - cdep = Promise.reject(new Error('oops, something went wrong')); - return fpd().then(ortb2 => { - expect(ortb2.device.ext?.cdep).to.not.exist; - }) - }); - }); - it('leaves only one of app, site, dooh', () => { return fpd({ app: { p: 'val' }, diff --git a/test/spec/libraries/precisoUtils/bidUtilsCommon_spec.js b/test/spec/libraries/precisoUtils/bidUtilsCommon_spec.js index 03b3b219c..362a1100f 100644 --- a/test/spec/libraries/precisoUtils/bidUtilsCommon_spec.js +++ b/test/spec/libraries/precisoUtils/bidUtilsCommon_spec.js @@ -201,7 +201,6 @@ describe('bidUtilsCommon', function () { 'bidderCode': 'redtram', 'width': 300, 'height': 250, - 'statusMessage': 'Bid available', 'adId': '5691dd18ba6ab6', 'requestId': '23dc19818e5293', 'transactionId': '948c716b-bf64-4303-bcf4-395c2f6a9770', diff --git a/test/spec/modules/adkernelAdnAnalytics_spec.js b/test/spec/modules/adkernelAdnAnalytics_spec.js index 41477c555..3d628315d 100644 --- a/test/spec/modules/adkernelAdnAnalytics_spec.js +++ b/test/spec/modules/adkernelAdnAnalytics_spec.js @@ -175,7 +175,6 @@ describe('', function () { bidderCode: 'adapter', width: 300, height: 250, - statusMessage: 'Bid available', adId: '208750227436c1', mediaType: 'banner', cpm: 0.015, diff --git a/test/spec/modules/bidViewability_spec.js b/test/spec/modules/bidViewability_spec.js index 11257c0d0..146b67e4b 100644 --- a/test/spec/modules/bidViewability_spec.js +++ b/test/spec/modules/bidViewability_spec.js @@ -36,7 +36,6 @@ const PBJS_WINNING_BID = { 'bidder': 'pubmatic', 'width': 300, 'height': 250, - 'statusMessage': 'Bid available', 'adId': 'id', 'requestId': 1024, 'source': 'client', diff --git a/test/spec/modules/debugging_mod_spec.js b/test/spec/modules/debugging_mod_spec.js index ee8089b7a..8f7f1849b 100644 --- a/test/spec/modules/debugging_mod_spec.js +++ b/test/spec/modules/debugging_mod_spec.js @@ -587,7 +587,6 @@ describe('bid overrides', function () { 'bidderCode': 'rubicon', 'width': 970, 'height': 250, - 'statusMessage': 'Bid available', 'mediaType': 'banner', 'source': 'client', 'currency': 'USD', @@ -696,7 +695,6 @@ describe('bid overrides', function () { 'bids': [{ 'width': 970, 'height': 250, - 'statusMessage': 'Bid available', 'mediaType': 'banner', 'source': 'client', 'currency': 'USD', diff --git a/test/spec/modules/instreamTracking_spec.js b/test/spec/modules/instreamTracking_spec.js index ee6b70a99..2015ce8b1 100644 --- a/test/spec/modules/instreamTracking_spec.js +++ b/test/spec/modules/instreamTracking_spec.js @@ -63,7 +63,6 @@ function mockBidResponse(adUnit, requestId) { 'bidderCode': adUnit.bids[0].bidder, 'width': adUnit.sizes[0][0], 'height': adUnit.sizes[0][1], - 'statusMessage': 'Bid available', 'adId': 'id', 'requestId': requestId, 'source': 'client', diff --git a/test/spec/modules/r2b2AnalytiscAdapter_spec.js b/test/spec/modules/r2b2AnalytiscAdapter_spec.js index 9098cf10c..db34531f8 100644 --- a/test/spec/modules/r2b2AnalytiscAdapter_spec.js +++ b/test/spec/modules/r2b2AnalytiscAdapter_spec.js @@ -145,7 +145,6 @@ const R2B2_AD_UNIT_2_BID = { 'bidderCode': 'r2b2', 'width': 300, 'height': 100, - 'statusMessage': 'Bid available', 'adId': '22c828c62d44da5', 'requestId': '3c296eca6b08f4', 'transactionId': 'c8c3643c-9de0-43ea-bcd6-cc0072ec9b45', diff --git a/test/spec/modules/userId_spec.js b/test/spec/modules/userId_spec.js index 92fc37216..b97630af8 100644 --- a/test/spec/modules/userId_spec.js +++ b/test/spec/modules/userId_spec.js @@ -1431,37 +1431,96 @@ describe('User ID', function () { }); describe('Opt out', function () { - before(function () { - coreStorage.setCookie(PBJS_USER_ID_OPTOUT_NAME, '1', (new Date(Date.now() + 5000).toUTCString())); - }); + let mockIdSystem, cfg; + beforeEach(() => { + mockIdSystem = { + name: 'mockId', + decode: sinon.stub().callsFake(function (value) { + return { + 'mid': value.mock + }; + }), + getId: sinon.stub().callsFake(function () { + return { id: { mock: 'id' } }; + }) + }; + init(config); + setSubmoduleRegistry([mockIdSystem]); + cfg = { + userSync: { + syncDelay: 0, + auctionDelay: 1, // to let init complete without an auction + userIds: [{ + name: 'mockId' + }] + } + } + }) + Object.entries({ + 'cookies': { + setup() { + coreStorage.setCookie(PBJS_USER_ID_OPTOUT_NAME, '1', (new Date(Date.now() + 5000).toUTCString())); + }, + teardown() { + coreStorage.setCookie(PBJS_USER_ID_OPTOUT_NAME, '', EXPIRED_COOKIE_DATE); + } + }, + 'localStorage': { + setup() { + coreStorage.setDataInLocalStorage(PBJS_USER_ID_OPTOUT_NAME, '1'); + }, + teardown() { + coreStorage.removeDataFromLocalStorage(PBJS_USER_ID_OPTOUT_NAME); + } + } + }).forEach(([t, { setup, teardown }]) => { + describe(`via ${t}`, () => { + afterEach(teardown); - beforeEach(function () { - sinon.stub(utils, 'logInfo'); - }); + it('does not fetch ids if opt out flag is set', function () { + setup(); + config.setConfig(cfg); + return getGlobal().getUserIdsAsync().then((uid) => { + sinon.assert.notCalled(mockIdSystem.getId); + expect(uid).to.eql({}); + }) + }); - afterEach(function () { - // removed cookie - coreStorage.setCookie(PBJS_USER_ID_OPTOUT_NAME, '', EXPIRED_COOKIE_DATE); - requestBids.removeAll(); - utils.logInfo.restore(); - }); + it('initializes if opt out flag is not set', async function () { + config.setConfig(cfg); + return getGlobal().getUserIdsAsync().then((uid) => { + sinon.assert.called(mockIdSystem.getId); + expect(uid).to.eql({ mid: 'id' }); + }) + }); - it('does not fetch ids if opt out cookie exists', function () { - init(config); - setSubmoduleRegistry([sharedIdSystemSubmodule]); - const cfg = getConfigMock(['pubCommonId', 'pubcid', 'cookie']); - cfg.userSync.auctionDelay = 1; // to let init complete without an auction - config.setConfig(cfg); - return getGlobal().getUserIdsAsync().then((uid) => { - expect(uid).to.eql({}); - }) - }); + it('should opt out on refresh', () => { + config.setConfig(cfg); + return getGlobal().getUserIdsAsync().then((uid) => { + expect(uid).to.eql({ mid: 'id' }); + sinon.assert.calledOnce(mockIdSystem.getId); + setup(); + return getGlobal().refreshUserIds().then((uid) => { + sinon.assert.calledOnce(mockIdSystem.getId); + expect(uid).to.eql({}); + }) + }) + }); - it('initializes if no opt out cookie exists', function () { - init(config); - setSubmoduleRegistry([sharedIdSystemSubmodule]); - config.setConfig(getConfigMock(['pubCommonId', 'pubcid', 'cookie'])); - expect(utils.logInfo.args[0][0]).to.exist.and.to.contain('User ID - usersync config updated for 1 submodules'); + it('should opt back in on refresh', () => { + setup(); + config.setConfig(cfg); + return getGlobal().getUserIdsAsync().then((uid) => { + expect(uid).to.eql({}); + sinon.assert.notCalled(mockIdSystem.getId); + teardown(); + return getGlobal().refreshUserIds().then((uid) => { + sinon.assert.calledOnce(mockIdSystem.getId); + expect(uid).to.eql({ mid: 'id' }); + }); + }); + }); + }); }); }); diff --git a/test/spec/unit/core/targeting_spec.js b/test/spec/unit/core/targeting_spec.js index 0d125bcb0..704efcf6b 100644 --- a/test/spec/unit/core/targeting_spec.js +++ b/test/spec/unit/core/targeting_spec.js @@ -26,7 +26,6 @@ const sampleBid = { 'bidderCode': 'rubicon', 'width': '300', 'height': '250', - 'statusMessage': 'Bid available', 'adId': '148018fe5e', 'cpm': 0.537234, 'ad': 'markup', @@ -60,7 +59,6 @@ const bid2 = mkBid({ 'bidderCode': 'rubicon', 'width': '300', 'height': '250', - 'statusMessage': 'Bid available', 'adId': '5454545', 'cpm': 0.25, 'ad': 'markup', @@ -90,7 +88,6 @@ const bid3 = mkBid({ 'bidderCode': 'rubicon', 'width': '300', 'height': '600', - 'statusMessage': 'Bid available', 'adId': '48747745', 'cpm': 0.75, 'ad': 'markup', @@ -120,7 +117,6 @@ const nativeBid1 = mkBid({ 'bidderCode': 'appnexus', 'width': 0, 'height': 0, - 'statusMessage': 'Bid available', 'adId': '591e7c9354b633', 'requestId': '24aae81e32d6f6', 'mediaType': 'native', @@ -188,7 +184,6 @@ const nativeBid2 = mkBid({ 'bidderCode': 'dgads', 'width': 0, 'height': 0, - 'statusMessage': 'Bid available', 'adId': '6e0aba55ed54e5', 'requestId': '4de26ec83d9661', 'mediaType': 'native', diff --git a/test/spec/unit/pbjs_api_spec.js b/test/spec/unit/pbjs_api_spec.js index e5718817e..1a61214c6 100644 --- a/test/spec/unit/pbjs_api_spec.js +++ b/test/spec/unit/pbjs_api_spec.js @@ -3723,7 +3723,6 @@ describe('Unit: Prebid Module', function () { 'dealId': '1234', 'width': 300, 'height': 250, - 'statusMessage': 'Bid available', 'adId': '233bcbee889d46d', 'creative_id': 29681110, 'cpm': 10, diff --git a/tsconfig.json b/tsconfig.json index eb6e9650b..2e4f02a49 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,7 +8,7 @@ "rootDir": "./", "outDir": "./dist/src/", "noImplicitAny": false, - "allowJs": true, + "allowJs": false, "checkJs": false, "types": [], "lib": ["es2019", "DOM"],