Skip to content

Commit

Permalink
gallery search: exclude non validated and include latest version only
Browse files Browse the repository at this point in the history
  • Loading branch information
joaomoreno committed Jan 28, 2021
1 parent 06156a8 commit 1b8c9d6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/search.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import { getPublicGalleryAPI } from './util';
import { ExtensionQueryFilterType } from 'azure-devops-node-api/interfaces/GalleryInterfaces';
import { ExtensionQueryFilterType, ExtensionQueryFlags } from 'azure-devops-node-api/interfaces/GalleryInterfaces';
import { tableView, wordTrim } from './viewutils';

const pageSize = 100;

export async function search(searchText: string, json: boolean = false): Promise<any> {
const flags = [];
const api = getPublicGalleryAPI();
const results = await api.extensionQuery({
pageSize,
criteria: [{ filterType: ExtensionQueryFilterType.SearchText, value: searchText }],
flags,
flags: [ExtensionQueryFlags.ExcludeNonValidated, ExtensionQueryFlags.IncludeLatestVersionOnly],
});

if (json) {
Expand Down

0 comments on commit 1b8c9d6

Please sign in to comment.