@harnessio/react-ssca-manager-client 0.22.0 → 0.23.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/index.d.ts +4 -0
- package/dist/ssca-manager/src/services/index.js +1 -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/ArtifactListingResponseV2.d.ts +95 -0
- package/dist/ssca-manager/src/services/schemas/ArtifactListingResponseV2.js +4 -0
- package/dist/ssca-manager/src/services/schemas/RemediationListingRequestBody.d.ts +2 -2
- 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
|
+
}
|
|
@@ -1,4 +1,6 @@
|
|
|
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';
|
|
4
6
|
export type { CloseRemediationTrackerErrorResponse, CloseRemediationTrackerMutationPathParams, CloseRemediationTrackerOkResponse, CloseRemediationTrackerProps, } from './hooks/useCloseRemediationTrackerMutation';
|
|
@@ -62,6 +64,7 @@ export type { ArtifactComponentViewResponseBodyResponse } from './responses/Arti
|
|
|
62
64
|
export type { ArtifactDeploymentViewResponseBodyResponse } from './responses/ArtifactDeploymentViewResponseBodyResponse';
|
|
63
65
|
export type { ArtifactDetailResponseBodyResponse } from './responses/ArtifactDetailResponseBodyResponse';
|
|
64
66
|
export type { ArtifactListingResponseBodyResponse } from './responses/ArtifactListingResponseBodyResponse';
|
|
67
|
+
export type { ArtifactListingResponseBodyV2Response } from './responses/ArtifactListingResponseBodyV2Response';
|
|
65
68
|
export type { ArtifactSbomDriftResponseBodyResponse } from './responses/ArtifactSbomDriftResponseBodyResponse';
|
|
66
69
|
export type { ArtifactSbomResponseBodyResponse } from './responses/ArtifactSbomResponseBodyResponse';
|
|
67
70
|
export type { BaselineResponseBodyResponse } from './responses/BaselineResponseBodyResponse';
|
|
@@ -87,6 +90,7 @@ export type { ArtifactDeploymentViewResponse } from './schemas/ArtifactDeploymen
|
|
|
87
90
|
export type { ArtifactDetailResponse } from './schemas/ArtifactDetailResponse';
|
|
88
91
|
export type { ArtifactListingRequestBody } from './schemas/ArtifactListingRequestBody';
|
|
89
92
|
export type { ArtifactListingResponse } from './schemas/ArtifactListingResponse';
|
|
93
|
+
export type { ArtifactListingResponseV2 } from './schemas/ArtifactListingResponseV2';
|
|
90
94
|
export type { ArtifactSbomDriftRequestBody } from './schemas/ArtifactSbomDriftRequestBody';
|
|
91
95
|
export type { ArtifactSbomDriftResponse } from './schemas/ArtifactSbomDriftResponse';
|
|
92
96
|
export type { ArtifactSbomResponseBody } from './schemas/ArtifactSbomResponseBody';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { artifactList, useArtifactListQuery } from './hooks/useArtifactListQuery';
|
|
1
2
|
export { calculateDriftForArtifact, useCalculateDriftForArtifactMutation, } from './hooks/useCalculateDriftForArtifactMutation';
|
|
2
3
|
export { closeRemediationTracker, useCloseRemediationTrackerMutation, } from './hooks/useCloseRemediationTrackerMutation';
|
|
3
4
|
export { createRemediationTracker, useCreateRemediationTrackerMutation, } from './hooks/useCreateRemediationTrackerMutation';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
export interface ArtifactListingResponseV2 {
|
|
2
|
+
/**
|
|
3
|
+
* Flag denoting if current artifact is baseline
|
|
4
|
+
*/
|
|
5
|
+
baseline?: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Number of components of the artifact
|
|
8
|
+
*/
|
|
9
|
+
components_count?: number;
|
|
10
|
+
deployment?: {
|
|
11
|
+
/**
|
|
12
|
+
* Latest deployment activity of the artifact
|
|
13
|
+
*/
|
|
14
|
+
activity?: 'DEPLOYED' | 'GENERATED';
|
|
15
|
+
/**
|
|
16
|
+
* Count of pre-production environment this artifact is currently deployed.
|
|
17
|
+
*/
|
|
18
|
+
non_prod_env_count?: number;
|
|
19
|
+
/**
|
|
20
|
+
* Count of production environment this artifact is currently deployed.
|
|
21
|
+
*/
|
|
22
|
+
prod_env_count?: number;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Artifact ID
|
|
26
|
+
*/
|
|
27
|
+
id?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Artifact Name
|
|
30
|
+
*/
|
|
31
|
+
name?: string;
|
|
32
|
+
orchestration?: {
|
|
33
|
+
/**
|
|
34
|
+
* Orchestration step execution ID for the aritfact.
|
|
35
|
+
*/
|
|
36
|
+
id?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Build pipeline execution Id used for orchestration of the artifact
|
|
39
|
+
*/
|
|
40
|
+
pipeline_execution_id?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Build pipeline Id used for orchestration of the artifact
|
|
43
|
+
*/
|
|
44
|
+
pipeline_id?: string;
|
|
45
|
+
};
|
|
46
|
+
policy_enforcement?: {
|
|
47
|
+
/**
|
|
48
|
+
* Count of the allow list policy violations
|
|
49
|
+
*/
|
|
50
|
+
allow_list_violation_count?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Count of the deny list policy violations
|
|
53
|
+
*/
|
|
54
|
+
deny_list_violation_count?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Enforcement Step Id for the artifact lastest enfrocement.
|
|
57
|
+
*/
|
|
58
|
+
id?: string;
|
|
59
|
+
};
|
|
60
|
+
scorecard?: {
|
|
61
|
+
/**
|
|
62
|
+
* Average score of the artifact SBOM
|
|
63
|
+
*/
|
|
64
|
+
avg_score?: string;
|
|
65
|
+
/**
|
|
66
|
+
* Maximum score of the artifact SBOM
|
|
67
|
+
*/
|
|
68
|
+
max_score?: string;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* artifact type
|
|
72
|
+
*/
|
|
73
|
+
type?: string;
|
|
74
|
+
/**
|
|
75
|
+
* Last updated time of the artifact
|
|
76
|
+
*/
|
|
77
|
+
updated?: string;
|
|
78
|
+
/**
|
|
79
|
+
* Artifact Origin URL
|
|
80
|
+
*/
|
|
81
|
+
url?: string;
|
|
82
|
+
/**
|
|
83
|
+
* Artifact variant details
|
|
84
|
+
*/
|
|
85
|
+
variant?: {
|
|
86
|
+
/**
|
|
87
|
+
* Type of the variant.
|
|
88
|
+
*/
|
|
89
|
+
type?: string;
|
|
90
|
+
/**
|
|
91
|
+
* value of the variant for the aritfact.
|
|
92
|
+
*/
|
|
93
|
+
value?: string;
|
|
94
|
+
};
|
|
95
|
+
}
|
|
@@ -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
|
}
|