@sentry/types 8.0.0-alpha.9 → 8.0.0-beta.2

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 (37) hide show
  1. package/package.json +1 -1
  2. package/types/breadcrumb.d.ts +52 -1
  3. package/types/breadcrumb.d.ts.map +1 -1
  4. package/types/datacategory.d.ts +1 -1
  5. package/types/datacategory.d.ts.map +1 -1
  6. package/types/envelope.d.ts +9 -2
  7. package/types/envelope.d.ts.map +1 -1
  8. package/types/feedback/config.d.ts +147 -0
  9. package/types/feedback/config.d.ts.map +1 -0
  10. package/types/feedback/form.d.ts +8 -0
  11. package/types/feedback/form.d.ts.map +1 -0
  12. package/types/feedback/index.d.ts +63 -0
  13. package/types/feedback/index.d.ts.map +1 -0
  14. package/types/feedback/sendFeedback.d.ts +47 -0
  15. package/types/feedback/sendFeedback.d.ts.map +1 -0
  16. package/types/feedback/theme.d.ts +115 -0
  17. package/types/feedback/theme.d.ts.map +1 -0
  18. package/types/hub.d.ts +7 -0
  19. package/types/hub.d.ts.map +1 -1
  20. package/types/index.d.ts +2 -2
  21. package/types/index.d.ts.map +1 -1
  22. package/types/options.d.ts +12 -0
  23. package/types/options.d.ts.map +1 -1
  24. package/types-ts3.8/breadcrumb.d.ts +52 -1
  25. package/types-ts3.8/datacategory.d.ts +1 -1
  26. package/types-ts3.8/envelope.d.ts +9 -2
  27. package/types-ts3.8/feedback/config.d.ts +147 -0
  28. package/types-ts3.8/feedback/form.d.ts +8 -0
  29. package/types-ts3.8/feedback/index.d.ts +63 -0
  30. package/types-ts3.8/feedback/sendFeedback.d.ts +47 -0
  31. package/types-ts3.8/feedback/theme.d.ts +115 -0
  32. package/types-ts3.8/hub.d.ts +7 -0
  33. package/types-ts3.8/index.d.ts +2 -2
  34. package/types-ts3.8/options.d.ts +12 -0
  35. package/types/feedback.d.ts +0 -30
  36. package/types/feedback.d.ts.map +0 -1
  37. package/types-ts3.8/feedback.d.ts +0 -30
@@ -78,6 +78,18 @@ export interface ClientOptions<TO extends BaseTransportOptions = BaseTransportOp
78
78
  * Note that `tracesSampleRate` and `tracesSampler` take precedence over this option.
79
79
  */
80
80
  enableTracing?: boolean;
81
+ /**
82
+ * If this is enabled, any spans started will always have their parent be the active root span,
83
+ * if there is any active span.
84
+ *
85
+ * This is necessary because in some environments (e.g. browser),
86
+ * we cannot guarantee an accurate active span.
87
+ * Because we cannot properly isolate execution environments,
88
+ * you may get wrong results when using e.g. nested `startSpan()` calls.
89
+ *
90
+ * To solve this, in these environments we'll by default enable this option.
91
+ */
92
+ parentSpanIsAlwaysRootSpan?: boolean;
81
93
  /**
82
94
  * Initial data to populate scope.
83
95
  */
