prebid.js 9.2.0 → 9.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (279) hide show
  1. package/creative/constants.js +2 -1
  2. package/creative/crossDomain.js +16 -4
  3. package/dist/33acrossAnalyticsAdapter.js +1 -1
  4. package/dist/33acrossBidAdapter.js +1 -1
  5. package/dist/33acrossIdSystem.js +1 -1
  6. package/dist/BTBidAdapter.js +1 -1
  7. package/dist/adagioAnalyticsAdapter.js +1 -1
  8. package/dist/adagioBidAdapter.js +1 -1
  9. package/dist/adagioRtdProvider.js +1 -1
  10. package/dist/adagioUtils.js +1 -1
  11. package/dist/addefendBidAdapter.js +1 -1
  12. package/dist/adfBidAdapter.js +1 -1
  13. package/dist/adgenerationBidAdapter.js +1 -1
  14. package/dist/adlooxRtdProvider.js +1 -1
  15. package/dist/adnuntiusBidAdapter.js +1 -1
  16. package/dist/adqueryBidAdapter.js +1 -1
  17. package/dist/adrelevantisBidAdapter.js +1 -1
  18. package/dist/adstirBidAdapter.js +1 -1
  19. package/dist/adtrgtmeBidAdapter.js +1 -1
  20. package/dist/adxcgAnalyticsAdapter.js +1 -1
  21. package/dist/adxcgBidAdapter.js +1 -1
  22. package/dist/adyoulikeBidAdapter.js +1 -1
  23. package/dist/agmaAnalyticsAdapter.js +1 -1
  24. package/dist/ajaBidAdapter.js +1 -1
  25. package/dist/amxBidAdapter.js +1 -1
  26. package/dist/amxIdSystem.js +1 -1
  27. package/dist/appierAnalyticsAdapter.js +1 -1
  28. package/dist/appnexusBidAdapter.js +1 -1
  29. package/dist/asoBidAdapter.js +1 -1
  30. package/dist/axonixBidAdapter.js +1 -1
  31. package/dist/bidglassBidAdapter.js +1 -1
  32. package/dist/big-richmediaBidAdapter.js +1 -1
  33. package/dist/bridBidAdapter.js +1 -1
  34. package/dist/bridgewellBidAdapter.js +1 -1
  35. package/dist/brightMountainMediaBidAdapter.js +1 -1
  36. package/dist/carodaBidAdapter.js +1 -1
  37. package/dist/chtnwBidAdapter.js +1 -1
  38. package/dist/chunk-core.js +1 -1
  39. package/dist/codefuelBidAdapter.js +1 -1
  40. package/dist/concertBidAdapter.js +1 -1
  41. package/dist/connectadBidAdapter.js +1 -1
  42. package/dist/consentManagement.js +1 -0
  43. package/dist/consentManagementGpp.js +1 -1
  44. package/dist/consentManagementTcf.js +1 -1
  45. package/dist/consumableBidAdapter.js +1 -1
  46. package/dist/conversantAnalyticsAdapter.js +1 -1
  47. package/dist/conversantBidAdapter.js +1 -1
  48. package/dist/copper6sspBidAdapter.js +1 -0
  49. package/dist/cpmstarBidAdapter.js +1 -1
  50. package/dist/craftBidAdapter.js +1 -1
  51. package/dist/criteoBidAdapter.js +1 -1
  52. package/dist/cwireBidAdapter.js +1 -1
  53. package/dist/dailymotionBidAdapter.js +1 -1
  54. package/dist/deltaprojectsBidAdapter.js +1 -1
  55. package/dist/dependencies.json +51 -13
  56. package/dist/dianomiBidAdapter.js +1 -1
  57. package/dist/dspxBidAdapter.js +1 -1
  58. package/dist/dxkultureBidAdapter.js +1 -1
  59. package/dist/eplanningBidAdapter.js +1 -1
  60. package/dist/euidIdSystem.js +1 -1
  61. package/dist/exadsBidAdapter.js +1 -1
  62. package/dist/feedadBidAdapter.js +1 -1
  63. package/dist/finativeBidAdapter.js +1 -1
  64. package/dist/freewheel-sspBidAdapter.js +1 -1
  65. package/dist/gmosspBidAdapter.js +1 -1
  66. package/dist/goldbachBidAdapter.js +1 -1
  67. package/dist/greenbidsAnalyticsAdapter.js +1 -1
  68. package/dist/greenbidsRtdProvider.js +1 -1
  69. package/dist/gridBidAdapter.js +1 -1
  70. package/dist/gumgumBidAdapter.js +1 -1
  71. package/dist/h12mediaBidAdapter.js +1 -1
  72. package/dist/hypelabBidAdapter.js +1 -1
  73. package/dist/id5AnalyticsAdapter.js +1 -1
  74. package/dist/id5IdSystem.js +1 -1
  75. package/dist/illuminBidAdapter.js +1 -1
  76. package/dist/imdsBidAdapter.js +1 -1
  77. package/dist/improvedigitalBidAdapter.js +1 -1
  78. package/dist/insticatorBidAdapter.js +1 -1
  79. package/dist/intentIqIdSystem.js +1 -1
  80. package/dist/ixBidAdapter.js +1 -1
  81. package/dist/jixieBidAdapter.js +1 -1
  82. package/dist/justpremiumBidAdapter.js +1 -1
  83. package/dist/kargoBidAdapter.js +1 -1
  84. package/dist/kimberliteBidAdapter.js +1 -1
  85. package/dist/konduitAnalyticsAdapter.js +1 -1
  86. package/dist/kueezBidAdapter.js +1 -1
  87. package/dist/kueezRtbBidAdapter.js +1 -1
  88. package/dist/lassoBidAdapter.js +1 -1
  89. package/dist/lifestreetBidAdapter.js +1 -1
  90. package/dist/liveIntentIdSystem.js +1 -1
  91. package/dist/logicadBidAdapter.js +1 -1
  92. package/dist/loglyliftBidAdapter.js +1 -1
  93. package/dist/luceadBidAdapter.js +1 -1
  94. package/dist/luponmediaBidAdapter.js +1 -1
  95. package/dist/mabidderBidAdapter.js +1 -1
  96. package/dist/magniteAnalyticsAdapter.js +1 -1
  97. package/dist/malltvAnalyticsAdapter.js +1 -1
  98. package/dist/marsmediaBidAdapter.js +1 -1
  99. package/dist/mediafuseBidAdapter.js +1 -1
  100. package/dist/medianetAnalyticsAdapter.js +1 -1
  101. package/dist/medianetBidAdapter.js +1 -1
  102. package/dist/mediasquareBidAdapter.js +1 -1
  103. package/dist/mgidBidAdapter.js +1 -1
  104. package/dist/minutemediaBidAdapter.js +1 -1
  105. package/dist/missenaBidAdapter.js +1 -1
  106. package/dist/nexx360BidAdapter.js +1 -1
  107. package/dist/nobidAnalyticsAdapter.js +1 -1
  108. package/dist/nobidBidAdapter.js +1 -1
  109. package/dist/not-for-prod/prebid.js +184 -178
  110. package/dist/oguryBidAdapter.js +1 -1
  111. package/dist/onetagBidAdapter.js +1 -1
  112. package/dist/ooloAnalyticsAdapter.js +1 -1
  113. package/dist/openwebBidAdapter.js +1 -1
  114. package/dist/openxBidAdapter.js +1 -1
  115. package/dist/optidigitalBidAdapter.js +1 -1
  116. package/dist/orakiBidAdapter.js +1 -0
  117. package/dist/orbidderBidAdapter.js +1 -1
  118. package/dist/outbrainBidAdapter.js +1 -1
  119. package/dist/ozoneBidAdapter.js +1 -1
  120. package/dist/pairIdSystem.js +1 -1
  121. package/dist/pixfutureBidAdapter.js +1 -1
  122. package/dist/prebidServerBidAdapter.js +1 -1
  123. package/dist/processResponse.js +1 -0
  124. package/dist/publinkIdSystem.js +1 -1
  125. package/dist/publirBidAdapter.js +1 -1
  126. package/dist/pubmaticAnalyticsAdapter.js +1 -1
  127. package/dist/pubmaticBidAdapter.js +1 -1
  128. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  129. package/dist/pxyzBidAdapter.js +1 -1
  130. package/dist/quantcastBidAdapter.js +1 -1
  131. package/dist/readpeakBidAdapter.js +1 -1
  132. package/dist/relaidoBidAdapter.js +1 -1
  133. package/dist/retailspotBidAdapter.js +1 -1
  134. package/dist/rhythmoneBidAdapter.js +1 -1
  135. package/dist/riseBidAdapter.js +1 -1
  136. package/dist/rubiconBidAdapter.js +1 -1
  137. package/dist/seedingAllianceBidAdapter.js +1 -1
  138. package/dist/seedtagBidAdapter.js +1 -1
  139. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  140. package/dist/sharethroughBidAdapter.js +1 -1
  141. package/dist/shinezBidAdapter.js +1 -1
  142. package/dist/shinezRtbBidAdapter.js +1 -1
  143. package/dist/smaatoBidAdapter.js +1 -1
  144. package/dist/smartadserverBidAdapter.js +1 -1
  145. package/dist/smartxBidAdapter.js +1 -1
  146. package/dist/smartyadsBidAdapter.js +1 -1
  147. package/dist/smartyadsUtils.js +1 -0
  148. package/dist/smilewantedBidAdapter.js +1 -1
  149. package/dist/snigelBidAdapter.js +1 -1
  150. package/dist/sonobiBidAdapter.js +1 -1
  151. package/dist/sovrnBidAdapter.js +1 -1
  152. package/dist/sspBCBidAdapter.js +1 -1
  153. package/dist/stnBidAdapter.js +1 -1
  154. package/dist/stvBidAdapter.js +1 -1
  155. package/dist/sublimeBidAdapter.js +1 -1
  156. package/dist/taboolaBidAdapter.js +1 -1
  157. package/dist/tagorasBidAdapter.js +1 -1
  158. package/dist/tappxBidAdapter.js +1 -1
  159. package/dist/targetVideoBidAdapter.js +1 -1
  160. package/dist/teadsBidAdapter.js +1 -1
  161. package/dist/terceptAnalyticsAdapter.js +1 -1
  162. package/dist/themoneytizerBidAdapter.js +1 -1
  163. package/dist/trionBidAdapter.js +1 -1
  164. package/dist/tripleliftBidAdapter.js +1 -1
  165. package/dist/ttdBidAdapter.js +1 -1
  166. package/dist/twistDigitalBidAdapter.js +1 -1
  167. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  168. package/dist/uid2IdSystem.js +1 -1
  169. package/dist/underdogmediaBidAdapter.js +1 -1
  170. package/dist/undertoneBidAdapter.js +1 -1
  171. package/dist/unrulyBidAdapter.js +1 -1
  172. package/dist/userId.js +1 -1
  173. package/dist/viantOrtbBidAdapter.js +1 -1
  174. package/dist/vidazooBidAdapter.js +1 -1
  175. package/dist/vidazooUtils.js +1 -0
  176. package/dist/videobyteBidAdapter.js +1 -1
  177. package/dist/visxBidAdapter.js +1 -1
  178. package/dist/vuukleBidAdapter.js +1 -1
  179. package/dist/widespaceBidAdapter.js +1 -1
  180. package/dist/winrBidAdapter.js +1 -1
  181. package/dist/yahooAdsBidAdapter.js +1 -1
  182. package/dist/yieldmoBidAdapter.js +1 -1
  183. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  184. package/dist/yuktamediaAnalyticsAdapter.js +1 -1
  185. package/dist/zeta_global_sspBidAdapter.js +1 -1
  186. package/integrationExamples/gpt/x-domain/creative.html +1 -1
  187. package/libraries/consentManagement/cmUtils.js +38 -0
  188. package/libraries/processResponse/index.js +12 -0
  189. package/libraries/smartyadsUtils/getAdUrlByRegion.js +32 -0
  190. package/libraries/vidazooUtils/bidderUtils.js +480 -0
  191. package/libraries/vidazooUtils/constants.js +7 -0
  192. package/modules/adagioRtdProvider.js +9 -7
  193. package/modules/addefendBidAdapter.js +1 -2
  194. package/modules/adfBidAdapter.js +1 -10
  195. package/modules/adlooxRtdProvider.js +1 -1
  196. package/modules/adnuntiusBidAdapter.js +1 -0
  197. package/modules/adxcgAnalyticsAdapter.js +1 -2
  198. package/modules/carodaBidAdapter.js +3 -8
  199. package/modules/codefuelBidAdapter.js +1 -10
  200. package/modules/consentManagementGpp.js +2 -38
  201. package/modules/consentManagementTcf.js +7 -38
  202. package/modules/conversantAnalyticsAdapter.js +1 -2
  203. package/modules/copper6sspBidAdapter.js +19 -0
  204. package/modules/copper6sspBidAdapter.md +79 -0
  205. package/modules/cpmstarBidAdapter.js +52 -36
  206. package/modules/cpmstarBidAdapter.md +1 -4
  207. package/modules/criteoBidAdapter.js +10 -3
  208. package/modules/dailymotionBidAdapter.js +1 -1
  209. package/modules/deltaprojectsBidAdapter.js +2 -11
  210. package/modules/dianomiBidAdapter.js +1 -9
  211. package/modules/finativeBidAdapter.js +1 -10
  212. package/modules/gridBidAdapter.js +2 -12
  213. package/modules/id5AnalyticsAdapter.js +1 -2
  214. package/modules/illuminBidAdapter.js +9 -304
  215. package/modules/intentIqIdSystem.js +408 -50
  216. package/modules/intentIqIdSystem.md +92 -0
  217. package/modules/kueezRtbBidAdapter.js +17 -312
  218. package/modules/liveIntentIdSystem.js +2 -2
  219. package/modules/luponmediaBidAdapter.js +4 -10
  220. package/modules/mabidderBidAdapter.js +1 -2
  221. package/modules/medianetAnalyticsAdapter.js +1 -2
  222. package/modules/medianetBidAdapter.js +1 -1
  223. package/modules/mgidBidAdapter.js +1 -10
  224. package/modules/orakiBidAdapter.js +19 -0
  225. package/modules/orakiBidAdapter.md +79 -0
  226. package/modules/orbidderBidAdapter.js +4 -2
  227. package/modules/outbrainBidAdapter.js +8 -43
  228. package/modules/ozoneBidAdapter.js +9 -7
  229. package/modules/pairIdSystem.js +27 -10
  230. package/modules/pixfutureBidAdapter.js +1 -2
  231. package/modules/prebidServerBidAdapter/index.js +1 -1
  232. package/modules/seedtagBidAdapter.js +4 -0
  233. package/modules/shinezRtbBidAdapter.js +12 -304
  234. package/modules/smartadserverBidAdapter.js +3 -0
  235. package/modules/smartyadsBidAdapter.js +6 -110
  236. package/modules/snigelBidAdapter.js +1 -2
  237. package/modules/tagorasBidAdapter.js +13 -316
  238. package/modules/tappxBidAdapter.js +1 -2
  239. package/modules/terceptAnalyticsAdapter.js +1 -2
  240. package/modules/twistDigitalBidAdapter.js +9 -433
  241. package/modules/userId/index.js +31 -21
  242. package/modules/viantOrtbBidAdapter.js +20 -0
  243. package/modules/vidazooBidAdapter.js +26 -468
  244. package/modules/visxBidAdapter.js +27 -29
  245. package/modules/yahooAdsBidAdapter.js +4 -1
  246. package/modules/yuktamediaAnalyticsAdapter.js +1 -2
  247. package/modules/zeta_global_sspBidAdapter.js +2 -2
  248. package/package.json +1 -1
  249. package/src/adRendering.js +25 -2
  250. package/src/constants.js +2 -0
  251. package/src/prebid.js +2 -1
  252. package/src/utils.js +19 -1
  253. package/test/spec/creative/crossDomainCreative_spec.js +38 -2
  254. package/test/spec/fpd/gdpr_spec.js +24 -2
  255. package/test/spec/libraries/processResponse_spec.js +60 -0
  256. package/test/spec/modules/adagioRtdProvider_spec.js +12 -0
  257. package/test/spec/modules/adnuntiusBidAdapter_spec.js +6 -3
  258. package/test/spec/modules/conversantAnalyticsAdapter_spec.js +1 -1
  259. package/test/spec/modules/copper6sspBidAdapter_spec.js +514 -0
  260. package/test/spec/modules/cpmstarBidAdapter_spec.js +1 -1
  261. package/test/spec/modules/dailymotionBidAdapter_spec.js +18 -14
  262. package/test/spec/modules/illuminBidAdapter_spec.js +26 -13
  263. package/test/spec/modules/intentIqIdSystem_spec.js +264 -36
  264. package/test/spec/modules/kueezRtbBidAdapter_spec.js +26 -15
  265. package/test/spec/modules/orakiBidAdapter_spec.js +510 -0
  266. package/test/spec/modules/outbrainBidAdapter_spec.js +32 -1
  267. package/test/spec/modules/seedtagBidAdapter_spec.js +27 -0
  268. package/test/spec/modules/shinezRtbBidAdapter_spec.js +26 -14
  269. package/test/spec/modules/smartadserverBidAdapter_spec.js +7 -0
  270. package/test/spec/modules/smartyadsBidAdapter_spec.js +6 -83
  271. package/test/spec/modules/tagorasBidAdapter_spec.js +26 -15
  272. package/test/spec/modules/twistDigitalBidAdapter_spec.js +19 -22
  273. package/test/spec/modules/userId_spec.js +86 -47
  274. package/test/spec/modules/viantOrtbBidAdapter_spec.js +87 -6
  275. package/test/spec/modules/vidazooBidAdapter_spec.js +21 -23
  276. package/test/spec/modules/visxBidAdapter_spec.js +180 -0
  277. package/test/spec/modules/yahooAdsBidAdapter_spec.js +1 -1
  278. package/test/spec/modules/zeta_global_sspBidAdapter_spec.js +11 -0
  279. package/test/spec/unit/pbjs_api_spec.js +6 -1
