Make entity metadata exports private in TechDocs
Co-authored-by: Anders Näsman <realandersn@users.noreply.github.com> Co-authored-by: Eric Peterson <iamEAP@users.noreply.github.com> Signed-off-by: Otto Sichert <git@ottosichert.de>
This commit is contained in:
@@ -6,7 +6,6 @@
|
||||
/// <reference types="react" />
|
||||
|
||||
import { ApiRef } from '@backstage/core-plugin-api';
|
||||
import { AsyncState } from 'react-use/lib/useAsyncFn';
|
||||
import { BackstagePlugin } from '@backstage/core-plugin-api';
|
||||
import { CompoundEntityRef } from '@backstage/catalog-model';
|
||||
import { Config } from '@backstage/config';
|
||||
@@ -22,8 +21,8 @@ import { RouteRef } from '@backstage/core-plugin-api';
|
||||
import { StyledComponentProps } from '@material-ui/core';
|
||||
import { TableColumn } from '@backstage/core-components';
|
||||
import { TableProps } from '@backstage/core-components';
|
||||
import { TechDocsEntityMetadata } from '@backstage/plugin-techdocs-react';
|
||||
import { TechDocsMetadata } from '@backstage/plugin-techdocs-react';
|
||||
import { TechDocsEntityMetadata as TechDocsEntityMetadata_2 } from '@backstage/plugin-techdocs-react';
|
||||
import { TechDocsMetadata as TechDocsMetadata_2 } from '@backstage/plugin-techdocs-react';
|
||||
import { TechDocsReaderPageValue } from '@backstage/plugin-techdocs-react';
|
||||
import { ToolbarProps } from '@material-ui/core';
|
||||
import { UserListFilterKind } from '@backstage/plugin-catalog-react';
|
||||
@@ -215,9 +214,9 @@ export interface TechDocsApi {
|
||||
// (undocumented)
|
||||
getEntityMetadata(
|
||||
entityId: CompoundEntityRef,
|
||||
): Promise<TechDocsEntityMetadata>;
|
||||
): Promise<TechDocsEntityMetadata_2>;
|
||||
// (undocumented)
|
||||
getTechDocsMetadata(entityId: CompoundEntityRef): Promise<TechDocsMetadata>;
|
||||
getTechDocsMetadata(entityId: CompoundEntityRef): Promise<TechDocsMetadata_2>;
|
||||
}
|
||||
|
||||
// @public
|
||||
@@ -238,8 +237,8 @@ export class TechDocsClient implements TechDocsApi {
|
||||
getApiOrigin(): Promise<string>;
|
||||
getEntityMetadata(
|
||||
entityId: CompoundEntityRef,
|
||||
): Promise<TechDocsEntityMetadata>;
|
||||
getTechDocsMetadata(entityId: CompoundEntityRef): Promise<TechDocsMetadata>;
|
||||
): Promise<TechDocsEntityMetadata_2>;
|
||||
getTechDocsMetadata(entityId: CompoundEntityRef): Promise<TechDocsMetadata_2>;
|
||||
}
|
||||
|
||||
// @public
|
||||
@@ -252,9 +251,15 @@ export type TechDocsCustomHomeProps = {
|
||||
tabsConfig: TabsConfig;
|
||||
};
|
||||
|
||||
// @public @deprecated (undocumented)
|
||||
export type TechDocsEntityMetadata = TechDocsEntityMetadata_2;
|
||||
|
||||
// @public
|
||||
export const TechDocsIndexPage: () => JSX.Element;
|
||||
|
||||
// @public @deprecated (undocumented)
|
||||
export type TechDocsMetadata = TechDocsMetadata_2;
|
||||
|
||||
// @public
|
||||
export const TechdocsPage: () => JSX.Element;
|
||||
|
||||
@@ -325,8 +330,8 @@ export const TechDocsReaderPageHeader: (
|
||||
// @public @deprecated
|
||||
export type TechDocsReaderPageHeaderProps = PropsWithChildren<{
|
||||
entityRef?: CompoundEntityRef;
|
||||
entityMetadata?: TechDocsEntityMetadata;
|
||||
techDocsMetadata?: TechDocsMetadata;
|
||||
entityMetadata?: TechDocsEntityMetadata_2;
|
||||
techDocsMetadata?: TechDocsMetadata_2;
|
||||
}>;
|
||||
|
||||
// @public (undocumented)
|
||||
@@ -357,8 +362,8 @@ export type TechDocsReaderPageRenderFunction = ({
|
||||
entityMetadataValue,
|
||||
entityRef,
|
||||
}: {
|
||||
techdocsMetadataValue?: TechDocsMetadata | undefined;
|
||||
entityMetadataValue?: TechDocsEntityMetadata | undefined;
|
||||
techdocsMetadataValue?: TechDocsMetadata_2 | undefined;
|
||||
entityMetadataValue?: TechDocsEntityMetadata_2 | undefined;
|
||||
entityRef: CompoundEntityRef;
|
||||
onReady?: () => void;
|
||||
}) => JSX.Element;
|
||||
@@ -470,10 +475,4 @@ export class TechDocsStorageClient implements TechDocsStorageApi {
|
||||
logHandler?: (line: string) => void,
|
||||
): Promise<SyncResult>;
|
||||
}
|
||||
|
||||
// @public
|
||||
export const useEntityMetadata: () => AsyncState<TechDocsEntityMetadata>;
|
||||
|
||||
// @public
|
||||
export const useTechDocsMetadata: () => AsyncState<TechDocsMetadata>;
|
||||
```
|
||||
|
||||
@@ -20,6 +20,11 @@
|
||||
* @packageDocumentation
|
||||
*/
|
||||
|
||||
import {
|
||||
TechDocsEntityMetadata,
|
||||
TechDocsMetadata,
|
||||
} from '@backstage/plugin-techdocs-react';
|
||||
|
||||
export * from './types';
|
||||
export * from './api';
|
||||
export * from './client';
|
||||
@@ -36,3 +41,22 @@ export {
|
||||
techdocsPlugin,
|
||||
} from './plugin';
|
||||
export * from './Router';
|
||||
|
||||
/**
|
||||
* @deprecated Import from `@backstage/plugin-techdocs-react` instead
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
type DeprecatedTechDocsMetadata = TechDocsMetadata;
|
||||
|
||||
/**
|
||||
* @deprecated Import from `@backstage/plugin-techdocs-react` instead
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
type DeprecatedTechDocsEntityMetadata = TechDocsEntityMetadata;
|
||||
|
||||
export type {
|
||||
DeprecatedTechDocsEntityMetadata as TechDocsEntityMetadata,
|
||||
DeprecatedTechDocsMetadata as TechDocsMetadata,
|
||||
};
|
||||
|
||||
@@ -113,9 +113,9 @@ export const TechDocsReaderPageProvider = memo(
|
||||
);
|
||||
|
||||
/**
|
||||
* Hook for use within TechDocs addons to retrieve Entity Metadata for the
|
||||
* current TechDocs site.
|
||||
* @public
|
||||
* Hook for sub-components to retrieve Entity Metadata for the current TechDocs
|
||||
* site.
|
||||
* @internal
|
||||
*/
|
||||
export const useEntityMetadata = () => {
|
||||
const { entityMetadata } = useTechDocsReaderPage();
|
||||
@@ -123,9 +123,9 @@ export const useEntityMetadata = () => {
|
||||
};
|
||||
|
||||
/**
|
||||
* Hook for use within TechDocs addons to retrieve TechDocs Metadata for the
|
||||
* current TechDocs site.
|
||||
* @public
|
||||
* Hook for sub-components to retrieve TechDocs Metadata for the current
|
||||
* TechDocs site.
|
||||
* @internal
|
||||
*/
|
||||
export const useTechDocsMetadata = () => {
|
||||
const { metadata } = useTechDocsReaderPage();
|
||||
|
||||
@@ -19,4 +19,8 @@ export type {
|
||||
TechDocsReaderPageProps,
|
||||
TechDocsReaderLayoutProps,
|
||||
} from './TechDocsReaderPage';
|
||||
export * from './context';
|
||||
export { TechDocsReaderPageProvider } from './context';
|
||||
export type {
|
||||
TechDocsReaderPageProviderProps,
|
||||
TechDocsReaderPageProviderRenderFunction,
|
||||
} from './context';
|
||||
|
||||
@@ -21,8 +21,6 @@ export type {
|
||||
TechDocsReaderPageProviderRenderFunction,
|
||||
} from './TechDocsReaderPage';
|
||||
export {
|
||||
useEntityMetadata,
|
||||
useTechDocsMetadata,
|
||||
TechDocsReaderLayout,
|
||||
TechDocsReaderPageProvider,
|
||||
} from './TechDocsReaderPage';
|
||||
|
||||
Reference in New Issue
Block a user