🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

@sentry/core

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sentry/core - npm Package Compare versions

Comparing version

to
9.13.0

@@ -59,5 +59,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });

const thirdPartyErrorsFilter = require('./integrations/third-party-errors-filter.js');
const console = require('./integrations/console.js');
const profiling = require('./profiling.js');
const fetch = require('./fetch.js');
const trpc = require('./trpc.js');
const mcpServer = require('./mcp-server.js');
const feedback = require('./feedback.js');

@@ -72,3 +74,3 @@ const exports$2 = require('./logs/exports.js');

const worldwide = require('./utils-hoist/worldwide.js');
const console = require('./utils-hoist/instrument/console.js');
const console$1 = require('./utils-hoist/instrument/console.js');
const fetch$1 = require('./utils-hoist/instrument/fetch.js');

@@ -256,5 +258,7 @@ const globalError = require('./utils-hoist/instrument/globalError.js');

exports.thirdPartyErrorFilterIntegration = thirdPartyErrorsFilter.thirdPartyErrorFilterIntegration;
exports.consoleIntegration = console.consoleIntegration;
exports.profiler = profiling.profiler;
exports.instrumentFetchRequest = fetch.instrumentFetchRequest;
exports.trpcMiddleware = trpc.trpcMiddleware;
exports.wrapMcpServerWithSentry = mcpServer.wrapMcpServerWithSentry;
exports.captureFeedback = feedback.captureFeedback;

@@ -274,3 +278,3 @@ exports._INTERNAL_captureLog = exports$2._INTERNAL_captureLog;

exports.GLOBAL_OBJ = worldwide.GLOBAL_OBJ;
exports.addConsoleInstrumentationHandler = console.addConsoleInstrumentationHandler;
exports.addConsoleInstrumentationHandler = console$1.addConsoleInstrumentationHandler;
exports.addFetchEndInstrumentationHandler = fetch$1.addFetchEndInstrumentationHandler;

@@ -277,0 +281,0 @@ exports.addFetchInstrumentationHandler = fetch$1.addFetchInstrumentationHandler;

@@ -85,25 +85,14 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });

client$1.emit('beforeCaptureLog', beforeLog);
const log = beforeSendLog ? beforeSendLog(beforeLog) : beforeLog;
if (!log) {
client$1.recordDroppedEvent('before_send', 'log_item', 1);
debugBuild.DEBUG_BUILD && logger.logger.warn('beforeSendLog returned null, log will not be captured.');
return;
}
const [, traceContext] = client._getTraceInfoFromScope(client$1, scope);
const { level, message, attributes, severityNumber } = log;
const logAttributes = {
...attributes,
const processedLogAttributes = {
...beforeLog.attributes,
};
if (release) {
logAttributes['sentry.release'] = release;
processedLogAttributes['sentry.release'] = release;
}
if (environment) {
logAttributes['sentry.environment'] = environment;
processedLogAttributes['sentry.environment'] = environment;
}

@@ -113,11 +102,12 @@

if (sdk) {
logAttributes['sentry.sdk.name'] = sdk.name;
logAttributes['sentry.sdk.version'] = sdk.version;
processedLogAttributes['sentry.sdk.name'] = sdk.name;
processedLogAttributes['sentry.sdk.version'] = sdk.version;
}
if (is.isParameterizedString(message)) {
const { __sentry_template_string__, __sentry_template_values__ = [] } = message;
logAttributes['sentry.message.template'] = __sentry_template_string__;
const beforeLogMessage = beforeLog.message;
if (is.isParameterizedString(beforeLogMessage)) {
const { __sentry_template_string__, __sentry_template_values__ = [] } = beforeLogMessage;
processedLogAttributes['sentry.message.template'] = __sentry_template_string__;
__sentry_template_values__.forEach((param, index) => {
logAttributes[`sentry.message.parameter.${index}`] = param;
processedLogAttributes[`sentry.message.parameter.${index}`] = param;
});

@@ -129,5 +119,18 @@ }

// Add the parent span ID to the log attributes for trace context
logAttributes['sentry.trace.parent_span_id'] = span.spanContext().spanId;
processedLogAttributes['sentry.trace.parent_span_id'] = span.spanContext().spanId;
}
const processedLog = { ...beforeLog, attributes: processedLogAttributes };
client$1.emit('beforeCaptureLog', processedLog);
const log = beforeSendLog ? beforeSendLog(processedLog) : processedLog;
if (!log) {
client$1.recordDroppedEvent('before_send', 'log_item', 1);
debugBuild.DEBUG_BUILD && logger.logger.warn('beforeSendLog returned null, log will not be captured.');
return;
}
const { level, message, attributes = {}, severityNumber } = log;
const serializedLog = {

@@ -138,3 +141,3 @@ severityText: level,

},
attributes: Object.entries(logAttributes).map(([key, value]) => logAttributeToSerializedLogAttribute(key, value)),
attributes: Object.entries(attributes).map(([key, value]) => logAttributeToSerializedLogAttribute(key, value)),
timeUnixNano: `${new Date().getTime().toString()}000000`,

@@ -141,0 +144,0 @@ traceId: traceContext?.trace_id,

@@ -96,2 +96,6 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });

try {
if (options.shouldSend && (await options.shouldSend(envelope$1)) === false) {
throw new Error('Envelope not sent because `shouldSend` callback returned false');
}
const result = await transport.send(envelope$1);

@@ -98,0 +102,0 @@

@@ -5,5 +5,5 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });

const SDK_VERSION = "9.12.0" ;
const SDK_VERSION = "9.13.0" ;
exports.SDK_VERSION = SDK_VERSION;
//# sourceMappingURL=version.js.map

@@ -57,5 +57,7 @@ export { registerSpanErrorInstrumentation } from './tracing/errors.js';

export { thirdPartyErrorFilterIntegration } from './integrations/third-party-errors-filter.js';
export { consoleIntegration } from './integrations/console.js';
export { profiler } from './profiling.js';
export { instrumentFetchRequest } from './fetch.js';
export { trpcMiddleware } from './trpc.js';
export { wrapMcpServerWithSentry } from './mcp-server.js';
export { captureFeedback } from './feedback.js';

@@ -62,0 +64,0 @@ export { _INTERNAL_captureLog, _INTERNAL_flushLogsBuffer } from './logs/exports.js';

@@ -83,25 +83,14 @@ import { _getTraceInfoFromScope } from '../client.js';

client.emit('beforeCaptureLog', beforeLog);
const log = beforeSendLog ? beforeSendLog(beforeLog) : beforeLog;
if (!log) {
client.recordDroppedEvent('before_send', 'log_item', 1);
DEBUG_BUILD && logger.warn('beforeSendLog returned null, log will not be captured.');
return;
}
const [, traceContext] = _getTraceInfoFromScope(client, scope);
const { level, message, attributes, severityNumber } = log;
const logAttributes = {
...attributes,
const processedLogAttributes = {
...beforeLog.attributes,
};
if (release) {
logAttributes['sentry.release'] = release;
processedLogAttributes['sentry.release'] = release;
}
if (environment) {
logAttributes['sentry.environment'] = environment;
processedLogAttributes['sentry.environment'] = environment;
}

@@ -111,11 +100,12 @@

if (sdk) {
logAttributes['sentry.sdk.name'] = sdk.name;
logAttributes['sentry.sdk.version'] = sdk.version;
processedLogAttributes['sentry.sdk.name'] = sdk.name;
processedLogAttributes['sentry.sdk.version'] = sdk.version;
}
if (isParameterizedString(message)) {
const { __sentry_template_string__, __sentry_template_values__ = [] } = message;
logAttributes['sentry.message.template'] = __sentry_template_string__;
const beforeLogMessage = beforeLog.message;
if (isParameterizedString(beforeLogMessage)) {
const { __sentry_template_string__, __sentry_template_values__ = [] } = beforeLogMessage;
processedLogAttributes['sentry.message.template'] = __sentry_template_string__;
__sentry_template_values__.forEach((param, index) => {
logAttributes[`sentry.message.parameter.${index}`] = param;
processedLogAttributes[`sentry.message.parameter.${index}`] = param;
});

@@ -127,5 +117,18 @@ }

// Add the parent span ID to the log attributes for trace context
logAttributes['sentry.trace.parent_span_id'] = span.spanContext().spanId;
processedLogAttributes['sentry.trace.parent_span_id'] = span.spanContext().spanId;
}
const processedLog = { ...beforeLog, attributes: processedLogAttributes };
client.emit('beforeCaptureLog', processedLog);
const log = beforeSendLog ? beforeSendLog(processedLog) : processedLog;
if (!log) {
client.recordDroppedEvent('before_send', 'log_item', 1);
DEBUG_BUILD && logger.warn('beforeSendLog returned null, log will not be captured.');
return;
}
const { level, message, attributes = {}, severityNumber } = log;
const serializedLog = {

@@ -136,3 +139,3 @@ severityText: level,

},
attributes: Object.entries(logAttributes).map(([key, value]) => logAttributeToSerializedLogAttribute(key, value)),
attributes: Object.entries(attributes).map(([key, value]) => logAttributeToSerializedLogAttribute(key, value)),
timeUnixNano: `${new Date().getTime().toString()}000000`,

@@ -139,0 +142,0 @@ traceId: traceContext?.trace_id,

@@ -1,1 +0,1 @@

{"type":"module","version":"9.12.0","sideEffects":false}
{"type":"module","version":"9.13.0","sideEffects":false}

@@ -94,2 +94,6 @@ import { DEBUG_BUILD } from '../debug-build.js';

try {
if (options.shouldSend && (await options.shouldSend(envelope)) === false) {
throw new Error('Envelope not sent because `shouldSend` callback returned false');
}
const result = await transport.send(envelope);

@@ -96,0 +100,0 @@

// This is a magic string replaced by rollup
const SDK_VERSION = "9.12.0" ;
const SDK_VERSION = "9.13.0" ;
export { SDK_VERSION };
//# sourceMappingURL=version.js.map

@@ -56,5 +56,7 @@ export { ClientClass as SentryCoreCurrentScopes } from './sdk';

export { thirdPartyErrorFilterIntegration } from './integrations/third-party-errors-filter';
export { consoleIntegration } from './integrations/console';
export { profiler } from './profiling';
export { instrumentFetchRequest } from './fetch';
export { trpcMiddleware } from './trpc';
export { wrapMcpServerWithSentry } from './mcp-server';
export { captureFeedback } from './feedback';

@@ -61,0 +63,0 @@ export { ReportDialogOptions } from './report-dialog';

@@ -29,4 +29,14 @@ import { Envelope, InternalBaseTransportOptions, Transport } from '../types-hoist';

* @param retryDelay The current retry delay in milliseconds.
* @returns Whether the envelope should be stored.
*/
shouldStore?: (envelope: Envelope, error: Error, retryDelay: number) => boolean | Promise<boolean>;
/**
* Should an attempt be made to send the envelope to Sentry.
*
* If this function is supplied and returns false, `shouldStore` will be called to determine if the envelope should be stored.
*
* @param envelope The envelope that will be sent.
* @returns Whether we should attempt to send the envelope
*/
shouldSend?: (envelope: Envelope) => boolean | Promise<boolean>;
}

@@ -33,0 +43,0 @@ /**

@@ -56,5 +56,7 @@ export type { ClientClass as SentryCoreCurrentScopes } from './sdk';

export { thirdPartyErrorFilterIntegration } from './integrations/third-party-errors-filter';
export { consoleIntegration } from './integrations/console';
export { profiler } from './profiling';
export { instrumentFetchRequest } from './fetch';
export { trpcMiddleware } from './trpc';
export { wrapMcpServerWithSentry } from './mcp-server';
export { captureFeedback } from './feedback';

@@ -61,0 +63,0 @@ export type { ReportDialogOptions } from './report-dialog';

@@ -29,4 +29,14 @@ import type { Envelope, InternalBaseTransportOptions, Transport } from '../types-hoist';

* @param retryDelay The current retry delay in milliseconds.
* @returns Whether the envelope should be stored.
*/
shouldStore?: (envelope: Envelope, error: Error, retryDelay: number) => boolean | Promise<boolean>;
/**
* Should an attempt be made to send the envelope to Sentry.
*
* If this function is supplied and returns false, `shouldStore` will be called to determine if the envelope should be stored.
*
* @param envelope The envelope that will be sent.
* @returns Whether we should attempt to send the envelope
*/
shouldSend?: (envelope: Envelope) => boolean | Promise<boolean>;
}

@@ -33,0 +43,0 @@ /**

{
"name": "@sentry/core",
"version": "9.12.0",
"version": "9.13.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