@spotlightjs/overlay 2.14.1 → 2.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/dist/integrations/sentry/components/insights/Profiles.d.ts +2 -0
  2. package/dist/integrations/sentry/components/insights/envelopes/EnvelopeList.d.ts +3 -1
  3. package/dist/integrations/sentry/components/insights/envelopes/index.d.ts +3 -1
  4. package/dist/integrations/sentry/components/shared/TimeBar.d.ts +9 -0
  5. package/dist/integrations/sentry/constants/sentry.d.ts +4 -0
  6. package/dist/integrations/sentry/constants.d.ts +20 -3
  7. package/dist/integrations/sentry/data/profiles.d.ts +4 -3
  8. package/dist/integrations/sentry/store/helpers.d.ts +2 -0
  9. package/dist/integrations/sentry/store/index.d.ts +3 -0
  10. package/dist/integrations/sentry/store/slices/envelopesSlice.d.ts +4 -0
  11. package/dist/integrations/sentry/store/slices/eventsSlice.d.ts +4 -0
  12. package/dist/integrations/sentry/store/slices/profilesSlice.d.ts +4 -0
  13. package/dist/integrations/sentry/store/slices/sdksSlice.d.ts +4 -0
  14. package/dist/integrations/sentry/store/slices/settingsSlice.d.ts +6 -0
  15. package/dist/integrations/sentry/store/slices/sharedSlice.d.ts +4 -0
  16. package/dist/integrations/sentry/store/slices/subscriptionsSlice.d.ts +6 -0
  17. package/dist/integrations/sentry/store/slices/tracesSlice.d.ts +4 -0
  18. package/dist/integrations/sentry/store/store.d.ts +4 -0
  19. package/dist/integrations/sentry/store/types.d.ts +83 -0
  20. package/dist/integrations/sentry/store/utils.d.ts +2 -0
  21. package/dist/integrations/sentry/types.d.ts +10 -2
  22. package/dist/integrations/sentry/utils/sentry.d.ts +5 -0
  23. package/dist/sentry-spotlight.iife.js +106 -106
  24. package/dist/sentry-spotlight.iife.js.map +1 -1
  25. package/dist/sentry-spotlight.js +10323 -10166
  26. package/dist/sentry-spotlight.js.map +1 -1
  27. package/dist/sentry-spotlight.umd.cjs +106 -106
  28. package/dist/sentry-spotlight.umd.cjs.map +1 -1
  29. package/package.json +3 -2
  30. package/dist/integrations/sentry/data/sentryDataCache.d.ts +0 -76
  31. package/dist/integrations/sentry/data/useSentryHelpers.d.ts +0 -3
  32. /package/dist/integrations/sentry/{data/sentryDataCache.spec.d.ts → store/store.spec.d.ts} +0 -0
