integrationListDirectory.ts 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353
  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. assets: [],
  207. author: {name: 'Sentry Team', url: 'https://github.com/getsentry/sentry'},
  208. canDisable: true,
  209. contexts: [],
  210. description: 'Forward Sentry events to Amazon SQS.',
  211. doc: '',
  212. featureDescriptions: [
  213. {
  214. description: 'Forward Sentry errors and events to Amazon SQS.',
  215. featureGate: 'data-forwarding',
  216. },
  217. ],
  218. features: ['data-forwarding'],
  219. hasConfiguration: true,
  220. id: 'amazon-sqs',
  221. isHidden: false,
  222. isTestable: false,
  223. metadata: {},
  224. name: 'Amazon SQS',
  225. projectList: [],
  226. resourceLinks: [
  227. {
  228. title: 'Report Issue',
  229. url: 'https://github.com/getsentry/sentry/issues',
  230. },
  231. {
  232. title: 'View Source',
  233. url: 'https://github.com/getsentry/sentry/tree/master/src/sentry_plugins',
  234. },
  235. ],
  236. shortName: 'Amazon SQS',
  237. slug: 'amazon-sqs',
  238. status: 'beta',
  239. type: 'data-forwarding',
  240. version: '10.1.0.dev0',
  241. },
  242. {
  243. status: 'unknown',
  244. description: 'Send alerts to PagerDuty.',
  245. isTestable: true,
  246. isHidden: true,
  247. hasConfiguration: true,
  248. shortName: 'PagerDuty',
  249. id: 'pagerduty',
  250. assets: [],
  251. featureDescriptions: [
  252. {
  253. description:
  254. 'Configure rule based PagerDuty alerts to automatically be triggered in a specific\n service - or in multiple services!',
  255. featureGate: 'alert-rule',
  256. },
  257. ],
  258. features: ['alert-rule'],
  259. name: 'PagerDuty',
  260. author: {url: 'https://github.com/getsentry/sentry', name: 'Sentry Team'},
  261. contexts: [],
  262. doc: '',
  263. resourceLinks: [
  264. {
  265. url: 'https://github.com/getsentry/sentry/issues',
  266. title: 'Report Issue',
  267. },
  268. {
  269. url: 'https://github.com/getsentry/sentry/tree/master/src/sentry_plugins',
  270. title: 'View Source',
  271. },
  272. ],
  273. slug: 'pagerduty',
  274. projectList: [
  275. {
  276. projectId: 2,
  277. configured: true,
  278. enabled: true,
  279. projectSlug: 'javascript',
  280. projectPlatform: 'javascript',
  281. projectName: 'JavaScript',
  282. },
  283. ],
  284. version: '10.1.0.dev0',
  285. canDisable: true,
  286. type: 'notification',
  287. metadata: {},
  288. },
  289. ];
  290. }
  291. export function WebhookPluginConfigFixture(plugin?: Partial<Plugin>): Plugin {
  292. return {
  293. id: 'webhooks',
  294. name: 'WebHooks',
  295. slug: 'webhooks',
  296. shortName: 'WebHooks',
  297. type: 'notification',
  298. canDisable: true,
  299. isTestable: true,
  300. hasConfiguration: true,
  301. metadata: {},
  302. contexts: [],
  303. status: 'unknown',
  304. assets: [],
  305. doc: '',
  306. enabled: true,
  307. version: '24.1.0.dev0',
  308. author: {
  309. name: 'Sentry Team',
  310. url: 'https://github.com/getsentry/sentry',
  311. },
  312. isDeprecated: false,
  313. isHidden: false,
  314. description:
  315. '\nTrigger outgoing HTTP POST requests from Sentry.\n\nNote: To configure webhooks over multiple projects, we recommend setting up an\nInternal Integration.\n',
  316. features: ['alert-rule'],
  317. featureDescriptions: [
  318. {
  319. description: 'Configure rule based outgoing HTTP POST requests from Sentry.',
  320. featureGate: 'alert-rule',
  321. featureId: 1,
  322. },
  323. ],
  324. resourceLinks: [
  325. {
  326. title: 'Report Issue',
  327. url: 'https://github.com/getsentry/sentry/issues',
  328. },
  329. {
  330. title: 'View Source',
  331. url: 'https://github.com/getsentry/sentry/tree/master/src/sentry/plugins/sentry_webhooks',
  332. },
  333. {
  334. title: 'Internal Integrations',
  335. url: 'https://docs.sentry.io/workflow/integrations/integration-platform/#internal-integrations',
  336. },
  337. ],
  338. ...plugin,
  339. };
  340. }