Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions packages/javascript/js-client-library/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ import {
UpdateConfigurationResponse,
UploadFileToIngestResponse,
WebhookTestResponse,
ZoneProtectedAssetScoreResponse,
} from './responses';
import * as types from './types';

Expand Down Expand Up @@ -750,6 +751,13 @@ class BHEAPIClient {
paramsSerializer: { indexes: null },
});

getZoneProtectedAssetScore = (environments: string[], assetGroupTagId: number, options?: RequestOptions) =>
this.baseClient.get<ZoneProtectedAssetScoreResponse>('/api/v2/asset-scores/zone-protected-asset-score', {
...options,
params: { ...options?.params, environments, asset_group_tag_id: assetGroupTagId },
paramsSerializer: { indexes: null },
});

/* explore search */

getPathfindingResult = (startNode: string, endNode: string, options?: RequestOptions) =>
Expand Down
14 changes: 14 additions & 0 deletions packages/javascript/js-client-library/src/responses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,20 @@ export type PostureHistoryResponse = TimeWindowedResponse<PostureHistoryData[]>
data_type: string;
};

export type ZoneProtectedAssetScoreData = {
date: string;
exposed_count: number;
protected_count: number;
total_count: number;
// The protected share of the zone, expressed as a fraction between 0 and 1.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

appreciate the comment here

value: number;
};

export type ZoneProtectedAssetScoreResponse = TimeWindowedResponse<ZoneProtectedAssetScoreData[]> & {
environments: string[];
asset_group_tag_id: number;
};
Comment thread
cweidenkeller marked this conversation as resolved.

type DatapipeStatus = {
status: 'idle' | 'ingesting' | 'analyzing' | 'purging';
last_complete_analysis_at: string;
Expand Down
Loading