Skip to content

Commit

Permalink
fixed an issue where search returns ADO and VSIDE extensions with VS …
Browse files Browse the repository at this point in the history
…Code's extensions
  • Loading branch information
prashantvc committed Sep 3, 2021
1 parent 411b6f6 commit 3ecd3e2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,18 @@ import { ExtensionQueryFilterType, ExtensionQueryFlags } from 'azure-devops-node
import { tableView, wordTrim } from './viewutils';

const pageSize = 100;
const installationTarget = 'Microsoft.VisualStudio.Code';
const excludeFlags = '37888'; //Value to exclude un-published, locked or hidden extensions

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

Expand Down

0 comments on commit 3ecd3e2

Please sign in to comment.