diff --git a/plugins/sentry/api-report.md b/plugins/sentry/api-report.md index bd77c46aa6..2a1b041546 100644 --- a/plugins/sentry/api-report.md +++ b/plugins/sentry/api-report.md @@ -14,28 +14,18 @@ import { InfoCardVariants } from '@backstage/core-components'; import { Options } from '@material-table/core'; import { RouteRef } from '@backstage/core-plugin-api'; -// Warning: (ae-forgotten-export) The symbol "SentryPageProps" needs to be exported by the entry point index.d.ts -// Warning: (ae-missing-release-tag) "EntitySentryCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) -export const EntitySentryCard: ({ - statsFor, - tableOptions, -}: SentryPageProps) => JSX.Element; +export const EntitySentryCard: (props: SentryPageProps) => JSX.Element; -// Warning: (ae-missing-release-tag) "EntitySentryContent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) -export const EntitySentryContent: ({ - statsFor, - tableOptions, -}: SentryPageProps) => JSX.Element; +export const EntitySentryContent: (props: SentryPageProps) => JSX.Element; + +// @public (undocumented) +export type EventPoint = number[]; // @public export const isSentryAvailable: (entity: Entity) => boolean; -// Warning: (ae-missing-release-tag) "MockSentryApi" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export class MockSentryApi implements SentryApi { // (undocumented) @@ -74,11 +64,14 @@ export interface SentryApi { ): Promise; } +// @public (undocumented) +export type SentryApiError = { + detail: string; +}; + // @public (undocumented) export const sentryApiRef: ApiRef; -// Warning: (ae-missing-release-tag) "SentryIssue" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type SentryIssue = { platform: SentryPlatform; @@ -113,6 +106,14 @@ export type SentryIssue = { statusDetails: any; }; +// @public (undocumented) +export type SentryIssueMetadata = { + function?: string; + type?: string; + value?: string; + filename?: string; +}; + // @public (undocumented) export const SentryIssuesWidget: (props: { entity: Entity; @@ -122,6 +123,15 @@ export const SentryIssuesWidget: (props: { query?: string; }) => JSX.Element; +// @public (undocumented) +export type SentryPageProps = { + statsFor?: '24h' | '14d' | ''; + tableOptions?: Options; +}; + +// @public (undocumented) +export type SentryPlatform = 'javascript' | 'javascript-react' | string; + // @public (undocumented) const sentryPlugin: BackstagePlugin< { @@ -133,10 +143,11 @@ const sentryPlugin: BackstagePlugin< export { sentryPlugin as plugin }; export { sentryPlugin }; -// Warnings were encountered during analysis: -// -// src/api/sentry-issue.d.ts:16:5 - (ae-forgotten-export) The symbol "SentryPlatform" needs to be exported by the entry point index.d.ts -// src/api/sentry-issue.d.ts:21:9 - (ae-forgotten-export) The symbol "EventPoint" needs to be exported by the entry point index.d.ts -// src/api/sentry-issue.d.ts:31:5 - (ae-forgotten-export) The symbol "SentryIssueMetadata" needs to be exported by the entry point index.d.ts -// src/api/sentry-issue.d.ts:44:5 - (ae-forgotten-export) The symbol "SentryProject" needs to be exported by the entry point index.d.ts +// @public (undocumented) +export type SentryProject = { + platform: SentryPlatform; + slug: string; + id: string; + name: string; +}; ``` diff --git a/plugins/sentry/src/api/index.ts b/plugins/sentry/src/api/index.ts index 66ac07eda2..9ae6d4eea2 100644 --- a/plugins/sentry/src/api/index.ts +++ b/plugins/sentry/src/api/index.ts @@ -17,5 +17,12 @@ export * from './mock'; export type { SentryApi } from './sentry-api'; export { sentryApiRef } from './sentry-api'; -export type { SentryIssue } from './sentry-issue'; +export type { + EventPoint, + SentryApiError, + SentryIssue, + SentryIssueMetadata, + SentryPlatform, + SentryProject, +} from './sentry-issue'; export { ProductionSentryApi } from './production-api'; diff --git a/plugins/sentry/src/api/mock/mock-api.ts b/plugins/sentry/src/api/mock/mock-api.ts index af64d8656a..4f9f4254fc 100644 --- a/plugins/sentry/src/api/mock/mock-api.ts +++ b/plugins/sentry/src/api/mock/mock-api.ts @@ -30,9 +30,12 @@ function getMockIssue(): SentryIssue { stats: randomizedStats, }; } + function getMockIssues(number: number): SentryIssue[] { return new Array(number).fill(0).map(getMockIssue); } + +/** @public */ export class MockSentryApi implements SentryApi { fetchIssues(): Promise { return new Promise(resolve => { diff --git a/plugins/sentry/src/api/sentry-issue.ts b/plugins/sentry/src/api/sentry-issue.ts index ef0e99adb8..e25cf88829 100644 --- a/plugins/sentry/src/api/sentry-issue.ts +++ b/plugins/sentry/src/api/sentry-issue.ts @@ -14,24 +14,29 @@ * limitations under the License. */ -type SentryPlatform = 'javascript' | 'javascript-react' | string; +/** @public */ +export type SentryPlatform = 'javascript' | 'javascript-react' | string; -type EventPoint = number[]; +/** @public */ +export type EventPoint = number[]; -type SentryProject = { +/** @public */ +export type SentryProject = { platform: SentryPlatform; slug: string; id: string; name: string; }; -type SentryIssueMetadata = { +/** @public */ +export type SentryIssueMetadata = { function?: string; type?: string; value?: string; filename?: string; }; +/** @public */ export type SentryIssue = { platform: SentryPlatform; lastSeen: string; @@ -65,6 +70,7 @@ export type SentryIssue = { statusDetails: any; }; +/** @public */ export type SentryApiError = { detail: string; }; diff --git a/plugins/sentry/src/components/SentryIssuesTable/SentryIssuesTable.tsx b/plugins/sentry/src/components/SentryIssuesTable/SentryIssuesTable.tsx index e8e4c44a11..abe29efd7f 100644 --- a/plugins/sentry/src/components/SentryIssuesTable/SentryIssuesTable.tsx +++ b/plugins/sentry/src/components/SentryIssuesTable/SentryIssuesTable.tsx @@ -64,11 +64,8 @@ type SentryIssuesTableProps = { tableOptions: Options; }; -const SentryIssuesTable = ({ - sentryIssues, - statsFor, - tableOptions, -}: SentryIssuesTableProps) => { +const SentryIssuesTable = (props: SentryIssuesTableProps) => { + const { sentryIssues, statsFor, tableOptions } = props; return ( ; }; +/** @public */ export const EntitySentryContent = sentryPlugin.provide( createRoutableExtension({ name: 'EntitySentryContent', @@ -35,7 +37,7 @@ export const EntitySentryContent = sentryPlugin.provide( component: () => import('./components/SentryIssuesWidget').then( ({ SentryIssuesWidget }) => { - const SentryPage = ({ statsFor, tableOptions }: SentryPageProps) => { + const SentryPage = (props: SentryPageProps) => { const { entity } = useEntity(); const defaultOptions: Options = { padding: 'dense', @@ -46,8 +48,8 @@ export const EntitySentryContent = sentryPlugin.provide( return ( ); }; @@ -57,6 +59,7 @@ export const EntitySentryContent = sentryPlugin.provide( }), ); +/** @public */ export const EntitySentryCard = sentryPlugin.provide( createComponentExtension({ name: 'EntitySentryCard', @@ -64,17 +67,14 @@ export const EntitySentryCard = sentryPlugin.provide( lazy: () => import('./components/SentryIssuesWidget').then( ({ SentryIssuesWidget }) => { - const SentryCard = ({ - statsFor, - tableOptions, - }: SentryPageProps) => { + const SentryCard = (props: SentryPageProps) => { const { entity } = useEntity(); return (