Socket
Socket
Sign inDemoInstall

@sentry/types

Package Overview
Dependencies
0
Maintainers
11
Versions
417
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 8.0.0-alpha.7 to 8.0.0-alpha.8

types-ts3.8/timedEvent.d.ts

2

package.json
{
"name": "@sentry/types",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Types for all Sentry JavaScript SDKs",

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

@@ -17,11 +17,2 @@ import { Breadcrumb, BreadcrumbHint } from './breadcrumb';

/**
* Checks if this hub's version is older than the given version.
*
* @param version A version number to compare to.
* @return True if the given version is newer; otherwise false.
*
* @deprecated This will be removed in v8.
*/
isOlderThan(version: number): boolean;
/**
* This binds the given client to the current scope.

@@ -34,25 +25,2 @@ * @param client An SDK client (client) instance.

/**
* Create a new scope to store context information.
*
* The scope will be layered on top of the current one. It is isolated, i.e. all
* breadcrumbs and context information added to this scope will be removed once
* the scope ends. Be sure to always remove this scope with {@link this.popScope}
* when the operation finishes or throws.
*
* @returns Scope, the new cloned scope
*
* @deprecated Use `withScope` instead.
*/
pushScope(): Scope;
/**
* Removes a previously pushed scope from the stack.
*
* This restores the state before the scope was pushed. All breadcrumbs and
* context information added since the last call to {@link this.pushScope} are
* discarded.
*
* @deprecated Use `withScope` instead.
*/
popScope(): boolean;
/**
* Creates a new scope with and executes the given operation within.

@@ -221,11 +189,3 @@ * The scope is automatically removed once the operation

captureSession(endSession?: boolean): void;
/**
* Returns if default PII should be sent to Sentry and propagated in outgoing requests
* when Tracing is used.
*
* @deprecated Use top-level `getClient().getOptions().sendDefaultPii` instead. This function
* only unnecessarily increased API surface but only wrapped accessing the option.
*/
shouldSendDefaultPii(): boolean;
}
//# sourceMappingURL=hub.d.ts.map

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

export { SeverityLevel } from './severity';
export { Span, SpanContext, SpanOrigin, SpanAttributeValue, SpanAttributes, SpanTimeInput, SpanJSON, SpanContextData, TraceFlag, MetricSummary, } from './span';
export { Span, SentrySpanArguments, SpanOrigin, SpanAttributeValue, SpanAttributes, SpanTimeInput, SpanJSON, SpanContextData, TraceFlag, MetricSummary, } from './span';
export { SpanStatus } from './spanStatus';
export { TimedEvent } from './timedEvent';
export { StackFrame } from './stackframe';

@@ -39,3 +40,3 @@ export { Stacktrace, StackParser, StackLineParser, StackLineParserFn } from './stacktrace';

export { StartSpanOptions } from './startSpanOptions';
export { CustomSamplingContext, SamplingContext, TraceparentData, Transaction, TransactionContext, TransactionMetadata, TransactionSource, } from './transaction';
export { CustomSamplingContext, SamplingContext, TraceparentData, TransactionSource, } from './transaction';
export { DurationUnit, InformationUnit, FractionUnit, MeasurementUnit, NoneUnit, Measurements, } from './measurement';

@@ -52,2 +53,3 @@ export { Thread } from './thread';

export { ParameterizedString } from './parameterize';
export { ViewHierarchyData, ViewHierarchyWindow } from './view-hierarchy';
//# sourceMappingURL=index.d.ts.map

@@ -21,9 +21,2 @@ import { WebFetchHeaders } from './webfetchapi';

