catalog-client: reuse EntityFilterQuery
Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
This commit is contained in:
@@ -159,12 +159,6 @@ export interface CatalogRequestOptions {
|
||||
token?: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export type EntitiesFilter =
|
||||
| Record<string, string | symbol | (string | symbol)[]>[]
|
||||
| Record<string, string | symbol | (string | symbol)[]>
|
||||
| undefined;
|
||||
|
||||
// @public
|
||||
export const ENTITY_STATUS_CATALOG_PROCESSING_TYPE =
|
||||
'backstage.io/catalog-processing';
|
||||
@@ -235,7 +229,7 @@ export interface GetEntityAncestorsResponse {
|
||||
// @public
|
||||
export interface GetEntityFacetsRequest {
|
||||
facets: string[];
|
||||
filter?: EntitiesFilter;
|
||||
filter?: EntityFilterQuery;
|
||||
}
|
||||
|
||||
// @public
|
||||
@@ -261,7 +255,7 @@ export type GetPaginatedEntitiesInitialRequest =
|
||||
| {
|
||||
fields?: string[];
|
||||
limit?: number;
|
||||
filter?: EntitiesFilter;
|
||||
filter?: EntityFilterQuery;
|
||||
sortFields?: EntityOrderQuery;
|
||||
query?: string;
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ import {
|
||||
GetEntitiesByRefsResponse,
|
||||
GetPaginatedEntitiesRequest,
|
||||
GetPaginatedEntitiesResponse,
|
||||
EntitiesFilter,
|
||||
EntityFilterQuery,
|
||||
GetPaginatedEntitiesCursorRequest,
|
||||
} from './types/api';
|
||||
import { DiscoveryApi } from './types/discovery';
|
||||
@@ -522,7 +522,7 @@ export class CatalogClient implements CatalogApi {
|
||||
return await response.json();
|
||||
}
|
||||
|
||||
private getParams(filter: EntitiesFilter = []) {
|
||||
private getParams(filter: EntityFilterQuery = []) {
|
||||
const params: string[] = [];
|
||||
// filter param can occur multiple times, for example
|
||||
// /api/catalog/entities?filter=metadata.name=wayback-search,kind=component&filter=metadata.name=www-artist,kind=component'
|
||||
|
||||
@@ -287,7 +287,7 @@ export interface GetEntityFacetsRequest {
|
||||
* (exported from this package), which means that you assert on the existence
|
||||
* of that key, no matter what its value is.
|
||||
*/
|
||||
filter?: EntitiesFilter;
|
||||
filter?: EntityFilterQuery;
|
||||
/**
|
||||
* Dot separated paths for the facets to extract from each entity.
|
||||
*
|
||||
@@ -356,16 +356,6 @@ export type AddLocationRequest = {
|
||||
dryRun?: boolean;
|
||||
};
|
||||
|
||||
/**
|
||||
* Used for filtering entities that match the given patterns.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export type EntitiesFilter =
|
||||
| Record<string, string | symbol | (string | symbol)[]>[]
|
||||
| Record<string, string | symbol | (string | symbol)[]>
|
||||
| undefined;
|
||||
|
||||
/**
|
||||
* The response type for {@link CatalogClient.addLocation}.
|
||||
*
|
||||
@@ -410,7 +400,7 @@ export type GetPaginatedEntitiesInitialRequest =
|
||||
| {
|
||||
fields?: string[];
|
||||
limit?: number;
|
||||
filter?: EntitiesFilter;
|
||||
filter?: EntityFilterQuery;
|
||||
sortFields?: EntityOrderQuery;
|
||||
query?: string;
|
||||
}
|
||||
|
||||
@@ -25,7 +25,6 @@ export type {
|
||||
EntityOrderQuery,
|
||||
GetEntitiesByRefsRequest,
|
||||
GetEntitiesByRefsResponse,
|
||||
EntitiesFilter,
|
||||
GetEntitiesRequest,
|
||||
GetEntitiesResponse,
|
||||
GetEntityAncestorsRequest,
|
||||
|
||||
Reference in New Issue
Block a user