@@ -1,338 +1,43 @@
1
- import {_each, deepAccess, parseSizesInput, parseUrl, uniques, isFn} from '../src/utils.js';
2
1
  import {registerBidder} from '../src/adapters/bidderFactory.js';
3
2
  import {BANNER, VIDEO} from '../src/mediaTypes.js';
4
3
  import {getStorageManager} from '../src/storageManager.js';
5
- import {config} from '../src/config.js';
4
+ import {
5
+ createBuildRequestsFn,
6
+ createInterpretResponseFn,
7
+ createUserSyncGetter,
8
+ isBidRequestValid
9
+ } from '../libraries/vidazooUtils/bidderUtils.js';
6
10
 
7
11
  const GVLID = 1165;
8
12
  const DEFAULT_SUB_DOMAIN = 'exchange';
9
13
  const BIDDER_CODE = 'kueezrtb';
10
14
  const BIDDER_VERSION = '1.0.0';
11
- const CURRENCY = 'USD';
12
- const TTL_SECONDS = 60 * 5;
13
- const UNIQUE_DEAL_ID_EXPIRY = 1000 * 60 * 15;
14
- const storage = getStorageManager({bidderCode: BIDDER_CODE});
15
-
16
- function getTopWindowQueryParams() {
17
- try {
18
- const parsedUrl = parseUrl(window.top.document.URL, {decodeSearchAsString: true});
19
- return parsedUrl.search;
20
- } catch (e) {
21
- return '';
22
- }
23
- }
15
+ export const storage = getStorageManager({bidderCode: BIDDER_CODE});
24
16
 