export interface HandlerDataXhr {
/**
* @deprecated This property will be removed in v8.
*/
args: [
string,
string
];
xhr: SentryWrappedXMLHttpRequest;

@@ -30,0 +23,0 @@ startTimestamp?: number;

import { Breadcrumb, BreadcrumbHint } from './breadcrumb';
import { ErrorEvent, Event, EventHint, TransactionEvent } from './event';
import { ErrorEvent, EventHint, TransactionEvent } from './event';
import { Integration } from './integration';

@@ -236,3 +236,3 @@ import { CaptureContext } from './scope';

*/
beforeSend?: (event: ErrorEvent, hint: EventHint) => PromiseLike<Event | null> | Event | null;
beforeSend?: (event: ErrorEvent, hint: EventHint) => PromiseLike<ErrorEvent | null> | ErrorEvent | null;
/**

@@ -249,3 +249,3 @@ * An event-processing callback for transaction events, guaranteed to be invoked after all other event

*/
beforeSendTransaction?: (event: TransactionEvent, hint: EventHint) => PromiseLike<Event | null> | Event | null;
beforeSendTransaction?: (event: TransactionEvent, hint: EventHint) => PromiseLike<TransactionEvent | null> | TransactionEvent | null;
/**

@@ -252,0 +252,0 @@ * A callback invoked when adding a breadcrumb, allowing to optionally modify

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

import { PropagationContext } from './tracing';
import { Transaction } from './transaction';
import { User } from './user';

@@ -139,7 +138,2 @@ /** JSDocs */

/**
* Returns the `Transaction` attached to the scope (if there is one).
* @deprecated You should not rely on the transaction, but just use `startSpan()` APIs instead.
*/
getTransaction(): Transaction | undefined;
/**
* Returns the `Session` if there is one

@@ -190,6 +184,2 @@ */

/**
* Returns an array of attachments on the scope
*/
getAttachments(): Attachment[];
/**
* Clears attachments from the scope

@@ -196,0 +186,0 @@ */

@@ -97,3 +97,3 @@ import { Primitive } from './misc';

/**
* Only true if the SpanContext was propagated from a remote parent.
* Only true if the SentrySpanArguments was propagated from a remote parent.
*/

@@ -117,3 +117,3 @@ isRemote?: boolean | undefined;

*/
export interface SpanContext {
export interface SentrySpanArguments {
/**

@@ -144,9 +144,2 @@ * Human-readable identifier for the span.

/**
* Data of the Span.
* @deprecated Pass `attributes` instead.
*/
data?: {
[key: string]: any;
};
/**
* Attributes of the Span.

@@ -200,4 +193,8 @@ */

isRecording(): boolean;
/**
* Adds an event to the Span.
*/
addEvent(name: string, attributesOrStartTime?: SpanAttributes | SpanTimeInput, startTime?: SpanTimeInput): this;
}
export {};
//# sourceMappingURL=span.d.ts.map

@@ -1,33 +0,4 @@

import { Context } from './context';
import { DynamicSamplingContext } from './envelope';
import { MeasurementUnit } from './measurement';
import { ExtractedNodeRequestData, WorkerLocation } from './misc';
import { PolymorphicRequest } from './polymorphics';
import { Span, SpanAttributes, SpanContext } from './span';
import { SpanAttributes } from './span';
/**
* Interface holding Transaction-specific properties
*/
export interface TransactionContext extends SpanContext {
/**
* Human-readable identifier for the transaction
*/
name: string;
/**
* If true, sets the end timestamp of the transaction to the highest timestamp of child spans, trimming
* the duration of the transaction. This is useful to discard extra time in the transaction that is not
* accounted for in child spans, like what happens in the idle transaction Tracing integration, where we finish the
* transaction after a given "idle time" and we don't want this "idle time" to be part of the transaction.
*/
trimEnd?: boolean | undefined;
/**
* If this transaction has a parent, the parent's sampling decision
*/
parentSampled?: boolean | undefined;
/**
* Metadata associated with the transaction, for internal SDK use.
* @deprecated Use attributes or store data on the scope instead.
*/
metadata?: Partial<TransactionMetadata>;
}
/**
* Data pulled from a `sentry-trace` header

@@ -50,66 +21,2 @@ */

/**
* Transaction "Class", inherits Span only has `setName`
*/
export interface Transaction extends Pick<TransactionContext, Exclude<keyof TransactionContext, 'name' | 'op' | 'spanId' | 'traceId'>>, Span {
/**
* @inheritDoc
*/
startTimestamp: number;
/**
* Data for the transaction.
* @deprecated Use `getSpanAttributes(transaction)` instead.
*/
data: {
[key: string]: any;
};
/**
* Attributes for the transaction.
* @deprecated Use `getSpanAttributes(transaction)` instead.
*/
attributes: SpanAttributes;
/**
* Metadata about the transaction.
* @deprecated Use attributes or store data on the scope instead.
*/
metadata: TransactionMetadata;
/**
* Set the context of a transaction event.
* @deprecated Use either `.setAttribute()`, or set the context on the scope before creating the transaction.
*/
setContext(key: string, context: Context): void;
/**
* Set observed measurement for this transaction.
*
* @param name Name of the measurement
* @param value Value of the measurement
* @param unit Unit of the measurement. (Defaults to an empty string)
*
* @deprecated Use top-level `setMeasurement()` instead.
*/
setMeasurement(name: string, value: number, unit: MeasurementUnit): void;
/**
* Returns the current transaction properties as a `TransactionContext`.
* @deprecated Use `toJSON()` or access the fields directly instead.
*/
toContext(): TransactionContext;
/**
* Set metadata for this transaction.
* @deprecated Use attributes or store data on the scope instead.
*/
setMetadata(newMetadata: Partial<TransactionMetadata>): void;
/**
* Return the current Dynamic Sampling Context of this transaction
*
* @deprecated Use top-level `getDynamicSamplingContextFromSpan` instead.
*/
getDynamicSamplingContext(): Partial<DynamicSamplingContext>;
/**
* Creates a new `Span` while setting the current `Span.id` as `parentSpanId`.
* Also the `sampled` decision will be inherited.
*
* @deprecated Use `startSpan()`, `startSpanManual()` or `startInactiveSpan()` instead.
*/
startChild(spanContext?: Pick<SpanContext, Exclude<keyof SpanContext, 'sampled' | 'traceId' | 'parentSpanId'>>): Span;
}
/**
* Context data passed by the user when starting a transaction, to be used by the tracesSampler method.

@@ -127,5 +34,9 @@ */

/**
* Context data with which transaction being sampled was created
* Context data with which transaction being sampled was created.
* @deprecated This is duplicate data and will be removed eventually.
*/
transactionContext: TransactionContext;
transactionContext: {
name: string;
parentSampled?: boolean | undefined;
};
/**

@@ -144,20 +55,7 @@ * Sampling decision from the parent transaction, if any.

request?: ExtractedNodeRequestData;
/** The name of the span being sampled. */
name: string;
/** Initial attributes that have been passed to the span being sampled. */
attributes?: SpanAttributes;
}
export interface TransactionMetadata {
/**
* The sample rate used when sampling this transaction.
* @deprecated Use `SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE` attribute instead.
*/
sampleRate?: number;
/**
* The Dynamic Sampling Context of a transaction. If provided during transaction creation, its Dynamic Sampling
* Context Will be frozen
*/
dynamicSamplingContext?: Partial<DynamicSamplingContext>;
/** For transactions tracing server-side request handling, the request being tracked. */
request?: PolymorphicRequest;
/** For transactions tracing server-side request handling, the path of the request being tracked. */
/** TODO: If we rm -rf `instrumentServer`, this can go, too */
requestPath?: string;
}
/**

@@ -164,0 +62,0 @@ * Contains information about how the name of the transaction was determined. This will be used by the server to decide

@@ -17,11 +17,2 @@ import type { Breadcrumb, BreadcrumbHint } from './breadcrumb';

/**
* Checks if this hub's version is older than the given version.
*
* @param version A version number to compare to.
* @return True if the given version is newer; otherwise false.
*
* @deprecated This will be removed in v8.
*/
isOlderThan(version: number): boolean;
/**
* This binds the given client to the current scope.

@@ -34,25 +25,2 @@ * @param client An SDK client (client) instance.

/**
* Create a new scope to store context information.
*
* The scope will be layered on top of the current one. It is isolated, i.e. all
* breadcrumbs and context information added to this scope will be removed once
* the scope ends. Be sure to always remove this scope with {@link this.popScope}
* when the operation finishes or throws.
*
* @returns Scope, the new cloned scope
*
* @deprecated Use `withScope` instead.
*/
pushScope(): Scope;
/**
* Removes a previously pushed scope from the stack.
*
* This restores the state before the scope was pushed. All breadcrumbs and
* context information added since the last call to {@link this.pushScope} are
* discarded.
*
* @deprecated Use `withScope` instead.
*/
popScope(): boolean;
/**
* Creates a new scope with and executes the given operation within.

@@ -221,11 +189,3 @@ * The scope is automatically removed once the operation

captureSession(endSession?: boolean): void;
/**
* Returns if default PII should be sent to Sentry and propagated in outgoing requests
* when Tracing is used.
*
* @deprecated Use top-level `getClient().getOptions().sendDefaultPii` instead. This function
* only unnecessarily increased API surface but only wrapped accessing the option.
*/
shouldSendDefaultPii(): boolean;
}
//# sourceMappingURL=hub.d.ts.map

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

