Edit

Share via


ReportingRestClient class

Base class that should be used (derived from) to make requests to VSS REST apis

Extends

Constructors

ReportingRestClient(IVssRestClientOptions)

Methods

createAdvancedFilter(AdvancedFilterCreate)

Creates a new advanced filter for the organization.

deleteAdvancedFilter(string)

Deletes an advanced filter.

getAdvancedFilter(string)

Gets a specific advanced filter by its ID.

getAlertSummaryForOrg(FilterCriteria)

Get Alert summary by severity for the org

getCombinedAlertsForOrg(CombinedAlertFilterCriteria, number, string)

Get Combined Alerts for the org

getDependencyComponentNamesForOrg()

Get all distinct dependency component names for the org (used for UX filtering)

getEnablementSummaryForOrg(EnablementFilterCriteria)

Get Enablement summary for the org

getProjectsAndReposForOrg()

Get all projects and repositories for the org (used for UX filtering)

getRuleNamesForOrg(string)

Get all distinct code scanning rule names for the org (used for UX filtering)

getSecretTypesForOrg()

Get all distinct secret types for the org (used for UX filtering)

getUXComputedFilters()
listAdvancedFilters(boolean, string)

Gets all advanced filters for the organization.

updateAdvancedFilter(AdvancedFilterUpdate, string)

Updates an advanced filter. Only the name can be updated.

Constructor Details

ReportingRestClient(IVssRestClientOptions)

new ReportingRestClient(options: IVssRestClientOptions)

Parameters

Method Details

createAdvancedFilter(AdvancedFilterCreate)

Creates a new advanced filter for the organization.

function createAdvancedFilter(filter: AdvancedFilterCreate): Promise<AdvancedFilter>

Parameters

filter
AdvancedFilterCreate

The advanced filter to create.

Returns

Promise<AdvancedFilter>

deleteAdvancedFilter(string)

Deletes an advanced filter.

function deleteAdvancedFilter(filterId: string): Promise<void>

Parameters

filterId

string

The ID of the advanced filter to delete.

Returns

Promise<void>

getAdvancedFilter(string)

Gets a specific advanced filter by its ID.

function getAdvancedFilter(filterId: string): Promise<AdvancedFilter>

Parameters

filterId

string

The ID of the advanced filter to retrieve.

Returns

Promise<AdvancedFilter>

getAlertSummaryForOrg(FilterCriteria)

Get Alert summary by severity for the org

function getAlertSummaryForOrg(criteria?: FilterCriteria): Promise<OrgAlertSummary>

Parameters

criteria
FilterCriteria

Options to limit the summaries returned

Returns

Promise<OrgAlertSummary>

getCombinedAlertsForOrg(CombinedAlertFilterCriteria, number, string)

Get Combined Alerts for the org

function getCombinedAlertsForOrg(criteria?: CombinedAlertFilterCriteria, top?: number, continuationToken?: string): Promise<PagedList<DashboardAlert>>

Parameters

criteria
CombinedAlertFilterCriteria

Options to filter the combined alerts returned

top

number

The maximum number of alerts to return

continuationToken

string

If there are more alerts than can be returned, a continuation token is placed in the "x-ms-continuationtoken" header. Use that token here to get the next page of alerts

Returns

getDependencyComponentNamesForOrg()

Get all distinct dependency component names for the org (used for UX filtering)

function getDependencyComponentNamesForOrg(): Promise<string[]>

Returns

Promise<string[]>

getEnablementSummaryForOrg(EnablementFilterCriteria)

Get Enablement summary for the org

function getEnablementSummaryForOrg(criteria?: EnablementFilterCriteria): Promise<OrgEnablementSummary>

Parameters

criteria
EnablementFilterCriteria

Options to limit the summaries returned

Returns

getProjectsAndReposForOrg()

Get all projects and repositories for the org (used for UX filtering)

function getProjectsAndReposForOrg(): Promise<ProjectAndRepoInfo[]>

Returns

Promise<ProjectAndRepoInfo[]>

getRuleNamesForOrg(string)

Get all distinct code scanning rule names for the org (used for UX filtering)

function getRuleNamesForOrg(toolName?: string): Promise<CodeScanningRuleInfo[]>

Parameters

toolName

string

Optional tool name to filter rules by

Returns

getSecretTypesForOrg()

Get all distinct secret types for the org (used for UX filtering)

function getSecretTypesForOrg(): Promise<string[]>

Returns

Promise<string[]>

getUXComputedFilters()

function getUXComputedFilters(): Promise<ReportingUXComputedFilters>

Returns

listAdvancedFilters(boolean, string)

Gets all advanced filters for the organization.

function listAdvancedFilters(includeDeleted?: boolean, keywords?: string): Promise<AdvancedFilter[]>

Parameters

includeDeleted

boolean

Whether to include soft-deleted filters.

keywords

string

Optional filter to search filters by name (case-insensitive, partial match).

Returns

Promise<AdvancedFilter[]>

updateAdvancedFilter(AdvancedFilterUpdate, string)

Updates an advanced filter. Only the name can be updated.

function updateAdvancedFilter(filter: AdvancedFilterUpdate, filterId: string): Promise<void>

Parameters

filter
AdvancedFilterUpdate

The update data containing the new name.

filterId

string

The ID of the advanced filter to update.

Returns

Promise<void>