@sentry/core
Advanced tools
Comparing version
@@ -5,3 +5,2 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); | ||
const debugBuild = require('./debug-build.js'); | ||
const log = require('./log.js'); | ||
const session = require('./session.js'); | ||
@@ -13,3 +12,2 @@ const is = require('./utils-hoist/is.js'); | ||
const worldwide = require('./utils-hoist/worldwide.js'); | ||
const parameterize = require('./utils/parameterize.js'); | ||
const prepareEvent = require('./utils/prepareEvent.js'); | ||
@@ -327,117 +325,2 @@ | ||
/** | ||
* A namespace for experimental logging functions. | ||
* | ||
* @experimental Will be removed in future versions. Use with caution. | ||
*/ | ||
const _experiment_log = { | ||
/** | ||
* A utility to record a log with level 'TRACE' and send it to sentry. | ||
* | ||
* Logs represent a message and some parameters which provide context for a trace or error. | ||
* | ||
* @example | ||
* ```js | ||
* const { trace, fmt } = Sentry._experiment_log; | ||
* trace(fmt`user ${username} just bought ${item}!`); | ||
* ``` | ||
*/ | ||
trace: log.sendLog('trace'), | ||
/** | ||
* A utility to record a log with level 'DEBUG' and send it to sentry. | ||
* | ||
* Logs represent a message and some parameters which provide context for a trace or error. | ||
* | ||
* @example | ||
* ```js | ||
* const { debug, fmt } = Sentry._experiment_log; | ||
* debug(fmt`user ${username} just bought ${item}!`); | ||
* ``` | ||
*/ | ||
debug: log.sendLog('debug'), | ||
/** | ||
* A utility to record a log with level 'INFO' and send it to sentry. | ||
* | ||
* Logs represent a message and some parameters which provide context for a trace or error. | ||
* | ||
* @example | ||
* ```js | ||
* const { info, fmt } = Sentry._experiment_log; | ||
* info(fmt`user ${username} just bought ${item}!`); | ||
* ``` | ||
*/ | ||
info: log.sendLog('info'), | ||
/** | ||
* A utility to record a log with level 'INFO' and send it to sentry. | ||
* | ||
* Logs represent a message and some parameters which provide context for a trace or error. | ||
* | ||
* @example | ||
* ```js | ||
* const { log, fmt } = Sentry._experiment_log; | ||
* log(fmt`user ${username} just bought ${item}!`); | ||
* ``` | ||
*/ | ||
log: log.sendLog('info', 10), | ||
/** | ||
* A utility to record a log with level 'ERROR' and send it to sentry. | ||
* | ||
* Logs represent a message and some parameters which provide context for a trace or error. | ||
* | ||
* @example | ||
* ```js | ||
* const { error, fmt } = Sentry._experiment_log; | ||
* error(fmt`user ${username} just bought ${item}!`); | ||
* ``` | ||
*/ | ||
error: log.sendLog('error'), | ||
/** | ||
* A utility to record a log with level 'WARN' and send it to sentry. | ||
* | ||
* Logs represent a message and some parameters which provide context for a trace or error. | ||
* | ||
* @example | ||
* ```js | ||
* const { warn, fmt } = Sentry._experiment_log; | ||
* warn(fmt`user ${username} just bought ${item}!`); | ||
* ``` | ||
*/ | ||
warn: log.sendLog('warn'), | ||
/** | ||
* A utility to record a log with level 'FATAL' and send it to sentry. | ||
* | ||
* Logs represent a message and some parameters which provide context for a trace or error. | ||
* | ||
* @example | ||
* ```js | ||
* const { fatal, fmt } = Sentry._experiment_log; | ||
* fatal(fmt`user ${username} just bought ${item}!`); | ||
* ``` | ||
*/ | ||
fatal: log.sendLog('fatal'), | ||
/** | ||
* Tagged template function which returns parameterized representation of the message | ||
* | ||
* @example | ||
* ```js | ||
* Sentry._experiment_log.fmt`This is a log statement with ${x} and ${y} params` | ||
* ``` | ||
*/ | ||
fmt: parameterize.parameterizeStringTemplate, | ||
/** | ||
* A flexible utility to record a log with a custom level and send it to sentry. | ||
* | ||
* You can optionally pass in custom attributes and a custom severity number to be attached to the log. | ||
* | ||
* @example | ||
* ```js | ||
* Sentry._experiment_log.emit({ level: 'info', message: Sentry._experiment_log.fmt`user ${username }just bought ${item}`, attributes: { extra: 123 } }) | ||
* ``` | ||
*/ | ||
emit: log.captureLog, | ||
}; | ||
exports._experiment_log = _experiment_log; | ||
exports.addEventProcessor = addEventProcessor; | ||
@@ -444,0 +327,0 @@ exports.captureCheckIn = captureCheckIn; |
@@ -154,3 +154,2 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); | ||
exports.createSpanEnvelope = envelope.createSpanEnvelope; | ||
exports._experiment_log = exports$1._experiment_log; | ||
exports.addEventProcessor = exports$1.addEventProcessor; | ||
@@ -157,0 +156,0 @@ exports.captureCheckIn = exports$1.captureCheckIn; |
@@ -12,2 +12,4 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); | ||
* | ||
* If the method on the passed object is not a function, the wrapper will not be applied. | ||
* | ||
* @param source An object that contains a method to be wrapped. | ||
@@ -26,3 +28,9 @@ * @param name The name of the method to be wrapped. | ||
// explicitly casting to unknown because we don't know the type of the method initially at all | ||
const original = source[name] ; | ||
if (typeof original !== 'function') { | ||
return; | ||
} | ||
const wrapped = replacementFactory(original) ; | ||
@@ -29,0 +37,0 @@ |
@@ -64,3 +64,3 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); | ||
function supportsHistory() { | ||
return 'history' in WINDOW; | ||
return 'history' in WINDOW && !!WINDOW.history; | ||
} | ||
@@ -67,0 +67,0 @@ |
@@ -5,5 +5,5 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); | ||
const SDK_VERSION = "9.6.0-alpha.0" ; | ||
const SDK_VERSION = "9.6.0" ; | ||
exports.SDK_VERSION = SDK_VERSION; | ||
//# sourceMappingURL=version.js.map |
@@ -19,23 +19,3 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); | ||
/** | ||
* Tagged template function which returns parameterized representation of the message | ||
* For example: parameterize`This is a log statement with ${x} and ${y} params`, would return: | ||
* "__sentry_template_string__": 'This is a log statement with %s and %s params', | ||
* "__sentry_template_values__": ['first', 'second'] | ||
* @param strings An array of string values splitted between expressions | ||
* @param values Expressions extracted from template string | ||
* @returns String with template information in __sentry_template_string__ and __sentry_template_values__ properties | ||
*/ | ||
function parameterizeStringTemplate( | ||
strings, | ||
...values | ||
) { | ||
const formatted = new String(String.raw(strings, ...values)) ; | ||
formatted.__sentry_template_string__ = strings.join('\x00').replace(/%/g, '%%').replace(/\0/g, '%s'); | ||
formatted.__sentry_template_values__ = values; | ||
return formatted; | ||
} | ||
exports.parameterize = parameterize; | ||
exports.parameterizeStringTemplate = parameterizeStringTemplate; | ||
//# sourceMappingURL=parameterize.js.map |
import { getCurrentScope, getIsolationScope, getClient, withIsolationScope } from './currentScopes.js'; | ||
import { DEBUG_BUILD } from './debug-build.js'; | ||
import { sendLog, captureLog } from './log.js'; | ||
import { makeSession, updateSession, closeSession } from './session.js'; | ||
@@ -10,3 +9,2 @@ import { isThenable } from './utils-hoist/is.js'; | ||
import { GLOBAL_OBJ } from './utils-hoist/worldwide.js'; | ||
import { parameterizeStringTemplate } from './utils/parameterize.js'; | ||
import { parseEventHintOrCaptureContext } from './utils/prepareEvent.js'; | ||
@@ -324,117 +322,3 @@ | ||
/** | ||
* A namespace for experimental logging functions. | ||
* | ||
* @experimental Will be removed in future versions. Use with caution. | ||
*/ | ||
const _experiment_log = { | ||
/** | ||
* A utility to record a log with level 'TRACE' and send it to sentry. | ||
* | ||
* Logs represent a message and some parameters which provide context for a trace or error. | ||
* | ||
* @example | ||
* ```js | ||
* const { trace, fmt } = Sentry._experiment_log; | ||
* trace(fmt`user ${username} just bought ${item}!`); | ||
* ``` | ||
*/ | ||
trace: sendLog('trace'), | ||
/** | ||
* A utility to record a log with level 'DEBUG' and send it to sentry. | ||
* | ||
* Logs represent a message and some parameters which provide context for a trace or error. | ||
* | ||
* @example | ||
* ```js | ||
* const { debug, fmt } = Sentry._experiment_log; | ||
* debug(fmt`user ${username} just bought ${item}!`); | ||
* ``` | ||
*/ | ||
debug: sendLog('debug'), | ||
/** | ||
* A utility to record a log with level 'INFO' and send it to sentry. | ||
* | ||
* Logs represent a message and some parameters which provide context for a trace or error. | ||
* | ||
* @example | ||
* ```js | ||
* const { info, fmt } = Sentry._experiment_log; | ||
* info(fmt`user ${username} just bought ${item}!`); | ||
* ``` | ||
*/ | ||
info: sendLog('info'), | ||
/** | ||
* A utility to record a log with level 'INFO' and send it to sentry. | ||
* | ||
* Logs represent a message and some parameters which provide context for a trace or error. | ||
* | ||
* @example | ||
* ```js | ||
* const { log, fmt } = Sentry._experiment_log; | ||
* log(fmt`user ${username} just bought ${item}!`); | ||
* ``` | ||
*/ | ||
log: sendLog('info', 10), | ||
/** | ||
* A utility to record a log with level 'ERROR' and send it to sentry. | ||
* | ||
* Logs represent a message and some parameters which provide context for a trace or error. | ||
* | ||
* @example | ||
* ```js | ||
* const { error, fmt } = Sentry._experiment_log; | ||
* error(fmt`user ${username} just bought ${item}!`); | ||
* ``` | ||
*/ | ||
error: sendLog('error'), | ||
/** | ||
* A utility to record a log with level 'WARN' and send it to sentry. | ||
* | ||
* Logs represent a message and some parameters which provide context for a trace or error. | ||
* | ||
* @example | ||
* ```js | ||
* const { warn, fmt } = Sentry._experiment_log; | ||
* warn(fmt`user ${username} just bought ${item}!`); | ||
* ``` | ||
*/ | ||
warn: sendLog('warn'), | ||
/** | ||
* A utility to record a log with level 'FATAL' and send it to sentry. | ||
* | ||
* Logs represent a message and some parameters which provide context for a trace or error. | ||
* | ||
* @example | ||
* ```js | ||
* const { fatal, fmt } = Sentry._experiment_log; | ||
* fatal(fmt`user ${username} just bought ${item}!`); | ||
* ``` | ||
*/ | ||
fatal: sendLog('fatal'), | ||
/** | ||
* Tagged template function which returns parameterized representation of the message | ||
* | ||
* @example | ||
* ```js | ||
* Sentry._experiment_log.fmt`This is a log statement with ${x} and ${y} params` | ||
* ``` | ||
*/ | ||
fmt: parameterizeStringTemplate, | ||
/** | ||
* A flexible utility to record a log with a custom level and send it to sentry. | ||
* | ||
* You can optionally pass in custom attributes and a custom severity number to be attached to the log. | ||
* | ||
* @example | ||
* ```js | ||
* Sentry._experiment_log.emit({ level: 'info', message: Sentry._experiment_log.fmt`user ${username }just bought ${item}`, attributes: { extra: 123 } }) | ||
* ``` | ||
*/ | ||
emit: captureLog, | ||
}; | ||
export { _experiment_log, addEventProcessor, captureCheckIn, captureEvent, captureException, captureMessage, captureSession, close, endSession, flush, isEnabled, isInitialized, lastEventId, setContext, setExtra, setExtras, setTag, setTags, setUser, startSession, withMonitor }; | ||
export { addEventProcessor, captureCheckIn, captureEvent, captureException, captureMessage, captureSession, close, endSession, flush, isEnabled, isInitialized, lastEventId, setContext, setExtra, setExtras, setTag, setTags, setUser, startSession, withMonitor }; | ||
//# sourceMappingURL=exports.js.map |
@@ -14,3 +14,3 @@ export { registerSpanErrorInstrumentation } from './tracing/errors.js'; | ||
export { createEventEnvelope, createSessionEnvelope, createSpanEnvelope } from './envelope.js'; | ||
export { _experiment_log, addEventProcessor, captureCheckIn, captureEvent, captureException, captureMessage, captureSession, close, endSession, flush, isEnabled, isInitialized, lastEventId, setContext, setExtra, setExtras, setTag, setTags, setUser, startSession, withMonitor } from './exports.js'; | ||
export { addEventProcessor, captureCheckIn, captureEvent, captureException, captureMessage, captureSession, close, endSession, flush, isEnabled, isInitialized, lastEventId, setContext, setExtra, setExtras, setTag, setTags, setUser, startSession, withMonitor } from './exports.js'; | ||
export { getClient, getCurrentScope, getGlobalScope, getIsolationScope, getTraceContextFromScope, withIsolationScope, withScope } from './currentScopes.js'; | ||
@@ -17,0 +17,0 @@ export { getDefaultCurrentScope, getDefaultIsolationScope } from './defaultScopes.js'; |
@@ -1,1 +0,1 @@ | ||
{"type":"module","version":"9.6.0-alpha.0","sideEffects":false} | ||
{"type":"module","version":"9.6.0","sideEffects":false} |
@@ -10,2 +10,4 @@ import { htmlTreeAsString } from './browser.js'; | ||
* | ||
* If the method on the passed object is not a function, the wrapper will not be applied. | ||
* | ||
* @param source An object that contains a method to be wrapped. | ||
@@ -24,3 +26,9 @@ * @param name The name of the method to be wrapped. | ||
// explicitly casting to unknown because we don't know the type of the method initially at all | ||
const original = source[name] ; | ||
if (typeof original !== 'function') { | ||
return; | ||
} | ||
const wrapped = replacementFactory(original) ; | ||
@@ -27,0 +35,0 @@ |
@@ -62,3 +62,3 @@ import { DEBUG_BUILD } from './debug-build.js'; | ||
function supportsHistory() { | ||
return 'history' in WINDOW; | ||
return 'history' in WINDOW && !!WINDOW.history; | ||
} | ||
@@ -65,0 +65,0 @@ |
// This is a magic string replaced by rollup | ||
const SDK_VERSION = "9.6.0-alpha.0" ; | ||
const SDK_VERSION = "9.6.0" ; | ||
export { SDK_VERSION }; | ||
//# sourceMappingURL=version.js.map |
@@ -17,22 +17,3 @@ /** | ||
/** | ||
* Tagged template function which returns parameterized representation of the message | ||
* For example: parameterize`This is a log statement with ${x} and ${y} params`, would return: | ||
* "__sentry_template_string__": 'This is a log statement with %s and %s params', | ||
* "__sentry_template_values__": ['first', 'second'] | ||
* @param strings An array of string values splitted between expressions | ||
* @param values Expressions extracted from template string | ||
* @returns String with template information in __sentry_template_string__ and __sentry_template_values__ properties | ||
*/ | ||
function parameterizeStringTemplate( | ||
strings, | ||
...values | ||
) { | ||
const formatted = new String(String.raw(strings, ...values)) ; | ||
formatted.__sentry_template_string__ = strings.join('\x00').replace(/%/g, '%%').replace(/\0/g, '%s'); | ||
formatted.__sentry_template_values__ = values; | ||
return formatted; | ||
} | ||
export { parameterize, parameterizeStringTemplate }; | ||
export { parameterize }; | ||
//# sourceMappingURL=parameterize.js.map |
@@ -1,5 +0,3 @@ | ||
import { captureLog } from './log'; | ||
import { CaptureContext } from './scope'; | ||
import { CheckIn, Event, EventHint, EventProcessor, Extra, Extras, MonitorConfig, Primitive, Session, SessionContext, SeverityLevel, User } from './types-hoist'; | ||
import { parameterizeStringTemplate } from './utils/parameterize'; | ||
import { ExclusiveEventHintOrCaptureContext } from './utils/prepareEvent'; | ||
@@ -148,113 +146,2 @@ /** | ||
export declare function captureSession(end?: boolean): void; | ||
/** | ||
* A namespace for experimental logging functions. | ||
* | ||
* @experimental Will be removed in future versions. Use with caution. | ||
*/ | ||
export declare const _experiment_log: { | ||
/** | ||
* A utility to record a log with level 'TRACE' and send it to sentry. | ||
* | ||
* Logs represent a message and some parameters which provide context for a trace or error. | ||
* | ||
* @example | ||
* ```js | ||
* const { trace, fmt } = Sentry._experiment_log; | ||
* trace(fmt`user ${username} just bought ${item}!`); | ||
* ``` | ||
*/ | ||
trace: (message: string | import("./types-hoist").ParameterizedString<unknown[]>, customAttributes?: Record<string, unknown> | undefined) => void; | ||
/** | ||
* A utility to record a log with level 'DEBUG' and send it to sentry. | ||
* | ||
* Logs represent a message and some parameters which provide context for a trace or error. | ||
* | ||
* @example | ||
* ```js | ||
* const { debug, fmt } = Sentry._experiment_log; | ||
* debug(fmt`user ${username} just bought ${item}!`); | ||
* ``` | ||
*/ | ||
debug: (message: string | import("./types-hoist").ParameterizedString<unknown[]>, customAttributes?: Record<string, unknown> | undefined) => void; | ||
/** | ||
* A utility to record a log with level 'INFO' and send it to sentry. | ||
* | ||
* Logs represent a message and some parameters which provide context for a trace or error. | ||
* | ||
* @example | ||
* ```js | ||
* const { info, fmt } = Sentry._experiment_log; | ||
* info(fmt`user ${username} just bought ${item}!`); | ||
* ``` | ||
*/ | ||
info: (message: string | import("./types-hoist").ParameterizedString<unknown[]>, customAttributes?: Record<string, unknown> | undefined) => void; | ||
/** | ||
* A utility to record a log with level 'INFO' and send it to sentry. | ||
* | ||
* Logs represent a message and some parameters which provide context for a trace or error. | ||
* | ||
* @example | ||
* ```js | ||
* const { log, fmt } = Sentry._experiment_log; | ||
* log(fmt`user ${username} just bought ${item}!`); | ||
* ``` | ||
*/ | ||
log: (message: string | import("./types-hoist").ParameterizedString<unknown[]>, customAttributes?: Record<string, unknown> | undefined) => void; | ||
/** | ||
* A utility to record a log with level 'ERROR' and send it to sentry. | ||
* | ||
* Logs represent a message and some parameters which provide context for a trace or error. | ||
* | ||
* @example | ||
* ```js | ||
* const { error, fmt } = Sentry._experiment_log; | ||
* error(fmt`user ${username} just bought ${item}!`); | ||
* ``` | ||
*/ | ||
error: (message: string | import("./types-hoist").ParameterizedString<unknown[]>, customAttributes?: Record<string, unknown> | undefined) => void; | ||
/** | ||
* A utility to record a log with level 'WARN' and send it to sentry. | ||
* | ||
* Logs represent a message and some parameters which provide context for a trace or error. | ||
* | ||
* @example | ||
* ```js | ||
* const { warn, fmt } = Sentry._experiment_log; | ||
* warn(fmt`user ${username} just bought ${item}!`); | ||
* ``` | ||
*/ | ||
warn: (message: string | import("./types-hoist").ParameterizedString<unknown[]>, customAttributes?: Record<string, unknown> | undefined) => void; | ||
/** | ||
* A utility to record a log with level 'FATAL' and send it to sentry. | ||
* | ||
* Logs represent a message and some parameters which provide context for a trace or error. | ||
* | ||
* @example | ||
* ```js | ||
* const { fatal, fmt } = Sentry._experiment_log; | ||
* fatal(fmt`user ${username} just bought ${item}!`); | ||
* ``` | ||
*/ | ||
fatal: (message: string | import("./types-hoist").ParameterizedString<unknown[]>, customAttributes?: Record<string, unknown> | undefined) => void; | ||
/** | ||
* Tagged template function which returns parameterized representation of the message | ||
* | ||
* @example | ||
* ```js | ||
* Sentry._experiment_log.fmt`This is a log statement with ${x} and ${y} params` | ||
* ``` | ||
*/ | ||
fmt: typeof parameterizeStringTemplate; | ||
/** | ||
* A flexible utility to record a log with a custom level and send it to sentry. | ||
* | ||
* You can optionally pass in custom attributes and a custom severity number to be attached to the log. | ||
* | ||
* @example | ||
* ```js | ||
* Sentry._experiment_log.emit({ level: 'info', message: Sentry._experiment_log.fmt`user ${username }just bought ${item}`, attributes: { extra: 123 } }) | ||
* ``` | ||
*/ | ||
emit: typeof captureLog; | ||
}; | ||
//# sourceMappingURL=exports.d.ts.map |
@@ -10,3 +10,3 @@ export { ClientClass as SentryCoreCurrentScopes } from './sdk'; | ||
export { createEventEnvelope, createSessionEnvelope, createSpanEnvelope } from './envelope'; | ||
export { captureCheckIn, withMonitor, captureException, captureEvent, captureMessage, lastEventId, close, flush, setContext, setExtra, setExtras, setTag, setTags, setUser, isInitialized, isEnabled, startSession, endSession, captureSession, addEventProcessor, _experiment_log, } from './exports'; | ||
export { captureCheckIn, withMonitor, captureException, captureEvent, captureMessage, lastEventId, close, flush, setContext, setExtra, setExtras, setTag, setTags, setUser, isInitialized, isEnabled, startSession, endSession, captureSession, addEventProcessor, } from './exports'; | ||
export { getCurrentScope, getIsolationScope, getGlobalScope, withScope, withIsolationScope, getClient, getTraceContextFromScope, } from './currentScopes'; | ||
@@ -13,0 +13,0 @@ export { getDefaultCurrentScope, getDefaultIsolationScope } from './defaultScopes'; |
@@ -160,6 +160,2 @@ import { CaptureContext } from '../scope'; | ||
[key: string]: any; | ||
/** | ||
* If logs support should be enabled. Defaults to false. | ||
*/ | ||
enableLogs?: boolean; | ||
}; | ||
@@ -166,0 +162,0 @@ /** |
@@ -1,5 +0,5 @@ | ||
export type ParameterizedString<Values = string[]> = string & { | ||
export type ParameterizedString = string & { | ||
__sentry_template_string__?: string; | ||
__sentry_template_values__?: Values; | ||
__sentry_template_values__?: string[]; | ||
}; | ||
//# sourceMappingURL=parameterize.d.ts.map |
@@ -5,2 +5,4 @@ import { WrappedFunction } from '../types-hoist'; | ||
* | ||
* If the method on the passed object is not a function, the wrapper will not be applied. | ||
* | ||
* @param source An object that contains a method to be wrapped. | ||
@@ -7,0 +9,0 @@ * @param name The name of the method to be wrapped. |
@@ -12,12 +12,2 @@ import { ParameterizedString } from '../types-hoist'; | ||
export declare function parameterize(strings: TemplateStringsArray, ...values: string[]): ParameterizedString; | ||
/** | ||
* Tagged template function which returns parameterized representation of the message | ||
* For example: parameterize`This is a log statement with ${x} and ${y} params`, would return: | ||
* "__sentry_template_string__": 'This is a log statement with %s and %s params', | ||
* "__sentry_template_values__": ['first', 'second'] | ||
* @param strings An array of string values splitted between expressions | ||
* @param values Expressions extracted from template string | ||
* @returns String with template information in __sentry_template_string__ and __sentry_template_values__ properties | ||
*/ | ||
export declare function parameterizeStringTemplate(strings: TemplateStringsArray, ...values: unknown[]): ParameterizedString<unknown[]>; | ||
//# sourceMappingURL=parameterize.d.ts.map |
@@ -1,5 +0,3 @@ | ||
import { captureLog } from './log'; | ||
import type { CaptureContext } from './scope'; | ||
import type { CheckIn, Event, EventHint, EventProcessor, Extra, Extras, MonitorConfig, Primitive, Session, SessionContext, SeverityLevel, User } from './types-hoist'; | ||
import { parameterizeStringTemplate } from './utils/parameterize'; | ||
import type { ExclusiveEventHintOrCaptureContext } from './utils/prepareEvent'; | ||
@@ -148,113 +146,2 @@ /** | ||
export declare function captureSession(end?: boolean): void; | ||
/** | ||
* A namespace for experimental logging functions. | ||
* | ||
* @experimental Will be removed in future versions. Use with caution. | ||
*/ | ||
export declare const _experiment_log: { | ||
/** | ||
* A utility to record a log with level 'TRACE' and send it to sentry. | ||
* | ||
* Logs represent a message and some parameters which provide context for a trace or error. | ||
* | ||
* @example | ||
* ```js | ||
* const { trace, fmt } = Sentry._experiment_log; | ||
* trace(fmt`user ${username} just bought ${item}!`); | ||
* ``` | ||
*/ | ||
trace: (message: string | import("./types-hoist").ParameterizedString<unknown[]>, customAttributes?: Record<string, unknown> | undefined) => void; | ||
/** | ||
* A utility to record a log with level 'DEBUG' and send it to sentry. | ||
* | ||
* Logs represent a message and some parameters which provide context for a trace or error. | ||
* | ||
* @example | ||
* ```js | ||
* const { debug, fmt } = Sentry._experiment_log; | ||
* debug(fmt`user ${username} just bought ${item}!`); | ||
* ``` | ||
*/ | ||
debug: (message: string | import("./types-hoist").ParameterizedString<unknown[]>, customAttributes?: Record<string, unknown> | undefined) => void; | ||
/** | ||
* A utility to record a log with level 'INFO' and send it to sentry. | ||
* | ||
* Logs represent a message and some parameters which provide context for a trace or error. | ||
* | ||
* @example | ||
* ```js | ||
* const { info, fmt } = Sentry._experiment_log; | ||
* info(fmt`user ${username} just bought ${item}!`); | ||
* ``` | ||
*/ | ||
info: (message: string | import("./types-hoist").ParameterizedString<unknown[]>, customAttributes?: Record<string, unknown> | undefined) => void; | ||
/** | ||
* A utility to record a log with level 'INFO' and send it to sentry. | ||
* | ||
* Logs represent a message and some parameters which provide context for a trace or error. | ||
* | ||
* @example | ||
* ```js | ||
* const { log, fmt } = Sentry._experiment_log; | ||
* log(fmt`user ${username} just bought ${item}!`); | ||
* ``` | ||
*/ | ||
log: (message: string | import("./types-hoist").ParameterizedString<unknown[]>, customAttributes?: Record<string, unknown> | undefined) => void; | ||
/** | ||
* A utility to record a log with level 'ERROR' and send it to sentry. | ||
* | ||
* Logs represent a message and some parameters which provide context for a trace or error. | ||
* | ||
* @example | ||
* ```js | ||
* const { error, fmt } = Sentry._experiment_log; | ||
* error(fmt`user ${username} just bought ${item}!`); | ||
* ``` | ||
*/ | ||
error: (message: string | import("./types-hoist").ParameterizedString<unknown[]>, customAttributes?: Record<string, unknown> | undefined) => void; | ||
/** | ||
* A utility to record a log with level 'WARN' and send it to sentry. | ||
* | ||
* Logs represent a message and some parameters which provide context for a trace or error. | ||
* | ||
* @example | ||
* ```js | ||
* const { warn, fmt } = Sentry._experiment_log; | ||
* warn(fmt`user ${username} just bought ${item}!`); | ||
* ``` | ||
*/ | ||
warn: (message: string | import("./types-hoist").ParameterizedString<unknown[]>, customAttributes?: Record<string, unknown> | undefined) => void; | ||
/** | ||
* A utility to record a log with level 'FATAL' and send it to sentry. | ||
* | ||
* Logs represent a message and some parameters which provide context for a trace or error. | ||
* | ||
* @example | ||
* ```js | ||
* const { fatal, fmt } = Sentry._experiment_log; | ||
* fatal(fmt`user ${username} just bought ${item}!`); | ||
* ``` | ||
*/ | ||
fatal: (message: string | import("./types-hoist").ParameterizedString<unknown[]>, customAttributes?: Record<string, unknown> | undefined) => void; | ||
/** | ||
* Tagged template function which returns parameterized representation of the message | ||
* | ||
* @example | ||
* ```js | ||
* Sentry._experiment_log.fmt`This is a log statement with ${x} and ${y} params` | ||
* ``` | ||
*/ | ||
fmt: typeof parameterizeStringTemplate; | ||
/** | ||
* A flexible utility to record a log with a custom level and send it to sentry. | ||
* | ||
* You can optionally pass in custom attributes and a custom severity number to be attached to the log. | ||
* | ||
* @example | ||
* ```js | ||
* Sentry._experiment_log.emit({ level: 'info', message: Sentry._experiment_log.fmt`user ${username }just bought ${item}`, attributes: { extra: 123 } }) | ||
* ``` | ||
*/ | ||
emit: typeof captureLog; | ||
}; | ||
//# sourceMappingURL=exports.d.ts.map |
@@ -10,3 +10,3 @@ export type { ClientClass as SentryCoreCurrentScopes } from './sdk'; | ||
export { createEventEnvelope, createSessionEnvelope, createSpanEnvelope } from './envelope'; | ||
export { captureCheckIn, withMonitor, captureException, captureEvent, captureMessage, lastEventId, close, flush, setContext, setExtra, setExtras, setTag, setTags, setUser, isInitialized, isEnabled, startSession, endSession, captureSession, addEventProcessor, _experiment_log, } from './exports'; | ||
export { captureCheckIn, withMonitor, captureException, captureEvent, captureMessage, lastEventId, close, flush, setContext, setExtra, setExtras, setTag, setTags, setUser, isInitialized, isEnabled, startSession, endSession, captureSession, addEventProcessor, } from './exports'; | ||
export { getCurrentScope, getIsolationScope, getGlobalScope, withScope, withIsolationScope, getClient, getTraceContextFromScope, } from './currentScopes'; | ||
@@ -13,0 +13,0 @@ export { getDefaultCurrentScope, getDefaultIsolationScope } from './defaultScopes'; |
@@ -160,6 +160,2 @@ import type { CaptureContext } from '../scope'; | ||
[key: string]: any; | ||
/** | ||
* If logs support should be enabled. Defaults to false. | ||
*/ | ||
enableLogs?: boolean; | ||
}; | ||
@@ -166,0 +162,0 @@ /** |
@@ -1,5 +0,5 @@ | ||
export type ParameterizedString<Values = string[]> = string & { | ||
export type ParameterizedString = string & { | ||
__sentry_template_string__?: string; | ||
__sentry_template_values__?: Values; | ||
__sentry_template_values__?: string[]; | ||
}; | ||
//# sourceMappingURL=parameterize.d.ts.map |
@@ -5,2 +5,4 @@ import type { WrappedFunction } from '../types-hoist'; | ||
* | ||
* If the method on the passed object is not a function, the wrapper will not be applied. | ||
* | ||
* @param source An object that contains a method to be wrapped. | ||
@@ -7,0 +9,0 @@ * @param name The name of the method to be wrapped. |
@@ -12,12 +12,2 @@ import type { ParameterizedString } from '../types-hoist'; | ||
export declare function parameterize(strings: TemplateStringsArray, ...values: string[]): ParameterizedString; | ||
/** | ||
* Tagged template function which returns parameterized representation of the message | ||
* For example: parameterize`This is a log statement with ${x} and ${y} params`, would return: | ||
* "__sentry_template_string__": 'This is a log statement with %s and %s params', | ||
* "__sentry_template_values__": ['first', 'second'] | ||
* @param strings An array of string values splitted between expressions | ||
* @param values Expressions extracted from template string | ||
* @returns String with template information in __sentry_template_string__ and __sentry_template_values__ properties | ||
*/ | ||
export declare function parameterizeStringTemplate(strings: TemplateStringsArray, ...values: unknown[]): ParameterizedString<unknown[]>; | ||
//# sourceMappingURL=parameterize.d.ts.map |
{ | ||
"name": "@sentry/core", | ||
"version": "9.6.0-alpha.0", | ||
"version": "9.6.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
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
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
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
0
-100%3129629
-2.05%981
-0.71%37114
-2.4%