group.tsx 18 KB

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