Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@sentry/types

Package Overview
Dependencies
Maintainers
11
Versions
481
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sentry/types - npm Package Compare versions

Comparing version 7.93.0 to 7.94.0

2

package.json
{
"name": "@sentry/types",
"version": "7.93.0",
"version": "7.94.0",
"description": "Types for all Sentry JavaScript SDKs",

@@ -5,0 +5,0 @@ "repository": "git://github.com/getsentry/sentry-javascript.git",

@@ -50,4 +50,6 @@ import { TraceContext } from './context';

timezone?: SerializedMonitorConfig['timezone'];
failure_issue_threshold?: number;
recovery_threshold?: number;
}
export {};
//# sourceMappingURL=checkin.d.ts.map

@@ -121,4 +121,9 @@ import { Breadcrumb, BreadcrumbHint } from './breadcrumb';

getEventProcessors?(): EventProcessor[];
/** Returns the client's instance of the given integration class, it any. */
/**
* Returns the client's instance of the given integration class, it any.
* @deprecated Use `getIntegrationByName()` instead.
*/
getIntegration<T extends Integration>(integration: IntegrationClass<T>): T | null;
/** Get the instance of the integration with the given name on the client, if it was added. */
getIntegrationByName?<T extends Integration = Integration>(name: string): T | undefined;
/**

@@ -133,4 +138,12 @@ * Add an integration to the client.

addIntegration?(integration: Integration): void;
/** This is an internal function to setup all integrations that should run on the client */
/**
* This is an internal function to setup all integrations that should run on the client.
* @deprecated Use `client.init()` instead.
*/
setupIntegrations(forceInitialize?: boolean): void;
/**
* Initialize this client.
* Call this after the client was set on a scope.
*/
init?(): void;
/** Creates an {@link Event} from all inputs to `captureException` and non-primitive inputs to `captureMessage`. */

@@ -137,0 +150,0 @@ eventFromException(exception: any, hint?: EventHint): PromiseLike<Event>;

@@ -19,2 +19,5 @@ import { SerializedCheckIn } from './checkin';

transaction?: string;
/**
* @deprecated Functonality for segment has been removed.
*/
user_segment?: string;

@@ -21,0 +24,0 @@ replay_id?: string;

@@ -14,3 +14,3 @@ import { Attachment } from './attachment';

import { Severity, SeverityLevel } from './severity';
import { Span } from './span';
import { Span, SpanJSON } from './span';
import { Thread } from './thread';

@@ -90,2 +90,12 @@ import { TransactionSource } from './transaction';

}
/**
* Represents the event that's sent in an event envelope, omitting interfaces that are no longer representative after
* event serialization.
*/
export interface SerializedEvent extends Pick<Event, Exclude<keyof Event, 'spans'>> {
/**
* POJO objects of spans belonging to this event.
*/
spans?: SpanJSON[];
}
//# sourceMappingURL=event.d.ts.map

@@ -23,3 +23,3 @@ import { Breadcrumb, BreadcrumbHint } from './breadcrumb';

*
* @hidden
* @deprecated This will be removed in v8.
*/

@@ -30,2 +30,4 @@ isOlderThan(version: number): boolean;

* @param client An SDK client (client) instance.
*
* @deprecated Use `initAndBind()` directly.
*/

@@ -68,7 +70,15 @@ bindClient(client?: Client): void;

* @param callback that will be enclosed into push/popScope.
*
* @deprecated Use `Sentry.withScope()` instead.
*/
withScope<T>(callback: (scope: Scope) => T): T;
/** Returns the client of the top stack. */
/**
* Returns the client of the top stack.
* @deprecated Use `Sentry.getClient()` instead.
*/
getClient(): Client | undefined;
/** Returns the scope of the top stack */
/**
* Returns the scope of the top stack.
* @deprecated Use `Sentry.getCurrentScope()` instead.
*/
getScope(): Scope;

@@ -78,2 +88,4 @@ /**

* The isolation scope is used to isolate data between different hubs.
*
* @deprecated Use `Sentry.getIsolationScope()` instead.
*/

