@@ -89,7 +89,6 @@ import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
|
||||
import { vmwareCloudAuthApiRef } from '@backstage/core-plugin-api';
|
||||
import { withApis } from '@backstage/core-plugin-api';
|
||||
import { z } from 'zod';
|
||||
import { ZodObject } from 'zod';
|
||||
import { ZodSchema } from 'zod';
|
||||
import { ZodTypeDef } from 'zod';
|
||||
|
||||
@@ -392,7 +391,7 @@ export function createApiExtension<
|
||||
configSchema?: PortableSchema<TConfig>;
|
||||
inputs?: TInputs;
|
||||
},
|
||||
): ExtensionDefinition<TConfig, ZodObject<any, any, any, any, any>>;
|
||||
): ExtensionDefinition<TConfig>;
|
||||
|
||||
// @public (undocumented)
|
||||
export namespace createApiExtension {
|
||||
@@ -488,7 +487,7 @@ export function createComponentExtension<
|
||||
inputs: Expand<ResolvedExtensionInputs<TInputs>>;
|
||||
}) => ComponentType<TProps>;
|
||||
};
|
||||
}): ExtensionDefinition<TConfig, ZodObject<any, any, any, any, any>>;
|
||||
}): ExtensionDefinition<TConfig>;
|
||||
|
||||
// @public (undocumented)
|
||||
export namespace createComponentExtension {
|
||||
@@ -512,35 +511,49 @@ export function createComponentRef<T extends {} = {}>(options: {
|
||||
export function createExtension<
|
||||
TOutput extends AnyExtensionDataMap,
|
||||
TInputs extends AnyExtensionInputMap,
|
||||
TConfigSchema extends z.ZodObject<any, any, any, any, any>,
|
||||
TConfig extends z.infer<TConfigSchema>,
|
||||
TConfig,
|
||||
TConfigSchema extends {
|
||||
[key: string]: z.ZodType;
|
||||
},
|
||||
>(
|
||||
options: CreateExtensionOptions<TOutput, TInputs, TConfigSchema, TConfig>,
|
||||
): ExtensionDefinition<TConfig, TConfigSchema>;
|
||||
options: CreateExtensionOptions<TOutput, TInputs, TConfig, TConfigSchema>,
|
||||
): ExtensionDefinition<TConfig>;
|
||||
|
||||
// @public
|
||||
export function createExtensionBlueprint<
|
||||
TParams,
|
||||
TInputs extends AnyExtensionInputMap,
|
||||
TOutput extends AnyExtensionDataMap,
|
||||
TConfig,
|
||||
TConfigSchema extends {
|
||||
[key in string]: z.ZodType;
|
||||
},
|
||||
TDataRefs extends AnyExtensionDataMap = never,
|
||||
>(
|
||||
options: CreateExtensionBlueprintOptions<
|
||||
TParams,
|
||||
TInputs,
|
||||
TOutput,
|
||||
TConfig,
|
||||
TConfigSchema,
|
||||
TDataRefs
|
||||
>,
|
||||
): ExtensionBlueprint<TParams, TInputs, TOutput, TConfig, TDataRefs>;
|
||||
): ExtensionBlueprint<
|
||||
TParams,
|
||||
TInputs,
|
||||
TOutput,
|
||||
{
|
||||
[key in keyof TConfigSchema]: z.infer<TConfigSchema[key]>;
|
||||
},
|
||||
TDataRefs
|
||||
>;
|
||||
|
||||
// @public (undocumented)
|
||||
export interface CreateExtensionBlueprintOptions<
|
||||
TParams,
|
||||
TInputs extends AnyExtensionInputMap,
|
||||
TOutput extends AnyExtensionDataMap,
|
||||
TConfig,
|
||||
TConfigSchema extends {
|
||||
[key in string]: z.ZodType;
|
||||
},
|
||||
TDataRefs extends AnyExtensionDataMap,
|
||||
> {
|
||||
// (undocumented)
|
||||
@@ -549,7 +562,11 @@ export interface CreateExtensionBlueprintOptions<
|
||||
input: string;
|
||||
};
|
||||
// (undocumented)
|
||||
configSchema?: PortableSchema<TConfig>;
|
||||
config?: {
|
||||
schema: {
|
||||
[key in keyof TConfigSchema]: (zImpl: typeof z) => TConfigSchema[key];
|
||||
};
|
||||
};
|
||||
// (undocumented)
|
||||
dataRefs?: TDataRefs;
|
||||
// (undocumented)
|
||||
@@ -559,7 +576,9 @@ export interface CreateExtensionBlueprintOptions<
|
||||
params: TParams,
|
||||
context: {
|
||||
node: AppNode;
|
||||
config: TConfig;
|
||||
config: {
|
||||
[key in keyof TConfigSchema]: z.infer<TConfigSchema[key]>;
|
||||
};
|
||||
inputs: Expand<ResolvedExtensionInputs<TInputs>>;
|
||||
},
|
||||
): Expand<ExtensionDataValues<TOutput>>;
|
||||
@@ -607,8 +626,10 @@ export function createExtensionInput<
|
||||
export interface CreateExtensionOptions<
|
||||
TOutput extends AnyExtensionDataMap,
|
||||
TInputs extends AnyExtensionInputMap,
|
||||
TConfigSchema extends z.ZodObject<any, any, any, any, any>,
|
||||
TConfig extends z.infer<TConfigSchema>,
|
||||
TConfig,
|
||||
TConfigSchema extends {
|
||||
[key: string]: z.ZodType;
|
||||
},
|
||||
> {
|
||||
// (undocumented)
|
||||
attachTo: {
|
||||
@@ -617,7 +638,9 @@ export interface CreateExtensionOptions<
|
||||
};
|
||||
// (undocumented)
|
||||
config?: {
|
||||
schema: (context: { z: typeof z }) => TConfigSchema;
|
||||
schema: {
|
||||
[key in keyof TConfigSchema]: (zImpl: typeof z) => TConfigSchema[key];
|
||||
};
|
||||
};
|
||||
// @deprecated (undocumented)
|
||||
configSchema?: PortableSchema<TConfig>;
|
||||
@@ -626,7 +649,9 @@ export interface CreateExtensionOptions<
|
||||
// (undocumented)
|
||||
factory(context: {
|
||||
node: AppNode;
|
||||
config: TConfig;
|
||||
config: TConfig & {
|
||||
[key in keyof TConfigSchema]: z.infer<TConfigSchema[key]>;
|
||||
};
|
||||
inputs: Expand<ResolvedExtensionInputs<TInputs>>;
|
||||
}): Expand<ExtensionDataValues<TOutput>>;
|
||||
// (undocumented)
|
||||
@@ -679,12 +704,9 @@ export function createNavItemExtension(options: {
|
||||
routeRef: RouteRef<undefined>;
|
||||
title: string;
|
||||
icon: IconComponent_2;
|
||||
}): ExtensionDefinition<
|
||||
{
|
||||
title: string;
|
||||
},
|
||||
ZodObject<any, any, any, any, any>
|
||||
>;
|
||||
}): ExtensionDefinition<{
|
||||
title: string;
|
||||
}>;
|
||||
|
||||
// @public (undocumented)
|
||||
export namespace createNavItemExtension {
|
||||
@@ -706,7 +728,7 @@ export function createNavLogoExtension(options: {
|
||||
namespace?: string;
|
||||
logoIcon: JSX.Element;
|
||||
logoFull: JSX.Element;
|
||||
}): ExtensionDefinition<any, ZodObject<any, any, any, any, any>>;
|
||||
}): ExtensionDefinition<unknown>;
|
||||
|
||||
// @public (undocumented)
|
||||
export namespace createNavLogoExtension {
|
||||
@@ -814,7 +836,7 @@ export namespace createRouterExtension {
|
||||
>;
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
// @public @deprecated (undocumented)
|
||||
export function createSchemaFromZod<TOutput, TInput>(
|
||||
schemaCreator: (zImpl: typeof z) => ZodSchema<TOutput, ZodTypeDef, TInput>,
|
||||
): PortableSchema<TOutput>;
|
||||
@@ -861,7 +883,7 @@ export function createSubRouteRef<
|
||||
// @public (undocumented)
|
||||
export function createThemeExtension(
|
||||
theme: AppTheme,
|
||||
): ExtensionDefinition<any, ZodObject<any, any, any, any, any>>;
|
||||
): ExtensionDefinition<unknown>;
|
||||
|
||||
// @public (undocumented)
|
||||
export namespace createThemeExtension {
|
||||
@@ -877,7 +899,7 @@ export namespace createThemeExtension {
|
||||
export function createTranslationExtension(options: {
|
||||
name?: string;
|
||||
resource: TranslationResource | TranslationMessages;
|
||||
}): ExtensionDefinition<any, ZodObject<any, any, any, any, any>>;
|
||||
}): ExtensionDefinition<unknown>;
|
||||
|
||||
// @public (undocumented)
|
||||
export namespace createTranslationExtension {
|
||||
@@ -936,12 +958,18 @@ export interface ExtensionBlueprint<
|
||||
TParams,
|
||||
TInputs extends AnyExtensionInputMap,
|
||||
TOutput extends AnyExtensionDataMap,
|
||||
TConfig,
|
||||
TConfig extends {
|
||||
[key in string]: unknown;
|
||||
},
|
||||
TDataRefs extends AnyExtensionDataMap,
|
||||
> {
|
||||
// (undocumented)
|
||||
dataRefs: TDataRefs;
|
||||
make(
|
||||
make<
|
||||
TExtensionConfigSchema extends {
|
||||
[key in string]: z.ZodType;
|
||||
},
|
||||
>(
|
||||
args: {
|
||||
namespace?: string;
|
||||
name?: string;
|
||||
@@ -952,7 +980,15 @@ export interface ExtensionBlueprint<
|
||||
disabled?: boolean;
|
||||
inputs?: TInputs;
|
||||
output?: TOutput;
|
||||
configSchema?: PortableSchema<TConfig>;
|
||||
config?: {
|
||||
schema: {
|
||||
[key in keyof TExtensionConfigSchema]: (
|
||||
zImpl: typeof z,
|
||||
) => TExtensionConfigSchema[key];
|
||||
} & {
|
||||
[key in keyof TConfig]?: never;
|
||||
};
|
||||
};
|
||||
} & (
|
||||
| {
|
||||
factory(
|
||||
@@ -965,7 +1001,11 @@ export interface ExtensionBlueprint<
|
||||
) => Expand<ExtensionDataValues<TOutput>>,
|
||||
context: {
|
||||
node: AppNode;
|
||||
config: TConfig;
|
||||
config: {
|
||||
[key in keyof TExtensionConfigSchema]: z.infer<
|
||||
TExtensionConfigSchema[key]
|
||||
>;
|
||||
} & TConfig;
|
||||
inputs: Expand<ResolvedExtensionInputs<TInputs>>;
|
||||
},
|
||||
): Expand<ExtensionDataValues<TOutput>>;
|
||||
@@ -974,7 +1014,13 @@ export interface ExtensionBlueprint<
|
||||
params: TParams;
|
||||
}
|
||||
),
|
||||
): ExtensionDefinition<TConfig>;
|
||||
): ExtensionDefinition<
|
||||
{
|
||||
[key in keyof TExtensionConfigSchema]: z.infer<
|
||||
TExtensionConfigSchema[key]
|
||||
>;
|
||||
} & TConfig
|
||||
>;
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
@@ -1021,10 +1067,7 @@ export type ExtensionDataValues<TExtensionData extends AnyExtensionDataMap> = {
|
||||
};
|
||||
|
||||
// @public (undocumented)
|
||||
export interface ExtensionDefinition<
|
||||
TConfig,
|
||||
TConfigSchema extends z.ZodObject<any, any, any, any, any> = any,
|
||||
> {
|
||||
export interface ExtensionDefinition<TConfig> {
|
||||
// (undocumented)
|
||||
$$type: '@backstage/ExtensionDefinition';
|
||||
// (undocumented)
|
||||
@@ -1035,8 +1078,6 @@ export interface ExtensionDefinition<
|
||||
// (undocumented)
|
||||
readonly configSchema?: PortableSchema<TConfig>;
|
||||
// (undocumented)
|
||||
readonly configSchema2?: TConfigSchema;
|
||||
// (undocumented)
|
||||
readonly disabled: boolean;
|
||||
// (undocumented)
|
||||
readonly kind?: string;
|
||||
@@ -1134,7 +1175,9 @@ export const IconBundleBlueprint: ExtensionBlueprint<
|
||||
{}
|
||||
>;
|
||||
},
|
||||
unknown,
|
||||
{
|
||||
[x: string]: any;
|
||||
},
|
||||
{
|
||||
icons: ConfigurableExtensionDataRef<
|
||||
'core.icons',
|
||||
|
||||
@@ -33,39 +33,3 @@ export const IconBundleBlueprint = createExtensionBlueprint({
|
||||
icons: iconsDataRef,
|
||||
},
|
||||
});
|
||||
|
||||
IconBundleBlueprint.make({
|
||||
name: 'asd',
|
||||
params: {
|
||||
icons: {
|
||||
'icon-name': () => null,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
IconBundleBlueprint.make({
|
||||
name: 'asd',
|
||||
params: {
|
||||
icons: {
|
||||
'icon-name': () => null,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
IconBundleBlueprint.make({
|
||||
name: 'asd',
|
||||
factory() {
|
||||
return {
|
||||
icons: {
|
||||
'icon-name': () => null,
|
||||
},
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
IconBundleBlueprint.make({
|
||||
name: 'asd',
|
||||
factory(f) {
|
||||
return f({ icons: { 'icon-name': () => null } });
|
||||
},
|
||||
});
|
||||
|
||||
@@ -102,11 +102,11 @@ export class ExtensionTester {
|
||||
...output,
|
||||
path: coreExtensionData.routePath,
|
||||
},
|
||||
factory: (params: any) => ({
|
||||
factory: params => ({
|
||||
...factory(params),
|
||||
path: '/',
|
||||
}),
|
||||
} as any);
|
||||
});
|
||||
tester.add(extension, options);
|
||||
return tester;
|
||||
}
|
||||
|
||||
@@ -4,22 +4,9 @@
|
||||
|
||||
```ts
|
||||
import { BackstagePlugin } from '@backstage/frontend-plugin-api';
|
||||
import { ExtensionDefinition } from '@backstage/frontend-plugin-api';
|
||||
import { ExternalRouteRef } from '@backstage/frontend-plugin-api';
|
||||
import { RouteRef } from '@backstage/frontend-plugin-api';
|
||||
|
||||
// Warning: (ae-missing-release-tag) "CatalogGraphEntityCard" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export const CatalogGraphEntityCard: ExtensionDefinition<
|
||||
{
|
||||
title: string | undefined;
|
||||
height: number | undefined;
|
||||
} & {
|
||||
filter: string | undefined;
|
||||
}
|
||||
>;
|
||||
|
||||
// @public (undocumented)
|
||||
const _default: BackstagePlugin<
|
||||
{
|
||||
|
||||
@@ -24,7 +24,7 @@ import {
|
||||
compatWrapper,
|
||||
convertLegacyRouteRef,
|
||||
} from '@backstage/core-compat-api';
|
||||
import { EntityCardBlueprint } from '@backstage/plugin-catalog-react/alpha';
|
||||
import { createEntityCardExtension } from '@backstage/plugin-catalog-react/alpha';
|
||||
import { catalogGraphRouteRef, catalogEntityRouteRef } from './routes';
|
||||
import { Direction } from './components';
|
||||
|
||||
@@ -46,67 +46,24 @@ function getEntityGraphRelationsConfigSchema(
|
||||
});
|
||||
}
|
||||
|
||||
export const CatalogGraphEntityCard = EntityCardBlueprint.make({
|
||||
const CatalogGraphEntityCard = createEntityCardExtension({
|
||||
name: 'relations',
|
||||
// configSchema: origSchema =>
|
||||
// createSchemaFromZod(z =>
|
||||
// z
|
||||
// .object({
|
||||
// // Filter is a config required to all entity cards
|
||||
// // filter: z.string().optional(),
|
||||
// title: z.string().optional(),
|
||||
// height: z.number().optional(),
|
||||
// // Skipping a "variant" config for now, defaulting to "gridItem" in the component
|
||||
// // For more details, see this comment: https://github.com/backstage/backstage/pull/22619#discussion_r1477333252
|
||||
// })
|
||||
// .merge(getEntityGraphRelationsConfigSchema(z))
|
||||
// .merge(origSchema),
|
||||
// ),
|
||||
|
||||
// config: {
|
||||
// schema: ({ z, parent }) =>
|
||||
// parent
|
||||
// .merge({
|
||||
// title: z.string().optional(),
|
||||
// height: z.number().optional(),
|
||||
// })
|
||||
// .merge(getEntityGraphRelationsConfigSchema(z)),
|
||||
// },
|
||||
|
||||
// config: {
|
||||
// schema: ({ z, parent }) =>
|
||||
// parent
|
||||
// .extend({
|
||||
// title: z.string().optional(),
|
||||
// height: z.number().optional(),
|
||||
// })
|
||||
// .merge(getEntityGraphRelationsConfigSchema(z)),
|
||||
// // .merge(parent)
|
||||
// },
|
||||
|
||||
// TODO: implement this and check the types. 👋 zod types.
|
||||
config: {
|
||||
schema: {
|
||||
title: z => z.string().optional(),
|
||||
height: z => z.number().optional(),
|
||||
},
|
||||
},
|
||||
|
||||
// config: {
|
||||
// schema: z => ({
|
||||
// title: z.string().optional(),
|
||||
// height: z.number().optional(),
|
||||
// }),
|
||||
// },
|
||||
|
||||
factory(origFactory, { config: { filter: _, ...props } }) {
|
||||
return origFactory({
|
||||
loader: async () =>
|
||||
import('./components/CatalogGraphCard').then(m =>
|
||||
compatWrapper(<m.CatalogGraphCard {...props} />),
|
||||
),
|
||||
});
|
||||
},
|
||||
configSchema: createSchemaFromZod(z =>
|
||||
z
|
||||
.object({
|
||||
// Filter is a config required to all entity cards
|
||||
filter: z.string().optional(),
|
||||
title: z.string().optional(),
|
||||
height: z.number().optional(),
|
||||
// Skipping a "variant" config for now, defaulting to "gridItem" in the component
|
||||
// For more details, see this comment: https://github.com/backstage/backstage/pull/22619#discussion_r1477333252
|
||||
})
|
||||
.merge(getEntityGraphRelationsConfigSchema(z)),
|
||||
),
|
||||
loader: async ({ config: { filter, ...props } }) =>
|
||||
import('./components/CatalogGraphCard').then(m =>
|
||||
compatWrapper(<m.CatalogGraphCard {...props} />),
|
||||
),
|
||||
});
|
||||
|
||||
const CatalogGraphPage = createPageExtension({
|
||||
|
||||
@@ -3,20 +3,17 @@
|
||||
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
||||
|
||||
```ts
|
||||
/// <reference types="react" />
|
||||
|
||||
import { AnyExtensionInputMap } from '@backstage/frontend-plugin-api';
|
||||
import { ConfigurableExtensionDataRef } from '@backstage/frontend-plugin-api';
|
||||
import { Entity } from '@backstage/catalog-model';
|
||||
import { ExtensionBlueprint } from '@backstage/frontend-plugin-api';
|
||||
import { ExtensionDefinition } from '@backstage/frontend-plugin-api';
|
||||
import { PortableSchema } from '@backstage/frontend-plugin-api';
|
||||
import { default as React_2 } from 'react';
|
||||
import { ResolvedExtensionInputs } from '@backstage/frontend-plugin-api';
|
||||
import { ResourcePermission } from '@backstage/plugin-permission-common';
|
||||
import { RouteRef } from '@backstage/frontend-plugin-api';
|
||||
import { TranslationRef } from '@backstage/core-plugin-api/alpha';
|
||||
import { ZodOptional } from 'zod';
|
||||
import { ZodRawShape } from 'zod';
|
||||
import { ZodString } from 'zod';
|
||||
|
||||
// @alpha (undocumented)
|
||||
export const catalogExtensionData: {
|
||||
@@ -118,7 +115,7 @@ export function createEntityCardExtension<
|
||||
config: TConfig;
|
||||
inputs: Expand<ResolvedExtensionInputs<TInputs>>;
|
||||
}) => Promise<JSX.Element>;
|
||||
}): ExtensionDefinition<TConfig, ZodRawShape>;
|
||||
}): ExtensionDefinition<TConfig>;
|
||||
|
||||
// @alpha (undocumented)
|
||||
export function createEntityContentExtension<
|
||||
@@ -141,48 +138,11 @@ export function createEntityContentExtension<
|
||||
loader: (options: {
|
||||
inputs: Expand<ResolvedExtensionInputs<TInputs>>;
|
||||
}) => Promise<JSX.Element>;
|
||||
}): ExtensionDefinition<
|
||||
{
|
||||
title: string;
|
||||
path: string;
|
||||
filter?: string | undefined;
|
||||
},
|
||||
ZodRawShape
|
||||
>;
|
||||
|
||||
// @alpha (undocumented)
|
||||
export const EntityCardBlueprint: ExtensionBlueprint<
|
||||
{
|
||||
filter?: string | ((entity: Entity) => boolean) | undefined;
|
||||
loader: () => Promise<JSX.Element>;
|
||||
},
|
||||
AnyExtensionInputMap,
|
||||
{
|
||||
element: ConfigurableExtensionDataRef<
|
||||
'core.reactElement',
|
||||
React_2.JSX.Element,
|
||||
{}
|
||||
>;
|
||||
filterFunction: ConfigurableExtensionDataRef<
|
||||
'catalog.entity-filter-function',
|
||||
(entity: Entity) => boolean,
|
||||
((entity: Entity) => boolean) & {
|
||||
optional: true;
|
||||
}
|
||||
>;
|
||||
filterExpression: ConfigurableExtensionDataRef<
|
||||
'catalog.entity-filter-expression',
|
||||
string,
|
||||
string & {
|
||||
optional: true;
|
||||
}
|
||||
>;
|
||||
},
|
||||
{
|
||||
filter: ZodOptional<ZodString>;
|
||||
},
|
||||
never
|
||||
>;
|
||||
}): ExtensionDefinition<{
|
||||
title: string;
|
||||
path: string;
|
||||
filter?: string | undefined;
|
||||
}>;
|
||||
|
||||
// @alpha
|
||||
export function isOwnerOf(owner: Entity, entity: Entity): boolean;
|
||||
|
||||
@@ -22,7 +22,6 @@ import {
|
||||
RouteRef,
|
||||
coreExtensionData,
|
||||
createExtension,
|
||||
createExtensionBlueprint,
|
||||
createExtensionDataRef,
|
||||
createSchemaFromZod,
|
||||
} from '@backstage/frontend-plugin-api';
|
||||
@@ -48,49 +47,6 @@ export const catalogExtensionData = {
|
||||
}),
|
||||
};
|
||||
|
||||
/** @alpha */
|
||||
export const EntityCardBlueprint = createExtensionBlueprint({
|
||||
kind: 'entity-card',
|
||||
attachTo: { id: 'entity-content:catalog/overview', input: 'cards' },
|
||||
// configSchema: createSchemaFromZod(z =>
|
||||
// z.object({
|
||||
// filter: z.string().optional(),
|
||||
// }),
|
||||
// ),
|
||||
config: {
|
||||
schema: {
|
||||
filter: z => z.string().optional(),
|
||||
},
|
||||
},
|
||||
output: {
|
||||
element: coreExtensionData.reactElement,
|
||||
filterFunction: catalogExtensionData.entityFilterFunction.optional(),
|
||||
filterExpression: catalogExtensionData.entityFilterExpression.optional(),
|
||||
},
|
||||
factory(
|
||||
params: {
|
||||
filter?:
|
||||
| typeof catalogExtensionData.entityFilterFunction.T
|
||||
| typeof catalogExtensionData.entityFilterExpression.T;
|
||||
loader: () => Promise<JSX.Element>;
|
||||
},
|
||||
{ node, config },
|
||||
) {
|
||||
const ExtensionComponent = lazy(() =>
|
||||
params.loader().then(element => ({ default: () => element })),
|
||||
);
|
||||
|
||||
return {
|
||||
element: (
|
||||
<ExtensionBoundary node={node}>
|
||||
<ExtensionComponent />
|
||||
</ExtensionBoundary>
|
||||
),
|
||||
...mergeFilters({ config, options: params }),
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
// TODO: Figure out how to merge with provided config schema
|
||||
/** @alpha */
|
||||
export function createEntityCardExtension<
|
||||
@@ -198,13 +154,6 @@ export function createEntityContentExtension<
|
||||
filter: z.string().optional(),
|
||||
}),
|
||||
),
|
||||
// config: {
|
||||
// schema: ({ z }) => ({
|
||||
// path: z.string().default(options.defaultPath),
|
||||
// title: z.string().default(options.defaultTitle),
|
||||
// filter: z.string().optional(),
|
||||
// }),
|
||||
// },
|
||||
factory({ config, inputs, node }) {
|
||||
const ExtensionComponent = lazy(() =>
|
||||
options
|
||||
|
||||
@@ -12,39 +12,6 @@ import { ExternalRouteRef } from '@backstage/frontend-plugin-api';
|
||||
import { PortableSchema } from '@backstage/frontend-plugin-api';
|
||||
import { RouteRef } from '@backstage/frontend-plugin-api';
|
||||
import { TranslationRef } from '@backstage/core-plugin-api/alpha';
|
||||
import { ZodObject } from 'zod';
|
||||
|
||||
// Warning: (ae-missing-release-tag) "catalogAboutEntityCard" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export const catalogAboutEntityCard: ExtensionDefinition<
|
||||
{
|
||||
filter?: string | undefined;
|
||||
},
|
||||
ZodObject<any, any, any, any, any>
|
||||
>;
|
||||
|
||||
// Warning: (ae-missing-release-tag) "catalogLinksEntityCard" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export const catalogLinksEntityCard: ExtensionDefinition<
|
||||
{
|
||||
filter?: string | undefined;
|
||||
},
|
||||
ZodObject<any, any, any, any, any>
|
||||
>;
|
||||
|
||||
// Warning: (ae-missing-release-tag) "catalogOverviewEntityContent" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export const catalogOverviewEntityContent: ExtensionDefinition<
|
||||
{
|
||||
title: string;
|
||||
path: string;
|
||||
filter?: string | undefined;
|
||||
},
|
||||
ZodObject<any, any, any, any, any>
|
||||
>;
|
||||
|
||||
// @alpha (undocumented)
|
||||
export const catalogTranslationRef: TranslationRef<
|
||||
@@ -139,7 +106,7 @@ export function createCatalogFilterExtension<
|
||||
inputs?: TInputs;
|
||||
configSchema?: PortableSchema<TConfig>;
|
||||
loader: (options: { config: TConfig }) => Promise<JSX.Element>;
|
||||
}): ExtensionDefinition<TConfig, ZodObject<any, any, any, any, any>>;
|
||||
}): ExtensionDefinition<TConfig>;
|
||||
|
||||
// @alpha (undocumented)
|
||||
const _default: BackstagePlugin<
|
||||
|
||||
@@ -16,5 +16,3 @@
|
||||
|
||||
export { default } from './plugin';
|
||||
export { createCatalogFilterExtension } from './createCatalogFilterExtension';
|
||||
export { catalogAboutEntityCard, catalogLinksEntityCard } from './entityCards';
|
||||
export { catalogOverviewEntityContent } from './entityContents';
|
||||
|
||||
@@ -11,7 +11,6 @@ import { ListItemProps } from '@material-ui/core/ListItem';
|
||||
import { PortableSchema } from '@backstage/frontend-plugin-api';
|
||||
import { SearchDocument } from '@backstage/plugin-search-common';
|
||||
import { SearchResult } from '@backstage/plugin-search-common';
|
||||
import { ZodObject } from 'zod';
|
||||
|
||||
// @alpha (undocumented)
|
||||
export type BaseSearchResultListItemProps<T = {}> = T & {
|
||||
@@ -26,7 +25,7 @@ export function createSearchResultListItemExtension<
|
||||
},
|
||||
>(
|
||||
options: SearchResultItemExtensionOptions<TConfig>,
|
||||
): ExtensionDefinition<TConfig, ZodObject<any, any, any, any, any>>;
|
||||
): ExtensionDefinition<TConfig>;
|
||||
|
||||
// @alpha (undocumented)
|
||||
export namespace createSearchResultListItemExtension {
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
import { BackstagePlugin } from '@backstage/frontend-plugin-api';
|
||||
import { ExtensionDefinition } from '@backstage/frontend-plugin-api';
|
||||
import { RouteRef } from '@backstage/frontend-plugin-api';
|
||||
import { ZodObject } from 'zod';
|
||||
|
||||
// @alpha (undocumented)
|
||||
const _default: BackstagePlugin<
|
||||
@@ -18,27 +17,18 @@ const _default: BackstagePlugin<
|
||||
export default _default;
|
||||
|
||||
// @alpha (undocumented)
|
||||
export const searchApi: ExtensionDefinition<
|
||||
{},
|
||||
ZodObject<any, any, any, any, any>
|
||||
>;
|
||||
export const searchApi: ExtensionDefinition<{}>;
|
||||
|
||||
// @alpha (undocumented)
|
||||
export const searchNavItem: ExtensionDefinition<
|
||||
{
|
||||
title: string;
|
||||
},
|
||||
ZodObject<any, any, any, any, any>
|
||||
>;
|
||||
export const searchNavItem: ExtensionDefinition<{
|
||||
title: string;
|
||||
}>;
|
||||
|
||||
// @alpha (undocumented)
|
||||
export const searchPage: ExtensionDefinition<
|
||||
{
|
||||
path: string;
|
||||
noTrack: boolean;
|
||||
},
|
||||
any
|
||||
>;
|
||||
export const searchPage: ExtensionDefinition<{
|
||||
path: string;
|
||||
noTrack: boolean;
|
||||
}>;
|
||||
|
||||
// (No @packageDocumentation comment for this package)
|
||||
```
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
import { BackstagePlugin } from '@backstage/frontend-plugin-api';
|
||||
import { ExtensionDefinition } from '@backstage/frontend-plugin-api';
|
||||
import { RouteRef } from '@backstage/frontend-plugin-api';
|
||||
import { ZodObject } from 'zod';
|
||||
|
||||
// @alpha (undocumented)
|
||||
const _default: BackstagePlugin<
|
||||
@@ -24,16 +23,13 @@ const _default: BackstagePlugin<
|
||||
export default _default;
|
||||
|
||||
// @alpha (undocumented)
|
||||
export const techDocsSearchResultListItemExtension: ExtensionDefinition<
|
||||
{
|
||||
lineClamp: number;
|
||||
noTrack: boolean;
|
||||
asListItem: boolean;
|
||||
asLink: boolean;
|
||||
title?: string | undefined;
|
||||
},
|
||||
ZodObject<any, any, any, any, any>
|
||||
>;
|
||||
export const techDocsSearchResultListItemExtension: ExtensionDefinition<{
|
||||
lineClamp: number;
|
||||
noTrack: boolean;
|
||||
asListItem: boolean;
|
||||
asLink: boolean;
|
||||
title?: string | undefined;
|
||||
}>;
|
||||
|
||||
// (No @packageDocumentation comment for this package)
|
||||
```
|
||||
|
||||
@@ -7,7 +7,6 @@ import { BackstagePlugin } from '@backstage/frontend-plugin-api';
|
||||
import { ExtensionDefinition } from '@backstage/frontend-plugin-api';
|
||||
import { RouteRef } from '@backstage/frontend-plugin-api';
|
||||
import { TranslationRef } from '@backstage/core-plugin-api/alpha';
|
||||
import { ZodObject } from 'zod';
|
||||
|
||||
// @alpha (undocumented)
|
||||
const _default: BackstagePlugin<
|
||||
@@ -19,12 +18,9 @@ const _default: BackstagePlugin<
|
||||
export default _default;
|
||||
|
||||
// @alpha (undocumented)
|
||||
export const settingsNavItem: ExtensionDefinition<
|
||||
{
|
||||
title: string;
|
||||
},
|
||||
ZodObject<any, any, any, any, any>
|
||||
>;
|
||||
export const settingsNavItem: ExtensionDefinition<{
|
||||
title: string;
|
||||
}>;
|
||||
|
||||
// @alpha (undocumented)
|
||||
export const userSettingsTranslationRef: TranslationRef<
|
||||
|
||||
Reference in New Issue
Block a user