Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/core/src/api.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { ReportDialogOptions } from './report-dialog';
import type { DsnComponents, DsnLike, SdkInfo } from './types-hoist';
import type { DsnComponents, DsnLike } from './types-hoist/dsn';
import type { SdkInfo } from './types-hoist/sdkinfo';
import { dsnToString, makeDsn } from './utils-hoist/dsn';

const SENTRY_API_VERSION = '7';
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/breadcrumbs.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getClient, getIsolationScope } from './currentScopes';
import type { Breadcrumb, BreadcrumbHint } from './types-hoist';
import type { Breadcrumb, BreadcrumbHint } from './types-hoist/breadcrumb';
import { consoleSandbox } from './utils-hoist/logger';
import { dateTimestampInSeconds } from './utils-hoist/time';

Expand Down
12 changes: 4 additions & 8 deletions packages/core/src/checkin.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import type {
CheckInEnvelope,
CheckInItem,
DsnComponents,
DynamicSamplingContext,
SdkMetadata,
SerializedCheckIn,
} from './types-hoist';
import type { CheckInEnvelope, CheckInItem, DynamicSamplingContext } from './types-hoist/envelope';
import type { DsnComponents } from './types-hoist/dsn';
import type { SdkMetadata } from './types-hoist/sdkmetadata';
import type { SerializedCheckIn } from './types-hoist/checkin';
import { dsnToString } from './utils-hoist/dsn';
import { createEnvelope } from './utils-hoist/envelope';

Expand Down
56 changes: 20 additions & 36 deletions packages/core/src/client.ts
Original file line number Diff line number Diff line change
@@ -1,40 +1,24 @@
/* eslint-disable max-lines */
import type {
Breadcrumb,
BreadcrumbHint,
CheckIn,
ClientOptions,
DataCategory,
DsnComponents,
DynamicSamplingContext,
Envelope,
ErrorEvent,
Event,
EventDropReason,
EventHint,
EventProcessor,
FeedbackEvent,
FetchBreadcrumbHint,
Integration,
Log,
MonitorConfig,
Outcome,
ParameterizedString,
SdkMetadata,
Session,
SessionAggregates,
SeverityLevel,
Span,
SpanAttributes,
SpanContextData,
SpanJSON,
StartSpanOptions,
TraceContext,
TransactionEvent,
Transport,
TransportMakeRequestResponse,
XhrBreadcrumbHint,
} from './types-hoist';
import type { Breadcrumb, BreadcrumbHint, FetchBreadcrumbHint, XhrBreadcrumbHint } from './types-hoist/breadcrumb';
import type { CheckIn, MonitorConfig } from './types-hoist/checkin';
import type { ClientOptions } from './types-hoist/options';
import type { DataCategory } from './types-hoist/datacategory';
import type { EventDropReason, Outcome } from './types-hoist/clientreport';
import type { DsnComponents } from './types-hoist/dsn';
import type { DynamicSamplingContext, Envelope } from './types-hoist/envelope';
import type { ErrorEvent, Event, EventHint, TransactionEvent } from './types-hoist/event';
import type { EventProcessor } from './types-hoist/eventprocessor';
import type { FeedbackEvent } from './types-hoist/feedback';
import type { Integration } from './types-hoist/integration';
import type { Log } from './types-hoist/log';
import type { ParameterizedString } from './types-hoist/parameterize';
import type { SdkMetadata } from './types-hoist/sdkmetadata';
import type { Session, SessionAggregates } from './types-hoist/session';
import type { SeverityLevel } from './types-hoist/severity';
import type { Span, SpanAttributes, SpanContextData, SpanJSON } from './types-hoist/span';
import type { StartSpanOptions } from './types-hoist/startSpanOptions';
import type { TraceContext } from './types-hoist/context';
import type { Transport, TransportMakeRequestResponse } from './types-hoist/transport';

import { getEnvelopeEndpointWithUrlEncodedAuth } from './api';
import { DEFAULT_ENVIRONMENT } from './constants';
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/currentScopes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { getAsyncContextStrategy } from './asyncContext';
import { getGlobalSingleton, getMainCarrier } from './carrier';
import type { Client } from './client';
import { Scope } from './scope';
import type { TraceContext } from './types-hoist';
import type { TraceContext } from './types-hoist/context';
import { generateSpanId } from './utils-hoist/propagationContext';

