Socket
Socket
Sign inDemoInstall

@sentry/types

Package Overview
Dependencies
Maintainers
11
Versions
463
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.91.0 to 7.92.0

8

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

@@ -12,2 +12,8 @@ "repository": "git://github.com/getsentry/sentry-javascript.git",

},
"files": [
"cjs",
"esm",
"types",
"types-ts3.8"
],
"main": "cjs/index.js",

@@ -14,0 +20,0 @@ "module": "esm/index.js",

2

types-ts3.8/index.d.ts

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

export { Severity, SeverityLevel } from './severity';
export { Span, SpanContext, SpanOrigin } from './span';
export { Span, SpanContext, SpanOrigin, SpanAttributeValue, SpanAttributes } from './span';
export { StackFrame } from './stackframe';

@@ -35,0 +35,0 @@ export { Stacktrace, StackParser, StackLineParser, StackLineParserFn } from './stacktrace';

@@ -7,8 +7,8 @@ import { MeasurementUnit } from './measurement';

*/
export declare abstract class MetricInstance {
/*
* Returns the weight of the metric.
*/
readonly weight: number;
export interface MetricInstance {
/**
* Returns the weight of the metric.
*/
weight: number;
/**
* Adds a value to a metric.

@@ -15,0 +15,0 @@ */

import { Attachment } from './attachment';
import { Breadcrumb } from './breadcrumb';
import { Client } from './client';
import { Context, Contexts } from './context';

@@ -51,2 +52,12 @@ import { EventProcessor } from './eventprocessor';

export interface Scope {
/**
* Update the client on the scope.
*/
setClient(client: Client | undefined): void;
/**
* Get the client assigned to this scope.
*
* It is generally recommended to use the global function `Sentry.getClient()` instead, unless you know what you are doing.
*/
getClient(): Client | undefined;
/** Add new event processor that will be called after {@link applyToEvent}. */

@@ -53,0 +64,0 @@ addEventProcessor(callback: EventProcessor): this;

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

import { TraceContext } from './context';
import { Instrumenter } from './instrumenter';

@@ -9,2 +10,4 @@ import { Primitive } from './misc';

export type SpanOrigin = SpanOriginType | string | string | string;
export type SpanAttributeValue = string | number | boolean | Array<null | undefined | string> | Array<null | undefined | number> | Array<null | undefined | boolean>;
export type SpanAttributes = Record<string, SpanAttributeValue | undefined>;
/** Interface holding all properties that can be set on a Span on creation. */

@@ -58,2 +61,6 @@ export interface SpanContext {

/**
* Attributes of the Span.
*/
attributes?: SpanAttributes;
/**
* Timestamp in seconds (epoch time) indicating when the span started.

@@ -106,2 +113,6 @@ */

/**
* @inheritDoc
*/
attributes: SpanAttributes;
/**
* The transaction containing this span

@@ -139,2 +150,12 @@ */

/**
* Set a single attribute on the span.
* Set it to `undefined` to remove the attribute.
*/
setAttribute(key: string, value: SpanAttributeValue | undefined): void;
/**
* Set multiple attributes on the span.
* Any attribute set to `undefined` will be removed.
*/
setAttributes(attributes: SpanAttributes): void;
/**
* Sets the status attribute on the current span

@@ -152,5 +173,11 @@ * See: {@sentry/tracing SpanStatus} for possible values

* Set the name of the span.
*
* @deprecated Use `updateName()` instead.
*/
setName(name: string): void;
/**
* Update the name of the span.
*/
updateName(name: string): this;
/**
* Creates a new `Span` while setting the current `Span.id` as `parentSpanId`.

@@ -164,23 +191,22 @@ * Also the `sampled` decision will be inherited.

isSuccess(): boolean;
/** Return a traceparent compatible header string */
/**
* Return a traceparent compatible header string.
* @deprecated Use `spanToTraceHeader()` instead.
*/
toTraceparent(): string;
/** Returns the current span properties as a `SpanContext` */
/**
* Returns the current span properties as a `SpanContext`.
* @deprecated Use `toJSON()` or access the fields directly instead.
*/
toContext(): SpanContext;
/** Updates the current span with a new `SpanContext` */
/**
* Updates the current span with a new `SpanContext`.
* @deprecated Update the fields directly instead.
*/
updateWithContext(spanContext: SpanContext): this;
/** Convert the object to JSON for w. spans array info only */
getTraceContext(): {
data?: {
[key: string]: any;
};
description?: string;
op?: string;
parent_span_id?: string;
span_id: string;
status?: string;
tags?: {
[key: string]: Primitive;
};
trace_id: string;
};
/**
* Convert the object to JSON for w. spans array info only.
* @deprecated Use `spanToTraceContext()` util function instead.
*/
getTraceContext(): TraceContext;
/** Convert the object to JSON */

@@ -202,2 +228,3 @@ toJSON(): {

trace_id: string;
origin?: SpanOrigin;
};

@@ -204,0 +231,0 @@ }

@@ -7,3 +7,3 @@ import { Context } from './context';

import { PolymorphicRequest } from './polymorphics';
import { Span, SpanContext } from './span';
import { Span, SpanAttributes, SpanContext } from './span';
/**

@@ -66,2 +66,6 @@ * Interface holding Transaction-specific properties

/**
* @inheritDoc
*/
attributes: SpanAttributes;
/**
* Metadata about the transaction

@@ -90,5 +94,11 @@ */

setMeasurement(name: string, value: number, unit: MeasurementUnit): void;
/** Returns the current transaction properties as a `TransactionContext` */
/**
* Returns the current transaction properties as a `TransactionContext`.
* @deprecated Use `toJSON()` or access the fields directly instead.
*/
toContext(): TransactionContext;
/** Updates the current transaction with a new `TransactionContext` */
/**
* Updates the current transaction with a new `TransactionContext`.
* @deprecated Update the fields directly instead.
*/
updateWithContext(transactionContext: TransactionContext): this;

@@ -95,0 +105,0 @@ /**

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

export type { Severity, SeverityLevel } from './severity';
export type { Span, SpanContext, SpanOrigin } from './span';
export type { Span, SpanContext, SpanOrigin, SpanAttributeValue, SpanAttributes } from './span';
export type { StackFrame } from './stackframe';

@@ -35,0 +35,0 @@ export type { Stacktrace, StackParser, StackLineParser, StackLineParserFn } from './stacktrace';

@@ -7,7 +7,7 @@ import type { MeasurementUnit } from './measurement';

*/
export declare abstract class MetricInstance {
export interface MetricInstance {
/**
* Returns the weight of the metric.
*/
get weight(): number;
weight: number;
/**

@@ -14,0 +14,0 @@ * Adds a value to a metric.

import type { Attachment } from './attachment';
import type { Breadcrumb } from './breadcrumb';
import type { Client } from './client';
import type { Context, Contexts } from './context';

@@ -51,2 +52,12 @@ import type { EventProcessor } from './eventprocessor';

export interface Scope {
/**
* Update the client on the scope.
*/
setClient(client: Client | undefined): void;
/**
* Get the client assigned to this scope.
*
* It is generally recommended to use the global function `Sentry.getClient()` instead, unless you know what you are doing.
*/
getClient(): Client | undefined;
/** Add new event processor that will be called after {@link applyToEvent}. */

@@ -53,0 +64,0 @@ addEventProcessor(callback: EventProcessor): this;

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

import type { TraceContext } from './context';
import type { Instrumenter } from './instrumenter';

@@ -9,2 +10,4 @@ import type { Primitive } from './misc';

export type SpanOrigin = SpanOriginType | `${SpanOriginType}.${SpanOriginCategory}` | `${SpanOriginType}.${SpanOriginCategory}.${SpanOriginIntegrationName}` | `${SpanOriginType}.${SpanOriginCategory}.${SpanOriginIntegrationName}.${SpanOriginIntegrationPart}`;
export type SpanAttributeValue = string | number | boolean | Array<null | undefined | string> | Array<null | undefined | number> | Array<null | undefined | boolean>;
export type SpanAttributes = Record<string, SpanAttributeValue | undefined>;
/** Interface holding all properties that can be set on a Span on creation. */

@@ -58,2 +61,6 @@ export interface SpanContext {

/**
* Attributes of the Span.
*/
attributes?: SpanAttributes;
/**
* Timestamp in seconds (epoch time) indicating when the span started.

@@ -106,2 +113,6 @@ */

/**
* @inheritDoc
*/
attributes: SpanAttributes;
/**
* The transaction containing this span

@@ -139,2 +150,12 @@ */

/**
* Set a single attribute on the span.
* Set it to `undefined` to remove the attribute.
*/
setAttribute(key: string, value: SpanAttributeValue | undefined): void;
/**
* Set multiple attributes on the span.
* Any attribute set to `undefined` will be removed.
*/
setAttributes(attributes: SpanAttributes): void;
/**
* Sets the status attribute on the current span

@@ -152,5 +173,11 @@ * See: {@sentry/tracing SpanStatus} for possible values

* Set the name of the span.
*
* @deprecated Use `updateName()` instead.
*/
setName(name: string): void;
/**
* Update the name of the span.
*/
updateName(name: string): this;
/**
* Creates a new `Span` while setting the current `Span.id` as `parentSpanId`.

@@ -164,23 +191,22 @@ * Also the `sampled` decision will be inherited.

isSuccess(): boolean;
/** Return a traceparent compatible header string */
/**
* Return a traceparent compatible header string.
* @deprecated Use `spanToTraceHeader()` instead.
*/
toTraceparent(): string;
/** Returns the current span properties as a `SpanContext` */
/**
* Returns the current span properties as a `SpanContext`.
* @deprecated Use `toJSON()` or access the fields directly instead.
*/
toContext(): SpanContext;
/** Updates the current span with a new `SpanContext` */
/**
* Updates the current span with a new `SpanContext`.
* @deprecated Update the fields directly instead.
*/
updateWithContext(spanContext: SpanContext): this;
/** Convert the object to JSON for w. spans array info only */
getTraceContext(): {
data?: {
[key: string]: any;
};
description?: string;
op?: string;
parent_span_id?: string;
span_id: string;
status?: string;
tags?: {
[key: string]: Primitive;
};
trace_id: string;
};
/**
* Convert the object to JSON for w. spans array info only.
* @deprecated Use `spanToTraceContext()` util function instead.
*/
getTraceContext(): TraceContext;
/** Convert the object to JSON */

@@ -202,2 +228,3 @@ toJSON(): {

trace_id: string;
origin?: SpanOrigin;
};

@@ -204,0 +231,0 @@ }

@@ -7,3 +7,3 @@ import type { Context } from './context';

import type { PolymorphicRequest } from './polymorphics';
import type { Span, SpanContext } from './span';
import type { Span, SpanAttributes, SpanContext } from './span';
/**

@@ -66,2 +66,6 @@ * Interface holding Transaction-specific properties

/**
* @inheritDoc
*/
attributes: SpanAttributes;
/**
* Metadata about the transaction

@@ -90,5 +94,11 @@ */

setMeasurement(name: string, value: number, unit: MeasurementUnit): void;
/** Returns the current transaction properties as a `TransactionContext` */
/**
* Returns the current transaction properties as a `TransactionContext`.
* @deprecated Use `toJSON()` or access the fields directly instead.
*/
toContext(): TransactionContext;
/** Updates the current transaction with a new `TransactionContext` */
/**
* Updates the current transaction with a new `TransactionContext`.
* @deprecated Update the fields directly instead.
*/
updateWithContext(transactionContext: TransactionContext): this;

@@ -95,0 +105,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

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