forked from prebid/Prebid.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnetIdSystem.js
53 lines (49 loc) · 1.4 KB
/
netIdSystem.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/**
* This module adds netId to the User ID module
* The {@link module:modules/userId} module is required
* @module modules/netIdSystem
* @requires module:modules/userId
*/
import {submodule} from '../src/hook.js';
/**
* @typedef {import('../modules/userId/index.js').Submodule} Submodule
* @typedef {import('../modules/userId/index.js').SubmoduleConfig} SubmoduleConfig
* @typedef {import('../modules/userId/index.js').ConsentData} ConsentData
* @typedef {import('../modules/userId/index.js').IdResponse} IdResponse
*/
/** @type {Submodule} */
export const netIdSubmodule = {
/**
* used to link submodule with config
* @type {string}
*/
name: 'netId',
/**
* decode the stored id value for passing to bid requests
* @function decode
* @param {(Object|string)} value
* @returns {(Object|undefined)}
*/
decode(value) {
return (value && typeof value['netId'] === 'string') ? { 'netId': value['netId'] } : undefined;
},
/**
* performs action to obtain id and return a value in the callback's response argument
* @function
* @param {SubmoduleConfig} [config]
* @param {ConsentData} [consentData]
* @param {(Object|undefined)} cacheIdObj
* @returns {IdResponse|undefined}
*/
getId(config) {
/* currently not possible */
return {};
},
eids: {
'netId': {
source: 'netid.de',
atype: 1
},
}
};
submodule('userId', netIdSubmodule);