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 21KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963
  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. declare namespace T {
  21. // Type ordered alphabetically to prevent merge conflicts
  22. export type Dict<T> = { [key: string]: T };
  23. export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
  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 AlmRepository {
  33. label: string;
  34. installationKey: string;
  35. linkedProjectKey?: string;
  36. linkedProjectName?: string;
  37. private?: boolean;
  38. }
  39. export interface AlmUnboundApplication {
  40. installationId: string;
  41. key: string;
  42. name: string;
  43. }
  44. interface BaseAnalysis {
  45. buildString?: string;
  46. detectedCI?: string;
  47. events: AnalysisEvent[];
  48. key: string;
  49. manualNewCodePeriodBaseline?: boolean;
  50. projectVersion?: string;
  51. }
  52. export interface Analysis extends BaseAnalysis {
  53. date: string;
  54. }
  55. export interface ParsedAnalysis extends BaseAnalysis {
  56. date: Date;
  57. }
  58. export interface AnalysisEvent {
  59. category: string;
  60. description?: string;
  61. key: string;
  62. name: string;
  63. qualityGate?: {
  64. failing: Array<{ branch: string; key: string; name: string }>;
  65. status: string;
  66. stillFailing: boolean;
  67. };
  68. definitionChange?: {
  69. projects: Array<{
  70. branch?: string;
  71. changeType: string;
  72. key: string;
  73. name: string;
  74. newBranch?: string;
  75. oldBranch?: string;
  76. }>;
  77. };
  78. }
  79. export interface AppState {
  80. adminPages?: Extension[];
  81. authenticationError?: boolean;
  82. authorizationError?: boolean;
  83. branchesEnabled?: boolean;
  84. canAdmin?: boolean;
  85. edition: 'community' | 'developer' | 'enterprise' | 'datacenter' | undefined;
  86. globalPages?: Extension[];
  87. instanceUsesDefaultAdminCredentials?: boolean;
  88. multipleAlmEnabled?: boolean;
  89. needIssueSync?: boolean;
  90. productionDatabase: boolean;
  91. qualifiers: string[];
  92. settings: T.Dict<string>;
  93. standalone?: boolean;
  94. version: string;
  95. webAnalyticsJsPath?: string;
  96. }
  97. export interface Breadcrumb {
  98. key: string;
  99. name: string;
  100. qualifier: string;
  101. }
  102. export namespace Chart {
  103. export interface Point {
  104. x: Date;
  105. y: number | string | undefined;
  106. }
  107. export interface Serie {
  108. data: Point[];
  109. name: string;
  110. translatedName: string;
  111. type: string;
  112. }
  113. }
  114. export interface Component extends LightComponent {
  115. alm?: { key: string; url: string };
  116. analysisDate?: string;
  117. breadcrumbs: Breadcrumb[];
  118. configuration?: ComponentConfiguration;
  119. description?: string;
  120. extensions?: Extension[];
  121. isFavorite?: boolean;
  122. leakPeriodDate?: string;
  123. name: string;
  124. needIssueSync?: boolean;
  125. path?: string;
  126. refKey?: string;
  127. qualityProfiles?: ComponentQualityProfile[];
  128. qualityGate?: { isDefault?: boolean; key: string; name: string };
  129. tags?: string[];
  130. version?: string;
  131. visibility?: Visibility;
  132. }
  133. interface ComponentConfiguration {
  134. canApplyPermissionTemplate?: boolean;
  135. canBrowseProject?: boolean;
  136. canUpdateProjectVisibilityToPrivate?: boolean;
  137. extensions?: Extension[];
  138. showBackgroundTasks?: boolean;
  139. showHistory?: boolean;
  140. showLinks?: boolean;
  141. showQualityGates?: boolean;
  142. showQualityProfiles?: boolean;
  143. showPermissions?: boolean;
  144. showSettings?: boolean;
  145. showUpdateKey?: boolean;
  146. }
  147. export interface ComponentQualityProfile {
  148. deleted?: boolean;
  149. key: string;
  150. language: string;
  151. name: string;
  152. }
  153. interface ComponentMeasureIntern {
  154. branch?: string;
  155. description?: string;
  156. isFavorite?: boolean;
  157. isRecentlyBrowsed?: boolean;
  158. key: string;
  159. match?: string;
  160. name: string;
  161. path?: string;
  162. project?: string;
  163. qualifier: string;
  164. refKey?: string;
  165. }
  166. export interface ComponentMeasure extends ComponentMeasureIntern {
  167. measures?: Measure[];
  168. }
  169. export interface ComponentMeasureEnhanced extends ComponentMeasureIntern {
  170. value?: string;
  171. leak?: string;
  172. measures: MeasureEnhanced[];
  173. }
  174. export interface Condition {
  175. error: string;
  176. id: number;
  177. metric: string;
  178. op?: string;
  179. }
  180. export interface CoveredFile {
  181. key: string;
  182. longName: string;
  183. coveredLines: number;
  184. }
  185. export interface Coupon {
  186. billing?: {
  187. address?: string;
  188. country?: string;
  189. email?: string;
  190. name?: string;
  191. use?: string;
  192. };
  193. maxNcloc: number;
  194. planActiveUntil: string;
  195. }
  196. export interface CurrentUser {
  197. isLoggedIn: boolean;
  198. permissions?: { global: string[] };
  199. }
  200. export interface CurrentUserSetting {
  201. key: CurrentUserSettingNames;
  202. value: string;
  203. }
  204. type CurrentUserSettingNames =
  205. | 'notifications.optOut'
  206. | 'notifications.readDate'
  207. | 'tutorials.jenkins.skipBitbucketPreReqs';
  208. export interface CustomMeasure {
  209. createdAt?: string;
  210. description?: string;
  211. id: string;
  212. metric: {
  213. key: string;
  214. name: string;
  215. domain?: string;
  216. type: string;
  217. };
  218. projectKey: string;
  219. pending?: boolean;
  220. user: T.UserBase;
  221. value: string;
  222. updatedAt?: string;
  223. }
  224. export interface Duplication {
  225. blocks: DuplicationBlock[];
  226. }
  227. export interface DuplicationBlock {
  228. _ref?: string;
  229. from: number;
  230. size: number;
  231. }
  232. export interface DuplicatedFile {
  233. key: string;
  234. name: string;
  235. project: string;
  236. projectName: string;
  237. subProject?: string;
  238. subProjectName?: string;
  239. }
  240. export type ExpandDirection = 'up' | 'down';
  241. export interface Extension {
  242. key: string;
  243. name: string;
  244. }
  245. export interface FacetValue<T = string> {
  246. count: number;
  247. val: T;
  248. }
  249. export interface FlowLocation {
  250. component: string;
  251. componentName?: string;
  252. index?: number;
  253. msg?: string;
  254. textRange: TextRange;
  255. }
  256. export interface Group {
  257. default?: boolean;
  258. description?: string;
  259. id: number;
  260. membersCount: number;
  261. name: string;
  262. }
  263. export type HealthType = 'RED' | 'YELLOW' | 'GREEN';
  264. export type HomePage =
  265. | { type: 'APPLICATION'; branch: string | undefined; component: string }
  266. | { type: 'ISSUES' }
  267. | { type: 'MY_ISSUES' }
  268. | { type: 'MY_PROJECTS' }
  269. | { type: 'PORTFOLIO'; component: string }
  270. | { type: 'PORTFOLIOS' }
  271. | { type: 'PROJECT'; branch: string | undefined; component: string }
  272. | { type: 'PROJECTS' };
  273. export type HomePageType =
  274. | 'APPLICATION'
  275. | 'ISSUES'
  276. | 'MY_ISSUES'
  277. | 'MY_PROJECTS'
  278. | 'PORTFOLIO'
  279. | 'PORTFOLIOS'
  280. | 'PROJECT'
  281. | 'PROJECTS';
  282. export interface IdentityProvider {
  283. backgroundColor: string;
  284. helpMessage?: string;
  285. iconPath: string;
  286. key: string;
  287. name: string;
  288. }
  289. export interface Issue {
  290. actions: string[];
  291. assignee?: string;
  292. assigneeActive?: boolean;
  293. assigneeAvatar?: string;
  294. assigneeLogin?: string;
  295. assigneeName?: string;
  296. author?: string;
  297. branch?: string;
  298. comments?: IssueComment[];
  299. component: string;
  300. componentLongName: string;
  301. componentQualifier: string;
  302. componentUuid: string;
  303. creationDate: string;
  304. effort?: string;
  305. externalRuleEngine?: string;
  306. fromExternalRule?: boolean;
  307. key: string;
  308. flows: FlowLocation[][];
  309. fromHotspot: boolean;
  310. line?: number;
  311. message: string;
  312. project: string;
  313. projectName: string;
  314. projectKey: string;
  315. pullRequest?: string;
  316. resolution?: string;
  317. rule: string;
  318. ruleName: string;
  319. ruleStatus?: string;
  320. secondaryLocations: FlowLocation[];
  321. severity: string;
  322. status: string;
  323. subProject?: string;
  324. subProjectName?: string;
  325. tags?: string[];
  326. textRange?: TextRange;
  327. transitions: string[];
  328. type: T.IssueType;
  329. }
  330. export interface IssueChangelog {
  331. avatar?: string;
  332. creationDate: string;
  333. diffs: IssueChangelogDiff[];
  334. user: string;
  335. isUserActive: boolean;
  336. userName: string;
  337. }
  338. export interface IssueChangelogDiff {
  339. key: string;
  340. newValue?: string;
  341. oldValue?: string;
  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 interface IssuesByLine {
  356. [key: number]: Issue[];
  357. }
  358. export type IssueType = 'BUG' | 'VULNERABILITY' | 'CODE_SMELL' | 'SECURITY_HOTSPOT';
  359. export interface Language {
  360. key: string;
  361. name: string;
  362. }
  363. export type Languages = T.Dict<Language>;
  364. export interface LightComponent {
  365. key: string;
  366. qualifier: string;
  367. }
  368. export interface LinearIssueLocation {
  369. from: number;
  370. index?: number;
  371. line: number;
  372. startLine?: number;
  373. text?: string;
  374. to: number;
  375. }
  376. export interface LineMap {
  377. [line: number]: SourceLine;
  378. }
  379. export interface LinePopup {
  380. index?: number;
  381. line: number;
  382. name: string;
  383. open?: boolean;
  384. }
  385. export interface LoggedInUser extends CurrentUser, UserActive {
  386. externalIdentity?: string;
  387. externalProvider?: string;
  388. groups: string[];
  389. homepage?: HomePage;
  390. isLoggedIn: true;
  391. local?: boolean;
  392. scmAccounts: string[];
  393. settings?: CurrentUserSetting[];
  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. period?: 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 NewCodePeriod {
  436. type?: NewCodePeriodSettingType;
  437. value?: string;
  438. effectiveValue?: string;
  439. inherited?: boolean;
  440. }
  441. export interface NewCodePeriodBranch {
  442. projectKey: string;
  443. branchKey: string;
  444. inherited?: boolean;
  445. type?: NewCodePeriodSettingType;
  446. value?: string;
  447. effectiveValue?: string;
  448. }
  449. export type NewCodePeriodSettingType =
  450. | 'PREVIOUS_VERSION'
  451. | 'NUMBER_OF_DAYS'
  452. | 'SPECIFIC_ANALYSIS'
  453. | 'REFERENCE_BRANCH';
  454. export interface Notification {
  455. channel: string;
  456. project?: string;
  457. projectName?: string;
  458. type: string;
  459. }
  460. export interface NotificationProject {
  461. project: string;
  462. projectName: string;
  463. }
  464. export interface Paging {
  465. pageIndex: number;
  466. pageSize: number;
  467. total: number;
  468. }
  469. export interface Period {
  470. date: string;
  471. index?: number;
  472. mode: PeriodMode | NewCodePeriodSettingType;
  473. modeParam?: string;
  474. parameter?: string;
  475. }
  476. export interface PeriodMeasure {
  477. bestValue?: boolean;
  478. index: number;
  479. value: string;
  480. }
  481. /*
  482. * These are old baseline setting types, necessary for
  483. * backward compatibility.
  484. */
  485. export type PeriodMode =
  486. | 'days'
  487. | 'date'
  488. | 'version'
  489. | 'previous_analysis'
  490. | 'previous_version'
  491. | 'manual_baseline';
  492. export interface Permission {
  493. description: string;
  494. key: string;
  495. name: string;
  496. }
  497. export interface PermissionDefinition {
  498. key: string;
  499. name: string;
  500. description: string;
  501. }
  502. export type PermissionDefinitions = Array<PermissionDefinition | PermissionDefinitionGroup>;
  503. export interface PermissionDefinitionGroup {
  504. category: string;
  505. permissions: PermissionDefinition[];
  506. }
  507. export interface PermissionGroup {
  508. description?: string;
  509. id?: string;
  510. name: string;
  511. permissions: string[];
  512. }
  513. export interface PermissionUser extends UserActive {
  514. permissions: string[];
  515. }
  516. export interface PermissionTemplate {
  517. defaultFor: string[];
  518. id: string;
  519. name: string;
  520. description?: string;
  521. projectKeyPattern?: string;
  522. createdAt: string;
  523. updatedAt?: string;
  524. permissions: Array<{
  525. key: string;
  526. usersCount: number;
  527. groupsCount: number;
  528. withProjectCreator?: boolean;
  529. }>;
  530. }
  531. export interface ProfileInheritanceDetails {
  532. activeRuleCount: number;
  533. isBuiltIn: boolean;
  534. key: string;
  535. name: string;
  536. overridingRuleCount?: number;
  537. }
  538. export interface ProjectLink {
  539. id: string;
  540. name?: string;
  541. type: string;
  542. url: string;
  543. }
  544. export interface QualityGate {
  545. actions?: {
  546. associateProjects?: boolean;
  547. copy?: boolean;
  548. delete?: boolean;
  549. manageConditions?: boolean;
  550. rename?: boolean;
  551. setAsDefault?: boolean;
  552. };
  553. conditions?: Condition[];
  554. id: string;
  555. isBuiltIn?: boolean;
  556. isDefault?: boolean;
  557. name: string;
  558. }
  559. export type RawQuery = T.Dict<any>;
  560. export interface Rule {
  561. isTemplate?: boolean;
  562. key: string;
  563. lang?: string;
  564. langName?: string;
  565. name: string;
  566. params?: RuleParameter[];
  567. severity: string;
  568. status: string;
  569. sysTags?: string[];
  570. tags?: string[];
  571. type: RuleType;
  572. }
  573. export interface RuleActivation {
  574. createdAt: string;
  575. inherit: RuleInheritance;
  576. params: { key: string; value: string }[];
  577. qProfile: string;
  578. severity: string;
  579. }
  580. export interface RuleDetails extends Rule {
  581. createdAt: string;
  582. debtOverloaded?: boolean;
  583. debtRemFnCoeff?: string;
  584. debtRemFnOffset?: string;
  585. debtRemFnType?: string;
  586. defaultDebtRemFnOffset?: string;
  587. defaultDebtRemFnType?: string;
  588. defaultRemFnBaseEffort?: string;
  589. defaultRemFnType?: string;
  590. effortToFixDescription?: string;
  591. htmlDesc?: string;
  592. htmlNote?: string;
  593. internalKey?: string;
  594. isExternal?: boolean;
  595. mdDesc?: string;
  596. mdNote?: string;
  597. remFnBaseEffort?: string;
  598. remFnOverloaded?: boolean;
  599. remFnType?: string;
  600. repo: string;
  601. scope?: RuleScope;
  602. templateKey?: string;
  603. }
  604. export type RuleInheritance = 'NONE' | 'INHERITED' | 'OVERRIDES';
  605. export interface RuleParameter {
  606. defaultValue?: string;
  607. htmlDesc?: string;
  608. key: string;
  609. type: string;
  610. }
  611. export type RuleScope = 'MAIN' | 'TEST' | 'ALL';
  612. export type RuleType = 'BUG' | 'VULNERABILITY' | 'CODE_SMELL' | 'SECURITY_HOTSPOT' | 'UNKNOWN';
  613. export interface Snippet {
  614. start: number;
  615. end: number;
  616. index: number;
  617. toDelete?: boolean;
  618. }
  619. export interface SnippetGroup extends SnippetsByComponent {
  620. locations: T.FlowLocation[];
  621. }
  622. export interface SnippetsByComponent {
  623. component: SourceViewerFile;
  624. sources: { [line: number]: SourceLine };
  625. }
  626. export interface SourceLine {
  627. code?: string;
  628. conditions?: number;
  629. coverageStatus?: SourceLineCoverageStatus;
  630. coveredConditions?: number;
  631. duplicated?: boolean;
  632. isNew?: boolean;
  633. line: number;
  634. lineHits?: number;
  635. scmAuthor?: string;
  636. scmDate?: string;
  637. scmRevision?: string;
  638. }
  639. export type SourceLineCoverageStatus = 'uncovered' | 'partially-covered' | 'covered';
  640. export interface SourceViewerFile {
  641. fav?: boolean;
  642. key: string;
  643. leakPeriodDate?: string;
  644. measures: {
  645. coverage?: string;
  646. duplicationDensity?: string;
  647. issues?: string;
  648. lines?: string;
  649. tests?: string;
  650. };
  651. path: string;
  652. project: string;
  653. projectName: string;
  654. q: string;
  655. subProject?: string;
  656. subProjectName?: string;
  657. uuid: string;
  658. }
  659. export type StandardSecurityCategories = T.Dict<{ title: string; description?: string }>;
  660. export type Status = 'ERROR' | 'OK';
  661. export interface SubscriptionPlan {
  662. maxNcloc: number;
  663. price: number;
  664. }
  665. export interface SuggestionLink {
  666. link: string;
  667. scope?: 'sonarcloud';
  668. text: string;
  669. }
  670. export interface SysInfoAppNode extends SysInfoBase {
  671. 'Compute Engine Logging': SysInfoLogging;
  672. Name: string;
  673. 'Web Logging': SysInfoLogging;
  674. }
  675. export interface SysInfoBase extends SysInfoValueObject {
  676. Health: HealthType;
  677. 'Health Causes': string[];
  678. Plugins?: Dict<string>;
  679. System: {
  680. Version: string;
  681. };
  682. }
  683. export interface SysInfoCluster extends SysInfoBase {
  684. 'Application Nodes': SysInfoAppNode[];
  685. 'Search Nodes': SysInfoSearchNode[];
  686. Settings: Dict<string>;
  687. Statistics?: {
  688. ncloc: number;
  689. };
  690. System: {
  691. 'High Availability': true;
  692. 'Server ID': string;
  693. Version: string;
  694. };
  695. }
  696. export interface SysInfoLogging extends Dict<string> {
  697. 'Logs Level': string;
  698. }
  699. export interface SysInfoSearchNode extends SysInfoValueObject {
  700. Name: string;
  701. }
  702. export interface SysInfoSection extends Dict<SysInfoValueObject> {}
  703. export interface SysInfoStandalone extends SysInfoBase {
  704. 'Compute Engine Logging': SysInfoLogging;
  705. Settings: Dict<string>;
  706. Statistics?: {
  707. ncloc: number;
  708. } & Dict<string | number>;
  709. System: {
  710. 'High Availability': false;
  711. 'Server ID': string;
  712. Version: string;
  713. };
  714. 'Web Logging': SysInfoLogging;
  715. }
  716. export type SysInfoValue =
  717. | boolean
  718. | string
  719. | number
  720. | undefined
  721. | HealthType
  722. | SysInfoValueObject
  723. | SysInfoValueArray;
  724. export interface SysInfoValueArray extends Array<SysInfoValue> {}
  725. export interface SysInfoValueObject extends Dict<SysInfoValue> {}
  726. export type SysStatus =
  727. | 'STARTING'
  728. | 'UP'
  729. | 'DOWN'
  730. | 'RESTARTING'
  731. | 'DB_MIGRATION_NEEDED'
  732. | 'DB_MIGRATION_RUNNING';
  733. export interface TestCase {
  734. coveredLines: number;
  735. durationInMs: number;
  736. fileId: string;
  737. fileKey: string;
  738. fileName: string;
  739. id: string;
  740. message?: string;
  741. name: string;
  742. stacktrace?: string;
  743. status: string;
  744. }
  745. export interface TextRange {
  746. startLine: number;
  747. startOffset: number;
  748. endLine: number;
  749. endOffset: number;
  750. }
  751. export interface User extends UserBase {
  752. externalIdentity?: string;
  753. externalProvider?: string;
  754. groups?: string[];
  755. lastConnectionDate?: string;
  756. local: boolean;
  757. scmAccounts?: string[];
  758. tokensCount?: number;
  759. }
  760. export interface UserActive extends UserBase {
  761. active?: true;
  762. name: string;
  763. }
  764. export interface UserBase {
  765. active?: boolean;
  766. avatar?: string;
  767. email?: string;
  768. login: string;
  769. name?: string;
  770. }
  771. export interface UserSelected extends UserActive {
  772. selected: boolean;
  773. }
  774. export interface UserToken {
  775. name: string;
  776. createdAt: string;
  777. lastConnectionDate?: string;
  778. }
  779. export interface NewUserToken extends UserToken {
  780. login: string;
  781. token: string;
  782. }
  783. export type Visibility = 'public' | 'private';
  784. export interface Webhook {
  785. key: string;
  786. latestDelivery?: WebhookDelivery;
  787. name: string;
  788. secret?: string;
  789. url: string;
  790. }
  791. export interface WebhookDelivery {
  792. at: string;
  793. durationMs: number;
  794. httpStatus?: number;
  795. id: string;
  796. success: boolean;
  797. }
  798. export namespace WebApi {
  799. export interface Action {
  800. key: string;
  801. changelog: Changelog[];
  802. description: string;
  803. deprecatedSince?: string;
  804. hasResponseExample: boolean;
  805. internal: boolean;
  806. params?: Param[];
  807. post: boolean;
  808. since?: string;
  809. }
  810. export interface Changelog {
  811. description: string;
  812. version: string;
  813. }
  814. export interface Domain {
  815. actions: Action[];
  816. deprecatedSince?: string;
  817. description: string;
  818. internal?: boolean;
  819. path: string;
  820. since?: string;
  821. }
  822. export interface Example {
  823. example: string;
  824. format: string;
  825. }
  826. export interface Param {
  827. defaultValue?: string;
  828. deprecatedKey?: string;
  829. deprecatedKeySince?: string;
  830. deprecatedSince?: string;
  831. description: string;
  832. exampleValue?: string;
  833. internal: boolean;
  834. key: string;
  835. maximumLength?: number;
  836. maximumValue?: number;
  837. maxValuesAllowed?: number;
  838. minimumLength?: number;
  839. minimumValue?: number;
  840. possibleValues?: string[];
  841. required: boolean;
  842. since?: string;
  843. }
  844. }
  845. }