group.tsx 18 KB

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