diff --git a/dev-packages/browser-integration-tests/suites/public-api/instrumentation/eventListener/event-target/test.ts b/dev-packages/browser-integration-tests/suites/public-api/instrumentation/eventListener/event-target/test.ts index 7900c774a914..513b3911422a 100644 --- a/dev-packages/browser-integration-tests/suites/public-api/instrumentation/eventListener/event-target/test.ts +++ b/dev-packages/browser-integration-tests/suites/public-api/instrumentation/eventListener/event-target/test.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test'; -import type { Event } from '@sentry/types'; +import type { Event } from '@sentry/core'; import { sentryTest } from '../../../../../utils/fixtures'; import { getFirstSentryEnvelopeRequest } from '../../../../../utils/helpers'; diff --git a/docs/migration/draft-v9-migration-guide.md b/docs/migration/draft-v9-migration-guide.md index fb62a6635e0d..b70b314d8f98 100644 --- a/docs/migration/draft-v9-migration-guide.md +++ b/docs/migration/draft-v9-migration-guide.md @@ -66,6 +66,8 @@ ## `@sentry/types` +- **The `@sentry/types` package has been deprecated. Import everything from `@sentry/core` instead.** + - Deprecated `Request` in favor of `RequestEventData`. ## `@sentry/vue` diff --git a/packages/types/README.md b/packages/types/README.md index 4c0e2d9cbc34..a7fa71c4421b 100644 --- a/packages/types/README.md +++ b/packages/types/README.md @@ -4,7 +4,11 @@
-# Sentry JavaScript SDK Types +# Sentry JavaScript SDK Types (DEPRECATED) + +> DEPRECATION NOTICE: The `@sentry/types` package is deprecated. +> All exports have been moved to `@sentry/core`. +> Import everything from `@sentry/core` instead. [](https://www.npmjs.com/package/@sentry/types) [](https://www.npmjs.com/package/@sentry/types) diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts index 4d428476532b..372e5e854a87 100644 --- a/packages/types/src/index.ts +++ b/packages/types/src/index.ts @@ -1,192 +1,570 @@ -export type { - Attachment, - Breadcrumb, - BreadcrumbHint, - FetchBreadcrumbData, - XhrBreadcrumbData, - FetchBreadcrumbHint, - XhrBreadcrumbHint, - Client, - ClientReport, - Outcome, - EventDropReason, - Context, - Contexts, - DeviceContext, - OsContext, - AppContext, - CultureContext, - TraceContext, - CloudResourceContext, - MissingInstrumentationContext, - DataCategory, - DsnComponents, - DsnLike, - DsnProtocol, - DebugImage, - DebugMeta, - AttachmentItem, - BaseEnvelopeHeaders, - BaseEnvelopeItemHeaders, - ClientReportEnvelope, - ClientReportItem, - DynamicSamplingContext, - Envelope, - EnvelopeItemType, - EnvelopeItem, - EventEnvelope, - EventEnvelopeHeaders, - EventItem, - ReplayEnvelope, - FeedbackItem, - SessionEnvelope, - SessionItem, - UserFeedbackItem, - CheckInItem, - CheckInEnvelope, - StatsdItem, - StatsdEnvelope, - ProfileItem, - ProfileChunkEnvelope, - ProfileChunkItem, - SpanEnvelope, - SpanItem, - ExtendedError, - Event, - EventHint, - EventType, - ErrorEvent, - TransactionEvent, - EventProcessor, - Exception, - Extra, - Extras, - // eslint-disable-next-line deprecation/deprecation - Hub, - Integration, - IntegrationClass, - IntegrationFn, - Mechanism, - ExtractedNodeRequestData, - HttpHeaderValue, - Primitive, - WorkerLocation, - ClientOptions, - Options, - Package, - PolymorphicEvent, - PolymorphicRequest, - ThreadId, - FrameId, - StackId, - ThreadCpuSample, - ThreadCpuStack, - ThreadCpuFrame, - ThreadCpuProfile, - ContinuousThreadCpuProfile, - Profile, - ProfileChunk, - ReplayEvent, - ReplayRecordingData, - ReplayRecordingMode, - FeedbackEvent, - FeedbackFormData, - FeedbackInternalOptions, - FeedbackModalIntegration, - FeedbackScreenshotIntegration, - SendFeedback, - SendFeedbackParams, - UserFeedback, - QueryParams, - RequestEventData, - // eslint-disable-next-line deprecation/deprecation - Request, - SanitizedRequestData, - Runtime, - CaptureContext, - Scope, - ScopeContext, - ScopeData, - SdkInfo, - SdkMetadata, - SessionAggregates, - AggregationCounts, - Session, - SessionContext, - SessionStatus, - RequestSession, - RequestSessionStatus, - SessionFlusherLike, - SerializedSession, - SeverityLevel, - Span, - SentrySpanArguments, - SpanOrigin, - SpanAttributeValue, - SpanAttributes, - SpanTimeInput, - SpanJSON, - SpanContextData, - TraceFlag, - MetricSummary, - SpanStatus, - TimedEvent, - StackFrame, - Stacktrace, - StackParser, - StackLineParser, - StackLineParserFn, - PropagationContext, - TracePropagationTargets, - SerializedTraceData, - StartSpanOptions, - TraceparentData, - TransactionSource, - CustomSamplingContext, - SamplingContext, - DurationUnit, - InformationUnit, - FractionUnit, - MeasurementUnit, - NoneUnit, - Measurements, - Thread, - Transport, - TransportRequest, - TransportMakeRequestResponse, - InternalBaseTransportOptions, - BaseTransportOptions, - TransportRequestExecutor, - User, - WebFetchHeaders, - WebFetchRequest, - WrappedFunction, - HandlerDataFetch, - HandlerDataXhr, - HandlerDataDom, - HandlerDataConsole, - HandlerDataHistory, - HandlerDataError, - HandlerDataUnhandledRejection, - ConsoleLevel, - SentryXhrData, - SentryWrappedXMLHttpRequest, - BrowserClientReplayOptions, - BrowserClientProfilingOptions, - CheckIn, - MonitorConfig, - FinishedCheckIn, - InProgressCheckIn, - SerializedCheckIn, - MetricsAggregator, - MetricBucketItem, - MetricInstance, - MetricData, - Metrics, - ParameterizedString, - ContinuousProfiler, - ProfilingIntegration, - Profiler, - ViewHierarchyData, - ViewHierarchyWindow, +/* eslint-disable max-lines */ +import type { + AggregationCounts as AggregationCounts_imported, + AppContext as AppContext_imported, + Attachment as Attachment_imported, + AttachmentItem as AttachmentItem_imported, + BaseEnvelopeHeaders as BaseEnvelopeHeaders_imported, + BaseEnvelopeItemHeaders as BaseEnvelopeItemHeaders_imported, + BaseTransportOptions as BaseTransportOptions_imported, + Breadcrumb as Breadcrumb_imported, + BreadcrumbHint as BreadcrumbHint_imported, + BrowserClientProfilingOptions as BrowserClientProfilingOptions_imported, + BrowserClientReplayOptions as BrowserClientReplayOptions_imported, + CaptureContext as CaptureContext_imported, + CheckIn as CheckIn_imported, + CheckInEnvelope as CheckInEnvelope_imported, + CheckInItem as CheckInItem_imported, + Client as Client_imported, + ClientOptions as ClientOptions_imported, + ClientReport as ClientReport_imported, + ClientReportEnvelope as ClientReportEnvelope_imported, + ClientReportItem as ClientReportItem_imported, + CloudResourceContext as CloudResourceContext_imported, + ConsoleLevel as ConsoleLevel_imported, + Context as Context_imported, + Contexts as Contexts_imported, + ContinuousProfiler as ContinuousProfiler_imported, + ContinuousThreadCpuProfile as ContinuousThreadCpuProfile_imported, + CultureContext as CultureContext_imported, + CustomSamplingContext as CustomSamplingContext_imported, + DataCategory as DataCategory_imported, + DebugImage as DebugImage_imported, + DebugMeta as DebugMeta_imported, + DeviceContext as DeviceContext_imported, + DsnComponents as DsnComponents_imported, + DsnLike as DsnLike_imported, + DsnProtocol as DsnProtocol_imported, + DurationUnit as DurationUnit_imported, + DynamicSamplingContext as DynamicSamplingContext_imported, + Envelope as Envelope_imported, + EnvelopeItem as EnvelopeItem_imported, + EnvelopeItemType as EnvelopeItemType_imported, + ErrorEvent as ErrorEvent_imported, + Event as Event_imported, + EventDropReason as EventDropReason_imported, + EventEnvelope as EventEnvelope_imported, + EventEnvelopeHeaders as EventEnvelopeHeaders_imported, + EventHint as EventHint_imported, + EventItem as EventItem_imported, + EventProcessor as EventProcessor_imported, + EventType as EventType_imported, + Exception as Exception_imported, + ExtendedError as ExtendedError_imported, + Extra as Extra_imported, + ExtractedNodeRequestData as ExtractedNodeRequestData_imported, + Extras as Extras_imported, + FeedbackEvent as FeedbackEvent_imported, + FeedbackFormData as FeedbackFormData_imported, + FeedbackInternalOptions as FeedbackInternalOptions_imported, + FeedbackItem as FeedbackItem_imported, + FeedbackModalIntegration as FeedbackModalIntegration_imported, + FeedbackScreenshotIntegration as FeedbackScreenshotIntegration_imported, + FetchBreadcrumbData as FetchBreadcrumbData_imported, + FetchBreadcrumbHint as FetchBreadcrumbHint_imported, + FinishedCheckIn as FinishedCheckIn_imported, + FractionUnit as FractionUnit_imported, + FrameId as FrameId_imported, + HandlerDataConsole as HandlerDataConsole_imported, + HandlerDataDom as HandlerDataDom_imported, + HandlerDataError as HandlerDataError_imported, + HandlerDataFetch as HandlerDataFetch_imported, + HandlerDataHistory as HandlerDataHistory_imported, + HandlerDataUnhandledRejection as HandlerDataUnhandledRejection_imported, + HandlerDataXhr as HandlerDataXhr_imported, + HttpHeaderValue as HttpHeaderValue_imported, + Hub as Hub_imported, + InProgressCheckIn as InProgressCheckIn_imported, + InformationUnit as InformationUnit_imported, + Integration as Integration_imported, + IntegrationClass as IntegrationClass_imported, + IntegrationFn as IntegrationFn_imported, + InternalBaseTransportOptions as InternalBaseTransportOptions_imported, + MeasurementUnit as MeasurementUnit_imported, + Measurements as Measurements_imported, + Mechanism as Mechanism_imported, + MetricBucketItem as MetricBucketItem_imported, + MetricData as MetricData_imported, + MetricInstance as MetricInstance_imported, + MetricSummary as MetricSummary_imported, + Metrics as Metrics_imported, + MetricsAggregator as MetricsAggregator_imported, + MissingInstrumentationContext as MissingInstrumentationContext_imported, + MonitorConfig as MonitorConfig_imported, + NoneUnit as NoneUnit_imported, + Options as Options_imported, + OsContext as OsContext_imported, + Outcome as Outcome_imported, + Package as Package_imported, + ParameterizedString as ParameterizedString_imported, + PolymorphicEvent as PolymorphicEvent_imported, + PolymorphicRequest as PolymorphicRequest_imported, + Primitive as Primitive_imported, + Profile as Profile_imported, + ProfileChunk as ProfileChunk_imported, + ProfileChunkEnvelope as ProfileChunkEnvelope_imported, + ProfileChunkItem as ProfileChunkItem_imported, + ProfileItem as ProfileItem_imported, + Profiler as Profiler_imported, + ProfilingIntegration as ProfilingIntegration_imported, + PropagationContext as PropagationContext_imported, + QueryParams as QueryParams_imported, + ReplayEnvelope as ReplayEnvelope_imported, + ReplayEvent as ReplayEvent_imported, + ReplayRecordingData as ReplayRecordingData_imported, + ReplayRecordingMode as ReplayRecordingMode_imported, + Request as Request_imported, + RequestEventData as RequestEventData_imported, + RequestSession as RequestSession_imported, + RequestSessionStatus as RequestSessionStatus_imported, + Runtime as Runtime_imported, + SamplingContext as SamplingContext_imported, + SanitizedRequestData as SanitizedRequestData_imported, + Scope as Scope_imported, + ScopeContext as ScopeContext_imported, + ScopeData as ScopeData_imported, + SdkInfo as SdkInfo_imported, + SdkMetadata as SdkMetadata_imported, + SendFeedback as SendFeedback_imported, + SendFeedbackParams as SendFeedbackParams_imported, + SentrySpanArguments as SentrySpanArguments_imported, + SentryWrappedXMLHttpRequest as SentryWrappedXMLHttpRequest_imported, + SentryXhrData as SentryXhrData_imported, + SerializedCheckIn as SerializedCheckIn_imported, + SerializedSession as SerializedSession_imported, + SerializedTraceData as SerializedTraceData_imported, + Session as Session_imported, + SessionAggregates as SessionAggregates_imported, + SessionContext as SessionContext_imported, + SessionEnvelope as SessionEnvelope_imported, + SessionFlusherLike as SessionFlusherLike_imported, + SessionItem as SessionItem_imported, + SessionStatus as SessionStatus_imported, + SeverityLevel as SeverityLevel_imported, + Span as Span_imported, + SpanAttributeValue as SpanAttributeValue_imported, + SpanAttributes as SpanAttributes_imported, + SpanContextData as SpanContextData_imported, + SpanEnvelope as SpanEnvelope_imported, + SpanItem as SpanItem_imported, + SpanJSON as SpanJSON_imported, + SpanOrigin as SpanOrigin_imported, + SpanStatus as SpanStatus_imported, + SpanTimeInput as SpanTimeInput_imported, + StackFrame as StackFrame_imported, + StackId as StackId_imported, + StackLineParser as StackLineParser_imported, + StackLineParserFn as StackLineParserFn_imported, + StackParser as StackParser_imported, + Stacktrace as Stacktrace_imported, + StartSpanOptions as StartSpanOptions_imported, + StatsdEnvelope as StatsdEnvelope_imported, + StatsdItem as StatsdItem_imported, + Thread as Thread_imported, + ThreadCpuFrame as ThreadCpuFrame_imported, + ThreadCpuProfile as ThreadCpuProfile_imported, + ThreadCpuSample as ThreadCpuSample_imported, + ThreadCpuStack as ThreadCpuStack_imported, + ThreadId as ThreadId_imported, + TimedEvent as TimedEvent_imported, + TraceContext as TraceContext_imported, + TraceFlag as TraceFlag_imported, + TracePropagationTargets as TracePropagationTargets_imported, + TraceparentData as TraceparentData_imported, + TransactionEvent as TransactionEvent_imported, + TransactionSource as TransactionSource_imported, + Transport as Transport_imported, + TransportMakeRequestResponse as TransportMakeRequestResponse_imported, + TransportRequest as TransportRequest_imported, + TransportRequestExecutor as TransportRequestExecutor_imported, + User as User_imported, + UserFeedback as UserFeedback_imported, + UserFeedbackItem as UserFeedbackItem_imported, + ViewHierarchyData as ViewHierarchyData_imported, + ViewHierarchyWindow as ViewHierarchyWindow_imported, + WebFetchHeaders as WebFetchHeaders_imported, + WebFetchRequest as WebFetchRequest_imported, + WorkerLocation as WorkerLocation_imported, + WrappedFunction as WrappedFunction_imported, + XhrBreadcrumbData as XhrBreadcrumbData_imported, + XhrBreadcrumbHint as XhrBreadcrumbHint_imported, } from '@sentry/core'; + +/** @deprecated This type has been moved to `@sentry/core`. */ +export type Attachment = Attachment_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type Breadcrumb = Breadcrumb_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type BreadcrumbHint = BreadcrumbHint_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type FetchBreadcrumbData = FetchBreadcrumbData_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type XhrBreadcrumbData = XhrBreadcrumbData_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type FetchBreadcrumbHint = FetchBreadcrumbHint_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type XhrBreadcrumbHint = XhrBreadcrumbHint_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type Client = Client_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type ClientReport = ClientReport_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type Outcome = Outcome_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type EventDropReason = EventDropReason_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type Context = Context_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type Contexts = Contexts_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type DeviceContext = DeviceContext_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type OsContext = OsContext_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type AppContext = AppContext_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type CultureContext = CultureContext_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type TraceContext = TraceContext_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type CloudResourceContext = CloudResourceContext_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type MissingInstrumentationContext = MissingInstrumentationContext_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type DataCategory = DataCategory_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type DsnComponents = DsnComponents_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type DsnLike = DsnLike_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type DsnProtocol = DsnProtocol_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type DebugImage = DebugImage_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type DebugMeta = DebugMeta_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type AttachmentItem = AttachmentItem_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type BaseEnvelopeHeaders = BaseEnvelopeHeaders_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type BaseEnvelopeItemHeaders = BaseEnvelopeItemHeaders_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type ClientReportEnvelope = ClientReportEnvelope_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type ClientReportItem = ClientReportItem_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type DynamicSamplingContext = DynamicSamplingContext_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type Envelope = Envelope_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type EnvelopeItemType = EnvelopeItemType_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type EnvelopeItem = EnvelopeItem_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type EventEnvelope = EventEnvelope_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type EventEnvelopeHeaders = EventEnvelopeHeaders_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type EventItem = EventItem_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type ReplayEnvelope = ReplayEnvelope_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type FeedbackItem = FeedbackItem_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type SessionEnvelope = SessionEnvelope_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type SessionItem = SessionItem_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type UserFeedbackItem = UserFeedbackItem_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type CheckInItem = CheckInItem_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type CheckInEnvelope = CheckInEnvelope_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type StatsdItem = StatsdItem_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type StatsdEnvelope = StatsdEnvelope_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type ProfileItem = ProfileItem_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type ProfileChunkEnvelope = ProfileChunkEnvelope_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type ProfileChunkItem = ProfileChunkItem_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type SpanEnvelope = SpanEnvelope_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type SpanItem = SpanItem_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type ExtendedError = ExtendedError_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type Event = Event_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type EventHint = EventHint_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type EventType = EventType_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type ErrorEvent = ErrorEvent_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type TransactionEvent = TransactionEvent_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type EventProcessor = EventProcessor_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type Exception = Exception_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type Extra = Extra_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type Extras = Extras_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +// eslint-disable-next-line deprecation/deprecation +export type Hub = Hub_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type Integration = Integration_imported; +/** @deprecated This type has been moved to `@sentry/core`. */ +export type IntegrationClass