availableNotificationActions.ts 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. import type {AvailableNotificationAction} from 'sentry/types/notificationActions';
  2. export function AvailableNotificationActionsFixture(
  3. params: AvailableNotificationAction[] = []
  4. ): {actions: AvailableNotificationAction[]} {
  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. {
  120. action: {
  121. triggerType: 'spike-protection',
  122. serviceType: 'opsgenie',
  123. targetType: 'specific',
  124. integrationId: 3,
  125. integrationName: 'sentry-enterprise',
  126. targetIdentifier: '1-opsgenie-test-team-2',
  127. targetDisplay: 'opsgenie-test-team-2',
  128. },
  129. requires: [
  130. {
  131. name: 'projects',
  132. description: 'Project slugs which will receive the action',
  133. },
  134. ],
  135. },
  136. {
  137. action: {
  138. triggerType: 'spike-protection',
  139. serviceType: 'opsgenie',
  140. targetType: 'specific',
  141. integrationId: 3,
  142. integrationName: 'sentry-enterprise',
  143. targetIdentifier: '1-opsgenie-test-team',
  144. targetDisplay: 'opsgenie-test-team',
  145. },
  146. requires: [
  147. {
  148. name: 'projects',
  149. description: 'Project slugs which will receive the action',
  150. },
  151. ],
  152. },
  153. ...params,
  154. ],
  155. };
  156. }