@harnessio/react-ssca-manager-client 0.22.0 → 0.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ssca-manager/src/services/hooks/useArtifactListQuery.d.ts +47 -0
- package/dist/ssca-manager/src/services/hooks/useArtifactListQuery.js +14 -0
- package/dist/ssca-manager/src/services/hooks/useCheckArtifactAndDeploymentsMutation.d.ts +23 -0
- package/dist/ssca-manager/src/services/hooks/useCheckArtifactAndDeploymentsMutation.js +14 -0
- package/dist/ssca-manager/src/services/index.d.ts +8 -0
- package/dist/ssca-manager/src/services/index.js +2 -0
- package/dist/ssca-manager/src/services/responses/ArtifactListingResponseBodyV2Response.d.ts +2 -0
- package/dist/ssca-manager/src/services/responses/ArtifactListingResponseBodyV2Response.js +1 -0
- package/dist/ssca-manager/src/services/schemas/ArtifactAndDeploymentsResponseBody.d.ts +4 -0
- package/dist/ssca-manager/src/services/schemas/ArtifactAndDeploymentsResponseBody.js +4 -0
- package/dist/ssca-manager/src/services/schemas/ArtifactListingResponseV2.d.ts +84 -0
- package/dist/ssca-manager/src/services/schemas/ArtifactListingResponseV2.js +1 -0
- package/dist/ssca-manager/src/services/schemas/ArtifactVariant.d.ts +10 -0
- package/dist/ssca-manager/src/services/schemas/ArtifactVariant.js +4 -0
- package/dist/ssca-manager/src/services/schemas/RemediationArtifactListingRequestBody.d.ts +1 -1
- package/dist/ssca-manager/src/services/schemas/RemediationDetailsResponse.d.ts +4 -0
- package/dist/ssca-manager/src/services/schemas/RemediationListingRequestBody.d.ts +2 -2
- package/dist/ssca-manager/src/services/schemas/RemediationListingResponse.d.ts +5 -0
- package/package.json +1 -1
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
+
import type { ArtifactListingResponseBodyV2Response } from '../responses/ArtifactListingResponseBodyV2Response';
|
|
3
|
+
import type { ArtifactListingRequestBodyRequestBody } from '../requestBodies/ArtifactListingRequestBodyRequestBody';
|
|
4
|
+
import type { ResponseWithPagination } from '../helpers';
|
|
5
|
+
import { FetcherOptions } from '../../../../fetcher/index.js';
|
|
6
|
+
export interface ArtifactListQueryPathParams {
|
|
7
|
+
org: string;
|
|
8
|
+
project: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ArtifactListQueryQueryParams {
|
|
11
|
+
/**
|
|
12
|
+
* @default 30
|
|
13
|
+
*/
|
|
14
|
+
limit?: number;
|
|
15
|
+
/**
|
|
16
|
+
* @default "ASC"
|
|
17
|
+
*/
|
|
18
|
+
order?: 'ASC' | 'DESC';
|
|
19
|
+
/**
|
|
20
|
+
* @default 0
|
|
21
|
+
*/
|
|
22
|
+
page?: number;
|
|
23
|
+
/**
|
|
24
|
+
* @default "name"
|
|
25
|
+
*/
|
|
26
|
+
sort?: {};
|
|
27
|
+
type: 'image' | 'repository';
|
|
28
|
+
/**
|
|
29
|
+
* @default "all"
|
|
30
|
+
*/
|
|
31
|
+
view_mode?: 'all' | 'latest';
|
|
32
|
+
}
|
|
33
|
+
export interface ArtifactListQueryHeaderParams {
|
|
34
|
+
'Harness-Account'?: string;
|
|
35
|
+
}
|
|
36
|
+
export type ArtifactListRequestBody = ArtifactListingRequestBodyRequestBody;
|
|
37
|
+
export type ArtifactListOkResponse = ResponseWithPagination<ArtifactListingResponseBodyV2Response>;
|
|
38
|
+
export type ArtifactListErrorResponse = unknown;
|
|
39
|
+
export interface ArtifactListProps extends ArtifactListQueryPathParams, Omit<FetcherOptions<ArtifactListQueryQueryParams, ArtifactListRequestBody, ArtifactListQueryHeaderParams>, 'url'> {
|
|
40
|
+
queryParams: ArtifactListQueryQueryParams;
|
|
41
|
+
body: ArtifactListRequestBody;
|
|
42
|
+
}
|
|
43
|
+
export declare function artifactList(props: ArtifactListProps): Promise<ArtifactListOkResponse>;
|
|
44
|
+
/**
|
|
45
|
+
* List artifacts
|
|
46
|
+
*/
|
|
47
|
+
export declare function useArtifactListQuery(props: ArtifactListProps, options?: Omit<UseQueryOptions<ArtifactListOkResponse, ArtifactListErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<ArtifactListOkResponse, unknown>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// This code is autogenerated using @harnessio/oats-cli.
|
|
3
|
+
// Please do not modify this code directly.
|
|
4
|
+
import { useQuery } from '@tanstack/react-query';
|
|
5
|
+
import { fetcher } from '../../../../fetcher/index.js';
|
|
6
|
+
export function artifactList(props) {
|
|
7
|
+
return fetcher(Object.assign({ url: `/v1/orgs/${props.org}/projects/${props.project}/artifacts`, method: 'POST' }, props));
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* List artifacts
|
|
11
|
+
*/
|
|
12
|
+
export function useArtifactListQuery(props, options) {
|
|
13
|
+
return useQuery(['artifactList', props.org, props.project, props.queryParams, props.body], ({ signal }) => artifactList(Object.assign(Object.assign({}, props), { signal })), options);
|
|
14
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { UseMutationOptions } from '@tanstack/react-query';
|
|
2
|
+
import type { ArtifactAndDeploymentsResponseBody } from '../schemas/ArtifactAndDeploymentsResponseBody';
|
|
3
|
+
import type { RemediationTrackerCreateRequestBodyRequestBody } from '../requestBodies/RemediationTrackerCreateRequestBodyRequestBody';
|
|
4
|
+
import type { ResponseWithPagination } from '../helpers';
|
|
5
|
+
import { FetcherOptions } from '../../../../fetcher/index.js';
|
|
6
|
+
export interface CheckArtifactAndDeploymentsMutationPathParams {
|
|
7
|
+
org: string;
|
|
8
|
+
project: string;
|
|
9
|
+
}
|
|
10
|
+
export interface CheckArtifactAndDeploymentsMutationHeaderParams {
|
|
11
|
+
'Harness-Account'?: string;
|
|
12
|
+
}
|
|
13
|
+
export type CheckArtifactAndDeploymentsRequestBody = RemediationTrackerCreateRequestBodyRequestBody;
|
|
14
|
+
export type CheckArtifactAndDeploymentsOkResponse = ResponseWithPagination<ArtifactAndDeploymentsResponseBody>;
|
|
15
|
+
export type CheckArtifactAndDeploymentsErrorResponse = unknown;
|
|
16
|
+
export interface CheckArtifactAndDeploymentsProps extends CheckArtifactAndDeploymentsMutationPathParams, Omit<FetcherOptions<unknown, CheckArtifactAndDeploymentsRequestBody, CheckArtifactAndDeploymentsMutationHeaderParams>, 'url'> {
|
|
17
|
+
body: CheckArtifactAndDeploymentsRequestBody;
|
|
18
|
+
}
|
|
19
|
+
export declare function checkArtifactAndDeployments(props: CheckArtifactAndDeploymentsProps): Promise<CheckArtifactAndDeploymentsOkResponse>;
|
|
20
|
+
/**
|
|
21
|
+
* Check Artifacts And Deployments.
|
|
22
|
+
*/
|
|
23
|
+
export declare function useCheckArtifactAndDeploymentsMutation(options?: Omit<UseMutationOptions<CheckArtifactAndDeploymentsOkResponse, CheckArtifactAndDeploymentsErrorResponse, CheckArtifactAndDeploymentsProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<CheckArtifactAndDeploymentsOkResponse, unknown, CheckArtifactAndDeploymentsProps, unknown>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// This code is autogenerated using @harnessio/oats-cli.
|
|
3
|
+
// Please do not modify this code directly.
|
|
4
|
+
import { useMutation } from '@tanstack/react-query';
|
|
5
|
+
import { fetcher } from '../../../../fetcher/index.js';
|
|
6
|
+
export function checkArtifactAndDeployments(props) {
|
|
7
|
+
return fetcher(Object.assign({ url: `/v1/orgs/${props.org}/projects/${props.project}/remediations/check-artifacts`, method: 'POST' }, props));
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Check Artifacts And Deployments.
|
|
11
|
+
*/
|
|
12
|
+
export function useCheckArtifactAndDeploymentsMutation(options) {
|
|
13
|
+
return useMutation((mutateProps) => checkArtifactAndDeployments(mutateProps), options);
|
|
14
|
+
}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
export type { GetPathParamsType, ResponseWithPagination } from './helpers';
|
|
2
|
+
export type { ArtifactListErrorResponse, ArtifactListOkResponse, ArtifactListProps, ArtifactListQueryPathParams, ArtifactListQueryQueryParams, ArtifactListRequestBody, } from './hooks/useArtifactListQuery';
|
|
3
|
+
export { artifactList, useArtifactListQuery } from './hooks/useArtifactListQuery';
|
|
2
4
|
export type { CalculateDriftForArtifactErrorResponse, CalculateDriftForArtifactMutationPathParams, CalculateDriftForArtifactOkResponse, CalculateDriftForArtifactProps, CalculateDriftForArtifactRequestBody, } from './hooks/useCalculateDriftForArtifactMutation';
|
|
3
5
|
export { calculateDriftForArtifact, useCalculateDriftForArtifactMutation, } from './hooks/useCalculateDriftForArtifactMutation';
|
|
6
|
+
export type { CheckArtifactAndDeploymentsErrorResponse, CheckArtifactAndDeploymentsMutationPathParams, CheckArtifactAndDeploymentsOkResponse, CheckArtifactAndDeploymentsProps, CheckArtifactAndDeploymentsRequestBody, } from './hooks/useCheckArtifactAndDeploymentsMutation';
|
|
7
|
+
export { checkArtifactAndDeployments, useCheckArtifactAndDeploymentsMutation, } from './hooks/useCheckArtifactAndDeploymentsMutation';
|
|
4
8
|
export type { CloseRemediationTrackerErrorResponse, CloseRemediationTrackerMutationPathParams, CloseRemediationTrackerOkResponse, CloseRemediationTrackerProps, } from './hooks/useCloseRemediationTrackerMutation';
|
|
5
9
|
export { closeRemediationTracker, useCloseRemediationTrackerMutation, } from './hooks/useCloseRemediationTrackerMutation';
|
|
6
10
|
export type { CreateRemediationTrackerErrorResponse, CreateRemediationTrackerMutationPathParams, CreateRemediationTrackerOkResponse, CreateRemediationTrackerProps, CreateRemediationTrackerRequestBody, } from './hooks/useCreateRemediationTrackerMutation';
|
|
@@ -62,6 +66,7 @@ export type { ArtifactComponentViewResponseBodyResponse } from './responses/Arti
|
|
|
62
66
|
export type { ArtifactDeploymentViewResponseBodyResponse } from './responses/ArtifactDeploymentViewResponseBodyResponse';
|
|
63
67
|
export type { ArtifactDetailResponseBodyResponse } from './responses/ArtifactDetailResponseBodyResponse';
|
|
64
68
|
export type { ArtifactListingResponseBodyResponse } from './responses/ArtifactListingResponseBodyResponse';
|
|
69
|
+
export type { ArtifactListingResponseBodyV2Response } from './responses/ArtifactListingResponseBodyV2Response';
|
|
65
70
|
export type { ArtifactSbomDriftResponseBodyResponse } from './responses/ArtifactSbomDriftResponseBodyResponse';
|
|
66
71
|
export type { ArtifactSbomResponseBodyResponse } from './responses/ArtifactSbomResponseBodyResponse';
|
|
67
72
|
export type { BaselineResponseBodyResponse } from './responses/BaselineResponseBodyResponse';
|
|
@@ -80,6 +85,7 @@ export type { RemediationTrackerUpdateResponseBodyResponse } from './responses/R
|
|
|
80
85
|
export type { RemediationTrackersOverallSummaryResponseBodyResponse } from './responses/RemediationTrackersOverallSummaryResponseBodyResponse';
|
|
81
86
|
export type { SaveResponseResponse } from './responses/SaveResponseResponse';
|
|
82
87
|
export type { SbomScorecardResponseBodyResponse } from './responses/SbomScorecardResponseBodyResponse';
|
|
88
|
+
export type { ArtifactAndDeploymentsResponseBody } from './schemas/ArtifactAndDeploymentsResponseBody';
|
|
83
89
|
export type { ArtifactComponentViewRequestBody } from './schemas/ArtifactComponentViewRequestBody';
|
|
84
90
|
export type { ArtifactComponentViewResponse } from './schemas/ArtifactComponentViewResponse';
|
|
85
91
|
export type { ArtifactDeploymentViewRequestBody } from './schemas/ArtifactDeploymentViewRequestBody';
|
|
@@ -87,9 +93,11 @@ export type { ArtifactDeploymentViewResponse } from './schemas/ArtifactDeploymen
|
|
|
87
93
|
export type { ArtifactDetailResponse } from './schemas/ArtifactDetailResponse';
|
|
88
94
|
export type { ArtifactListingRequestBody } from './schemas/ArtifactListingRequestBody';
|
|
89
95
|
export type { ArtifactListingResponse } from './schemas/ArtifactListingResponse';
|
|
96
|
+
export type { ArtifactListingResponseV2 } from './schemas/ArtifactListingResponseV2';
|
|
90
97
|
export type { ArtifactSbomDriftRequestBody } from './schemas/ArtifactSbomDriftRequestBody';
|
|
91
98
|
export type { ArtifactSbomDriftResponse } from './schemas/ArtifactSbomDriftResponse';
|
|
92
99
|
export type { ArtifactSbomResponseBody } from './schemas/ArtifactSbomResponseBody';
|
|
100
|
+
export type { ArtifactVariant } from './schemas/ArtifactVariant';
|
|
93
101
|
export type { BaselineRequestBody } from './schemas/BaselineRequestBody';
|
|
94
102
|
export type { BaselineResponseBody } from './schemas/BaselineResponseBody';
|
|
95
103
|
export type { CategoryScorecard } from './schemas/CategoryScorecard';
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
export { artifactList, useArtifactListQuery } from './hooks/useArtifactListQuery';
|
|
1
2
|
export { calculateDriftForArtifact, useCalculateDriftForArtifactMutation, } from './hooks/useCalculateDriftForArtifactMutation';
|
|
3
|
+
export { checkArtifactAndDeployments, useCheckArtifactAndDeploymentsMutation, } from './hooks/useCheckArtifactAndDeploymentsMutation';
|
|
2
4
|
export { closeRemediationTracker, useCloseRemediationTrackerMutation, } from './hooks/useCloseRemediationTrackerMutation';
|
|
3
5
|
export { createRemediationTracker, useCreateRemediationTrackerMutation, } from './hooks/useCreateRemediationTrackerMutation';
|
|
4
6
|
export { createTicket, useCreateTicketMutation } from './hooks/useCreateTicketMutation';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { ArtifactVariant } from '../schemas/ArtifactVariant';
|
|
2
|
+
export interface ArtifactListingResponseV2 {
|
|
3
|
+
/**
|
|
4
|
+
* Flag denoting if current artifact is baseline
|
|
5
|
+
*/
|
|
6
|
+
baseline?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Number of components of the artifact
|
|
9
|
+
*/
|
|
10
|
+
components_count?: number;
|
|
11
|
+
deployment?: {
|
|
12
|
+
/**
|
|
13
|
+
* Latest deployment activity of the artifact
|
|
14
|
+
*/
|
|
15
|
+
activity?: 'DEPLOYED' | 'GENERATED';
|
|
16
|
+
/**
|
|
17
|
+
* Count of pre-production environment this artifact is currently deployed.
|
|
18
|
+
*/
|
|
19
|
+
non_prod_env_count?: number;
|
|
20
|
+
/**
|
|
21
|
+
* Count of production environment this artifact is currently deployed.
|
|
22
|
+
*/
|
|
23
|
+
prod_env_count?: number;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Artifact ID
|
|
27
|
+
*/
|
|
28
|
+
id?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Artifact Name
|
|
31
|
+
*/
|
|
32
|
+
name?: string;
|
|
33
|
+
orchestration?: {
|
|
34
|
+
/**
|
|
35
|
+
* Orchestration step execution ID for the aritfact.
|
|
36
|
+
*/
|
|
37
|
+
id?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Build pipeline execution Id used for orchestration of the artifact
|
|
40
|
+
*/
|
|
41
|
+
pipeline_execution_id?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Build pipeline Id used for orchestration of the artifact
|
|
44
|
+
*/
|
|
45
|
+
pipeline_id?: string;
|
|
46
|
+
};
|
|
47
|
+
policy_enforcement?: {
|
|
48
|
+
/**
|
|
49
|
+
* Count of the allow list policy violations
|
|
50
|
+
*/
|
|
51
|
+
allow_list_violation_count?: string;
|
|
52
|
+
/**
|
|
53
|
+
* Count of the deny list policy violations
|
|
54
|
+
*/
|
|
55
|
+
deny_list_violation_count?: string;
|
|
56
|
+
/**
|
|
57
|
+
* Enforcement Step Id for the artifact lastest enfrocement.
|
|
58
|
+
*/
|
|
59
|
+
id?: string;
|
|
60
|
+
};
|
|
61
|
+
scorecard?: {
|
|
62
|
+
/**
|
|
63
|
+
* Average score of the artifact SBOM
|
|
64
|
+
*/
|
|
65
|
+
avg_score?: string;
|
|
66
|
+
/**
|
|
67
|
+
* Maximum score of the artifact SBOM
|
|
68
|
+
*/
|
|
69
|
+
max_score?: string;
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* artifact type
|
|
73
|
+
*/
|
|
74
|
+
type?: 'image' | 'repository';
|
|
75
|
+
/**
|
|
76
|
+
* Last updated time of the artifact
|
|
77
|
+
*/
|
|
78
|
+
updated?: string;
|
|
79
|
+
/**
|
|
80
|
+
* Artifact Origin URL
|
|
81
|
+
*/
|
|
82
|
+
url?: string;
|
|
83
|
+
variant?: ArtifactVariant;
|
|
84
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -15,6 +15,10 @@ export interface RemediationDetailsResponse {
|
|
|
15
15
|
* @format int64
|
|
16
16
|
*/
|
|
17
17
|
artifacts_excluded: number;
|
|
18
|
+
/**
|
|
19
|
+
* If Remediation Tracker was closed manually , name of the user who closed it.
|
|
20
|
+
*/
|
|
21
|
+
closed_by?: string;
|
|
18
22
|
/**
|
|
19
23
|
* Description/comments for the tracker.
|
|
20
24
|
*/
|
|
@@ -5,13 +5,13 @@ export interface RemediationListingRequestBody {
|
|
|
5
5
|
*/
|
|
6
6
|
component_name_filter?: {
|
|
7
7
|
operator: NameOperator;
|
|
8
|
-
value
|
|
8
|
+
value: string;
|
|
9
9
|
};
|
|
10
10
|
/**
|
|
11
11
|
* Filter for CVE.
|
|
12
12
|
*/
|
|
13
13
|
cve_filter?: {
|
|
14
14
|
operator: NameOperator;
|
|
15
|
-
value
|
|
15
|
+
value: string;
|
|
16
16
|
};
|
|
17
17
|
}
|