group.tsx 19 KB

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