@@ -0,0 +1,2 @@
1
+ declare function Profiles(): import("react/jsx-runtime").JSX.Element;
2
+ export default Profiles;
@@ -1 +1,3 @@
1
- export default function EnvelopeList(): import("react/jsx-runtime").JSX.Element;
1
+ export default function EnvelopeList({ showAll }: {
2
+ showAll: boolean;
3
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1 +1,3 @@
1
- export default function EnvelopesTab(): import("react/jsx-runtime").JSX.Element;
1
+ export default function EnvelopesTab(props: {
2
+ showAll: boolean;
3
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ type TimeBarProps = {
2
+ value: number;
3
+ maxValue: number;
4
+ title?: string;
5
+ children?: React.ReactNode;
6
+ className?: string;
7
+ };
8
+ export declare function TimeBar({ value, maxValue, title, children, className }: TimeBarProps): import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -0,0 +1,4 @@
1
+ export declare const ERROR_EVENT_TYPES: Set<string>;
2
+ export declare const TRACE_EVENT_TYPES: Set<string>;
3
+ export declare const PROFILE_EVENT_TYPES: Set<string>;
4
+ export declare const SUPPORTED_EVENT_TYPES: Set<string>;
@@ -1,7 +1,24 @@
1
1
  export declare const DB_SPAN_REGEX: RegExp;
2
+ export declare const AGGREGATE_CALL_PROFILES_SORT_KEYS: {
3
+ functionName: string;
4
+ totalTime: string;
5
+ samples: string;
6
+ traces: string;
7
+ };
8
+ export declare const AGGREGATE_PROFILES_HEADERS: ({
9
+ id: string;
10
+ title: string;
11
+ sortKey: string;
12
+ primary: boolean;
13
+ } | {
14
+ id: string;
15
+ title: string;
16
+ sortKey: string;
17
+ primary?: undefined;
18
+ })[];
2
19
  export declare const RESOURCES_SORT_KEYS: {
3
20
  avgDuration: string;
4
- timeSpent: string;
21
+ totalTime: string;
5
22
  description: string;
6
23
  avgEncodedSize: string;
7
24
  };
@@ -18,7 +35,7 @@ export declare const RESOURCE_HEADERS: ({
18
35
  })[];
19
36
  export declare const QUERIES_SORT_KEYS: {
20
37
  queryDesc: string;
21
- timeSpent: string;
38
+ totalTime: string;
22
39
  avgDuration: string;
23
40
  };
24
41
  export declare const QUERIES_HEADERS: ({
@@ -70,7 +87,7 @@ export declare const TRANSACTION_SUMMARY_TABLE_HEADERS: ({
70
87
  export declare const QUERY_SUMMARY_SORT_KEYS: {
71
88
  foundIn: string;
72
89
  spanId: string;
73
- timeSpent: string;
90
+ totalTime: string;
74
91
  };
75
92
  export declare const QUERY_SUMMARY_HEADERS: ({
76
93
  id: string;
@@ -1,10 +1,11 @@
1
- import { Span, Trace } from '../types';
2
- import { SentryProfileWithTraceMeta } from './sentryDataCache';
1
+ import { SentryProfileWithTraceMeta } from '../store/types';
2
+ import { EventFrame, Span, Trace } from '../types';
3
3
 
4
+ export declare function getFunctionNameFromFrame(frame: EventFrame): string;
4
5
  export declare function getSpansFromProfile(trace: Trace, profile: SentryProfileWithTraceMeta, parent_span_id: string | undefined, startTs: number, endTs: number, threadIds: Set<string>): Span[];
5
6
  /**
6
7
  * Modifies the spanTree in place recursively by adding spans from the
7
8
  * profile data where there are gaps in the trace data.
8
9
  * @param spanTree Span[] The tree of spans to graft profile spans into
9
10
  */
10
- export declare function graftProfileSpans(trace: Trace, spanTree?: Span[], parent?: Span | Trace, profile?: SentryProfileWithTraceMeta): void;
11
+ export declare function graftProfileSpans(trace: Trace, profile?: SentryProfileWithTraceMeta, spanTree?: Span[], parent?: Span | Trace): void;
@@ -0,0 +1,2 @@
1
+ export declare function isLocalTrace(traceId: string): boolean | null;
2
+ export declare function getLocalTraces(): import('../types').Trace[];
@@ -0,0 +1,3 @@
1
+ import { default as store } from './store';
2
+
3
+ export default store;
@@ -0,0 +1,4 @@
1
+ import { StateCreator } from 'zustand';
2
+ import { EnvelopesSliceActions, EnvelopesSliceState, SentryStore } from '../types';
3
+
4
+ export declare const createEnvelopesSlice: StateCreator<SentryStore, [], [], EnvelopesSliceState & EnvelopesSliceActions>;
@@ -0,0 +1,4 @@
1
+ import { StateCreator } from 'zustand';
2
+ import { EventsSliceActions, EventsSliceState, SentryStore } from '../types';
3
+
4
+ export declare const createEventsSlice: StateCreator<SentryStore, [], [], EventsSliceState & EventsSliceActions>;
@@ -0,0 +1,4 @@
1
+ import { StateCreator } from 'zustand';
2
+ import { ProfilesSliceActions, ProfilesSliceState, SentryStore } from '../types';
3
+
4
+ export declare const createProfilesSlice: StateCreator<SentryStore, [], [], ProfilesSliceState & ProfilesSliceActions>;
@@ -0,0 +1,4 @@
1
+ import { StateCreator } from 'zustand';
2
+ import { SDKsSliceActions, SDKsSliceState, SentryStore } from '../types';
3
+
4
+ export declare const createSDKsSlice: StateCreator<SentryStore, [], [], SDKsSliceState & SDKsSliceActions>;
@@ -0,0 +1,6 @@
1
+ import { StateCreator } from 'zustand';
2
+ import { SentryStore, SettingsSliceActions, SettingsSliceState } from '../types';
3
+
4
+ export declare const createSettingsSlice: StateCreator<SentryStore, [
5
+ ], [
6
+ ], SettingsSliceState & SettingsSliceActions>;
@@ -0,0 +1,4 @@
1
+ import { StateCreator } from 'zustand';
2
+ import { SentryStore, SharedSliceActions } from '../types';
3
+
4
+ export declare const createSharedSlice: StateCreator<SentryStore, [], [], SharedSliceActions>;
@@ -0,0 +1,6 @@
1
+ import { StateCreator } from 'zustand';
2
+ import { SentryStore, SubscriptionsSliceActions, SubscriptionsSliceState } from '../types';
3
+
4
+ export declare const createSubscriptionsSlice: StateCreator<SentryStore, [
5
+ ], [
6
+ ], SubscriptionsSliceState & SubscriptionsSliceActions>;
@@ -0,0 +1,4 @@
1
+ import { StateCreator } from 'zustand';
2
+ import { SentryStore, TracesSliceActions, TracesSliceState } from '../types';
3
+
4
+ export declare const createTracesSlice: StateCreator<SentryStore, [], [], TracesSliceState & TracesSliceActions>;
@@ -0,0 +1,4 @@
1
+ import { SharedSliceActions } from './types';
2
+
3
+ declare const useSentryStore: import('zustand').UseBoundStore<import('zustand').StoreApi<import('./types').EventsSliceState & import('./types').TracesSliceState & import('./types').ProfilesSliceState & import('./types').SubscriptionsSliceState & import('./types').SettingsSliceState & import('./types').EnvelopesSliceState & import('./types').SDKsSliceState & import('./types').EventsSliceActions & import('./types').TracesSliceActions & import('./types').ProfilesSliceActions & import('./types').SubscriptionsSliceActions & import('./types').SettingsSliceActions & import('./types').EnvelopesSliceActions & import('./types').SDKsSliceActions & SharedSliceActions>>;
4
+ export default useSentryStore;
@@ -0,0 +1,83 @@
1
+ import { Envelope } from '@sentry/core';
2
+ import { RawEventContext } from '../../integration';
3
+ import { AggregateCallData, Sdk, SentryErrorEvent, SentryEvent, SentryProcessedProfile, Trace } from '../types';
4
+
5
+ export type SentryProfileWithTraceMeta = SentryProcessedProfile & {
6
+ timestamp: number;
7
+ active_thread_id: string;
8
+ };
9
+ export type OnlineSubscription = ['online', (status: boolean) => void];
10
+ export type EventSubscription = ['event', (event: SentryEvent) => void];
11
+ export type TraceSubscription = ['trace', (trace: Trace) => void];
12
+ export type Subscription = OnlineSubscription | EventSubscription | TraceSubscription;
13
+ export interface EventsSliceState {
14
+ events: SentryEvent[];
15
+ eventIds: Set<string>;
16
+ }
17
+ export interface EventsSliceActions {
18
+ pushEvent: (event: SentryEvent & {
19
+ event_id?: string;
20
+ }) => Promise<void>;
21
+ getEvents: () => SentryEvent[];
22
+ }
23
+ export interface TracesSliceState {
24
+ traces: Trace[];
25
+ tracesById: Map<string, Trace>;
26
+ localTraceIds: Set<string>;
27
+ }
28
+ export interface TracesSliceActions {
29
+ trackLocalTrace: (traceId: string) => void;
30
+ getTraces: () => Trace[];
31
+ }
32
+ export interface ProfilesSliceState {
33
+ profilesByTraceId: Map<string, SentryProfileWithTraceMeta>;
34
+ }
35
+ export interface ProfilesSliceActions {
36
+ getProfileByTraceId: (id: string) => SentryProfileWithTraceMeta | undefined;
37
+ getAggregateCallData: () => AggregateCallData[];
38
+ }
39
+ export interface SubscriptionsSliceState {
40
+ subscribers: Map<string, Subscription>;
41
+ }
42
+ export interface SubscriptionsSliceActions {
43
+ subscribe: (...args: Subscription) => () => void;
44
+ }
45
+ export interface SettingsSliceState {
46
+ contextLinesProvider: string;
47
+ }
48
+ export interface SettingsSliceActions {
49
+ setSidecarUrl: (url: string) => void;
50
+ }
51
+ export interface EnvelopesSliceState {
52
+ envelopes: Array<{
53
+ envelope: Envelope;
54
+ rawEnvelope: RawEventContext;
55
+ }>;
56
+ }
57
+ export interface EnvelopesSliceActions {
58
+ pushEnvelope: (params: {
59
+ envelope: Envelope;
60
+ rawEnvelope: RawEventContext;
61
+ }) => number;
62
+ getEnvelopes: () => Array<{
63
+ envelope: Envelope;
64
+ rawEnvelope: RawEventContext;
65
+ }>;
66
+ }
67
+ export interface SDKsSliceState {
68
+ sdks: Sdk[];
69
+ }
70
+ export interface SDKsSliceActions {
71
+ inferSdkFromEvent: (event: SentryEvent) => Sdk;
72
+ getSdks: () => Sdk[];
73
+ }
74
+ export interface SharedSliceActions {
75
+ getEventById: (id: string) => SentryEvent | undefined;
76
+ getTraceById: (id: string) => Trace | undefined;
77
+ getEventsByTrace: (traceId: string, spanId?: string | null) => SentryEvent[];
78
+ processStacktrace: (errorEvent: SentryErrorEvent) => Promise<void[]>;
79
+ resetData: () => void;
80
+ }
81
+ export type SentryStoreState = EventsSliceState & TracesSliceState & ProfilesSliceState & SubscriptionsSliceState & SettingsSliceState & EnvelopesSliceState & SDKsSliceState;
82
+ export type SentryStoreActions = EventsSliceActions & TracesSliceActions & ProfilesSliceActions & SubscriptionsSliceActions & SettingsSliceActions & EnvelopesSliceActions & SDKsSliceActions & SharedSliceActions;
83
+ export type SentryStore = SentryStoreState & SentryStoreActions;
@@ -0,0 +1,2 @@
1
+ export declare function toTimestamp(date: string | number): number;
2
+ export declare function relativeNsToTimestamp(startTs: number, ns: number | string): number;
@@ -1,5 +1,7 @@
1
1
  import { EventEnvelopeHeaders, Measurements } from '@sentry/core';
2
2
 
3
+ export type TraceId = string;
4
+ export type SpanId = string;
3
5
  export type FrameVars = {
4
6
  [key: string]: string;
5
7
  };
@@ -86,8 +88,8 @@ export type SentryErrorEvent = CommonEventAttrs & {
86
88
  exception: EventException;
87
89
  };
88
90
  export type Span = {
89
- trace_id?: string;
90
- span_id: string;
91
+ trace_id?: TraceId;
92
+ span_id: SpanId;
91
93
  parent_span_id?: string | null;
92
94
  op?: string | null;
93
95
  description?: string | null;
@@ -130,6 +132,12 @@ export type SentryProfile = {
130
132
  export type SentryProcessedProfile = SentryProfile & {
131
133
  samples: ProcessedProfileSample[];
132
134
  };
135
+ export type AggregateCallData = {
136
+ name: string;
137
+ totalTime: number;
138
+ samples: number;
139
+ traceIds: Set<TraceId>;
140
+ };
133
141
  export type SentryDeviceInfo = {
134
142
  architecture: string;
135
143
  is_emulator?: boolean;
@@ -0,0 +1,5 @@
1
+ import { SentryErrorEvent, SentryEvent, SentryProfileV1Event, SentryTransactionEvent } from '../types';
2
+
3
+ export declare function isErrorEvent(event: SentryEvent): event is SentryErrorEvent;
4
+ export declare function isProfileEvent(event: SentryEvent): event is SentryProfileV1Event;
5
+ export declare function isTraceEvent(event: SentryEvent): event is SentryTransactionEvent;