@@ -87,2 +99,4 @@ getIsolationScope(): Scope;

* @returns The generated eventId.
*
* @deprecated Use `Sentry.captureException()` instead.
*/

@@ -97,2 +111,4 @@ captureException(exception: any, hint?: EventHint): string;

* @returns The generated eventId.
*
* @deprecated Use `Sentry.captureMessage()` instead.
*/

@@ -105,2 +121,4 @@ captureMessage(message: string, level?: Severity | SeverityLevel, hint?: EventHint): string;

* @param hint May contain additional information about the original exception.
*
* @deprecated Use `Sentry.captureEvent()` instead.
*/

@@ -112,2 +130,4 @@ captureEvent(event: Event, hint?: EventHint): string;

* @returns The last event id of a captured event.
*
* @deprecated This will be removed in v8.
*/

@@ -123,2 +143,4 @@ lastEventId(): string | undefined;

* @param hint May contain additional information about the original breadcrumb.
*
* @deprecated Use `Sentry.addBreadcrumb()` instead.
*/

@@ -130,2 +152,4 @@ addBreadcrumb(breadcrumb: Breadcrumb, hint?: BreadcrumbHint): void;

* @param user User context object to be set in the current context. Pass `null` to unset the user.
*
* @deprecated Use `Sentry.setUser()` instead.
*/

@@ -137,2 +161,4 @@ setUser(user: User | null): void;

* @param tags Tags context object to merge into current context.
*
* @deprecated Use `Sentry.setTags()` instead.
*/