25
17
  export function createDomain(subDomain = DEFAULT_SUB_DOMAIN) {
26
18
  return `https://${subDomain}.kueezrtb.com`;
27
19
  }
28
20
 
29
- export function extractCID(params) {
30
- return params.cId || params.CID || params.cID || params.CId || params.cid || params.ciD || params.Cid || params.CiD;
31
- }
32
-
33
- export function extractPID(params) {
34
- return params.pId || params.PID || params.pID || params.PId || params.pid || params.piD || params.Pid || params.PiD;
35
- }
36
-
37
- export function extractSubDomain(params) {
38
- return params.subDomain || params.SubDomain || params.Subdomain || params.subdomain || params.SUBDOMAIN || params.subDOMAIN;
39
- }
40
-
41
- function isBidRequestValid(bid) {
42
- const params = bid.params || {};
43
- return !!(extractCID(params) && extractPID(params));
44
- }
45
-
46
- function buildRequest(bid, topWindowUrl, sizes, bidderRequest, bidderTimeout) {
21
+ function createUniqueRequestData(hashUrl, bid) {
47
22
  const {
48
- params,
49
- bidId,
50
- userId,
51
- adUnitCode,
52
- schain,
53
- mediaTypes,
54
23
  auctionId,
55
24
  transactionId,
56
- bidderRequestId,
57
- bidRequestsCount,
58
- bidderRequestsCount,
59
- bidderWinsCount
60
25
  } = bid;
61
- let {bidFloor, ext} = params;
62
- const hashUrl = hashCode(topWindowUrl);
63
- const uniqueDealId = getUniqueDealId(hashUrl);
64
- const cId = extractCID(params);
65
- const pId = extractPID(params);
66
- const subDomain = extractSubDomain(params);
67
-
68
- const gpid = deepAccess(bid, 'ortb2Imp.ext.gpid') || deepAccess(bid, 'ortb2Imp.ext.data.pbadslot', '');
69
-
70
- if (isFn(bid.getFloor)) {
71
- const floorInfo = bid.getFloor({
72
- currency: 'USD',
73
- mediaType: '*',
74
- size: '*'
75
- });
76
-
77
- if (floorInfo.currency === 'USD') {
78
- bidFloor = floorInfo.floor;
79
- }
80
- }
81
26
 
82
- let data = {
83
- url: encodeURIComponent(topWindowUrl),
84
- uqs: getTopWindowQueryParams(),
85
- cb: Date.now(),
86
- bidFloor: bidFloor,
87
- bidId: bidId,
88
- referrer: bidderRequest.refererInfo.ref,
89
- adUnitCode: adUnitCode,
90
- publisherId: pId,
91
- sizes: sizes,
92
- uniqueDealId: uniqueDealId,
93
- bidderVersion: BIDDER_VERSION,
94
- prebidVersion: '$prebid.version$',
95
- res: `${screen.width}x${screen.height}`,
96
- schain: schain,
97
- mediaTypes: mediaTypes,
98
- gpid: gpid,
99
- // TODO: fix auctionId/transactionId leak: https://github.com/prebid/Prebid.js/issues/9781
100
- auctionId: auctionId,
101
- transactionId: transactionId,
102
- bidderRequestId: bidderRequestId,
103
- bidRequestsCount: bidRequestsCount,
104
- bidderRequestsCount: bidderRequestsCount,
105
- bidderWinsCount: bidderWinsCount,
106
- bidderTimeout: bidderTimeout
107
- };
108
-
109
- appendUserIdsToRequestPayload(data, userId);
110
-
111
- const sua = deepAccess(bidderRequest, 'ortb2.device.sua');
112
-
113
- if (sua) {
114
- data.sua = sua;
115
- }
116
-
117
- if (bidderRequest.gdprConsent) {
118
- if (bidderRequest.gdprConsent.consentString) {
119
- data.gdprConsent = bidderRequest.gdprConsent.consentString;
120
- }
121
- if (bidderRequest.gdprConsent.gdprApplies !== undefined) {
122
- data.gdpr = bidderRequest.gdprConsent.gdprApplies ? 1 : 0;
123
- }
124
- }
125
- if (bidderRequest.uspConsent) {
126
- data.usPrivacy = bidderRequest.uspConsent;
127
- }
128
-
129
- if (bidderRequest.gppConsent) {
130
- data.gppString = bidderRequest.gppConsent.gppString;
131
- data.gppSid = bidderRequest.gppConsent.applicableSections;
132
- } else if (bidderRequest.ortb2?.regs?.gpp) {
133
- data.gppString = bidderRequest.ortb2.regs.gpp;
134
- data.gppSid = bidderRequest.ortb2.regs.gpp_sid;
135
- }
136
-
137
- const dto = {
138
- method: 'POST',
139
- url: `${createDomain(subDomain)}/prebid/multi/${cId}`,
140
- data: data
27
+ return {
28
+ auctionId,
29
+ transactionId,
141
30
  };
142
-
143
- _each(ext, (value, key) => {
144
- dto.data['ext.' + key] = value;
145
- });
146
-
147
- return dto;
148
31
  }
149
32
 
150
- function appendUserIdsToRequestPayload(payloadRef, userIds) {
151
- let key;
152
- _each(userIds, (userId, idSystemProviderName) => {
153
- key = `uid.${idSystemProviderName}`;
33
+ const buildRequests = createBuildRequestsFn(createDomain, createUniqueRequestData, storage, BIDDER_CODE, BIDDER_VERSION, false);
154
34
 
155
- switch (idSystemProviderName) {
156
- case 'digitrustid':
157
- payloadRef[key] = deepAccess(userId, 'data.id');
158
- break;
159
- case 'lipb':
160
- payloadRef[key] = userId.lipbid;
161
- break;
162
- case 'parrableId':
163
- payloadRef[key] = userId.eid;
164
- break;
165
- case 'id5id':
166
- payloadRef[key] = userId.uid;
167
- break;
168
- default:
169
- payloadRef[key] = userId;
170
- }
171
- });
172
- }
35
+ const interpretResponse = createInterpretResponseFn(BIDDER_CODE, false);
173
36
 
174
- function buildRequests(validBidRequests, bidderRequest) {
175
- const topWindowUrl = bidderRequest.refererInfo.page || bidderRequest.refererInfo.topmostLocation;
176
- const bidderTimeout = bidderRequest.timeout ?? config.getConfig('bidderTimeout');
177
- const requests = [];
178
- validBidRequests.forEach(validBidRequest => {
179
- const sizes = parseSizesInput(validBidRequest.sizes);
180
- const request = buildRequest(validBidRequest, topWindowUrl, sizes, bidderRequest, bidderTimeout);
181
- requests.push(request);
182
- });
183
- return requests;
184
- }
185
-
186
- function interpretResponse(serverResponse, request) {
187
- if (!serverResponse || !serverResponse.body) {
188
- return [];
189
- }
190
- const {bidId} = request.data;
191
- const {results} = serverResponse.body;
192
-
193
- let output = [];
194
-
195
- try {
196
- results.forEach(result => {
197
- const {
198
- creativeId,
199
- ad,
200
- price,
201
- exp,
202
- width,
203
- height,
204
- currency,
205
- metaData,
206
- advertiserDomains,
207
- mediaType = BANNER
208
- } = result;
209
- if (!ad || !price) {
210
- return;
211
- }
212
-
213
- const response = {
214
- requestId: bidId,
215
- cpm: price,
216
- width: width,
217
- height: height,
218
- creativeId: creativeId,
219
- currency: currency || CURRENCY,
220
- netRevenue: true,
221
- ttl: exp || TTL_SECONDS,
222
- };
223
-
224
- if (metaData) {
225
- Object.assign(response, {
226
- meta: metaData
227
- })
228
- } else {
229
- Object.assign(response, {
230
- meta: {
231
- advertiserDomains: advertiserDomains || []
232
- }
233
- })
234
- }
235
-
236
- if (mediaType === BANNER) {
237
- Object.assign(response, {
238
- ad: ad,
239
- });
240
- } else {
241
- Object.assign(response, {
242
- vastXml: ad,
243
- mediaType: VIDEO
244
- });
245
- }
246
- output.push(response);
247
- });
248
- return output;
249
- } catch (e) {
250
- return [];
251
- }
252
- }
253
-
254
- function getUserSyncs(syncOptions, responses, gdprConsent = {}, uspConsent = '', gppConsent = {}) {
255
- let syncs = [];
256
- const {iframeEnabled, pixelEnabled} = syncOptions;
257
- const {gdprApplies, consentString = ''} = gdprConsent;
258
- const {gppString, applicableSections} = gppConsent;
259
-
260
- const cidArr = responses.filter(resp => deepAccess(resp, 'body.cid')).map(resp => resp.body.cid).filter(uniques);
261
- let params = `?cid=${encodeURIComponent(cidArr.join(','))}&gdpr=${gdprApplies ? 1 : 0}&gdpr_consent=${encodeURIComponent(consentString || '')}&us_privacy=${encodeURIComponent(uspConsent || '')}`
262
-
263
- if (gppString && applicableSections?.length) {
264
- params += '&gpp=' + encodeURIComponent(gppString);
265
- params += '&gpp_sid=' + encodeURIComponent(applicableSections.join(','));
266
- }
267
-
268
- if (iframeEnabled) {
269
- syncs.push({
270
- type: 'iframe',
271
- url: `https://sync.kueezrtb.com/api/sync/iframe/${params}`
272
- });
273
- }
274
- if (pixelEnabled) {
275
- syncs.push({
276
- type: 'image',
277
- url: `https://sync.kueezrtb.com/api/sync/image/${params}`
278
- });
279
- }
280
- return syncs;
281
- }
282
-
283
- export function hashCode(s, prefix = '_') {
284
- const l = s.length;
285
- let h = 0
286
- let i = 0;
287
- if (l > 0) {
288
- while (i < l) {
289
- h = (h << 5) - h + s.charCodeAt(i++) | 0;
290
- }
291
- }
292
- return prefix + h;
293
- }
294
-
295
- export function getUniqueDealId(key, expiry = UNIQUE_DEAL_ID_EXPIRY) {
296
- const storageKey = `u_${key}`;
297
- const now = Date.now();
298
- const data = getStorageItem(storageKey);
299
- let uniqueId;
300
-
301
- if (!data || !data.value || now - data.created > expiry) {
302
- uniqueId = `${key}_${now.toString()}`;
303
- setStorageItem(storageKey, uniqueId);
304
- } else {
305
- uniqueId = data.value;
306
- }
307
-
308
- return uniqueId;
309
- }
310
-
311
- export function getStorageItem(key) {
312
- try {
313
- return tryParseJSON(storage.getDataFromLocalStorage(key));
314
- } catch (e) {
315
- }
316
-
317
- return null;
318
- }
319
-
320
- export function setStorageItem(key, value, timestamp) {
321
- try {
322
- const created = timestamp || Date.now();
323
- const data = JSON.stringify({value, created});
324
- storage.setDataInLocalStorage(key, data);
325
- } catch (e) {
326
- }
327
- }
328
-
329
- export function tryParseJSON(value) {
330
- try {
331
- return JSON.parse(value);
332
- } catch (e) {
333
- return value;
334
- }
335
- }
37
+ const getUserSyncs = createUserSyncGetter({
38
+ iframeSyncUrl: 'https://sync.kueezrtb.com/api/sync/iframe',
39
+ imageSyncUrl: 'https://sync.kueezrtb.com/api/sync/image'
40
+ });
336
41
 
337
42
  export const spec = {
338
43
  code: BIDDER_CODE,
@@ -20,7 +20,7 @@ import { getRefererInfo } from '../src/refererDetection.js';
20
20
  * @typedef {import('../modules/userId/index.js').SubmoduleConfig} SubmoduleConfig
21
21
  * @typedef {import('../modules/userId/index.js').IdResponse} IdResponse
22
22
  */
23
-
23
+ const GVLID = 148;
24
24
  const DEFAULT_AJAX_TIMEOUT = 5000;
25
25
  const EVENTS_TOPIC = 'pre_lips';
26
26
  const MODULE_NAME = 'liveIntentId';
@@ -185,7 +185,7 @@ export const liveIntentIdSubmodule = {
185
185
  * @type {string}
186
186
  */
187
187
  name: MODULE_NAME,
188
-
188
+ gvlid: GVLID,
189
189
  setModuleMode(mode) {
190
190
  this.moduleMode = mode;
191
191
  },
@@ -9,7 +9,9 @@ import {
9
9
  logError,
10
10
  logMessage,
11
11
  logWarn,
12
- parseSizesInput
12
+ parseSizesInput,
13
+ sizeTupleToRtbSize,
14
+ sizesToSizeTuples
13
15
  } from '../src/utils.js';
14
16
  import {registerBidder} from '../src/adapters/bidderFactory.js';
15
17
  import {config} from '../src/config.js';
@@ -271,16 +273,8 @@ function newOrtbBidRequest(bidRequest, bidderRequest, currentImps) {
271
273
  let bannerSizes = [];
272
274
 
273
275
  if (bannerParams && bannerParams.sizes) {
274
- const sizes = parseSizesInput(bannerParams.sizes);
275
-
276
276
  // get banner sizes in form [{ w: <int>, h: <int> }, ...]
277
- const format = sizes.map(size => {
278
- const [ width, height ] = size.split('x');
279
- const w = parseInt(width, 10);
280
- const h = parseInt(height, 10);
281
- return { w, h };
282
- });
283
-
277
+ const format = sizesToSizeTuples(bannerParams.sizes).map(sizeTupleToRtbSize);
284
278
  bannerSizes = format;
285
279
  }
286
280
 
@@ -1,6 +1,5 @@
1
1
  import { registerBidder } from '../src/adapters/bidderFactory.js';
2
2
  import { BANNER } from '../src/mediaTypes.js';
3
- import { getGlobal } from '../src/prebidGlobal.js';
4
3
  import { ortbConverter } from '../libraries/ortbConverter/converter.js';
5
4
 
6
5
  const BIDDER_CODE = 'mabidder';
@@ -39,7 +38,7 @@ export const spec = {
39
38
  url: baseUrl,
40
39
  method: 'POST',
41
40
  data: {
42
- v: getGlobal().version,
41
+ v: 'v' + '$prebid.version$',
43
42
  bids: bids,
44
43
  url: bidderRequest.refererInfo.page || '',
45
44
  referer: bidderRequest.refererInfo.ref || '',
@@ -36,8 +36,7 @@ const PRICE_GRANULARITY = {
36
36
  };
37
37
 
38
38
  const MEDIANET_BIDDER_CODE = 'medianet';
39
- // eslint-disable-next-line no-undef
40
- const PREBID_VERSION = getGlobal().version;
39
+ const PREBID_VERSION = '$prebid.version$'
41
40
  const ERROR_CONFIG_JSON_PARSE = 'analytics_config_parse_fail';
42
41
  const ERROR_CONFIG_FETCH = 'analytics_config_ajax_fail';
43
42
  const ERROR_WINNING_BID_ABSENT = 'winning_bid_absent';
@@ -186,7 +186,7 @@ function extParams(bidRequest, bidderRequests) {
186
186
  const coppaApplies = !!(config.getConfig('coppa'));
187
187
  return Object.assign({},
188
188
  { customer_id: params.cid },
189
- { prebid_version: getGlobal().version },
189
+ { prebid_version: 'v' + '$prebid.version$' },
190
190
  { gdpr_applies: gdprApplies },
191
191
  (gdprApplies) && { gdpr_consent_string: gdpr.consentString || '' },
192
192
  { usp_applies: uspApplies },
@@ -12,7 +12,7 @@ import {
12
12
  isFn,
13
13
  isNumber,
14
14
  isBoolean,
15
- isInteger, deepSetValue, getBidIdParameter,
15
+ isInteger, deepSetValue, getBidIdParameter, setOnAny
16
16
  } from '../src/utils.js';
17
17
  import {registerBidder} from '../src/adapters/bidderFactory.js';
18
18
  import {BANNER, NATIVE} from '../src/mediaTypes.js';
@@ -431,15 +431,6 @@ export const spec = {
431
431
 
432
432
  registerBidder(spec);
433
433
 
434
- function setOnAny(collection, key) {
435
- for (let i = 0, result; i < collection.length; i++) {
436
- result = deepAccess(collection[i], key);
437
- if (result) {
438
- return result;
439
- }
440
- }
441
- }
442
-
443
434
  /**
444
435
  * Unpack the Server's Bid into a Prebid-compatible one.
445
436
  * @param serverBid
@@ -0,0 +1,19 @@
1
+ import { registerBidder } from '../src/adapters/bidderFactory.js';
2
+ import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js';
3
+ import { isBidRequestValid, buildRequests, interpretResponse, getUserSyncs } from '../libraries/teqblazeUtils/bidderUtils.js';
4
+
5
+ const BIDDER_CODE = 'oraki';
6
+ const AD_URL = 'https://eu1.oraki.io/pbjs';
7
+ const SYNC_URL = 'https://sync.oraki.io';
8
+
9
+ export const spec = {
10
+ code: BIDDER_CODE,
11
+ supportedMediaTypes: [BANNER, VIDEO, NATIVE],
12
+
13
+ isBidRequestValid: isBidRequestValid(),
14
+ buildRequests: buildRequests(AD_URL),
15
+ interpretResponse,
16
+ getUserSyncs: getUserSyncs(SYNC_URL)
17
+ };
18
+
19
+ registerBidder(spec);
@@ -0,0 +1,79 @@
1
+ # Overview
2
+
3
+ ```
4
+ Module Name: Oraki Bidder Adapter
5
+ Module Type: Oraki Bidder Adapter
6
+ Maintainer: ben@oraki.io
7
+ ```
8
+
9
+ # Description
10
+
11
+ Connects to Oraki exchange for bids.
12
+ Oraki bid adapter supports Banner, Video (instream and outstream) and Native.
13
+
14
+ # Test Parameters
15
+ ```
16
+ var adUnits = [
17
+ // Will return static test banner
18
+ {
19
+ code: 'adunit1',
20
+ mediaTypes: {
21
+ banner: {
22
+ sizes: [ [300, 250], [320, 50] ],
23
+ }
24
+ },
25
+ bids: [
26
+ {
27
+ bidder: 'oraki',
28
+ params: {
29
+ placementId: 'testBanner',
30
+ }
31
+ }
32
+ ]
33
+ },
34
+ {
35
+ code: 'addunit2',
36
+ mediaTypes: {
37
+ video: {
38
+ playerSize: [ [640, 480] ],
39
+ context: 'instream',
40
+ minduration: 5,
41
+ maxduration: 60,
42
+ }
43
+ },
44
+ bids: [
45
+ {
46
+ bidder: 'oraki',
47
+ params: {
48
+ placementId: 'testVideo',
49
+ }
50
+ }
51
+ ]
52
+ },
53
+ {
54
+ code: 'addunit3',
55
+ mediaTypes: {
56
+ native: {
57
+ title: {
58
+ required: true
59
+ },
60
+ body: {
61
+ required: true
62
+ },
63
+ icon: {
64
+ required: true,
65
+ size: [64, 64]
66
+ }
67
+ }
68
+ },
69
+ bids: [
70
+ {
71
+ bidder: 'oraki',
72
+ params: {
73
+ placementId: 'testNative',
74
+ }
75
+ }
76
+ ]
77
+ }
78
+ ];
79
+ ```
@@ -3,7 +3,6 @@ import { registerBidder } from '../src/adapters/bidderFactory.js';
3
3
  import { getStorageManager } from '../src/storageManager.js';
4
4
  import { BANNER, NATIVE } from '../src/mediaTypes.js';
5
5
  import { convertOrtbRequestToProprietaryNative } from '../src/native.js';
6
- import { getGlobal } from '../src/prebidGlobal.js';
7
6
 
8
7
  /**
9
8
  * @typedef {import('../src/adapters/bidderFactory.js').BidRequest} BidRequest
@@ -93,6 +92,9 @@ export const spec = {
93
92
  if (bidderRequest && bidderRequest.refererInfo) {
94
93
  referer = bidderRequest.refererInfo.page || '';
95
94
  }
95
+ if (bidRequest?.mediaTypes?.video) {
96
+ delete bidRequest.mediaTypes.video;
97
+ }
96
98
 
97
99
  bidRequest.params.bidfloor = getBidFloor(bidRequest);
98
100
 
@@ -101,7 +103,7 @@ export const spec = {
101
103
  method: 'POST',
102
104
  options: { withCredentials: true },
103
105
  data: {
104
- v: getGlobal().version,
106
+ v: 'v' + '$prebid.version$',
105
107
  pageUrl: referer,
106
108
  ...bidRequest // get all data provided by bid request
107
109
  }
@@ -5,7 +5,7 @@ import {registerBidder} from '../src/adapters/bidderFactory.js';
5
5
  import {BANNER, NATIVE, VIDEO} from '../src/mediaTypes.js';
6
6
  import { getStorageManager } from '../src/storageManager.js';
7
7
  import {OUTSTREAM} from '../src/video.js';
8
- import {_map, deepAccess, deepSetValue, isArray, logWarn, replaceAuctionPrice} from '../src/utils.js';
8
+ import {_map, deepAccess, deepSetValue, logWarn, replaceAuctionPrice, setOnAny, parseGPTSingleSizeArrayToRtbSize} from '../src/utils.js';
9
9
  import {ajax} from '../src/ajax.js';
10
10
  import {config} from '../src/config.js';
11
11
  import {convertOrtbRequestToProprietaryNative} from '../src/native.js';
@@ -94,7 +94,7 @@ export const spec = {
94
94
  imp.video = getVideoAsset(bid);
95
95
  } else {
96
96
  imp.banner = {
97
- format: transformSizes(bid.sizes)
97
+ format: bid.sizes?.map((size) => parseGPTSingleSizeArrayToRtbSize(size))
98
98
  }
99
99
  }
100
100
 
@@ -111,7 +111,7 @@ export const spec = {
111
111
  const request = {
112
112
  id: bidderRequest.bidderRequestId,
113
113
  site: { page, publisher },
114
- device: { ua },
114
+ device: ortb2?.device || { ua },
115
115
  source: { fd: 1 },
116
116
  cur: [cur],
117
117
  tmax: timeout,
@@ -174,7 +174,7 @@ export const spec = {
174
174
  }
175
175
  const { seatbid, cur } = serverResponse.body;
176
176
 
177
- const bidResponses = flatten(seatbid.map(seat => seat.bid)).reduce((result, bid) => {
177
+ const bidResponses = seatbid.map(seat => seat.bid).flat().reduce((result, bid) => {
178
178
  result[bid.impid - 1] = bid;
179
179
  return result;
180
180
  }, []);
@@ -288,19 +288,6 @@ function parseNative(bid) {
288
288
  return result;
289
289
  }
290
290
 
291
- function setOnAny(collection, key) {
292
- for (let i = 0, result; i < collection.length; i++) {
293
- result = deepAccess(collection[i], key);
294
- if (result) {
295
- return result;
296
- }
297
- }
298
- }
299
-
300
- function flatten(arr) {
301
- return [].concat(...arr);
302
- }
303
-
304
291
  function getNativeAssets(bid) {
305
292
  return _map(bid.nativeParams, (bidParams, key) => {
306
293
  const props = NATIVE_PARAMS[key];
@@ -319,7 +306,7 @@ function getNativeAssets(bid) {
319
306
  }
320
307
 
321
308
  if (bidParams.sizes) {
322
- const sizes = flatten(bidParams.sizes);
309
+ const sizes = bidParams.sizes.flat();
323
310
  w = parseInt(sizes[0], 10);
324
311
  h = parseInt(sizes[1], 10);
325
312
  }
@@ -339,7 +326,7 @@ function getNativeAssets(bid) {
339
326
  }
340
327
 
341
328
  function getVideoAsset(bid) {
342
- const sizes = flatten(bid.mediaTypes.video.playerSize);
329
+ const sizes = bid.mediaTypes.video.playerSize.flat();
343
330
  return {
344
331
  w: parseInt(sizes[0], 10),
345
332
  h: parseInt(sizes[1], 10),
@@ -354,34 +341,12 @@ function getVideoAsset(bid) {
354
341
  minduration: bid.mediaTypes.video.minduration,
355
342
  maxduration: bid.mediaTypes.video.maxduration,
356
343
  startdelay: bid.mediaTypes.video.startdelay,
357
- placement: bid.mediaTypes.video.plcmt ?? bid.mediaTypes.video.placement,
344
+ placement: bid.mediaTypes.video.placement,
345
+ plcmt: bid.mediaTypes.video.plcmt,
358
346
  linearity: bid.mediaTypes.video.linearity
359
347
  };
360
348
  }
361
349
 
362
- /* Turn bid request sizes into ut-compatible format */
363
- function transformSizes(requestSizes) {
364
- if (!isArray(requestSizes)) {
365
- return [];
366
- }
367
-
368
- if (requestSizes.length === 2 && !isArray(requestSizes[0])) {
369
- return [{
370
- w: parseInt(requestSizes[0], 10),
371
- h: parseInt(requestSizes[1], 10)
372
- }];
373
- } else if (isArray(requestSizes[0])) {
374
- return requestSizes.map(item =>
375
- ({
376
- w: parseInt(item[0], 10),
377
- h: parseInt(item[1], 10)
378
- })
379
- );
380
- }
381
-
382
- return [];
383
- }
384
-
385
350
  function _getFloor(bid, type) {
386
351
  const floorInfo = bid.getFloor({
387
352
  currency: CURRENCY,