prebid.js 9.5.0 → 9.6.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.
- package/dist/33acrossAnalyticsAdapter.js +1 -1
- package/dist/33acrossBidAdapter.js +1 -1
- package/dist/33acrossIdSystem.js +1 -1
- package/dist/BTBidAdapter.js +1 -1
- package/dist/adagioAnalyticsAdapter.js +1 -1
- package/dist/adagioBidAdapter.js +1 -1
- package/dist/adagioUtils.js +1 -1
- package/dist/addefendBidAdapter.js +1 -1
- package/dist/adgenerationBidAdapter.js +1 -1
- package/dist/adkernelBidAdapter.js +1 -1
- package/dist/adlooxRtdProvider.js +1 -1
- package/dist/adqueryBidAdapter.js +1 -1
- package/dist/adrelevantisBidAdapter.js +1 -1
- package/dist/adstirBidAdapter.js +1 -1
- package/dist/adtrgtmeBidAdapter.js +1 -1
- package/dist/adxcgAnalyticsAdapter.js +1 -1
- package/dist/adxcgBidAdapter.js +1 -1
- package/dist/adyoulikeBidAdapter.js +1 -1
- package/dist/agmaAnalyticsAdapter.js +1 -1
- package/dist/aidemBidAdapter.js +1 -1
- package/dist/ajaBidAdapter.js +1 -1
- package/dist/amxBidAdapter.js +1 -1
- package/dist/amxIdSystem.js +1 -1
- package/dist/appierAnalyticsAdapter.js +1 -1
- package/dist/appnexusBidAdapter.js +1 -1
- package/dist/asoBidAdapter.js +1 -1
- package/dist/axonixBidAdapter.js +1 -1
- package/dist/bidglassBidAdapter.js +1 -1
- package/dist/big-richmediaBidAdapter.js +1 -1
- package/dist/bridBidAdapter.js +1 -1
- package/dist/bridgewellBidAdapter.js +1 -1
- package/dist/brightMountainMediaBidAdapter.js +1 -1
- package/dist/carodaBidAdapter.js +1 -1
- package/dist/chtnwBidAdapter.js +1 -1
- package/dist/chunk-core.js +1 -1
- package/dist/concertBidAdapter.js +1 -1
- package/dist/connectIdSystem.js +1 -1
- package/dist/connectadBidAdapter.js +1 -1
- package/dist/consumableBidAdapter.js +1 -1
- package/dist/conversantAnalyticsAdapter.js +1 -1
- package/dist/conversantBidAdapter.js +1 -1
- package/dist/craftBidAdapter.js +1 -1
- package/dist/criteoBidAdapter.js +1 -1
- package/dist/cwireBidAdapter.js +1 -1
- package/dist/dailymotionBidAdapter.js +1 -1
- package/dist/dependencies.json +26 -1
- package/dist/dspxBidAdapter.js +1 -1
- package/dist/dxkultureBidAdapter.js +1 -1
- package/dist/eplanningBidAdapter.js +1 -1
- package/dist/euidIdSystem.js +1 -1
- package/dist/exadsBidAdapter.js +1 -1
- package/dist/feedadBidAdapter.js +1 -1
- package/dist/finativeBidAdapter.js +1 -1
- package/dist/freewheel-sspBidAdapter.js +1 -1
- package/dist/gmosspBidAdapter.js +1 -1
- package/dist/goldbachBidAdapter.js +1 -1
- package/dist/greenbidsAnalyticsAdapter.js +1 -1
- package/dist/greenbidsRtdProvider.js +1 -1
- package/dist/gridBidAdapter.js +1 -1
- package/dist/gumgumBidAdapter.js +1 -1
- package/dist/h12mediaBidAdapter.js +1 -1
- package/dist/hypelabBidAdapter.js +1 -1
- package/dist/id5AnalyticsAdapter.js +1 -1
- package/dist/id5IdSystem.js +1 -1
- package/dist/imdsBidAdapter.js +1 -1
- package/dist/improvedigitalBidAdapter.js +1 -1
- package/dist/insticatorBidAdapter.js +1 -1
- package/dist/intentIqAnalyticsAdapter.js +1 -1
- package/dist/ixBidAdapter.js +1 -1
- package/dist/jixieBidAdapter.js +1 -1
- package/dist/justpremiumBidAdapter.js +1 -1
- package/dist/kargoBidAdapter.js +1 -1
- package/dist/kimberliteBidAdapter.js +1 -1
- package/dist/konduitAnalyticsAdapter.js +1 -1
- package/dist/kueezBidAdapter.js +1 -1
- package/dist/lassoBidAdapter.js +1 -1
- package/dist/lifestreetBidAdapter.js +1 -1
- package/dist/liveIntentIdSystem.js +1 -1
- package/dist/logicadBidAdapter.js +1 -1
- package/dist/loglyliftBidAdapter.js +1 -1
- package/dist/luceadBidAdapter.js +1 -1
- package/dist/mabidderBidAdapter.js +1 -1
- package/dist/magniteAnalyticsAdapter.js +1 -1
- package/dist/malltvAnalyticsAdapter.js +1 -1
- package/dist/marsmediaBidAdapter.js +1 -1
- package/dist/mediafuseBidAdapter.js +1 -1
- package/dist/medianetAnalyticsAdapter.js +1 -1
- package/dist/medianetBidAdapter.js +1 -1
- package/dist/mediasquareBidAdapter.js +1 -1
- package/dist/mgidBidAdapter.js +1 -1
- package/dist/minutemediaBidAdapter.js +1 -1
- package/dist/missenaBidAdapter.js +1 -1
- package/dist/nexx360BidAdapter.js +1 -1
- package/dist/nobidAnalyticsAdapter.js +1 -1
- package/dist/nobidBidAdapter.js +1 -1
- package/dist/not-for-prod/prebid.js +163 -162
- package/dist/oguryBidAdapter.js +1 -1
- package/dist/onetagBidAdapter.js +1 -1
- package/dist/ooloAnalyticsAdapter.js +1 -1
- package/dist/openwebBidAdapter.js +1 -1
- package/dist/openxBidAdapter.js +1 -1
- package/dist/optidigitalBidAdapter.js +1 -1
- package/dist/orbidderBidAdapter.js +1 -1
- package/dist/outbrainBidAdapter.js +1 -1
- package/dist/pixfutureBidAdapter.js +1 -1
- package/dist/publinkIdSystem.js +1 -1
- package/dist/publirBidAdapter.js +1 -1
- package/dist/pubmaticAnalyticsAdapter.js +1 -1
- package/dist/pubmaticBidAdapter.js +1 -1
- package/dist/pubwiseAnalyticsAdapter.js +1 -1
- package/dist/pubxaiAnalyticsAdapter.js +1 -1
- package/dist/pxyzBidAdapter.js +1 -1
- package/dist/quantcastBidAdapter.js +1 -1
- package/dist/readpeakBidAdapter.js +1 -1
- package/dist/relaidoBidAdapter.js +1 -1
- package/dist/retailspotBidAdapter.js +1 -1
- package/dist/rhythmoneBidAdapter.js +1 -1
- package/dist/riseBidAdapter.js +1 -1
- package/dist/riseUtils.js +1 -0
- package/dist/rubiconBidAdapter.js +1 -1
- package/dist/seedingAllianceBidAdapter.js +1 -1
- package/dist/seedtagBidAdapter.js +1 -1
- package/dist/sharethroughAnalyticsAdapter.js +1 -1
- package/dist/sharethroughBidAdapter.js +1 -1
- package/dist/shinezBidAdapter.js +1 -1
- package/dist/smaatoBidAdapter.js +1 -1
- package/dist/smartadserverBidAdapter.js +1 -1
- package/dist/smarthubBidAdapter.js +1 -1
- package/dist/smartxBidAdapter.js +1 -1
- package/dist/smilewantedBidAdapter.js +1 -1
- package/dist/snigelBidAdapter.js +1 -1
- package/dist/sonobiBidAdapter.js +1 -1
- package/dist/sovrnBidAdapter.js +1 -1
- package/dist/sspBCBidAdapter.js +1 -1
- package/dist/stnBidAdapter.js +1 -1
- package/dist/stvBidAdapter.js +1 -1
- package/dist/sublimeBidAdapter.js +1 -1
- package/dist/taboolaBidAdapter.js +1 -1
- package/dist/tappxBidAdapter.js +1 -1
- package/dist/targetVideoBidAdapter.js +1 -1
- package/dist/teadsBidAdapter.js +1 -1
- package/dist/telariaBidAdapter.js +1 -1
- package/dist/teqblazeUtils.js +1 -1
- package/dist/terceptAnalyticsAdapter.js +1 -1
- package/dist/themoneytizerBidAdapter.js +1 -1
- package/dist/trionBidAdapter.js +1 -1
- package/dist/tripleliftBidAdapter.js +1 -1
- package/dist/ttdBidAdapter.js +1 -1
- package/dist/ucfunnelAnalyticsAdapter.js +1 -1
- package/dist/uid2IdSystem.js +1 -1
- package/dist/uid2IdSystem_shared.js +1 -1
- package/dist/underdogmediaBidAdapter.js +1 -1
- package/dist/undertoneBidAdapter.js +1 -1
- package/dist/unrulyBidAdapter.js +1 -1
- package/dist/vidazooUtils.js +1 -1
- package/dist/videobyteBidAdapter.js +1 -1
- package/dist/visxBidAdapter.js +1 -1
- package/dist/vuukleBidAdapter.js +1 -1
- package/dist/widespaceBidAdapter.js +1 -1
- package/dist/winrBidAdapter.js +1 -1
- package/dist/yahooAdsBidAdapter.js +1 -1
- package/dist/yieldmoBidAdapter.js +1 -1
- package/dist/yieldoneAnalyticsAdapter.js +1 -1
- package/libraries/riseUtils/index.js +330 -0
- package/libraries/teqblazeUtils/bidderUtils.js +15 -11
- package/modules/adagioAnalyticsAdapter.js +101 -84
- package/modules/adagioAnalyticsAdapter.md +4 -0
- package/modules/adagioBidAdapter.js +4 -16
- package/modules/adkernelBidAdapter.js +2 -2
- package/modules/aidemBidAdapter.js +2 -0
- package/modules/connectIdSystem.js +5 -3
- package/modules/insticatorBidAdapter.js +35 -31
- package/modules/kargoBidAdapter.js +11 -14
- package/modules/kimberliteBidAdapter.js +24 -7
- package/modules/kimberliteBidAdapter.md +30 -1
- package/modules/minutemediaBidAdapter.js +21 -398
- package/modules/nexx360BidAdapter.js +3 -2
- package/modules/openwebBidAdapter.js +18 -396
- package/modules/publirBidAdapter.js +20 -273
- package/modules/resetdigitalBidAdapter.md +54 -45
- package/modules/riseBidAdapter.js +19 -400
- package/modules/shinezBidAdapter.js +17 -361
- package/modules/smarthubBidAdapter.js +45 -177
- package/modules/stnBidAdapter.js +22 -398
- package/modules/telariaBidAdapter.js +2 -32
- package/modules/uid2IdSystem_shared.js +51 -39
- package/package.json +1 -1
- package/src/prebid.js +4 -0
- package/test/spec/modules/adagioAnalyticsAdapter_spec.js +231 -141
- package/test/spec/modules/adagioBidAdapter_spec.js +32 -66
- package/test/spec/modules/connectIdSystem_spec.js +27 -28
- package/test/spec/modules/insticatorBidAdapter_spec.js +8 -1
- package/test/spec/modules/kargoBidAdapter_spec.js +7 -8
- package/test/spec/modules/kimberliteBidAdapter_spec.js +137 -65
- package/test/spec/modules/nexx360BidAdapter_spec.js +1 -1
- package/test/spec/modules/smarthubBidAdapter_spec.js +6 -4
- package/test/spec/unit/pbjs_api_spec.js +11 -0
|
@@ -7,12 +7,22 @@ function isValidIdentity(identity) {
|
|
|
7
7
|
return !!(typeof identity === 'object' && identity !== null && identity.advertising_token && identity.identity_expires && identity.refresh_from && identity.refresh_token && identity.refresh_expires);
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
+
// Helper function to prepend message
|
|
11
|
+
function prependMessage(message) {
|
|
12
|
+
return `UID2 shared library - ${message}`;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// Wrapper function for logInfo
|
|
16
|
+
function logInfoWrapper(logInfo, ...args) {
|
|
17
|
+
logInfo(prependMessage(args[0]), ...args.slice(1));
|
|
18
|
+
}
|
|
19
|
+
|
|
10
20
|
// This is extracted from an in-progress API client. Once it's available via NPM, this class should be replaced with the NPM package.
|
|
11
21
|
export class Uid2ApiClient {
|
|
12
22
|
constructor(opts, clientId, logInfo, logWarn) {
|
|
13
23
|
this._baseUrl = opts.baseUrl;
|
|
14
24
|
this._clientVersion = clientId;
|
|
15
|
-
this._logInfo = logInfo;
|
|
25
|
+
this._logInfo = (...args) => logInfoWrapper(logInfo, ...args);
|
|
16
26
|
this._logWarn = logWarn;
|
|
17
27
|
}
|
|
18
28
|
|
|
@@ -35,7 +45,7 @@ export class Uid2ApiClient {
|
|
|
35
45
|
if (this.isValidRefreshResponse(response)) {
|
|
36
46
|
if (response.status === 'success') { return { status: response.status, identity: response.body }; }
|
|
37
47
|
return response;
|
|
38
|
-
} else { return `Response didn't contain a valid status
|
|
48
|
+
} else { return prependMessage(`Response didn't contain a valid status`); }
|
|
39
49
|
}
|
|
40
50
|
callRefreshApi(refreshDetails) {
|
|
41
51
|
const url = this._baseUrl + '/v2/token/refresh';
|
|
@@ -53,7 +63,7 @@ export class Uid2ApiClient {
|
|
|
53
63
|
this._logInfo('No response decryption key available, assuming unencrypted JSON');
|
|
54
64
|
const response = JSON.parse(responseText);
|
|
55
65
|
const result = this.ResponseToRefreshResult(response);
|
|
56
|
-
if (typeof result === 'string') { rejectPromise(result); } else { resolvePromise(result); }
|
|
66
|
+
if (typeof result === 'string') { rejectPromise(prependMessage(result)); } else { resolvePromise(result); }
|
|
57
67
|
} else {
|
|
58
68
|
this._logInfo('Decrypting refresh API response');
|
|
59
69
|
const encodeResp = this.createArrayBuffer(atob(responseText));
|
|
@@ -69,12 +79,12 @@ export class Uid2ApiClient {
|
|
|
69
79
|
this._logInfo('Decrypted to:', decryptedResponse);
|
|
70
80
|
const response = JSON.parse(decryptedResponse);
|
|
71
81
|
const result = this.ResponseToRefreshResult(response);
|
|
72
|
-
if (typeof result === 'string') { rejectPromise(result); } else { resolvePromise(result); }
|
|
73
|
-
}, (reason) => this._logWarn(`Call to UID2 API failed
|
|
74
|
-
}, (reason) => this._logWarn(`Call to UID2 API failed
|
|
82
|
+
if (typeof result === 'string') { rejectPromise(prependMessage(result)); } else { resolvePromise(result); }
|
|
83
|
+
}, (reason) => this._logWarn(prependMessage(`Call to UID2 API failed`), reason));
|
|
84
|
+
}, (reason) => this._logWarn(prependMessage(`Call to UID2 API failed`), reason));
|
|
75
85
|
}
|
|
76
86
|
} catch (_err) {
|
|
77
|
-
rejectPromise(responseText);
|
|
87
|
+
rejectPromise(prependMessage(responseText));
|
|
78
88
|
}
|
|
79
89
|
},
|
|
80
90
|
error: (error, xhr) => {
|
|
@@ -82,9 +92,9 @@ export class Uid2ApiClient {
|
|
|
82
92
|
this._logInfo('Error status, assuming unencrypted JSON');
|
|
83
93
|
const response = JSON.parse(xhr.responseText);
|
|
84
94
|
const result = this.ResponseToRefreshResult(response);
|
|
85
|
-
if (typeof result === 'string') { rejectPromise(result); } else { resolvePromise(result); }
|
|
95
|
+
if (typeof result === 'string') { rejectPromise(prependMessage(result)); } else { resolvePromise(result); }
|
|
86
96
|
} catch (_e) {
|
|
87
|
-
rejectPromise(error)
|
|
97
|
+
rejectPromise(prependMessage(error));
|
|
88
98
|
}
|
|
89
99
|
}
|
|
90
100
|
}, refreshDetails.refresh_token, { method: 'POST',
|
|
@@ -99,7 +109,7 @@ export class Uid2StorageManager {
|
|
|
99
109
|
this._storage = storage;
|
|
100
110
|
this._preferLocalStorage = preferLocalStorage;
|
|
101
111
|
this._storageName = storageName;
|
|
102
|
-
this._logInfo = logInfo;
|
|
112
|
+
this._logInfo = (...args) => logInfoWrapper(logInfo, ...args);
|
|
103
113
|
}
|
|
104
114
|
readCookie(cookieName) {
|
|
105
115
|
return this._storage.cookiesAreEnabled() ? this._storage.getCookie(cookieName) : null;
|
|
@@ -392,7 +402,7 @@ if (FEATURES.UID2_CSTG) {
|
|
|
392
402
|
this._baseUrl = opts.baseUrl;
|
|
393
403
|
this._serverPublicKey = opts.cstg.serverPublicKey;
|
|
394
404
|
this._subscriptionId = opts.cstg.subscriptionId;
|
|
395
|
-
this._logInfo = logInfo;
|
|
405
|
+
this._logInfo = (...args) => logInfoWrapper(logInfo, ...args);
|
|
396
406
|
this._logWarn = logWarn;
|
|
397
407
|
}
|
|
398
408
|
|
|
@@ -512,11 +522,11 @@ if (FEATURES.UID2_CSTG) {
|
|
|
512
522
|
// A 200 should always be a success response.
|
|
513
523
|
// Something has gone wrong.
|
|
514
524
|
rejectPromise(
|
|
515
|
-
`API error: Response body was invalid for HTTP status 200: ${decryptedResponse}`
|
|
525
|
+
prependMessage(`API error: Response body was invalid for HTTP status 200: ${decryptedResponse}`)
|
|
516
526
|
);
|
|
517
527
|
}
|
|
518
528
|
} catch (err) {
|
|
519
|
-
rejectPromise(err);
|
|
529
|
+
rejectPromise(prependMessage(err));
|
|
520
530
|
}
|
|
521
531
|
},
|
|
522
532
|
error: (error, xhr) => {
|
|
@@ -524,32 +534,32 @@ if (FEATURES.UID2_CSTG) {
|
|
|
524
534
|
if (xhr.status === 400) {
|
|
525
535
|
const response = JSON.parse(xhr.responseText);
|
|
526
536
|
if (this.isCstgApiClientErrorResponse(response)) {
|
|
527
|
-
rejectPromise(`Client error: ${response.message}`);
|
|
537
|
+
rejectPromise(prependMessage(`Client error: ${response.message}`));
|
|
528
538
|
} else {
|
|
529
539
|
// A 400 should always be a client error.
|
|
530
540
|
// Something has gone wrong.
|
|
531
541
|
rejectPromise(
|
|
532
|
-
`API error: Response body was invalid for HTTP status 400: ${xhr.responseText}`
|
|
542
|
+
prependMessage(`UID2 API error: Response body was invalid for HTTP status 400: ${xhr.responseText}`)
|
|
533
543
|
);
|
|
534
544
|
}
|
|
535
545
|
} else if (xhr.status === 403) {
|
|
536
546
|
const response = JSON.parse(xhr.responseText);
|
|
537
547
|
if (this.isCstgApiForbiddenResponse(xhr)) {
|
|
538
|
-
rejectPromise(`Forbidden: ${response.message}`);
|
|
548
|
+
rejectPromise(prependMessage(`Forbidden: ${response.message}`));
|
|
539
549
|
} else {
|
|
540
550
|
// A 403 should always be a forbidden response.
|
|
541
551
|
// Something has gone wrong.
|
|
542
552
|
rejectPromise(
|
|
543
|
-
`API error: Response body was invalid for HTTP status 403: ${xhr.responseText}`
|
|
553
|
+
prependMessage(`UID2 API error: Response body was invalid for HTTP status 403: ${xhr.responseText}`)
|
|
544
554
|
);
|
|
545
555
|
}
|
|
546
556
|
} else {
|
|
547
557
|
rejectPromise(
|
|
548
|
-
`API error: Unexpected HTTP status ${xhr.status}: ${error}`
|
|
558
|
+
prependMessage(`UID2 API error: Unexpected HTTP status ${xhr.status}: ${error}`)
|
|
549
559
|
);
|
|
550
560
|
}
|
|
551
561
|
} catch (_e) {
|
|
552
|
-
rejectPromise(error);
|
|
562
|
+
rejectPromise(prependMessage(error));
|
|
553
563
|
}
|
|
554
564
|
},
|
|
555
565
|
},
|
|
@@ -678,43 +688,45 @@ if (FEATURES.UID2_CSTG) {
|
|
|
678
688
|
}
|
|
679
689
|
|
|
680
690
|
export function Uid2GetId(config, prebidStorageManager, _logInfo, _logWarn) {
|
|
691
|
+
const logInfo = (...args) => logInfoWrapper(_logInfo, ...args);
|
|
692
|
+
|
|
681
693
|
let suppliedToken = null;
|
|
682
694
|
const preferLocalStorage = (config.storage !== 'cookie');
|
|
683
|
-
const storageManager = new Uid2StorageManager(prebidStorageManager, preferLocalStorage, config.internalStorage,
|
|
684
|
-
|
|
695
|
+
const storageManager = new Uid2StorageManager(prebidStorageManager, preferLocalStorage, config.internalStorage, logInfo);
|
|
696
|
+
logInfo(`Module is using ${preferLocalStorage ? 'local storage' : 'cookies'} for internal storage.`);
|
|
685
697
|
|
|
686
698
|
const isCstgEnabled =
|
|
687
699
|
clientSideTokenGenerator &&
|
|
688
700
|
clientSideTokenGenerator.isCSTGOptionsValid(config.cstg, _logWarn);
|
|
689
701
|
if (isCstgEnabled) {
|
|
690
|
-
|
|
702
|
+
logInfo(`Module is using client-side token generation.`);
|
|
691
703
|
// Ignores config.paramToken and config.serverCookieName if any is provided
|
|
692
704
|
suppliedToken = null;
|
|
693
705
|
} else if (config.paramToken) {
|
|
694
706
|
suppliedToken = config.paramToken;
|
|
695
|
-
|
|
707
|
+
logInfo('Read token from params', suppliedToken);
|
|
696
708
|
} else if (config.serverCookieName) {
|
|
697
709
|
suppliedToken = storageManager.readProvidedCookie(config.serverCookieName);
|
|
698
|
-
|
|
710
|
+
logInfo('Read token from server-supplied cookie', suppliedToken);
|
|
699
711
|
}
|
|
700
712
|
let storedTokens = storageManager.getStoredValueWithFallback();
|
|
701
|
-
|
|
713
|
+
logInfo('Loaded module-stored tokens:', storedTokens);
|
|
702
714
|
|
|
703
715
|
if (storedTokens && typeof storedTokens === 'string') {
|
|
704
716
|
// Stored value is a plain token - if no token is supplied, just use the stored value.
|
|
705
717
|
|
|
706
718
|
if (!suppliedToken && !isCstgEnabled) {
|
|
707
|
-
|
|
719
|
+
logInfo('Returning legacy cookie value.');
|
|
708
720
|
return { id: storedTokens };
|
|
709
721
|
}
|
|
710
722
|
// Otherwise, ignore the legacy value - it should get over-written later anyway.
|
|
711
|
-
|
|
723
|
+
logInfo('Discarding superseded legacy cookie.');
|
|
712
724
|
storedTokens = null;
|
|
713
725
|
}
|
|
714
726
|
|
|
715
727
|
if (suppliedToken && storedTokens) {
|
|
716
728
|
if (storedTokens.originalToken?.advertising_token !== suppliedToken.advertising_token) {
|
|
717
|
-
|
|
729
|
+
logInfo('Server supplied new token - ignoring stored value.', storedTokens.originalToken?.advertising_token, suppliedToken.advertising_token);
|
|
718
730
|
// Stored token wasn't originally sourced from the provided token - ignore the stored value. A new user has logged in?
|
|
719
731
|
storedTokens = null;
|
|
720
732
|
}
|
|
@@ -723,16 +735,16 @@ export function Uid2GetId(config, prebidStorageManager, _logInfo, _logWarn) {
|
|
|
723
735
|
if (FEATURES.UID2_CSTG && isCstgEnabled) {
|
|
724
736
|
const cstgIdentity = clientSideTokenGenerator.getValidIdentity(config.cstg, _logWarn);
|
|
725
737
|
if (cstgIdentity) {
|
|
726
|
-
if (storedTokens && clientSideTokenGenerator.isStoredTokenInvalid(cstgIdentity, storedTokens,
|
|
738
|
+
if (storedTokens && clientSideTokenGenerator.isStoredTokenInvalid(cstgIdentity, storedTokens, logInfo, _logWarn)) {
|
|
727
739
|
storedTokens = null;
|
|
728
740
|
}
|
|
729
741
|
|
|
730
742
|
if (!storedTokens || Date.now() > storedTokens.latestToken.refresh_expires) {
|
|
731
|
-
const promise = clientSideTokenGenerator.generateTokenAndStore(config.apiBaseUrl, config.cstg, cstgIdentity, storageManager,
|
|
732
|
-
|
|
743
|
+
const promise = clientSideTokenGenerator.generateTokenAndStore(config.apiBaseUrl, config.cstg, cstgIdentity, storageManager, logInfo, _logWarn);
|
|
744
|
+
logInfo('Generate token using CSTG');
|
|
733
745
|
return { callback: (cb) => {
|
|
734
746
|
promise.then((result) => {
|
|
735
|
-
|
|
747
|
+
logInfo('Token generation responded, passing the new token on.', result);
|
|
736
748
|
cb(result);
|
|
737
749
|
});
|
|
738
750
|
} };
|
|
@@ -742,25 +754,25 @@ export function Uid2GetId(config, prebidStorageManager, _logInfo, _logWarn) {
|
|
|
742
754
|
|
|
743
755
|
const useSuppliedToken = !(storedTokens?.latestToken) || (suppliedToken && suppliedToken.identity_expires > storedTokens.latestToken.identity_expires);
|
|
744
756
|
const newestAvailableToken = useSuppliedToken ? suppliedToken : storedTokens.latestToken;
|
|
745
|
-
|
|
757
|
+
logInfo('UID2 module selected latest token', useSuppliedToken, newestAvailableToken);
|
|
746
758
|
if ((!newestAvailableToken || Date.now() > newestAvailableToken.refresh_expires)) {
|
|
747
|
-
|
|
759
|
+
logInfo('Newest available token is expired and not refreshable.');
|
|
748
760
|
return { id: null };
|
|
749
761
|
}
|
|
750
762
|
if (Date.now() > newestAvailableToken.identity_expires) {
|
|
751
|
-
const promise = refreshTokenAndStore(config.apiBaseUrl, newestAvailableToken, config.clientId, storageManager,
|
|
752
|
-
|
|
763
|
+
const promise = refreshTokenAndStore(config.apiBaseUrl, newestAvailableToken, config.clientId, storageManager, logInfo, _logWarn);
|
|
764
|
+
logInfo('Token is expired but can be refreshed, attempting refresh.');
|
|
753
765
|
return { callback: (cb) => {
|
|
754
766
|
promise.then((result) => {
|
|
755
|
-
|
|
767
|
+
logInfo('Refresh reponded, passing the updated token on.', result);
|
|
756
768
|
cb(result);
|
|
757
769
|
});
|
|
758
770
|
} };
|
|
759
771
|
}
|
|
760
772
|
// If should refresh (but don't need to), refresh in the background.
|
|
761
773
|
if (Date.now() > newestAvailableToken.refresh_from) {
|
|
762
|
-
|
|
763
|
-
refreshTokenAndStore(config.apiBaseUrl, newestAvailableToken, config.clientId, storageManager,
|
|
774
|
+
logInfo(`Refreshing token in background with low priority.`);
|
|
775
|
+
refreshTokenAndStore(config.apiBaseUrl, newestAvailableToken, config.clientId, storageManager, logInfo, _logWarn);
|
|
764
776
|
}
|
|
765
777
|
const tokens = {
|
|
766
778
|
originalToken: suppliedToken ?? storedTokens?.originalToken,
|
package/package.json
CHANGED
package/src/prebid.js
CHANGED
|
@@ -869,6 +869,10 @@ pbjsInstance.getHighestCpmBids = function (adUnitCode) {
|
|
|
869
869
|
return targeting.getWinningBids(adUnitCode);
|
|
870
870
|
};
|
|
871
871
|
|
|
872
|
+
pbjsInstance.clearAllAuctions = function () {
|
|
873
|
+
auctionManager.clearAllAuctions();
|
|
874
|
+
};
|
|
875
|
+
|
|
872
876
|
if (FEATURES.VIDEO) {
|
|
873
877
|
/**
|
|
874
878
|
* Mark the winning bid as used, should only be used in conjunction with video
|