Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /*
  2. * SonarQube
  3. * Copyright (C) 2009-2021 SonarSource SA
  4. * mailto:info AT sonarsource DOT com
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 3 of the License, or (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public License
  17. * along with this program; if not, write to the Free Software Foundation,
  18. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  19. */
  20. export interface Plugin {
  21. key: string;
  22. name: string;
  23. category?: string;
  24. description?: string;
  25. editionBundled?: boolean;
  26. license?: string;
  27. organizationName?: string;
  28. homepageUrl?: string;
  29. organizationUrl?: string;
  30. issueTrackerUrl?: string;
  31. termsAndConditionsUrl?: string;
  32. }
  33. export interface PendingPluginResult {
  34. installing: PendingPlugin[];
  35. updating: PendingPlugin[];
  36. removing: PendingPlugin[];
  37. }
  38. export interface AvailablePlugin extends Plugin {
  39. release: Release;
  40. update: Update;
  41. }
  42. export interface PendingPlugin extends Plugin {
  43. version: string;
  44. implementationBuild: string;
  45. }
  46. export interface InstalledPlugin extends PendingPlugin {
  47. documentationPath?: string;
  48. issueTrackerUrl?: string;
  49. filename: string;
  50. hash: string;
  51. sonarLintSupported: boolean;
  52. updatedAt: number;
  53. updates?: Update[];
  54. }
  55. export interface Release {
  56. version: string;
  57. date: string;
  58. description?: string;
  59. changeLogUrl?: string;
  60. }
  61. export interface Update {
  62. status: string;
  63. release?: Release;
  64. requires: Plugin[];
  65. previousUpdates?: Update[];
  66. }
  67. export enum PluginType {
  68. Bundled = 'BUNDLED',
  69. External = 'EXTERNAL'
  70. }
  71. export enum RiskConsent {
  72. Accepted = 'ACCEPTED',
  73. NotAccepted = 'NOT_ACCEPTED',
  74. Required = 'REQUIRED'
  75. }
  76. export function isAvailablePlugin(plugin: Plugin): plugin is AvailablePlugin {
  77. return (plugin as any).release !== undefined;
  78. }
  79. export function isInstalledPlugin(plugin: Plugin): plugin is InstalledPlugin {
  80. return isPendingPlugin(plugin) && (plugin as any).updatedAt !== undefined;
  81. }
  82. export function isPendingPlugin(plugin: Plugin): plugin is PendingPlugin {
  83. return (plugin as any).version !== undefined;
  84. }