Skip to content

Commit

Permalink
Update TS type names for EPR search results (#52512)
Browse files Browse the repository at this point in the history
 * `RegistryList -> RegistrySearchResults`
 * `RegistryListItem -> RegistrySearchResult`
  • Loading branch information
John Schulz authored Dec 9, 2019
1 parent 6f91887 commit f6239e7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions x-pack/legacy/plugins/epm/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ export interface ServiceRequirements {
// Registry's response types
// from /search
// https://github.com/elastic/package-registry/blob/master/docs/api/search.json
export type RegistryList = RegistryListItem[];
export type RegistrySearchResults = RegistrySearchResult[];
// from getPackageOutput at https://github.com/elastic/package-registry/blob/master/search.go
export type RegistryListItem = Pick<
export type RegistrySearchResult = Pick<
RegistryPackage,
'name' | 'title' | 'version' | 'description' | 'type' | 'icons' | 'internal' | 'download' | 'path'
>;
Expand Down Expand Up @@ -152,7 +152,7 @@ export interface RegistryPackage {
// Managers public HTTP response types
export type PackageList = PackageListItem[];

export type PackageListItem = Installable<RegistryListItem & PackageAdditions>;
export type PackageListItem = Installable<RegistrySearchResult & PackageAdditions>;
export type PackagesGroupedByStatus = Record<InstallationStatus, PackageList>;
export type PackageInfo = Installable<RegistryPackage & PackageAdditions>;

Expand Down
4 changes: 2 additions & 2 deletions x-pack/legacy/plugins/epm/server/registry/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
CategoryId,
CategorySummaryList,
KibanaAssetType,
RegistryList,
RegistrySearchResults,
RegistryPackage,
} from '../../common/types';
import { epmConfigStore } from '../config';
Expand All @@ -27,7 +27,7 @@ export interface SearchParams {
category?: CategoryId;
}

export async function fetchList(params?: SearchParams): Promise<RegistryList> {
export async function fetchList(params?: SearchParams): Promise<RegistrySearchResults> {
const { registryUrl } = epmConfigStore.getConfig();
const url = new URL(`${registryUrl}/search`);
if (params && params.category) {
Expand Down

0 comments on commit f6239e7

Please sign in to comment.