Move all GrRestApiInterface to RestApiService & Element
Change-Id: I999abe8488abc2d25f12238d2c49ea4f6d64208a
This commit is contained in:
@@ -28,7 +28,7 @@ import {htmlTemplate} from './gr-create-repo-dialog_html';
|
|||||||
import {encodeURL, getBaseUrl} from '../../../utils/url-util';
|
import {encodeURL, getBaseUrl} from '../../../utils/url-util';
|
||||||
import {page} from '../../../utils/page-wrapper-utils';
|
import {page} from '../../../utils/page-wrapper-utils';
|
||||||
import {customElement, observe, property} from '@polymer/decorators';
|
import {customElement, observe, property} from '@polymer/decorators';
|
||||||
import {GrRestApiInterface} from '../../shared/gr-rest-api-interface/gr-rest-api-interface';
|
import {RestApiService} from '../../../services/services/gr-rest-api/gr-rest-api';
|
||||||
import {ProjectInput, RepoName} from '../../../types/common';
|
import {ProjectInput, RepoName} from '../../../types/common';
|
||||||
import {hasOwnProperty} from '../../../utils/common-util';
|
import {hasOwnProperty} from '../../../utils/common-util';
|
||||||
import {AutocompleteQuery} from '../../shared/gr-autocomplete/gr-autocomplete';
|
import {AutocompleteQuery} from '../../shared/gr-autocomplete/gr-autocomplete';
|
||||||
@@ -41,7 +41,7 @@ declare global {
|
|||||||
|
|
||||||
export interface GrCreateRepoDialog {
|
export interface GrCreateRepoDialog {
|
||||||
$: {
|
$: {
|
||||||
restAPI: GrRestApiInterface;
|
restAPI: RestApiService & Element;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -29,7 +29,7 @@ import {ListViewMixin} from '../../../mixins/gr-list-view-mixin/gr-list-view-mix
|
|||||||
import {GerritNav} from '../../core/gr-navigation/gr-navigation';
|
import {GerritNav} from '../../core/gr-navigation/gr-navigation';
|
||||||
import {customElement, property, observe, computed} from '@polymer/decorators';
|
import {customElement, property, observe, computed} from '@polymer/decorators';
|
||||||
import {AppElementAdminParams} from '../../gr-app-types';
|
import {AppElementAdminParams} from '../../gr-app-types';
|
||||||
import {GrRestApiInterface} from '../../shared/gr-rest-api-interface/gr-rest-api-interface';
|
import {RestApiService} from '../../../services/services/gr-rest-api/gr-rest-api';
|
||||||
import {GrOverlay} from '../../shared/gr-overlay/gr-overlay';
|
import {GrOverlay} from '../../shared/gr-overlay/gr-overlay';
|
||||||
import {RepoName, ProjectInfoWithName} from '../../../types/common';
|
import {RepoName, ProjectInfoWithName} from '../../../types/common';
|
||||||
import {GrCreateRepoDialog} from '../gr-create-repo-dialog/gr-create-repo-dialog';
|
import {GrCreateRepoDialog} from '../gr-create-repo-dialog/gr-create-repo-dialog';
|
||||||
@@ -43,7 +43,7 @@ declare global {
|
|||||||
|
|
||||||
export interface GrRepoList {
|
export interface GrRepoList {
|
||||||
$: {
|
$: {
|
||||||
restAPI: GrRestApiInterface;
|
restAPI: RestApiService & Element;
|
||||||
createOverlay: GrOverlay;
|
createOverlay: GrOverlay;
|
||||||
createNewModal: GrCreateRepoDialog;
|
createNewModal: GrCreateRepoDialog;
|
||||||
};
|
};
|
||||||
|
@@ -23,8 +23,8 @@ import {LegacyElementMixin} from '@polymer/polymer/lib/legacy/legacy-element-mix
|
|||||||
import {PolymerElement} from '@polymer/polymer/polymer-element';
|
import {PolymerElement} from '@polymer/polymer/polymer-element';
|
||||||
import {htmlTemplate} from './gr-download-commands_html';
|
import {htmlTemplate} from './gr-download-commands_html';
|
||||||
import {customElement, property, observe} from '@polymer/decorators';
|
import {customElement, property, observe} from '@polymer/decorators';
|
||||||
import {GrRestApiInterface} from '../gr-rest-api-interface/gr-rest-api-interface';
|
|
||||||
import {PaperTabsElement} from '@polymer/paper-tabs/paper-tabs';
|
import {PaperTabsElement} from '@polymer/paper-tabs/paper-tabs';
|
||||||
|
import {RestApiService} from '../../../services/services/gr-rest-api/gr-rest-api';
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
interface HTMLElementTagNameMap {
|
interface HTMLElementTagNameMap {
|
||||||
@@ -35,7 +35,7 @@ declare global {
|
|||||||
export interface GrDownloadCommands {
|
export interface GrDownloadCommands {
|
||||||
$: {
|
$: {
|
||||||
downloadTabs: PaperTabsElement;
|
downloadTabs: PaperTabsElement;
|
||||||
restAPI: GrRestApiInterface;
|
restAPI: RestApiService & Element;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -33,7 +33,7 @@ import {
|
|||||||
BranchInfo,
|
BranchInfo,
|
||||||
} from '../../../types/common';
|
} from '../../../types/common';
|
||||||
import {GrLabeledAutocomplete} from '../gr-labeled-autocomplete/gr-labeled-autocomplete';
|
import {GrLabeledAutocomplete} from '../gr-labeled-autocomplete/gr-labeled-autocomplete';
|
||||||
import {GrRestApiInterface} from '../gr-rest-api-interface/gr-rest-api-interface';
|
import {RestApiService} from '../../../services/services/gr-rest-api/gr-rest-api';
|
||||||
|
|
||||||
const SUGGESTIONS_LIMIT = 15;
|
const SUGGESTIONS_LIMIT = 15;
|
||||||
const REF_PREFIX = 'refs/heads/';
|
const REF_PREFIX = 'refs/heads/';
|
||||||
@@ -42,7 +42,7 @@ export interface GrRepoBranchPicker {
|
|||||||
$: {
|
$: {
|
||||||
repoInput: GrLabeledAutocomplete;
|
repoInput: GrLabeledAutocomplete;
|
||||||
branchInput: GrLabeledAutocomplete;
|
branchInput: GrLabeledAutocomplete;
|
||||||
restAPI: GrRestApiInterface;
|
restAPI: RestApiService & Element;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@customElement('gr-repo-branch-picker')
|
@customElement('gr-repo-branch-picker')
|
||||||
|
@@ -72,6 +72,7 @@ import {
|
|||||||
Password,
|
Password,
|
||||||
ProjectWatchInfo,
|
ProjectWatchInfo,
|
||||||
NameToProjectInfoMap,
|
NameToProjectInfoMap,
|
||||||
|
ProjectInput,
|
||||||
} from '../../../types/common';
|
} from '../../../types/common';
|
||||||
import {ParsedChangeInfo} from '../../../elements/shared/gr-rest-api-interface/gr-reviewer-updates-parser';
|
import {ParsedChangeInfo} from '../../../elements/shared/gr-rest-api-interface/gr-reviewer-updates-parser';
|
||||||
import {HttpMethod} from '../../../constants/constants';
|
import {HttpMethod} from '../../../constants/constants';
|
||||||
@@ -330,6 +331,13 @@ export interface RestApiService {
|
|||||||
errFn?: ErrorCallback
|
errFn?: ErrorCallback
|
||||||
): Promise<ProjectAccessInfo | undefined>;
|
): Promise<ProjectAccessInfo | undefined>;
|
||||||
|
|
||||||
|
createRepo(config: ProjectInput & {name: RepoName}): Promise<Response>;
|
||||||
|
createRepo(
|
||||||
|
config: ProjectInput & {name: RepoName},
|
||||||
|
errFn: ErrorCallback
|
||||||
|
): Promise<Response | undefined>;
|
||||||
|
createRepo(config: ProjectInput, errFn?: ErrorCallback): Promise<Response>;
|
||||||
|
|
||||||
getRepo(
|
getRepo(
|
||||||
repo: RepoName,
|
repo: RepoName,
|
||||||
errFn?: ErrorCallback
|
errFn?: ErrorCallback
|
||||||
|
Reference in New Issue
Block a user