/**
Expand Down
19 changes: 9 additions & 10 deletions packages/core/src/envelope.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
import type { Client } from './client';
import { getDynamicSamplingContextFromSpan } from './tracing/dynamicSamplingContext';
import type { SentrySpan } from './tracing/sentrySpan';
import type { DsnComponents } from './types-hoist/dsn';
import type {
DsnComponents,
DynamicSamplingContext,
Event,
EventEnvelope,
EventItem,
LegacyCSPReport,
SpanEnvelope,
SpanItem,
RawSecurityEnvelope,
RawSecurityItem,
SdkInfo,
SdkMetadata,
Session,
SessionAggregates,
SessionEnvelope,
SessionItem,
SpanEnvelope,
SpanItem,
} from './types-hoist';
} from './types-hoist/envelope';
import type { Event } from './types-hoist/event';
import type { LegacyCSPReport } from './types-hoist/csp';
import type { SdkInfo } from './types-hoist/sdkinfo';
import type { SdkMetadata } from './types-hoist/sdkmetadata';
import type { Session, SessionAggregates } from './types-hoist/session';
import { dsnToString } from './utils-hoist/dsn';
import {
createEnvelope,
Expand Down
4 changes: 3 additions & 1 deletion packages/core/src/eventProcessors.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { DEBUG_BUILD } from './debug-build';
import type { Event, EventHint, EventProcessor } from './types-hoist';
import type { Event } from './types-hoist/event';
import type { EventHint } from './types-hoist/event';
import type { EventProcessor } from './types-hoist/eventprocessor';
import { isThenable } from './utils-hoist/is';
import { logger } from './utils-hoist/logger';
import { SyncPromise } from './utils-hoist/syncpromise';
Expand Down
23 changes: 8 additions & 15 deletions packages/core/src/exports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,14 @@ import { getClient, getCurrentScope, getIsolationScope, withIsolationScope } fro
import { DEBUG_BUILD } from './debug-build';
import type { CaptureContext } from './scope';
import { closeSession, makeSession, updateSession } from './session';
import type {
CheckIn,
Event,
EventHint,
EventProcessor,
Extra,
Extras,
FinishedCheckIn,
MonitorConfig,
Primitive,
Session,
SessionContext,
SeverityLevel,
User,
} from './types-hoist';
import type { CheckIn, FinishedCheckIn, MonitorConfig } from './types-hoist/checkin';
import type { Event, EventHint } from './types-hoist/event';
import type { EventProcessor } from './types-hoist/eventprocessor';
import type { Extra, Extras } from './types-hoist/extra';
import type { Primitive } from './types-hoist/misc';
import type { Session, SessionContext } from './types-hoist/session';
import type { SeverityLevel } from './types-hoist/severity';
import type { User } from './types-hoist/user';
import { isThenable } from './utils-hoist/is';
import { logger } from './utils-hoist/logger';
import { uuid4 } from './utils-hoist/misc';
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/feedback.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { getClient, getCurrentScope } from './currentScopes';
import type { EventHint, FeedbackEvent, SendFeedbackParams } from './types-hoist';
import type { EventHint } from './types-hoist/event';
import type { FeedbackEvent, SendFeedbackParams } from './types-hoist/feedback';

/**
* Send user feedback to Sentry.
Expand Down
4 changes: 3 additions & 1 deletion packages/core/src/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import { getClient } from './currentScopes';
import { SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from './semanticAttributes';
import { SPAN_STATUS_ERROR, setHttpStatus, startInactiveSpan } from './tracing';
import { SentryNonRecordingSpan } from './tracing/sentryNonRecordingSpan';
import type { FetchBreadcrumbHint, HandlerDataFetch, Span, SpanAttributes, SpanOrigin } from './types-hoist';
import type { FetchBreadcrumbHint } from './types-hoist/breadcrumb';
import type { HandlerDataFetch } from './types-hoist/instrument';
import type { Span, SpanAttributes, SpanOrigin } from './types-hoist/span';
import { SENTRY_BAGGAGE_KEY_PREFIX } from './utils-hoist/baggage';
import { isInstanceOf, isRequest } from './utils-hoist/is';
import { getSanitizedUrlStringFromUrlObject, isURLObjectRelative, parseStringToURLObject } from './utils-hoist/url';
Expand Down
177 changes: 174 additions & 3 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable max-lines */