@@ -1 +1 @@
1
- {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AACvE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAEnE,MAAM,WAAW,aAAa,CAAC,EAAE,SAAS,oBAAoB,GAAG,oBAAoB;IACnF;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC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SAAQ,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC,EAAE,cAAc,GAAG,WAAW,GAAG,aAAa,CAAC;IACtF;;;OAGG;IACH,mBAAmB,CAAC,EAAE,KAAK,GAAG,WAAW,EAAE,CAAC;IAE5C;;;;OAIG;IACH,YAAY,CAAC,EAAE,WAAW,EAAE,GAAG,CAAC,CAAC,YAAY,EAAE,WAAW,EAAE,KAAK,WAAW,EAAE,CAAC,CAAC;IAEhF;;;;OAIG;IACH,SAAS,CAAC,EAAE,CAAC,gBAAgB,EAAE,EAAE,KAAK,SAAS,CAAC;IAEhD;;;OAGG;IACH,WAAW,CAAC,EAAE,WAAW,GAAG,eAAe,EAAE,CAAC;CAC/C"}
@@ -1,14 +1,65 @@
1
1
  import { SeverityLevel } from './severity';
2
- /** JSDoc */
2
+ /**
3
+ * Sentry uses breadcrumbs to create a trail of events that happened prior to an issue.
4
+ * These events are very similar to traditional logs but can record more rich structured data.
5
+ *
6
+ * @link https://develop.sentry.dev/sdk/event-payloads/breadcrumbs/
7
+ */
3
8
  export interface Breadcrumb {
9
+ /**
10
+ * By default, all breadcrumbs are recorded as default, which makes them appear as a Debug entry, but Sentry provides
11
+ * other types that influence how the breadcrumbs are rendered. For more information, see the description of
12
+ * recognized breadcrumb types.
13
+ *
14
+ * @summary The type of breadcrumb.
15
+ * @link https://develop.sentry.dev/sdk/event-payloads/breadcrumbs/#breadcrumb-types
16
+ */
4
17
  type?: string;
18
+ /**
19
+ * Allowed values are, from highest to lowest:
20
+ * `fatal`, `error`, `warning`, `info`, and `debug`.
21
+ * Levels are used in the UI to emphasize and deemphasize the crumb. The default is `info`.
22
+ *
23
+ * @summary This defines the severity level of the breadcrumb.
24
+ */
5
25
  level?: SeverityLevel;
6
26
  event_id?: string;
27
+ /**
28
+ * Typically it is a module name or a descriptive string. For instance, `ui.click` could be used to
29
+ * indicate that a click happened in the UI or flask could be used to indicate that the event originated in
30
+ * the Flask framework.
31
+ * @private Internally we render some crumbs' color and icon based on the provided category.
32
+ * For more information, see the description of recognized breadcrumb types.
33
+ * @summary A dotted string indicating what the crumb is or from where it comes.
34
+ * @link https://develop.sentry.dev/sdk/event-payloads/breadcrumbs/#breadcrumb-types
35
+ */
7
36
  category?: string;
37
+ /**
38
+ * If a message is provided, it is rendered as text with all whitespace preserved.
39
+ *
40
+ * @summary Human-readable message for the breadcrumb.
41
+ */
8
42
  message?: string;
43
+ /**
44
+ * Contains a dictionary whose contents depend on the breadcrumb type.
45
+ * Additional parameters that are unsupported by the type are rendered as a key/value table.
46
+ *
47
+ * @summary Arbitrary data associated with this breadcrumb.
48
+ */
9
49
  data?: {
10
50
  [key: string]: any;
11
51
  };
52
+ /**
53
+ * The format is a numeric (integer or float) value representing
54
+ * the number of seconds that have elapsed since the Unixepoch.
55
+ * Breadcrumbs are most useful when they include a timestamp, as it creates a timeline
56
+ * leading up to an event expection/error.
57
+ *
58
+ * @note The API supports a string as defined in RFC 3339, but the SDKs only support a numeric value for now.
59
+ *
60
+ * @summary A timestamp representing when the breadcrumb occurred.
61
+ * @link https://develop.sentry.dev/sdk/event-payloads/breadcrumbs/#:~:text=is%20info.-,timestamp,-(recommended)
62
+ */
12
63
  timestamp?: number;
13
64
  }
14
65
  /** JSDoc */
@@ -1,2 +1,2 @@
1
- export type DataCategory = 'default' | 'error' | 'transaction' | 'replay' | 'security' | 'attachment' | 'session' | 'internal' | 'profile' | 'monitor' | 'feedback' | 'statsd' | 'unknown';
1
+ export type DataCategory = 'default' | 'error' | 'transaction' | 'replay' | 'security' | 'attachment' | 'session' | 'internal' | 'profile' | 'monitor' | 'feedback' | 'metric_bucket' | 'span' | 'unknown';
2
2
  //# sourceMappingURL=datacategory.d.ts.map
@@ -8,6 +8,7 @@ import { Profile } from './profiling';
8
8
  import { ReplayEvent, ReplayRecordingData } from './replay';
9
9
  import { SdkInfo } from './sdkinfo';
10
10
  import { SerializedSession, Session, SessionAggregates } from './session';
11
+ import { Span } from './span';
11
12
  export type DynamicSamplingContext = {
12
13
  trace_id: string;
13
14
  public_key: DsnComponents['publicKey'];
@@ -18,7 +19,7 @@ export type DynamicSamplingContext = {
18
19
  replay_id?: string;
19
20
  sampled?: string;
20
21
  };
21
- export type EnvelopeItemType = 'client_report' | 'user_report' | 'feedback' | 'session' | 'sessions' | 'transaction' | 'attachment' | 'event' | 'profile' | 'replay_event' | 'replay_recording' | 'check_in' | 'statsd';
22
+ export type EnvelopeItemType = 'client_report' | 'user_report' | 'feedback' | 'session' | 'sessions' | 'transaction' | 'attachment' | 'event' | 'profile' | 'replay_event' | 'replay_recording' | 'check_in' | 'statsd' | 'span';
22
23
  export type BaseEnvelopeHeaders = {
23
24
  [key: string]: unknown;
24
25
  dsn?: string;
@@ -79,6 +80,9 @@ type StatsdItemHeaders = {
79
80
  type ProfileItemHeaders = {
80
81
  type: 'profile';
81
82
  };
83
+ type SpanItemHeaders = {
84
+ type: 'span';
85
+ };
82
86
  export type EventItem = BaseEnvelopeItem<EventItemHeaders, Event>;
83
87
  export type AttachmentItem = BaseEnvelopeItem<AttachmentItemHeaders, string | Uint8Array>;
84
88
  export type UserFeedbackItem = BaseEnvelopeItem<UserFeedbackItemHeaders, UserFeedback>;
@@ -90,6 +94,7 @@ type ReplayRecordingItem = BaseEnvelopeItem<ReplayRecordingItemHeaders, ReplayRe
90
94
  export type StatsdItem = BaseEnvelopeItem<StatsdItemHeaders, string>;
91
95
  export type FeedbackItem = BaseEnvelopeItem<FeedbackItemHeaders, FeedbackEvent>;
92
96
  export type ProfileItem = BaseEnvelopeItem<ProfileItemHeaders, Profile>;
97
+ export type SpanItem = BaseEnvelopeItem<SpanItemHeaders, Span>;
93
98
  export type EventEnvelopeHeaders = {
94
99
  event_id: string;
95
100
  sent_at: string;
@@ -104,6 +109,7 @@ type CheckInEnvelopeHeaders = {
104
109
  type ClientReportEnvelopeHeaders = BaseEnvelopeHeaders;
105
110
  type ReplayEnvelopeHeaders = BaseEnvelopeHeaders;
106
111
  type StatsdEnvelopeHeaders = BaseEnvelopeHeaders;
112
+ type SpanEnvelopeHeaders = BaseEnvelopeHeaders;
107
113
  export type EventEnvelope = BaseEnvelope<EventEnvelopeHeaders, EventItem | AttachmentItem | UserFeedbackItem | FeedbackItem | ProfileItem>;
108
114
  export type SessionEnvelope = BaseEnvelope<SessionEnvelopeHeaders, SessionItem>;
109
115
  export type ClientReportEnvelope = BaseEnvelope<ClientReportEnvelopeHeaders, ClientReportItem>;
@@ -116,7 +122,8 @@ export type ReplayEnvelope = [
116
122
  ];
117
123
  export type CheckInEnvelope = BaseEnvelope<CheckInEnvelopeHeaders, CheckInItem>;
118
124
  export type StatsdEnvelope = BaseEnvelope<StatsdEnvelopeHeaders, StatsdItem>;
119
- export type Envelope = EventEnvelope | SessionEnvelope | ClientReportEnvelope | ReplayEnvelope | CheckInEnvelope | StatsdEnvelope;
125
+ export type SpanEnvelope = BaseEnvelope<SpanEnvelopeHeaders, SpanItem>;
126
+ export type Envelope = EventEnvelope | SessionEnvelope | ClientReportEnvelope | ReplayEnvelope | CheckInEnvelope | StatsdEnvelope | SpanEnvelope;
120
127
  export type EnvelopeItem = Envelope[1][number];
121
128
  export {};
122
129
  //# sourceMappingURL=envelope.d.ts.map
@@ -0,0 +1,147 @@
1
+ import { FeedbackFormData } from './form';
2
+ import { FeedbackTheme } from './theme';
3
+ /**
4
+ * General feedback configuration
5
+ */
6
+ export interface FeedbackGeneralConfiguration {
7
+ /**
8
+ * id to use for the main widget container (this will host the shadow DOM)
9
+ */
10
+ id: string;
11
+ /**
12
+ * Show the Sentry branding
13
+ */
14
+ showBranding: boolean;
15
+ /**
16
+ * Auto-inject default Feedback actor button to the DOM when integration is
17
+ * added.
18
+ */
19
+ autoInject: boolean;
20
+ /**
21
+ * Should the email field be required?
22
+ */
23
+ isEmailRequired: boolean;
24
+ /**
25
+ * Should the name field be required?
26
+ */
27
+ isNameRequired: boolean;
28
+ /**
29
+ * Should the email input field be visible? Note: email will still be collected if set via `Sentry.setUser()`
30
+ */
31
+ showEmail: boolean;
32
+ /**
33
+ * Should the name input field be visible? Note: name will still be collected if set via `Sentry.setUser()`
34
+ */
35
+ showName: boolean;
36
+ /**
37
+ * Should the screen shots field be included?
38
+ * Screen shots cannot be marked as required
39
+ */
40
+ showScreenshot: boolean;
41
+ /**
42
+ * Fill in email/name input fields with Sentry user context if it exists.
43
+ * The value of the email/name keys represent the properties of your user context.
44
+ */
45
+ useSentryUser: {
46
+ email: string;
47
+ name: string;
48
+ };
49
+ }
50
+ /**
51
+ * Theme-related configuration
52
+ */
53
+ export interface FeedbackThemeConfiguration {
54
+ /**
55
+ * The colorscheme to use. "system" will choose the scheme based on the user's system settings
56
+ */
57
+ colorScheme: 'system' | 'light' | 'dark';
58
+ /**
59
+ * Light theme customization, will be merged with default theme values.
60
+ */
61
+ themeLight: FeedbackTheme;
62
+ /**
63
+ * Dark theme customization, will be merged with default theme values.
64
+ */
65
+ themeDark: FeedbackTheme;
66
+ }
67
+ /**
68
+ * All of the different text labels that can be customized
69
+ */
70
+ export interface FeedbackTextConfiguration {
71
+ /**
72
+ * The label for the Feedback widget button that opens the dialog
73
+ */
74
+ buttonLabel: string;
75
+ /**
76
+ * The label for the Feedback form cancel button that closes dialog
77
+ */
78
+ cancelButtonLabel: string;
79
+ /**
80
+ * The label for the Feedback form submit button that sends feedback
81
+ */
82
+ submitButtonLabel: string;
83
+ /**
84
+ * The title of the Feedback form
85
+ */
86
+ formTitle: string;
87
+ /**
88
+ * Label for the email input
89
+ */
90
+ emailLabel: string;
91
+ /**
92
+ * Placeholder text for Feedback email input
93
+ */
94
+ emailPlaceholder: string;
95
+ /**
96
+ * Label for the message input
97
+ */
98
+ messageLabel: string;
99
+ /**
100
+ * Placeholder text for Feedback message input
101
+ */
102
+ messagePlaceholder: string;
103
+ /**
104
+ * Label for the name input
105
+ */
106
+ nameLabel: string;
107
+ /**
108
+ * Placeholder text for Feedback name input
109
+ */
110
+ namePlaceholder: string;
111
+ /**
112
+ * Message after feedback was sent successfully
113
+ */
114
+ successMessageText: string;
115
+ /**
116
+ * Text which indicates that a field is required
117
+ */
118
+ isRequiredText: string;
119
+ }
120
+ /**
121
+ * The public callbacks available for the feedback integration
122
+ */
123
+ export interface FeedbackCallbacks {
124
+ /**
125
+ * Callback when form is opened
126
+ */
127
+ onFormOpen?: () => void;
128
+ /**
129
+ * Callback when form is closed and not submitted
130
+ */
131
+ onFormClose?: () => void;
132
+ /**
133
+ * Callback when feedback is successfully submitted
134
+ *
135
+ * After this you'll see a SuccessMessage on the screen for a moment.
136
+ */
137
+ onSubmitSuccess?: (data: FeedbackFormData) => void;
138
+ /**
139
+ * Callback when feedback is unsuccessfully submitted
140
+ */
141
+ onSubmitError?: (error: Error) => void;
142
+ /**
143
+ * Callback when the feedback form is submitted successfully, and the SuccessMessage is complete, or dismissed
144
+ */
145
+ onFormSubmitted?: () => void;
146
+ }
147
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1,8 @@
1
+ import { Attachment } from '../attachment';
2
+ export type FeedbackFormData = {
3
+ name: string;
4
+ email: string;
5
+ message: string;
6
+ attachments: Attachment[] | undefined;
7
+ };
8
+ //# sourceMappingURL=form.d.ts.map
@@ -0,0 +1,63 @@
1
+ import { Attachment } from '../attachment';
2
+ import { Integration } from '../integration';
3
+ import { FeedbackCallbacks, FeedbackGeneralConfiguration, FeedbackTextConfiguration, FeedbackThemeConfiguration } from './config';
4
+ export { FeedbackFormData } from './form';
5
+ import { FeedbackEvent, SendFeedback, SendFeedbackParams, UserFeedback } from './sendFeedback';
6
+ export { FeedbackEvent, UserFeedback, SendFeedback, SendFeedbackParams };
7
+ /**
8
+ * The integration's internal `options` member where every value should be set
9
+ */
10
+ export interface FeedbackInternalOptions extends FeedbackGeneralConfiguration, FeedbackThemeConfiguration, FeedbackTextConfiguration, FeedbackCallbacks {
11
+ }
12
+ type HTMLElement = unknown;
13
+ export interface FeedbackDialog {
14
+ /**
15
+ * The HTMLElement that is containing all the form content
16
+ */
17
+ el: HTMLElement;
18
+ /**
19
+ * Insert the Dialog into the Shadow DOM.
20
+ *
21
+ * The Dialog starts in the `closed` state where no inner HTML is rendered.
22
+ */
23
+ appendToDom: () => void;
24
+ /**
25
+ * Remove the dialog from the Shadow DOM
26
+ */
27
+ removeFromDom: () => void;
28
+ /**
29
+ * Open/Show the dialog & form inside it
30
+ */
31
+ open: () => void;
32
+ /**
33
+ * Close/Hide the dialog & form inside it
34
+ */
35
+ close: () => void;
36
+ }
37
+ type ShadowRoot = unknown;
38
+ export interface CreateDialogProps {
39
+ options: FeedbackInternalOptions;
40
+ screenshotIntegration: FeedbackScreenshotIntegration | undefined;
41
+ sendFeedback: SendFeedback;
42
+ shadow: ShadowRoot;
43
+ }
44
+ export interface FeedbackModalIntegration extends Integration {
45
+ createDialog: (props: CreateDialogProps) => FeedbackDialog;
46
+ }
47
+ type HType = unknown;
48
+ type VNode = unknown;
49
+ export interface FeedbackScreenshotIntegration extends Integration {
50
+ createInput: (h: HType, dialog: FeedbackDialog) => {
51
+ /**
52
+ * The preact component
53
+ */
54
+ input: (props: {
55
+ onError: (error: Error) => void;
56
+ }) => VNode;
57
+ /**
58
+ * The image/screenshot bytes
59
+ */
60
+ value: () => Promise<Attachment | undefined>;
61
+ };
62
+ }
63
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,47 @@
1
+ import { Attachment } from '../attachment';
2
+ import { Event } from '../event';
3
+ import { TransportMakeRequestResponse } from '../transport';
4
+ import { User } from '../user';
5
+ /**
6
+ * Crash report feedback object
7
+ */
8
+ export interface UserFeedback {
9
+ event_id: string;
10
+ email: User['email'];
11
+ name: string;
12
+ comments: string;
13
+ }
14
+ interface FeedbackContext extends Record<string, unknown> {
15
+ message: string;
16
+ contact_email?: string;
17
+ name?: string;
18
+ replay_id?: string;
19
+ url?: string;
20
+ }
21
+ /**
22
+ * NOTE: These types are still considered Alpha and subject to change.
23
+ * @hidden
24
+ */
25
+ export interface FeedbackEvent extends Event {
26
+ type: 'feedback';
27
+ contexts: Event['contexts'] & {
28
+ feedback: FeedbackContext;
29
+ };
30
+ }
31
+ export interface SendFeedbackParams {
32
+ message: string;
33
+ name?: string;
34
+ email?: string;
35
+ attachments?: Attachment[];
36
+ url?: string;
37
+ source?: string;
38
+ }
39
+ interface SendFeedbackOptions {
40
+ /**
41
+ * Should include replay with the feedback?
42
+ */
43
+ includeReplay?: boolean;
44
+ }
45
+ export type SendFeedback = (params: SendFeedbackParams, options?: SendFeedbackOptions) => Promise<TransportMakeRequestResponse>;
46
+ export {};
47
+ //# sourceMappingURL=sendFeedback.d.ts.map
@@ -0,0 +1,115 @@
1
+ export interface FeedbackTheme {
2
+ /**
3
+ * Font family for widget
4
+ */
5
+ fontFamily: string;
6
+ /**
7
+ * Font size for widget
8
+ */
9
+ fontSize: string;
10
+ /**
11
+ * Background color for actor and dialog
12
+ */
13
+ background: string;
14
+ /**
15
+ * Background color on hover
16
+ */
17
+ backgroundHover: string;
18
+ /**
19
+ * Border styling for actor and dialog
20
+ */
21
+ border: string;
22
+ /**
23
+ * Border radius styling for actor
24
+ */
25
+ borderRadius: string;
26
+ /**
27
+ * Box shadow for actor and dialog
28
+ */
29
+ boxShadow: string;
30
+ /**
31
+ * Foreground color (i.e. text color)
32
+ */
33
+ foreground: string;
34
+ /**
35
+ * Success color
36
+ */
37
+ success: string;
38
+ /**
39
+ * Error color
40
+ */
41
+ error: string;
42
+ /**
43
+ * Background color for the submit button
44
+ */
45
+ submitBackground: string;
46
+ /**
47
+ * Background color when hovering over the submit button
48
+ */
49
+ submitBackgroundHover: string;
50
+ /**
51
+ * Border style for the submit button
52
+ */
53
+ submitBorder: string;
54
+ /**
55
+ * Border style for the submit button, in the focued state
56
+ */
57
+ submitOutlineFocus: string;
58
+ /**
59
+ * Foreground color for the submit button
60
+ */
61
+ submitForeground: string;
62
+ /**
63
+ * Foreground color for the submit button, in the hover state
64
+ */
65
+ submitForegroundHover: string;
66
+ /**
67
+ * Background color for the cancel button
68
+ */
69
+ cancelBackground: string;
70
+ /**
71
+ * Background color when hovering over the cancel button
72
+ */
73
+ cancelBackgroundHover: string;
74
+ /**
75
+ * Border style for the cancel button
76
+ */
77
+ cancelBorder: string;
78
+ /**
79
+ * Border style for the cancel button, in the focued state
80
+ */
81
+ cancelOutlineFocus: string;
82
+ /**
83
+ * Foreground color for the cancel button
84
+ */
85
+ cancelForeground: string;
86
+ /**
87
+ * Foreground color for the cancel button, in the hover state
88
+ */
89
+ cancelForegroundHover: string;
90
+ /**
91
+ * Background color for form inputs
92
+ */
93
+ inputBackground: string;
94
+ /**
95
+ * Foreground color for form inputs
96
+ */
97
+ inputForeground: string;
98
+ /**
99
+ * Border styles for form inputs
100
+ */
101
+ inputBorder: string;
102
+ /**
103
+ * Border styles for form inputs when focused
104
+ */
105
+ inputOutlineFocus: string;
106
+ /**
107
+ * Border radius for dialog
108
+ */
109
+ formBorderRadius: string;
110
+ /**
111
+ * Border radius for form inputs
112
+ */
113
+ formContentBorderRadius: string;
114
+ }
115
+ //# sourceMappingURL=theme.d.ts.map
@@ -11,6 +11,13 @@ import { User } from './user';
11
11
  /**
12
12
  * Internal class used to make sure we always have the latest internal functions
13
13
  * working in case we have a version conflict.
14
+ *
15
+ * @deprecated This interface will be removed in a future major version of the SDK in favour of
16
+ * `Scope` and `Client` objects and APIs.
17
+ *
18
+ * Most APIs referencing `Hub` are themselves and will be removed in version 8 of the SDK. More information:
19
+ * - [Migration Guide](https://github.com/getsentry/sentry-javascript/blob/develop/MIGRATION.md#deprecate-hub)
20
+ *
14
21
  */
15
22
  export interface Hub {
16
23
  /**
@@ -6,7 +6,7 @@ export { Context, Contexts, DeviceContext, OsContext, AppContext, CultureContext
6
6
  export { DataCategory } from './datacategory';
7
7
  export { DsnComponents, DsnLike, DsnProtocol } from './dsn';
8
8
  export { DebugImage, DebugMeta } from './debugMeta';
9
- export { AttachmentItem, BaseEnvelopeHeaders, BaseEnvelopeItemHeaders, ClientReportEnvelope, ClientReportItem, DynamicSamplingContext, Envelope, EnvelopeItemType, EnvelopeItem, EventEnvelope, EventEnvelopeHeaders, EventItem, ReplayEnvelope, FeedbackItem, SessionEnvelope, SessionItem, UserFeedbackItem, CheckInItem, CheckInEnvelope, StatsdItem, StatsdEnvelope, ProfileItem, } from './envelope';
9
+ export { AttachmentItem, BaseEnvelopeHeaders, BaseEnvelopeItemHeaders, ClientReportEnvelope, ClientReportItem, DynamicSamplingContext, Envelope, EnvelopeItemType, EnvelopeItem, EventEnvelope, EventEnvelopeHeaders, EventItem, ReplayEnvelope, FeedbackItem, SessionEnvelope, SessionItem, UserFeedbackItem, CheckInItem, CheckInEnvelope, StatsdItem, StatsdEnvelope, ProfileItem, SpanEnvelope, SpanItem, } from './envelope';
10
10
  export { ExtendedError } from './error';
11
11
  export { Event, EventHint, EventType, ErrorEvent, TransactionEvent } from './event';
12
12
  export { EventProcessor } from './eventprocessor';
@@ -21,7 +21,7 @@ export { Package } from './package';
21
21
  export { PolymorphicEvent, PolymorphicRequest } from './polymorphics';
22
22
  export { ThreadId, FrameId, StackId, ThreadCpuSample, ThreadCpuStack, ThreadCpuFrame, ThreadCpuProfile, Profile, } from './profiling';
23
23
  export { ReplayEvent, ReplayRecordingData, ReplayRecordingMode } from './replay';
24
- export { FeedbackEvent, UserFeedback } from './feedback';
24
+ export { FeedbackDialog, FeedbackEvent, FeedbackFormData, FeedbackInternalOptions, FeedbackModalIntegration, FeedbackScreenshotIntegration, SendFeedback, SendFeedbackParams, CreateDialogProps, UserFeedback, } from './feedback';
25
25
  export { QueryParams, Request, SanitizedRequestData } from './request';
26
26
  export { Runtime } from './runtime';
27
27
  export { CaptureContext, Scope, ScopeContext, ScopeData } from './scope';
@@ -78,6 +78,18 @@ export interface ClientOptions<TO extends BaseTransportOptions = BaseTransportOp
78
78
  * Note that `tracesSampleRate` and `tracesSampler` take precedence over this option.
79
79
  */
80
80
  enableTracing?: boolean;
81
+ /**
82
+ * If this is enabled, any spans started will always have their parent be the active root span,
83
+ * if there is any active span.
84
+ *
85
+ * This is necessary because in some environments (e.g. browser),
86
+ * we cannot guarantee an accurate active span.
87
+ * Because we cannot properly isolate execution environments,
88
+ * you may get wrong results when using e.g. nested `startSpan()` calls.
89
+ *
90
+ * To solve this, in these environments we'll by default enable this option.
91
+ */
92
+ parentSpanIsAlwaysRootSpan?: boolean;
81
93
  /**
82
94
  * Initial data to populate scope.
83
95
  */
@@ -1,30 +0,0 @@
1
- import type { Event } from './event';
2
- import type { User } from './user';
3
- /**
4
- * Crash report feedback object
5
- */
6
- export interface UserFeedback {
7
- event_id: string;
8
- email: User['email'];
9
- name: string;
10
- comments: string;
11
- }
12
- interface FeedbackContext extends Record<string, unknown> {
13
- message: string;
14
- contact_email?: string;
15
- name?: string;
16
- replay_id?: string;
17
- url?: string;
18
- }
19
- /**
20
- * NOTE: These types are still considered Alpha and subject to change.
21
- * @hidden
22
- */
23
- export interface FeedbackEvent extends Event {
24
- type: 'feedback';
25
- contexts: Event['contexts'] & {
26
- feedback: FeedbackContext;
27
- };
28
- }
29
- export {};
30
- //# sourceMappingURL=feedback.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"feedback.d.ts","sourceRoot":"","sources":["../../src/feedback.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAEnC;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,UAAU,eAAgB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACvD,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,MAAM,WAAW,aAAc,SAAQ,KAAK;IAC1C,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE,KAAK,CAAC,UAAU,CAAC,GAAG;QAC5B,QAAQ,EAAE,eAAe,CAAC;KAC3B,CAAC;CACH"}
@@ -1,30 +0,0 @@
1
- import { Event } from './event';
2
- import { User } from './user';
3
- /**
4
- * Crash report feedback object
5
- */
6
- export interface UserFeedback {
7
- event_id: string;
8
- email: User['email'];
9
- name: string;
10
- comments: string;
11
- }
12
- interface FeedbackContext extends Record<string, unknown> {
13
- message: string;
14
- contact_email?: string;
15
- name?: string;
16
- replay_id?: string;
17
- url?: string;
18
- }
19
- /**
20
- * NOTE: These types are still considered Alpha and subject to change.
21
- * @hidden
22
- */
23
- export interface FeedbackEvent extends Event {
24
- type: 'feedback';
25
- contexts: Event['contexts'] & {
26
- feedback: FeedbackContext;
27
- };
28
- }
29
- export {};
30
- //# sourceMappingURL=feedback.d.ts.map