more api cleanup

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2022-08-18 14:11:45 +02:00
parent e195112c5c
commit 3f739be9d9
88 changed files with 358 additions and 594 deletions
+4 -22
View File
@@ -42,8 +42,6 @@ export class MockSentryApi implements SentryApi {
fetchIssues(): Promise<SentryIssue[]>;
}
// Warning: (ae-missing-release-tag) "ProductionSentryApi" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export class ProductionSentryApi implements SentryApi {
constructor(
@@ -61,13 +59,9 @@ export class ProductionSentryApi implements SentryApi {
): Promise<SentryIssue[]>;
}
// Warning: (ae-missing-release-tag) "Router" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export const Router: ({ entity }: { entity: Entity }) => JSX.Element;
export const Router: (props: { entity: Entity }) => JSX.Element;
// Warning: (ae-missing-release-tag) "SentryApi" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export interface SentryApi {
// (undocumented)
@@ -80,8 +74,6 @@ export interface SentryApi {
): Promise<SentryIssue[]>;
}
// Warning: (ae-missing-release-tag) "sentryApiRef" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export const sentryApiRef: ApiRef<SentryApi>;
@@ -121,25 +113,15 @@ export type SentryIssue = {
statusDetails: any;
};
// Warning: (ae-missing-release-tag) "SentryIssuesWidget" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export const SentryIssuesWidget: ({
entity,
statsFor,
tableOptions,
variant,
query,
}: {
export const SentryIssuesWidget: (props: {
entity: Entity;
statsFor: '24h' | '14d' | '';
tableOptions: Options<never>;
variant?: InfoCardVariants | undefined;
query?: string | undefined;
variant?: InfoCardVariants;
query?: string;
}) => JSX.Element;
// Warning: (ae-missing-release-tag) "sentryPlugin" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
const sentryPlugin: BackstagePlugin<
{
+1
View File
@@ -20,6 +20,7 @@ import { DiscoveryApi, IdentityApi } from '@backstage/core-plugin-api';
import { Entity } from '@backstage/catalog-model';
import { getProjectSlug, getOrganization } from './annotations';
/** @public */
export class ProductionSentryApi implements SentryApi {
constructor(
private readonly discoveryApi: DiscoveryApi,
+2
View File
@@ -18,10 +18,12 @@ import { SentryIssue } from './sentry-issue';
import { createApiRef } from '@backstage/core-plugin-api';
import { Entity } from '@backstage/catalog-model';
/** @public */
export const sentryApiRef = createApiRef<SentryApi>({
id: 'plugin.sentry.service',
});
/** @public */
export interface SentryApi {
fetchIssues(
entity: Entity,
+3 -2
View File
@@ -19,14 +19,15 @@ import { Entity } from '@backstage/catalog-model';
import { Route, Routes } from 'react-router';
import { SentryIssuesWidget } from './SentryIssuesWidget';
export const Router = ({ entity }: { entity: Entity }) => {
/** @public */
export const Router = (props: { entity: Entity }) => {
return (
<Routes>
<Route
path="/"
element={
<SentryIssuesWidget
entity={entity}
entity={props.entity}
statsFor="24h"
tableOptions={{
padding: 'dense',
@@ -32,19 +32,21 @@ import {
import { ErrorApi, errorApiRef, useApi } from '@backstage/core-plugin-api';
import { Options } from '@material-table/core';
export const SentryIssuesWidget = ({
entity,
statsFor,
tableOptions,
variant = 'gridItem',
query = '',
}: {
/** @public */
export const SentryIssuesWidget = (props: {
entity: Entity;
statsFor: '24h' | '14d' | '';
tableOptions: Options<never>;
variant?: InfoCardVariants;
query?: string;
}) => {
const {
entity,
statsFor,
tableOptions,
variant = 'gridItem',
query = '',
} = props;
const errorApi = useApi<ErrorApi>(errorApiRef);
const sentryApi = useApi(sentryApiRef);
+2
View File
@@ -24,10 +24,12 @@ import {
identityApiRef,
} from '@backstage/core-plugin-api';
/** @public */
export const rootRouteRef = createRouteRef({
id: 'sentry',
});
/** @public */
export const sentryPlugin = createPlugin({
id: 'sentry',
apis: [