• 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.5
/modules/utiqMtpIdSystem.js
1
/**
1✔
2
 * This module adds Utiq MTP provided by Utiq SA/NV to the User ID module
3
 * The {@link module:modules/userId} module is required
4
 * @module modules/utiqMtpIdSystem
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 = 'utiqMtpId';
1✔
17
const LOG_PREFIX = 'Utiq MTP module';
1✔
18

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

24
/**
25
 * Get the "mtid" from html5 local storage to make it available to the UserId module.
26
 * @returns {{utiqMtp: (*|string)}}
27
 */
28
function getUtiqFromStorage() {
29
  let utiqPass;
30
  const utiqPassStorage = JSON.parse(
26✔
31
    storage.getDataFromLocalStorage('utiqPass')
32
  );
33
  logInfo(
26✔
34
    `${LOG_PREFIX}: Local storage utiqPass: ${JSON.stringify(
35
      utiqPassStorage
36
    )}`
37
  );
38

39
  if (
26✔
40
    utiqPassStorage &&
65✔
41
    utiqPassStorage.connectId &&
42
    Array.isArray(utiqPassStorage.connectId.idGraph) &&
43
    utiqPassStorage.connectId.idGraph.length > 0
44
  ) {
45
    utiqPass = utiqPassStorage.connectId.idGraph[0];
13✔
46
  }
47
  logInfo(
26✔
48
    `${LOG_PREFIX}: Graph of utiqPass: ${JSON.stringify(
49
      utiqPass
50
    )}`
51
  );
52

53
  return {
26✔
54
    utiqMtp:
55
      utiqPass && utiqPass.mtid
65✔
56
        ? utiqPass.mtid
57
        : null,
58
  };
59
}
60

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

142
submodule('userId', utiqMtpIdSubmodule);
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