@sentry/core
Advanced tools
Comparing version 8.42.0 to 8.43.0
@@ -117,3 +117,2 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
*/ | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
captureException(exception, hint, scope) { | ||
@@ -750,3 +749,2 @@ const eventId = misc.uuid4(); | ||
*/ | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
@@ -753,0 +751,0 @@ } |
@@ -6,2 +6,5 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
const envelope = require('./utils-hoist/envelope.js'); | ||
require('./utils-hoist/version.js'); | ||
require('./utils-hoist/debug-build.js'); | ||
require('./utils-hoist/logger.js'); | ||
const spanUtils = require('./utils/spanUtils.js'); | ||
@@ -8,0 +11,0 @@ |
@@ -21,7 +21,3 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
*/ | ||
function captureException( | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
exception, | ||
hint, | ||
) { | ||
function captureException(exception, hint) { | ||
return currentScopes.getCurrentScope().captureException(exception, prepareEvent.parseEventHintOrCaptureContext(hint)); | ||
@@ -61,3 +57,2 @@ } | ||
*/ | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
function setContext(name, context) { | ||
@@ -64,0 +59,0 @@ currentScopes.getIsolationScope().setContext(name, context); |
@@ -23,3 +23,2 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
try { | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
Function.prototype.toString = function ( ...args) { | ||
@@ -26,0 +25,0 @@ const originalFunction = object.getOriginalFunction(this); |
@@ -20,2 +20,3 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
"Can't find variable: _AutofillCallbackHandler", // Unactionable error in instagram webview https://developers.facebook.com/community/threads/320013549791141/ | ||
/^Non-Error promise rejection captured with value: Object Not Found Matching Id:\d+, MethodName:simulateEvent, ParamCount:\d+$/, // unactionable error from CEFSharp, a .NET library that embeds chromium in .NET apps | ||
]; | ||
@@ -22,0 +23,0 @@ |
@@ -21,3 +21,3 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
// We adjust the type here to add the `unref()` part, as setInterval can technically return a number of a NodeJS.Timer. | ||
// We adjust the type here to add the `unref()` part, as setInterval can technically return a number or a NodeJS.Timer | ||
@@ -24,0 +24,0 @@ // SDKs are required to shift the flush interval by random() * rollup_in_seconds. |
@@ -60,2 +60,3 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
/** Request Mode Session Status */ | ||
// eslint-disable-next-line deprecation/deprecation | ||
@@ -94,2 +95,10 @@ /** The client on this scope */ | ||
newScope._contexts = { ...this._contexts }; | ||
if (this._contexts.flags) { | ||
// We need to copy the `values` array so insertions on a cloned scope | ||
// won't affect the original array. | ||
newScope._contexts.flags = { | ||
values: [...this._contexts.flags.values], | ||
}; | ||
} | ||
newScope._user = this._user; | ||
@@ -187,2 +196,3 @@ newScope._level = this._level; | ||
*/ | ||
// eslint-disable-next-line deprecation/deprecation | ||
getRequestSession() { | ||
@@ -195,2 +205,3 @@ return this._requestSession; | ||
*/ | ||
// eslint-disable-next-line deprecation/deprecation | ||
setRequestSession(requestSession) { | ||
@@ -317,3 +328,4 @@ this._requestSession = requestSession; | ||
scopeToMerge instanceof Scope | ||
? [scopeToMerge.getScopeData(), scopeToMerge.getRequestSession()] | ||
? // eslint-disable-next-line deprecation/deprecation | ||
[scopeToMerge.getScopeData(), scopeToMerge.getRequestSession()] | ||
: is.isPlainObject(scopeToMerge) | ||
@@ -320,0 +332,0 @@ ? [captureContext , (captureContext ).requestSession] |
@@ -26,2 +26,3 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
extends baseclient.BaseClient { | ||
// eslint-disable-next-line deprecation/deprecation | ||
@@ -62,8 +63,9 @@ /** | ||
*/ | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
captureException(exception, hint, scope) { | ||
// Check if the flag `autoSessionTracking` is enabled, and if `_sessionFlusher` exists because it is initialised only | ||
// when the `requestHandler` middleware is used, and hence the expectation is to have SessionAggregates payload | ||
// sent to the Server only when the `requestHandler` middleware is used | ||
// Check if `_sessionFlusher` exists because it is initialized (defined) only when the `autoSessionTracking` is enabled. | ||
// The expectation is that session aggregates are only sent when `autoSessionTracking` is enabled. | ||
// TODO(v9): Our goal in the future is to not have the `autoSessionTracking` option and instead rely on integrations doing the creation and sending of sessions. We will not have a central kill-switch for sessions. | ||
// TODO(v9): This should move into the httpIntegration. | ||
if (this._options.autoSessionTracking && this._sessionFlusher) { | ||
// eslint-disable-next-line deprecation/deprecation | ||
const requestSession = currentScopes.getIsolationScope().getRequestSession(); | ||
@@ -85,5 +87,6 @@ | ||
captureEvent(event, hint, scope) { | ||
// Check if the flag `autoSessionTracking` is enabled, and if `_sessionFlusher` exists because it is initialised only | ||
// when the `requestHandler` middleware is used, and hence the expectation is to have SessionAggregates payload | ||
// sent to the Server only when the `requestHandler` middleware is used | ||
// Check if `_sessionFlusher` exists because it is initialized only when the `autoSessionTracking` is enabled. | ||
// The expectation is that session aggregates are only sent when `autoSessionTracking` is enabled. | ||
// TODO(v9): Our goal in the future is to not have the `autoSessionTracking` option and instead rely on integrations doing the creation and sending of sessions. We will not have a central kill-switch for sessions. | ||
// TODO(v9): This should move into the httpIntegration. | ||
if (this._options.autoSessionTracking && this._sessionFlusher) { | ||
@@ -96,2 +99,3 @@ const eventType = event.type || 'exception'; | ||
if (isException) { | ||
// eslint-disable-next-line deprecation/deprecation | ||
const requestSession = currentScopes.getIsolationScope().getRequestSession(); | ||
@@ -121,8 +125,15 @@ | ||
/** Method that initialises an instance of SessionFlusher on Client */ | ||
/** | ||
* Initializes an instance of SessionFlusher on the client which will aggregate and periodically flush session data. | ||
* | ||
* NOTICE: This method will implicitly create an interval that is periodically called. | ||
* To clean up this resources, call `.close()` when you no longer intend to use the client. | ||
* Not doing so will result in a memory leak. | ||
*/ | ||
initSessionFlusher() { | ||
const { release, environment } = this._options; | ||
if (!release) { | ||
debugBuild.DEBUG_BUILD && logger.logger.warn('Cannot initialise an instance of SessionFlusher if no release is provided!'); | ||
debugBuild.DEBUG_BUILD && logger.logger.warn('Cannot initialize an instance of SessionFlusher if no release is provided!'); | ||
} else { | ||
// eslint-disable-next-line deprecation/deprecation | ||
this._sessionFlusher = new sessionflusher.SessionFlusher(this, { | ||
@@ -202,2 +213,4 @@ release, | ||
* appropriate session aggregates bucket | ||
* | ||
* @deprecated This method should not be used or extended. It's functionality will move into the `httpIntegration` and not be part of any public API. | ||
*/ | ||
@@ -204,0 +217,0 @@ _captureRequestSession() { |
@@ -7,8 +7,9 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
/** | ||
* @inheritdoc | ||
* @deprecated `SessionFlusher` is deprecated and will be removed in the next major version of the SDK. | ||
*/ | ||
// TODO(v9): The goal for the SessionFlusher is to become a stupidly simple mechanism to aggregate "Sessions" (actually "RequestSessions"). It should probably live directly inside the Http integration/instrumentation. | ||
// eslint-disable-next-line deprecation/deprecation | ||
class SessionFlusher { | ||
// Cast to any so that it can use Node.js timeout | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
// We adjust the type here to add the `unref()` part, as setInterval can technically return a number or a NodeJS.Timer | ||
@@ -23,5 +24,3 @@ constructor(client, attrs) { | ||
this._intervalId = setInterval(() => this.flush(), this.flushTimeout * 1000); | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access | ||
if (this._intervalId.unref) { | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access | ||
this._intervalId.unref(); | ||
@@ -70,2 +69,3 @@ } | ||
const isolationScope = currentScopes.getIsolationScope(); | ||
// eslint-disable-next-line deprecation/deprecation | ||
const requestSession = isolationScope.getRequestSession(); | ||
@@ -77,2 +77,3 @@ | ||
// case captureRequestSession is called more than once to prevent double count | ||
// eslint-disable-next-line deprecation/deprecation | ||
isolationScope.setRequestSession(undefined); | ||
@@ -87,2 +88,3 @@ /* eslint-enable @typescript-eslint/no-unsafe-member-access */ | ||
*/ | ||
// eslint-disable-next-line deprecation/deprecation | ||
_incrementSessionStatusCount(status, date) { | ||
@@ -89,0 +91,0 @@ // Truncate minutes and seconds on Session Started attribute to have one minute bucket keys |
Object.defineProperty(exports, '__esModule', { value: true }); | ||
const misc = require('../utils-hoist/misc.js'); | ||
const propagationContext = require('../utils-hoist/propagationContext.js'); | ||
const spanUtils = require('../utils/spanUtils.js'); | ||
@@ -12,4 +12,4 @@ | ||
constructor(spanContext = {}) { | ||
this._traceId = spanContext.traceId || misc.uuid4(); | ||
this._spanId = spanContext.spanId || misc.uuid4().substring(16); | ||
this._traceId = spanContext.traceId || propagationContext.generateTraceId(); | ||
this._spanId = spanContext.spanId || propagationContext.generateSpanId(); | ||
} | ||
@@ -16,0 +16,0 @@ |
@@ -9,4 +9,4 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
const logger = require('../utils-hoist/logger.js'); | ||
const misc = require('../utils-hoist/misc.js'); | ||
const object = require('../utils-hoist/object.js'); | ||
const propagationContext = require('../utils-hoist/propagationContext.js'); | ||
const time = require('../utils-hoist/time.js'); | ||
@@ -44,4 +44,4 @@ const spanUtils = require('../utils/spanUtils.js'); | ||
constructor(spanContext = {}) { | ||
this._traceId = spanContext.traceId || misc.uuid4(); | ||
this._spanId = spanContext.spanId || misc.uuid4().substring(16); | ||
this._traceId = spanContext.traceId || propagationContext.generateTraceId(); | ||
this._spanId = spanContext.spanId || propagationContext.generateSpanId(); | ||
this._startTime = spanContext.startTimestamp || time.timestampInSeconds(); | ||
@@ -48,0 +48,0 @@ |
@@ -212,2 +212,3 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
statsd: 'metric_bucket', | ||
raw_security: 'security', | ||
}; | ||
@@ -214,0 +215,0 @@ |
@@ -23,2 +23,4 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
// Note: The reason we are doing window.onerror instead of window.addEventListener('error') | ||
// is that we are using this handler in the Loader Script, to handle buffered errors consistently | ||
worldwide.GLOBAL_OBJ.onerror = function ( | ||
@@ -40,3 +42,3 @@ msg, | ||
if (_oldOnErrorHandler && !_oldOnErrorHandler.__SENTRY_LOADER__) { | ||
if (_oldOnErrorHandler) { | ||
// eslint-disable-next-line prefer-rest-params | ||
@@ -43,0 +45,0 @@ return _oldOnErrorHandler.apply(this, arguments); |
@@ -25,2 +25,4 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
// Note: The reason we are doing window.onunhandledrejection instead of window.addEventListener('unhandledrejection') | ||
// is that we are using this handler in the Loader Script, to handle buffered rejections consistently | ||
worldwide.GLOBAL_OBJ.onunhandledrejection = function (e) { | ||
@@ -30,3 +32,3 @@ const handlerData = e; | ||
if (_oldOnUnhandledRejectionHandler && !_oldOnUnhandledRejectionHandler.__SENTRY_LOADER__) { | ||
if (_oldOnUnhandledRejectionHandler) { | ||
// eslint-disable-next-line prefer-rest-params | ||
@@ -33,0 +35,0 @@ return _oldOnUnhandledRejectionHandler.apply(this, arguments); |
@@ -73,3 +73,2 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
CONSOLE_LEVELS.forEach(name => { | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
logger[name] = (...args) => { | ||
@@ -76,0 +75,0 @@ if (enabled) { |
@@ -92,3 +92,3 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
return { | ||
filename, | ||
filename: filename ? decodeURI(filename) : undefined, | ||
module: getModule ? getModule(filename) : undefined, | ||
@@ -95,0 +95,0 @@ function: functionName, |
@@ -96,5 +96,6 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
*/ | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
function urlEncode(object) { | ||
return Object.keys(object) | ||
.map(key => `${encodeURIComponent(key)}=${encodeURIComponent(object[key])}`) | ||
return Object.entries(object) | ||
.map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`) | ||
.join('&'); | ||
@@ -101,0 +102,0 @@ } |
@@ -68,3 +68,2 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
*/ | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
function safeJoin(input, delimiter) { | ||
@@ -71,0 +70,0 @@ if (!Array.isArray(input)) { |
Object.defineProperty(exports, '__esModule', { value: true }); | ||
const baggage = require('./baggage.js'); | ||
const misc = require('./misc.js'); | ||
const propagationContext = require('./propagationContext.js'); | ||
@@ -79,4 +78,4 @@ | ||
function generateSentryTraceHeader( | ||
traceId = misc.uuid4(), | ||
spanId = misc.uuid4().substring(16), | ||
traceId = propagationContext.generateTraceId(), | ||
spanId = propagationContext.generateSpanId(), | ||
sampled, | ||
@@ -83,0 +82,0 @@ ) { |
@@ -21,7 +21,5 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
// borrowed from: https://github.com/angular/angular.js/pull/13945/files | ||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */ | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
// TODO(v9): Remove this custom check, it is pretty old and likely not needed anymore | ||
const chromeVar = (WINDOW ).chrome; | ||
const isChromePackagedApp = chromeVar && chromeVar.app && chromeVar.app.runtime; | ||
/* eslint-enable @typescript-eslint/no-unsafe-member-access */ | ||
const hasHistoryApi = 'history' in WINDOW && !!WINDOW.history.pushState && !!WINDOW.history.replaceState; | ||
@@ -28,0 +26,0 @@ |
@@ -5,5 +5,5 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
const SDK_VERSION = "8.42.0" ; | ||
const SDK_VERSION = "8.43.0" ; | ||
exports.SDK_VERSION = SDK_VERSION; | ||
//# sourceMappingURL=version.js.map |
@@ -297,2 +297,10 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
// event.contexts.flags (FeatureFlagContext) stores context for our feature | ||
// flag integrations. It has a greater nesting depth than our other typed | ||
// Contexts, so we re-normalize with a fixed depth of 3 here. We do not want | ||
// to skip this in case of conflicting, user-provided context. | ||
if (event.contexts && event.contexts.flags && normalized.contexts) { | ||
normalized.contexts.flags = normalize.normalize(event.contexts.flags, 3, maxBreadth); | ||
} | ||
return normalized; | ||
@@ -299,0 +307,0 @@ } |
@@ -11,2 +11,3 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
const object = require('../utils-hoist/object.js'); | ||
const propagationContext = require('../utils-hoist/propagationContext.js'); | ||
const time = require('../utils-hoist/time.js'); | ||
@@ -47,6 +48,14 @@ const tracing = require('../utils-hoist/tracing.js'); | ||
function spanToTraceContext(span) { | ||
const { spanId: span_id, traceId: trace_id } = span.spanContext(); | ||
const { parent_span_id } = spanToJSON(span); | ||
const { spanId, traceId: trace_id, isRemote } = span.spanContext(); | ||
return object.dropUndefinedKeys({ parent_span_id, span_id, trace_id }); | ||
// If the span is remote, we use a random/virtual span as span_id to the trace context, | ||
// and the remote span as parent_span_id | ||
const parent_span_id = isRemote ? spanId : spanToJSON(span).parent_span_id; | ||
const span_id = isRemote ? propagationContext.generateSpanId() : spanId; | ||
return object.dropUndefinedKeys({ | ||
parent_span_id, | ||
span_id, | ||
trace_id, | ||
}); | ||
} | ||
@@ -53,0 +62,0 @@ |
@@ -115,3 +115,2 @@ import { getEnvelopeEndpointWithUrlEncodedAuth } from './api.js'; | ||
*/ | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
captureException(exception, hint, scope) { | ||
@@ -748,3 +747,2 @@ const eventId = uuid4(); | ||
*/ | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
@@ -751,0 +749,0 @@ } |
import { getDynamicSamplingContextFromSpan } from './tracing/dynamicSamplingContext.js'; | ||
import { dsnToString } from './utils-hoist/dsn.js'; | ||
import { getSdkMetadataForEnvelopeHeader, createEnvelope, createEventEnvelopeHeaders, createSpanEnvelopeItem } from './utils-hoist/envelope.js'; | ||
import './utils-hoist/version.js'; | ||
import './utils-hoist/debug-build.js'; | ||
import './utils-hoist/logger.js'; | ||
import { spanToJSON, showSpanDropWarning } from './utils/spanUtils.js'; | ||
@@ -5,0 +8,0 @@ |
@@ -19,7 +19,3 @@ import { DEFAULT_ENVIRONMENT } from './constants.js'; | ||
*/ | ||
function captureException( | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
exception, | ||
hint, | ||
) { | ||
function captureException(exception, hint) { | ||
return getCurrentScope().captureException(exception, parseEventHintOrCaptureContext(hint)); | ||
@@ -59,3 +55,2 @@ } | ||
*/ | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
function setContext(name, context) { | ||
@@ -62,0 +57,0 @@ getIsolationScope().setContext(name, context); |
@@ -21,3 +21,2 @@ import { getClient } from '../currentScopes.js'; | ||
try { | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
Function.prototype.toString = function ( ...args) { | ||
@@ -24,0 +23,0 @@ const originalFunction = getOriginalFunction(this); |
@@ -18,2 +18,3 @@ import { DEBUG_BUILD } from '../debug-build.js'; | ||
"Can't find variable: _AutofillCallbackHandler", // Unactionable error in instagram webview https://developers.facebook.com/community/threads/320013549791141/ | ||
/^Non-Error promise rejection captured with value: Object Not Found Matching Id:\d+, MethodName:simulateEvent, ParamCount:\d+$/, // unactionable error from CEFSharp, a .NET library that embeds chromium in .NET apps | ||
]; | ||
@@ -20,0 +21,0 @@ |
@@ -19,3 +19,3 @@ import { timestampInSeconds } from '../utils-hoist/time.js'; | ||
// We adjust the type here to add the `unref()` part, as setInterval can technically return a number of a NodeJS.Timer. | ||
// We adjust the type here to add the `unref()` part, as setInterval can technically return a number or a NodeJS.Timer | ||
@@ -22,0 +22,0 @@ // SDKs are required to shift the flush interval by random() * rollup_in_seconds. |
@@ -1,1 +0,1 @@ | ||
{"type":"module","version":"8.42.0","sideEffects":false} | ||
{"type":"module","version":"8.43.0","sideEffects":false} |
@@ -58,2 +58,3 @@ import { updateSession } from './session.js'; | ||
/** Request Mode Session Status */ | ||
// eslint-disable-next-line deprecation/deprecation | ||
@@ -92,2 +93,10 @@ /** The client on this scope */ | ||
newScope._contexts = { ...this._contexts }; | ||
if (this._contexts.flags) { | ||
// We need to copy the `values` array so insertions on a cloned scope | ||
// won't affect the original array. | ||
newScope._contexts.flags = { | ||
values: [...this._contexts.flags.values], | ||
}; | ||
} | ||
newScope._user = this._user; | ||
@@ -185,2 +194,3 @@ newScope._level = this._level; | ||
*/ | ||
// eslint-disable-next-line deprecation/deprecation | ||
getRequestSession() { | ||
@@ -193,2 +203,3 @@ return this._requestSession; | ||
*/ | ||
// eslint-disable-next-line deprecation/deprecation | ||
setRequestSession(requestSession) { | ||
@@ -315,3 +326,4 @@ this._requestSession = requestSession; | ||
scopeToMerge instanceof Scope | ||
? [scopeToMerge.getScopeData(), scopeToMerge.getRequestSession()] | ||
? // eslint-disable-next-line deprecation/deprecation | ||
[scopeToMerge.getScopeData(), scopeToMerge.getRequestSession()] | ||
: isPlainObject(scopeToMerge) | ||
@@ -318,0 +330,0 @@ ? [captureContext , (captureContext ).requestSession] |
@@ -24,2 +24,3 @@ import { BaseClient } from './baseclient.js'; | ||
extends BaseClient { | ||
// eslint-disable-next-line deprecation/deprecation | ||
@@ -60,8 +61,9 @@ /** | ||
*/ | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
captureException(exception, hint, scope) { | ||
// Check if the flag `autoSessionTracking` is enabled, and if `_sessionFlusher` exists because it is initialised only | ||
// when the `requestHandler` middleware is used, and hence the expectation is to have SessionAggregates payload | ||
// sent to the Server only when the `requestHandler` middleware is used | ||
// Check if `_sessionFlusher` exists because it is initialized (defined) only when the `autoSessionTracking` is enabled. | ||
// The expectation is that session aggregates are only sent when `autoSessionTracking` is enabled. | ||
// TODO(v9): Our goal in the future is to not have the `autoSessionTracking` option and instead rely on integrations doing the creation and sending of sessions. We will not have a central kill-switch for sessions. | ||
// TODO(v9): This should move into the httpIntegration. | ||
if (this._options.autoSessionTracking && this._sessionFlusher) { | ||
// eslint-disable-next-line deprecation/deprecation | ||
const requestSession = getIsolationScope().getRequestSession(); | ||
@@ -83,5 +85,6 @@ | ||
captureEvent(event, hint, scope) { | ||
// Check if the flag `autoSessionTracking` is enabled, and if `_sessionFlusher` exists because it is initialised only | ||
// when the `requestHandler` middleware is used, and hence the expectation is to have SessionAggregates payload | ||
// sent to the Server only when the `requestHandler` middleware is used | ||
// Check if `_sessionFlusher` exists because it is initialized only when the `autoSessionTracking` is enabled. | ||
// The expectation is that session aggregates are only sent when `autoSessionTracking` is enabled. | ||
// TODO(v9): Our goal in the future is to not have the `autoSessionTracking` option and instead rely on integrations doing the creation and sending of sessions. We will not have a central kill-switch for sessions. | ||
// TODO(v9): This should move into the httpIntegration. | ||
if (this._options.autoSessionTracking && this._sessionFlusher) { | ||
@@ -94,2 +97,3 @@ const eventType = event.type || 'exception'; | ||
if (isException) { | ||
// eslint-disable-next-line deprecation/deprecation | ||
const requestSession = getIsolationScope().getRequestSession(); | ||
@@ -119,8 +123,15 @@ | ||
/** Method that initialises an instance of SessionFlusher on Client */ | ||
/** | ||
* Initializes an instance of SessionFlusher on the client which will aggregate and periodically flush session data. | ||
* | ||
* NOTICE: This method will implicitly create an interval that is periodically called. | ||
* To clean up this resources, call `.close()` when you no longer intend to use the client. | ||
* Not doing so will result in a memory leak. | ||
*/ | ||
initSessionFlusher() { | ||
const { release, environment } = this._options; | ||
if (!release) { | ||
DEBUG_BUILD && logger.warn('Cannot initialise an instance of SessionFlusher if no release is provided!'); | ||
DEBUG_BUILD && logger.warn('Cannot initialize an instance of SessionFlusher if no release is provided!'); | ||
} else { | ||
// eslint-disable-next-line deprecation/deprecation | ||
this._sessionFlusher = new SessionFlusher(this, { | ||
@@ -200,2 +211,4 @@ release, | ||
* appropriate session aggregates bucket | ||
* | ||
* @deprecated This method should not be used or extended. It's functionality will move into the `httpIntegration` and not be part of any public API. | ||
*/ | ||
@@ -202,0 +215,0 @@ _captureRequestSession() { |
@@ -5,8 +5,9 @@ import { getIsolationScope } from './currentScopes.js'; | ||
/** | ||
* @inheritdoc | ||
* @deprecated `SessionFlusher` is deprecated and will be removed in the next major version of the SDK. | ||
*/ | ||
// TODO(v9): The goal for the SessionFlusher is to become a stupidly simple mechanism to aggregate "Sessions" (actually "RequestSessions"). It should probably live directly inside the Http integration/instrumentation. | ||
// eslint-disable-next-line deprecation/deprecation | ||
class SessionFlusher { | ||
// Cast to any so that it can use Node.js timeout | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
// We adjust the type here to add the `unref()` part, as setInterval can technically return a number or a NodeJS.Timer | ||
@@ -21,5 +22,3 @@ constructor(client, attrs) { | ||
this._intervalId = setInterval(() => this.flush(), this.flushTimeout * 1000); | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access | ||
if (this._intervalId.unref) { | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access | ||
this._intervalId.unref(); | ||
@@ -68,2 +67,3 @@ } | ||
const isolationScope = getIsolationScope(); | ||
// eslint-disable-next-line deprecation/deprecation | ||
const requestSession = isolationScope.getRequestSession(); | ||
@@ -75,2 +75,3 @@ | ||
// case captureRequestSession is called more than once to prevent double count | ||
// eslint-disable-next-line deprecation/deprecation | ||
isolationScope.setRequestSession(undefined); | ||
@@ -85,2 +86,3 @@ /* eslint-enable @typescript-eslint/no-unsafe-member-access */ | ||
*/ | ||
// eslint-disable-next-line deprecation/deprecation | ||
_incrementSessionStatusCount(status, date) { | ||
@@ -87,0 +89,0 @@ // Truncate minutes and seconds on Session Started attribute to have one minute bucket keys |
@@ -1,2 +0,2 @@ | ||
import { uuid4 } from '../utils-hoist/misc.js'; | ||
import { generateTraceId, generateSpanId } from '../utils-hoist/propagationContext.js'; | ||
import { TRACE_FLAG_NONE } from '../utils/spanUtils.js'; | ||
@@ -10,4 +10,4 @@ | ||
constructor(spanContext = {}) { | ||
this._traceId = spanContext.traceId || uuid4(); | ||
this._spanId = spanContext.spanId || uuid4().substring(16); | ||
this._traceId = spanContext.traceId || generateTraceId(); | ||
this._spanId = spanContext.spanId || generateSpanId(); | ||
} | ||
@@ -14,0 +14,0 @@ |
@@ -7,4 +7,4 @@ import { getClient, getCurrentScope } from '../currentScopes.js'; | ||
import { logger } from '../utils-hoist/logger.js'; | ||
import { uuid4 } from '../utils-hoist/misc.js'; | ||
import { dropUndefinedKeys } from '../utils-hoist/object.js'; | ||
import { generateTraceId, generateSpanId } from '../utils-hoist/propagationContext.js'; | ||
import { timestampInSeconds } from '../utils-hoist/time.js'; | ||
@@ -42,4 +42,4 @@ import { TRACE_FLAG_SAMPLED, TRACE_FLAG_NONE, spanTimeInputToSeconds, getStatusMessage, getRootSpan, spanToJSON, getSpanDescendants, spanToTransactionTraceContext } from '../utils/spanUtils.js'; | ||
constructor(spanContext = {}) { | ||
this._traceId = spanContext.traceId || uuid4(); | ||
this._spanId = spanContext.spanId || uuid4().substring(16); | ||
this._traceId = spanContext.traceId || generateTraceId(); | ||
this._spanId = spanContext.spanId || generateSpanId(); | ||
this._startTime = spanContext.startTimestamp || timestampInSeconds(); | ||
@@ -46,0 +46,0 @@ |
@@ -210,2 +210,3 @@ import { dsnToString } from './dsn.js'; | ||
statsd: 'metric_bucket', | ||
raw_security: 'security', | ||
}; | ||
@@ -212,0 +213,0 @@ |
@@ -21,2 +21,4 @@ import { GLOBAL_OBJ } from '../worldwide.js'; | ||
// Note: The reason we are doing window.onerror instead of window.addEventListener('error') | ||
// is that we are using this handler in the Loader Script, to handle buffered errors consistently | ||
GLOBAL_OBJ.onerror = function ( | ||
@@ -38,3 +40,3 @@ msg, | ||
if (_oldOnErrorHandler && !_oldOnErrorHandler.__SENTRY_LOADER__) { | ||
if (_oldOnErrorHandler) { | ||
// eslint-disable-next-line prefer-rest-params | ||
@@ -41,0 +43,0 @@ return _oldOnErrorHandler.apply(this, arguments); |
@@ -23,2 +23,4 @@ import { GLOBAL_OBJ } from '../worldwide.js'; | ||
// Note: The reason we are doing window.onunhandledrejection instead of window.addEventListener('unhandledrejection') | ||
// is that we are using this handler in the Loader Script, to handle buffered rejections consistently | ||
GLOBAL_OBJ.onunhandledrejection = function (e) { | ||
@@ -28,3 +30,3 @@ const handlerData = e; | ||
if (_oldOnUnhandledRejectionHandler && !_oldOnUnhandledRejectionHandler.__SENTRY_LOADER__) { | ||
if (_oldOnUnhandledRejectionHandler) { | ||
// eslint-disable-next-line prefer-rest-params | ||
@@ -31,0 +33,0 @@ return _oldOnUnhandledRejectionHandler.apply(this, arguments); |
@@ -71,3 +71,2 @@ import { DEBUG_BUILD } from './debug-build.js'; | ||
CONSOLE_LEVELS.forEach(name => { | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
logger[name] = (...args) => { | ||
@@ -74,0 +73,0 @@ if (enabled) { |
@@ -90,3 +90,3 @@ import { UNKNOWN_FUNCTION } from './stacktrace.js'; | ||
return { | ||
filename, | ||
filename: filename ? decodeURI(filename) : undefined, | ||
module: getModule ? getModule(filename) : undefined, | ||
@@ -93,0 +93,0 @@ function: functionName, |
@@ -94,5 +94,6 @@ import { htmlTreeAsString } from './browser.js'; | ||
*/ | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
function urlEncode(object) { | ||
return Object.keys(object) | ||
.map(key => `${encodeURIComponent(key)}=${encodeURIComponent(object[key])}`) | ||
return Object.entries(object) | ||
.map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`) | ||
.join('&'); | ||
@@ -99,0 +100,0 @@ } |
@@ -66,3 +66,2 @@ import { isVueViewModel, isString, isRegExp } from './is.js'; | ||
*/ | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
function safeJoin(input, delimiter) { | ||
@@ -69,0 +68,0 @@ if (!Array.isArray(input)) { |
import { baggageHeaderToDynamicSamplingContext } from './baggage.js'; | ||
import { uuid4 } from './misc.js'; | ||
import { generateTraceId, generateSpanId } from './propagationContext.js'; | ||
@@ -77,4 +76,4 @@ | ||
function generateSentryTraceHeader( | ||
traceId = uuid4(), | ||
spanId = uuid4().substring(16), | ||
traceId = generateTraceId(), | ||
spanId = generateSpanId(), | ||
sampled, | ||
@@ -81,0 +80,0 @@ ) { |
@@ -19,7 +19,5 @@ import { GLOBAL_OBJ } from '../worldwide.js'; | ||
// borrowed from: https://github.com/angular/angular.js/pull/13945/files | ||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */ | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
// TODO(v9): Remove this custom check, it is pretty old and likely not needed anymore | ||
const chromeVar = (WINDOW ).chrome; | ||
const isChromePackagedApp = chromeVar && chromeVar.app && chromeVar.app.runtime; | ||
/* eslint-enable @typescript-eslint/no-unsafe-member-access */ | ||
const hasHistoryApi = 'history' in WINDOW && !!WINDOW.history.pushState && !!WINDOW.history.replaceState; | ||
@@ -26,0 +24,0 @@ |
// This is a magic string replaced by rollup | ||
const SDK_VERSION = "8.42.0" ; | ||
const SDK_VERSION = "8.43.0" ; | ||
export { SDK_VERSION }; | ||
//# sourceMappingURL=version.js.map |
@@ -295,2 +295,10 @@ import { DEFAULT_ENVIRONMENT } from '../constants.js'; | ||
// event.contexts.flags (FeatureFlagContext) stores context for our feature | ||
// flag integrations. It has a greater nesting depth than our other typed | ||
// Contexts, so we re-normalize with a fixed depth of 3 here. We do not want | ||
// to skip this in case of conflicting, user-provided context. | ||
if (event.contexts && event.contexts.flags && normalized.contexts) { | ||
normalized.contexts.flags = normalize(event.contexts.flags, 3, maxBreadth); | ||
} | ||
return normalized; | ||
@@ -297,0 +305,0 @@ } |
@@ -9,2 +9,3 @@ import { getAsyncContextStrategy } from '../asyncContext/index.js'; | ||
import { dropUndefinedKeys, addNonEnumerableProperty } from '../utils-hoist/object.js'; | ||
import { generateSpanId } from '../utils-hoist/propagationContext.js'; | ||
import { timestampInSeconds } from '../utils-hoist/time.js'; | ||
@@ -45,6 +46,14 @@ import { generateSentryTraceHeader } from '../utils-hoist/tracing.js'; | ||
function spanToTraceContext(span) { | ||
const { spanId: span_id, traceId: trace_id } = span.spanContext(); | ||
const { parent_span_id } = spanToJSON(span); | ||
const { spanId, traceId: trace_id, isRemote } = span.spanContext(); | ||
return dropUndefinedKeys({ parent_span_id, span_id, trace_id }); | ||
// If the span is remote, we use a random/virtual span as span_id to the trace context, | ||
// and the remote span as parent_span_id | ||
const parent_span_id = isRemote ? spanId : spanToJSON(span).parent_span_id; | ||
const span_id = isRemote ? generateSpanId() : spanId; | ||
return dropUndefinedKeys({ | ||
parent_span_id, | ||
span_id, | ||
trace_id, | ||
}); | ||
} | ||
@@ -51,0 +60,0 @@ |
@@ -58,3 +58,3 @@ import { Breadcrumb, BreadcrumbHint, Client, ClientOptions, DataCategory, DsnComponents, DynamicSamplingContext, Envelope, Event, EventDropReason, EventHint, EventProcessor, FeedbackEvent, Integration, Outcome, ParameterizedString, SdkMetadata, Session, SessionAggregates, SeverityLevel, Span, SpanAttributes, SpanContextData, StartSpanOptions, Transport, TransportMakeRequestResponse } from './types-hoist'; | ||
*/ | ||
captureException(exception: any, hint?: EventHint, scope?: Scope): string; | ||
captureException(exception: unknown, hint?: EventHint, scope?: Scope): string; | ||
/** | ||
@@ -283,3 +283,3 @@ * @inheritDoc | ||
*/ | ||
abstract eventFromException(_exception: any, _hint?: EventHint): PromiseLike<Event>; | ||
abstract eventFromException(_exception: unknown, _hint?: EventHint): PromiseLike<Event>; | ||
/** | ||
@@ -286,0 +286,0 @@ * @inheritDoc |
import { SentrySpan } from './tracing/sentrySpan'; | ||
import { Client, DsnComponents, Event, EventEnvelope, SdkMetadata, Session, SessionAggregates, SessionEnvelope, SpanEnvelope } from './types-hoist'; | ||
import { Client, DsnComponents, Event, EventEnvelope, LegacyCSPReport, RawSecurityEnvelope, SdkMetadata, Session, SessionAggregates, SessionEnvelope, SpanEnvelope } from './types-hoist'; | ||
/** Creates an envelope from a Session */ | ||
@@ -18,2 +18,6 @@ export declare function createSessionEnvelope(session: Session | SessionAggregates, dsn?: DsnComponents, metadata?: SdkMetadata, tunnel?: string): SessionEnvelope; | ||
], client?: Client): SpanEnvelope; | ||
/** | ||
* Create an Envelope from a CSP report. | ||
*/ | ||
export declare function createRawSecurityEnvelope(report: LegacyCSPReport, dsn: DsnComponents, tunnel?: string, release?: string, environment?: string): RawSecurityEnvelope; | ||
//# sourceMappingURL=envelope.d.ts.map |
@@ -10,3 +10,3 @@ import { CaptureContext, CheckIn, Event, EventHint, EventProcessor, Extra, Extras, MonitorConfig, Primitive, Session, SessionContext, SeverityLevel, User } from './types-hoist'; | ||
*/ | ||
export declare function captureException(exception: any, hint?: ExclusiveEventHintOrCaptureContext): string; | ||
export declare function captureException(exception: unknown, hint?: ExclusiveEventHintOrCaptureContext): string; | ||
/** | ||
@@ -34,3 +34,3 @@ * Captures a message event and sends it to Sentry. | ||
export declare function setContext(name: string, context: { | ||
[key: string]: any; | ||
[key: string]: unknown; | ||
} | null): void; | ||
@@ -37,0 +37,0 @@ /** |
@@ -6,3 +6,2 @@ import { Client, HandlerDataFetch, Scope, Span, SpanOrigin } from './types-hoist'; | ||
]> | { | ||
[key: string]: any; | ||
append: (key: string, value: string) => void; | ||
@@ -9,0 +8,0 @@ get: (key: string) => string | null | undefined; |
@@ -66,2 +66,3 @@ export { ClientClass as SentryCoreCurrentScopes } from './sdk'; | ||
export * from './types-hoist/index'; | ||
export { FeatureFlag } from './featureFlags'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -34,3 +34,3 @@ import { BaseTransportOptions, CheckIn, ClientOptions, DynamicSamplingContext, Event, EventHint, MonitorConfig, ParameterizedString, SeverityLevel, TraceContext } from './types-hoist'; | ||
*/ | ||
captureException(exception: any, hint?: EventHint, scope?: Scope): string; | ||
captureException(exception: unknown, hint?: EventHint, scope?: Scope): string; | ||
/** | ||
@@ -45,3 +45,9 @@ * @inheritDoc | ||
close(timeout?: number): PromiseLike<boolean>; | ||
/** Method that initialises an instance of SessionFlusher on Client */ | ||
/** | ||
* Initializes an instance of SessionFlusher on the client which will aggregate and periodically flush session data. | ||
* | ||
* NOTICE: This method will implicitly create an interval that is periodically called. | ||
* To clean up this resources, call `.close()` when you no longer intend to use the client. | ||
* Not doing so will result in a memory leak. | ||
*/ | ||
initSessionFlusher(): void; | ||
@@ -59,2 +65,4 @@ /** | ||
* appropriate session aggregates bucket | ||
* | ||
* @deprecated This method should not be used or extended. It's functionality will move into the `httpIntegration` and not be part of any public API. | ||
*/ | ||
@@ -61,0 +69,0 @@ protected _captureRequestSession(): void; |
@@ -7,3 +7,3 @@ import { Client, SessionAggregates, SessionFlusherLike } from './types-hoist'; | ||
/** | ||
* @inheritdoc | ||
* @deprecated `SessionFlusher` is deprecated and will be removed in the next major version of the SDK. | ||
*/ | ||
@@ -14,3 +14,3 @@ export declare class SessionFlusher implements SessionFlusherLike { | ||
private _sessionAttrs; | ||
private _intervalId; | ||
private readonly _intervalId; | ||
private _isEnabled; | ||
@@ -17,0 +17,0 @@ private _client; |
@@ -0,1 +1,2 @@ | ||
import { FeatureFlag } from '../featureFlags'; | ||
import { Primitive } from './misc'; | ||
@@ -14,2 +15,3 @@ import { SpanOrigin } from './span'; | ||
profile?: ProfileContext; | ||
flags?: FeatureFlagContext; | ||
} | ||
@@ -120,2 +122,11 @@ export interface StateContext extends Record<string, unknown> { | ||
} | ||
/** | ||
* Used to buffer flag evaluation data on the current scope and attach it to | ||
* error events. `values` should be initialized as empty ([]), and modifying | ||
* directly is not recommended. Use the functions in @sentry/browser | ||
* src/utils/featureFlags instead. | ||
*/ | ||
export interface FeatureFlagContext extends Record<string, unknown> { | ||
values: FeatureFlag[]; | ||
} | ||
//# sourceMappingURL=context.d.ts.map |
import { AttachmentType } from './attachment'; | ||
import { SerializedCheckIn } from './checkin'; | ||
import { ClientReport } from './clientreport'; | ||
import { LegacyCSPReport } from './csp'; | ||
import { DsnComponents } from './dsn'; | ||
@@ -22,3 +23,3 @@ import { Event } from './event'; | ||
}; | ||
export type EnvelopeItemType = 'client_report' | 'user_report' | 'feedback' | 'session' | 'sessions' | 'transaction' | 'attachment' | 'event' | 'profile' | 'profile_chunk' | 'replay_event' | 'replay_recording' | 'check_in' | 'statsd' | 'span'; | ||
export type EnvelopeItemType = 'client_report' | 'user_report' | 'feedback' | 'session' | 'sessions' | 'transaction' | 'attachment' | 'event' | 'profile' | 'profile_chunk' | 'replay_event' | 'replay_recording' | 'check_in' | 'statsd' | 'span' | 'raw_security'; | ||
export type BaseEnvelopeHeaders = { | ||
@@ -90,2 +91,7 @@ [key: string]: unknown; | ||
}; | ||
type RawSecurityHeaders = { | ||
type: 'raw_security'; | ||
sentry_release?: string; | ||
sentry_environment?: string; | ||
}; | ||
export type EventItem = BaseEnvelopeItem<EventItemHeaders, Event>; | ||
@@ -104,2 +110,3 @@ export type AttachmentItem = BaseEnvelopeItem<AttachmentItemHeaders, string | Uint8Array>; | ||
export type SpanItem = BaseEnvelopeItem<SpanItemHeaders, Partial<SpanJSON>>; | ||
export type RawSecurityItem = BaseEnvelopeItem<RawSecurityHeaders, LegacyCSPReport>; | ||
export type EventEnvelopeHeaders = { | ||
@@ -136,5 +143,6 @@ event_id: string; | ||
export type ProfileChunkEnvelope = BaseEnvelope<BaseEnvelopeHeaders, ProfileChunkItem>; | ||
export type Envelope = EventEnvelope | SessionEnvelope | ClientReportEnvelope | ProfileChunkEnvelope | ReplayEnvelope | CheckInEnvelope | StatsdEnvelope | SpanEnvelope; | ||
export type RawSecurityEnvelope = BaseEnvelope<BaseEnvelopeHeaders, RawSecurityItem>; | ||
export type Envelope = EventEnvelope | SessionEnvelope | ClientReportEnvelope | ProfileChunkEnvelope | ReplayEnvelope | CheckInEnvelope | StatsdEnvelope | SpanEnvelope | RawSecurityEnvelope; | ||
export type EnvelopeItem = Envelope[1][number]; | ||
export {}; | ||
//# sourceMappingURL=envelope.d.ts.map |
@@ -9,3 +9,3 @@ export { Attachment } from './attachment'; | ||
export { DebugImage, DebugMeta } from './debugMeta'; | ||
export { AttachmentItem, BaseEnvelopeHeaders, BaseEnvelopeItemHeaders, ClientReportEnvelope, ClientReportItem, DynamicSamplingContext, Envelope, EnvelopeItemType, EnvelopeItem, EventEnvelope, EventEnvelopeHeaders, EventItem, ReplayEnvelope, FeedbackItem, SessionEnvelope, SessionItem, UserFeedbackItem, CheckInItem, CheckInEnvelope, StatsdItem, StatsdEnvelope, ProfileItem, ProfileChunkEnvelope, ProfileChunkItem, SpanEnvelope, SpanItem, } from './envelope'; | ||
export { AttachmentItem, BaseEnvelopeHeaders, BaseEnvelopeItemHeaders, ClientReportEnvelope, ClientReportItem, DynamicSamplingContext, Envelope, EnvelopeItemType, EnvelopeItem, EventEnvelope, EventEnvelopeHeaders, EventItem, ReplayEnvelope, FeedbackItem, SessionEnvelope, SessionItem, UserFeedbackItem, CheckInItem, CheckInEnvelope, RawSecurityEnvelope, RawSecurityItem, StatsdItem, StatsdEnvelope, ProfileItem, ProfileChunkEnvelope, ProfileChunkItem, SpanEnvelope, SpanItem, } from './envelope'; | ||
export { ExtendedError } from './error'; | ||
@@ -55,2 +55,3 @@ export { Event, EventHint, EventType, ErrorEvent, TransactionEvent } from './event'; | ||
export { ViewHierarchyData, ViewHierarchyWindow } from './view-hierarchy'; | ||
export { LegacyCSPReport } from './csp'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -156,2 +156,4 @@ import { Attachment } from './attachment'; | ||
* Returns the `RequestSession` if there is one | ||
* | ||
* @deprecated Use `getSession()` and `setSession()` instead of `getRequestSession()` and `setRequestSession()`; | ||
*/ | ||
@@ -161,2 +163,4 @@ getRequestSession(): RequestSession | undefined; | ||
* Sets the `RequestSession` on the scope | ||
* | ||
* @deprecated Use `getSession()` and `setSession()` instead of `getRequestSession()` and `setRequestSession()`; | ||
*/ | ||
@@ -163,0 +167,0 @@ setRequestSession(requestSession?: RequestSession): this; |
import { User } from './user'; | ||
/** | ||
* @deprecated This type is deprecated and will be removed in the next major version of the SDK. | ||
*/ | ||
export interface RequestSession { | ||
@@ -32,2 +35,5 @@ status?: RequestSessionStatus; | ||
export type SessionStatus = 'ok' | 'exited' | 'crashed' | 'abnormal'; | ||
/** | ||
* @deprecated This type is deprecated and will be removed in the next major version of the SDK. | ||
*/ | ||
export type RequestSessionStatus = 'ok' | 'errored' | 'crashed'; | ||
@@ -42,2 +48,5 @@ /** JSDoc */ | ||
} | ||
/** | ||
* @deprecated This type is deprecated and will be removed in the next major version of the SDK. | ||
*/ | ||
export interface SessionFlusherLike { | ||
@@ -44,0 +53,0 @@ /** |
@@ -7,3 +7,3 @@ import { ConsoleLevel } from '../types-hoist'; | ||
export declare const originalConsoleMethods: { | ||
[key in ConsoleLevel]?: (...args: any[]) => void; | ||
[key in ConsoleLevel]?: (...args: unknown[]) => void; | ||
}; | ||
@@ -10,0 +10,0 @@ /** JSDoc */ |
@@ -25,3 +25,3 @@ export { escapeStringForRegex } from './vendor/escapeStringForRegex'; | ||
*/ | ||
export declare function safeJoin(input: any[], delimiter?: string): string; | ||
export declare function safeJoin(input: unknown[], delimiter?: string): string; | ||
/** | ||
@@ -28,0 +28,0 @@ * Checks if the given value matches a regex or string |
@@ -48,3 +48,2 @@ /** | ||
__SENTRY_INSTRUMENTED__?: true; | ||
__SENTRY_LOADER__?: true; | ||
}; | ||
@@ -54,3 +53,2 @@ onunhandledrejection?: { | ||
__SENTRY_INSTRUMENTED__?: true; | ||
__SENTRY_LOADER__?: true; | ||
}; | ||
@@ -57,0 +55,0 @@ SENTRY_ENVIRONMENT?: string; |
@@ -58,3 +58,3 @@ import type { Breadcrumb, BreadcrumbHint, Client, ClientOptions, DataCategory, DsnComponents, DynamicSamplingContext, Envelope, Event, EventDropReason, EventHint, EventProcessor, FeedbackEvent, Integration, Outcome, ParameterizedString, SdkMetadata, Session, SessionAggregates, SeverityLevel, Span, SpanAttributes, SpanContextData, StartSpanOptions, Transport, TransportMakeRequestResponse } from './types-hoist'; | ||
*/ | ||
captureException(exception: any, hint?: EventHint, scope?: Scope): string; | ||
captureException(exception: unknown, hint?: EventHint, scope?: Scope): string; | ||
/** | ||
@@ -283,3 +283,3 @@ * @inheritDoc | ||
*/ | ||
abstract eventFromException(_exception: any, _hint?: EventHint): PromiseLike<Event>; | ||
abstract eventFromException(_exception: unknown, _hint?: EventHint): PromiseLike<Event>; | ||
/** | ||
@@ -286,0 +286,0 @@ * @inheritDoc |
import type { SentrySpan } from './tracing/sentrySpan'; | ||
import type { Client, DsnComponents, Event, EventEnvelope, SdkMetadata, Session, SessionAggregates, SessionEnvelope, SpanEnvelope } from './types-hoist'; | ||
import type { Client, DsnComponents, Event, EventEnvelope, LegacyCSPReport, RawSecurityEnvelope, SdkMetadata, Session, SessionAggregates, SessionEnvelope, SpanEnvelope } from './types-hoist'; | ||
/** Creates an envelope from a Session */ | ||
@@ -15,2 +15,6 @@ export declare function createSessionEnvelope(session: Session | SessionAggregates, dsn?: DsnComponents, metadata?: SdkMetadata, tunnel?: string): SessionEnvelope; | ||
export declare function createSpanEnvelope(spans: [SentrySpan, ...SentrySpan[]], client?: Client): SpanEnvelope; | ||
/** | ||
* Create an Envelope from a CSP report. | ||
*/ | ||
export declare function createRawSecurityEnvelope(report: LegacyCSPReport, dsn: DsnComponents, tunnel?: string, release?: string, environment?: string): RawSecurityEnvelope; | ||
//# sourceMappingURL=envelope.d.ts.map |
@@ -10,3 +10,3 @@ import type { CaptureContext, CheckIn, Event, EventHint, EventProcessor, Extra, Extras, MonitorConfig, Primitive, Session, SessionContext, SeverityLevel, User } from './types-hoist'; | ||
*/ | ||
export declare function captureException(exception: any, hint?: ExclusiveEventHintOrCaptureContext): string; | ||
export declare function captureException(exception: unknown, hint?: ExclusiveEventHintOrCaptureContext): string; | ||
/** | ||
@@ -34,3 +34,3 @@ * Captures a message event and sends it to Sentry. | ||
export declare function setContext(name: string, context: { | ||
[key: string]: any; | ||
[key: string]: unknown; | ||
} | null): void; | ||
@@ -37,0 +37,0 @@ /** |
import type { Client, HandlerDataFetch, Scope, Span, SpanOrigin } from './types-hoist'; | ||
type PolymorphicRequestHeaders = Record<string, string | undefined> | Array<[string, string]> | { | ||
[key: string]: any; | ||
append: (key: string, value: string) => void; | ||
@@ -5,0 +4,0 @@ get: (key: string) => string | null | undefined; |
@@ -66,2 +66,3 @@ export type { ClientClass as SentryCoreCurrentScopes } from './sdk'; | ||
export * from './types-hoist/index'; | ||
export type { FeatureFlag } from './featureFlags'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -34,3 +34,3 @@ import type { BaseTransportOptions, CheckIn, ClientOptions, DynamicSamplingContext, Event, EventHint, MonitorConfig, ParameterizedString, SeverityLevel, TraceContext } from './types-hoist'; | ||
*/ | ||
captureException(exception: any, hint?: EventHint, scope?: Scope): string; | ||
captureException(exception: unknown, hint?: EventHint, scope?: Scope): string; | ||
/** | ||
@@ -45,3 +45,9 @@ * @inheritDoc | ||
close(timeout?: number): PromiseLike<boolean>; | ||
/** Method that initialises an instance of SessionFlusher on Client */ | ||
/** | ||
* Initializes an instance of SessionFlusher on the client which will aggregate and periodically flush session data. | ||
* | ||
* NOTICE: This method will implicitly create an interval that is periodically called. | ||
* To clean up this resources, call `.close()` when you no longer intend to use the client. | ||
* Not doing so will result in a memory leak. | ||
*/ | ||
initSessionFlusher(): void; | ||
@@ -59,2 +65,4 @@ /** | ||
* appropriate session aggregates bucket | ||
* | ||
* @deprecated This method should not be used or extended. It's functionality will move into the `httpIntegration` and not be part of any public API. | ||
*/ | ||
@@ -61,0 +69,0 @@ protected _captureRequestSession(): void; |
@@ -7,3 +7,3 @@ import type { Client, SessionAggregates, SessionFlusherLike } from './types-hoist'; | ||
/** | ||
* @inheritdoc | ||
* @deprecated `SessionFlusher` is deprecated and will be removed in the next major version of the SDK. | ||
*/ | ||
@@ -14,3 +14,3 @@ export declare class SessionFlusher implements SessionFlusherLike { | ||
private _sessionAttrs; | ||
private _intervalId; | ||
private readonly _intervalId; | ||
private _isEnabled; | ||
@@ -17,0 +17,0 @@ private _client; |
@@ -0,1 +1,2 @@ | ||
import type { FeatureFlag } from '../featureFlags'; | ||
import type { Primitive } from './misc'; | ||
@@ -14,2 +15,3 @@ import type { SpanOrigin } from './span'; | ||
profile?: ProfileContext; | ||
flags?: FeatureFlagContext; | ||
} | ||
@@ -120,2 +122,11 @@ export interface StateContext extends Record<string, unknown> { | ||
} | ||
/** | ||
* Used to buffer flag evaluation data on the current scope and attach it to | ||
* error events. `values` should be initialized as empty ([]), and modifying | ||
* directly is not recommended. Use the functions in @sentry/browser | ||
* src/utils/featureFlags instead. | ||
*/ | ||
export interface FeatureFlagContext extends Record<string, unknown> { | ||
values: FeatureFlag[]; | ||
} | ||
//# sourceMappingURL=context.d.ts.map |
import type { AttachmentType } from './attachment'; | ||
import type { SerializedCheckIn } from './checkin'; | ||
import type { ClientReport } from './clientreport'; | ||
import type { LegacyCSPReport } from './csp'; | ||
import type { DsnComponents } from './dsn'; | ||
@@ -22,3 +23,3 @@ import type { Event } from './event'; | ||
}; | ||
export type EnvelopeItemType = 'client_report' | 'user_report' | 'feedback' | 'session' | 'sessions' | 'transaction' | 'attachment' | 'event' | 'profile' | 'profile_chunk' | 'replay_event' | 'replay_recording' | 'check_in' | 'statsd' | 'span'; | ||
export type EnvelopeItemType = 'client_report' | 'user_report' | 'feedback' | 'session' | 'sessions' | 'transaction' | 'attachment' | 'event' | 'profile' | 'profile_chunk' | 'replay_event' | 'replay_recording' | 'check_in' | 'statsd' | 'span' | 'raw_security'; | ||
export type BaseEnvelopeHeaders = { | ||
@@ -87,2 +88,7 @@ [key: string]: unknown; | ||
}; | ||
type RawSecurityHeaders = { | ||
type: 'raw_security'; | ||
sentry_release?: string; | ||
sentry_environment?: string; | ||
}; | ||
export type EventItem = BaseEnvelopeItem<EventItemHeaders, Event>; | ||
@@ -101,2 +107,3 @@ export type AttachmentItem = BaseEnvelopeItem<AttachmentItemHeaders, string | Uint8Array>; | ||
export type SpanItem = BaseEnvelopeItem<SpanItemHeaders, Partial<SpanJSON>>; | ||
export type RawSecurityItem = BaseEnvelopeItem<RawSecurityHeaders, LegacyCSPReport>; | ||
export type EventEnvelopeHeaders = { | ||
@@ -127,5 +134,6 @@ event_id: string; | ||
export type ProfileChunkEnvelope = BaseEnvelope<BaseEnvelopeHeaders, ProfileChunkItem>; | ||
export type Envelope = EventEnvelope | SessionEnvelope | ClientReportEnvelope | ProfileChunkEnvelope | ReplayEnvelope | CheckInEnvelope | StatsdEnvelope | SpanEnvelope; | ||
export type RawSecurityEnvelope = BaseEnvelope<BaseEnvelopeHeaders, RawSecurityItem>; | ||
export type Envelope = EventEnvelope | SessionEnvelope | ClientReportEnvelope | ProfileChunkEnvelope | ReplayEnvelope | CheckInEnvelope | StatsdEnvelope | SpanEnvelope | RawSecurityEnvelope; | ||
export type EnvelopeItem = Envelope[1][number]; | ||
export {}; | ||
//# sourceMappingURL=envelope.d.ts.map |
@@ -9,3 +9,3 @@ export type { Attachment } from './attachment'; | ||
export type { DebugImage, DebugMeta } from './debugMeta'; | ||
export type { AttachmentItem, BaseEnvelopeHeaders, BaseEnvelopeItemHeaders, ClientReportEnvelope, ClientReportItem, DynamicSamplingContext, Envelope, EnvelopeItemType, EnvelopeItem, EventEnvelope, EventEnvelopeHeaders, EventItem, ReplayEnvelope, FeedbackItem, SessionEnvelope, SessionItem, UserFeedbackItem, CheckInItem, CheckInEnvelope, StatsdItem, StatsdEnvelope, ProfileItem, ProfileChunkEnvelope, ProfileChunkItem, SpanEnvelope, SpanItem, } from './envelope'; | ||
export type { AttachmentItem, BaseEnvelopeHeaders, BaseEnvelopeItemHeaders, ClientReportEnvelope, ClientReportItem, DynamicSamplingContext, Envelope, EnvelopeItemType, EnvelopeItem, EventEnvelope, EventEnvelopeHeaders, EventItem, ReplayEnvelope, FeedbackItem, SessionEnvelope, SessionItem, UserFeedbackItem, CheckInItem, CheckInEnvelope, RawSecurityEnvelope, RawSecurityItem, StatsdItem, StatsdEnvelope, ProfileItem, ProfileChunkEnvelope, ProfileChunkItem, SpanEnvelope, SpanItem, } from './envelope'; | ||
export type { ExtendedError } from './error'; | ||
@@ -55,2 +55,3 @@ export type { Event, EventHint, EventType, ErrorEvent, TransactionEvent } from './event'; | ||
export type { ViewHierarchyData, ViewHierarchyWindow } from './view-hierarchy'; | ||
export type { LegacyCSPReport } from './csp'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -156,2 +156,4 @@ import type { Attachment } from './attachment'; | ||
* Returns the `RequestSession` if there is one | ||
* | ||
* @deprecated Use `getSession()` and `setSession()` instead of `getRequestSession()` and `setRequestSession()`; | ||
*/ | ||
@@ -161,2 +163,4 @@ getRequestSession(): RequestSession | undefined; | ||
* Sets the `RequestSession` on the scope | ||
* | ||
* @deprecated Use `getSession()` and `setSession()` instead of `getRequestSession()` and `setRequestSession()`; | ||
*/ | ||
@@ -163,0 +167,0 @@ setRequestSession(requestSession?: RequestSession): this; |
import type { User } from './user'; | ||
/** | ||
* @deprecated This type is deprecated and will be removed in the next major version of the SDK. | ||
*/ | ||
export interface RequestSession { | ||
@@ -32,2 +35,5 @@ status?: RequestSessionStatus; | ||
export type SessionStatus = 'ok' | 'exited' | 'crashed' | 'abnormal'; | ||
/** | ||
* @deprecated This type is deprecated and will be removed in the next major version of the SDK. | ||
*/ | ||
export type RequestSessionStatus = 'ok' | 'errored' | 'crashed'; | ||
@@ -42,2 +48,5 @@ /** JSDoc */ | ||
} | ||
/** | ||
* @deprecated This type is deprecated and will be removed in the next major version of the SDK. | ||
*/ | ||
export interface SessionFlusherLike { | ||
@@ -44,0 +53,0 @@ /** |
@@ -7,3 +7,3 @@ import type { ConsoleLevel } from '../types-hoist'; | ||
export declare const originalConsoleMethods: { | ||
[key in ConsoleLevel]?: (...args: any[]) => void; | ||
[key in ConsoleLevel]?: (...args: unknown[]) => void; | ||
}; | ||
@@ -10,0 +10,0 @@ /** JSDoc */ |
@@ -25,3 +25,3 @@ export { escapeStringForRegex } from './vendor/escapeStringForRegex'; | ||
*/ | ||
export declare function safeJoin(input: any[], delimiter?: string): string; | ||
export declare function safeJoin(input: unknown[], delimiter?: string): string; | ||
/** | ||
@@ -28,0 +28,0 @@ * Checks if the given value matches a regex or string |
@@ -48,3 +48,2 @@ /** | ||
__SENTRY_INSTRUMENTED__?: true; | ||
__SENTRY_LOADER__?: true; | ||
}; | ||
@@ -54,3 +53,2 @@ onunhandledrejection?: { | ||
__SENTRY_INSTRUMENTED__?: true; | ||
__SENTRY_LOADER__?: true; | ||
}; | ||
@@ -57,0 +55,0 @@ SENTRY_ENVIRONMENT?: string; |
{ | ||
"name": "@sentry/core", | ||
"version": "8.42.0", | ||
"version": "8.43.0", | ||
"description": "Base implementation for all Sentry JavaScript SDKs", | ||
@@ -5,0 +5,0 @@ "repository": "git://github.com/getsentry/sentry-javascript.git", |
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
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
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
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
3551604
1140
42635