export type { SeverityLevel } from './severity';
export type { Span, SpanContext, SpanOrigin, SpanAttributeValue, SpanAttributes, SpanTimeInput, SpanJSON, SpanContextData, TraceFlag, MetricSummary, } from './span';
export type { Span, SentrySpanArguments, SpanOrigin, SpanAttributeValue, SpanAttributes, SpanTimeInput, SpanJSON, SpanContextData, TraceFlag, MetricSummary, } from './span';
export type { SpanStatus } from './spanStatus';
export type { TimedEvent } from './timedEvent';
export type { StackFrame } from './stackframe';

@@ -39,3 +40,3 @@ export type { Stacktrace, StackParser, StackLineParser, StackLineParserFn } from './stacktrace';

export type { StartSpanOptions } from './startSpanOptions';
export type { CustomSamplingContext, SamplingContext, TraceparentData, Transaction, TransactionContext, TransactionMetadata, TransactionSource, } from './transaction';
export type { CustomSamplingContext, SamplingContext, TraceparentData, TransactionSource, } from './transaction';
export type { DurationUnit, InformationUnit, FractionUnit, MeasurementUnit, NoneUnit, Measurements, } from './measurement';

@@ -52,2 +53,3 @@ export type { Thread } from './thread';

export type { ParameterizedString } from './parameterize';
export type { ViewHierarchyData, ViewHierarchyWindow } from './view-hierarchy';
//# sourceMappingURL=index.d.ts.map

