feat: fix plugin api report

Signed-off-by: Kamil Wolny <mrwolny@gmail.com>
This commit is contained in:
Kamil Wolny
2022-08-10 10:14:45 +01:00
parent 347ea327c2
commit 9e64dd3032
2 changed files with 87 additions and 3 deletions
+74
View File
@@ -5,9 +5,49 @@
```ts
/// <reference types="react" />
import { ApiRef } from '@backstage/core-plugin-api';
import { BackstagePlugin } from '@backstage/core-plugin-api';
import { ConfigApi } from '@backstage/core-plugin-api';
import { ErrorApi } from '@backstage/core-plugin-api';
import { OAuthApi } from '@backstage/core-plugin-api';
import { RouteRef } from '@backstage/core-plugin-api';
// @public (undocumented)
export type Assignee = {
avatarUrl: string;
login: string;
};
// @public (undocumented)
export type EdgesWithNodes<T> = {
edges: Array<{
node: T;
}>;
};
// @public (undocumented)
export type GitHubIssuesApi = ReturnType<typeof gitHubIssuesApi>;
// @public (undocumented)
export const gitHubIssuesApi: (
githubAuthApi: OAuthApi,
configApi: ConfigApi,
errorApi: ErrorApi,
) => {
fetchIssuesByRepoFromGitHub: (
repos: Array<string>,
itemsPerRepo: number,
) => Promise<IssuesByRepo>;
};
// @public (undocumented)
export const gitHubIssuesApiRef: ApiRef<{
fetchIssuesByRepoFromGitHub: (
repos: Array<string>,
itemsPerRepo: number,
) => Promise<IssuesByRepo>;
}>;
// @public (undocumented)
export const GitHubIssuesCard: (props: GitHubIssuesProps) => JSX.Element;
@@ -29,5 +69,39 @@ export type GitHubIssuesProps = {
itemsPerRepo?: number;
};
// @public (undocumented)
export type Issue = {
assignees: EdgesWithNodes<Assignee>;
author: IssueAuthor;
repository: {
nameWithOwner: string;
};
title: string;
url: string;
participants: {
totalCount: number;
};
createdAt: string;
updatedAt: string;
comments: {
totalCount: number;
};
};
// @public (undocumented)
export type IssueAuthor = {
login: string;
};
// @public (undocumented)
export type IssuesByRepo = Record<string, RepoIssues>;
// @public (undocumented)
export type RepoIssues = {
issues: {
totalCount: number;
} & EdgesWithNodes<Issue>;
};
// (No @packageDocumentation comment for this package)
```
@@ -23,21 +23,25 @@ import {
import { readGitHubIntegrationConfigs } from '@backstage/integration';
import { ForwardedError } from '@backstage/errors';
type Assignee = {
/** @public */
export type Assignee = {
avatarUrl: string;
login: string;
};
type EdgesWithNodes<T> = {
/** @public */
export type EdgesWithNodes<T> = {
edges: Array<{
node: T;
}>;
};
type IssueAuthor = {
/** @public */
export type IssueAuthor = {
login: string;
};
/** @public */
export type Issue = {
assignees: EdgesWithNodes<Assignee>;
author: IssueAuthor;
@@ -56,19 +60,25 @@ export type Issue = {
};
};
/** @public */
export type RepoIssues = {
issues: {
totalCount: number;
} & EdgesWithNodes<Issue>;
};
/** @public */
export type IssuesByRepo = Record<string, RepoIssues>;
/** @public */
export type GitHubIssuesApi = ReturnType<typeof gitHubIssuesApi>;
/** @public */
export const gitHubIssuesApiRef = createApiRef<GitHubIssuesApi>({
id: 'plugin.githubissues.service',
});
/** @public */
export const gitHubIssuesApi = (
githubAuthApi: OAuthApi,
configApi: ConfigApi,