availableNotificationActions.tsx 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. import type {AvailableNotificationAction as AvailableNotificationActionType} from 'sentry/types';
  2. export function AvailableNotificationActions(
  3. params: AvailableNotificationActionType[] = []
  4. ): {actions: AvailableNotificationActionType[]} {
  5. return {
  6. actions: [
  7. {
  8. action: {
  9. triggerType: 'spike-protection',
  10. serviceType: 'sentry_notification',
  11. targetType: 'specific',
  12. targetIdentifier: 'default',
  13. targetDisplay: 'default',
  14. },
  15. requires: [
  16. {
  17. name: 'projects',
  18. description: 'Project slugs which will receive the action',
  19. },
  20. ],
  21. },
  22. {
  23. action: {
  24. triggerType: 'spike-protection',
  25. serviceType: 'slack',
  26. targetType: 'specific',
  27. integrationId: 1,
  28. integrationName: 'sentry-ecosystem',
  29. },
  30. requires: [
  31. {
  32. name: 'projects',
  33. description: 'Project slugs which will receive the action',
  34. },
  35. {
  36. name: 'targetIdentifier',
  37. description: "Slack channel ID (e.g. 'C123ABC45DE')",
  38. },
  39. {
  40. name: 'targetDisplay',
  41. description: 'Slack channel name (e.g #sentry-spike-protection)',
  42. },
  43. ],
  44. },
  45. {
  46. action: {
  47. triggerType: 'spike-protection',
  48. serviceType: 'slack',
  49. targetType: 'specific',
  50. integrationId: 5,
  51. integrationName: 'sentry-enterprise',
  52. },
  53. requires: [
  54. {
  55. name: 'projects',
  56. description: 'Project slugs which will receive the action',
  57. },
  58. {
  59. name: 'targetIdentifier',
  60. description: "Slack channel ID (e.g. 'C123ABC45DE')",
  61. },
  62. {
  63. name: 'targetDisplay',
  64. description: 'Slack channel name (e.g #sentry-spike-protection)',
  65. },
  66. ],
  67. },
  68. {
  69. action: {
  70. triggerType: 'spike-protection',
  71. serviceType: 'pagerduty',
  72. targetType: 'specific',
  73. integrationId: 2,
  74. integrationName: 'sentry-enterprise',
  75. targetIdentifier: '3',
  76. targetDisplay: 'Default Service',
  77. },
  78. requires: [
  79. {
  80. name: 'projects',
  81. description: 'Project slugs which will receive the action',
  82. },
  83. ],
  84. },
  85. {
  86. action: {
  87. triggerType: 'spike-protection',
  88. serviceType: 'pagerduty',
  89. targetType: 'specific',
  90. integrationId: 2,
  91. integrationName: 'sentry-enterprise',
  92. targetIdentifier: '2',
  93. targetDisplay: 'Test 2',
  94. },
  95. requires: [
  96. {
  97. name: 'projects',
  98. description: 'Project slugs which will receive the action',
  99. },
  100. ],
  101. },
  102. {
  103. action: {
  104. triggerType: 'spike-protection',
  105. serviceType: 'pagerduty',
  106. targetType: 'specific',
  107. integrationId: 2,
  108. integrationName: 'sentry-enterprise',
  109. targetIdentifier: '1',
  110. targetDisplay: 'Test 1',
  111. },
  112. requires: [
  113. {
  114. name: 'projects',
  115. description: 'Project slugs which will receive the action',
  116. },
  117. ],
  118. },
  119. ...params,
  120. ],
  121. };
  122. }