-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New PubProvided Id UserId Submodule (#5767)
* PubProvided Module * - * formatting * formatting * Added rubiconBidAdapter support Added unit tests * formatting * formatting * formatting * formatting * commit to rerun build * type changes * type changes * type changes * Revert "type changes" This reverts commit af408b0 * Revert "type changes" This reverts commit af408b0 * formatting * formatting * formatting * formatting * formatting * Revert "type changes" This reverts commit 114005a * formatting * formatting * formatting * formatting * commit to rerun build * commit to rerun build * commit to rerun build * rubiconBidAdapter changes * rubiconBidAdapter changes * rubiconBidAdapter changes * trigger build * fix * fix * fix * rebuild Co-authored-by: myerkovich <[email protected]>
- Loading branch information
1 parent
eb9cf3f
commit 739bad8
Showing
7 changed files
with
513 additions
and
201 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/** | ||
* This module adds Publisher Provided ids support to the User ID module | ||
* The {@link module:modules/userId} module is required. | ||
* @module modules/pubProvidedSystem | ||
* @requires module:modules/userId | ||
*/ | ||
|
||
import {submodule} from '../src/hook.js'; | ||
import * as utils from '../src/utils.js'; | ||
|
||
const MODULE_NAME = 'pubProvidedId'; | ||
|
||
/** @type {Submodule} */ | ||
export const pubProvidedIdSubmodule = { | ||
|
||
/** | ||
* used to link submodule with config | ||
* @type {string} | ||
*/ | ||
name: MODULE_NAME, | ||
|
||
/** | ||
* decode the stored id value for passing to bid request | ||
* @function | ||
* @param {string} value | ||
* @returns {{pubProvidedId: array}} or undefined if value doesn't exists | ||
*/ | ||
decode(value) { | ||
const res = value ? {pubProvidedId: value} : undefined; | ||
utils.logInfo('PubProvidedId: Decoded value ' + JSON.stringify(res)); | ||
return res; | ||
}, | ||
|
||
/** | ||
* performs action to obtain id and return a value. | ||
* @function | ||
* @param {SubmoduleParams} [configParams] | ||
* @returns {{id: array}} | ||
*/ | ||
getId(configParams) { | ||
let res = []; | ||
if (utils.isArray(configParams.eids)) { | ||
res = res.concat(configParams.eids); | ||
} | ||
if (typeof configParams.eidsFunction === 'function') { | ||
res = res.concat(configParams.eidsFunction()); | ||
} | ||
return {id: res}; | ||
} | ||
}; | ||
|
||
// Register submodule for userId | ||
submodule('userId', pubProvidedIdSubmodule); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.