group.tsx 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781
  1. import type {SearchGroup} from 'sentry/components/smartSearchBar/types';
  2. import type {FieldKind} from 'sentry/utils/fields';
  3. import type {Actor, TimeseriesValue} from './core';
  4. import type {Event, EventMetadata, EventOrGroupType, Level} from './event';
  5. import type {Commit, PullRequest, Repository} from './integrations';
  6. import type {Team} from './organization';
  7. import type {PlatformKey, Project} from './project';
  8. import type {AvatarUser, User} from './user';
  9. export type EntryData = Record<string, any | Array<any>>;
  10. /**
  11. * Saved issues searches
  12. */
  13. export type RecentSearch = {
  14. dateCreated: string;
  15. id: string;
  16. lastSeen: string;
  17. organizationId: string;
  18. query: string;
  19. type: SavedSearchType;
  20. };
  21. // XXX: Deprecated Sentry 9 attributes are not included here.
  22. export type SavedSearch = {
  23. dateCreated: string;
  24. id: string;
  25. isGlobal: boolean;
  26. isPinned: boolean;
  27. name: string;
  28. query: string;
  29. sort: string;
  30. type: SavedSearchType;
  31. visibility: SavedSearchVisibility;
  32. };
  33. export enum SavedSearchVisibility {
  34. ORGANIZATION = 'organization',
  35. OWNER = 'owner',
  36. OWNER_PINNED = 'owner_pinned',
  37. }
  38. export enum SavedSearchType {
  39. ISSUE = 0,
  40. EVENT = 1,
  41. SESSION = 2,
  42. REPLAY = 3,
  43. METRIC = 4,
  44. }
  45. export enum IssueCategory {
  46. PERFORMANCE = 'performance',
  47. ERROR = 'error',
  48. CRON = 'cron',
  49. PROFILE = 'profile',
  50. }
  51. export enum IssueType {
  52. // Error
  53. ERROR = 'error',
  54. // Performance
  55. PERFORMANCE_CONSECUTIVE_DB_QUERIES = 'performance_consecutive_db_queries',
  56. PERFORMANCE_CONSECUTIVE_HTTP = 'performance_consecutive_http',
  57. PERFORMANCE_FILE_IO_MAIN_THREAD = 'performance_file_io_main_thread',
  58. PERFORMANCE_DB_MAIN_THREAD = 'performance_db_main_thread',
  59. PERFORMANCE_N_PLUS_ONE_API_CALLS = 'performance_n_plus_one_api_calls',
  60. PERFORMANCE_N_PLUS_ONE_DB_QUERIES = 'performance_n_plus_one_db_queries',
  61. PERFORMANCE_SLOW_DB_QUERY = 'performance_slow_db_query',
  62. PERFORMANCE_RENDER_BLOCKING_ASSET = 'performance_render_blocking_asset_span',
  63. PERFORMANCE_UNCOMPRESSED_ASSET = 'performance_uncompressed_assets',
  64. PERFORMANCE_LARGE_HTTP_PAYLOAD = 'performance_large_http_payload',
  65. PERFORMANCE_HTTP_OVERHEAD = 'performance_http_overhead',
  66. PERFORMANCE_DURATION_REGRESSION = 'performance_duration_regression',
  67. // Profile
  68. PROFILE_FILE_IO_MAIN_THREAD = 'profile_file_io_main_thread',
  69. PROFILE_IMAGE_DECODE_MAIN_THREAD = 'profile_image_decode_main_thread',
  70. PROFILE_JSON_DECODE_MAIN_THREAD = 'profile_json_decode_main_thread',
  71. PROFILE_REGEX_MAIN_THREAD = 'profile_regex_main_thread',
  72. PROFILE_FRAME_DROP = 'profile_frame_drop',
  73. PROFILE_FRAME_DROP_EXPERIMENTAL = 'profile_frame_drop_experimental',
  74. PROFILE_FUNCTION_REGRESSION_EXPERIMENTAL = 'profile_function_regression_exp',
  75. }
  76. export enum IssueTitle {
  77. PERFORMANCE_CONSECUTIVE_DB_QUERIES = 'Consecutive DB Queries',
  78. PERFORMANCE_CONSECUTIVE_HTTP = 'Consecutive HTTP',
  79. PERFORMANCE_FILE_IO_MAIN_THREAD = 'File IO on Main Thread',
  80. PERFORMANCE_DB_MAIN_THREAD = 'DB on Main Thread',
  81. PERFORMANCE_N_PLUS_ONE_API_CALLS = 'N+1 API Call',
  82. PERFORMANCE_N_PLUS_ONE_DB_QUERIES = 'N+1 Query',
  83. PERFORMANCE_SLOW_DB_QUERY = 'Slow DB Query',
  84. PERFORMANCE_RENDER_BLOCKING_ASSET = 'Large Render Blocking Asset',
  85. PERFORMANCE_UNCOMPRESSED_ASSET = 'Uncompressed Asset',
  86. PERFORMANCE_LARGE_HTTP_PAYLOAD = 'Large HTTP payload',
  87. PERFORMANCE_HTTP_OVERHEAD = 'HTTP/1.1 Overhead',
  88. PERFORMANCE_DURATION_REGRESSION = 'Duration Regression',
  89. }
  90. export const getIssueTypeFromOccurenceType = (
  91. typeId: number | undefined
  92. ): IssueType | null => {
  93. const occurrenceTypeToIssueIdMap = {
  94. 1001: IssueType.PERFORMANCE_SLOW_DB_QUERY,
  95. 1004: IssueType.PERFORMANCE_RENDER_BLOCKING_ASSET,
  96. 1006: IssueType.PERFORMANCE_N_PLUS_ONE_DB_QUERIES,
  97. 1007: IssueType.PERFORMANCE_CONSECUTIVE_DB_QUERIES,
  98. 1008: IssueType.PERFORMANCE_FILE_IO_MAIN_THREAD,
  99. 1009: IssueType.PERFORMANCE_CONSECUTIVE_HTTP,
  100. 1010: IssueType.PERFORMANCE_N_PLUS_ONE_API_CALLS,
  101. 1012: IssueType.PERFORMANCE_UNCOMPRESSED_ASSET,
  102. 1013: IssueType.PERFORMANCE_DB_MAIN_THREAD,
  103. 1015: IssueType.PERFORMANCE_LARGE_HTTP_PAYLOAD,
  104. 1016: IssueType.PERFORMANCE_HTTP_OVERHEAD,
  105. };
  106. if (!typeId) {
  107. return null;
  108. }
  109. return occurrenceTypeToIssueIdMap[typeId] ?? null;
  110. };
  111. // endpoint: /api/0/issues/:issueId/attachments/?limit=50
  112. export type IssueAttachment = {
  113. dateCreated: string;
  114. event_id: string;
  115. headers: object;
  116. id: string;
  117. mimetype: string;
  118. name: string;
  119. sha1: string;
  120. size: number;
  121. type: string;
  122. };
  123. // endpoint: /api/0/projects/:orgSlug/:projSlug/events/:eventId/attachments/
  124. export type EventAttachment = IssueAttachment;
  125. /**
  126. * Issue Tags
  127. */
  128. export type Tag = {
  129. key: string;
  130. name: string;
  131. isInput?: boolean;
  132. kind?: FieldKind;
  133. /**
  134. * How many values should be suggested in autocomplete.
  135. * Overrides SmartSearchBar's `maxSearchItems` prop.
  136. */
  137. maxSuggestedValues?: number;
  138. predefined?: boolean;
  139. totalValues?: number;
  140. /**
  141. * Usually values are strings, but a predefined tag can define its SearchGroups
  142. */
  143. values?: string[] | SearchGroup[];
  144. };
  145. export type TagCollection = Record<string, Tag>;
  146. export type TagValue = {
  147. count: number;
  148. firstSeen: string;
  149. lastSeen: string;
  150. name: string;
  151. value: string;
  152. email?: string;
  153. identifier?: string;
  154. ipAddress?: string;
  155. key?: string;
  156. query?: string;
  157. username?: string;
  158. } & AvatarUser;
  159. type Topvalue = {
  160. count: number;
  161. firstSeen: string;
  162. key: string;
  163. lastSeen: string;
  164. name: string;
  165. value: string;
  166. // Might not actually exist.
  167. query?: string;
  168. readable?: string;
  169. };
  170. export type TagWithTopValues = {
  171. key: string;
  172. name: string;
  173. topValues: Array<Topvalue>;
  174. totalValues: number;
  175. uniqueValues: number;
  176. canDelete?: boolean;
  177. };
  178. /**
  179. * Inbox, issue owners and Activity
  180. */
  181. export type InboxReasonDetails = {
  182. count?: number | null;
  183. until?: string | null;
  184. user_count?: number | null;
  185. user_window?: number | null;
  186. window?: number | null;
  187. };
  188. export const enum GroupInboxReason {
  189. NEW = 0,
  190. UNIGNORED = 1,
  191. REGRESSION = 2,
  192. MANUAL = 3,
  193. REPROCESSED = 4,
  194. ESCALATING = 5,
  195. ONGOING = 6,
  196. }
  197. export type InboxDetails = {
  198. date_added?: string;
  199. reason?: GroupInboxReason;
  200. reason_details?: InboxReasonDetails | null;
  201. };
  202. export type SuggestedOwnerReason =
  203. | 'suspectCommit'
  204. | 'ownershipRule'
  205. | 'projectOwnership'
  206. // TODO: codeowners may no longer exist
  207. | 'codeowners';
  208. // Received from the backend to denote suggested owners of an issue
  209. export type SuggestedOwner = {
  210. date_added: string;
  211. owner: string;
  212. type: SuggestedOwnerReason;
  213. };
  214. export interface ParsedOwnershipRule {
  215. matcher: {pattern: string; type: string};
  216. owners: Actor[];
  217. }
  218. export type IssueOwnership = {
  219. autoAssignment:
  220. | 'Auto Assign to Suspect Commits'
  221. | 'Auto Assign to Issue Owner'
  222. | 'Turn off Auto-Assignment';
  223. codeownersAutoSync: boolean;
  224. dateCreated: string | null;
  225. fallthrough: boolean;
  226. isActive: boolean;
  227. lastUpdated: string | null;
  228. raw: string | null;
  229. schema?: {rules: ParsedOwnershipRule[]; version: number};
  230. };
  231. export enum GroupActivityType {
  232. NOTE = 'note',
  233. SET_RESOLVED = 'set_resolved',
  234. SET_RESOLVED_BY_AGE = 'set_resolved_by_age',
  235. SET_RESOLVED_IN_RELEASE = 'set_resolved_in_release',
  236. SET_RESOLVED_IN_COMMIT = 'set_resolved_in_commit',
  237. SET_RESOLVED_IN_PULL_REQUEST = 'set_resolved_in_pull_request',
  238. SET_UNRESOLVED = 'set_unresolved',
  239. SET_IGNORED = 'set_ignored',
  240. SET_PUBLIC = 'set_public',
  241. SET_PRIVATE = 'set_private',
  242. SET_REGRESSION = 'set_regression',
  243. CREATE_ISSUE = 'create_issue',
  244. UNMERGE_SOURCE = 'unmerge_source',
  245. UNMERGE_DESTINATION = 'unmerge_destination',
  246. FIRST_SEEN = 'first_seen',
  247. ASSIGNED = 'assigned',
  248. UNASSIGNED = 'unassigned',
  249. MERGE = 'merge',
  250. REPROCESS = 'reprocess',
  251. MARK_REVIEWED = 'mark_reviewed',
  252. AUTO_SET_ONGOING = 'auto_set_ongoing',
  253. SET_ESCALATING = 'set_escalating',
  254. }
  255. interface GroupActivityBase {
  256. dateCreated: string;
  257. id: string;
  258. project: Project;
  259. assignee?: string;
  260. issue?: Group;
  261. user?: null | User;
  262. }
  263. interface GroupActivityNote extends GroupActivityBase {
  264. data: {
  265. text: string;
  266. };
  267. type: GroupActivityType.NOTE;
  268. }
  269. interface GroupActivitySetResolved extends GroupActivityBase {
  270. data: Record<string, any>;
  271. type: GroupActivityType.SET_RESOLVED;
  272. }
  273. interface GroupActivitySetUnresolved extends GroupActivityBase {
  274. data: Record<string, any>;
  275. type: GroupActivityType.SET_UNRESOLVED;
  276. }
  277. interface GroupActivitySetPublic extends GroupActivityBase {
  278. data: Record<string, any>;
  279. type: GroupActivityType.SET_PUBLIC;
  280. }
  281. interface GroupActivitySetPrivate extends GroupActivityBase {
  282. data: Record<string, any>;
  283. type: GroupActivityType.SET_PRIVATE;
  284. }
  285. interface GroupActivitySetByAge extends GroupActivityBase {
  286. data: Record<string, any>;
  287. type: GroupActivityType.SET_RESOLVED_BY_AGE;
  288. }
  289. interface GroupActivityUnassigned extends GroupActivityBase {
  290. data: Record<string, any>;
  291. type: GroupActivityType.UNASSIGNED;
  292. }
  293. interface GroupActivityFirstSeen extends GroupActivityBase {
  294. data: Record<string, any>;
  295. type: GroupActivityType.FIRST_SEEN;
  296. }
  297. interface GroupActivityMarkReviewed extends GroupActivityBase {
  298. data: Record<string, any>;
  299. type: GroupActivityType.MARK_REVIEWED;
  300. }
  301. interface GroupActivityRegression extends GroupActivityBase {
  302. data: {
  303. /**
  304. * True if the project is using semver to decide if the event is a regression.
  305. * Available when the issue was resolved in a release.
  306. */
  307. follows_semver?: boolean;
  308. /**
  309. * The version that the issue was previously resolved in.
  310. * Available when the issue was resolved in a release.
  311. */
  312. resolved_in_version?: string;
  313. version?: string;
  314. };
  315. type: GroupActivityType.SET_REGRESSION;
  316. }
  317. export interface GroupActivitySetByResolvedInNextSemverRelease extends GroupActivityBase {
  318. data: {
  319. // Set for semver releases
  320. current_release_version: string;
  321. };
  322. type: GroupActivityType.SET_RESOLVED_IN_RELEASE;
  323. }
  324. export interface GroupActivitySetByResolvedInRelease extends GroupActivityBase {
  325. data: {
  326. version?: string;
  327. };
  328. type: GroupActivityType.SET_RESOLVED_IN_RELEASE;
  329. }
  330. interface GroupActivitySetByResolvedInCommit extends GroupActivityBase {
  331. data: {
  332. commit?: Commit;
  333. };
  334. type: GroupActivityType.SET_RESOLVED_IN_COMMIT;
  335. }
  336. interface GroupActivitySetByResolvedInPullRequest extends GroupActivityBase {
  337. data: {
  338. pullRequest?: PullRequest;
  339. };
  340. type: GroupActivityType.SET_RESOLVED_IN_PULL_REQUEST;
  341. }
  342. export interface GroupActivitySetIgnored extends GroupActivityBase {
  343. data: {
  344. ignoreCount?: number;
  345. ignoreDuration?: number;
  346. ignoreUntil?: string;
  347. /** Archived until escalating */
  348. ignoreUntilEscalating?: boolean;
  349. ignoreUserCount?: number;
  350. ignoreUserWindow?: number;
  351. ignoreWindow?: number;
  352. };
  353. type: GroupActivityType.SET_IGNORED;
  354. }
  355. export interface GroupActivityReprocess extends GroupActivityBase {
  356. data: {
  357. eventCount: number;
  358. newGroupId: number;
  359. oldGroupId: number;
  360. };
  361. type: GroupActivityType.REPROCESS;
  362. }
  363. interface GroupActivityUnmergeDestination extends GroupActivityBase {
  364. data: {
  365. fingerprints: Array<string>;
  366. source?: {
  367. id: string;
  368. shortId: string;
  369. };
  370. };
  371. type: GroupActivityType.UNMERGE_DESTINATION;
  372. }
  373. interface GroupActivityUnmergeSource extends GroupActivityBase {
  374. data: {
  375. fingerprints: Array<string>;
  376. destination?: {
  377. id: string;
  378. shortId: string;
  379. };
  380. };
  381. type: GroupActivityType.UNMERGE_SOURCE;
  382. }
  383. interface GroupActivityMerge extends GroupActivityBase {
  384. data: {
  385. issues: Array<any>;
  386. };
  387. type: GroupActivityType.MERGE;
  388. }
  389. interface GroupActivityAutoSetOngoing extends GroupActivityBase {
  390. data: {
  391. afterDays?: number;
  392. };
  393. type: GroupActivityType.AUTO_SET_ONGOING;
  394. }
  395. export interface GroupActivitySetEscalating extends GroupActivityBase {
  396. data: {
  397. expired_snooze?: {
  398. count: number | null;
  399. until: Date | null;
  400. user_count: number | null;
  401. user_window: number | null;
  402. window: number | null;
  403. };
  404. forecast?: number;
  405. };
  406. type: GroupActivityType.SET_ESCALATING;
  407. }
  408. export interface GroupActivityAssigned extends GroupActivityBase {
  409. data: {
  410. assignee: string;
  411. assigneeType: string;
  412. user: Team | User;
  413. assigneeEmail?: string;
  414. /**
  415. * If the user was assigned via an integration
  416. */
  417. integration?: 'projectOwnership' | 'codeowners' | 'slack' | 'msteams';
  418. /** Codeowner or Project owner rule as a string */
  419. rule?: string;
  420. };
  421. type: GroupActivityType.ASSIGNED;
  422. }
  423. export interface GroupActivityCreateIssue extends GroupActivityBase {
  424. data: {
  425. location: string;
  426. provider: string;
  427. title: string;
  428. };
  429. type: GroupActivityType.CREATE_ISSUE;
  430. }
  431. export type GroupActivity =
  432. | GroupActivityNote
  433. | GroupActivitySetResolved
  434. | GroupActivitySetUnresolved
  435. | GroupActivitySetIgnored
  436. | GroupActivitySetByAge
  437. | GroupActivitySetByResolvedInRelease
  438. | GroupActivitySetByResolvedInNextSemverRelease
  439. | GroupActivitySetByResolvedInCommit
  440. | GroupActivitySetByResolvedInPullRequest
  441. | GroupActivityFirstSeen
  442. | GroupActivityMerge
  443. | GroupActivityReprocess
  444. | GroupActivityUnassigned
  445. | GroupActivityMarkReviewed
  446. | GroupActivityUnmergeDestination
  447. | GroupActivitySetPublic
  448. | GroupActivitySetPrivate
  449. | GroupActivityRegression
  450. | GroupActivityUnmergeSource
  451. | GroupActivityAssigned
  452. | GroupActivityCreateIssue
  453. | GroupActivityAutoSetOngoing
  454. | GroupActivitySetEscalating;
  455. export type Activity = GroupActivity;
  456. interface GroupFiltered {
  457. count: string;
  458. firstSeen: string;
  459. lastSeen: string;
  460. stats: Record<string, TimeseriesValue[]>;
  461. userCount: number;
  462. }
  463. export interface GroupStats extends GroupFiltered {
  464. filtered: GroupFiltered | null;
  465. id: string;
  466. // for issue alert previews, the last time a group triggered a rule
  467. lastTriggered?: string;
  468. lifetime?: GroupFiltered;
  469. sessionCount?: string | null;
  470. }
  471. export interface IgnoredStatusDetails {
  472. actor?: AvatarUser;
  473. ignoreCount?: number;
  474. // Sent in requests. ignoreUntil is used in responses.
  475. ignoreDuration?: number;
  476. ignoreUntil?: string;
  477. ignoreUntilEscalating?: boolean;
  478. ignoreUserCount?: number;
  479. ignoreUserWindow?: number;
  480. ignoreWindow?: number;
  481. }
  482. export interface ResolvedStatusDetails {
  483. actor?: AvatarUser;
  484. autoResolved?: boolean;
  485. inCommit?: {
  486. commit?: string;
  487. dateCreated?: string;
  488. id?: string;
  489. repository?: string | Repository;
  490. };
  491. inNextRelease?: boolean;
  492. inRelease?: string;
  493. repository?: string;
  494. }
  495. interface ReprocessingStatusDetails {
  496. info: {
  497. dateCreated: string;
  498. totalEvents: number;
  499. } | null;
  500. pendingEvents: number;
  501. }
  502. export interface UserParticipant extends User {
  503. type: 'user';
  504. }
  505. export interface TeamParticipant extends Team {
  506. type: 'team';
  507. }
  508. /**
  509. * The payload sent when marking reviewed
  510. */
  511. export interface MarkReviewed {
  512. inbox: false;
  513. }
  514. /**
  515. * The payload sent when updating a group's status
  516. */
  517. export interface GroupStatusResolution {
  518. status: GroupStatus.RESOLVED | GroupStatus.UNRESOLVED | GroupStatus.IGNORED;
  519. statusDetails: ResolvedStatusDetails | IgnoredStatusDetails | {};
  520. substatus?: GroupSubstatus | null;
  521. }
  522. export const enum GroupStatus {
  523. RESOLVED = 'resolved',
  524. UNRESOLVED = 'unresolved',
  525. IGNORED = 'ignored',
  526. REPROCESSING = 'reprocessing',
  527. }
  528. export const enum GroupSubstatus {
  529. ARCHIVED_UNTIL_ESCALATING = 'archived_until_escalating',
  530. ARCHIVED_UNTIL_CONDITION_MET = 'archived_until_condition_met',
  531. ARCHIVED_FOREVER = 'archived_forever',
  532. ESCALATING = 'escalating',
  533. ONGOING = 'ongoing',
  534. REGRESSED = 'regressed',
  535. NEW = 'new',
  536. }
  537. // TODO(ts): incomplete
  538. export interface BaseGroup {
  539. activity: GroupActivity[];
  540. annotations: string[];
  541. assignedTo: Actor | null;
  542. culprit: string;
  543. firstSeen: string;
  544. hasSeen: boolean;
  545. id: string;
  546. isBookmarked: boolean;
  547. isPublic: boolean;
  548. isSubscribed: boolean;
  549. isUnhandled: boolean;
  550. issueCategory: IssueCategory;
  551. issueType: IssueType;
  552. lastSeen: string;
  553. level: Level;
  554. logger: string | null;
  555. metadata: EventMetadata;
  556. numComments: number;
  557. participants: Array<UserParticipant | TeamParticipant>;
  558. permalink: string;
  559. platform: PlatformKey;
  560. pluginActions: any[]; // TODO(ts)
  561. pluginContexts: any[]; // TODO(ts)
  562. pluginIssues: any[]; // TODO(ts)
  563. project: Project;
  564. seenBy: User[];
  565. shareId: string;
  566. shortId: string;
  567. status: GroupStatus;
  568. statusDetails: IgnoredStatusDetails | ResolvedStatusDetails | ReprocessingStatusDetails;
  569. subscriptionDetails: {disabled?: boolean; reason?: string} | null;
  570. title: string;
  571. type: EventOrGroupType;
  572. userReportCount: number;
  573. inbox?: InboxDetails | null | false;
  574. latestEvent?: Event;
  575. owners?: SuggestedOwner[] | null;
  576. substatus?: GroupSubstatus | null;
  577. }
  578. export interface GroupReprocessing extends BaseGroup, GroupStats {
  579. status: GroupStatus.REPROCESSING;
  580. statusDetails: ReprocessingStatusDetails;
  581. }
  582. export interface GroupResolved extends BaseGroup, GroupStats {
  583. status: GroupStatus.RESOLVED;
  584. statusDetails: ResolvedStatusDetails;
  585. }
  586. export interface GroupIgnored extends BaseGroup, GroupStats {
  587. status: GroupStatus.IGNORED;
  588. statusDetails: IgnoredStatusDetails;
  589. }
  590. export interface GroupUnresolved extends BaseGroup, GroupStats {
  591. status: GroupStatus.UNRESOLVED;
  592. statusDetails: {};
  593. }
  594. export type Group = GroupUnresolved | GroupResolved | GroupIgnored | GroupReprocessing;
  595. export interface GroupTombstone {
  596. actor: AvatarUser;
  597. culprit: string;
  598. id: string;
  599. level: Level;
  600. metadata: EventMetadata;
  601. type: EventOrGroupType;
  602. title?: string;
  603. }
  604. export interface GroupTombstoneHelper extends GroupTombstone {
  605. isTombstone: true;
  606. }
  607. export type ProcessingIssueItem = {
  608. checksum: string;
  609. data: {
  610. // TODO(ts) This type is likely incomplete, but this is what
  611. // project processing issues settings uses.
  612. _scope: string;
  613. image_arch: string;
  614. image_path: string;
  615. image_uuid: string;
  616. dist?: string;
  617. release?: string;
  618. };
  619. id: string;
  620. lastSeen: string;
  621. numEvents: number;
  622. type: string;
  623. };
  624. export type ProcessingIssue = {
  625. hasIssues: boolean;
  626. hasMoreResolveableIssues: boolean;
  627. issuesProcessing: number;
  628. lastSeen: string;
  629. numIssues: number;
  630. project: string;
  631. resolveableIssues: number;
  632. signedLink: string;
  633. issues?: ProcessingIssueItem[];
  634. };
  635. /**
  636. * Datascrubbing
  637. */
  638. export type Meta = {
  639. chunks: Array<ChunkType>;
  640. err: Array<MetaError>;
  641. len: number;
  642. rem: Array<MetaRemark>;
  643. };
  644. export type MetaError = string | [string, any];
  645. export type MetaRemark = Array<string | number>;
  646. export type ChunkType = {
  647. rule_id: string | number;
  648. text: string;
  649. type: string;
  650. remark?: string | number;
  651. };
  652. /**
  653. * User Feedback
  654. */
  655. export type UserReport = {
  656. comments: string;
  657. dateCreated: string;
  658. email: string;
  659. event: {eventID: string; id: string};
  660. eventID: string;
  661. id: string;
  662. issue: Group;
  663. name: string;
  664. user: User;
  665. };
  666. export type KeyValueListDataItem = {
  667. key: string;
  668. subject: string;
  669. actionButton?: React.ReactNode;
  670. isContextData?: boolean;
  671. isMultiValue?: boolean;
  672. meta?: Meta;
  673. subjectDataTestId?: string;
  674. subjectIcon?: React.ReactNode;
  675. value?: React.ReactNode;
  676. };
  677. export type KeyValueListData = KeyValueListDataItem[];
  678. // Response from ShortIdLookupEndpoint
  679. // /organizations/${orgId}/shortids/${query}/
  680. export type ShortIdResponse = {
  681. group: Group;
  682. groupId: string;
  683. organizationSlug: string;
  684. projectSlug: string;
  685. shortId: string;
  686. };
  687. /**
  688. * Note used in Group Activity and Alerts for users to comment
  689. */
  690. export type Note = {
  691. /**
  692. * Array of [id, display string] tuples used for @-mentions
  693. */
  694. mentions: [string, string][];
  695. /**
  696. * Note contents (markdown allowed)
  697. */
  698. text: string;
  699. };