You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

types.d.ts 22KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984
  1. /*
  2. * SonarQube
  3. * Copyright (C) 2009-2019 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. declare namespace T {
  21. export type Dict<T> = { [key: string]: T };
  22. export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
  23. // Type ordered alphabetically to prevent merge conflicts
  24. export interface A11ySkipLink {
  25. key: string;
  26. label: string;
  27. weight?: number;
  28. }
  29. export interface AlmApplication extends IdentityProvider {
  30. installationUrl: string;
  31. }
  32. export interface AlmOrganization extends OrganizationBase {
  33. almUrl: string;
  34. key: string;
  35. personal: boolean;
  36. privateRepos: number;
  37. publicRepos: number;
  38. }
  39. export interface AlmRepository {
  40. label: string;
  41. installationKey: string;
  42. linkedProjectKey?: string;
  43. linkedProjectName?: string;
  44. private?: boolean;
  45. }
  46. export interface AlmUnboundApplication {
  47. installationId: string;
  48. key: string;
  49. name: string;
  50. }
  51. export interface Analysis {
  52. buildString?: string;
  53. date: string;
  54. events: AnalysisEvent[];
  55. key: string;
  56. manualNewCodePeriodBaseline?: boolean;
  57. projectVersion?: string;
  58. }
  59. export interface AnalysisEvent {
  60. category: string;
  61. description?: string;
  62. key: string;
  63. name: string;
  64. qualityGate?: {
  65. failing: Array<{ branch: string; key: string; name: string }>;
  66. status: string;
  67. stillFailing: boolean;
  68. };
  69. definitionChange?: {
  70. projects: Array<{
  71. branch?: string;
  72. changeType: string;
  73. key: string;
  74. name: string;
  75. newBranch?: string;
  76. oldBranch?: string;
  77. }>;
  78. };
  79. }
  80. export interface AppState {
  81. adminPages?: Extension[];
  82. authenticationError?: boolean;
  83. authorizationError?: boolean;
  84. branchesEnabled?: boolean;
  85. canAdmin?: boolean;
  86. defaultOrganization: string;
  87. edition: EditionKey;
  88. globalPages?: Extension[];
  89. organizationsEnabled?: boolean;
  90. productionDatabase: boolean;
  91. qualifiers: string[];
  92. settings: T.Dict<string>;
  93. standalone?: boolean;
  94. version: string;
  95. }
  96. export interface Branch {
  97. analysisDate?: string;
  98. isMain: boolean;
  99. name: string;
  100. status?: { qualityGateStatus: Status };
  101. }
  102. export type BranchLike = Branch | PullRequest;
  103. export type BranchParameters = { branch?: string } | { pullRequest?: string };
  104. export type BranchType = 'LONG' | 'SHORT';
  105. export interface Breadcrumb {
  106. key: string;
  107. name: string;
  108. qualifier: string;
  109. }
  110. export interface Component extends LightComponent {
  111. alm?: { key: string; url: string };
  112. analysisDate?: string;
  113. breadcrumbs: Breadcrumb[];
  114. configuration?: ComponentConfiguration;
  115. description?: string;
  116. extensions?: Extension[];
  117. isFavorite?: boolean;
  118. leakPeriodDate?: string;
  119. name: string;
  120. path?: string;
  121. refKey?: string;
  122. qualityProfiles?: ComponentQualityProfile[];
  123. qualityGate?: { isDefault?: boolean; key: string; name: string };
  124. tags?: string[];
  125. version?: string;
  126. visibility?: Visibility;
  127. }
  128. interface ComponentConfiguration {
  129. canApplyPermissionTemplate?: boolean;
  130. canUpdateProjectVisibilityToPrivate?: boolean;
  131. extensions?: Extension[];
  132. showBackgroundTasks?: boolean;
  133. showHistory?: boolean;
  134. showLinks?: boolean;
  135. showManualMeasures?: boolean;
  136. showQualityGates?: boolean;
  137. showQualityProfiles?: boolean;
  138. showPermissions?: boolean;
  139. showSettings?: boolean;
  140. showUpdateKey?: boolean;
  141. }
  142. export interface ComponentQualityProfile {
  143. deleted?: boolean;
  144. key: string;
  145. language: string;
  146. name: string;
  147. }
  148. interface ComponentMeasureIntern {
  149. branch?: string;
  150. description?: string;
  151. isFavorite?: boolean;
  152. isRecentlyBrowsed?: boolean;
  153. key: string;
  154. match?: string;
  155. name: string;
  156. organization?: string;
  157. path?: string;
  158. project?: string;
  159. qualifier: string;
  160. refKey?: string;
  161. }
  162. export interface ComponentMeasure extends ComponentMeasureIntern {
  163. measures?: Measure[];
  164. }
  165. export interface ComponentMeasureEnhanced extends ComponentMeasureIntern {
  166. value?: string;
  167. leak?: string;
  168. measures: MeasureEnhanced[];
  169. }
  170. export interface Condition {
  171. error: string;
  172. id: number;
  173. metric: string;
  174. op?: string;
  175. }
  176. export interface CoveredFile {
  177. key: string;
  178. longName: string;
  179. coveredLines: number;
  180. }
  181. export interface Coupon {
  182. billing?: {
  183. address?: string;
  184. country?: string;
  185. email?: string;
  186. name?: string;
  187. use?: string;
  188. };
  189. maxNcloc: number;
  190. planActiveUntil: string;
  191. }
  192. export interface CurrentUser {
  193. isLoggedIn: boolean;
  194. permissions?: { global: string[] };
  195. showOnboardingTutorial?: boolean;
  196. }
  197. export interface CurrentUserSetting {
  198. key: CurrentUserSettingNames;
  199. value: string;
  200. }
  201. type CurrentUserSettingNames = 'notifications.optOut' | 'notifications.readDate';
  202. export interface CustomMeasure {
  203. createdAt?: string;
  204. description?: string;
  205. id: string;
  206. metric: {
  207. key: string;
  208. name: string;
  209. domain?: string;
  210. type: string;
  211. };
  212. projectKey: string;
  213. pending?: boolean;
  214. user: {
  215. active?: boolean;
  216. email?: string;
  217. login: string;
  218. name: string;
  219. };
  220. value: string;
  221. updatedAt?: string;
  222. }
  223. export interface Duplication {
  224. blocks: DuplicationBlock[];
  225. }
  226. export interface DuplicationBlock {
  227. _ref: string;
  228. from: number;
  229. size: number;
  230. }
  231. export interface DuplicatedFile {
  232. key: string;
  233. name: string;
  234. project: string;
  235. projectName: string;
  236. subProject?: string;
  237. subProjectName?: string;
  238. }
  239. export type EditionKey = 'community' | 'developer' | 'enterprise' | 'datacenter';
  240. export interface Extension {
  241. key: string;
  242. name: string;
  243. }
  244. export interface FacetValue<T = string> {
  245. count: number;
  246. val: T;
  247. }
  248. export interface FlowLocation {
  249. component: string;
  250. componentName?: string;
  251. msg?: string;
  252. textRange: TextRange;
  253. }
  254. export interface Group {
  255. default?: boolean;
  256. description?: string;
  257. id: number;
  258. membersCount: number;
  259. name: string;
  260. }
  261. export type HomePage =
  262. | { type: 'APPLICATION'; branch: string | undefined; component: string }
  263. | { type: 'ISSUES' }
  264. | { type: 'MY_ISSUES' }
  265. | { type: 'MY_PROJECTS' }
  266. | { type: 'ORGANIZATION'; organization: string }
  267. | { type: 'PORTFOLIO'; component: string }
  268. | { type: 'PORTFOLIOS' }
  269. | { type: 'PROJECT'; branch: string | undefined; component: string }
  270. | { type: 'PROJECTS' };
  271. export type HomePageType =
  272. | 'APPLICATION'
  273. | 'ISSUES'
  274. | 'MY_ISSUES'
  275. | 'MY_PROJECTS'
  276. | 'ORGANIZATION'
  277. | 'PORTFOLIO'
  278. | 'PORTFOLIOS'
  279. | 'PROJECT'
  280. | 'PROJECTS';
  281. export interface IdentityProvider {
  282. backgroundColor: string;
  283. helpMessage?: string;
  284. iconPath: string;
  285. key: string;
  286. name: string;
  287. }
  288. export interface SecurityHotspot {
  289. activeRules: number;
  290. category?: string;
  291. cwe?: string;
  292. distribution?: Array<SecurityHotspot>;
  293. openSecurityHotspots: number;
  294. toReviewSecurityHotspots: number;
  295. totalRules: number;
  296. vulnerabilities: number;
  297. vulnerabilityRating?: number;
  298. wontFixSecurityHotspots: number;
  299. }
  300. export interface Issue {
  301. actions: string[];
  302. assignee?: string;
  303. assigneeActive?: string;
  304. assigneeAvatar?: string;
  305. assigneeLogin?: string;
  306. assigneeName?: string;
  307. author?: string;
  308. branch?: string;
  309. comments?: IssueComment[];
  310. component: string;
  311. componentLongName: string;
  312. componentQualifier: string;
  313. componentUuid: string;
  314. creationDate: string;
  315. effort?: string;
  316. externalRuleEngine?: string;
  317. fromExternalRule?: boolean;
  318. key: string;
  319. flows: FlowLocation[][];
  320. fromHotspot: boolean;
  321. line?: number;
  322. message: string;
  323. organization: string;
  324. project: string;
  325. projectName: string;
  326. projectOrganization: string;
  327. projectKey: string;
  328. pullRequest?: string;
  329. resolution?: string;
  330. rule: string;
  331. ruleName: string;
  332. secondaryLocations: FlowLocation[];
  333. severity: string;
  334. status: string;
  335. subProject?: string;
  336. subProjectName?: string;
  337. subProjectUuid?: string;
  338. tags?: string[];
  339. textRange?: TextRange;
  340. transitions: string[];
  341. type: IssueType;
  342. }
  343. export interface IssueComment {
  344. author?: string;
  345. authorActive?: boolean;
  346. authorAvatar?: string;
  347. authorLogin?: string;
  348. authorName?: string;
  349. createdAt: string;
  350. htmlText: string;
  351. key: string;
  352. markdown: string;
  353. updatable: boolean;
  354. }
  355. export type IssueType = 'BUG' | 'VULNERABILITY' | 'CODE_SMELL' | 'SECURITY_HOTSPOT';
  356. export interface Language {
  357. key: string;
  358. name: string;
  359. }
  360. export type Languages = T.Dict<Language>;
  361. export interface LightComponent {
  362. key: string;
  363. organization: string;
  364. qualifier: string;
  365. }
  366. export interface LinearIssueLocation {
  367. from: number;
  368. index?: number;
  369. line: number;
  370. startLine?: number;
  371. to: number;
  372. }
  373. export interface LoggedInUser extends CurrentUser {
  374. avatar?: string;
  375. email?: string;
  376. externalIdentity?: string;
  377. externalProvider?: string;
  378. groups: string[];
  379. homepage?: HomePage;
  380. isLoggedIn: true;
  381. local?: boolean;
  382. login: string;
  383. name: string;
  384. personalOrganization?: string;
  385. scmAccounts: string[];
  386. settings?: CurrentUserSetting[];
  387. }
  388. export interface LongLivingBranch extends Branch {
  389. isMain: false;
  390. type: 'LONG';
  391. }
  392. export interface MainBranch extends Branch {
  393. isMain: true;
  394. }
  395. export interface Measure extends MeasureIntern {
  396. metric: string;
  397. }
  398. export interface MeasureEnhanced extends MeasureIntern {
  399. metric: Metric;
  400. leak?: string;
  401. }
  402. interface MeasureIntern {
  403. bestValue?: boolean;
  404. periods?: PeriodMeasure[];
  405. value?: string;
  406. }
  407. export interface Metric {
  408. bestValue?: string;
  409. custom?: boolean;
  410. decimalScale?: number;
  411. description?: string;
  412. direction?: number;
  413. domain?: string;
  414. hidden?: boolean;
  415. higherValuesAreBetter?: boolean;
  416. id: string;
  417. key: string;
  418. name: string;
  419. qualitative?: boolean;
  420. type: string;
  421. worstValue?: string;
  422. }
  423. export interface MyProject {
  424. description?: string;
  425. key: string;
  426. lastAnalysisDate?: string;
  427. links: Array<{
  428. name: string;
  429. type: string;
  430. href: string;
  431. }>;
  432. name: string;
  433. qualityGate?: string;
  434. }
  435. export interface Notification {
  436. channel: string;
  437. organization?: string;
  438. project?: string;
  439. projectName?: string;
  440. type: string;
  441. }
  442. export interface OrganizationActions {
  443. admin?: boolean;
  444. delete?: boolean;
  445. provision?: boolean;
  446. executeAnalysis?: boolean;
  447. }
  448. export interface Organization extends OrganizationBase {
  449. actions?: OrganizationActions;
  450. alm?: { key: string; membersSync: boolean; url: string };
  451. adminPages?: Extension[];
  452. canUpdateProjectsVisibilityToPrivate?: boolean;
  453. guarded?: boolean;
  454. isDefault?: boolean;
  455. key: string;
  456. pages?: Extension[];
  457. projectVisibility?: Visibility;
  458. subscription?: OrganizationSubscription;
  459. }
  460. export interface OrganizationBase {
  461. avatar?: string;
  462. description?: string;
  463. key?: string;
  464. name: string;
  465. url?: string;
  466. }
  467. export interface OrganizationMember {
  468. login: string;
  469. name: string;
  470. avatar?: string;
  471. groupCount?: number;
  472. }
  473. export type OrganizationSubscription = 'FREE' | 'PAID' | 'SONARQUBE';
  474. export interface Paging {
  475. pageIndex: number;
  476. pageSize: number;
  477. total: number;
  478. }
  479. export interface Period {
  480. date: string;
  481. index: number;
  482. mode: PeriodMode;
  483. modeParam?: string;
  484. parameter?: string;
  485. }
  486. export interface PeriodMeasure {
  487. bestValue?: boolean;
  488. index: number;
  489. value: string;
  490. }
  491. export type PeriodMode =
  492. | 'days'
  493. | 'date'
  494. | 'version'
  495. | 'previous_analysis'
  496. | 'previous_version'
  497. | 'manual_baseline';
  498. export interface Permission {
  499. description: string;
  500. key: string;
  501. name: string;
  502. }
  503. export interface PermissionDefinition {
  504. key: string;
  505. name: string;
  506. description: string;
  507. }
  508. export type PermissionDefinitions = Array<PermissionDefinition | PermissionDefinitionGroup>;
  509. export interface PermissionDefinitionGroup {
  510. category: string;
  511. permissions: PermissionDefinition[];
  512. }
  513. export interface PermissionGroup {
  514. description?: string;
  515. id?: string;
  516. name: string;
  517. permissions: string[];
  518. }
  519. export interface PermissionUser {
  520. avatar?: string;
  521. email?: string;
  522. login: string;
  523. name: string;
  524. permissions: string[];
  525. }
  526. export interface PermissionTemplate {
  527. defaultFor: string[];
  528. id: string;
  529. name: string;
  530. description?: string;
  531. projectKeyPattern?: string;
  532. createdAt: string;
  533. updatedAt?: string;
  534. permissions: Array<{
  535. key: string;
  536. usersCount: number;
  537. groupsCount: number;
  538. withProjectCreator?: boolean;
  539. }>;
  540. }
  541. export interface ProjectLink {
  542. id: string;
  543. name?: string;
  544. type: string;
  545. url: string;
  546. }
  547. export interface PullRequest {
  548. analysisDate?: string;
  549. base: string;
  550. branch: string;
  551. key: string;
  552. isOrphan?: true;
  553. status?: { qualityGateStatus: Status };
  554. title: string;
  555. url?: string;
  556. }
  557. export interface QualityGate {
  558. actions?: {
  559. associateProjects?: boolean;
  560. copy?: boolean;
  561. delete?: boolean;
  562. manageConditions?: boolean;
  563. rename?: boolean;
  564. setAsDefault?: boolean;
  565. };
  566. conditions?: Condition[];
  567. id: number;
  568. isBuiltIn?: boolean;
  569. isDefault?: boolean;
  570. name: string;
  571. }
  572. export interface QualityGateProjectStatusCondition {
  573. status: Status;
  574. metricKey: string;
  575. comparator: string;
  576. periodIndex: number;
  577. errorThreshold: string;
  578. actualValue: string;
  579. }
  580. export interface QualityGateProjectStatus {
  581. conditions?: QualityGateProjectStatusCondition[];
  582. ignoredConditions: boolean;
  583. status: Status;
  584. }
  585. export interface QualityGateStatusCondition {
  586. actual?: string;
  587. error?: string;
  588. level: string;
  589. metric: string;
  590. op: string;
  591. period?: number;
  592. warning?: string;
  593. }
  594. export interface QualityGateStatusConditionEnhanced extends QualityGateStatusCondition {
  595. measure: T.MeasureEnhanced;
  596. }
  597. export interface Rule {
  598. isTemplate?: boolean;
  599. key: string;
  600. lang?: string;
  601. langName?: string;
  602. name: string;
  603. params?: RuleParameter[];
  604. severity: string;
  605. status: string;
  606. sysTags?: string[];
  607. tags?: string[];
  608. type: RuleType;
  609. }
  610. export interface RuleActivation {
  611. createdAt: string;
  612. inherit: RuleInheritance;
  613. params: { key: string; value: string }[];
  614. qProfile: string;
  615. severity: string;
  616. }
  617. export interface RuleDetails extends Rule {
  618. createdAt: string;
  619. debtOverloaded?: boolean;
  620. debtRemFnCoeff?: string;
  621. debtRemFnOffset?: string;
  622. debtRemFnType?: string;
  623. defaultDebtRemFnOffset?: string;
  624. defaultDebtRemFnType?: string;
  625. defaultRemFnBaseEffort?: string;
  626. defaultRemFnType?: string;
  627. effortToFixDescription?: string;
  628. htmlDesc?: string;
  629. htmlNote?: string;
  630. internalKey?: string;
  631. isExternal?: boolean;
  632. mdDesc?: string;
  633. mdNote?: string;
  634. remFnBaseEffort?: string;
  635. remFnOverloaded?: boolean;
  636. remFnType?: string;
  637. repo: string;
  638. scope?: RuleScope;
  639. templateKey?: string;
  640. }
  641. export type RuleInheritance = 'NONE' | 'INHERITED' | 'OVERRIDES';
  642. export interface RuleParameter {
  643. defaultValue?: string;
  644. htmlDesc?: string;
  645. key: string;
  646. type: string;
  647. }
  648. export type RuleScope = 'MAIN' | 'TEST' | 'ALL';
  649. export type RuleType = 'BUG' | 'VULNERABILITY' | 'CODE_SMELL' | 'SECURITY_HOTSPOT' | 'UNKNOWN';
  650. export type Status = 'ERROR' | 'OK';
  651. export type Setting = SettingValue & { definition: SettingDefinition };
  652. export type SettingType =
  653. | 'STRING'
  654. | 'TEXT'
  655. | 'PASSWORD'
  656. | 'BOOLEAN'
  657. | 'FLOAT'
  658. | 'INTEGER'
  659. | 'LICENSE'
  660. | 'LONG'
  661. | 'SINGLE_SELECT_LIST'
  662. | 'PROPERTY_SET';
  663. export interface SettingDefinition {
  664. description?: string;
  665. key: string;
  666. name?: string;
  667. options: string[];
  668. type?: SettingType;
  669. }
  670. export interface SettingFieldDefinition extends SettingDefinition {
  671. description: string;
  672. name: string;
  673. }
  674. export interface SettingCategoryDefinition extends SettingDefinition {
  675. category: string;
  676. defaultValue?: string;
  677. deprecatedKey?: string;
  678. fields: SettingFieldDefinition[];
  679. multiValues?: boolean;
  680. subCategory: string;
  681. }
  682. export interface SettingValue {
  683. fieldValues?: Array<T.Dict<string>>;
  684. inherited?: boolean;
  685. key: string;
  686. parentFieldValues?: Array<T.Dict<string>>;
  687. parentValue?: string;
  688. parentValues?: string[];
  689. value?: string;
  690. values?: string[];
  691. }
  692. export interface ShortLivingBranch extends Branch {
  693. isMain: false;
  694. isOrphan?: true;
  695. mergeBranch: string;
  696. type: 'SHORT';
  697. }
  698. export interface SourceLine {
  699. code?: string;
  700. conditions?: number;
  701. coverageStatus?: SourceLineCoverageStatus;
  702. coveredConditions?: number;
  703. duplicated?: boolean;
  704. isNew?: boolean;
  705. line: number;
  706. lineHits?: number;
  707. scmAuthor?: string;
  708. scmDate?: string;
  709. scmRevision?: string;
  710. }
  711. export type SourceLineCoverageStatus = 'uncovered' | 'partially-covered' | 'covered';
  712. export interface SourceViewerFile {
  713. canMarkAsFavorite?: boolean;
  714. fav?: boolean;
  715. key: string;
  716. leakPeriodDate?: string;
  717. measures: {
  718. coverage?: string;
  719. duplicationDensity?: string;
  720. issues?: string;
  721. lines?: string;
  722. tests?: string;
  723. };
  724. path: string;
  725. project: string;
  726. projectName: string;
  727. q: string;
  728. subProject?: string;
  729. subProjectName?: string;
  730. uuid: string;
  731. }
  732. export interface SubscriptionPlan {
  733. maxNcloc: number;
  734. price: number;
  735. }
  736. export interface SuggestionLink {
  737. link: string;
  738. scope?: 'sonarcloud';
  739. text: string;
  740. }
  741. export interface Task {
  742. analysisId?: string;
  743. branch?: string;
  744. branchType?: string;
  745. componentKey?: string;
  746. componentName?: string;
  747. componentQualifier?: string;
  748. errorMessage?: string;
  749. errorStacktrace?: string;
  750. errorType?: string;
  751. executedAt?: string;
  752. executionTimeMs?: number;
  753. hasErrorStacktrace?: boolean;
  754. hasScannerContext?: boolean;
  755. id: string;
  756. logs?: boolean;
  757. organization: string;
  758. pullRequest?: string;
  759. pullRequestTitle?: string;
  760. scannerContext?: string;
  761. startedAt?: string;
  762. status: string;
  763. submittedAt: string;
  764. submitterLogin?: string;
  765. type: string;
  766. warningCount?: number;
  767. warnings?: string[];
  768. }
  769. export interface TestCase {
  770. coveredLines: number;
  771. durationInMs: number;
  772. fileId: string;
  773. fileKey: string;
  774. fileName: string;
  775. id: string;
  776. message?: string;
  777. name: string;
  778. stacktrace?: string;
  779. status: string;
  780. }
  781. export interface TextRange {
  782. startLine: number;
  783. startOffset: number;
  784. endLine: number;
  785. endOffset: number;
  786. }
  787. export interface User {
  788. active: boolean;
  789. avatar?: string;
  790. email?: string;
  791. externalIdentity?: string;
  792. externalProvider?: string;
  793. groups?: string[];
  794. lastConnectionDate?: string;
  795. local: boolean;
  796. login: string;
  797. name: string;
  798. scmAccounts?: string[];
  799. tokensCount?: number;
  800. }
  801. export interface UserToken {
  802. name: string;
  803. createdAt: string;
  804. lastConnectionDate?: string;
  805. }
  806. export interface NewUserToken extends UserToken {
  807. login: string;
  808. token: string;
  809. }
  810. export type Visibility = 'public' | 'private';
  811. export interface Webhook {
  812. key: string;
  813. latestDelivery?: WebhookDelivery;
  814. name: string;
  815. url: string;
  816. }
  817. export interface WebhookDelivery {
  818. at: string;
  819. durationMs: number;
  820. httpStatus?: number;
  821. id: string;
  822. success: boolean;
  823. }
  824. export namespace WebApi {
  825. export interface Action {
  826. key: string;
  827. changelog: Changelog[];
  828. description: string;
  829. deprecatedSince?: string;
  830. hasResponseExample: boolean;
  831. internal: boolean;
  832. params?: Param[];
  833. post: boolean;
  834. since?: string;
  835. }
  836. export interface Changelog {
  837. description: string;
  838. version: string;
  839. }
  840. export interface Domain {
  841. actions: Action[];
  842. deprecatedSince?: string;
  843. description: string;
  844. internal?: boolean;
  845. path: string;
  846. since?: string;
  847. }
  848. export interface Example {
  849. example: string;
  850. format: string;
  851. }
  852. export interface Param {
  853. defaultValue?: string;
  854. deprecatedKey?: string;
  855. deprecatedKeySince?: string;
  856. deprecatedSince?: string;
  857. description: string;
  858. exampleValue?: string;
  859. internal: boolean;
  860. key: string;
  861. maximumLength?: number;
  862. maximumValue?: number;
  863. maxValuesAllowed?: number;
  864. minimumLength?: number;
  865. minimumValue?: number;
  866. possibleValues?: string[];
  867. required: boolean;
  868. since?: string;
  869. }
  870. }
  871. }