group.tsx 19 KB

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