diff --git a/plugins/api-docs/report-alpha.api.md b/plugins/api-docs/report-alpha.api.md index 78e8b9442b..73c1fc3ae9 100644 --- a/plugins/api-docs/report-alpha.api.md +++ b/plugins/api-docs/report-alpha.api.md @@ -9,6 +9,7 @@ import { AnyRouteRefParams } from '@backstage/frontend-plugin-api'; import { ConfigurableExtensionDataRef } from '@backstage/frontend-plugin-api'; import { Entity } from '@backstage/catalog-model'; import { EntityCardType } from '@backstage/plugin-catalog-react/alpha'; +import { EntityPredicate } from '@backstage/plugin-catalog-react/alpha'; import { ExtensionDefinition } from '@backstage/frontend-plugin-api'; import { ExtensionInput } from '@backstage/frontend-plugin-api'; import { ExternalRouteRef } from '@backstage/frontend-plugin-api'; @@ -45,11 +46,11 @@ const _default: FrontendPlugin< kind: 'entity-card'; name: 'consumed-apis'; config: { - filter: string | undefined; + filter: EntityPredicate | undefined; type: 'full' | 'info' | 'peek' | undefined; }; configInput: { - filter?: string | undefined; + filter?: EntityPredicate | undefined; type?: 'full' | 'info' | 'peek' | undefined; }; output: @@ -82,7 +83,7 @@ const _default: FrontendPlugin< inputs: {}; params: { loader: () => Promise; - filter?: string | ((entity: Entity) => boolean) | undefined; + filter?: EntityPredicate | ((entity: Entity) => boolean) | undefined; type?: EntityCardType | undefined; }; }>; @@ -90,11 +91,11 @@ const _default: FrontendPlugin< kind: 'entity-card'; name: 'consuming-components'; config: { - filter: string | undefined; + filter: EntityPredicate | undefined; type: 'full' | 'info' | 'peek' | undefined; }; configInput: { - filter?: string | undefined; + filter?: EntityPredicate | undefined; type?: 'full' | 'info' | 'peek' | undefined; }; output: @@ -127,7 +128,7 @@ const _default: FrontendPlugin< inputs: {}; params: { loader: () => Promise; - filter?: string | ((entity: Entity) => boolean) | undefined; + filter?: EntityPredicate | ((entity: Entity) => boolean) | undefined; type?: EntityCardType | undefined; }; }>; @@ -135,11 +136,11 @@ const _default: FrontendPlugin< kind: 'entity-card'; name: 'definition'; config: { - filter: string | undefined; + filter: EntityPredicate | undefined; type: 'full' | 'info' | 'peek' | undefined; }; configInput: { - filter?: string | undefined; + filter?: EntityPredicate | undefined; type?: 'full' | 'info' | 'peek' | undefined; }; output: @@ -172,7 +173,7 @@ const _default: FrontendPlugin< inputs: {}; params: { loader: () => Promise; - filter?: string | ((entity: Entity) => boolean) | undefined; + filter?: EntityPredicate | ((entity: Entity) => boolean) | undefined; type?: EntityCardType | undefined; }; }>; @@ -180,11 +181,11 @@ const _default: FrontendPlugin< kind: 'entity-card'; name: 'has-apis'; config: { - filter: string | undefined; + filter: EntityPredicate | undefined; type: 'full' | 'info' | 'peek' | undefined; }; configInput: { - filter?: string | undefined; + filter?: EntityPredicate | undefined; type?: 'full' | 'info' | 'peek' | undefined; }; output: @@ -217,7 +218,7 @@ const _default: FrontendPlugin< inputs: {}; params: { loader: () => Promise; - filter?: string | ((entity: Entity) => boolean) | undefined; + filter?: EntityPredicate | ((entity: Entity) => boolean) | undefined; type?: EntityCardType | undefined; }; }>; @@ -225,11 +226,11 @@ const _default: FrontendPlugin< kind: 'entity-card'; name: 'provided-apis'; config: { - filter: string | undefined; + filter: EntityPredicate | undefined; type: 'full' | 'info' | 'peek' | undefined; }; configInput: { - filter?: string | undefined; + filter?: EntityPredicate | undefined; type?: 'full' | 'info' | 'peek' | undefined; }; output: @@ -262,7 +263,7 @@ const _default: FrontendPlugin< inputs: {}; params: { loader: () => Promise; - filter?: string | ((entity: Entity) => boolean) | undefined; + filter?: EntityPredicate | ((entity: Entity) => boolean) | undefined; type?: EntityCardType | undefined; }; }>; @@ -270,11 +271,11 @@ const _default: FrontendPlugin< kind: 'entity-card'; name: 'providing-components'; config: { - filter: string | undefined; + filter: EntityPredicate | undefined; type: 'full' | 'info' | 'peek' | undefined; }; configInput: { - filter?: string | undefined; + filter?: EntityPredicate | undefined; type?: 'full' | 'info' | 'peek' | undefined; }; output: @@ -307,7 +308,7 @@ const _default: FrontendPlugin< inputs: {}; params: { loader: () => Promise; - filter?: string | ((entity: Entity) => boolean) | undefined; + filter?: EntityPredicate | ((entity: Entity) => boolean) | undefined; type?: EntityCardType | undefined; }; }>; @@ -317,11 +318,11 @@ const _default: FrontendPlugin< config: { path: string | undefined; title: string | undefined; - filter: string | undefined; + filter: EntityPredicate | undefined; group: string | false | undefined; }; configInput: { - filter?: string | undefined; + filter?: EntityPredicate | undefined; title?: string | undefined; path?: string | undefined; group?: string | false | undefined; @@ -379,7 +380,7 @@ const _default: FrontendPlugin< | 'observability' | undefined; routeRef?: RouteRef | undefined; - filter?: string | ((entity: Entity) => boolean) | undefined; + filter?: EntityPredicate | ((entity: Entity) => boolean) | undefined; }; }>; 'entity-content:api-docs/definition': ExtensionDefinition<{ @@ -388,11 +389,11 @@ const _default: FrontendPlugin< config: { path: string | undefined; title: string | undefined; - filter: string | undefined; + filter: EntityPredicate | undefined; group: string | false | undefined; }; configInput: { - filter?: string | undefined; + filter?: EntityPredicate | undefined; title?: string | undefined; path?: string | undefined; group?: string | false | undefined; @@ -450,7 +451,7 @@ const _default: FrontendPlugin< | 'observability' | undefined; routeRef?: RouteRef | undefined; - filter?: string | ((entity: Entity) => boolean) | undefined; + filter?: EntityPredicate | ((entity: Entity) => boolean) | undefined; }; }>; 'nav-item:api-docs': ExtensionDefinition<{ diff --git a/plugins/catalog-graph/report-alpha.api.md b/plugins/catalog-graph/report-alpha.api.md index 9cdd5c3f01..fcc9265cb4 100644 --- a/plugins/catalog-graph/report-alpha.api.md +++ b/plugins/catalog-graph/report-alpha.api.md @@ -9,6 +9,7 @@ import { ConfigurableExtensionDataRef } from '@backstage/frontend-plugin-api'; import { Direction } from '@backstage/plugin-catalog-graph'; import { Entity } from '@backstage/catalog-model'; import { EntityCardType } from '@backstage/plugin-catalog-react/alpha'; +import { EntityPredicate } from '@backstage/plugin-catalog-react/alpha'; import { ExtensionDefinition } from '@backstage/frontend-plugin-api'; import { ExtensionInput } from '@backstage/frontend-plugin-api'; import { ExternalRouteRef } from '@backstage/frontend-plugin-api'; @@ -43,7 +44,7 @@ const _default: FrontendPlugin< title: string | undefined; height: number | undefined; } & { - filter: string | undefined; + filter: EntityPredicate | undefined; type: 'full' | 'info' | 'peek' | undefined; }; configInput: { @@ -59,7 +60,7 @@ const _default: FrontendPlugin< mergeRelations?: boolean | undefined; relationPairs?: [string, string][] | undefined; } & { - filter?: string | undefined; + filter?: EntityPredicate | undefined; type?: 'full' | 'info' | 'peek' | undefined; }; output: @@ -102,7 +103,7 @@ const _default: FrontendPlugin< name: 'relations'; params: { loader: () => Promise; - filter?: string | ((entity: Entity) => boolean) | undefined; + filter?: EntityPredicate | ((entity: Entity) => boolean) | undefined; type?: EntityCardType | undefined; }; }>; diff --git a/plugins/catalog-react/report-alpha.api.md b/plugins/catalog-react/report-alpha.api.md index 02fac5f75a..1619bc6a3d 100644 --- a/plugins/catalog-react/report-alpha.api.md +++ b/plugins/catalog-react/report-alpha.api.md @@ -11,6 +11,7 @@ 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 { JsonValue } from '@backstage/types'; import { JSX as JSX_2 } from 'react'; import { default as React_2 } from 'react'; import { ResourcePermission } from '@backstage/plugin-permission-common'; @@ -80,9 +81,7 @@ export function convertLegacyEntityCardExtension( LegacyExtension: ComponentType<{}>, overrides?: { name?: string; - filter?: - | typeof EntityCardBlueprint.dataRefs.filterFunction.T - | typeof EntityCardBlueprint.dataRefs.filterExpression.T; + filter?: string | EntityPredicate | ((entity: Entity) => boolean); }, ): ExtensionDefinition; @@ -91,9 +90,7 @@ export function convertLegacyEntityContentExtension( LegacyExtension: ComponentType<{}>, overrides?: { name?: string; - filter?: - | typeof EntityContentBlueprint.dataRefs.filterFunction.T - | typeof EntityContentBlueprint.dataRefs.filterExpression.T; + filter?: string | EntityPredicate | ((entity: Entity) => boolean); defaultPath?: string; defaultTitle?: string; }, @@ -113,7 +110,7 @@ export const EntityCardBlueprint: ExtensionBlueprint<{ name: undefined; params: { loader: () => Promise; - filter?: string | ((entity: Entity) => boolean) | undefined; + filter?: EntityPredicate | ((entity: Entity) => boolean) | undefined; type?: EntityCardType | undefined; }; output: @@ -141,11 +138,11 @@ export const EntityCardBlueprint: ExtensionBlueprint<{ >; inputs: {}; config: { - filter: string | undefined; + filter: EntityPredicate | undefined; type: 'full' | 'info' | 'peek' | undefined; }; configInput: { - filter?: string | undefined; + filter?: EntityPredicate | undefined; type?: 'full' | 'info' | 'peek' | undefined; }; dataRefs: { @@ -186,7 +183,7 @@ export const EntityContentBlueprint: ExtensionBlueprint<{ | 'observability' | undefined; routeRef?: RouteRef | undefined; - filter?: string | ((entity: Entity) => boolean) | undefined; + filter?: EntityPredicate | ((entity: Entity) => boolean) | undefined; }; output: | ConfigurableExtensionDataRef @@ -224,11 +221,11 @@ export const EntityContentBlueprint: ExtensionBlueprint<{ config: { path: string | undefined; title: string | undefined; - filter: string | undefined; + filter: EntityPredicate | undefined; group: string | false | undefined; }; configInput: { - filter?: string | undefined; + filter?: EntityPredicate | undefined; title?: string | undefined; path?: string | undefined; group?: string | false | undefined; @@ -262,7 +259,7 @@ export const EntityContentLayoutBlueprint: ExtensionBlueprint<{ kind: 'entity-content-layout'; name: undefined; params: { - filter?: string | ((entity: Entity) => boolean) | undefined; + filter?: EntityPredicate | ((entity: Entity) => boolean) | undefined; loader: () => Promise< (props: EntityContentLayoutProps) => React_2.JSX.Element >; @@ -290,10 +287,10 @@ export const EntityContentLayoutBlueprint: ExtensionBlueprint<{ inputs: {}; config: { type: string | undefined; - filter: string | undefined; + filter: EntityPredicate | undefined; }; configInput: { - filter?: string | undefined; + filter?: EntityPredicate | undefined; type?: string | undefined; }; dataRefs: { @@ -324,6 +321,54 @@ export interface EntityContentLayoutProps { }>; } +// @alpha (undocumented) +export type EntityPredicate = + | EntityPredicateExpression + | EntityPredicatePrimitive + | { + $all: EntityPredicate[]; + } + | { + $any: EntityPredicate[]; + } + | { + $not: EntityPredicate; + }; + +// @alpha (undocumented) +export type EntityPredicateExpression = { + [KPath in string]: EntityPredicateValue; +} & { + [KPath in `$${string}`]: never; +}; + +// @alpha (undocumented) +export type EntityPredicatePrimitive = string | number | boolean; + +// @alpha +export function entityPredicateToFilterFunction( + entityPredicate: EntityPredicate, +): (value: T) => boolean; + +// @alpha (undocumented) +export type EntityPredicateValue = + | EntityPredicatePrimitive + | { + $exists: boolean; + } + | { + $in: EntityPredicatePrimitive[]; + } + | { + $contains: EntityPredicateExpression; + }; + +// @alpha +export function evaluateEntityPredicate( + filter: EntityPredicate, + value: JsonValue, +): boolean; + // @alpha export function isOwnerOf(owner: Entity, entity: Entity): boolean; diff --git a/plugins/catalog-react/src/alpha/blueprints/EntityCardBlueprint.ts b/plugins/catalog-react/src/alpha/blueprints/EntityCardBlueprint.ts index 4639a8863f..b2f64c19e6 100644 --- a/plugins/catalog-react/src/alpha/blueprints/EntityCardBlueprint.ts +++ b/plugins/catalog-react/src/alpha/blueprints/EntityCardBlueprint.ts @@ -29,6 +29,7 @@ import { import { createEntityPredicateSchema } from '../predicates/createEntityPredicateSchema'; import { EntityPredicate } from '../predicates'; import { resolveEntityFilterData } from './resolveEntityFilterData'; +import { Entity } from '@backstage/catalog-model'; /** * @alpha @@ -62,7 +63,7 @@ export const EntityCardBlueprint = createExtensionBlueprint({ type, }: { loader: () => Promise; - filter?: EntityPredicate | typeof entityFilterFunctionDataRef.T; + filter?: string | EntityPredicate | ((entity: Entity) => boolean); type?: EntityCardType; }, { node, config }, diff --git a/plugins/catalog-react/src/alpha/blueprints/EntityContentBlueprint.ts b/plugins/catalog-react/src/alpha/blueprints/EntityContentBlueprint.ts index 9c67f3c0bc..dbfb11092a 100644 --- a/plugins/catalog-react/src/alpha/blueprints/EntityContentBlueprint.ts +++ b/plugins/catalog-react/src/alpha/blueprints/EntityContentBlueprint.ts @@ -30,6 +30,7 @@ import { import { EntityPredicate } from '../predicates'; import { resolveEntityFilterData } from './resolveEntityFilterData'; import { createEntityPredicateSchema } from '../predicates/createEntityPredicateSchema'; +import { Entity } from '@backstage/catalog-model'; /** * @alpha @@ -76,7 +77,7 @@ export const EntityContentBlueprint = createExtensionBlueprint({ defaultTitle: string; defaultGroup?: keyof typeof defaultEntityContentGroups | (string & {}); routeRef?: RouteRef; - filter?: string | EntityPredicate | typeof entityFilterFunctionDataRef.T; + filter?: string | EntityPredicate | ((entity: Entity) => boolean); }, { node, config }, ) { diff --git a/plugins/catalog-react/src/alpha/blueprints/EntityContentLayoutBlueprint.tsx b/plugins/catalog-react/src/alpha/blueprints/EntityContentLayoutBlueprint.tsx index a6a90eee06..033b0f2187 100644 --- a/plugins/catalog-react/src/alpha/blueprints/EntityContentLayoutBlueprint.tsx +++ b/plugins/catalog-react/src/alpha/blueprints/EntityContentLayoutBlueprint.tsx @@ -28,6 +28,7 @@ import React from 'react'; import { EntityPredicate } from '../predicates'; import { resolveEntityFilterData } from './resolveEntityFilterData'; import { createEntityPredicateSchema } from '../predicates/createEntityPredicateSchema'; +import { Entity } from '@backstage/catalog-model'; /** @alpha */ export interface EntityContentLayoutProps { @@ -69,7 +70,7 @@ export const EntityContentLayoutBlueprint = createExtensionBlueprint({ loader, filter, }: { - filter?: string | EntityPredicate | typeof entityFilterFunctionDataRef.T; + filter?: string | EntityPredicate | ((entity: Entity) => boolean); loader: () => Promise< (props: EntityContentLayoutProps) => React.JSX.Element >; diff --git a/plugins/catalog-react/src/alpha/converters/convertLegacyEntityCardExtension.tsx b/plugins/catalog-react/src/alpha/converters/convertLegacyEntityCardExtension.tsx index ed92461736..3c76e6b8d6 100644 --- a/plugins/catalog-react/src/alpha/converters/convertLegacyEntityCardExtension.tsx +++ b/plugins/catalog-react/src/alpha/converters/convertLegacyEntityCardExtension.tsx @@ -20,15 +20,15 @@ import { ExtensionDefinition } from '@backstage/frontend-plugin-api'; import React, { ComponentType } from 'react'; import { EntityCardBlueprint } from '../blueprints'; import kebabCase from 'lodash/kebabCase'; +import { EntityPredicate } from '../predicates'; +import { Entity } from '@backstage/catalog-model'; /** @alpha */ export function convertLegacyEntityCardExtension( LegacyExtension: ComponentType<{}>, overrides?: { name?: string; - filter?: - | typeof EntityCardBlueprint.dataRefs.filterFunction.T - | typeof EntityCardBlueprint.dataRefs.filterExpression.T; + filter?: string | EntityPredicate | ((entity: Entity) => boolean); }, ): ExtensionDefinition { const element = ; diff --git a/plugins/catalog-react/src/alpha/converters/convertLegacyEntityContentExtension.tsx b/plugins/catalog-react/src/alpha/converters/convertLegacyEntityContentExtension.tsx index 02f5d104bc..2f106a20e1 100644 --- a/plugins/catalog-react/src/alpha/converters/convertLegacyEntityContentExtension.tsx +++ b/plugins/catalog-react/src/alpha/converters/convertLegacyEntityContentExtension.tsx @@ -28,15 +28,15 @@ import kebabCase from 'lodash/kebabCase'; import startCase from 'lodash/startCase'; import React, { ComponentType } from 'react'; import { EntityContentBlueprint } from '../blueprints'; +import { EntityPredicate } from '../predicates'; +import { Entity } from '@backstage/catalog-model'; /** @alpha */ export function convertLegacyEntityContentExtension( LegacyExtension: ComponentType<{}>, overrides?: { name?: string; - filter?: - | typeof EntityContentBlueprint.dataRefs.filterFunction.T - | typeof EntityContentBlueprint.dataRefs.filterExpression.T; + filter?: string | EntityPredicate | ((entity: Entity) => boolean); defaultPath?: string; defaultTitle?: string; }, diff --git a/plugins/catalog-react/src/alpha/predicates/evaluateEntityPredicate.ts b/plugins/catalog-react/src/alpha/predicates/evaluateEntityPredicate.ts index cf33457376..84fbfa3499 100644 --- a/plugins/catalog-react/src/alpha/predicates/evaluateEntityPredicate.ts +++ b/plugins/catalog-react/src/alpha/predicates/evaluateEntityPredicate.ts @@ -24,6 +24,7 @@ import { valueAtPath } from './valueAtPath'; /** * Convert an entity predicate to a filter function that can be used to filter entities. + * @alpha */ export function entityPredicateToFilterFunction( entityPredicate: EntityPredicate, diff --git a/plugins/catalog/report-alpha.api.md b/plugins/catalog/report-alpha.api.md index 4961e2e9fb..3732f3355a 100644 --- a/plugins/catalog/report-alpha.api.md +++ b/plugins/catalog/report-alpha.api.md @@ -12,6 +12,7 @@ import { ConfigurableExtensionDataRef } from '@backstage/frontend-plugin-api'; import { Entity } from '@backstage/catalog-model'; import { EntityCardType } from '@backstage/plugin-catalog-react/alpha'; import { EntityContentLayoutProps } from '@backstage/plugin-catalog-react/alpha'; +import { EntityPredicate } from '@backstage/plugin-catalog-react/alpha'; import { ExtensionBlueprint } from '@backstage/frontend-plugin-api'; import { ExtensionDefinition } from '@backstage/frontend-plugin-api'; import { ExtensionInput } from '@backstage/frontend-plugin-api'; @@ -353,11 +354,11 @@ const _default: FrontendPlugin< kind: 'entity-card'; name: 'about'; config: { - filter: string | undefined; + filter: EntityPredicate | undefined; type: 'full' | 'info' | 'peek' | undefined; }; configInput: { - filter?: string | undefined; + filter?: EntityPredicate | undefined; type?: 'full' | 'info' | 'peek' | undefined; }; output: @@ -386,7 +387,7 @@ const _default: FrontendPlugin< inputs: {}; params: { loader: () => Promise; - filter?: string | ((entity: Entity) => boolean) | undefined; + filter?: EntityPredicate | ((entity: Entity) => boolean) | undefined; type?: EntityCardType | undefined; }; }>; @@ -394,11 +395,11 @@ const _default: FrontendPlugin< kind: 'entity-card'; name: 'depends-on-components'; config: { - filter: string | undefined; + filter: EntityPredicate | undefined; type: 'full' | 'info' | 'peek' | undefined; }; configInput: { - filter?: string | undefined; + filter?: EntityPredicate | undefined; type?: 'full' | 'info' | 'peek' | undefined; }; output: @@ -427,7 +428,7 @@ const _default: FrontendPlugin< inputs: {}; params: { loader: () => Promise; - filter?: string | ((entity: Entity) => boolean) | undefined; + filter?: EntityPredicate | ((entity: Entity) => boolean) | undefined; type?: EntityCardType | undefined; }; }>; @@ -435,11 +436,11 @@ const _default: FrontendPlugin< kind: 'entity-card'; name: 'depends-on-resources'; config: { - filter: string | undefined; + filter: EntityPredicate | undefined; type: 'full' | 'info' | 'peek' | undefined; }; configInput: { - filter?: string | undefined; + filter?: EntityPredicate | undefined; type?: 'full' | 'info' | 'peek' | undefined; }; output: @@ -468,7 +469,7 @@ const _default: FrontendPlugin< inputs: {}; params: { loader: () => Promise; - filter?: string | ((entity: Entity) => boolean) | undefined; + filter?: EntityPredicate | ((entity: Entity) => boolean) | undefined; type?: EntityCardType | undefined; }; }>; @@ -476,11 +477,11 @@ const _default: FrontendPlugin< kind: 'entity-card'; name: 'has-components'; config: { - filter: string | undefined; + filter: EntityPredicate | undefined; type: 'full' | 'info' | 'peek' | undefined; }; configInput: { - filter?: string | undefined; + filter?: EntityPredicate | undefined; type?: 'full' | 'info' | 'peek' | undefined; }; output: @@ -509,7 +510,7 @@ const _default: FrontendPlugin< inputs: {}; params: { loader: () => Promise; - filter?: string | ((entity: Entity) => boolean) | undefined; + filter?: EntityPredicate | ((entity: Entity) => boolean) | undefined; type?: EntityCardType | undefined; }; }>; @@ -517,11 +518,11 @@ const _default: FrontendPlugin< kind: 'entity-card'; name: 'has-resources'; config: { - filter: string | undefined; + filter: EntityPredicate | undefined; type: 'full' | 'info' | 'peek' | undefined; }; configInput: { - filter?: string | undefined; + filter?: EntityPredicate | undefined; type?: 'full' | 'info' | 'peek' | undefined; }; output: @@ -550,7 +551,7 @@ const _default: FrontendPlugin< inputs: {}; params: { loader: () => Promise; - filter?: string | ((entity: Entity) => boolean) | undefined; + filter?: EntityPredicate | ((entity: Entity) => boolean) | undefined; type?: EntityCardType | undefined; }; }>; @@ -558,11 +559,11 @@ const _default: FrontendPlugin< kind: 'entity-card'; name: 'has-subcomponents'; config: { - filter: string | undefined; + filter: EntityPredicate | undefined; type: 'full' | 'info' | 'peek' | undefined; }; configInput: { - filter?: string | undefined; + filter?: EntityPredicate | undefined; type?: 'full' | 'info' | 'peek' | undefined; }; output: @@ -591,7 +592,7 @@ const _default: FrontendPlugin< inputs: {}; params: { loader: () => Promise; - filter?: string | ((entity: Entity) => boolean) | undefined; + filter?: EntityPredicate | ((entity: Entity) => boolean) | undefined; type?: EntityCardType | undefined; }; }>; @@ -599,11 +600,11 @@ const _default: FrontendPlugin< kind: 'entity-card'; name: 'has-subdomains'; config: { - filter: string | undefined; + filter: EntityPredicate | undefined; type: 'full' | 'info' | 'peek' | undefined; }; configInput: { - filter?: string | undefined; + filter?: EntityPredicate | undefined; type?: 'full' | 'info' | 'peek' | undefined; }; output: @@ -632,7 +633,7 @@ const _default: FrontendPlugin< inputs: {}; params: { loader: () => Promise; - filter?: string | ((entity: Entity) => boolean) | undefined; + filter?: EntityPredicate | ((entity: Entity) => boolean) | undefined; type?: EntityCardType | undefined; }; }>; @@ -640,11 +641,11 @@ const _default: FrontendPlugin< kind: 'entity-card'; name: 'has-systems'; config: { - filter: string | undefined; + filter: EntityPredicate | undefined; type: 'full' | 'info' | 'peek' | undefined; }; configInput: { - filter?: string | undefined; + filter?: EntityPredicate | undefined; type?: 'full' | 'info' | 'peek' | undefined; }; output: @@ -673,7 +674,7 @@ const _default: FrontendPlugin< inputs: {}; params: { loader: () => Promise; - filter?: string | ((entity: Entity) => boolean) | undefined; + filter?: EntityPredicate | ((entity: Entity) => boolean) | undefined; type?: EntityCardType | undefined; }; }>; @@ -681,11 +682,11 @@ const _default: FrontendPlugin< kind: 'entity-card'; name: 'labels'; config: { - filter: string | undefined; + filter: EntityPredicate | undefined; type: 'full' | 'info' | 'peek' | undefined; }; configInput: { - filter?: string | undefined; + filter?: EntityPredicate | undefined; type?: 'full' | 'info' | 'peek' | undefined; }; output: @@ -714,7 +715,7 @@ const _default: FrontendPlugin< inputs: {}; params: { loader: () => Promise; - filter?: string | ((entity: Entity) => boolean) | undefined; + filter?: EntityPredicate | ((entity: Entity) => boolean) | undefined; type?: EntityCardType | undefined; }; }>; @@ -722,11 +723,11 @@ const _default: FrontendPlugin< kind: 'entity-card'; name: 'links'; config: { - filter: string | undefined; + filter: EntityPredicate | undefined; type: 'full' | 'info' | 'peek' | undefined; }; configInput: { - filter?: string | undefined; + filter?: EntityPredicate | undefined; type?: 'full' | 'info' | 'peek' | undefined; }; output: @@ -755,7 +756,7 @@ const _default: FrontendPlugin< inputs: {}; params: { loader: () => Promise; - filter?: string | ((entity: Entity) => boolean) | undefined; + filter?: EntityPredicate | ((entity: Entity) => boolean) | undefined; type?: EntityCardType | undefined; }; }>; @@ -763,11 +764,11 @@ const _default: FrontendPlugin< config: { path: string | undefined; title: string | undefined; - filter: string | undefined; + filter: EntityPredicate | undefined; group: string | false | undefined; }; configInput: { - filter?: string | undefined; + filter?: EntityPredicate | undefined; title?: string | undefined; path?: string | undefined; group?: string | false | undefined; @@ -877,7 +878,7 @@ const _default: FrontendPlugin< | 'observability' | undefined; routeRef?: RouteRef | undefined; - filter?: string | ((entity: Entity) => boolean) | undefined; + filter?: EntityPredicate | ((entity: Entity) => boolean) | undefined; }; }>; 'nav-item:catalog': ExtensionDefinition<{ diff --git a/plugins/kubernetes/report-alpha.api.md b/plugins/kubernetes/report-alpha.api.md index ef824bc435..0cca232bf6 100644 --- a/plugins/kubernetes/report-alpha.api.md +++ b/plugins/kubernetes/report-alpha.api.md @@ -9,6 +9,7 @@ import { AnyApiFactory } from '@backstage/frontend-plugin-api'; import { AnyRouteRefParams } from '@backstage/frontend-plugin-api'; import { ConfigurableExtensionDataRef } from '@backstage/frontend-plugin-api'; import { Entity } from '@backstage/catalog-model'; +import { EntityPredicate } from '@backstage/plugin-catalog-react/alpha'; import { ExtensionDefinition } from '@backstage/frontend-plugin-api'; import { FrontendPlugin } from '@backstage/frontend-plugin-api'; import { JSX as JSX_2 } from 'react'; @@ -88,11 +89,11 @@ const _default: FrontendPlugin< config: { path: string | undefined; title: string | undefined; - filter: string | undefined; + filter: EntityPredicate | undefined; group: string | false | undefined; }; configInput: { - filter?: string | undefined; + filter?: EntityPredicate | undefined; title?: string | undefined; path?: string | undefined; group?: string | false | undefined; @@ -146,7 +147,7 @@ const _default: FrontendPlugin< | 'observability' | undefined; routeRef?: RouteRef | undefined; - filter?: string | ((entity: Entity) => boolean) | undefined; + filter?: EntityPredicate | ((entity: Entity) => boolean) | undefined; }; }>; 'page:kubernetes': ExtensionDefinition<{ diff --git a/plugins/org/report-alpha.api.md b/plugins/org/report-alpha.api.md index eb5c41faa1..508c0ed04e 100644 --- a/plugins/org/report-alpha.api.md +++ b/plugins/org/report-alpha.api.md @@ -6,6 +6,7 @@ import { ConfigurableExtensionDataRef } from '@backstage/frontend-plugin-api'; import { Entity } from '@backstage/catalog-model'; import { EntityCardType } from '@backstage/plugin-catalog-react/alpha'; +import { EntityPredicate } from '@backstage/plugin-catalog-react/alpha'; import { ExtensionDefinition } from '@backstage/frontend-plugin-api'; import { ExternalRouteRef } from '@backstage/frontend-plugin-api'; import { FrontendPlugin } from '@backstage/frontend-plugin-api'; @@ -22,11 +23,11 @@ const _default: FrontendPlugin< kind: 'entity-card'; name: 'group-profile'; config: { - filter: string | undefined; + filter: EntityPredicate | undefined; type: 'full' | 'info' | 'peek' | undefined; }; configInput: { - filter?: string | undefined; + filter?: EntityPredicate | undefined; type?: 'full' | 'info' | 'peek' | undefined; }; output: @@ -59,7 +60,7 @@ const _default: FrontendPlugin< inputs: {}; params: { loader: () => Promise; - filter?: string | ((entity: Entity) => boolean) | undefined; + filter?: EntityPredicate | ((entity: Entity) => boolean) | undefined; type?: EntityCardType | undefined; }; }>; @@ -67,11 +68,11 @@ const _default: FrontendPlugin< kind: 'entity-card'; name: 'members-list'; config: { - filter: string | undefined; + filter: EntityPredicate | undefined; type: 'full' | 'info' | 'peek' | undefined; }; configInput: { - filter?: string | undefined; + filter?: EntityPredicate | undefined; type?: 'full' | 'info' | 'peek' | undefined; }; output: @@ -104,7 +105,7 @@ const _default: FrontendPlugin< inputs: {}; params: { loader: () => Promise; - filter?: string | ((entity: Entity) => boolean) | undefined; + filter?: EntityPredicate | ((entity: Entity) => boolean) | undefined; type?: EntityCardType | undefined; }; }>; @@ -112,11 +113,11 @@ const _default: FrontendPlugin< kind: 'entity-card'; name: 'ownership'; config: { - filter: string | undefined; + filter: EntityPredicate | undefined; type: 'full' | 'info' | 'peek' | undefined; }; configInput: { - filter?: string | undefined; + filter?: EntityPredicate | undefined; type?: 'full' | 'info' | 'peek' | undefined; }; output: @@ -149,7 +150,7 @@ const _default: FrontendPlugin< inputs: {}; params: { loader: () => Promise; - filter?: string | ((entity: Entity) => boolean) | undefined; + filter?: EntityPredicate | ((entity: Entity) => boolean) | undefined; type?: EntityCardType | undefined; }; }>; @@ -157,11 +158,11 @@ const _default: FrontendPlugin< kind: 'entity-card'; name: 'user-profile'; config: { - filter: string | undefined; + filter: EntityPredicate | undefined; type: 'full' | 'info' | 'peek' | undefined; }; configInput: { - filter?: string | undefined; + filter?: EntityPredicate | undefined; type?: 'full' | 'info' | 'peek' | undefined; }; output: @@ -194,7 +195,7 @@ const _default: FrontendPlugin< inputs: {}; params: { loader: () => Promise; - filter?: string | ((entity: Entity) => boolean) | undefined; + filter?: EntityPredicate | ((entity: Entity) => boolean) | undefined; type?: EntityCardType | undefined; }; }>; diff --git a/plugins/techdocs/report-alpha.api.md b/plugins/techdocs/report-alpha.api.md index 681961a33e..0dcca55c73 100644 --- a/plugins/techdocs/report-alpha.api.md +++ b/plugins/techdocs/report-alpha.api.md @@ -8,6 +8,7 @@ import { AnyExtensionDataRef } from '@backstage/frontend-plugin-api'; import { AnyRouteRefParams } from '@backstage/frontend-plugin-api'; import { ConfigurableExtensionDataRef } from '@backstage/frontend-plugin-api'; import { Entity } from '@backstage/catalog-model'; +import { EntityPredicate } from '@backstage/plugin-catalog-react/alpha'; import { ExtensionDefinition } from '@backstage/frontend-plugin-api'; import { ExtensionInput } from '@backstage/frontend-plugin-api'; import { FrontendPlugin } from '@backstage/frontend-plugin-api'; @@ -89,11 +90,11 @@ const _default: FrontendPlugin< config: { path: string | undefined; title: string | undefined; - filter: string | undefined; + filter: EntityPredicate | undefined; group: string | false | undefined; }; configInput: { - filter?: string | undefined; + filter?: EntityPredicate | undefined; title?: string | undefined; path?: string | undefined; group?: string | false | undefined; @@ -178,7 +179,7 @@ const _default: FrontendPlugin< | 'observability' | undefined; routeRef?: RouteRef | undefined; - filter?: string | ((entity: Entity) => boolean) | undefined; + filter?: EntityPredicate | ((entity: Entity) => boolean) | undefined; }; }>; 'nav-item:techdocs': ExtensionDefinition<{