• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

prebid / Prebid.js / 16976294738

14 Aug 2025 08:45PM UTC coverage: 96.25% (-0.001%) from 96.251%
16976294738

push

github

web-flow
fluct Bid Adapter : add instl support (#13439)

* add instl support

* falseの場合も明示的に送信するようにした

39472 of 48509 branches covered (81.37%)

11 of 11 new or added lines in 2 files covered. (100.0%)

23 existing lines in 11 files now uncovered.

195599 of 203219 relevant lines covered (96.25%)

124.45 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

97.73
/modules/utiqIdSystem.js
1
/**
1✔
2
 * This module adds Utiq provided by Utiq SA/NV to the User ID module
3
 * The {@link module:modules/userId} module is required
4
 * @module modules/utiqIdSystem
5
 * @requires module:modules/userId
6
 */
7
import { logInfo } from '../src/utils.js';
8
import { submodule } from '../src/hook.js';
9
import { getStorageManager } from '../src/storageManager.js';
10
import { MODULE_TYPE_UID } from '../src/activities/modules.js';
11

12
/**
13
 * @typedef {import('../modules/userId/index.js').Submodule} Submodule
14
 */
15

16
const MODULE_NAME = 'utiqId';
1✔
17
const LOG_PREFIX = 'Utiq module';
1✔
18

19
export const storage = getStorageManager({
1✔
20
  moduleType: MODULE_TYPE_UID,
21
  moduleName: MODULE_NAME,
22
});
23

24
/**
25
 * Get the "atid" from html5 local storage to make it available to the UserId module.
26
 * @returns {{utiq: (*|string)}}
27
 */
28
function getUtiqFromStorage() {
29
  let utiqPass;
30
  const utiqPassStorage = JSON.parse(
29✔
31
    storage.getDataFromLocalStorage('utiqPass')
32
  );
33

34
  const netIdAdtechpass = storage.getDataFromLocalStorage('netid_utiq_adtechpass');
29✔
35

36
  if (netIdAdtechpass) {
29✔
37
    logInfo(
1✔
38
      `${LOG_PREFIX}: Local storage netid_utiq_adtechpass: ${netIdAdtechpass}`
39
    );
40
    return {
1✔
41
      utiq: netIdAdtechpass,
42
    }
43
  }
44

45
  if (
28✔
46
    utiqPassStorage &&
55✔
47
    utiqPassStorage.connectId &&
48
    Array.isArray(utiqPassStorage.connectId.idGraph) &&
49
    utiqPassStorage.connectId.idGraph.length > 0
50
  ) {
51
    utiqPass = utiqPassStorage.connectId.idGraph[0];
9✔
52

53
    logInfo(
9✔
54
      `${LOG_PREFIX}: Local storage utiqPass: ${JSON.stringify(
55
        utiqPassStorage
56
      )}`
57
    );
58

59
    logInfo(
9✔
60
      `${LOG_PREFIX}: Graph of utiqPass: ${JSON.stringify(
61
        utiqPass
62
      )}`
63
    );
64
  }
65

66
  return {
28✔
67
    utiq:
68
      utiqPass && utiqPass.atid
65✔
69
        ? utiqPass.atid
70
        : null,
71
  };
72
}
73

74
/** @type {Submodule} */
75
export const utiqIdSubmodule = {
1✔
76
  /**
77
   * Used to link submodule with config
78
   * @type {string}
79
   */
80
  name: MODULE_NAME,
81
  disclosureURL: 'local://modules/utiqDeviceStorageDisclosure.json',
82
  /**
83
   * Decodes the stored id value for passing to bid requests.
84
   * @function
85
   * @returns {{utiq: string} | null}
86
   */
87
  decode(bidId) {
88
    logInfo(`${LOG_PREFIX}: Decoded ID value ${JSON.stringify(bidId)}`);
5✔
89
    return bidId.utiq ? bidId : null;
5✔
90
  },
91
  /**
92
   * Get the id from helper function and initiate a new user sync.
93
   * @param config
94
   * @returns {{callback: Function}|{id: {utiq: string}}}
95
   */
96
  getId: function (config) {
97
    const data = getUtiqFromStorage();
12✔
98
    if (data.utiq) {
12✔
99
      logInfo(`${LOG_PREFIX}: Local storage ID value ${JSON.stringify(data)}`);
6✔
100
      return { id: { utiq: data.utiq } };
6✔
101
    } else {
102
      if (!config) {
6✔
103
        config = {};
5✔
104
      }
105
      if (!config.params) {
6✔
106
        config.params = {};
5✔
107
      }
108
      if (
6✔
109
        typeof config.params.maxDelayTime === 'undefined' ||
7✔
110
        config.params.maxDelayTime === null
111
      ) {
112
        config.params.maxDelayTime = 1000;
5✔
113
      }
114
      // Current delay and delay step in milliseconds
115
      let currentDelay = 0;
6✔
116
      const delayStep = 50;
6✔
117
      const result = (callback) => {
6✔
118
        const data = getUtiqFromStorage();
17✔
119
        if (!data.utiq) {
17✔
120
          if (currentDelay > config.params.maxDelayTime) {
15✔
121
            logInfo(
1✔
122
              `${LOG_PREFIX}: No utiq value set after ${config.params.maxDelayTime} max allowed delay time`
123
            );
124
            callback(null);
1✔
125
          } else {
126
            currentDelay += delayStep;
14✔
127
            setTimeout(() => {
14✔
128
              result(callback);
14✔
129
            }, delayStep);
130
          }
131
        } else {
132
          const dataToReturn = { utiq: data.utiq };
2✔
133
          logInfo(
2✔
134
            `${LOG_PREFIX}: Returning ID value data of ${JSON.stringify(
135
              dataToReturn
136
            )}`
137
          );
138
          callback(dataToReturn);
2✔
139
        }
140
      };
141
      return { callback: result };
6✔
142
    }
143
  },
144
  eids: {
145
    'utiq': {
146
      source: 'utiq.com',
147
      atype: 1,
148
      getValue: function (data) {
UNCOV
149
        return data;
×
150
      },
151
    },
152
  }
153
};
154

155
submodule('userId', utiqIdSubmodule);
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc