Socket
Socket
Sign inDemoInstall

@sentry/utils

Package Overview
Dependencies
1
Maintainers
11
Versions
467
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 8.0.0-alpha.9 to 8.0.0-beta.1

cjs/instrument/handlers.js

5

cjs/envelope.js

@@ -198,3 +198,4 @@ Object.defineProperty(exports, '__esModule', { value: true });

feedback: 'feedback',
statsd: 'statsd',
span: 'span',
statsd: 'metric_bucket',
};

@@ -209,3 +210,3 @@

/** Extracts the minimal SDK info from from the metadata or an events */
/** Extracts the minimal SDK info from the metadata or an events */
function getSdkMetadataForEnvelopeHeader(metadataOrEvent) {

@@ -212,0 +213,0 @@ if (!metadataOrEvent || !metadataOrEvent.sdk) {

102

cjs/eventbuilder.js

@@ -32,2 +32,16 @@ Object.defineProperty(exports, '__esModule', { value: true });

/** If a plain object has a property that is an `Error`, return this error. */
function getErrorPropertyFromObject(obj) {
for (const prop in obj) {
if (Object.prototype.hasOwnProperty.call(obj, prop)) {
const value = obj[prop];
if (value instanceof Error) {
return value;
}
}
}
return undefined;
}
function getMessageForObject(exception) {

@@ -44,11 +58,65 @@ if ('name' in exception && typeof exception.name === 'string') {

return exception.message;
} else {
// This will allow us to group events based on top-level keys
// which is much better than creating new group when any key/value change
return `Object captured as exception with keys: ${object.extractExceptionKeysForMessage(
exception ,
)}`;
}
const keys = object.extractExceptionKeysForMessage(exception);
// Some ErrorEvent instances do not have an `error` property, which is why they are not handled before
// We still want to try to get a decent message for these cases
if (is.isErrorEvent(exception)) {
return `Event \`ErrorEvent\` captured as exception with message \`${exception.message}\``;
}
const className = getObjectClassName(exception);
return `${
className && className !== 'Object' ? `'${className}'` : 'Object'
} captured as exception with keys: ${keys}`;
}
function getObjectClassName(obj) {
try {
const prototype = Object.getPrototypeOf(obj);
return prototype ? prototype.constructor.name : undefined;
} catch (e) {
// ignore errors here
}
}
function getException(
client,
mechanism,
exception,
hint,
) {
if (is.isError(exception)) {
return [exception, undefined];
}
// Mutate this!
mechanism.synthetic = true;
if (is.isPlainObject(exception)) {
const normalizeDepth = client && client.getOptions().normalizeDepth;
const extras = { ['__serialized__']: normalize.normalizeToSize(exception , normalizeDepth) };
const errorFromProp = getErrorPropertyFromObject(exception);
if (errorFromProp) {
return [errorFromProp, extras];
}
const message = getMessageForObject(exception);
const ex = (hint && hint.syntheticException) || new Error(message);
ex.message = message;
return [ex, extras];
}
// This handles when someone does: `throw "something awesome";`
// We use synthesized Error here so we can extract a (rough) stack trace.
const ex = (hint && hint.syntheticException) || new Error(exception );
ex.message = `${exception}`;
return [ex, undefined];
}
/**

@@ -64,3 +132,2 @@ * Builds and Event from a Exception

) {
let ex = exception;
const providedMechanism =

@@ -73,24 +140,7 @@ hint && hint.data && (hint.data ).mechanism;

let extras;
const [ex, extras] = getException(client, mechanism, exception, hint);
if (!is.isError(exception)) {
if (is.isPlainObject(exception)) {
const normalizeDepth = client && client.getOptions().normalizeDepth;
extras = { ['__serialized__']: normalize.normalizeToSize(exception , normalizeDepth) };
const message = getMessageForObject(exception);
ex = (hint && hint.syntheticException) || new Error(message);
(ex ).message = message;
} else {
// This handles when someone does: `throw "something awesome";`
// We use synthesized Error here so we can extract a (rough) stack trace.
ex = (hint && hint.syntheticException) || new Error(exception );
(ex ).message = exception ;
}
mechanism.synthetic = true;
}
const event = {
exception: {
values: [exceptionFromError(stackParser, ex )],
values: [exceptionFromError(stackParser, ex)],
},

@@ -97,0 +147,0 @@ };

@@ -8,10 +8,7 @@ Object.defineProperty(exports, '__esModule', { value: true });

const worldwide = require('./worldwide.js');
const _handlers = require('./instrument/_handlers.js');
const console = require('./instrument/console.js');
const dom = require('./instrument/dom.js');
const fetch = require('./instrument/fetch.js');
const globalError = require('./instrument/globalError.js');
const globalUnhandledRejection = require('./instrument/globalUnhandledRejection.js');
const history = require('./instrument/history.js');
const xhr = require('./instrument/xhr.js');
const handlers = require('./instrument/handlers.js');
const is = require('./is.js');

@@ -68,11 +65,10 @@ const isBrowser = require('./isBrowser.js');

exports.getGlobalSingleton = worldwide.getGlobalSingleton;
exports.resetInstrumentationHandlers = _handlers.resetInstrumentationHandlers;
exports.addConsoleInstrumentationHandler = console.addConsoleInstrumentationHandler;
exports.addClickKeypressInstrumentationHandler = dom.addClickKeypressInstrumentationHandler;
exports.addFetchInstrumentationHandler = fetch.addFetchInstrumentationHandler;
exports.addGlobalErrorInstrumentationHandler = globalError.addGlobalErrorInstrumentationHandler;
exports.addGlobalUnhandledRejectionInstrumentationHandler = globalUnhandledRejection.addGlobalUnhandledRejectionInstrumentationHandler;
exports.addHistoryInstrumentationHandler = history.addHistoryInstrumentationHandler;
exports.SENTRY_XHR_DATA_KEY = xhr.SENTRY_XHR_DATA_KEY;
exports.addXhrInstrumentationHandler = xhr.addXhrInstrumentationHandler;
exports.addHandler = handlers.addHandler;
exports.maybeInstrument = handlers.maybeInstrument;
exports.resetInstrumentationHandlers = handlers.resetInstrumentationHandlers;
exports.triggerHandlers = handlers.triggerHandlers;
exports.isDOMError = is.isDOMError;

@@ -79,0 +75,0 @@ exports.isDOMException = is.isDOMException;

@@ -6,3 +6,3 @@ Object.defineProperty(exports, '__esModule', { value: true });

const worldwide = require('../worldwide.js');
const _handlers = require('./_handlers.js');
const handlers = require('./handlers.js');

@@ -17,4 +17,4 @@ /**

const type = 'console';
_handlers.addHandler(type, handler);
_handlers.maybeInstrument(type, instrumentConsole);
handlers.addHandler(type, handler);
handlers.maybeInstrument(type, instrumentConsole);
}

@@ -37,3 +37,3 @@

const handlerData = { args, level };
_handlers.triggerHandlers('console', handlerData);
handlers.triggerHandlers('console', handlerData);

@@ -40,0 +40,0 @@ const log = logger.originalConsoleMethods[level];

@@ -6,3 +6,3 @@ Object.defineProperty(exports, '__esModule', { value: true });

const worldwide = require('../worldwide.js');
const _handlers = require('./_handlers.js');
const handlers = require('./handlers.js');

@@ -19,4 +19,4 @@ /**

const type = 'fetch';
_handlers.addHandler(type, handler);
_handlers.maybeInstrument(type, instrumentFetch);
handlers.addHandler(type, handler);
handlers.maybeInstrument(type, instrumentFetch);
}

@@ -42,3 +42,3 @@

_handlers.triggerHandlers('fetch', {
handlers.triggerHandlers('fetch', {
...handlerData,

@@ -56,3 +56,3 @@ });

_handlers.triggerHandlers('fetch', finishedHandlerData);
handlers.triggerHandlers('fetch', finishedHandlerData);
return response;

@@ -67,3 +67,3 @@ },

_handlers.triggerHandlers('fetch', erroredHandlerData);
handlers.triggerHandlers('fetch', erroredHandlerData);
// NOTE: If you are a Sentry user, and you are seeing this stack frame,

@@ -70,0 +70,0 @@ // it means the sentry.javascript SDK caught an error invoking your application code.

Object.defineProperty(exports, '__esModule', { value: true });
const worldwide = require('../worldwide.js');
const _handlers = require('./_handlers.js');
const handlers = require('./handlers.js');

@@ -16,4 +16,4 @@ let _oldOnErrorHandler = null;

const type = 'error';
_handlers.addHandler(type, handler);
_handlers.maybeInstrument(type, instrumentError);
handlers.addHandler(type, handler);
handlers.maybeInstrument(type, instrumentError);
}

@@ -38,3 +38,3 @@

};
_handlers.triggerHandlers('error', handlerData);
handlers.triggerHandlers('error', handlerData);

@@ -41,0 +41,0 @@ if (_oldOnErrorHandler && !_oldOnErrorHandler.__SENTRY_LOADER__) {

Object.defineProperty(exports, '__esModule', { value: true });
const worldwide = require('../worldwide.js');
const _handlers = require('./_handlers.js');
const handlers = require('./handlers.js');

@@ -18,4 +18,4 @@ let _oldOnUnhandledRejectionHandler = null;

const type = 'unhandledrejection';
_handlers.addHandler(type, handler);
_handlers.maybeInstrument(type, instrumentUnhandledRejection);
handlers.addHandler(type, handler);
handlers.maybeInstrument(type, instrumentUnhandledRejection);
}

@@ -28,3 +28,3 @@

const handlerData = e;
_handlers.triggerHandlers('unhandledrejection', handlerData);
handlers.triggerHandlers('unhandledrejection', handlerData);

@@ -31,0 +31,0 @@ if (_oldOnUnhandledRejectionHandler && !_oldOnUnhandledRejectionHandler.__SENTRY_LOADER__) {

@@ -34,4 +34,4 @@ Object.defineProperty(exports, '__esModule', { value: true });

*/
function disabledUntil(limits, category) {
return limits[category] || limits.all || 0;
function disabledUntil(limits, dataCategory) {
return limits[dataCategory] || limits.all || 0;
}

@@ -42,4 +42,4 @@

*/
function isRateLimited(limits, category, now = Date.now()) {
return disabledUntil(limits, category) > now;
function isRateLimited(limits, dataCategory, now = Date.now()) {
return disabledUntil(limits, dataCategory) > now;
}

@@ -71,3 +71,3 @@

* where each <header> is of the form
* <retry_after>: <categories>: <scope>: <reason_code>
* <retry_after>: <categories>: <scope>: <reason_code>: <namespaces>
* where

@@ -79,5 +79,7 @@ * <retry_after> is a delay in seconds

* <reason_code> is an arbitrary string like "org_quota" - ignored by SDK
* <namespaces> Semicolon-separated list of metric namespace identifiers. Defines which namespace(s) will be affected.
* Only present if rate limit applies to the metric_bucket data category.
*/
for (const limit of rateLimitHeader.trim().split(',')) {
const [retryAfter, categories] = limit.split(':', 2);
const [retryAfter, categories, , , namespaces] = limit.split(':', 5);
const headerDelay = parseInt(retryAfter, 10);

@@ -89,3 +91,10 @@ const delay = (!isNaN(headerDelay) ? headerDelay : 60) * 1000; // 60sec default

for (const category of categories.split(';')) {
updatedRateLimits[category] = now + delay;
if (category === 'metric_bucket') {
// namespaces will be present when category === 'metric_bucket'
if (!namespaces || namespaces.split(';').includes('custom')) {
updatedRateLimits[category] = now + delay;
}
} else {
updatedRateLimits[category] = now + delay;
}
}

@@ -92,0 +101,0 @@ }

@@ -270,3 +270,3 @@ Object.defineProperty(exports, '__esModule', { value: true });

if (include.transaction && !event.transaction) {
if (include.transaction && !event.transaction && event.type === 'transaction') {
// TODO do we even need this anymore?

@@ -273,0 +273,0 @@ // TODO make this work for nextjs

@@ -196,3 +196,4 @@ import { dsnToString } from './dsn.js';

feedback: 'feedback',
statsd: 'statsd',
span: 'span',
statsd: 'metric_bucket',
};

@@ -207,3 +208,3 @@

/** Extracts the minimal SDK info from from the metadata or an events */
/** Extracts the minimal SDK info from the metadata or an events */
function getSdkMetadataForEnvelopeHeader(metadataOrEvent) {

@@ -210,0 +211,0 @@ if (!metadataOrEvent || !metadataOrEvent.sdk) {

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

import { isError, isPlainObject, isParameterizedString } from './is.js';
import { isParameterizedString, isError, isPlainObject, isErrorEvent } from './is.js';
import { addExceptionTypeValue, addExceptionMechanism } from './misc.js';

@@ -30,2 +30,16 @@ import { normalizeToSize } from './normalize.js';

/** If a plain object has a property that is an `Error`, return this error. */
function getErrorPropertyFromObject(obj) {
for (const prop in obj) {
if (Object.prototype.hasOwnProperty.call(obj, prop)) {
const value = obj[prop];
if (value instanceof Error) {
return value;
}
}
}
return undefined;
}
function getMessageForObject(exception) {

@@ -42,11 +56,65 @@ if ('name' in exception && typeof exception.name === 'string') {

return exception.message;
} else {
// This will allow us to group events based on top-level keys
// which is much better than creating new group when any key/value change
return `Object captured as exception with keys: ${extractExceptionKeysForMessage(
exception ,
)}`;
}
const keys = extractExceptionKeysForMessage(exception);
// Some ErrorEvent instances do not have an `error` property, which is why they are not handled before
// We still want to try to get a decent message for these cases
if (isErrorEvent(exception)) {
return `Event \`ErrorEvent\` captured as exception with message \`${exception.message}\``;
}
const className = getObjectClassName(exception);
return `${
className && className !== 'Object' ? `'${className}'` : 'Object'
} captured as exception with keys: ${keys}`;
}
function getObjectClassName(obj) {
try {
const prototype = Object.getPrototypeOf(obj);
return prototype ? prototype.constructor.name : undefined;
} catch (e) {
// ignore errors here
}
}
function getException(
client,
mechanism,
exception,
hint,
) {
if (isError(exception)) {
return [exception, undefined];
}
// Mutate this!
mechanism.synthetic = true;
if (isPlainObject(exception)) {
const normalizeDepth = client && client.getOptions().normalizeDepth;
const extras = { ['__serialized__']: normalizeToSize(exception , normalizeDepth) };
const errorFromProp = getErrorPropertyFromObject(exception);
if (errorFromProp) {
return [errorFromProp, extras];
}
const message = getMessageForObject(exception);
const ex = (hint && hint.syntheticException) || new Error(message);
ex.message = message;
return [ex, extras];
}
// This handles when someone does: `throw "something awesome";`
// We use synthesized Error here so we can extract a (rough) stack trace.
const ex = (hint && hint.syntheticException) || new Error(exception );
ex.message = `${exception}`;
return [ex, undefined];
}
/**

@@ -62,3 +130,2 @@ * Builds and Event from a Exception

) {
let ex = exception;
const providedMechanism =

@@ -71,24 +138,7 @@ hint && hint.data && (hint.data ).mechanism;

let extras;
const [ex, extras] = getException(client, mechanism, exception, hint);
if (!isError(exception)) {
if (isPlainObject(exception)) {
const normalizeDepth = client && client.getOptions().normalizeDepth;
extras = { ['__serialized__']: normalizeToSize(exception , normalizeDepth) };
const message = getMessageForObject(exception);
ex = (hint && hint.syntheticException) || new Error(message);
(ex ).message = message;
} else {
// This handles when someone does: `throw "something awesome";`
// We use synthesized Error here so we can extract a (rough) stack trace.
ex = (hint && hint.syntheticException) || new Error(exception );
(ex ).message = exception ;
}
mechanism.synthetic = true;
}
const event = {
exception: {
values: [exceptionFromError(stackParser, ex )],
values: [exceptionFromError(stackParser, ex)],
},

@@ -95,0 +145,0 @@ };

@@ -6,10 +6,7 @@ export { applyAggregateErrorsToEvent } from './aggregate-errors.js';

export { GLOBAL_OBJ, getGlobalSingleton } from './worldwide.js';
export { resetInstrumentationHandlers } from './instrument/_handlers.js';
export { addConsoleInstrumentationHandler } from './instrument/console.js';
export { addClickKeypressInstrumentationHandler } from './instrument/dom.js';
export { addFetchInstrumentationHandler } from './instrument/fetch.js';
export { addGlobalErrorInstrumentationHandler } from './instrument/globalError.js';
export { addGlobalUnhandledRejectionInstrumentationHandler } from './instrument/globalUnhandledRejection.js';
export { addHistoryInstrumentationHandler } from './instrument/history.js';
export { SENTRY_XHR_DATA_KEY, addXhrInstrumentationHandler } from './instrument/xhr.js';
export { addHandler, maybeInstrument, resetInstrumentationHandlers, triggerHandlers } from './instrument/handlers.js';
export { isDOMError, isDOMException, isElement, isError, isErrorEvent, isEvent, isInstanceOf, isParameterizedString, isPlainObject, isPrimitive, isRegExp, isString, isSyntheticEvent, isThenable, isVueViewModel } from './is.js';

@@ -16,0 +13,0 @@ export { isBrowser } from './isBrowser.js';

import { CONSOLE_LEVELS, originalConsoleMethods } from '../logger.js';
import { fill } from '../object.js';
import { GLOBAL_OBJ } from '../worldwide.js';
import { addHandler, maybeInstrument, triggerHandlers } from './_handlers.js';
import { addHandler, maybeInstrument, triggerHandlers } from './handlers.js';

@@ -6,0 +6,0 @@ /**

import { fill } from '../object.js';
import { supportsNativeFetch } from '../supports.js';
import { GLOBAL_OBJ } from '../worldwide.js';
import { addHandler, maybeInstrument, triggerHandlers } from './_handlers.js';
import { addHandler, maybeInstrument, triggerHandlers } from './handlers.js';

@@ -6,0 +6,0 @@ /**

import { GLOBAL_OBJ } from '../worldwide.js';
import { addHandler, maybeInstrument, triggerHandlers } from './_handlers.js';
import { addHandler, maybeInstrument, triggerHandlers } from './handlers.js';

@@ -4,0 +4,0 @@ let _oldOnErrorHandler = null;

import { GLOBAL_OBJ } from '../worldwide.js';
import { addHandler, maybeInstrument, triggerHandlers } from './_handlers.js';
import { addHandler, maybeInstrument, triggerHandlers } from './handlers.js';

@@ -4,0 +4,0 @@ let _oldOnUnhandledRejectionHandler = null;

@@ -32,4 +32,4 @@ // Intentionally keeping the key broad, as we don't know for sure what rate limit headers get returned from backend

*/
function disabledUntil(limits, category) {
return limits[category] || limits.all || 0;
function disabledUntil(limits, dataCategory) {
return limits[dataCategory] || limits.all || 0;
}

@@ -40,4 +40,4 @@

*/
function isRateLimited(limits, category, now = Date.now()) {
return disabledUntil(limits, category) > now;
function isRateLimited(limits, dataCategory, now = Date.now()) {
return disabledUntil(limits, dataCategory) > now;
}

@@ -69,3 +69,3 @@

* where each <header> is of the form
* <retry_after>: <categories>: <scope>: <reason_code>
* <retry_after>: <categories>: <scope>: <reason_code>: <namespaces>
* where

@@ -77,5 +77,7 @@ * <retry_after> is a delay in seconds

* <reason_code> is an arbitrary string like "org_quota" - ignored by SDK
* <namespaces> Semicolon-separated list of metric namespace identifiers. Defines which namespace(s) will be affected.
* Only present if rate limit applies to the metric_bucket data category.
*/
for (const limit of rateLimitHeader.trim().split(',')) {
const [retryAfter, categories] = limit.split(':', 2);
const [retryAfter, categories, , , namespaces] = limit.split(':', 5);
const headerDelay = parseInt(retryAfter, 10);

@@ -87,3 +89,10 @@ const delay = (!isNaN(headerDelay) ? headerDelay : 60) * 1000; // 60sec default

for (const category of categories.split(';')) {
updatedRateLimits[category] = now + delay;
if (category === 'metric_bucket') {
// namespaces will be present when category === 'metric_bucket'
if (!namespaces || namespaces.split(';').includes('custom')) {
updatedRateLimits[category] = now + delay;
}
} else {
updatedRateLimits[category] = now + delay;
}
}

@@ -90,0 +99,0 @@ }

@@ -268,3 +268,3 @@ import { parseCookie } from './cookie.js';

if (include.transaction && !event.transaction) {
if (include.transaction && !event.transaction && event.type === 'transaction') {
// TODO do we even need this anymore?

@@ -271,0 +271,0 @@ // TODO make this work for nextjs

{
"name": "@sentry/utils",
"version": "8.0.0-alpha.9",
"version": "8.0.0-beta.1",
"description": "Utilities for all Sentry JavaScript SDKs",

@@ -45,3 +45,3 @@ "repository": "git://github.com/getsentry/sentry-javascript.git",

"dependencies": {
"@sentry/types": "8.0.0-alpha.9"
"@sentry/types": "8.0.0-beta.1"
},

@@ -48,0 +48,0 @@ "devDependencies": {

@@ -41,3 +41,3 @@ import { Attachment, AttachmentItem, DataCategory, DsnComponents, Envelope, EnvelopeItemType, Event, EventEnvelopeHeaders, SdkInfo, SdkMetadata } from '@sentry/types';

export declare function envelopeItemTypeToDataCategory(type: EnvelopeItemType): DataCategory;
/** Extracts the minimal SDK info from from the metadata or an events */
/** Extracts the minimal SDK info from the metadata or an events */
export declare function getSdkMetadataForEnvelopeHeader(metadataOrEvent?: SdkMetadata | Event): SdkInfo | undefined;

@@ -44,0 +44,0 @@ /**

@@ -1,10 +0,7 @@

import { resetInstrumentationHandlers } from './_handlers';
import { addConsoleInstrumentationHandler } from './console';
import { addClickKeypressInstrumentationHandler } from './dom';
import { addFetchInstrumentationHandler } from './fetch';
import { addGlobalErrorInstrumentationHandler } from './globalError';
import { addGlobalUnhandledRejectionInstrumentationHandler } from './globalUnhandledRejection';
import { addHistoryInstrumentationHandler } from './history';
import { SENTRY_XHR_DATA_KEY, addXhrInstrumentationHandler } from './xhr';
export { addConsoleInstrumentationHandler, addClickKeypressInstrumentationHandler, addXhrInstrumentationHandler, addFetchInstrumentationHandler, addHistoryInstrumentationHandler, addGlobalErrorInstrumentationHandler, addGlobalUnhandledRejectionInstrumentationHandler, SENTRY_XHR_DATA_KEY, resetInstrumentationHandlers, };
import { addHandler, maybeInstrument, resetInstrumentationHandlers, triggerHandlers } from './handlers';
export { addConsoleInstrumentationHandler, addFetchInstrumentationHandler, addGlobalErrorInstrumentationHandler, addGlobalUnhandledRejectionInstrumentationHandler, addHandler, maybeInstrument, triggerHandlers, resetInstrumentationHandlers, };
//# sourceMappingURL=index.d.ts.map

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

import { TransportMakeRequestResponse } from '@sentry/types';
import { DataCategory, TransportMakeRequestResponse } from '@sentry/types';
export type RateLimits = Record<string, number>;

@@ -18,7 +18,7 @@ export declare const DEFAULT_RETRY_AFTER: number;

*/
export declare function disabledUntil(limits: RateLimits, category: string): number;
export declare function disabledUntil(limits: RateLimits, dataCategory: DataCategory): number;
/**
* Checks if a category is rate limited
*/
export declare function isRateLimited(limits: RateLimits, category: string, now?: number): boolean;
export declare function isRateLimited(limits: RateLimits, dataCategory: DataCategory, now?: number): boolean;
/**

@@ -25,0 +25,0 @@ * Update ratelimits from incoming headers.

@@ -41,3 +41,3 @@ import type { Attachment, AttachmentItem, DataCategory, DsnComponents, Envelope, EnvelopeItemType, Event, EventEnvelopeHeaders, SdkInfo, SdkMetadata } from '@sentry/types';

export declare function envelopeItemTypeToDataCategory(type: EnvelopeItemType): DataCategory;
/** Extracts the minimal SDK info from from the metadata or an events */
/** Extracts the minimal SDK info from the metadata or an events */
export declare function getSdkMetadataForEnvelopeHeader(metadataOrEvent?: SdkMetadata | Event): SdkInfo | undefined;

@@ -44,0 +44,0 @@ /**

@@ -1,10 +0,7 @@

import { resetInstrumentationHandlers } from './_handlers';
import { addConsoleInstrumentationHandler } from './console';
import { addClickKeypressInstrumentationHandler } from './dom';
import { addFetchInstrumentationHandler } from './fetch';
import { addGlobalErrorInstrumentationHandler } from './globalError';
import { addGlobalUnhandledRejectionInstrumentationHandler } from './globalUnhandledRejection';
import { addHistoryInstrumentationHandler } from './history';
import { SENTRY_XHR_DATA_KEY, addXhrInstrumentationHandler } from './xhr';
export { addConsoleInstrumentationHandler, addClickKeypressInstrumentationHandler, addXhrInstrumentationHandler, addFetchInstrumentationHandler, addHistoryInstrumentationHandler, addGlobalErrorInstrumentationHandler, addGlobalUnhandledRejectionInstrumentationHandler, SENTRY_XHR_DATA_KEY, resetInstrumentationHandlers, };
import { addHandler, maybeInstrument, resetInstrumentationHandlers, triggerHandlers } from './handlers';
export { addConsoleInstrumentationHandler, addFetchInstrumentationHandler, addGlobalErrorInstrumentationHandler, addGlobalUnhandledRejectionInstrumentationHandler, addHandler, maybeInstrument, triggerHandlers, resetInstrumentationHandlers, };
//# sourceMappingURL=index.d.ts.map

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

import type { TransportMakeRequestResponse } from '@sentry/types';
import type { DataCategory, TransportMakeRequestResponse } from '@sentry/types';
export type RateLimits = Record<string, number>;

@@ -18,7 +18,7 @@ export declare const DEFAULT_RETRY_AFTER: number;

*/
export declare function disabledUntil(limits: RateLimits, category: string): number;
export declare function disabledUntil(limits: RateLimits, dataCategory: DataCategory): number;
/**
* Checks if a category is rate limited
*/
export declare function isRateLimited(limits: RateLimits, category: string, now?: number): boolean;
export declare function isRateLimited(limits: RateLimits, dataCategory: DataCategory, now?: number): boolean;
/**

@@ -25,0 +25,0 @@ * Update ratelimits from incoming headers.

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc