group.tsx 19 KB

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