export type { ClientClass as SentryCoreCurrentScopes } from './sdk';
export type { AsyncContextStrategy } from './asyncContext/types';
export type { Carrier } from './carrier';
Expand Down Expand Up @@ -120,9 +122,6 @@ export type { ReportDialogOptions } from './report-dialog';
export { _INTERNAL_captureLog, _INTERNAL_flushLogsBuffer } from './logs/exports';
export { consoleLoggingIntegration } from './logs/console-integration';

// TODO: Make this structure pretty again and don't do "export *"
export * from './types-hoist/index';

export type { FeatureFlag } from './featureFlags';

export { applyAggregateErrorsToEvent } from './utils-hoist/aggregate-errors';
Expand Down Expand Up @@ -272,3 +271,175 @@ export { vercelWaitUntil } from './utils-hoist/vercelWaitUntil';
export { SDK_VERSION } from './utils-hoist/version';
export { getDebugImagesForResources, getFilenameToDebugIdMap } from './utils-hoist/debug-ids';
export { escapeStringForRegex } from './utils-hoist/vendor/escapeStringForRegex';

export type { Attachment } from './types-hoist/attachment';
export type {
Breadcrumb,
BreadcrumbHint,
FetchBreadcrumbData,
XhrBreadcrumbData,
FetchBreadcrumbHint,
XhrBreadcrumbHint,
} from './types-hoist/breadcrumb';
export type { ClientReport, Outcome, EventDropReason } from './types-hoist/clientreport';
export type {
Context,
Contexts,
DeviceContext,
OsContext,
AppContext,
CultureContext,
TraceContext,
CloudResourceContext,
MissingInstrumentationContext,
} from './types-hoist/context';
export type { DataCategory } from './types-hoist/datacategory';
export type { DsnComponents, DsnLike, DsnProtocol } from './types-hoist/dsn';
export type { DebugImage, DebugMeta } from './types-hoist/debugMeta';
export type {
AttachmentItem,
BaseEnvelopeHeaders,
BaseEnvelopeItemHeaders,
ClientReportEnvelope,
ClientReportItem,
DynamicSamplingContext,
Envelope,
EnvelopeItemType,
EnvelopeItem,
EventEnvelope,
EventEnvelopeHeaders,
EventItem,
ReplayEnvelope,
FeedbackItem,
SessionEnvelope,
SessionItem,
UserFeedbackItem,
CheckInItem,
CheckInEnvelope,
RawSecurityEnvelope,
RawSecurityItem,
ProfileItem,
ProfileChunkEnvelope,
ProfileChunkItem,
SpanEnvelope,
SpanItem,
OtelLogEnvelope,
OtelLogItem,
} from './types-hoist/envelope';
export type { ExtendedError } from './types-hoist/error';
export type { Event, EventHint, EventType, ErrorEvent, TransactionEvent } from './types-hoist/event';
export type { EventProcessor } from './types-hoist/eventprocessor';
export type { Exception } from './types-hoist/exception';
export type { Extra, Extras } from './types-hoist/extra';
export type { Integration, IntegrationFn } from './types-hoist/integration';
export type { Mechanism } from './types-hoist/mechanism';
export type { ExtractedNodeRequestData, HttpHeaderValue, Primitive, WorkerLocation } from './types-hoist/misc';
export type { ClientOptions, Options } from './types-hoist/options';
export type { Package } from './types-hoist/package';
export type { PolymorphicEvent, PolymorphicRequest } from './types-hoist/polymorphics';
export type {
ThreadId,
FrameId,
StackId,
ThreadCpuSample,
ThreadCpuStack,
ThreadCpuFrame,
ThreadCpuProfile,
ContinuousThreadCpuProfile,
Profile,
ProfileChunk,
} from './types-hoist/profiling';
export type { ReplayEvent, ReplayRecordingData, ReplayRecordingMode } from './types-hoist/replay';
export type {
FeedbackEvent,
FeedbackFormData,
FeedbackInternalOptions,
FeedbackModalIntegration,
FeedbackScreenshotIntegration,
SendFeedback,
SendFeedbackParams,
UserFeedback,
} from './types-hoist/feedback';
export type { QueryParams, RequestEventData, SanitizedRequestData } from './types-hoist/request';
export type { Runtime } from './types-hoist/runtime';
export type { SdkInfo } from './types-hoist/sdkinfo';
export type { SdkMetadata } from './types-hoist/sdkmetadata';
export type {
SessionAggregates,
AggregationCounts,
Session,
SessionContext,
SessionStatus,
SerializedSession,
} from './types-hoist/session';
export type { SeverityLevel } from './types-hoist/severity';
export type {
Span,
SentrySpanArguments,
SpanOrigin,
SpanAttributeValue,
SpanAttributes,
SpanTimeInput,
SpanJSON,
SpanContextData,
TraceFlag,
} from './types-hoist/span';
export type { SpanStatus } from './types-hoist/spanStatus';
export type {
Log,
LogSeverityLevel,
SerializedOtelLog,
SerializedLogAttribute,
SerializedLogAttributeValueType,
} from './types-hoist/log';
export type { TimedEvent } from './types-hoist/timedEvent';
export type { StackFrame } from './types-hoist/stackframe';
export type { Stacktrace, StackParser, StackLineParser, StackLineParserFn } from './types-hoist/stacktrace';
export type { PropagationContext, TracePropagationTargets, SerializedTraceData } from './types-hoist/tracing';
export type { StartSpanOptions } from './types-hoist/startSpanOptions';
export type { TraceparentData, TransactionSource } from './types-hoist/transaction';
export type { CustomSamplingContext, SamplingContext } from './types-hoist/samplingcontext';
export type {
DurationUnit,
InformationUnit,
FractionUnit,
MeasurementUnit,
NoneUnit,
Measurements,
} from './types-hoist/measurement';
export type { Thread } from './types-hoist/thread';
export type {
Transport,
TransportRequest,
TransportMakeRequestResponse,
InternalBaseTransportOptions,
BaseTransportOptions,
TransportRequestExecutor,
} from './types-hoist/transport';
export type { User } from './types-hoist/user';
export type { WebFetchHeaders, WebFetchRequest } from './types-hoist/webfetchapi';
export type { WrappedFunction } from './types-hoist/wrappedfunction';
export type {
HandlerDataFetch,
HandlerDataXhr,
HandlerDataDom,
HandlerDataConsole,
HandlerDataHistory,
HandlerDataError,
HandlerDataUnhandledRejection,
ConsoleLevel,
SentryXhrData,
SentryWrappedXMLHttpRequest,
} from './types-hoist/instrument';
export type { BrowserClientReplayOptions, BrowserClientProfilingOptions } from './types-hoist/browseroptions';
export type {
CheckIn,
MonitorConfig,
FinishedCheckIn,
InProgressCheckIn,
SerializedCheckIn,
} from './types-hoist/checkin';
export type { ParameterizedString } from './types-hoist/parameterize';
export type { ContinuousProfiler, ProfilingIntegration, Profiler } from './types-hoist/profiling';
export type { ViewHierarchyData, ViewHierarchyWindow } from './types-hoist/view-hierarchy';
export type { LegacyCSPReport } from './types-hoist/csp';
4 changes: 3 additions & 1 deletion packages/core/src/integration.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import type { Client } from './client';
import { getClient } from './currentScopes';
import { DEBUG_BUILD } from './debug-build';
import type { Event, EventHint, Integration, IntegrationFn, Options } from './types-hoist';
import type { Event, EventHint } from './types-hoist/event';
import type { Integration, IntegrationFn } from './types-hoist/integration';
import type { Options } from './types-hoist/options';
import { logger } from './utils-hoist/logger';

export const installedIntegrations: string[] = [];
Expand Down
Loading
Loading