@@ -149,2 +175,4 @@ setTags(tags: {

* @param value Value of tag
*
* @deprecated Use `Sentry.setTag()` instead.
*/

@@ -156,2 +184,4 @@ setTag(key: string, value: Primitive): void;

* @param extra Any kind of data. This data will be normalized.
*
* @deprecated Use `Sentry.setExtra()` instead.
*/

@@ -162,2 +192,4 @@ setExtra(key: string, extra: Extra): void;

* @param extras Extras object to merge into current context.
*
* @deprecated Use `Sentry.setExtras()` instead.
*/

@@ -169,2 +201,4 @@ setExtras(extras: Extras): void;

* @param context Any kind of data. This data will be normalized.
*
* @deprecated Use `Sentry.setContext()` instead.
*/

@@ -185,7 +219,17 @@ setContext(name: string, context: {

* e.g.: Reporting issues to your own sentry when running in your component while still using the users configuration.
*
* TODO v8: This will be merged with `withScope()`
*/
run(callback: (hub: Hub) => void): void;
/** Returns the integration if installed on the current client. */
/**
* Returns the integration if installed on the current client.
*
* @deprecated Use `Sentry.getClient().getIntegration()` instead.
*/
getIntegration<T extends Integration>(integration: IntegrationClass<T>): T | null;
/** Returns all trace headers that are currently on the top scope. */
/**
* Returns all trace headers that are currently on the top scope.
*
* @deprecated Use `spanToTraceHeader()` instead.
*/
traceHeaders(): {

@@ -192,0 +236,0 @@ [key: string]: string;

@@ -11,3 +11,3 @@ export { Attachment } from './attachment';

export { ExtendedError } from './error';
export { Event, EventHint, EventType, ErrorEvent, TransactionEvent } from './event';
export { Event, EventHint, EventType, ErrorEvent, TransactionEvent, SerializedEvent } from './event';
export { EventProcessor } from './eventprocessor';

@@ -14,0 +14,0 @@ export { Exception } from './exception';

@@ -13,7 +13,4 @@ import { Client } from './client';

}
/**
* An integration in function form.
* This is expected to return an integration result,
*/
export type IntegrationFn = (...rest: any[]) => IntegrationFnResult;
/** Integration interface.
* This is more or less the same as `Integration`, but with a slimmer `setupOnce` siganture. */
export interface IntegrationFnResult {

@@ -27,4 +24,6 @@ /**

* It does not receives any arguments, and should only use for e.g. global monkey patching and similar things.
*
* NOTE: In v8, this will become optional.
*/
setupOnce?(): void;
setupOnce(): void;
/**

@@ -50,11 +49,18 @@ * Set up an integration for the given client.

}
/**
* An integration in function form.
* This is expected to return an integration.
*/
export type IntegrationFn = (...rest: any[]) => IntegrationFnResult;
/** Integration interface */
export interface Integration {
/**
* Returns {@link IntegrationClass.id}
* The name of the integration.
*/
name: string;
/**
* Sets the integration up only once.
* This takes no options on purpose, options should be passed in the constructor
* This hook is only called once, even if multiple clients are created.
* It does not receives any arguments, and should only use for e.g. global monkey patching and similar things.
*
* NOTE: In v8, this will become optional, and not receive any arguments anymore.
*/

@@ -61,0 +67,0 @@ setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void;

@@ -137,3 +137,3 @@ import { TraceContext } from './context';

/** Span holding trace_id, span_id */
export interface Span extends SpanContext {
export interface Span extends Pick<SpanContext, Exclude<keyof SpanContext, 'op' | 'status'>> {
/**

@@ -145,2 +145,9 @@ * Human-readable identifier for the span. Identical to span.description.

/**
* Operation of the Span.
*
* @deprecated Use `startSpan()` functions to set, `span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_OP, 'op')
* to update and `spanToJSON().op` to read the op instead
*/
op?: string;
/**
* The ID of the span.

@@ -161,6 +168,12 @@ * @deprecated Use `spanContext().spanId` instead.

/**
* @inheritDoc
* Timestamp in seconds (epoch time) indicating when the span started.
* @deprecated Use `spanToJSON()` instead.
*/
startTimestamp: number;
/**
* Timestamp in seconds (epoch time) indicating when the span ended.
* @deprecated Use `spanToJSON()` instead.
*/
endTimestamp?: number;
/**
* Tags for the span.

@@ -186,2 +199,3 @@ * @deprecated Use `getSpanAttributes(span)` instead.

* The transaction containing this span
* @deprecated Use top level `Sentry.getRootSpan()` instead
*/

@@ -191,5 +205,15 @@ transaction?: Transaction;

* The instrumenter that created this span.
*
* @deprecated this field will be removed.
*/
instrumenter: Instrumenter;
/**
* Completion status of the Span.
*
* See: {@sentry/tracing SpanStatus} for possible values
*
* @deprecated Use `.setStatus` to set or update and `spanToJSON()` to read the status.
*/
status?: string;
/**
* Get context data for this span.

@@ -201,3 +225,6 @@ * This includes the spanId & the traceId.

* Sets the finish timestamp on the current span.
*
* @param endTimestamp Takes an endTimestamp if the end should not be the time when you call this function.
*
* @deprecated Use `.end()` instead.
*/

@@ -266,2 +293,4 @@ finish(endTimestamp?: number): void;

* Determines whether span was successful (HTTP200)
*
* @deprecated Use `spanToJSON(span).status === 'ok'` instead.
*/

@@ -268,0 +297,0 @@ isSuccess(): boolean;

@@ -91,2 +91,4 @@ import { Context } from './context';

* The instrumenter that created this transaction.
*
* @deprecated This field will be removed in v8.
*/

@@ -96,2 +98,4 @@ instrumenter: Instrumenter;

* Set the name of the transaction
*
* @deprecated Use `.updateName()` and `.setAttribute()` instead.
*/

@@ -110,2 +114,4 @@ setName(name: string, source?: TransactionMetadata['source']): void;

* @param unit Unit of the measurement. (Defaults to an empty string)
*
* @deprecated Use top-level `setMeasurement()` instead.
*/

@@ -112,0 +118,0 @@ setMeasurement(name: string, value: number, unit: MeasurementUnit): void;

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

/** JSDoc */
/**
* An interface describing a user of an application or a handled request.
*/
export interface User {

@@ -8,2 +10,5 @@ [key: string]: any;

username?: string;
/**
* @deprecated Functonality for segment has been removed. Use a custom tag or context instead to capture this information.
*/
segment?: string;

@@ -10,0 +15,0 @@ }

@@ -50,4 +50,6 @@ import type { TraceContext } from './context';

timezone?: SerializedMonitorConfig['timezone'];
failure_issue_threshold?: number;
recovery_threshold?: number;
}
export {};
//# sourceMappingURL=checkin.d.ts.map

@@ -121,4 +121,9 @@ import type { Breadcrumb, BreadcrumbHint } from './breadcrumb';

getEventProcessors?(): EventProcessor[];
/** Returns the client's instance of the given integration class, it any. */
/**
* Returns the client's instance of the given integration class, it any.
* @deprecated Use `getIntegrationByName()` instead.
*/
getIntegration<T extends Integration>(integration: IntegrationClass<T>): T | null;
/** Get the instance of the integration with the given name on the client, if it was added. */
getIntegrationByName?<T extends Integration = Integration>(name: string): T | undefined;
/**

@@ -133,4 +138,12 @@ * Add an integration to the client.

addIntegration?(integration: Integration): void;
/** This is an internal function to setup all integrations that should run on the client */
/**
* This is an internal function to setup all integrations that should run on the client.
* @deprecated Use `client.init()` instead.
*/
setupIntegrations(forceInitialize?: boolean): void;
/**
* Initialize this client.
* Call this after the client was set on a scope.
*/
init?(): void;
/** Creates an {@link Event} from all inputs to `captureException` and non-primitive inputs to `captureMessage`. */

@@ -137,0 +150,0 @@ eventFromException(exception: any, hint?: EventHint): PromiseLike<Event>;

@@ -19,2 +19,5 @@ import type { SerializedCheckIn } from './checkin';

transaction?: string;
/**
* @deprecated Functonality for segment has been removed.
*/
user_segment?: string;

@@ -21,0 +24,0 @@ replay_id?: string;

@@ -14,3 +14,3 @@ import type { Attachment } from './attachment';

import type { Severity, SeverityLevel } from './severity';
import type { Span } from './span';
import type { Span, SpanJSON } from './span';
import type { Thread } from './thread';

@@ -90,2 +90,12 @@ import type { TransactionSource } from './transaction';

}
/**
* Represents the event that's sent in an event envelope, omitting interfaces that are no longer representative after
* event serialization.
*/
export interface SerializedEvent extends Omit<Event, 'spans'> {
/**
* POJO objects of spans belonging to this event.
*/
spans?: SpanJSON[];
}
//# sourceMappingURL=event.d.ts.map

@@ -23,3 +23,3 @@ import type { Breadcrumb, BreadcrumbHint } from './breadcrumb';

*
* @hidden
* @deprecated This will be removed in v8.
*/

@@ -30,2 +30,4 @@ isOlderThan(version: number): boolean;

* @param client An SDK client (client) instance.
*
* @deprecated Use `initAndBind()` directly.
*/

@@ -68,7 +70,15 @@ bindClient(client?: Client): void;

* @param callback that will be enclosed into push/popScope.
*
* @deprecated Use `Sentry.withScope()` instead.
*/
withScope<T>(callback: (scope: Scope) => T): T;
/** Returns the client of the top stack. */
/**
* Returns the client of the top stack.
* @deprecated Use `Sentry.getClient()` instead.
*/
getClient(): Client | undefined;
/** Returns the scope of the top stack */
/**
* Returns the scope of the top stack.
* @deprecated Use `Sentry.getCurrentScope()` instead.
*/
getScope(): Scope;

@@ -78,2 +88,4 @@ /**

* The isolation scope is used to isolate data between different hubs.
*
* @deprecated Use `Sentry.getIsolationScope()` instead.
*/

@@ -87,2 +99,4 @@ getIsolationScope(): Scope;

* @returns The generated eventId.
*
* @deprecated Use `Sentry.captureException()` instead.
*/

@@ -97,2 +111,4 @@ captureException(exception: any, hint?: EventHint): string;

* @returns The generated eventId.
*
* @deprecated Use `Sentry.captureMessage()` instead.
*/

@@ -105,2 +121,4 @@ captureMessage(message: string, level?: Severity | SeverityLevel, hint?: EventHint): string;

* @param hint May contain additional information about the original exception.
*
* @deprecated Use `Sentry.captureEvent()` instead.
*/

@@ -112,2 +130,4 @@ captureEvent(event: Event, hint?: EventHint): string;

* @returns The last event id of a captured event.
*
* @deprecated This will be removed in v8.
*/

@@ -123,2 +143,4 @@ lastEventId(): string | undefined;

* @param hint May contain additional information about the original breadcrumb.
*
* @deprecated Use `Sentry.addBreadcrumb()` instead.
*/

@@ -130,2 +152,4 @@ addBreadcrumb(breadcrumb: Breadcrumb, hint?: BreadcrumbHint): void;

* @param user User context object to be set in the current context. Pass `null` to unset the user.
*
* @deprecated Use `Sentry.setUser()` instead.
*/

@@ -137,2 +161,4 @@ setUser(user: User | null): void;

* @param tags Tags context object to merge into current context.
*
* @deprecated Use `Sentry.setTags()` instead.
*/

@@ -149,2 +175,4 @@ setTags(tags: {

* @param value Value of tag
*
* @deprecated Use `Sentry.setTag()` instead.
*/

@@ -156,2 +184,4 @@ setTag(key: string, value: Primitive): void;

* @param extra Any kind of data. This data will be normalized.
*
* @deprecated Use `Sentry.setExtra()` instead.
*/

@@ -162,2 +192,4 @@ setExtra(key: string, extra: Extra): void;

* @param extras Extras object to merge into current context.
*
* @deprecated Use `Sentry.setExtras()` instead.
*/

@@ -169,2 +201,4 @@ setExtras(extras: Extras): void;

* @param context Any kind of data. This data will be normalized.
*
* @deprecated Use `Sentry.setContext()` instead.
*/

@@ -185,7 +219,17 @@ setContext(name: string, context: {

* e.g.: Reporting issues to your own sentry when running in your component while still using the users configuration.
*
* TODO v8: This will be merged with `withScope()`
*/
run(callback: (hub: Hub) => void): void;
/** Returns the integration if installed on the current client. */
/**
* Returns the integration if installed on the current client.
*
* @deprecated Use `Sentry.getClient().getIntegration()` instead.
*/
getIntegration<T extends Integration>(integration: IntegrationClass<T>): T | null;
/** Returns all trace headers that are currently on the top scope. */
/**
* Returns all trace headers that are currently on the top scope.
*
* @deprecated Use `spanToTraceHeader()` instead.
*/
traceHeaders(): {

@@ -192,0 +236,0 @@ [key: string]: string;

@@ -11,3 +11,3 @@ export type { Attachment } from './attachment';

export type { ExtendedError } from './error';
export type { Event, EventHint, EventType, ErrorEvent, TransactionEvent } from './event';
export type { Event, EventHint, EventType, ErrorEvent, TransactionEvent, SerializedEvent } from './event';
export type { EventProcessor } from './eventprocessor';

@@ -14,0 +14,0 @@ export type { Exception } from './exception';

@@ -13,7 +13,4 @@ import type { Client } from './client';

}
/**
* An integration in function form.
* This is expected to return an integration result,
*/
export type IntegrationFn = (...rest: any[]) => IntegrationFnResult;
/** Integration interface.
* This is more or less the same as `Integration`, but with a slimmer `setupOnce` siganture. */
export interface IntegrationFnResult {

@@ -27,4 +24,6 @@ /**

* It does not receives any arguments, and should only use for e.g. global monkey patching and similar things.
*
* NOTE: In v8, this will become optional.
*/
setupOnce?(): void;
setupOnce(): void;
/**

@@ -50,11 +49,18 @@ * Set up an integration for the given client.

}
/**
* An integration in function form.
* This is expected to return an integration.
*/
export type IntegrationFn = (...rest: any[]) => IntegrationFnResult;
/** Integration interface */
export interface Integration {
/**
* Returns {@link IntegrationClass.id}
* The name of the integration.
*/
name: string;
/**
* Sets the integration up only once.
* This takes no options on purpose, options should be passed in the constructor
* This hook is only called once, even if multiple clients are created.
* It does not receives any arguments, and should only use for e.g. global monkey patching and similar things.
*
* NOTE: In v8, this will become optional, and not receive any arguments anymore.
*/

@@ -61,0 +67,0 @@ setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void;

@@ -137,3 +137,3 @@ import type { TraceContext } from './context';

/** Span holding trace_id, span_id */
export interface Span extends SpanContext {
export interface Span extends Omit<SpanContext, 'op' | 'status'> {
/**

@@ -145,2 +145,9 @@ * Human-readable identifier for the span. Identical to span.description.

/**
* Operation of the Span.
*
* @deprecated Use `startSpan()` functions to set, `span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_OP, 'op')
* to update and `spanToJSON().op` to read the op instead
*/
op?: string;
/**
* The ID of the span.

@@ -161,6 +168,12 @@ * @deprecated Use `spanContext().spanId` instead.

/**
* @inheritDoc
* Timestamp in seconds (epoch time) indicating when the span started.
* @deprecated Use `spanToJSON()` instead.
*/
startTimestamp: number;
/**
* Timestamp in seconds (epoch time) indicating when the span ended.
* @deprecated Use `spanToJSON()` instead.
*/
endTimestamp?: number;
/**
* Tags for the span.

@@ -186,2 +199,3 @@ * @deprecated Use `getSpanAttributes(span)` instead.

* The transaction containing this span
* @deprecated Use top level `Sentry.getRootSpan()` instead
*/

@@ -191,5 +205,15 @@ transaction?: Transaction;

* The instrumenter that created this span.
*
* @deprecated this field will be removed.
*/
instrumenter: Instrumenter;
/**
* Completion status of the Span.
*
* See: {@sentry/tracing SpanStatus} for possible values
*
* @deprecated Use `.setStatus` to set or update and `spanToJSON()` to read the status.
*/
status?: string;
/**
* Get context data for this span.

@@ -201,3 +225,6 @@ * This includes the spanId & the traceId.

* Sets the finish timestamp on the current span.
*
* @param endTimestamp Takes an endTimestamp if the end should not be the time when you call this function.
*
* @deprecated Use `.end()` instead.
*/

@@ -266,2 +293,4 @@ finish(endTimestamp?: number): void;

* Determines whether span was successful (HTTP200)
*
* @deprecated Use `spanToJSON(span).status === 'ok'` instead.
*/

@@ -268,0 +297,0 @@ isSuccess(): boolean;

@@ -91,2 +91,4 @@ import type { Context } from './context';

* The instrumenter that created this transaction.
*
* @deprecated This field will be removed in v8.
*/

@@ -96,2 +98,4 @@ instrumenter: Instrumenter;

* Set the name of the transaction
*
* @deprecated Use `.updateName()` and `.setAttribute()` instead.
*/

@@ -110,2 +114,4 @@ setName(name: string, source?: TransactionMetadata['source']): void;

* @param unit Unit of the measurement. (Defaults to an empty string)
*
* @deprecated Use top-level `setMeasurement()` instead.
*/

@@ -112,0 +118,0 @@ setMeasurement(name: string, value: number, unit: MeasurementUnit): void;

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

/** JSDoc */
/**
* An interface describing a user of an application or a handled request.
*/
export interface User {

@@ -8,2 +10,5 @@ [key: string]: any;

username?: string;
/**
* @deprecated Functonality for segment has been removed. Use a custom tag or context instead to capture this information.
*/
segment?: string;

@@ -10,0 +15,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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc