🚀 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.12.0

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

const headers = fetchOptionsObj.headers || (isRequest(request) ? request.headers : undefined);
const headers = fetchOptionsObj.headers || (is.isRequest(request) ? request.headers : undefined);

@@ -225,6 +225,2 @@ if (!headers) {

function isRequest(request) {
return typeof Request !== 'undefined' && is.isInstanceOf(request, Request);
}
function isHeaders(headers) {

@@ -231,0 +227,0 @@ return typeof Headers !== 'undefined' && is.isInstanceOf(headers, Headers);

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

const integration = require('../integration.js');
const semanticAttributes = require('../semanticAttributes.js');
const worldwide = require('../utils-hoist/worldwide.js');

@@ -18,2 +19,6 @@ require('../utils-hoist/debug-build.js');

const DEFAULT_ATTRIBUTES = {
[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.console.logging',
};
const _consoleLoggingIntegration = ((options = {}) => {

@@ -40,3 +45,3 @@ const levels = options.levels || logger.CONSOLE_LEVELS;

followingArgs.length > 0 ? `Assertion failed: ${formatConsoleArgs(followingArgs)}` : 'Assertion failed';
exports$1._INTERNAL_captureLog({ level: 'error', message });
exports$1._INTERNAL_captureLog({ level: 'error', message, attributes: DEFAULT_ATTRIBUTES });
}

@@ -51,2 +56,3 @@ return;

severityNumber: isLevelLog ? 10 : undefined,
attributes: DEFAULT_ATTRIBUTES,
});

@@ -53,0 +59,0 @@ });

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

if (release) {
logAttributes.release = release;
logAttributes['sentry.release'] = release;
}
if (environment) {
logAttributes.environment = environment;
logAttributes['sentry.environment'] = environment;
}
const { sdk } = client$1.getSdkMetadata() ?? {};
if (sdk) {
logAttributes['sentry.sdk.name'] = sdk.name;
logAttributes['sentry.sdk.version'] = sdk.version;
}
if (is.isParameterizedString(message)) {

@@ -115,3 +121,3 @@ const { __sentry_template_string__, __sentry_template_values__ = [] } = message;

__sentry_template_values__.forEach((param, index) => {
logAttributes[`sentry.message.param.${index}`] = param;
logAttributes[`sentry.message.parameter.${index}`] = param;
});

@@ -171,2 +177,4 @@ }

client.emit('flushLogs');
// sendEnvelope should not throw

@@ -173,0 +181,0 @@ // eslint-disable-next-line @typescript-eslint/no-floating-promises

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

// TODO: Make this configurable
const DEFAULT_LOG_FLUSH_INTERVAL = 5000;
/**

@@ -40,5 +43,5 @@ * The Sentry Server Runtime Client SDK.

const client = this;
client.on('flush', () => {
exports$1._INTERNAL_flushLogsBuffer(client);
client.on('flushLogs', () => {
client._logWeight = 0;
clearTimeout(client._logFlushIdleTimeout);
});

@@ -54,3 +57,7 @@

exports$1._INTERNAL_flushLogsBuffer(client);
client._logWeight = 0;
} else {
// start an idle timeout to flush the logs buffer if no logs are captured for a while
client._logFlushIdleTimeout = setTimeout(() => {
exports$1._INTERNAL_flushLogsBuffer(client);
}, DEFAULT_LOG_FLUSH_INTERVAL);
}

@@ -57,0 +64,0 @@ });

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

recordEnvelopeLoss('network_error');
debugBuild.DEBUG_BUILD && logger.logger.error('Encountered error running transport request:', error);
throw error;

@@ -70,0 +71,0 @@ },

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

virtualError,
headers: getHeadersFromFetchArgs(args),
};

@@ -255,2 +256,25 @@

function getHeadersFromFetchArgs(fetchArgs) {
const [requestArgument, optionsArgument] = fetchArgs;
try {
if (
typeof optionsArgument === 'object' &&
optionsArgument !== null &&
'headers' in optionsArgument &&
optionsArgument.headers
) {
return new Headers(optionsArgument.headers );
}
if (is.isRequest(requestArgument)) {
return new Headers(requestArgument.headers);
}
} catch {
// noop
}
return;
}
exports.addFetchEndInstrumentationHandler = addFetchEndInstrumentationHandler;

@@ -257,0 +281,0 @@ exports.addFetchInstrumentationHandler = addFetchInstrumentationHandler;

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

/**
* Checks whether the given parameter is a Standard Web API Request instance.
*
* Returns false if Request is not available in the current runtime.
*/
function isRequest(request) {
return typeof Request !== 'undefined' && isInstanceOf(request, Request);
}
exports.isDOMError = isDOMError;

@@ -209,2 +218,3 @@ exports.isDOMException = isDOMException;

exports.isRegExp = isRegExp;
exports.isRequest = isRequest;
exports.isString = isString;

@@ -211,0 +221,0 @@ exports.isSyntheticEvent = isSyntheticEvent;

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

const SDK_VERSION = "9.11.0" ;
const SDK_VERSION = "9.12.0" ;
exports.SDK_VERSION = SDK_VERSION;
//# sourceMappingURL=version.js.map
import { getClient } from './currentScopes.js';
import { SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from './semanticAttributes.js';
import './tracing/errors.js';
import { isInstanceOf } from './utils-hoist/is.js';
import { isRequest, isInstanceOf } from './utils-hoist/is.js';
import './utils-hoist/debug-build.js';

@@ -222,6 +222,2 @@ import './utils-hoist/logger.js';

function isRequest(request) {
return typeof Request !== 'undefined' && isInstanceOf(request, Request);
}
function isHeaders(headers) {

@@ -228,0 +224,0 @@ return typeof Headers !== 'undefined' && isInstanceOf(headers, Headers);

import { getClient } from '../currentScopes.js';
import { DEBUG_BUILD } from '../debug-build.js';
import { defineIntegration } from '../integration.js';
import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '../semanticAttributes.js';
import { GLOBAL_OBJ } from '../utils-hoist/worldwide.js';

@@ -15,2 +16,6 @@ import '../utils-hoist/debug-build.js';

const DEFAULT_ATTRIBUTES = {
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.console.logging',
};
const _consoleLoggingIntegration = ((options = {}) => {

@@ -37,3 +42,3 @@ const levels = options.levels || CONSOLE_LEVELS;

followingArgs.length > 0 ? `Assertion failed: ${formatConsoleArgs(followingArgs)}` : 'Assertion failed';
_INTERNAL_captureLog({ level: 'error', message });
_INTERNAL_captureLog({ level: 'error', message, attributes: DEFAULT_ATTRIBUTES });
}

@@ -48,2 +53,3 @@ return;

severityNumber: isLevelLog ? 10 : undefined,
attributes: DEFAULT_ATTRIBUTES,
});

@@ -50,0 +56,0 @@ });

@@ -101,9 +101,15 @@ import { _getTraceInfoFromScope } from '../client.js';

if (release) {
logAttributes.release = release;
logAttributes['sentry.release'] = release;
}
if (environment) {
logAttributes.environment = environment;
logAttributes['sentry.environment'] = environment;
}
const { sdk } = client.getSdkMetadata() ?? {};
if (sdk) {
logAttributes['sentry.sdk.name'] = sdk.name;
logAttributes['sentry.sdk.version'] = sdk.version;
}
if (isParameterizedString(message)) {

@@ -113,3 +119,3 @@ const { __sentry_template_string__, __sentry_template_values__ = [] } = message;

__sentry_template_values__.forEach((param, index) => {
logAttributes[`sentry.message.param.${index}`] = param;
logAttributes[`sentry.message.parameter.${index}`] = param;
});

@@ -169,2 +175,4 @@ }

client.emit('flushLogs');
// sendEnvelope should not throw

@@ -171,0 +179,0 @@ // eslint-disable-next-line @typescript-eslint/no-floating-promises

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

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

@@ -15,2 +15,5 @@ import { createCheckInEnvelope } from './checkin.js';

// TODO: Make this configurable
const DEFAULT_LOG_FLUSH_INTERVAL = 5000;
/**

@@ -38,5 +41,5 @@ * The Sentry Server Runtime Client SDK.

const client = this;
client.on('flush', () => {
_INTERNAL_flushLogsBuffer(client);
client.on('flushLogs', () => {
client._logWeight = 0;
clearTimeout(client._logFlushIdleTimeout);
});

@@ -52,3 +55,7 @@

_INTERNAL_flushLogsBuffer(client);
client._logWeight = 0;
} else {
// start an idle timeout to flush the logs buffer if no logs are captured for a while
client._logFlushIdleTimeout = setTimeout(() => {
_INTERNAL_flushLogsBuffer(client);
}, DEFAULT_LOG_FLUSH_INTERVAL);
}

@@ -55,0 +62,0 @@ });

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

recordEnvelopeLoss('network_error');
DEBUG_BUILD && logger.error('Encountered error running transport request:', error);
throw error;

@@ -68,0 +69,0 @@ },

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

import { isError } from '../is.js';
import { isError, isRequest } from '../is.js';
import { fill, addNonEnumerableProperty } from '../object.js';

@@ -65,2 +65,3 @@ import { supportsNativeFetch } from '../supports.js';

virtualError,
headers: getHeadersFromFetchArgs(args),
};

@@ -253,3 +254,26 @@

function getHeadersFromFetchArgs(fetchArgs) {
const [requestArgument, optionsArgument] = fetchArgs;
try {
if (
typeof optionsArgument === 'object' &&
optionsArgument !== null &&
'headers' in optionsArgument &&
optionsArgument.headers
) {
return new Headers(optionsArgument.headers );
}
if (isRequest(requestArgument)) {
return new Headers(requestArgument.headers);
}
} catch {
// noop
}
return;
}
export { addFetchEndInstrumentationHandler, addFetchInstrumentationHandler, parseFetchArgs };
//# sourceMappingURL=fetch.js.map

@@ -195,3 +195,12 @@ // eslint-disable-next-line @typescript-eslint/unbound-method

export { isDOMError, isDOMException, isElement, isError, isErrorEvent, isEvent, isInstanceOf, isParameterizedString, isPlainObject, isPrimitive, isRegExp, isString, isSyntheticEvent, isThenable, isVueViewModel };
/**
* Checks whether the given parameter is a Standard Web API Request instance.
*
* Returns false if Request is not available in the current runtime.
*/
function isRequest(request) {
return typeof Request !== 'undefined' && isInstanceOf(request, Request);
}
export { isDOMError, isDOMException, isElement, isError, isErrorEvent, isEvent, isInstanceOf, isParameterizedString, isPlainObject, isPrimitive, isRegExp, isRequest, isString, isSyntheticEvent, isThenable, isVueViewModel };
//# sourceMappingURL=is.js.map
// This is a magic string replaced by rollup
const SDK_VERSION = "9.11.0" ;
const SDK_VERSION = "9.12.0" ;
export { SDK_VERSION };
//# sourceMappingURL=version.js.map

@@ -302,2 +302,8 @@ import { Breadcrumb, BreadcrumbHint, CheckIn, ClientOptions, DataCategory, DsnComponents, DynamicSamplingContext, Envelope, Event, EventDropReason, EventHint, EventProcessor, FeedbackEvent, FetchBreadcrumbHint, Integration, Log, MonitorConfig, Outcome, ParameterizedString, SdkMetadata, Session, SessionAggregates, SeverityLevel, Span, SpanAttributes, SpanContextData, StartSpanOptions, TraceContext, Transport, TransportMakeRequestResponse, XhrBreadcrumbHint } from './types-hoist';

on(hook: 'afterCaptureLog', callback: (log: Log) => void): () => void;
/**
* A hook that is called when the client is flushing logs
*
* @returns {() => void} A function that, when executed, removes the registered callback.
*/
on(hook: 'flushLogs', callback: () => void): () => void;
/** Fire a hook whenever a span starts. */

@@ -400,2 +406,6 @@ emit(hook: 'spanStart', span: Span): void;

/**
* Emit a hook event for client flush logs
*/
emit(hook: 'flushLogs'): void;
/**
* Send an envelope to Sentry.

@@ -402,0 +412,0 @@ */

@@ -16,2 +16,3 @@ import { BaseTransportOptions, CheckIn, ClientOptions, Event, EventHint, MonitorConfig, ParameterizedString, SeverityLevel } from './types-hoist';

export declare class ServerRuntimeClient<O extends ClientOptions & ServerRuntimeClientOptions = ServerRuntimeClientOptions> extends Client<O> {
private _logFlushIdleTimeout;
private _logWeight;

@@ -18,0 +19,0 @@ /**

@@ -51,12 +51,2 @@ import { Primitive } from '../misc';

/**
* _experiments allows users to enable experimental or internal features.
* We don't consider such features as part of the public API and hence we don't guarantee semver for them.
* Experimental features can be added, changed or removed at any time.
*
* Default: undefined
*/
_experiments: Partial<{
annotations: boolean;
}>;
/**
* Set an object that will be merged sent as tags data with the event.

@@ -63,0 +53,0 @@ */

@@ -47,2 +47,4 @@ import { WebFetchHeaders } from './webfetchapi';

virtualError?: unknown;
/** Headers that the user passed to the fetch request. */
headers?: WebFetchHeaders;
}

@@ -49,0 +51,0 @@ export interface HandlerDataDom {

@@ -119,2 +119,8 @@ import { ParameterizedString, PolymorphicEvent, Primitive } from '../types-hoist';

export declare function isVueViewModel(wat: unknown): boolean;
/**
* Checks whether the given parameter is a Standard Web API Request instance.
*
* Returns false if Request is not available in the current runtime.
*/
export declare function isRequest(request: unknown): request is Request;
//# sourceMappingURL=is.d.ts.map

@@ -302,2 +302,8 @@ import type { Breadcrumb, BreadcrumbHint, CheckIn, ClientOptions, DataCategory, DsnComponents, DynamicSamplingContext, Envelope, Event, EventDropReason, EventHint, EventProcessor, FeedbackEvent, FetchBreadcrumbHint, Integration, Log, MonitorConfig, Outcome, ParameterizedString, SdkMetadata, Session, SessionAggregates, SeverityLevel, Span, SpanAttributes, SpanContextData, StartSpanOptions, TraceContext, Transport, TransportMakeRequestResponse, XhrBreadcrumbHint } from './types-hoist';

on(hook: 'afterCaptureLog', callback: (log: Log) => void): () => void;
/**
* A hook that is called when the client is flushing logs
*
* @returns {() => void} A function that, when executed, removes the registered callback.
*/
on(hook: 'flushLogs', callback: () => void): () => void;
/** Fire a hook whenever a span starts. */

@@ -400,2 +406,6 @@ emit(hook: 'spanStart', span: Span): void;

/**
* Emit a hook event for client flush logs
*/
emit(hook: 'flushLogs'): void;
/**
* Send an envelope to Sentry.

@@ -402,0 +412,0 @@ */

@@ -16,2 +16,3 @@ import type { BaseTransportOptions, CheckIn, ClientOptions, Event, EventHint, MonitorConfig, ParameterizedString, SeverityLevel } from './types-hoist';

export declare class ServerRuntimeClient<O extends ClientOptions & ServerRuntimeClientOptions = ServerRuntimeClientOptions> extends Client<O> {
private _logFlushIdleTimeout;
private _logWeight;

@@ -18,0 +19,0 @@ /**

@@ -51,12 +51,2 @@ import type { Primitive } from '../misc';

/**
* _experiments allows users to enable experimental or internal features.
* We don't consider such features as part of the public API and hence we don't guarantee semver for them.
* Experimental features can be added, changed or removed at any time.
*
* Default: undefined
*/
_experiments: Partial<{
annotations: boolean;
}>;
/**
* Set an object that will be merged sent as tags data with the event.

@@ -63,0 +53,0 @@ */

@@ -47,2 +47,4 @@ import type { WebFetchHeaders } from './webfetchapi';

virtualError?: unknown;
/** Headers that the user passed to the fetch request. */
headers?: WebFetchHeaders;
}

@@ -49,0 +51,0 @@ export interface HandlerDataDom {

@@ -119,2 +119,8 @@ import type { ParameterizedString, PolymorphicEvent, Primitive } from '../types-hoist';

export declare function isVueViewModel(wat: unknown): boolean;
/**
* Checks whether the given parameter is a Standard Web API Request instance.
*
* Returns false if Request is not available in the current runtime.
*/
export declare function isRequest(request: unknown): request is Request;
//# sourceMappingURL=is.d.ts.map
{
"name": "@sentry/core",
"version": "9.11.0",
"version": "9.12.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