Rename GitReleaseApiClient to GitReleaseClient

Signed-off-by: Erik Engervall <erik.engervall@gmail.com>
This commit is contained in:
Erik Engervall
2021-05-05 17:44:25 +02:00
parent d5885b4c7b
commit b83db8947b
19 changed files with 24 additions and 24 deletions
@@ -16,21 +16,21 @@
import { ConfigReader, OAuthApi } from '@backstage/core';
import { GitReleaseApiClient } from './GitReleaseApiClient';
import { GitReleaseClient } from './GitReleaseClient';
describe('GitReleaseApiClient', () => {
describe('GitReleaseClient', () => {
it('should return the default plugin api client', () => {
const configApi = new ConfigReader({});
const githubAuthApi: OAuthApi = {
getAccessToken: jest.fn(),
};
const gitReleaseApiClient = new GitReleaseApiClient({
const gitReleaseClient = new GitReleaseClient({
configApi,
githubAuthApi,
});
expect(gitReleaseApiClient).toMatchInlineSnapshot(`
GitReleaseApiClient {
expect(gitReleaseClient).toMatchInlineSnapshot(`
GitReleaseClient {
"baseUrl": "https://api.github.com",
"createCommit": [Function],
"createRef": [Function],
@@ -22,7 +22,7 @@ import { DISABLE_CACHE } from '../constants/constants';
import { Project } from '../contexts/ProjectContext';
import { UnboxArray, UnboxReturnedPromise } from '../types/helpers';
export class GitReleaseApiClient implements GitReleaseApi {
export class GitReleaseClient implements GitReleaseApi {
private readonly githubAuthApi: OAuthApi;
private readonly baseUrl: string;
readonly host: string;
@@ -16,7 +16,7 @@
import { createApiRef } from '@backstage/core';
import { GitReleaseApi } from './GitReleaseApiClient';
import { GitReleaseApi } from './GitReleaseClient';
export const gitReleaseManagerApiRef = createApiRef<GitReleaseApi>({
id: 'plugin.git-release-manager.service',
@@ -30,7 +30,7 @@ import {
GetBranchResult,
GetLatestReleaseResult,
GetRepositoryResult,
} from '../../api/GitReleaseApiClient';
} from '../../api/GitReleaseClient';
import { ComponentConfigCreateRc } from '../../types/types';
import { Differ } from '../../components/Differ';
import { getReleaseCandidateGitInfo } from '../../helpers/getReleaseCandidateGitInfo';
@@ -21,7 +21,7 @@ import { useApi } from '@backstage/core';
import {
GetLatestReleaseResult,
GetRepositoryResult,
} from '../../../api/GitReleaseApiClient';
} from '../../../api/GitReleaseClient';
import { CardHook, ComponentConfigCreateRc } from '../../../types/types';
import { getReleaseCandidateGitInfo } from '../../../helpers/getReleaseCandidateGitInfo';
import { gitReleaseManagerApiRef } from '../../../api/serviceApiRef';
@@ -21,7 +21,7 @@ import BarChartIcon from '@material-ui/icons/BarChart';
import {
GetBranchResult,
GetLatestReleaseResult,
} from '../../api/GitReleaseApiClient';
} from '../../api/GitReleaseClient';
import { Differ } from '../../components/Differ';
import { InfoCardPlus } from '../../components/InfoCardPlus';
import { Stats } from '../Stats/Stats';
@@ -21,7 +21,7 @@ import { Alert, AlertTitle } from '@material-ui/lab';
import {
GetBranchResult,
GetLatestReleaseResult,
} from '../../api/GitReleaseApiClient';
} from '../../api/GitReleaseClient';
import { ComponentConfigPatch } from '../../types/types';
import { getBumpedTag } from '../../helpers/getBumpedTag';
import { InfoCardPlus } from '../../components/InfoCardPlus';
@@ -38,7 +38,7 @@ import { Progress, useApi } from '@backstage/core';
import {
GetBranchResult,
GetLatestReleaseResult,
} from '../../api/GitReleaseApiClient';
} from '../../api/GitReleaseClient';
import { CalverTagParts } from '../../helpers/tagParts/getCalverTagParts';
import { ComponentConfigPatch } from '../../types/types';
import { Differ } from '../../components/Differ';
@@ -21,7 +21,7 @@ import { useApi } from '@backstage/core';
import {
GetLatestReleaseResult,
GetRecentCommitsResultSingle,
} from '../../../api/GitReleaseApiClient';
} from '../../../api/GitReleaseClient';
import { CalverTagParts } from '../../../helpers/tagParts/getCalverTagParts';
import { ComponentConfigPatch, CardHook } from '../../../types/types';
import { getPatchCommitSuffix } from '../helpers/getPatchCommitSuffix';
@@ -19,7 +19,7 @@ import { Alert, AlertTitle } from '@material-ui/lab';
import { Box, Typography } from '@material-ui/core';
import { ComponentConfigPromoteRc } from '../../types/types';
import { GetLatestReleaseResult } from '../../api/GitReleaseApiClient';
import { GetLatestReleaseResult } from '../../api/GitReleaseClient';
import { InfoCardPlus } from '../../components/InfoCardPlus';
import { NoLatestRelease } from '../../components/NoLatestRelease';
import { PromoteRcBody } from './PromoteRcBody';
@@ -19,7 +19,7 @@ import { Button, Typography, Box } from '@material-ui/core';
import { ComponentConfigPromoteRc } from '../../types/types';
import { Differ } from '../../components/Differ';
import { GetLatestReleaseResult } from '../../api/GitReleaseApiClient';
import { GetLatestReleaseResult } from '../../api/GitReleaseClient';
import { ResponseStepDialog } from '../../components/ResponseStepDialog/ResponseStepDialog';
import { TEST_IDS } from '../../test-helpers/test-ids';
import { usePromoteRc } from './hooks/usePromoteRc';
@@ -19,7 +19,7 @@ import { useAsync, useAsyncFn } from 'react-use';
import { useApi } from '@backstage/core';
import { CardHook, ComponentConfigPromoteRc } from '../../../types/types';
import { GetLatestReleaseResult } from '../../../api/GitReleaseApiClient';
import { GetLatestReleaseResult } from '../../../api/GitReleaseClient';
import { gitReleaseManagerApiRef } from '../../../api/serviceApiRef';
import { GitReleaseManagerError } from '../../../errors/GitReleaseManagerError';
import { TAG_OBJECT_MESSAGE } from '../../../constants/constants';
@@ -15,7 +15,7 @@
*/
import { calverRegexp } from '../../../helpers/tagParts/getCalverTagParts';
import { GetAllReleasesResult } from '../../../api/GitReleaseApiClient';
import { GetAllReleasesResult } from '../../../api/GitReleaseClient';
import { Project } from '../../../contexts/ProjectContext';
import { ReleaseStats } from '../contexts/ReleaseStatsContext';
import { semverRegexp } from '../../../helpers/tagParts/getSemverTagParts';
@@ -15,7 +15,7 @@
*/
import { calverRegexp } from '../../../helpers/tagParts/getCalverTagParts';
import { GetAllTagsResult } from '../../../api/GitReleaseApiClient';
import { GetAllTagsResult } from '../../../api/GitReleaseClient';
import { Project } from '../../../contexts/ProjectContext';
import { ReleaseStats } from '../contexts/ReleaseStatsContext';
import { semverRegexp } from '../../../helpers/tagParts/getSemverTagParts';
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { GitReleaseApi } from '../../../api/GitReleaseApiClient';
import { GitReleaseApi } from '../../../api/GitReleaseClient';
import { GitReleaseManagerError } from '../../../errors/GitReleaseManagerError';
import { Project } from '../../../contexts/ProjectContext';
@@ -17,7 +17,7 @@
import { DateTime } from 'luxon';
import { getBumpedSemverTagParts } from './getBumpedTag';
import { GetLatestReleaseResult } from '../api/GitReleaseApiClient';
import { GetLatestReleaseResult } from '../api/GitReleaseClient';
import { getSemverTagParts } from './tagParts/getSemverTagParts';
import { Project } from '../contexts/ProjectContext';
import { SEMVER_PARTS } from '../constants/constants';
@@ -16,7 +16,7 @@
import { useAsync } from 'react-use';
import { GitReleaseApi } from '../api/GitReleaseApiClient';
import { GitReleaseApi } from '../api/GitReleaseClient';
import { Project } from '../contexts/ProjectContext';
interface GetGitBatchInfo {
+2 -2
View File
@@ -23,7 +23,7 @@ import {
} from '@backstage/core';
import { gitReleaseManagerApiRef } from './api/serviceApiRef';
import { GitReleaseApiClient } from './api/GitReleaseApiClient';
import { GitReleaseClient } from './api/GitReleaseClient';
import { rootRouteRef } from './routes';
export { gitReleaseManagerApiRef };
@@ -41,7 +41,7 @@ export const gitReleaseManagerPlugin = createPlugin({
githubAuthApi: githubAuthApiRef,
},
factory: ({ configApi, githubAuthApi }) => {
return new GitReleaseApiClient({
return new GitReleaseClient({
configApi,
githubAuthApi,
});
@@ -21,7 +21,7 @@ import {
GetTagResult,
GitReleaseApi,
GetCommitResult,
} from '../api/GitReleaseApiClient';
} from '../api/GitReleaseClient';
import { CalverTagParts } from '../helpers/tagParts/getCalverTagParts';
import { Project } from '../contexts/ProjectContext';
import { getReleaseCandidateGitInfo } from '../helpers/getReleaseCandidateGitInfo';