integrationListDirectory.ts 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
  1. import type {
  2. Integration,
  3. IntegrationProvider,
  4. Plugin,
  5. SentryApp,
  6. } from 'sentry/types/integrations';
  7. export function ProviderListFixture(): {providers: IntegrationProvider[]} {
  8. return {
  9. providers: [
  10. {
  11. canAdd: true,
  12. canDisable: false,
  13. features: ['commits', 'issue-basic'],
  14. key: 'bitbucket',
  15. metadata: {
  16. aspects: {},
  17. author: 'The Sentry Team',
  18. description:
  19. 'Connect your Sentry organization to Bitbucket, enabling the following features:',
  20. features: [],
  21. issue_url:
  22. 'https://github.com/getsentry/sentry/issues/new?template=bug.yml&title=Bitbucket%20Integration:%20&labels=Component%3A%20Integrations',
  23. noun: 'Installation',
  24. source_url:
  25. 'https://github.com/getsentry/sentry/tree/master/src/sentry/integrations/bitbucket',
  26. },
  27. name: 'Bitbucket',
  28. setupDialog: {
  29. height: 600,
  30. url: '/organizations/sentry/integrations/bitbucket/setup/',
  31. width: 600,
  32. },
  33. slug: 'bitbucket',
  34. },
  35. ],
  36. };
  37. }
  38. export function BitbucketIntegrationConfigFixture(): Integration {
  39. return {
  40. accountType: '',
  41. gracePeriodEnd: '',
  42. organizationIntegrationStatus: 'active',
  43. domainName: 'bitbucket.org/%7Bfb715533-bbd7-4666-aa57-01dc93dd9cc0%7D',
  44. icon: 'https://secure.gravatar.com/avatar/8b4cb68e40b74c90427d8262256bd1c8?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FNN-0.png',
  45. id: '4',
  46. name: '{fb715533-bbd7-4666-aa57-01dc93dd9cc0}',
  47. provider: {
  48. aspects: {},
  49. canAdd: true,
  50. canDisable: false,
  51. features: ['commits', 'issue-basic'],
  52. key: 'bitbucket',
  53. name: 'Bitbucket',
  54. slug: 'bitbucket',
  55. },
  56. status: 'active',
  57. };
  58. }
  59. export function GitHubIntegrationConfigFixture(): Integration {
  60. return {
  61. accountType: '',
  62. gracePeriodEnd: '',
  63. organizationIntegrationStatus: 'active',
  64. domainName: 'github.com',
  65. icon: 'https://secure.gravatar.com/avatar/8b4cb68e40b74c90427d8262256bd1c8',
  66. id: '5',
  67. name: 'NisanthanNanthakumar',
  68. provider: {
  69. aspects: {},
  70. canAdd: true,
  71. canDisable: false,
  72. features: ['commits', 'issue-basic'],
  73. key: 'github',
  74. name: 'Github',
  75. slug: 'github',
  76. },
  77. status: 'active',
  78. };
  79. }
  80. export function OrgOwnedAppsFixture(): SentryApp[] {
  81. return [
  82. {
  83. author: 'Sentry',
  84. clientId: 'a6d35972d4164ef18845b1e2ca954fe70ac196e0b20d4d1e8760a38772cf6f1c',
  85. clientSecret: '8f47dcef40f7486f9bacfeca257022e092a483add7cf4d619993b9ace9775a79',
  86. events: [],
  87. isAlertable: false,
  88. name: 'My Headband Washer',
  89. overview: null,
  90. owner: {id: 1, slug: 'sentry'},
  91. redirectUrl: null,
  92. schema: {},
  93. scopes: ['project:read', 'team:read', 'team:write'],
  94. slug: 'my-headband-washer-289499',
  95. status: 'internal',
  96. uuid: 'a806ab10-9608-4a4f-8dd9-ca6d6c09f9f5',
  97. verifyInstall: false,
  98. webhookUrl: 'https://myheadbandwasher.com',
  99. featureData: [],
  100. popularity: null,
  101. },
  102. {
  103. author: 'La Croix',
  104. clientId: '8cc36458a0f94c93816e06dce7d808f882cbef59af6040d2b9ec4d67092c80f1',
  105. clientSecret: '2b2aeb743c3745ab832e03bf02a7d91851908d379646499f900cd115780e8b2b',
  106. events: [],
  107. isAlertable: false,
  108. name: 'La Croix Monitor',
  109. overview: null,
  110. owner: {id: 1, slug: 'sentry'},
  111. redirectUrl: null,
  112. schema: {},
  113. scopes: ['project:read', 'project:write', 'team:read'],
  114. slug: 'la-croix-monitor',
  115. status: 'unpublished',
  116. uuid: 'a59c8fcc-2f27-49f8-af9e-02661fc3e8d7',
  117. verifyInstall: false,
  118. webhookUrl: 'https://lacroix.com',
  119. featureData: [
  120. {
  121. description:
  122. 'La Croix can **utilize the Sentry API** to pull data or update resources in Sentry (with permissions granted, of course).',
  123. featureGate: 'integrations-api',
  124. featureId: 1,
  125. },
  126. ],
  127. popularity: null,
  128. },
  129. {
  130. author: 'Nisanthan',
  131. clientId: 'c215db1accc040919e0b0dce058e0ecf4ea062bb82174d70aee8eba62351be24',
  132. clientSecret: '193583e573d14d61832de96a9efc32ceb64e59a494284f58b50328a656420a55',
  133. events: [],
  134. isAlertable: false,
  135. name: 'ClickUp',
  136. overview: null,
  137. owner: {id: 1, slug: 'sentry'},
  138. redirectUrl: null,
  139. schema: {},
  140. scopes: [],
  141. slug: 'clickup',
  142. status: 'published',
  143. uuid: '5d547ecb-7eb8-4ed2-853b-40256177d526',
  144. verifyInstall: false,
  145. webhookUrl: 'http://localhost:7000',
  146. featureData: [
  147. {
  148. description:
  149. 'Clickup can **utilize the Sentry API** to pull data or update resources in Sentry (with permissions granted, of course).',
  150. featureGate: 'integrations-api',
  151. featureId: 1,
  152. },
  153. ],
  154. popularity: null,
  155. },
  156. ];
  157. }
  158. export function PublishedAppsFixture(): SentryApp[] {
  159. return [
  160. {
  161. author: 'Nisanthan',
  162. clientId: 'c215db1accc040919e0b0dce058e0ecf4ea062bb82174d70aee8eba62351be24',
  163. clientSecret: '193583e573d14d61832de96a9efc32ceb64e59a494284f58b50328a656420a55',
  164. events: [],
  165. isAlertable: false,
  166. name: 'ClickUp',
  167. overview: null,
  168. owner: {id: 1, slug: 'sentry'},
  169. redirectUrl: null,
  170. schema: {},
  171. scopes: [],
  172. slug: 'clickup',
  173. status: 'published',
  174. popularity: 9,
  175. uuid: '5d547ecb-7eb8-4ed2-853b-40256177d526',
  176. verifyInstall: false,
  177. webhookUrl: 'http://localhost:7000',
  178. featureData: [
  179. {
  180. description:
  181. 'Clickup can **utilize the Sentry API** to pull data or update resources in Sentry (with permissions granted, of course).',
  182. featureGate: 'integrations-api',
  183. featureId: 1,
  184. },
  185. ],
  186. },
  187. ];
  188. }
  189. export function SentryAppInstallsFixture() {
  190. return [
  191. {
  192. app: {
  193. slug: 'my-headband-washer-289499',
  194. uuid: 'a806ab10-9608-4a4f-8dd9-ca6d6c09f9f5',
  195. },
  196. code: 'e5b855d51ad64fa0b6c180ed7e664c5d',
  197. organization: {slug: 'sentry'},
  198. status: 'installed',
  199. uuid: '5379e8e1-0554-468f-90ca-2e0c88f1ac32',
  200. },
  201. ];
  202. }
  203. export function PluginListConfigFixture() {
  204. return [
  205. {
  206. author: {name: 'Sentry Team', url: 'https://github.com/getsentry/sentry'},
  207. canDisable: true,
  208. contexts: [],
  209. description: 'Forward Sentry events to Amazon SQS.',
  210. doc: '',
  211. featureDescriptions: [
  212. {
  213. description: 'Forward Sentry errors and events to Amazon SQS.',
  214. featureGate: 'data-forwarding',
  215. },
  216. ],
  217. features: ['data-forwarding'],
  218. hasConfiguration: true,
  219. id: 'amazon-sqs',
  220. isHidden: false,
  221. isTestable: false,
  222. metadata: {},
  223. name: 'Amazon SQS',
  224. projectList: [],
  225. resourceLinks: [
  226. {
  227. title: 'Report Issue',
  228. url: 'https://github.com/getsentry/sentry/issues',
  229. },
  230. {
  231. title: 'View Source',
  232. url: 'https://github.com/getsentry/sentry/tree/master/src/sentry_plugins',
  233. },
  234. ],
  235. shortName: 'Amazon SQS',
  236. slug: 'amazon-sqs',
  237. status: 'beta',
  238. type: 'data-forwarding',
  239. version: '10.1.0.dev0',
  240. },
  241. {
  242. status: 'unknown',
  243. description: 'Send alerts to PagerDuty.',
  244. isTestable: true,
  245. isHidden: true,
  246. hasConfiguration: true,
  247. shortName: 'PagerDuty',
  248. id: 'pagerduty',
  249. featureDescriptions: [
  250. {
  251. description:
  252. 'Configure rule based PagerDuty alerts to automatically be triggered in a specific\n service - or in multiple services!',
  253. featureGate: 'alert-rule',
  254. },
  255. ],
  256. features: ['alert-rule'],
  257. name: 'PagerDuty',
  258. author: {url: 'https://github.com/getsentry/sentry', name: 'Sentry Team'},
  259. contexts: [],
  260. doc: '',
  261. resourceLinks: [
  262. {
  263. url: 'https://github.com/getsentry/sentry/issues',
  264. title: 'Report Issue',
  265. },
  266. {
  267. url: 'https://github.com/getsentry/sentry/tree/master/src/sentry_plugins',
  268. title: 'View Source',
  269. },
  270. ],
  271. slug: 'pagerduty',
  272. projectList: [
  273. {
  274. projectId: 2,
  275. configured: true,
  276. enabled: true,
  277. projectSlug: 'javascript',
  278. projectPlatform: 'javascript',
  279. projectName: 'JavaScript',
  280. },
  281. ],
  282. version: '10.1.0.dev0',
  283. canDisable: true,
  284. type: 'notification',
  285. metadata: {},
  286. },
  287. ];
  288. }
  289. export function WebhookPluginConfigFixture(plugin?: Partial<Plugin>): Plugin {
  290. return {
  291. id: 'webhooks',
  292. name: 'WebHooks',
  293. slug: 'webhooks',
  294. shortName: 'WebHooks',
  295. type: 'notification',
  296. canDisable: true,
  297. isTestable: true,
  298. hasConfiguration: true,
  299. metadata: {},
  300. contexts: [],
  301. status: 'unknown',
  302. doc: '',
  303. enabled: true,
  304. version: '24.1.0.dev0',
  305. author: {
  306. name: 'Sentry Team',
  307. url: 'https://github.com/getsentry/sentry',
  308. },
  309. isDeprecated: false,
  310. isHidden: false,
  311. description:
  312. '\nTrigger outgoing HTTP POST requests from Sentry.\n\nNote: To configure webhooks over multiple projects, we recommend setting up an\nInternal Integration.\n',
  313. features: ['alert-rule'],
  314. featureDescriptions: [
  315. {
  316. description: 'Configure rule based outgoing HTTP POST requests from Sentry.',
  317. featureGate: 'alert-rule',
  318. featureId: 1,
  319. },
  320. ],
  321. resourceLinks: [
  322. {
  323. title: 'Report Issue',
  324. url: 'https://github.com/getsentry/sentry/issues',
  325. },
  326. {
  327. title: 'View Source',
  328. url: 'https://github.com/getsentry/sentry/tree/master/src/sentry/plugins/sentry_webhooks',
  329. },
  330. {
  331. title: 'Internal Integrations',
  332. url: 'https://docs.sentry.io/workflow/integrations/integration-platform/#internal-integrations',
  333. },
  334. ],
  335. ...plugin,
  336. };
  337. }