Skip to content

Commit 0caddec

Browse files
authored
ref(feedback): Move UserFeedback type into feedback.ts (#11032)
Moving the UserFeedback type into the feedback file. It's a better place for it, especially as there will be more related things coming soon (related to the feedback widget)
1 parent a48b293 commit 0caddec

File tree

4 files changed

+15
-11
lines changed

4 files changed

+15
-11
lines changed

packages/types/src/envelope.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ import type { ClientReport } from './clientreport';
44
import type { DsnComponents } from './dsn';
55
import type { Event } from './event';
66
import type { FeedbackEvent } from './feedback';
7+
import type { UserFeedback } from './feedback';
78
import type { Profile } from './profiling';
89
import type { ReplayEvent, ReplayRecordingData } from './replay';
910
import type { SdkInfo } from './sdkinfo';
1011
import type { SerializedSession, Session, SessionAggregates } from './session';
1112
import type { Transaction } from './transaction';
12-
import type { UserFeedback } from './user';
1313

1414
// Based on: https://develop.sentry.dev/sdk/envelopes/
1515

packages/types/src/feedback.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
import type { Event } from './event';
2+
import type { User } from './user';
23

3-
export interface FeedbackContext extends Record<string, unknown> {
4+
/**
5+
* Crash report feedback object
6+
*/
7+
export interface UserFeedback {
8+
event_id: string;
9+
email: User['email'];
10+
name: string;
11+
comments: string;
12+
}
13+
14+
interface FeedbackContext extends Record<string, unknown> {
415
message: string;
516
contact_email?: string;
617
name?: string;

packages/types/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export type {
6969
Profile,
7070
} from './profiling';
7171
export type { ReplayEvent, ReplayRecordingData, ReplayRecordingMode } from './replay';
72-
export type { FeedbackEvent } from './feedback';
72+
export type { FeedbackEvent, UserFeedback } from './feedback';
7373
export type { QueryParams, Request, SanitizedRequestData } from './request';
7474
export type { Runtime } from './runtime';
7575
export type { CaptureContext, Scope, ScopeContext, ScopeData } from './scope';
@@ -131,7 +131,7 @@ export type {
131131
BaseTransportOptions,
132132
TransportRequestExecutor,
133133
} from './transport';
134-
export type { User, UserFeedback } from './user';
134+
export type { User } from './user';
135135
export type { WebFetchHeaders, WebFetchRequest } from './webfetchapi';
136136
export type { WrappedFunction } from './wrappedfunction';
137137
export type {

packages/types/src/user.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,3 @@ export interface User {
88
email?: string;
99
username?: string;
1010
}
11-
12-
export interface UserFeedback {
13-
event_id: string;
14-
email: User['email'];
15-
name: string;
16-
comments: string;
17-
}

0 commit comments

Comments
 (0)