Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

types.d.ts 20KB

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