@@ -21,6 +21,2 @@ import type { WebFetchHeaders } from './webfetchapi';

export interface HandlerDataXhr {
/**
* @deprecated This property will be removed in v8.
*/
args: [string, string];
xhr: SentryWrappedXMLHttpRequest;

@@ -27,0 +23,0 @@ startTimestamp?: number;

import type { Breadcrumb, BreadcrumbHint } from './breadcrumb';
import type { ErrorEvent, Event, EventHint, TransactionEvent } from './event';
import type { ErrorEvent, EventHint, TransactionEvent } from './event';
import type { Integration } from './integration';

@@ -236,3 +236,3 @@ import type { CaptureContext } from './scope';

*/
beforeSend?: (event: ErrorEvent, hint: EventHint) => PromiseLike<Event | null> | Event | null;
beforeSend?: (event: ErrorEvent, hint: EventHint) => PromiseLike<ErrorEvent | null> | ErrorEvent | null;
/**

@@ -249,3 +249,3 @@ * An event-processing callback for transaction events, guaranteed to be invoked after all other event

*/
beforeSendTransaction?: (event: TransactionEvent, hint: EventHint) => PromiseLike<Event | null> | Event | null;
beforeSendTransaction?: (event: TransactionEvent, hint: EventHint) => PromiseLike<TransactionEvent | null> | TransactionEvent | null;
/**

@@ -252,0 +252,0 @@ * A callback invoked when adding a breadcrumb, allowing to optionally modify

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

import type { PropagationContext } from './tracing';
import type { Transaction } from './transaction';
import type { User } from './user';

@@ -139,7 +138,2 @@ /** JSDocs */

/**
* Returns the `Transaction` attached to the scope (if there is one).
* @deprecated You should not rely on the transaction, but just use `startSpan()` APIs instead.
*/
getTransaction(): Transaction | undefined;
/**
* Returns the `Session` if there is one

@@ -190,6 +184,2 @@ */

/**
* Returns an array of attachments on the scope
*/
getAttachments(): Attachment[];
/**
* Clears attachments from the scope

@@ -196,0 +186,0 @@ */

@@ -97,3 +97,3 @@ import type { Primitive } from './misc';

/**
* Only true if the SpanContext was propagated from a remote parent.
* Only true if the SentrySpanArguments was propagated from a remote parent.
*/

@@ -117,3 +117,3 @@ isRemote?: boolean | undefined;

*/
export interface SpanContext {
export interface SentrySpanArguments {
/**

@@ -144,9 +144,2 @@ * Human-readable identifier for the span.

/**
* Data of the Span.
* @deprecated Pass `attributes` instead.
*/
data?: {
[key: string]: any;
};
/**
* Attributes of the Span.

@@ -200,4 +193,8 @@ */

isRecording(): boolean;
/**
* Adds an event to the Span.
*/
addEvent(name: string, attributesOrStartTime?: SpanAttributes | SpanTimeInput, startTime?: SpanTimeInput): this;
}
export {};
//# sourceMappingURL=span.d.ts.map

@@ -1,33 +0,4 @@

import type { Context } from './context';
import type { DynamicSamplingContext } from './envelope';
import type { MeasurementUnit } from './measurement';
import type { ExtractedNodeRequestData, WorkerLocation } from './misc';
import type { PolymorphicRequest } from './polymorphics';
import type { Span, SpanAttributes, SpanContext } from './span';
import type { SpanAttributes } from './span';
/**
* Interface holding Transaction-specific properties
*/
export interface TransactionContext extends SpanContext {
/**
* Human-readable identifier for the transaction
*/
name: string;
/**
* If true, sets the end timestamp of the transaction to the highest timestamp of child spans, trimming
* the duration of the transaction. This is useful to discard extra time in the transaction that is not
* accounted for in child spans, like what happens in the idle transaction Tracing integration, where we finish the
* transaction after a given "idle time" and we don't want this "idle time" to be part of the transaction.
*/
trimEnd?: boolean | undefined;
/**
* If this transaction has a parent, the parent's sampling decision
*/
parentSampled?: boolean | undefined;
/**
* Metadata associated with the transaction, for internal SDK use.
* @deprecated Use attributes or store data on the scope instead.
*/
metadata?: Partial<TransactionMetadata>;
}
/**
* Data pulled from a `sentry-trace` header

@@ -50,66 +21,2 @@ */

/**
* Transaction "Class", inherits Span only has `setName`
*/
export interface Transaction extends Omit<TransactionContext, 'name' | 'op' | 'spanId' | 'traceId'>, Span {
/**
* @inheritDoc
*/
startTimestamp: number;
/**
* Data for the transaction.
* @deprecated Use `getSpanAttributes(transaction)` instead.
*/
data: {
[key: string]: any;
};
/**
* Attributes for the transaction.
* @deprecated Use `getSpanAttributes(transaction)` instead.
*/
attributes: SpanAttributes;
/**
* Metadata about the transaction.
* @deprecated Use attributes or store data on the scope instead.
*/
metadata: TransactionMetadata;
/**
* Set the context of a transaction event.
* @deprecated Use either `.setAttribute()`, or set the context on the scope before creating the transaction.
*/
setContext(key: string, context: Context): void;
/**
* Set observed measurement for this transaction.
*
* @param name Name of the measurement
* @param value Value of the measurement
* @param unit Unit of the measurement. (Defaults to an empty string)
*
* @deprecated Use top-level `setMeasurement()` instead.
*/
setMeasurement(name: string, value: number, unit: MeasurementUnit): void;
/**
* Returns the current transaction properties as a `TransactionContext`.
* @deprecated Use `toJSON()` or access the fields directly instead.
*/
toContext(): TransactionContext;
/**
* Set metadata for this transaction.
* @deprecated Use attributes or store data on the scope instead.
*/
setMetadata(newMetadata: Partial<TransactionMetadata>): void;
/**
* Return the current Dynamic Sampling Context of this transaction
*
* @deprecated Use top-level `getDynamicSamplingContextFromSpan` instead.
*/
getDynamicSamplingContext(): Partial<DynamicSamplingContext>;
/**
* Creates a new `Span` while setting the current `Span.id` as `parentSpanId`.
* Also the `sampled` decision will be inherited.
*
* @deprecated Use `startSpan()`, `startSpanManual()` or `startInactiveSpan()` instead.
*/
startChild(spanContext?: Pick<SpanContext, Exclude<keyof SpanContext, 'sampled' | 'traceId' | 'parentSpanId'>>): Span;
}
/**
* Context data passed by the user when starting a transaction, to be used by the tracesSampler method.

@@ -127,5 +34,9 @@ */

/**
* Context data with which transaction being sampled was created
* Context data with which transaction being sampled was created.
* @deprecated This is duplicate data and will be removed eventually.
*/
transactionContext: TransactionContext;
transactionContext: {
name: string;
parentSampled?: boolean | undefined;
};
/**

@@ -144,20 +55,7 @@ * Sampling decision from the parent transaction, if any.

request?: ExtractedNodeRequestData;
/** The name of the span being sampled. */
name: string;
/** Initial attributes that have been passed to the span being sampled. */
attributes?: SpanAttributes;
}
export interface TransactionMetadata {
/**
* The sample rate used when sampling this transaction.
* @deprecated Use `SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE` attribute instead.
*/
sampleRate?: number;
/**
* The Dynamic Sampling Context of a transaction. If provided during transaction creation, its Dynamic Sampling
* Context Will be frozen
*/
dynamicSamplingContext?: Partial<DynamicSamplingContext>;
/** For transactions tracing server-side request handling, the request being tracked. */
request?: PolymorphicRequest;
/** For transactions tracing server-side request handling, the path of the request being tracked. */
/** TODO: If we rm -rf `instrumentServer`, this can go, too */
requestPath?: string;
}
/**

@@ -164,0 +62,0 @@ * Contains information about how the name of the transaction was determined. This will be used by the server to decide

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc