@datadog/browser-core
Advanced tools
Comparing version 1.11.1 to 1.11.2
@@ -10,3 +10,3 @@ import { CookieCache } from './cookie'; | ||
getId(): string | undefined; | ||
getType(): T | undefined; | ||
getTrackingType(): T | undefined; | ||
} | ||
@@ -22,6 +22,6 @@ export interface SessionState { | ||
*/ | ||
export declare function startSessionManagement<Type extends string>(sessionTypeKey: string, computeSessionState: (rawType?: string) => { | ||
type: Type; | ||
export declare function startSessionManagement<TrackingType extends string>(productKey: string, computeSessionState: (rawTrackingType?: string) => { | ||
trackingType: TrackingType; | ||
isTracked: boolean; | ||
}): Session<Type>; | ||
}): Session<TrackingType>; | ||
export declare function isValidSessionString(sessionString: string | undefined): sessionString is string; | ||
@@ -28,0 +28,0 @@ export declare function persistSession(session: SessionState, cookie: CookieCache): void; |
@@ -16,3 +16,3 @@ "use strict"; | ||
*/ | ||
function startSessionManagement(sessionTypeKey, computeSessionState) { | ||
function startSessionManagement(productKey, computeSessionState) { | ||
var sessionCookie = cookie_1.cacheCookieAccess(exports.SESSION_COOKIE_NAME); | ||
@@ -24,4 +24,4 @@ oldCookiesMigration_1.tryOldCookiesMigration(sessionCookie); | ||
var session = retrieveActiveSession(sessionCookie); | ||
var _a = computeSessionState(session[sessionTypeKey]), type = _a.type, isTracked = _a.isTracked; | ||
session[sessionTypeKey] = type; | ||
var _a = computeSessionState(session[productKey]), trackingType = _a.trackingType, isTracked = _a.isTracked; | ||
session[productKey] = trackingType; | ||
if (isTracked && !session.id) { | ||
@@ -50,4 +50,4 @@ session.id = utils.generateUUID(); | ||
}, | ||
getType: function () { | ||
return retrieveActiveSession(sessionCookie)[sessionTypeKey]; | ||
getTrackingType: function () { | ||
return retrieveActiveSession(sessionCookie)[productKey]; | ||
}, | ||
@@ -54,0 +54,0 @@ renewObservable: renewObservable, |
@@ -10,3 +10,3 @@ import { CookieCache } from './cookie'; | ||
getId(): string | undefined; | ||
getType(): T | undefined; | ||
getTrackingType(): T | undefined; | ||
} | ||
@@ -22,6 +22,6 @@ export interface SessionState { | ||
*/ | ||
export declare function startSessionManagement<Type extends string>(sessionTypeKey: string, computeSessionState: (rawType?: string) => { | ||
type: Type; | ||
export declare function startSessionManagement<TrackingType extends string>(productKey: string, computeSessionState: (rawTrackingType?: string) => { | ||
trackingType: TrackingType; | ||
isTracked: boolean; | ||
}): Session<Type>; | ||
}): Session<TrackingType>; | ||
export declare function isValidSessionString(sessionString: string | undefined): sessionString is string; | ||
@@ -28,0 +28,0 @@ export declare function persistSession(session: SessionState, cookie: CookieCache): void; |
@@ -13,3 +13,3 @@ import { cacheCookieAccess, COOKIE_ACCESS_DELAY } from './cookie'; | ||
*/ | ||
export function startSessionManagement(sessionTypeKey, computeSessionState) { | ||
export function startSessionManagement(productKey, computeSessionState) { | ||
var sessionCookie = cacheCookieAccess(SESSION_COOKIE_NAME); | ||
@@ -21,4 +21,4 @@ tryOldCookiesMigration(sessionCookie); | ||
var session = retrieveActiveSession(sessionCookie); | ||
var _a = computeSessionState(session[sessionTypeKey]), type = _a.type, isTracked = _a.isTracked; | ||
session[sessionTypeKey] = type; | ||
var _a = computeSessionState(session[productKey]), trackingType = _a.trackingType, isTracked = _a.isTracked; | ||
session[productKey] = trackingType; | ||
if (isTracked && !session.id) { | ||
@@ -47,4 +47,4 @@ session.id = utils.generateUUID(); | ||
}, | ||
getType: function () { | ||
return retrieveActiveSession(sessionCookie)[sessionTypeKey]; | ||
getTrackingType: function () { | ||
return retrieveActiveSession(sessionCookie)[productKey]; | ||
}, | ||
@@ -51,0 +51,0 @@ renewObservable: renewObservable, |
{ | ||
"name": "@datadog/browser-core", | ||
"version": "1.11.1", | ||
"version": "1.11.2", | ||
"license": "Apache-2.0", | ||
@@ -29,3 +29,3 @@ "main": "cjs/index.js", | ||
}, | ||
"gitHead": "e830e0bef74d1e30585a03ff032b0bba7bb8364d" | ||
"gitHead": "b5cff10e609243eebd48c1b916b3af17fe0115d3" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
354420