@sentry/utils
Advanced tools
Comparing version 7.105.0 to 8.0.0-alpha.1
Object.defineProperty(exports, '__esModule', { value: true }); | ||
const nodeStackTrace = require('./node-stack-trace.js'); | ||
const object = require('./object.js'); | ||
const nodeStackTrace = require('./node-stack-trace.js'); | ||
const stacktrace = require('./stacktrace.js'); | ||
@@ -67,3 +68,3 @@ /** | ||
module: getModuleFromFilename(filename), | ||
function: frame.functionName || '?', | ||
function: frame.functionName || stacktrace.UNKNOWN_FUNCTION, | ||
colno, | ||
@@ -70,0 +71,0 @@ lineno, |
@@ -109,3 +109,2 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
// eslint-disable-next-line prefer-const | ||
className = elem.className; | ||
@@ -112,0 +111,0 @@ if (className && is.isString(className)) { |
@@ -58,13 +58,19 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
/** | ||
* Encode a string to UTF8. | ||
* Encode a string to UTF8 array. | ||
*/ | ||
function encodeUTF8(input, textEncoder) { | ||
const utf8 = textEncoder || new TextEncoder(); | ||
return utf8.encode(input); | ||
function encodeUTF8(input) { | ||
return new TextEncoder().encode(input); | ||
} | ||
/** | ||
* Decode a UTF8 array to string. | ||
*/ | ||
function decodeUTF8(input) { | ||
return new TextDecoder().decode(input); | ||
} | ||
/** | ||
* Serializes an envelope. | ||
*/ | ||
function serializeEnvelope(envelope, textEncoder) { | ||
function serializeEnvelope(envelope) { | ||
const [envHeaders, items] = envelope; | ||
@@ -77,5 +83,5 @@ | ||
if (typeof parts === 'string') { | ||
parts = typeof next === 'string' ? parts + next : [encodeUTF8(parts, textEncoder), next]; | ||
parts = typeof next === 'string' ? parts + next : [encodeUTF8(parts), next]; | ||
} else { | ||
parts.push(typeof next === 'string' ? encodeUTF8(next, textEncoder) : next); | ||
parts.push(typeof next === 'string' ? encodeUTF8(next) : next); | ||
} | ||
@@ -124,8 +130,4 @@ } | ||
*/ | ||
function parseEnvelope( | ||
env, | ||
textEncoder, | ||
textDecoder, | ||
) { | ||
let buffer = typeof env === 'string' ? textEncoder.encode(env) : env; | ||
function parseEnvelope(env) { | ||
let buffer = typeof env === 'string' ? encodeUTF8(env) : env; | ||
@@ -146,3 +148,3 @@ function readBinary(length) { | ||
return JSON.parse(textDecoder.decode(readBinary(i))) ; | ||
return JSON.parse(decodeUTF8(readBinary(i))) ; | ||
} | ||
@@ -167,7 +169,4 @@ | ||
*/ | ||
function createAttachmentEnvelopeItem( | ||
attachment, | ||
textEncoder, | ||
) { | ||
const buffer = typeof attachment.data === 'string' ? encodeUTF8(attachment.data, textEncoder) : attachment.data; | ||
function createAttachmentEnvelopeItem(attachment) { | ||
const buffer = typeof attachment.data === 'string' ? encodeUTF8(attachment.data) : attachment.data; | ||
@@ -199,3 +198,2 @@ return [ | ||
feedback: 'feedback', | ||
span: 'span', | ||
// TODO: This is a temporary workaround until we have a proper data category for metrics | ||
@@ -202,0 +200,0 @@ statsd: 'unknown', |
@@ -54,8 +54,6 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
* Builds and Event from a Exception | ||
* | ||
* TODO(v8): Remove getHub fallback | ||
* @hidden | ||
*/ | ||
function eventFromUnknownInput( | ||
getHubOrClient, | ||
client, | ||
stackParser, | ||
@@ -65,8 +63,2 @@ exception, | ||
) { | ||
const client = | ||
typeof getHubOrClient === 'function' | ||
? // eslint-disable-next-line deprecation/deprecation | ||
getHubOrClient().getClient() | ||
: getHubOrClient; | ||
let ex = exception; | ||
@@ -125,3 +117,2 @@ const providedMechanism = | ||
message, | ||
// eslint-disable-next-line deprecation/deprecation | ||
level = 'info', | ||
@@ -128,0 +119,0 @@ hint, |
@@ -8,3 +8,10 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
const worldwide = require('./worldwide.js'); | ||
const index = require('./instrument/index.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 is = require('./is.js'); | ||
@@ -23,2 +30,3 @@ const isBrowser = require('./isBrowser.js'); | ||
const stacktrace = require('./stacktrace.js'); | ||
const nodeStackTrace = require('./node-stack-trace.js'); | ||
const string = require('./string.js'); | ||
@@ -46,11 +54,2 @@ const supports = require('./supports.js'); | ||
const _optionalChainDelete = require('./buildPolyfills/_optionalChainDelete.js'); | ||
const console = require('./instrument/console.js'); | ||
const dom = require('./instrument/dom.js'); | ||
const xhr = require('./instrument/xhr.js'); | ||
const fetch = require('./instrument/fetch.js'); | ||
const history = require('./instrument/history.js'); | ||
const globalError = require('./instrument/globalError.js'); | ||
const globalUnhandledRejection = require('./instrument/globalUnhandledRejection.js'); | ||
const _handlers = require('./instrument/_handlers.js'); | ||
const nodeStackTrace = require('./node-stack-trace.js'); | ||
const escapeStringForRegex = require('./vendor/escapeStringForRegex.js'); | ||
@@ -73,3 +72,11 @@ const supportsHistory = require('./vendor/supportsHistory.js'); | ||
exports.getGlobalSingleton = worldwide.getGlobalSingleton; | ||
exports.addInstrumentationHandler = index.addInstrumentationHandler; | ||
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.isDOMError = is.isDOMError; | ||
@@ -136,10 +143,12 @@ exports.isDOMException = is.isDOMException; | ||
exports.winterCGRequestToRequestData = requestdata.winterCGRequestToRequestData; | ||
exports.severityFromString = severity.severityFromString; | ||
exports.severityLevelFromString = severity.severityLevelFromString; | ||
exports.validSeverityLevels = severity.validSeverityLevels; | ||
exports.UNKNOWN_FUNCTION = stacktrace.UNKNOWN_FUNCTION; | ||
exports.createStackParser = stacktrace.createStackParser; | ||
exports.getFunctionName = stacktrace.getFunctionName; | ||
exports.nodeStackLineParser = stacktrace.nodeStackLineParser; | ||
exports.stackParserFromStackParserOptions = stacktrace.stackParserFromStackParserOptions; | ||
exports.stripSentryFramesAndReverse = stacktrace.stripSentryFramesAndReverse; | ||
exports.filenameIsInApp = nodeStackTrace.filenameIsInApp; | ||
exports.node = nodeStackTrace.node; | ||
exports.nodeStackLineParser = nodeStackTrace.nodeStackLineParser; | ||
exports.isMatchingPattern = string.isMatchingPattern; | ||
@@ -217,14 +226,4 @@ exports.safeJoin = string.safeJoin; | ||
exports._optionalChainDelete = _optionalChainDelete._optionalChainDelete; | ||
exports.addConsoleInstrumentationHandler = console.addConsoleInstrumentationHandler; | ||
exports.addClickKeypressInstrumentationHandler = dom.addClickKeypressInstrumentationHandler; | ||
exports.SENTRY_XHR_DATA_KEY = xhr.SENTRY_XHR_DATA_KEY; | ||
exports.addXhrInstrumentationHandler = xhr.addXhrInstrumentationHandler; | ||
exports.addFetchInstrumentationHandler = fetch.addFetchInstrumentationHandler; | ||
exports.addHistoryInstrumentationHandler = history.addHistoryInstrumentationHandler; | ||
exports.addGlobalErrorInstrumentationHandler = globalError.addGlobalErrorInstrumentationHandler; | ||
exports.addGlobalUnhandledRejectionInstrumentationHandler = globalUnhandledRejection.addGlobalUnhandledRejectionInstrumentationHandler; | ||
exports.resetInstrumentationHandlers = _handlers.resetInstrumentationHandlers; | ||
exports.filenameIsInApp = nodeStackTrace.filenameIsInApp; | ||
exports.escapeStringForRegex = escapeStringForRegex.escapeStringForRegex; | ||
exports.supportsHistory = supportsHistory.supportsHistory; | ||
//# sourceMappingURL=index.js.map |
Object.defineProperty(exports, '__esModule', { value: true }); | ||
const stacktrace = require('./stacktrace.js'); | ||
/** | ||
@@ -27,3 +29,2 @@ * Does this filename look like it's part of the app code? | ||
/** Node Stack line parser */ | ||
// eslint-disable-next-line complexity | ||
function node(getModule) { | ||
@@ -75,3 +76,3 @@ const FILENAME_MATCH = /^\s*[-]{4,}$/; | ||
if (functionName === undefined) { | ||
methodName = methodName || '<anonymous>'; | ||
methodName = methodName || stacktrace.UNKNOWN_FUNCTION; | ||
functionName = typeName ? `${typeName}.${methodName}` : methodName; | ||
@@ -112,4 +113,15 @@ } | ||
/** | ||
* Node.js stack line parser | ||
* | ||
* This is in @sentry/utils so it can be used from the Electron SDK in the browser for when `nodeIntegration == true`. | ||
* This allows it to be used without referencing or importing any node specific code which causes bundlers to complain | ||
*/ | ||
function nodeStackLineParser(getModule) { | ||
return [90, node(getModule)]; | ||
} | ||
exports.filenameIsInApp = filenameIsInApp; | ||
exports.node = node; | ||
exports.nodeStackLineParser = nodeStackLineParser; | ||
//# sourceMappingURL=node-stack-trace.js.map |
@@ -29,3 +29,3 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
*/ | ||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
function dynamicRequire(mod, request) { | ||
@@ -32,0 +32,0 @@ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access |
@@ -26,13 +26,15 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
req, | ||
deps, | ||
// TODO(v8): Remove this parameter in v8 | ||
_deps, | ||
) { | ||
if (!transaction) return; | ||
// TODO(v8): SEMANTIC_ATTRIBUTE_SENTRY_SOURCE is in core, align this once we merge utils & core | ||
// eslint-disable-next-line deprecation/deprecation | ||
if (!transaction.metadata.source || transaction.metadata.source === 'url') { | ||
if (!transaction.attributes['sentry.source'] || transaction.attributes['sentry.source'] === 'url') { | ||
// Attempt to grab a parameterized route off of the request | ||
const [name, source] = extractPathForTransaction(req, { path: true, method: true }); | ||
transaction.updateName(name); | ||
// TODO: SEMANTIC_ATTRIBUTE_SENTRY_SOURCE is in core, align this once we merge utils & core | ||
// eslint-disable-next-line deprecation/deprecation | ||
transaction.setMetadata({ source }); | ||
// TODO(v8): SEMANTIC_ATTRIBUTE_SENTRY_SOURCE is in core, align this once we merge utils & core | ||
transaction.setAttribute('sentry.source', source); | ||
} | ||
@@ -43,5 +45,14 @@ transaction.setAttribute('url', req.originalUrl || req.url); | ||
} | ||
// TODO: We need to rewrite this to a flat format? | ||
// eslint-disable-next-line deprecation/deprecation | ||
transaction.setData('query', extractQueryParams(req, deps)); | ||
const query = extractQueryParams(req); | ||
if (typeof query === 'string') { | ||
transaction.setAttribute('query', query); | ||
} else if (query) { | ||
Object.keys(query).forEach(key => { | ||
const val = query[key]; | ||
if (typeof val === 'string' || typeof val === 'number') { | ||
transaction.setAttribute(`query.${key}`, val); | ||
} | ||
}); | ||
} | ||
} | ||
@@ -149,3 +160,3 @@ | ||
) { | ||
const { include = DEFAULT_REQUEST_INCLUDES, deps } = options || {}; | ||
const { include = DEFAULT_REQUEST_INCLUDES } = options || {}; | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
@@ -214,4 +225,3 @@ const requestData = {}; | ||
// express, koa, nextjs: req.query | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access | ||
requestData.query_string = extractQueryParams(req, deps); | ||
requestData.query_string = extractQueryParams(req); | ||
break; | ||
@@ -266,4 +276,4 @@ } | ||
const extractedRequestData = Array.isArray(include.request) | ||
? extractRequestData(req, { include: include.request, deps: options && options.deps }) | ||
: extractRequestData(req, { deps: options && options.deps }); | ||
? extractRequestData(req, { include: include.request }) | ||
: extractRequestData(req); | ||
@@ -309,6 +319,3 @@ event.request = { | ||
function extractQueryParams( | ||
req, | ||
deps, | ||
) { | ||
function extractQueryParams(req) { | ||
// url (including path and query string): | ||
@@ -330,9 +337,4 @@ // node, express: req.originalUrl | ||
try { | ||
return ( | ||
req.query || | ||
(typeof URL !== 'undefined' && new URL(originalUrl).search.slice(1)) || | ||
// In Node 8, `URL` isn't in the global scope, so we have to use the built-in module from Node | ||
(deps && deps.url && deps.url.parse(originalUrl).query) || | ||
undefined | ||
); | ||
const queryParams = req.query || new URL(originalUrl).search.slice(1); | ||
return queryParams.length ? queryParams : undefined; | ||
} catch (e2) { | ||
@@ -339,0 +341,0 @@ return undefined; |
@@ -16,14 +16,2 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
/** | ||
* Converts a string-based level into a member of the deprecated {@link Severity} enum. | ||
* | ||
* @deprecated `severityFromString` is deprecated. Please use `severityLevelFromString` instead. | ||
* | ||
* @param level String representation of Severity | ||
* @returns Severity | ||
*/ | ||
function severityFromString(level) { | ||
return severityLevelFromString(level) ; | ||
} | ||
/** | ||
* Converts a string-based level into a `SeverityLevel`, normalizing it along the way. | ||
@@ -38,5 +26,4 @@ * | ||
exports.severityFromString = severityFromString; | ||
exports.severityLevelFromString = severityLevelFromString; | ||
exports.validSeverityLevels = validSeverityLevels; | ||
//# sourceMappingURL=severity.js.map |
Object.defineProperty(exports, '__esModule', { value: true }); | ||
const nodeStackTrace = require('./node-stack-trace.js'); | ||
const STACKTRACE_FRAME_LIMIT = 50; | ||
const UNKNOWN_FUNCTION = '?'; | ||
// Used to sanitize webpack (error: *) wrapped stack errors | ||
@@ -116,3 +115,3 @@ const WEBPACK_ERROR_REGEXP = /\(error: (.*)\)/; | ||
filename: frame.filename || localStack[localStack.length - 1].filename, | ||
function: frame.function || '?', | ||
function: frame.function || UNKNOWN_FUNCTION, | ||
})); | ||
@@ -139,18 +138,7 @@ } | ||
/** | ||
* Node.js stack line parser | ||
* | ||
* This is in @sentry/utils so it can be used from the Electron SDK in the browser for when `nodeIntegration == true`. | ||
* This allows it to be used without referencing or importing any node specific code which causes bundlers to complain | ||
*/ | ||
function nodeStackLineParser(getModule) { | ||
return [90, nodeStackTrace.node(getModule)]; | ||
} | ||
exports.filenameIsInApp = nodeStackTrace.filenameIsInApp; | ||
exports.UNKNOWN_FUNCTION = UNKNOWN_FUNCTION; | ||
exports.createStackParser = createStackParser; | ||
exports.getFunctionName = getFunctionName; | ||
exports.nodeStackLineParser = nodeStackLineParser; | ||
exports.stackParserFromStackParserOptions = stackParserFromStackParserOptions; | ||
exports.stripSentryFramesAndReverse = stripSentryFramesAndReverse; | ||
//# sourceMappingURL=stacktrace.js.map |
@@ -180,3 +180,2 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
if (this._state === States.RESOLVED) { | ||
// eslint-disable-next-line @typescript-eslint/no-floating-promises | ||
handler[1](this._value ); | ||
@@ -183,0 +182,0 @@ } |
@@ -54,3 +54,3 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
/** | ||
* Takes a URL object and returns a sanitized string which is safe to use as span description | ||
* Takes a URL object and returns a sanitized string which is safe to use as span name | ||
* see: https://develop.sentry.dev/sdk/data-handling/#structuring-data | ||
@@ -57,0 +57,0 @@ */ |
@@ -5,3 +5,3 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
// a) reduce the size by skipping the runtime type - checking | ||
// b) ensure it gets down - compiled for old versions of Node(the published package only supports Node 12+). | ||
// b) ensure it gets down - compiled for old versions of Node(the published package only supports Node 14+). | ||
// | ||
@@ -8,0 +8,0 @@ // MIT License |
@@ -0,3 +1,4 @@ | ||
import { filenameIsInApp } from './node-stack-trace.js'; | ||
import { dropUndefinedKeys } from './object.js'; | ||
import { filenameIsInApp } from './node-stack-trace.js'; | ||
import { UNKNOWN_FUNCTION } from './stacktrace.js'; | ||
@@ -65,3 +66,3 @@ /** | ||
module: getModuleFromFilename(filename), | ||
function: frame.functionName || '?', | ||
function: frame.functionName || UNKNOWN_FUNCTION, | ||
colno, | ||
@@ -68,0 +69,0 @@ lineno, |
@@ -107,3 +107,2 @@ import { isString } from './is.js'; | ||
// eslint-disable-next-line prefer-const | ||
className = elem.className; | ||
@@ -110,0 +109,0 @@ if (className && isString(className)) { |
@@ -56,13 +56,19 @@ import { dsnToString } from './dsn.js'; | ||
/** | ||
* Encode a string to UTF8. | ||
* Encode a string to UTF8 array. | ||
*/ | ||
function encodeUTF8(input, textEncoder) { | ||
const utf8 = textEncoder || new TextEncoder(); | ||
return utf8.encode(input); | ||
function encodeUTF8(input) { | ||
return new TextEncoder().encode(input); | ||
} | ||
/** | ||
* Decode a UTF8 array to string. | ||
*/ | ||
function decodeUTF8(input) { | ||
return new TextDecoder().decode(input); | ||
} | ||
/** | ||
* Serializes an envelope. | ||
*/ | ||
function serializeEnvelope(envelope, textEncoder) { | ||
function serializeEnvelope(envelope) { | ||
const [envHeaders, items] = envelope; | ||
@@ -75,5 +81,5 @@ | ||
if (typeof parts === 'string') { | ||
parts = typeof next === 'string' ? parts + next : [encodeUTF8(parts, textEncoder), next]; | ||
parts = typeof next === 'string' ? parts + next : [encodeUTF8(parts), next]; | ||
} else { | ||
parts.push(typeof next === 'string' ? encodeUTF8(next, textEncoder) : next); | ||
parts.push(typeof next === 'string' ? encodeUTF8(next) : next); | ||
} | ||
@@ -122,8 +128,4 @@ } | ||
*/ | ||
function parseEnvelope( | ||
env, | ||
textEncoder, | ||
textDecoder, | ||
) { | ||
let buffer = typeof env === 'string' ? textEncoder.encode(env) : env; | ||
function parseEnvelope(env) { | ||
let buffer = typeof env === 'string' ? encodeUTF8(env) : env; | ||
@@ -144,3 +146,3 @@ function readBinary(length) { | ||
return JSON.parse(textDecoder.decode(readBinary(i))) ; | ||
return JSON.parse(decodeUTF8(readBinary(i))) ; | ||
} | ||
@@ -165,7 +167,4 @@ | ||
*/ | ||
function createAttachmentEnvelopeItem( | ||
attachment, | ||
textEncoder, | ||
) { | ||
const buffer = typeof attachment.data === 'string' ? encodeUTF8(attachment.data, textEncoder) : attachment.data; | ||
function createAttachmentEnvelopeItem(attachment) { | ||
const buffer = typeof attachment.data === 'string' ? encodeUTF8(attachment.data) : attachment.data; | ||
@@ -197,3 +196,2 @@ return [ | ||
feedback: 'feedback', | ||
span: 'span', | ||
// TODO: This is a temporary workaround until we have a proper data category for metrics | ||
@@ -200,0 +198,0 @@ statsd: 'unknown', |
@@ -52,8 +52,6 @@ import { isError, isPlainObject, isParameterizedString } from './is.js'; | ||
* Builds and Event from a Exception | ||
* | ||
* TODO(v8): Remove getHub fallback | ||
* @hidden | ||
*/ | ||
function eventFromUnknownInput( | ||
getHubOrClient, | ||
client, | ||
stackParser, | ||
@@ -63,8 +61,2 @@ exception, | ||
) { | ||
const client = | ||
typeof getHubOrClient === 'function' | ||
? // eslint-disable-next-line deprecation/deprecation | ||
getHubOrClient().getClient() | ||
: getHubOrClient; | ||
let ex = exception; | ||
@@ -123,3 +115,2 @@ const providedMechanism = | ||
message, | ||
// eslint-disable-next-line deprecation/deprecation | ||
level = 'info', | ||
@@ -126,0 +117,0 @@ hint, |
@@ -6,3 +6,10 @@ export { applyAggregateErrorsToEvent } from './aggregate-errors.js'; | ||
export { GLOBAL_OBJ, getGlobalObject, getGlobalSingleton } from './worldwide.js'; | ||
export { addInstrumentationHandler } from './instrument/index.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 { isDOMError, isDOMException, isElement, isError, isErrorEvent, isEvent, isInstanceOf, isNaN, isParameterizedString, isPlainObject, isPrimitive, isRegExp, isString, isSyntheticEvent, isThenable, isVueViewModel } from './is.js'; | ||
@@ -19,4 +26,5 @@ export { isBrowser } from './isBrowser.js'; | ||
export { DEFAULT_USER_INCLUDES, addRequestDataToEvent, addRequestDataToTransaction, extractPathForTransaction, extractRequestData, winterCGHeadersToDict, winterCGRequestToRequestData } from './requestdata.js'; | ||
export { severityFromString, severityLevelFromString, validSeverityLevels } from './severity.js'; | ||
export { createStackParser, getFunctionName, nodeStackLineParser, stackParserFromStackParserOptions, stripSentryFramesAndReverse } from './stacktrace.js'; | ||
export { severityLevelFromString, validSeverityLevels } from './severity.js'; | ||
export { UNKNOWN_FUNCTION, createStackParser, getFunctionName, stackParserFromStackParserOptions, stripSentryFramesAndReverse } from './stacktrace.js'; | ||
export { filenameIsInApp, node, nodeStackLineParser } from './node-stack-trace.js'; | ||
export { isMatchingPattern, safeJoin, snipLine, stringMatchesSomePattern, truncate } from './string.js'; | ||
@@ -44,13 +52,4 @@ export { isNativeFetch, supportsDOMError, supportsDOMException, supportsErrorEvent, supportsFetch, supportsNativeFetch, supportsReferrerPolicy, supportsReportingObserver } from './supports.js'; | ||
export { _optionalChainDelete } from './buildPolyfills/_optionalChainDelete.js'; | ||
export { addConsoleInstrumentationHandler } from './instrument/console.js'; | ||
export { addClickKeypressInstrumentationHandler } from './instrument/dom.js'; | ||
export { SENTRY_XHR_DATA_KEY, addXhrInstrumentationHandler } from './instrument/xhr.js'; | ||
export { addFetchInstrumentationHandler } from './instrument/fetch.js'; | ||
export { addHistoryInstrumentationHandler } from './instrument/history.js'; | ||
export { addGlobalErrorInstrumentationHandler } from './instrument/globalError.js'; | ||
export { addGlobalUnhandledRejectionInstrumentationHandler } from './instrument/globalUnhandledRejection.js'; | ||
export { resetInstrumentationHandlers } from './instrument/_handlers.js'; | ||
export { filenameIsInApp } from './node-stack-trace.js'; | ||
export { escapeStringForRegex } from './vendor/escapeStringForRegex.js'; | ||
export { supportsHistory } from './vendor/supportsHistory.js'; | ||
//# sourceMappingURL=index.js.map |
@@ -0,1 +1,3 @@ | ||
import { UNKNOWN_FUNCTION } from './stacktrace.js'; | ||
/** | ||
@@ -25,3 +27,2 @@ * Does this filename look like it's part of the app code? | ||
/** Node Stack line parser */ | ||
// eslint-disable-next-line complexity | ||
function node(getModule) { | ||
@@ -73,3 +74,3 @@ const FILENAME_MATCH = /^\s*[-]{4,}$/; | ||
if (functionName === undefined) { | ||
methodName = methodName || '<anonymous>'; | ||
methodName = methodName || UNKNOWN_FUNCTION; | ||
functionName = typeName ? `${typeName}.${methodName}` : methodName; | ||
@@ -110,3 +111,13 @@ } | ||
export { filenameIsInApp, node }; | ||
/** | ||
* Node.js stack line parser | ||
* | ||
* This is in @sentry/utils so it can be used from the Electron SDK in the browser for when `nodeIntegration == true`. | ||
* This allows it to be used without referencing or importing any node specific code which causes bundlers to complain | ||
*/ | ||
function nodeStackLineParser(getModule) { | ||
return [90, node(getModule)]; | ||
} | ||
export { filenameIsInApp, node, nodeStackLineParser }; | ||
//# sourceMappingURL=node-stack-trace.js.map |
@@ -27,3 +27,3 @@ import { isBrowserBundle } from './env.js'; | ||
*/ | ||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
function dynamicRequire(mod, request) { | ||
@@ -30,0 +30,0 @@ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access |
@@ -24,13 +24,15 @@ import { parseCookie } from './cookie.js'; | ||
req, | ||
deps, | ||
// TODO(v8): Remove this parameter in v8 | ||
_deps, | ||
) { | ||
if (!transaction) return; | ||
// TODO(v8): SEMANTIC_ATTRIBUTE_SENTRY_SOURCE is in core, align this once we merge utils & core | ||
// eslint-disable-next-line deprecation/deprecation | ||
if (!transaction.metadata.source || transaction.metadata.source === 'url') { | ||
if (!transaction.attributes['sentry.source'] || transaction.attributes['sentry.source'] === 'url') { | ||
// Attempt to grab a parameterized route off of the request | ||
const [name, source] = extractPathForTransaction(req, { path: true, method: true }); | ||
transaction.updateName(name); | ||
// TODO: SEMANTIC_ATTRIBUTE_SENTRY_SOURCE is in core, align this once we merge utils & core | ||
// eslint-disable-next-line deprecation/deprecation | ||
transaction.setMetadata({ source }); | ||
// TODO(v8): SEMANTIC_ATTRIBUTE_SENTRY_SOURCE is in core, align this once we merge utils & core | ||
transaction.setAttribute('sentry.source', source); | ||
} | ||
@@ -41,5 +43,14 @@ transaction.setAttribute('url', req.originalUrl || req.url); | ||
} | ||
// TODO: We need to rewrite this to a flat format? | ||
// eslint-disable-next-line deprecation/deprecation | ||
transaction.setData('query', extractQueryParams(req, deps)); | ||
const query = extractQueryParams(req); | ||
if (typeof query === 'string') { | ||
transaction.setAttribute('query', query); | ||
} else if (query) { | ||
Object.keys(query).forEach(key => { | ||
const val = query[key]; | ||
if (typeof val === 'string' || typeof val === 'number') { | ||
transaction.setAttribute(`query.${key}`, val); | ||
} | ||
}); | ||
} | ||
} | ||
@@ -147,3 +158,3 @@ | ||
) { | ||
const { include = DEFAULT_REQUEST_INCLUDES, deps } = options || {}; | ||
const { include = DEFAULT_REQUEST_INCLUDES } = options || {}; | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
@@ -212,4 +223,3 @@ const requestData = {}; | ||
// express, koa, nextjs: req.query | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access | ||
requestData.query_string = extractQueryParams(req, deps); | ||
requestData.query_string = extractQueryParams(req); | ||
break; | ||
@@ -264,4 +274,4 @@ } | ||
const extractedRequestData = Array.isArray(include.request) | ||
? extractRequestData(req, { include: include.request, deps: options && options.deps }) | ||
: extractRequestData(req, { deps: options && options.deps }); | ||
? extractRequestData(req, { include: include.request }) | ||
: extractRequestData(req); | ||
@@ -307,6 +317,3 @@ event.request = { | ||
function extractQueryParams( | ||
req, | ||
deps, | ||
) { | ||
function extractQueryParams(req) { | ||
// url (including path and query string): | ||
@@ -328,9 +335,4 @@ // node, express: req.originalUrl | ||
try { | ||
return ( | ||
req.query || | ||
(typeof URL !== 'undefined' && new URL(originalUrl).search.slice(1)) || | ||
// In Node 8, `URL` isn't in the global scope, so we have to use the built-in module from Node | ||
(deps && deps.url && deps.url.parse(originalUrl).query) || | ||
undefined | ||
); | ||
const queryParams = req.query || new URL(originalUrl).search.slice(1); | ||
return queryParams.length ? queryParams : undefined; | ||
} catch (e2) { | ||
@@ -337,0 +339,0 @@ return undefined; |
@@ -14,14 +14,2 @@ // Note: Ideally the `SeverityLevel` type would be derived from `validSeverityLevels`, but that would mean either | ||
/** | ||
* Converts a string-based level into a member of the deprecated {@link Severity} enum. | ||
* | ||
* @deprecated `severityFromString` is deprecated. Please use `severityLevelFromString` instead. | ||
* | ||
* @param level String representation of Severity | ||
* @returns Severity | ||
*/ | ||
function severityFromString(level) { | ||
return severityLevelFromString(level) ; | ||
} | ||
/** | ||
* Converts a string-based level into a `SeverityLevel`, normalizing it along the way. | ||
@@ -36,3 +24,3 @@ * | ||
export { severityFromString, severityLevelFromString, validSeverityLevels }; | ||
export { severityLevelFromString, validSeverityLevels }; | ||
//# sourceMappingURL=severity.js.map |
@@ -1,5 +0,3 @@ | ||
import { node } from './node-stack-trace.js'; | ||
export { filenameIsInApp } from './node-stack-trace.js'; | ||
const STACKTRACE_FRAME_LIMIT = 50; | ||
const UNKNOWN_FUNCTION = '?'; | ||
// Used to sanitize webpack (error: *) wrapped stack errors | ||
@@ -115,3 +113,3 @@ const WEBPACK_ERROR_REGEXP = /\(error: (.*)\)/; | ||
filename: frame.filename || localStack[localStack.length - 1].filename, | ||
function: frame.function || '?', | ||
function: frame.function || UNKNOWN_FUNCTION, | ||
})); | ||
@@ -138,13 +136,3 @@ } | ||
/** | ||
* Node.js stack line parser | ||
* | ||
* This is in @sentry/utils so it can be used from the Electron SDK in the browser for when `nodeIntegration == true`. | ||
* This allows it to be used without referencing or importing any node specific code which causes bundlers to complain | ||
*/ | ||
function nodeStackLineParser(getModule) { | ||
return [90, node(getModule)]; | ||
} | ||
export { createStackParser, getFunctionName, nodeStackLineParser, stackParserFromStackParserOptions, stripSentryFramesAndReverse }; | ||
export { UNKNOWN_FUNCTION, createStackParser, getFunctionName, stackParserFromStackParserOptions, stripSentryFramesAndReverse }; | ||
//# sourceMappingURL=stacktrace.js.map |
@@ -178,3 +178,2 @@ import { isThenable } from './is.js'; | ||
if (this._state === States.RESOLVED) { | ||
// eslint-disable-next-line @typescript-eslint/no-floating-promises | ||
handler[1](this._value ); | ||
@@ -181,0 +180,0 @@ } |
@@ -52,3 +52,3 @@ /** | ||
/** | ||
* Takes a URL object and returns a sanitized string which is safe to use as span description | ||
* Takes a URL object and returns a sanitized string which is safe to use as span name | ||
* see: https://develop.sentry.dev/sdk/data-handling/#structuring-data | ||
@@ -55,0 +55,0 @@ */ |
// Based on https://github.com/sindresorhus/escape-string-regexp but with modifications to: | ||
// a) reduce the size by skipping the runtime type - checking | ||
// b) ensure it gets down - compiled for old versions of Node(the published package only supports Node 12+). | ||
// b) ensure it gets down - compiled for old versions of Node(the published package only supports Node 14+). | ||
// | ||
@@ -5,0 +5,0 @@ // MIT License |
{ | ||
"name": "@sentry/utils", | ||
"version": "7.105.0", | ||
"version": "8.0.0-alpha.1", | ||
"description": "Utilities for all Sentry JavaScript SDKs", | ||
@@ -10,3 +10,3 @@ "repository": "git://github.com/getsentry/sentry-javascript.git", | ||
"engines": { | ||
"node": ">=8" | ||
"node": ">=14.8" | ||
}, | ||
@@ -33,3 +33,3 @@ "files": [ | ||
"dependencies": { | ||
"@sentry/types": "7.105.0" | ||
"@sentry/types": "8.0.0-alpha.1" | ||
}, | ||
@@ -36,0 +36,0 @@ "devDependencies": { |
@@ -1,2 +0,2 @@ | ||
import { Attachment, AttachmentItem, DataCategory, DsnComponents, Envelope, EnvelopeItemType, Event, EventEnvelopeHeaders, SdkInfo, SdkMetadata, TextEncoderInternal } from '@sentry/types'; | ||
import { Attachment, AttachmentItem, DataCategory, DsnComponents, Envelope, EnvelopeItemType, Event, EventEnvelopeHeaders, SdkInfo, SdkMetadata } from '@sentry/types'; | ||
/** | ||
@@ -28,14 +28,11 @@ * Creates an envelope. | ||
*/ | ||
export declare function serializeEnvelope(envelope: Envelope, textEncoder?: TextEncoderInternal): string | Uint8Array; | ||
export interface TextDecoderInternal { | ||
decode(input?: Uint8Array): string; | ||
} | ||
export declare function serializeEnvelope(envelope: Envelope): string | Uint8Array; | ||
/** | ||
* Parses an envelope | ||
*/ | ||
export declare function parseEnvelope(env: string | Uint8Array, textEncoder: TextEncoderInternal, textDecoder: TextDecoderInternal): Envelope; | ||
export declare function parseEnvelope(env: string | Uint8Array): Envelope; | ||
/** | ||
* Creates attachment envelope items | ||
*/ | ||
export declare function createAttachmentEnvelopeItem(attachment: Attachment, textEncoder?: TextEncoderInternal): AttachmentItem; | ||
export declare function createAttachmentEnvelopeItem(attachment: Attachment): AttachmentItem; | ||
/** | ||
@@ -42,0 +39,0 @@ * Maps the type of an envelope item to a data category. |
@@ -1,2 +0,2 @@ | ||
import { Client, Event, EventHint, Exception, Hub, ParameterizedString, Severity, SeverityLevel, StackFrame, StackParser } from '@sentry/types'; | ||
import { Client, Event, EventHint, Exception, ParameterizedString, SeverityLevel, StackFrame, StackParser } from '@sentry/types'; | ||
/** | ||
@@ -12,7 +12,5 @@ * Extracts stack frames from the error.stack string | ||
* Builds and Event from a Exception | ||
* | ||
* TODO(v8): Remove getHub fallback | ||
* @hidden | ||
*/ | ||
export declare function eventFromUnknownInput(getHubOrClient: (() => Hub) | Client | undefined, stackParser: StackParser, exception: unknown, hint?: EventHint): Event; | ||
export declare function eventFromUnknownInput(client: Client, stackParser: StackParser, exception: unknown, hint?: EventHint): Event; | ||
/** | ||
@@ -22,3 +20,3 @@ * Builds and Event from a Message | ||
*/ | ||
export declare function eventFromMessage(stackParser: StackParser, message: ParameterizedString, level?: Severity | SeverityLevel, hint?: EventHint, attachStacktrace?: boolean): Event; | ||
export declare function eventFromMessage(stackParser: StackParser, message: ParameterizedString, level?: SeverityLevel, hint?: EventHint, attachStacktrace?: boolean): Event; | ||
//# sourceMappingURL=eventbuilder.d.ts.map |
@@ -20,2 +20,3 @@ export * from './aggregate-errors'; | ||
export * from './stacktrace'; | ||
export * from './node-stack-trace'; | ||
export * from './string'; | ||
@@ -22,0 +23,0 @@ export * from './supports'; |
@@ -1,2 +0,1 @@ | ||
import { InstrumentHandlerCallback as _InstrumentHandlerCallback, InstrumentHandlerType as _InstrumentHandlerType } from './_handlers'; | ||
import { resetInstrumentationHandlers } from './_handlers'; | ||
@@ -10,19 +9,3 @@ import { addConsoleInstrumentationHandler } from './console'; | ||
import { SENTRY_XHR_DATA_KEY, addXhrInstrumentationHandler } from './xhr'; | ||
/** | ||
* Add handler that will be called when given type of instrumentation triggers. | ||
* Use at your own risk, this might break without changelog notice, only used internally. | ||
* @hidden | ||
* @deprecated Use the proper function per instrumentation type instead! | ||
*/ | ||
export declare function addInstrumentationHandler(type: _InstrumentHandlerType, callback: _InstrumentHandlerCallback): void; | ||
/** | ||
* @deprecated Use the specific handler data types from @sentry/types instead, e.g. HandlerDataFetch, HandlerDataConsole, ... | ||
*/ | ||
type InstrumentHandlerCallback = _InstrumentHandlerCallback; | ||
/** | ||
* @deprecated Use the specific handler functions instead, e.g. addConsoleInstrumentationHandler, ... | ||
*/ | ||
type InstrumentHandlerType = _InstrumentHandlerType; | ||
export { InstrumentHandlerCallback, InstrumentHandlerType }; | ||
export { addConsoleInstrumentationHandler, addClickKeypressInstrumentationHandler, addXhrInstrumentationHandler, addFetchInstrumentationHandler, addHistoryInstrumentationHandler, addGlobalErrorInstrumentationHandler, addGlobalUnhandledRejectionInstrumentationHandler, SENTRY_XHR_DATA_KEY, resetInstrumentationHandlers, }; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import { StackLineParserFn } from '@sentry/types'; | ||
import { StackLineParser, StackLineParserFn } from '@sentry/types'; | ||
export type GetModuleFn = (filename: string | undefined) => string | undefined; | ||
@@ -9,2 +9,9 @@ /** | ||
export declare function node(getModule?: GetModuleFn): StackLineParserFn; | ||
/** | ||
* Node.js stack line parser | ||
* | ||
* This is in @sentry/utils so it can be used from the Electron SDK in the browser for when `nodeIntegration == true`. | ||
* This allows it to be used without referencing or importing any node specific code which causes bundlers to complain | ||
*/ | ||
export declare function nodeStackLineParser(getModule?: GetModuleFn): StackLineParser; | ||
//# sourceMappingURL=node-stack-trace.d.ts.map |
@@ -42,3 +42,3 @@ import { Event, ExtractedNodeRequestData, PolymorphicRequest, Transaction, TransactionSource, WebFetchHeaders, WebFetchRequest } from '@sentry/types'; | ||
*/ | ||
export declare function addRequestDataToTransaction(transaction: Transaction | undefined, req: PolymorphicRequest, deps?: InjectedNodeDeps): void; | ||
export declare function addRequestDataToTransaction(transaction: Transaction | undefined, req: PolymorphicRequest, _deps?: InjectedNodeDeps): void; | ||
/** | ||
@@ -77,3 +77,2 @@ * Extracts a complete and parameterized path from the request object and uses it to construct transaction name. | ||
include?: string[]; | ||
deps?: InjectedNodeDeps; | ||
}): ExtractedNodeRequestData; | ||
@@ -80,0 +79,0 @@ /** |
@@ -1,13 +0,4 @@ | ||
import { Severity, SeverityLevel } from '@sentry/types'; | ||
import { SeverityLevel } from '@sentry/types'; | ||
export declare const validSeverityLevels: string[]; | ||
/** | ||
* Converts a string-based level into a member of the deprecated {@link Severity} enum. | ||
* | ||
* @deprecated `severityFromString` is deprecated. Please use `severityLevelFromString` instead. | ||
* | ||
* @param level String representation of Severity | ||
* @returns Severity | ||
*/ | ||
export declare function severityFromString(level: Severity | SeverityLevel | string): Severity; | ||
/** | ||
* Converts a string-based level into a `SeverityLevel`, normalizing it along the way. | ||
@@ -14,0 +5,0 @@ * |
import { StackFrame, StackLineParser, StackParser } from '@sentry/types'; | ||
import { GetModuleFn } from './node-stack-trace'; | ||
import { filenameIsInApp } from './node-stack-trace'; | ||
export { filenameIsInApp }; | ||
export declare const UNKNOWN_FUNCTION = "?"; | ||
/** | ||
@@ -31,9 +29,2 @@ * Creates a stack parser with the supplied line parsers | ||
export declare function getFunctionName(fn: unknown): string; | ||
/** | ||
* Node.js stack line parser | ||
* | ||
* This is in @sentry/utils so it can be used from the Electron SDK in the browser for when `nodeIntegration == true`. | ||
* This allows it to be used without referencing or importing any node specific code which causes bundlers to complain | ||
*/ | ||
export declare function nodeStackLineParser(getModule?: GetModuleFn): StackLineParser; | ||
//# sourceMappingURL=stacktrace.d.ts.map |
@@ -29,3 +29,3 @@ type PartialURL = { | ||
/** | ||
* Takes a URL object and returns a sanitized string which is safe to use as span description | ||
* Takes a URL object and returns a sanitized string which is safe to use as span name | ||
* see: https://develop.sentry.dev/sdk/data-handling/#structuring-data | ||
@@ -32,0 +32,0 @@ */ |
@@ -1,2 +0,2 @@ | ||
import type { Attachment, AttachmentItem, DataCategory, DsnComponents, Envelope, EnvelopeItemType, Event, EventEnvelopeHeaders, SdkInfo, SdkMetadata, TextEncoderInternal } from '@sentry/types'; | ||
import type { Attachment, AttachmentItem, DataCategory, DsnComponents, Envelope, EnvelopeItemType, Event, EventEnvelopeHeaders, SdkInfo, SdkMetadata } from '@sentry/types'; | ||
/** | ||
@@ -28,14 +28,11 @@ * Creates an envelope. | ||
*/ | ||
export declare function serializeEnvelope(envelope: Envelope, textEncoder?: TextEncoderInternal): string | Uint8Array; | ||
export interface TextDecoderInternal { | ||
decode(input?: Uint8Array): string; | ||
} | ||
export declare function serializeEnvelope(envelope: Envelope): string | Uint8Array; | ||
/** | ||
* Parses an envelope | ||
*/ | ||
export declare function parseEnvelope(env: string | Uint8Array, textEncoder: TextEncoderInternal, textDecoder: TextDecoderInternal): Envelope; | ||
export declare function parseEnvelope(env: string | Uint8Array): Envelope; | ||
/** | ||
* Creates attachment envelope items | ||
*/ | ||
export declare function createAttachmentEnvelopeItem(attachment: Attachment, textEncoder?: TextEncoderInternal): AttachmentItem; | ||
export declare function createAttachmentEnvelopeItem(attachment: Attachment): AttachmentItem; | ||
/** | ||
@@ -42,0 +39,0 @@ * Maps the type of an envelope item to a data category. |
@@ -1,2 +0,2 @@ | ||
import type { Client, Event, EventHint, Exception, Hub, ParameterizedString, Severity, SeverityLevel, StackFrame, StackParser } from '@sentry/types'; | ||
import type { Client, Event, EventHint, Exception, ParameterizedString, SeverityLevel, StackFrame, StackParser } from '@sentry/types'; | ||
/** | ||
@@ -12,7 +12,5 @@ * Extracts stack frames from the error.stack string | ||
* Builds and Event from a Exception | ||
* | ||
* TODO(v8): Remove getHub fallback | ||
* @hidden | ||
*/ | ||
export declare function eventFromUnknownInput(getHubOrClient: (() => Hub) | Client | undefined, stackParser: StackParser, exception: unknown, hint?: EventHint): Event; | ||
export declare function eventFromUnknownInput(client: Client, stackParser: StackParser, exception: unknown, hint?: EventHint): Event; | ||
/** | ||
@@ -22,3 +20,3 @@ * Builds and Event from a Message | ||
*/ | ||
export declare function eventFromMessage(stackParser: StackParser, message: ParameterizedString, level?: Severity | SeverityLevel, hint?: EventHint, attachStacktrace?: boolean): Event; | ||
export declare function eventFromMessage(stackParser: StackParser, message: ParameterizedString, level?: SeverityLevel, hint?: EventHint, attachStacktrace?: boolean): Event; | ||
//# sourceMappingURL=eventbuilder.d.ts.map |
@@ -20,2 +20,3 @@ export * from './aggregate-errors'; | ||
export * from './stacktrace'; | ||
export * from './node-stack-trace'; | ||
export * from './string'; | ||
@@ -22,0 +23,0 @@ export * from './supports'; |
@@ -1,2 +0,1 @@ | ||
import type { InstrumentHandlerCallback as _InstrumentHandlerCallback, InstrumentHandlerType as _InstrumentHandlerType } from './_handlers'; | ||
import { resetInstrumentationHandlers } from './_handlers'; | ||
@@ -10,19 +9,3 @@ import { addConsoleInstrumentationHandler } from './console'; | ||
import { SENTRY_XHR_DATA_KEY, addXhrInstrumentationHandler } from './xhr'; | ||
/** | ||
* Add handler that will be called when given type of instrumentation triggers. | ||
* Use at your own risk, this might break without changelog notice, only used internally. | ||
* @hidden | ||
* @deprecated Use the proper function per instrumentation type instead! | ||
*/ | ||
export declare function addInstrumentationHandler(type: _InstrumentHandlerType, callback: _InstrumentHandlerCallback): void; | ||
/** | ||
* @deprecated Use the specific handler data types from @sentry/types instead, e.g. HandlerDataFetch, HandlerDataConsole, ... | ||
*/ | ||
type InstrumentHandlerCallback = _InstrumentHandlerCallback; | ||
/** | ||
* @deprecated Use the specific handler functions instead, e.g. addConsoleInstrumentationHandler, ... | ||
*/ | ||
type InstrumentHandlerType = _InstrumentHandlerType; | ||
export type { InstrumentHandlerCallback, InstrumentHandlerType }; | ||
export { addConsoleInstrumentationHandler, addClickKeypressInstrumentationHandler, addXhrInstrumentationHandler, addFetchInstrumentationHandler, addHistoryInstrumentationHandler, addGlobalErrorInstrumentationHandler, addGlobalUnhandledRejectionInstrumentationHandler, SENTRY_XHR_DATA_KEY, resetInstrumentationHandlers, }; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import type { StackLineParserFn } from '@sentry/types'; | ||
import type { StackLineParser, StackLineParserFn } from '@sentry/types'; | ||
export type GetModuleFn = (filename: string | undefined) => string | undefined; | ||
@@ -9,2 +9,9 @@ /** | ||
export declare function node(getModule?: GetModuleFn): StackLineParserFn; | ||
/** | ||
* Node.js stack line parser | ||
* | ||
* This is in @sentry/utils so it can be used from the Electron SDK in the browser for when `nodeIntegration == true`. | ||
* This allows it to be used without referencing or importing any node specific code which causes bundlers to complain | ||
*/ | ||
export declare function nodeStackLineParser(getModule?: GetModuleFn): StackLineParser; | ||
//# sourceMappingURL=node-stack-trace.d.ts.map |
@@ -42,3 +42,3 @@ import type { Event, ExtractedNodeRequestData, PolymorphicRequest, Transaction, TransactionSource, WebFetchHeaders, WebFetchRequest } from '@sentry/types'; | ||
*/ | ||
export declare function addRequestDataToTransaction(transaction: Transaction | undefined, req: PolymorphicRequest, deps?: InjectedNodeDeps): void; | ||
export declare function addRequestDataToTransaction(transaction: Transaction | undefined, req: PolymorphicRequest, _deps?: InjectedNodeDeps): void; | ||
/** | ||
@@ -74,3 +74,2 @@ * Extracts a complete and parameterized path from the request object and uses it to construct transaction name. | ||
include?: string[]; | ||
deps?: InjectedNodeDeps; | ||
}): ExtractedNodeRequestData; | ||
@@ -77,0 +76,0 @@ /** |
@@ -1,13 +0,4 @@ | ||
import type { Severity, SeverityLevel } from '@sentry/types'; | ||
import type { SeverityLevel } from '@sentry/types'; | ||
export declare const validSeverityLevels: string[]; | ||
/** | ||
* Converts a string-based level into a member of the deprecated {@link Severity} enum. | ||
* | ||
* @deprecated `severityFromString` is deprecated. Please use `severityLevelFromString` instead. | ||
* | ||
* @param level String representation of Severity | ||
* @returns Severity | ||
*/ | ||
export declare function severityFromString(level: Severity | SeverityLevel | string): Severity; | ||
/** | ||
* Converts a string-based level into a `SeverityLevel`, normalizing it along the way. | ||
@@ -14,0 +5,0 @@ * |
import type { StackFrame, StackLineParser, StackParser } from '@sentry/types'; | ||
import type { GetModuleFn } from './node-stack-trace'; | ||
import { filenameIsInApp } from './node-stack-trace'; | ||
export { filenameIsInApp }; | ||
export declare const UNKNOWN_FUNCTION = "?"; | ||
/** | ||
@@ -31,9 +29,2 @@ * Creates a stack parser with the supplied line parsers | ||
export declare function getFunctionName(fn: unknown): string; | ||
/** | ||
* Node.js stack line parser | ||
* | ||
* This is in @sentry/utils so it can be used from the Electron SDK in the browser for when `nodeIntegration == true`. | ||
* This allows it to be used without referencing or importing any node specific code which causes bundlers to complain | ||
*/ | ||
export declare function nodeStackLineParser(getModule?: GetModuleFn): StackLineParser; | ||
//# sourceMappingURL=stacktrace.d.ts.map |
@@ -29,3 +29,3 @@ type PartialURL = { | ||
/** | ||
* Takes a URL object and returns a sanitized string which is safe to use as span description | ||
* Takes a URL object and returns a sanitized string which is safe to use as span name | ||
* see: https://develop.sentry.dev/sdk/data-handling/#structuring-data | ||
@@ -32,0 +32,0 @@ */ |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
1
1253280
392
13557
1
+ Added@sentry/types@8.0.0-alpha.1(transitive)
- Removed@sentry/types@7.105.0(transitive)
Updated@sentry/types@8.0.0-alpha.1