sentryTypes.tsx 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. import PropTypes from 'prop-types';
  2. const Avatar = PropTypes.shape({
  3. avatarType: PropTypes.oneOf(['letter_avatar', 'upload', 'gravatar']),
  4. avatarUuid: PropTypes.string,
  5. });
  6. const User = PropTypes.shape({
  7. avatar: Avatar,
  8. avatarUrl: PropTypes.string,
  9. dateJoined: PropTypes.string,
  10. email: PropTypes.string,
  11. emails: PropTypes.arrayOf(
  12. PropTypes.shape({
  13. is_verified: PropTypes.bool,
  14. id: PropTypes.string,
  15. email: PropTypes.string,
  16. })
  17. ),
  18. has2fa: PropTypes.bool,
  19. hasPasswordAuth: PropTypes.bool,
  20. id: PropTypes.string,
  21. identities: PropTypes.array,
  22. isActive: PropTypes.bool,
  23. isManaged: PropTypes.bool,
  24. lastActive: PropTypes.string,
  25. lastLogin: PropTypes.string,
  26. username: PropTypes.string,
  27. });
  28. /**
  29. * @deprecated
  30. */
  31. const Group = PropTypes.shape({
  32. id: PropTypes.string.isRequired,
  33. annotations: PropTypes.array,
  34. assignedTo: User,
  35. count: PropTypes.string,
  36. culprit: PropTypes.string,
  37. firstSeen: PropTypes.string,
  38. hasSeen: PropTypes.bool,
  39. isBookmarked: PropTypes.bool,
  40. isPublic: PropTypes.bool,
  41. isSubscribed: PropTypes.bool,
  42. lastSeen: PropTypes.string,
  43. level: PropTypes.string,
  44. logger: PropTypes.string,
  45. metadata: PropTypes.shape({
  46. value: PropTypes.string,
  47. message: PropTypes.string,
  48. directive: PropTypes.string,
  49. type: PropTypes.string,
  50. title: PropTypes.string,
  51. uri: PropTypes.string,
  52. }),
  53. numComments: PropTypes.number,
  54. permalink: PropTypes.string,
  55. project: PropTypes.shape({
  56. name: PropTypes.string,
  57. slug: PropTypes.string,
  58. }),
  59. shareId: PropTypes.string,
  60. shortId: PropTypes.string,
  61. status: PropTypes.string,
  62. statusDetails: PropTypes.object,
  63. title: PropTypes.string,
  64. type: PropTypes.oneOf([
  65. 'error',
  66. 'csp',
  67. 'hpkp',
  68. 'expectct',
  69. 'expectstaple',
  70. 'default',
  71. 'transaction',
  72. ]),
  73. userCount: PropTypes.number,
  74. });
  75. const Team = PropTypes.shape({
  76. id: PropTypes.string.isRequired,
  77. slug: PropTypes.string.isRequired,
  78. });
  79. /**
  80. * @deprecated
  81. */
  82. const Project = PropTypes.shape({
  83. // snuba returns id as number
  84. id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
  85. slug: PropTypes.string.isRequired,
  86. // snuba results may not contain a `name` or `isBookmarked
  87. teams: PropTypes.arrayOf(Team),
  88. name: PropTypes.string,
  89. isBookmarked: PropTypes.bool,
  90. status: PropTypes.string,
  91. });
  92. /**
  93. * @deprecated
  94. */
  95. const Organization = PropTypes.shape({
  96. id: PropTypes.string.isRequired,
  97. });
  98. export default {Group, Organization, Project};