@grafana/faro-web-sdk
Advanced tools
Comparing version 1.9.1 to 1.10.0
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isErrorEvent = exports.isErrorDefined = exports.isError = exports.isElementDefined = exports.isElement = exports.isDomException = exports.isDomError = exports.isBoolean = exports.isArray = exports.internalGlobalObjectKey = exports.globalObject = exports.getTransportBody = exports.getInternalFaroFromGlobalObject = exports.getCurrentTimestamp = exports.genShortID = exports.defaultLogLevel = exports.defaultInternalLoggerLevel = exports.defaultGlobalObjectKey = exports.defaultExceptionType = exports.deepEqual = exports.createPromiseBuffer = exports.createInternalLogger = exports.Conventions = exports.BaseTransport = exports.BaseInstrumentation = exports.BaseExtension = exports.allLogLevels = exports.faro = exports.FetchTransport = exports.ConsoleTransport = exports.sdkMeta = exports.pageMeta = exports.defaultViewMeta = exports.defaultMetas = exports.createSession = exports.browserMeta = exports.PerformanceInstrumentation = exports.SessionInstrumentation = exports.WebVitalsInstrumentation = exports.ViewInstrumentation = exports.parseStacktrace = exports.getStackFramesFromError = exports.getDataFromSafariExtensions = exports.ErrorsInstrumentation = exports.ConsoleInstrumentation = exports.buildStackFrame = exports.initializeFaro = exports.defaultEventDomain = exports.makeCoreConfig = exports.getWebInstrumentations = void 0; | ||
exports.STORAGE_KEY = exports.SESSION_INACTIVITY_TIME = exports.SESSION_EXPIRATION_TIME = exports.MAX_SESSION_PERSISTENCE_TIME_BUFFER = exports.MAX_SESSION_PERSISTENCE_TIME = exports.VolatileSessionsManager = exports.PersistentSessionsManager = exports.EVENT_VIEW_CHANGED = exports.EVENT_SESSION_START = exports.EVENT_SESSION_RESUME = exports.EVENT_SESSION_EXTEND = exports.EVENT_ROUTE_CHANGE = exports.EVENT_NAVIGATION = exports.EVENT_CLICK = exports.VERSION = exports.transportItemTypeToBodyKey = exports.TransportItemType = exports.setInternalFaroOnGlobalObject = exports.noop = exports.LogLevel = exports.InternalLoggerLevel = exports.isUndefined = exports.isTypeof = exports.isToString = exports.isThenable = exports.isSyntheticEvent = exports.isSymbol = exports.isString = exports.isRegExp = exports.isPrimitive = exports.isObject = exports.isNumber = exports.isNull = exports.isMapDefined = exports.isMap = exports.isInternalFaroOnGlobalObject = exports.isInt = exports.isInstanceOf = exports.isFunction = exports.isEventDefined = exports.isEvent = void 0; | ||
exports.isEvent = exports.isErrorEvent = exports.isErrorDefined = exports.isError = exports.isElementDefined = exports.isElement = exports.isDomException = exports.isDomError = exports.isBoolean = exports.isArray = exports.internalGlobalObjectKey = exports.globalObject = exports.getTransportBody = exports.getInternalFaroFromGlobalObject = exports.getCurrentTimestamp = exports.genShortID = exports.defaultLogLevel = exports.defaultInternalLoggerLevel = exports.defaultGlobalObjectKey = exports.defaultExceptionType = exports.deepEqual = exports.createPromiseBuffer = exports.createInternalLogger = exports.Conventions = exports.BaseTransport = exports.BaseInstrumentation = exports.BaseExtension = exports.allLogLevels = exports.faro = exports.FetchTransport = exports.ConsoleTransport = exports.sdkMeta = exports.pageMeta = exports.defaultMetas = exports.createSession = exports.browserMeta = exports.PerformanceInstrumentation = exports.SessionInstrumentation = exports.WebVitalsInstrumentation = exports.ViewInstrumentation = exports.parseStacktrace = exports.getStackFramesFromError = exports.getDataFromSafariExtensions = exports.ErrorsInstrumentation = exports.ConsoleInstrumentation = exports.buildStackFrame = exports.initializeFaro = exports.defaultEventDomain = exports.makeCoreConfig = exports.getWebInstrumentations = void 0; | ||
exports.STORAGE_KEY = exports.SESSION_INACTIVITY_TIME = exports.SESSION_EXPIRATION_TIME = exports.MAX_SESSION_PERSISTENCE_TIME_BUFFER = exports.MAX_SESSION_PERSISTENCE_TIME = exports.VolatileSessionsManager = exports.PersistentSessionsManager = exports.EVENT_VIEW_CHANGED = exports.EVENT_SESSION_START = exports.EVENT_SESSION_RESUME = exports.EVENT_SESSION_EXTEND = exports.EVENT_ROUTE_CHANGE = exports.EVENT_NAVIGATION = exports.EVENT_CLICK = exports.VERSION = exports.transportItemTypeToBodyKey = exports.TransportItemType = exports.setInternalFaroOnGlobalObject = exports.noop = exports.LogLevel = exports.InternalLoggerLevel = exports.isUndefined = exports.isTypeof = exports.isToString = exports.isThenable = exports.isSyntheticEvent = exports.isSymbol = exports.isString = exports.isRegExp = exports.isPrimitive = exports.isObject = exports.isNumber = exports.isNull = exports.isMapDefined = exports.isMap = exports.isInternalFaroOnGlobalObject = exports.isInt = exports.isInstanceOf = exports.isFunction = exports.isEventDefined = void 0; | ||
var config_1 = require("./config"); | ||
@@ -27,3 +27,2 @@ Object.defineProperty(exports, "getWebInstrumentations", { enumerable: true, get: function () { return config_1.getWebInstrumentations; } }); | ||
Object.defineProperty(exports, "defaultMetas", { enumerable: true, get: function () { return metas_1.defaultMetas; } }); | ||
Object.defineProperty(exports, "defaultViewMeta", { enumerable: true, get: function () { return metas_1.defaultViewMeta; } }); | ||
Object.defineProperty(exports, "pageMeta", { enumerable: true, get: function () { return metas_1.pageMeta; } }); | ||
@@ -30,0 +29,0 @@ Object.defineProperty(exports, "sdkMeta", { enumerable: true, get: function () { return metas_1.sdkMeta; } }); |
@@ -7,3 +7,3 @@ export { getWebInstrumentations, makeCoreConfig } from './config'; | ||
export type { ConsoleInstrumentationOptions, ErrorEvent, ExtendedPromiseRejectionEvent } from './instrumentations'; | ||
export { browserMeta, createSession, defaultMetas, defaultViewMeta, pageMeta, sdkMeta } from './metas'; | ||
export { browserMeta, createSession, defaultMetas, pageMeta, sdkMeta } from './metas'; | ||
export { ConsoleTransport, FetchTransport } from './transports'; | ||
@@ -10,0 +10,0 @@ export type { ClockFn, ConsoleTransportOptions, FetchTransportOptions, FetchTransportRequestOptions, } from './transports'; |
@@ -6,3 +6,3 @@ import { BaseInstrumentation, LogLevel } from '@grafana/faro-core'; | ||
readonly name = "@grafana/faro-web-sdk:instrumentation-console"; | ||
readonly version = "1.9.1"; | ||
readonly version = "1.10.0"; | ||
static defaultDisabledLevels: LogLevel[]; | ||
@@ -9,0 +9,0 @@ constructor(options?: ConsoleInstrumentationOptions); |
@@ -6,3 +6,3 @@ export declare const primitiveUnhandledValue = "Non-Error promise rejection captured with value:"; | ||
export declare const objectEventValue = "Non-Error exception captured with keys:"; | ||
export declare const unknownString = "?"; | ||
export declare const unknownSymbolString = "?"; | ||
export declare const valueTypeRegex: RegExp; |
import { BaseInstrumentation } from '@grafana/faro-core'; | ||
export declare class ErrorsInstrumentation extends BaseInstrumentation { | ||
readonly name = "@grafana/faro-web-sdk:instrumentation-errors"; | ||
readonly version = "1.9.1"; | ||
readonly version = "1.10.0"; | ||
initialize(): void; | ||
} |
export declare const newLineString = "\n"; | ||
export declare const evalString = "eval"; | ||
export declare const unknownString = "?"; | ||
export declare const unknownSymbolString = "?"; | ||
export declare const atString = "@"; | ||
@@ -5,0 +5,0 @@ export declare const webkitLineRegex: RegExp; |
import { BaseInstrumentation } from '@grafana/faro-core'; | ||
export declare class PerformanceInstrumentation extends BaseInstrumentation { | ||
readonly name = "@grafana/faro-web-sdk:instrumentation-performance"; | ||
readonly version = "1.9.1"; | ||
readonly version = "1.10.0"; | ||
initialize(): void; | ||
private getIgnoreUrls; | ||
} |
@@ -0,1 +1,2 @@ | ||
import type { unknownString } from '@grafana/faro-core'; | ||
export type FaroNavigationTiming = Readonly<{ | ||
@@ -28,3 +29,3 @@ duration: string; | ||
cacheHitStatus: 'cache' | 'conditionalFetch' | 'fullLoad'; | ||
renderBlockingStatus: 'blocking' | 'non-blocking' | 'unknown'; | ||
renderBlockingStatus: 'blocking' | 'non-blocking' | typeof unknownString; | ||
initiatorType: string; | ||
@@ -31,0 +32,0 @@ }>; |
import { BaseInstrumentation } from '@grafana/faro-core'; | ||
export declare class SessionInstrumentation extends BaseInstrumentation { | ||
readonly name = "@grafana/faro-web-sdk:instrumentation-session"; | ||
readonly version = "1.9.1"; | ||
readonly version = "1.10.0"; | ||
private notifiedSession; | ||
@@ -6,0 +6,0 @@ private sendSessionStartEvent; |
import { BaseInstrumentation } from '@grafana/faro-core'; | ||
export declare class ViewInstrumentation extends BaseInstrumentation { | ||
readonly name = "@grafana/faro-web-sdk:instrumentation-view"; | ||
readonly version = "1.9.1"; | ||
readonly version = "1.10.0"; | ||
private notifiedView; | ||
@@ -6,0 +6,0 @@ private sendViewChangedEvent; |
import { BaseInstrumentation } from '@grafana/faro-core'; | ||
export declare class WebVitalsInstrumentation extends BaseInstrumentation { | ||
readonly name = "@grafana/faro-web-sdk:instrumentation-web-vitals"; | ||
readonly version = "1.9.1"; | ||
readonly version = "1.10.0"; | ||
initialize(): void; | ||
private intializeWebVitalsInstrumentation; | ||
} |
@@ -5,3 +5,2 @@ export { browserMeta } from './browser'; | ||
export { createSession } from './session'; | ||
export { defaultViewMeta } from './view'; | ||
export { sdkMeta } from './sdk'; |
@@ -7,5 +7,5 @@ import { BaseTransport } from '@grafana/faro-core'; | ||
readonly name = "@grafana/faro-web-sdk:transport-console"; | ||
readonly version = "1.9.1"; | ||
readonly version = "1.10.0"; | ||
constructor(options?: ConsoleTransportOptions); | ||
send(item: TransportItem): void; | ||
} |
@@ -7,3 +7,3 @@ import { BaseTransport, PromiseBuffer } from '@grafana/faro-core'; | ||
readonly name = "@grafana/faro-web-sdk:transport-fetch"; | ||
readonly version = "1.9.1"; | ||
readonly version = "1.10.0"; | ||
promiseBuffer: PromiseBuffer<Response | void>; | ||
@@ -10,0 +10,0 @@ private readonly rateLimitBackoffMs; |
@@ -33,3 +33,3 @@ "use strict"; | ||
function makeCoreConfig(browserConfig) { | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k; | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j; | ||
var transports = []; | ||
@@ -84,3 +84,3 @@ var internalLogger = (0, faro_core_1.createInternalLogger)(browserConfig.unpatchedConsole, browserConfig.internalLoggerLevel); | ||
user: browserConfig.user, | ||
view: (_k = browserConfig.view) !== null && _k !== void 0 ? _k : metas_1.defaultViewMeta, | ||
view: browserConfig.view, | ||
trackResources: browserConfig.trackResources, | ||
@@ -87,0 +87,0 @@ trackWebVitalsAttribution: browserConfig.trackWebVitalsAttribution, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isErrorEvent = exports.isErrorDefined = exports.isError = exports.isElementDefined = exports.isElement = exports.isDomException = exports.isDomError = exports.isBoolean = exports.isArray = exports.internalGlobalObjectKey = exports.globalObject = exports.getTransportBody = exports.getInternalFaroFromGlobalObject = exports.getCurrentTimestamp = exports.genShortID = exports.defaultLogLevel = exports.defaultInternalLoggerLevel = exports.defaultGlobalObjectKey = exports.defaultExceptionType = exports.deepEqual = exports.createPromiseBuffer = exports.createInternalLogger = exports.Conventions = exports.BaseTransport = exports.BaseInstrumentation = exports.BaseExtension = exports.allLogLevels = exports.faro = exports.FetchTransport = exports.ConsoleTransport = exports.sdkMeta = exports.pageMeta = exports.defaultViewMeta = exports.defaultMetas = exports.createSession = exports.browserMeta = exports.PerformanceInstrumentation = exports.SessionInstrumentation = exports.WebVitalsInstrumentation = exports.ViewInstrumentation = exports.parseStacktrace = exports.getStackFramesFromError = exports.getDataFromSafariExtensions = exports.ErrorsInstrumentation = exports.ConsoleInstrumentation = exports.buildStackFrame = exports.initializeFaro = exports.defaultEventDomain = exports.makeCoreConfig = exports.getWebInstrumentations = void 0; | ||
exports.STORAGE_KEY = exports.SESSION_INACTIVITY_TIME = exports.SESSION_EXPIRATION_TIME = exports.MAX_SESSION_PERSISTENCE_TIME_BUFFER = exports.MAX_SESSION_PERSISTENCE_TIME = exports.VolatileSessionsManager = exports.PersistentSessionsManager = exports.EVENT_VIEW_CHANGED = exports.EVENT_SESSION_START = exports.EVENT_SESSION_RESUME = exports.EVENT_SESSION_EXTEND = exports.EVENT_ROUTE_CHANGE = exports.EVENT_NAVIGATION = exports.EVENT_CLICK = exports.VERSION = exports.transportItemTypeToBodyKey = exports.TransportItemType = exports.setInternalFaroOnGlobalObject = exports.noop = exports.LogLevel = exports.InternalLoggerLevel = exports.isUndefined = exports.isTypeof = exports.isToString = exports.isThenable = exports.isSyntheticEvent = exports.isSymbol = exports.isString = exports.isRegExp = exports.isPrimitive = exports.isObject = exports.isNumber = exports.isNull = exports.isMapDefined = exports.isMap = exports.isInternalFaroOnGlobalObject = exports.isInt = exports.isInstanceOf = exports.isFunction = exports.isEventDefined = exports.isEvent = void 0; | ||
exports.isEvent = exports.isErrorEvent = exports.isErrorDefined = exports.isError = exports.isElementDefined = exports.isElement = exports.isDomException = exports.isDomError = exports.isBoolean = exports.isArray = exports.internalGlobalObjectKey = exports.globalObject = exports.getTransportBody = exports.getInternalFaroFromGlobalObject = exports.getCurrentTimestamp = exports.genShortID = exports.defaultLogLevel = exports.defaultInternalLoggerLevel = exports.defaultGlobalObjectKey = exports.defaultExceptionType = exports.deepEqual = exports.createPromiseBuffer = exports.createInternalLogger = exports.Conventions = exports.BaseTransport = exports.BaseInstrumentation = exports.BaseExtension = exports.allLogLevels = exports.faro = exports.FetchTransport = exports.ConsoleTransport = exports.sdkMeta = exports.pageMeta = exports.defaultMetas = exports.createSession = exports.browserMeta = exports.PerformanceInstrumentation = exports.SessionInstrumentation = exports.WebVitalsInstrumentation = exports.ViewInstrumentation = exports.parseStacktrace = exports.getStackFramesFromError = exports.getDataFromSafariExtensions = exports.ErrorsInstrumentation = exports.ConsoleInstrumentation = exports.buildStackFrame = exports.initializeFaro = exports.defaultEventDomain = exports.makeCoreConfig = exports.getWebInstrumentations = void 0; | ||
exports.STORAGE_KEY = exports.SESSION_INACTIVITY_TIME = exports.SESSION_EXPIRATION_TIME = exports.MAX_SESSION_PERSISTENCE_TIME_BUFFER = exports.MAX_SESSION_PERSISTENCE_TIME = exports.VolatileSessionsManager = exports.PersistentSessionsManager = exports.EVENT_VIEW_CHANGED = exports.EVENT_SESSION_START = exports.EVENT_SESSION_RESUME = exports.EVENT_SESSION_EXTEND = exports.EVENT_ROUTE_CHANGE = exports.EVENT_NAVIGATION = exports.EVENT_CLICK = exports.VERSION = exports.transportItemTypeToBodyKey = exports.TransportItemType = exports.setInternalFaroOnGlobalObject = exports.noop = exports.LogLevel = exports.InternalLoggerLevel = exports.isUndefined = exports.isTypeof = exports.isToString = exports.isThenable = exports.isSyntheticEvent = exports.isSymbol = exports.isString = exports.isRegExp = exports.isPrimitive = exports.isObject = exports.isNumber = exports.isNull = exports.isMapDefined = exports.isMap = exports.isInternalFaroOnGlobalObject = exports.isInt = exports.isInstanceOf = exports.isFunction = exports.isEventDefined = void 0; | ||
var config_1 = require("./config"); | ||
@@ -27,3 +27,2 @@ Object.defineProperty(exports, "getWebInstrumentations", { enumerable: true, get: function () { return config_1.getWebInstrumentations; } }); | ||
Object.defineProperty(exports, "defaultMetas", { enumerable: true, get: function () { return metas_1.defaultMetas; } }); | ||
Object.defineProperty(exports, "defaultViewMeta", { enumerable: true, get: function () { return metas_1.defaultViewMeta; } }); | ||
Object.defineProperty(exports, "pageMeta", { enumerable: true, get: function () { return metas_1.pageMeta; } }); | ||
@@ -30,0 +29,0 @@ Object.defineProperty(exports, "sdkMeta", { enumerable: true, get: function () { return metas_1.sdkMeta; } }); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.valueTypeRegex = exports.unknownString = exports.objectEventValue = exports.domExceptionType = exports.domErrorType = exports.primitiveUnhandledType = exports.primitiveUnhandledValue = void 0; | ||
exports.valueTypeRegex = exports.unknownSymbolString = exports.objectEventValue = exports.domExceptionType = exports.domErrorType = exports.primitiveUnhandledType = exports.primitiveUnhandledValue = void 0; | ||
exports.primitiveUnhandledValue = 'Non-Error promise rejection captured with value:'; | ||
@@ -9,4 +9,4 @@ exports.primitiveUnhandledType = 'UnhandledRejection'; | ||
exports.objectEventValue = 'Non-Error exception captured with keys:'; | ||
exports.unknownString = '?'; | ||
exports.unknownSymbolString = '?'; | ||
exports.valueTypeRegex = /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i; | ||
//# sourceMappingURL=const.js.map |
@@ -23,3 +23,3 @@ "use strict"; | ||
var eventIsString = (0, faro_core_1.isString)(evt); | ||
var initialStackFrame = (0, stackFrames_1.buildStackFrame)(source, const_1.unknownString, lineno, colno); | ||
var initialStackFrame = (0, stackFrames_1.buildStackFrame)(source, const_1.unknownSymbolString, lineno, colno); | ||
if (error || !eventIsString) { | ||
@@ -26,0 +26,0 @@ _a = (0, getErrorDetails_1.getErrorDetails)((error !== null && error !== void 0 ? error : evt)), value = _a[0], type = _a[1], stackFrames = _a[2]; |
@@ -8,3 +8,3 @@ "use strict"; | ||
filename: filename || document.location.href, | ||
function: func || const_1.unknownString, | ||
function: func || const_1.unknownSymbolString, | ||
}; | ||
@@ -11,0 +11,0 @@ if (lineno !== undefined) { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.reactMinifiedRegex = exports.safariWebExtensionString = exports.safariExtensionString = exports.firefoxEvalString = exports.firefoxEvalRegex = exports.firefoxLineRegex = exports.webkitAddressAtStringLength = exports.webkitAddressAtString = exports.webkitEvalString = exports.webkitEvalRegex = exports.webkitLineRegex = exports.atString = exports.unknownString = exports.evalString = exports.newLineString = void 0; | ||
exports.reactMinifiedRegex = exports.safariWebExtensionString = exports.safariExtensionString = exports.firefoxEvalString = exports.firefoxEvalRegex = exports.firefoxLineRegex = exports.webkitAddressAtStringLength = exports.webkitAddressAtString = exports.webkitEvalString = exports.webkitEvalRegex = exports.webkitLineRegex = exports.atString = exports.unknownSymbolString = exports.evalString = exports.newLineString = void 0; | ||
exports.newLineString = '\n'; | ||
exports.evalString = 'eval'; | ||
exports.unknownString = '?'; | ||
exports.unknownSymbolString = '?'; | ||
exports.atString = '@'; | ||
@@ -8,0 +8,0 @@ exports.webkitLineRegex = /^\s*at (?:(.*\).*?|.*?) ?\((?:address at )?)?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i; |
@@ -33,3 +33,3 @@ "use strict"; | ||
var spanContext = (0, performanceUtils_1.getSpanContextFromServerTiming)(navEntryJson === null || navEntryJson === void 0 ? void 0 : navEntryJson.serverTiming); | ||
var faroPreviousNavigationId = (_a = (0, utils_1.getItem)(instrumentationConstants_1.NAVIGATION_ID_STORAGE_KEY, utils_1.webStorageType.session)) !== null && _a !== void 0 ? _a : 'unknown'; | ||
var faroPreviousNavigationId = (_a = (0, utils_1.getItem)(instrumentationConstants_1.NAVIGATION_ID_STORAGE_KEY, utils_1.webStorageType.session)) !== null && _a !== void 0 ? _a : faro_core_1.unknownString; | ||
var faroNavigationEntry = __assign(__assign({}, (0, performanceUtils_1.createFaroNavigationTiming)(navEntryJson)), { faroNavigationId: (0, faro_core_1.genShortID)(), faroPreviousNavigationId: faroPreviousNavigationId }); | ||
@@ -36,0 +36,0 @@ (0, utils_1.setItem)(instrumentationConstants_1.NAVIGATION_ID_STORAGE_KEY, faroNavigationEntry.faroNavigationId, utils_1.webStorageType.session); |
@@ -146,3 +146,3 @@ "use strict"; | ||
if (v == null) { | ||
return 'unknown'; | ||
return faro_core_1.unknownString; | ||
} | ||
@@ -149,0 +149,0 @@ if (typeof v === 'number') { |
@@ -30,8 +30,8 @@ "use strict"; | ||
ViewInstrumentation.prototype.sendViewChangedEvent = function (meta) { | ||
var _a, _b, _c; | ||
var _a, _b, _c, _d; | ||
var view = meta.view; | ||
if (view && view.name !== ((_a = this.notifiedView) === null || _a === void 0 ? void 0 : _a.name)) { | ||
this.api.pushEvent(faro_core_1.EVENT_VIEW_CHANGED, { | ||
fromView: (_c = (_b = this.notifiedView) === null || _b === void 0 ? void 0 : _b.name) !== null && _c !== void 0 ? _c : '', | ||
toView: view.name, | ||
fromView: (_c = (_b = this.notifiedView) === null || _b === void 0 ? void 0 : _b.name) !== null && _c !== void 0 ? _c : faro_core_1.unknownString, | ||
toView: (_d = view.name) !== null && _d !== void 0 ? _d : faro_core_1.unknownString, | ||
}, undefined, { skipDedupe: true }); | ||
@@ -42,3 +42,2 @@ this.notifiedView = view; | ||
ViewInstrumentation.prototype.initialize = function () { | ||
this.sendViewChangedEvent(this.metas.value); | ||
this.metas.addListener(this.sendViewChangedEvent.bind(this)); | ||
@@ -45,0 +44,0 @@ }; |
@@ -5,2 +5,3 @@ "use strict"; | ||
var attribution_1 = require("web-vitals/attribution"); | ||
var faro_core_1 = require("@grafana/faro-core"); | ||
var utils_1 = require("../../utils"); | ||
@@ -117,3 +118,3 @@ var instrumentationConstants_1 = require("../instrumentationConstants"); | ||
var _a; | ||
var navigationEntryId = (_a = (0, utils_1.getItem)(instrumentationConstants_1.NAVIGATION_ID_STORAGE_KEY, utils_1.webStorageType.session)) !== null && _a !== void 0 ? _a : 'unknown'; | ||
var navigationEntryId = (_a = (0, utils_1.getItem)(instrumentationConstants_1.NAVIGATION_ID_STORAGE_KEY, utils_1.webStorageType.session)) !== null && _a !== void 0 ? _a : faro_core_1.unknownString; | ||
return { | ||
@@ -120,0 +121,0 @@ id: metric.id, |
@@ -5,2 +5,3 @@ "use strict"; | ||
var ua_parser_js_1 = require("ua-parser-js"); | ||
var faro_core_1 = require("@grafana/faro-core"); | ||
var browserMeta = function () { | ||
@@ -14,12 +15,11 @@ var parser = new ua_parser_js_1.UAParser(); | ||
var brands = getBrands(); | ||
var unknown = 'unknown'; | ||
return { | ||
browser: { | ||
name: name !== null && name !== void 0 ? name : unknown, | ||
version: version !== null && version !== void 0 ? version : unknown, | ||
os: "".concat(osName !== null && osName !== void 0 ? osName : unknown, " ").concat(osVersion !== null && osVersion !== void 0 ? osVersion : unknown), | ||
userAgent: userAgent !== null && userAgent !== void 0 ? userAgent : unknown, | ||
language: language !== null && language !== void 0 ? language : unknown, | ||
name: name !== null && name !== void 0 ? name : faro_core_1.unknownString, | ||
version: version !== null && version !== void 0 ? version : faro_core_1.unknownString, | ||
os: "".concat(osName !== null && osName !== void 0 ? osName : faro_core_1.unknownString, " ").concat(osVersion !== null && osVersion !== void 0 ? osVersion : faro_core_1.unknownString), | ||
userAgent: userAgent !== null && userAgent !== void 0 ? userAgent : faro_core_1.unknownString, | ||
language: language !== null && language !== void 0 ? language : faro_core_1.unknownString, | ||
mobile: mobile, | ||
brands: brands !== null && brands !== void 0 ? brands : unknown, | ||
brands: brands !== null && brands !== void 0 ? brands : faro_core_1.unknownString, | ||
viewportWidth: "".concat(window.innerWidth), | ||
@@ -26,0 +26,0 @@ viewportHeight: "".concat(window.innerHeight), |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.sdkMeta = exports.defaultViewMeta = exports.createSession = exports.pageMeta = exports.defaultMetas = exports.browserMeta = void 0; | ||
exports.sdkMeta = exports.createSession = exports.pageMeta = exports.defaultMetas = exports.browserMeta = void 0; | ||
var browser_1 = require("./browser"); | ||
@@ -12,6 +12,4 @@ Object.defineProperty(exports, "browserMeta", { enumerable: true, get: function () { return browser_1.browserMeta; } }); | ||
Object.defineProperty(exports, "createSession", { enumerable: true, get: function () { return session_1.createSession; } }); | ||
var view_1 = require("./view"); | ||
Object.defineProperty(exports, "defaultViewMeta", { enumerable: true, get: function () { return view_1.defaultViewMeta; } }); | ||
var sdk_1 = require("./sdk"); | ||
Object.defineProperty(exports, "sdkMeta", { enumerable: true, get: function () { return sdk_1.sdkMeta; } }); | ||
//# sourceMappingURL=index.js.map |
@@ -5,3 +5,3 @@ import { createInternalLogger, defaultBatchingConfig, defaultGlobalObjectKey, defaultInternalLoggerLevel, defaultLogArgsSerializer, defaultUnpatchedConsole, isObject, } from '@grafana/faro-core'; | ||
import { defaultSessionTrackingConfig } from '../instrumentations/session'; | ||
import { defaultMetas, defaultViewMeta } from '../metas'; | ||
import { defaultMetas } from '../metas'; | ||
import { k6Meta } from '../metas/k6'; | ||
@@ -11,3 +11,3 @@ import { FetchTransport } from '../transports'; | ||
export function makeCoreConfig(browserConfig) { | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k; | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j; | ||
const transports = []; | ||
@@ -62,3 +62,3 @@ const internalLogger = createInternalLogger(browserConfig.unpatchedConsole, browserConfig.internalLoggerLevel); | ||
user: browserConfig.user, | ||
view: (_k = browserConfig.view) !== null && _k !== void 0 ? _k : defaultViewMeta, | ||
view: browserConfig.view, | ||
trackResources: browserConfig.trackResources, | ||
@@ -65,0 +65,0 @@ trackWebVitalsAttribution: browserConfig.trackWebVitalsAttribution, |
@@ -5,3 +5,3 @@ export { getWebInstrumentations, makeCoreConfig } from './config'; | ||
export { buildStackFrame, ConsoleInstrumentation, ErrorsInstrumentation, getDataFromSafariExtensions, getStackFramesFromError, parseStacktrace, ViewInstrumentation, WebVitalsInstrumentation, SessionInstrumentation, PerformanceInstrumentation, } from './instrumentations'; | ||
export { browserMeta, createSession, defaultMetas, defaultViewMeta, pageMeta, sdkMeta } from './metas'; | ||
export { browserMeta, createSession, defaultMetas, pageMeta, sdkMeta } from './metas'; | ||
export { ConsoleTransport, FetchTransport } from './transports'; | ||
@@ -8,0 +8,0 @@ export { faro, allLogLevels, BaseExtension, BaseInstrumentation, BaseTransport, Conventions, createInternalLogger, createPromiseBuffer, deepEqual, defaultExceptionType, defaultGlobalObjectKey, defaultInternalLoggerLevel, defaultLogLevel, genShortID, getCurrentTimestamp, getInternalFaroFromGlobalObject, getTransportBody, globalObject, internalGlobalObjectKey, isArray, isBoolean, isDomError, isDomException, isElement, isElementDefined, isError, isErrorDefined, isErrorEvent, isEvent, isEventDefined, isFunction, isInstanceOf, isInt, isInternalFaroOnGlobalObject, isMap, isMapDefined, isNull, isNumber, isObject, isPrimitive, isRegExp, isString, isSymbol, isSyntheticEvent, isThenable, isToString, isTypeof, isUndefined, InternalLoggerLevel, LogLevel, noop, setInternalFaroOnGlobalObject, TransportItemType, transportItemTypeToBodyKey, VERSION, EVENT_CLICK, EVENT_NAVIGATION, EVENT_ROUTE_CHANGE, EVENT_SESSION_EXTEND, EVENT_SESSION_RESUME, EVENT_SESSION_START, EVENT_VIEW_CHANGED, } from '@grafana/faro-core'; |
@@ -6,4 +6,4 @@ export const primitiveUnhandledValue = 'Non-Error promise rejection captured with value:'; | ||
export const objectEventValue = 'Non-Error exception captured with keys:'; | ||
export const unknownString = '?'; | ||
export const unknownSymbolString = '?'; | ||
export const valueTypeRegex = /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i; | ||
//# sourceMappingURL=const.js.map |
import { isString } from '@grafana/faro-core'; | ||
import { unknownString } from './const'; | ||
import { unknownSymbolString } from './const'; | ||
import { getErrorDetails } from './getErrorDetails'; | ||
@@ -15,3 +15,3 @@ import { getValueAndTypeFromMessage } from './getValueAndTypeFromMessage'; | ||
const eventIsString = isString(evt); | ||
const initialStackFrame = buildStackFrame(source, unknownString, lineno, colno); | ||
const initialStackFrame = buildStackFrame(source, unknownSymbolString, lineno, colno); | ||
if (error || !eventIsString) { | ||
@@ -18,0 +18,0 @@ [value, type, stackFrames] = getErrorDetails((error !== null && error !== void 0 ? error : evt)); |
@@ -1,6 +0,6 @@ | ||
import { unknownString } from './const'; | ||
import { unknownSymbolString } from './const'; | ||
export function buildStackFrame(filename, func, lineno, colno) { | ||
const stackFrame = { | ||
filename: filename || document.location.href, | ||
function: func || unknownString, | ||
function: func || unknownSymbolString, | ||
}; | ||
@@ -7,0 +7,0 @@ if (lineno !== undefined) { |
export const newLineString = '\n'; | ||
export const evalString = 'eval'; | ||
export const unknownString = '?'; | ||
export const unknownSymbolString = '?'; | ||
export const atString = '@'; | ||
@@ -5,0 +5,0 @@ export const webkitLineRegex = /^\s*at (?:(.*\).*?|.*?) ?\((?:address at )?)?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i; |
@@ -1,2 +0,2 @@ | ||
import { genShortID } from '@grafana/faro-core'; | ||
import { genShortID, unknownString } from '@grafana/faro-core'; | ||
import { getItem, setItem, webStorageType } from '../../utils'; | ||
@@ -19,3 +19,3 @@ import { NAVIGATION_ID_STORAGE_KEY } from '../instrumentationConstants'; | ||
let spanContext = getSpanContextFromServerTiming(navEntryJson === null || navEntryJson === void 0 ? void 0 : navEntryJson.serverTiming); | ||
const faroPreviousNavigationId = (_a = getItem(NAVIGATION_ID_STORAGE_KEY, webStorageType.session)) !== null && _a !== void 0 ? _a : 'unknown'; | ||
const faroPreviousNavigationId = (_a = getItem(NAVIGATION_ID_STORAGE_KEY, webStorageType.session)) !== null && _a !== void 0 ? _a : unknownString; | ||
const faroNavigationEntry = Object.assign(Object.assign({}, createFaroNavigationTiming(navEntryJson)), { faroNavigationId: genShortID(), faroPreviousNavigationId }); | ||
@@ -22,0 +22,0 @@ setItem(NAVIGATION_ID_STORAGE_KEY, faroNavigationEntry.faroNavigationId, webStorageType.session); |
@@ -1,2 +0,2 @@ | ||
import { isArray } from '@grafana/faro-core'; | ||
import { isArray, unknownString } from '@grafana/faro-core'; | ||
const w3cTraceparentFormat = /^00-[a-f0-9]{32}-[a-f0-9]{16}-[0-9]{1,2}$/; | ||
@@ -120,3 +120,3 @@ // Extract traceparent from serverTiming, if present | ||
if (v == null) { | ||
return 'unknown'; | ||
return unknownString; | ||
} | ||
@@ -123,0 +123,0 @@ if (typeof v === 'number') { |
@@ -1,2 +0,2 @@ | ||
import { BaseInstrumentation, EVENT_VIEW_CHANGED, VERSION } from '@grafana/faro-core'; | ||
import { BaseInstrumentation, EVENT_VIEW_CHANGED, unknownString, VERSION } from '@grafana/faro-core'; | ||
// all this does is send VIEW_CHANGED event | ||
@@ -10,8 +10,8 @@ export class ViewInstrumentation extends BaseInstrumentation { | ||
sendViewChangedEvent(meta) { | ||
var _a, _b, _c; | ||
var _a, _b, _c, _d; | ||
const view = meta.view; | ||
if (view && view.name !== ((_a = this.notifiedView) === null || _a === void 0 ? void 0 : _a.name)) { | ||
this.api.pushEvent(EVENT_VIEW_CHANGED, { | ||
fromView: (_c = (_b = this.notifiedView) === null || _b === void 0 ? void 0 : _b.name) !== null && _c !== void 0 ? _c : '', | ||
toView: view.name, | ||
fromView: (_c = (_b = this.notifiedView) === null || _b === void 0 ? void 0 : _b.name) !== null && _c !== void 0 ? _c : unknownString, | ||
toView: (_d = view.name) !== null && _d !== void 0 ? _d : unknownString, | ||
}, undefined, { skipDedupe: true }); | ||
@@ -22,3 +22,2 @@ this.notifiedView = view; | ||
initialize() { | ||
this.sendViewChangedEvent(this.metas.value); | ||
this.metas.addListener(this.sendViewChangedEvent.bind(this)); | ||
@@ -25,0 +24,0 @@ } |
import { onCLS, onFCP, onFID, onINP, onLCP, onTTFB } from 'web-vitals/attribution'; | ||
import { unknownString } from '@grafana/faro-core'; | ||
import { getItem, webStorageType } from '../../utils'; | ||
@@ -106,3 +107,3 @@ import { NAVIGATION_ID_STORAGE_KEY } from '../instrumentationConstants'; | ||
var _a; | ||
const navigationEntryId = (_a = getItem(NAVIGATION_ID_STORAGE_KEY, webStorageType.session)) !== null && _a !== void 0 ? _a : 'unknown'; | ||
const navigationEntryId = (_a = getItem(NAVIGATION_ID_STORAGE_KEY, webStorageType.session)) !== null && _a !== void 0 ? _a : unknownString; | ||
return { | ||
@@ -109,0 +110,0 @@ id: metric.id, |
import { UAParser } from 'ua-parser-js'; | ||
import { unknownString } from '@grafana/faro-core'; | ||
export const browserMeta = () => { | ||
@@ -10,12 +11,11 @@ const parser = new UAParser(); | ||
const brands = getBrands(); | ||
const unknown = 'unknown'; | ||
return { | ||
browser: { | ||
name: name !== null && name !== void 0 ? name : unknown, | ||
version: version !== null && version !== void 0 ? version : unknown, | ||
os: `${osName !== null && osName !== void 0 ? osName : unknown} ${osVersion !== null && osVersion !== void 0 ? osVersion : unknown}`, | ||
userAgent: userAgent !== null && userAgent !== void 0 ? userAgent : unknown, | ||
language: language !== null && language !== void 0 ? language : unknown, | ||
name: name !== null && name !== void 0 ? name : unknownString, | ||
version: version !== null && version !== void 0 ? version : unknownString, | ||
os: `${osName !== null && osName !== void 0 ? osName : unknownString} ${osVersion !== null && osVersion !== void 0 ? osVersion : unknownString}`, | ||
userAgent: userAgent !== null && userAgent !== void 0 ? userAgent : unknownString, | ||
language: language !== null && language !== void 0 ? language : unknownString, | ||
mobile, | ||
brands: brands !== null && brands !== void 0 ? brands : unknown, | ||
brands: brands !== null && brands !== void 0 ? brands : unknownString, | ||
viewportWidth: `${window.innerWidth}`, | ||
@@ -22,0 +22,0 @@ viewportHeight: `${window.innerHeight}`, |
@@ -5,4 +5,3 @@ export { browserMeta } from './browser'; | ||
export { createSession } from './session'; | ||
export { defaultViewMeta } from './view'; | ||
export { sdkMeta } from './sdk'; | ||
//# sourceMappingURL=index.js.map |
@@ -7,3 +7,3 @@ export { getWebInstrumentations, makeCoreConfig } from './config'; | ||
export type { ConsoleInstrumentationOptions, ErrorEvent, ExtendedPromiseRejectionEvent } from './instrumentations'; | ||
export { browserMeta, createSession, defaultMetas, defaultViewMeta, pageMeta, sdkMeta } from './metas'; | ||
export { browserMeta, createSession, defaultMetas, pageMeta, sdkMeta } from './metas'; | ||
export { ConsoleTransport, FetchTransport } from './transports'; | ||
@@ -10,0 +10,0 @@ export type { ClockFn, ConsoleTransportOptions, FetchTransportOptions, FetchTransportRequestOptions, } from './transports'; |
@@ -6,3 +6,3 @@ import { BaseInstrumentation, LogLevel } from '@grafana/faro-core'; | ||
readonly name = "@grafana/faro-web-sdk:instrumentation-console"; | ||
readonly version = "1.9.1"; | ||
readonly version = "1.10.0"; | ||
static defaultDisabledLevels: LogLevel[]; | ||
@@ -9,0 +9,0 @@ constructor(options?: ConsoleInstrumentationOptions); |
@@ -6,3 +6,3 @@ export declare const primitiveUnhandledValue = "Non-Error promise rejection captured with value:"; | ||
export declare const objectEventValue = "Non-Error exception captured with keys:"; | ||
export declare const unknownString = "?"; | ||
export declare const unknownSymbolString = "?"; | ||
export declare const valueTypeRegex: RegExp; |
import { BaseInstrumentation } from '@grafana/faro-core'; | ||
export declare class ErrorsInstrumentation extends BaseInstrumentation { | ||
readonly name = "@grafana/faro-web-sdk:instrumentation-errors"; | ||
readonly version = "1.9.1"; | ||
readonly version = "1.10.0"; | ||
initialize(): void; | ||
} |
export declare const newLineString = "\n"; | ||
export declare const evalString = "eval"; | ||
export declare const unknownString = "?"; | ||
export declare const unknownSymbolString = "?"; | ||
export declare const atString = "@"; | ||
@@ -5,0 +5,0 @@ export declare const webkitLineRegex: RegExp; |
import { BaseInstrumentation } from '@grafana/faro-core'; | ||
export declare class PerformanceInstrumentation extends BaseInstrumentation { | ||
readonly name = "@grafana/faro-web-sdk:instrumentation-performance"; | ||
readonly version = "1.9.1"; | ||
readonly version = "1.10.0"; | ||
initialize(): void; | ||
private getIgnoreUrls; | ||
} |
@@ -0,1 +1,2 @@ | ||
import type { unknownString } from '@grafana/faro-core'; | ||
export type FaroNavigationTiming = Readonly<{ | ||
@@ -28,3 +29,3 @@ duration: string; | ||
cacheHitStatus: 'cache' | 'conditionalFetch' | 'fullLoad'; | ||
renderBlockingStatus: 'blocking' | 'non-blocking' | 'unknown'; | ||
renderBlockingStatus: 'blocking' | 'non-blocking' | typeof unknownString; | ||
initiatorType: string; | ||
@@ -31,0 +32,0 @@ }>; |
import { BaseInstrumentation } from '@grafana/faro-core'; | ||
export declare class SessionInstrumentation extends BaseInstrumentation { | ||
readonly name = "@grafana/faro-web-sdk:instrumentation-session"; | ||
readonly version = "1.9.1"; | ||
readonly version = "1.10.0"; | ||
private notifiedSession; | ||
@@ -6,0 +6,0 @@ private sendSessionStartEvent; |
import { BaseInstrumentation } from '@grafana/faro-core'; | ||
export declare class ViewInstrumentation extends BaseInstrumentation { | ||
readonly name = "@grafana/faro-web-sdk:instrumentation-view"; | ||
readonly version = "1.9.1"; | ||
readonly version = "1.10.0"; | ||
private notifiedView; | ||
@@ -6,0 +6,0 @@ private sendViewChangedEvent; |
import { BaseInstrumentation } from '@grafana/faro-core'; | ||
export declare class WebVitalsInstrumentation extends BaseInstrumentation { | ||
readonly name = "@grafana/faro-web-sdk:instrumentation-web-vitals"; | ||
readonly version = "1.9.1"; | ||
readonly version = "1.10.0"; | ||
initialize(): void; | ||
private intializeWebVitalsInstrumentation; | ||
} |
@@ -5,3 +5,2 @@ export { browserMeta } from './browser'; | ||
export { createSession } from './session'; | ||
export { defaultViewMeta } from './view'; | ||
export { sdkMeta } from './sdk'; |
@@ -7,5 +7,5 @@ import { BaseTransport } from '@grafana/faro-core'; | ||
readonly name = "@grafana/faro-web-sdk:transport-console"; | ||
readonly version = "1.9.1"; | ||
readonly version = "1.10.0"; | ||
constructor(options?: ConsoleTransportOptions); | ||
send(item: TransportItem): void; | ||
} |
@@ -7,3 +7,3 @@ import { BaseTransport, PromiseBuffer } from '@grafana/faro-core'; | ||
readonly name = "@grafana/faro-web-sdk:transport-fetch"; | ||
readonly version = "1.9.1"; | ||
readonly version = "1.10.0"; | ||
promiseBuffer: PromiseBuffer<Response | void>; | ||
@@ -10,0 +10,0 @@ private readonly rateLimitBackoffMs; |
{ | ||
"name": "@grafana/faro-web-sdk", | ||
"version": "1.9.1", | ||
"version": "1.10.0", | ||
"description": "Faro instrumentations, metas, transports for web.", | ||
@@ -55,3 +55,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@grafana/faro-core": "^1.9.1", | ||
"@grafana/faro-core": "^1.10.0", | ||
"ua-parser-js": "^1.0.32", | ||
@@ -67,3 +67,3 @@ "web-vitals": "^4.0.1" | ||
}, | ||
"gitHead": "5c60c80d440289bb4f1ec511abacc56b4e29dd9f" | ||
"gitHead": "31842e03e5a1051c007113b11beec843532ff242" | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
657677
439
5151
Updated@grafana/faro-core@^1.10.0