@harnessio/react-sto-core-client 0.3.0 → 0.3.2

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.
Files changed (21) hide show
  1. package/dist/sto-core/src/services/hooks/useExemptionsDeleteExemptionMutation.d.ts +38 -0
  2. package/dist/sto-core/src/services/hooks/useExemptionsDeleteExemptionMutation.js +14 -0
  3. package/dist/sto-core/src/services/hooks/useFrontendImpactedTargetsForExemptionQuery.d.ts +57 -0
  4. package/dist/sto-core/src/services/hooks/useFrontendImpactedTargetsForExemptionQuery.js +14 -0
  5. package/dist/sto-core/src/services/hooks/useFrontendIssueForExemptionQuery.d.ts +58 -0
  6. package/dist/sto-core/src/services/hooks/useFrontendIssueForExemptionQuery.js +14 -0
  7. package/dist/sto-core/src/services/hooks/useTargetsDeleteTargetMutation.d.ts +38 -0
  8. package/dist/sto-core/src/services/hooks/useTargetsDeleteTargetMutation.js +14 -0
  9. package/dist/sto-core/src/services/index.d.ts +13 -0
  10. package/dist/sto-core/src/services/index.js +4 -0
  11. package/dist/sto-core/src/services/schemas/ExemptionImpactedTargetsResult.d.ts +14 -0
  12. package/dist/sto-core/src/services/schemas/ExemptionImpactedTargetsResult.js +1 -0
  13. package/dist/sto-core/src/services/schemas/FrontendExemptionTargets.d.ts +78 -0
  14. package/dist/sto-core/src/services/schemas/FrontendExemptionTargets.js +4 -0
  15. package/dist/sto-core/src/services/schemas/FrontendImpactedTargetsForExemptionResponseBody.d.ts +2 -0
  16. package/dist/sto-core/src/services/schemas/FrontendImpactedTargetsForExemptionResponseBody.js +1 -0
  17. package/dist/sto-core/src/services/schemas/FrontendIssueForExemptionResponseBody.d.ts +2 -0
  18. package/dist/sto-core/src/services/schemas/FrontendIssueForExemptionResponseBody.js +1 -0
  19. package/dist/sto-core/src/services/schemas/IssueForExemptionResult.d.ts +147 -0
  20. package/dist/sto-core/src/services/schemas/IssueForExemptionResult.js +1 -0
  21. package/package.json +1 -1
@@ -0,0 +1,38 @@
1
+ import { UseMutationOptions } from '@tanstack/react-query';
2
+ import type { NotFound } from '../schemas/NotFound';
3
+ import type { ResponseWithPagination } from '../helpers';
4
+ import { FetcherOptions } from '../../../../fetcher/index.js';
5
+ export interface ExemptionsDeleteExemptionMutationPathParams {
6
+ /**
7
+ * The ID of the Exemption to delete
8
+ * @example "abcdef1234567890ghijkl"
9
+ */
10
+ id: string;
11
+ }
12
+ export interface ExemptionsDeleteExemptionMutationQueryParams {
13
+ /**
14
+ * Harness Account ID
15
+ * @example "abcdef1234567890ghijkl"
16
+ */
17
+ accountId: string;
18
+ /**
19
+ * Harness Organization ID
20
+ * @example "example_org"
21
+ */
22
+ orgId?: string;
23
+ /**
24
+ * Harness Project ID
25
+ * @example "example_project"
26
+ */
27
+ projectId?: string;
28
+ }
29
+ export type ExemptionsDeleteExemptionOkResponse = ResponseWithPagination<unknown>;
30
+ export type ExemptionsDeleteExemptionErrorResponse = NotFound;
31
+ export interface ExemptionsDeleteExemptionProps extends ExemptionsDeleteExemptionMutationPathParams, Omit<FetcherOptions<ExemptionsDeleteExemptionMutationQueryParams, unknown>, 'url'> {
32
+ queryParams: ExemptionsDeleteExemptionMutationQueryParams;
33
+ }
34
+ export declare function exemptionsDeleteExemption(props: ExemptionsDeleteExemptionProps): Promise<ExemptionsDeleteExemptionOkResponse>;
35
+ /**
36
+ * Delete an existing Exemption
37
+ */
38
+ export declare function useExemptionsDeleteExemptionMutation(options?: Omit<UseMutationOptions<ExemptionsDeleteExemptionOkResponse, ExemptionsDeleteExemptionErrorResponse, ExemptionsDeleteExemptionProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<ExemptionsDeleteExemptionOkResponse, NotFound, ExemptionsDeleteExemptionProps, 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 exemptionsDeleteExemption(props) {
7
+ return fetcher(Object.assign({ url: `/api/v2/exemptions/${props.id}`, method: 'DELETE' }, props));
8
+ }
9
+ /**
10
+ * Delete an existing Exemption
11
+ */
12
+ export function useExemptionsDeleteExemptionMutation(options) {
13
+ return useMutation((mutateProps) => exemptionsDeleteExemption(mutateProps), options);
14
+ }
@@ -0,0 +1,57 @@
1
+ import { UseQueryOptions } from '@tanstack/react-query';
2
+ import type { FrontendImpactedTargetsForExemptionResponseBody } from '../schemas/FrontendImpactedTargetsForExemptionResponseBody';
3
+ import type { NotFound } from '../schemas/NotFound';
4
+ import type { ResponseWithPagination } from '../helpers';
5
+ import { FetcherOptions } from '../../../../fetcher/index.js';
6
+ export interface FrontendImpactedTargetsForExemptionQueryPathParams {
7
+ /**
8
+ * ID of Security Test Exemption
9
+ * @example "abcdef1234567890ghijkl"
10
+ */
11
+ exemptionId: string;
12
+ }
13
+ export interface FrontendImpactedTargetsForExemptionQueryQueryParams {
14
+ /**
15
+ * Harness Account ID
16
+ * @example "abcdef1234567890ghijkl"
17
+ */
18
+ accountId: string;
19
+ /**
20
+ * Harness Organization ID
21
+ * @example "example_org"
22
+ */
23
+ orgId?: string;
24
+ /**
25
+ * Harness Project ID
26
+ * @example "example_project"
27
+ */
28
+ projectId?: string;
29
+ /**
30
+ * Page number to fetch (starting from 0)
31
+ * @format int64
32
+ * @default 0
33
+ * @example 4
34
+ */
35
+ page?: number;
36
+ /**
37
+ * Number of results per page
38
+ * @format int64
39
+ * @default 30
40
+ * @example 50
41
+ */
42
+ pageSize?: number;
43
+ /**
44
+ * @example "CWE-123"
45
+ */
46
+ search?: string;
47
+ }
48
+ export type FrontendImpactedTargetsForExemptionOkResponse = ResponseWithPagination<FrontendImpactedTargetsForExemptionResponseBody>;
49
+ export type FrontendImpactedTargetsForExemptionErrorResponse = NotFound;
50
+ export interface FrontendImpactedTargetsForExemptionProps extends FrontendImpactedTargetsForExemptionQueryPathParams, Omit<FetcherOptions<FrontendImpactedTargetsForExemptionQueryQueryParams, unknown>, 'url'> {
51
+ queryParams: FrontendImpactedTargetsForExemptionQueryQueryParams;
52
+ }
53
+ export declare function frontendImpactedTargetsForExemption(props: FrontendImpactedTargetsForExemptionProps): Promise<FrontendImpactedTargetsForExemptionOkResponse>;
54
+ /**
55
+ * Returns a list of impacted target details for an exemption id
56
+ */
57
+ export declare function useFrontendImpactedTargetsForExemptionQuery(props: FrontendImpactedTargetsForExemptionProps, options?: Omit<UseQueryOptions<FrontendImpactedTargetsForExemptionOkResponse, FrontendImpactedTargetsForExemptionErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<FrontendImpactedTargetsForExemptionOkResponse, NotFound>;
@@ -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 frontendImpactedTargetsForExemption(props) {
7
+ return fetcher(Object.assign({ url: `/api/v2/frontend/exemption/${props.exemptionId}/targets`, method: 'GET' }, props));
8
+ }
9
+ /**
10
+ * Returns a list of impacted target details for an exemption id
11
+ */
12
+ export function useFrontendImpactedTargetsForExemptionQuery(props, options) {
13
+ return useQuery(['Frontend#ImpactedTargetsForExemption', props.exemptionId, props.queryParams], ({ signal }) => frontendImpactedTargetsForExemption(Object.assign(Object.assign({}, props), { signal })), options);
14
+ }
@@ -0,0 +1,58 @@
1
+ import { UseQueryOptions } from '@tanstack/react-query';
2
+ import type { FrontendIssueForExemptionResponseBody } from '../schemas/FrontendIssueForExemptionResponseBody';
3
+ import type { NotFound } from '../schemas/NotFound';
4
+ import type { ResponseWithPagination } from '../helpers';
5
+ import { FetcherOptions } from '../../../../fetcher/index.js';
6
+ export interface FrontendIssueForExemptionQueryPathParams {
7
+ /**
8
+ * ID of Security Test Exemption
9
+ * @example "abcdef1234567890ghijkl"
10
+ */
11
+ exemptionId: string;
12
+ }
13
+ export interface FrontendIssueForExemptionQueryQueryParams {
14
+ /**
15
+ * Harness Account ID
16
+ * @example "abcdef1234567890ghijkl"
17
+ */
18
+ accountId: string;
19
+ /**
20
+ * Harness Organization ID
21
+ * @example "example_org"
22
+ */
23
+ orgId?: string;
24
+ /**
25
+ * Harness Project ID
26
+ * @example "example_project"
27
+ */
28
+ projectId?: string;
29
+ /**
30
+ * Harness STO Target ID
31
+ * @example "abcdef1234567890ghijkl"
32
+ */
33
+ targetId?: string;
34
+ /**
35
+ * Page number to fetch (starting from 0)
36
+ * @format int64
37
+ * @default 0
38
+ * @example 4
39
+ */
40
+ page?: number;
41
+ /**
42
+ * Number of results per page
43
+ * @format int64
44
+ * @default 30
45
+ * @example 50
46
+ */
47
+ pageSize?: number;
48
+ }
49
+ export type FrontendIssueForExemptionOkResponse = ResponseWithPagination<FrontendIssueForExemptionResponseBody>;
50
+ export type FrontendIssueForExemptionErrorResponse = NotFound;
51
+ export interface FrontendIssueForExemptionProps extends FrontendIssueForExemptionQueryPathParams, Omit<FetcherOptions<FrontendIssueForExemptionQueryQueryParams, unknown>, 'url'> {
52
+ queryParams: FrontendIssueForExemptionQueryQueryParams;
53
+ }
54
+ export declare function frontendIssueForExemption(props: FrontendIssueForExemptionProps): Promise<FrontendIssueForExemptionOkResponse>;
55
+ /**
56
+ * Returns a specific issue exemption
57
+ */
58
+ export declare function useFrontendIssueForExemptionQuery(props: FrontendIssueForExemptionProps, options?: Omit<UseQueryOptions<FrontendIssueForExemptionOkResponse, FrontendIssueForExemptionErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<FrontendIssueForExemptionOkResponse, NotFound>;
@@ -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 frontendIssueForExemption(props) {
7
+ return fetcher(Object.assign({ url: `/api/v2/frontend/issue-exemption/${props.exemptionId}`, method: 'GET' }, props));
8
+ }
9
+ /**
10
+ * Returns a specific issue exemption
11
+ */
12
+ export function useFrontendIssueForExemptionQuery(props, options) {
13
+ return useQuery(['Frontend#IssueForExemption', props.exemptionId, props.queryParams], ({ signal }) => frontendIssueForExemption(Object.assign(Object.assign({}, props), { signal })), options);
14
+ }
@@ -0,0 +1,38 @@
1
+ import { UseMutationOptions } from '@tanstack/react-query';
2
+ import type { NotFound } from '../schemas/NotFound';
3
+ import type { ResponseWithPagination } from '../helpers';
4
+ import { FetcherOptions } from '../../../../fetcher/index.js';
5
+ export interface TargetsDeleteTargetMutationPathParams {
6
+ /**
7
+ * The ID of the Test Target to delete
8
+ * @example "abcdef1234567890ghijkl"
9
+ */
10
+ id: string;
11
+ }
12
+ export interface TargetsDeleteTargetMutationQueryParams {
13
+ /**
14
+ * Harness Account ID
15
+ * @example "abcdef1234567890ghijkl"
16
+ */
17
+ accountId: string;
18
+ /**
19
+ * Harness Organization ID
20
+ * @example "example_org"
21
+ */
22
+ orgId: string;
23
+ /**
24
+ * Harness Project ID
25
+ * @example "example_project"
26
+ */
27
+ projectId: string;
28
+ }
29
+ export type TargetsDeleteTargetOkResponse = ResponseWithPagination<unknown>;
30
+ export type TargetsDeleteTargetErrorResponse = NotFound;
31
+ export interface TargetsDeleteTargetProps extends TargetsDeleteTargetMutationPathParams, Omit<FetcherOptions<TargetsDeleteTargetMutationQueryParams, unknown>, 'url'> {
32
+ queryParams: TargetsDeleteTargetMutationQueryParams;
33
+ }
34
+ export declare function targetsDeleteTarget(props: TargetsDeleteTargetProps): Promise<TargetsDeleteTargetOkResponse>;
35
+ /**
36
+ * Delete an existing Test Target
37
+ */
38
+ export declare function useTargetsDeleteTargetMutation(options?: Omit<UseMutationOptions<TargetsDeleteTargetOkResponse, TargetsDeleteTargetErrorResponse, TargetsDeleteTargetProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<TargetsDeleteTargetOkResponse, NotFound, TargetsDeleteTargetProps, 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 targetsDeleteTarget(props) {
7
+ return fetcher(Object.assign({ url: `/api/v2/targets/${props.id}`, method: 'DELETE' }, props));
8
+ }
9
+ /**
10
+ * Delete an existing Test Target
11
+ */
12
+ export function useTargetsDeleteTargetMutation(options) {
13
+ return useMutation((mutateProps) => targetsDeleteTarget(mutateProps), options);
14
+ }
@@ -1,7 +1,20 @@
1
1
  export type { GetPathParamsType, ResponseWithPagination } from './helpers';
2
+ export type { ExemptionsDeleteExemptionErrorResponse, ExemptionsDeleteExemptionMutationPathParams, ExemptionsDeleteExemptionMutationQueryParams, ExemptionsDeleteExemptionOkResponse, ExemptionsDeleteExemptionProps, } from './hooks/useExemptionsDeleteExemptionMutation';
3
+ export { exemptionsDeleteExemption, useExemptionsDeleteExemptionMutation, } from './hooks/useExemptionsDeleteExemptionMutation';
4
+ export type { FrontendImpactedTargetsForExemptionErrorResponse, FrontendImpactedTargetsForExemptionOkResponse, FrontendImpactedTargetsForExemptionProps, FrontendImpactedTargetsForExemptionQueryPathParams, FrontendImpactedTargetsForExemptionQueryQueryParams, } from './hooks/useFrontendImpactedTargetsForExemptionQuery';
5
+ export { frontendImpactedTargetsForExemption, useFrontendImpactedTargetsForExemptionQuery, } from './hooks/useFrontendImpactedTargetsForExemptionQuery';
6
+ export type { FrontendIssueForExemptionErrorResponse, FrontendIssueForExemptionOkResponse, FrontendIssueForExemptionProps, FrontendIssueForExemptionQueryPathParams, FrontendIssueForExemptionQueryQueryParams, } from './hooks/useFrontendIssueForExemptionQuery';
7
+ export { frontendIssueForExemption, useFrontendIssueForExemptionQuery, } from './hooks/useFrontendIssueForExemptionQuery';
2
8
  export type { ScansScanIssueOccurrencesErrorResponse, ScansScanIssueOccurrencesOkResponse, ScansScanIssueOccurrencesProps, ScansScanIssueOccurrencesQueryPathParams, ScansScanIssueOccurrencesQueryQueryParams, } from './hooks/useScansScanIssueOccurrencesQuery';
3
9
  export { scansScanIssueOccurrences, useScansScanIssueOccurrencesQuery, } from './hooks/useScansScanIssueOccurrencesQuery';
10
+ export type { TargetsDeleteTargetErrorResponse, TargetsDeleteTargetMutationPathParams, TargetsDeleteTargetMutationQueryParams, TargetsDeleteTargetOkResponse, TargetsDeleteTargetProps, } from './hooks/useTargetsDeleteTargetMutation';
11
+ export { targetsDeleteTarget, useTargetsDeleteTargetMutation, } from './hooks/useTargetsDeleteTargetMutation';
12
+ export type { ExemptionImpactedTargetsResult } from './schemas/ExemptionImpactedTargetsResult';
13
+ export type { FrontendExemptionTargets } from './schemas/FrontendExemptionTargets';
14
+ export type { FrontendImpactedTargetsForExemptionResponseBody } from './schemas/FrontendImpactedTargetsForExemptionResponseBody';
15
+ export type { FrontendIssueForExemptionResponseBody } from './schemas/FrontendIssueForExemptionResponseBody';
4
16
  export type { GitMetadata } from './schemas/GitMetadata';
17
+ export type { IssueForExemptionResult } from './schemas/IssueForExemptionResult';
5
18
  export type { IssueInScan } from './schemas/IssueInScan';
6
19
  export type { NotFound } from './schemas/NotFound';
7
20
  export type { Pagination } from './schemas/Pagination';
@@ -1 +1,5 @@
1
+ export { exemptionsDeleteExemption, useExemptionsDeleteExemptionMutation, } from './hooks/useExemptionsDeleteExemptionMutation';
2
+ export { frontendImpactedTargetsForExemption, useFrontendImpactedTargetsForExemptionQuery, } from './hooks/useFrontendImpactedTargetsForExemptionQuery';
3
+ export { frontendIssueForExemption, useFrontendIssueForExemptionQuery, } from './hooks/useFrontendIssueForExemptionQuery';
1
4
  export { scansScanIssueOccurrences, useScansScanIssueOccurrencesQuery, } from './hooks/useScansScanIssueOccurrencesQuery';
5
+ export { targetsDeleteTarget, useTargetsDeleteTargetMutation, } from './hooks/useTargetsDeleteTargetMutation';
@@ -0,0 +1,14 @@
1
+ import type { FrontendExemptionTargets } from '../schemas/FrontendExemptionTargets';
2
+ import type { Pagination } from '../schemas/Pagination';
3
+ /**
4
+ * List of targets for an exemption
5
+ * @example {"impactedTargets":[{"executionId":"abcdef1234567890ghijkl","hash":"d1998db4b4651a4b9be9ecf320a2dfb8b4710e35","lastScanned":1634836529,"name":"NodeGoat","numExemptedOccurrences":150,"numOccurrences":150,"orgId":"example_org","parameters":{"branch":"main"},"pipelineId":"pipeline_1","projectId":"example_project","scanId":"abcdef1234567890ghijkl","targetId":"abcdef1234567890ghijkl","type":"repository"},{"executionId":"abcdef1234567890ghijkl","hash":"d1998db4b4651a4b9be9ecf320a2dfb8b4710e35","lastScanned":1634836529,"name":"NodeGoat","numExemptedOccurrences":150,"numOccurrences":150,"orgId":"example_org","parameters":{"branch":"main"},"pipelineId":"pipeline_1","projectId":"example_project","scanId":"abcdef1234567890ghijkl","targetId":"abcdef1234567890ghijkl","type":"repository"},{"executionId":"abcdef1234567890ghijkl","hash":"d1998db4b4651a4b9be9ecf320a2dfb8b4710e35","lastScanned":1634836529,"name":"NodeGoat","numExemptedOccurrences":150,"numOccurrences":150,"orgId":"example_org","parameters":{"branch":"main"},"pipelineId":"pipeline_1","projectId":"example_project","scanId":"abcdef1234567890ghijkl","targetId":"abcdef1234567890ghijkl","type":"repository"},{"executionId":"abcdef1234567890ghijkl","hash":"d1998db4b4651a4b9be9ecf320a2dfb8b4710e35","lastScanned":1634836529,"name":"NodeGoat","numExemptedOccurrences":150,"numOccurrences":150,"orgId":"example_org","parameters":{"branch":"main"},"pipelineId":"pipeline_1","projectId":"example_project","scanId":"abcdef1234567890ghijkl","targetId":"abcdef1234567890ghijkl","type":"repository"}],"pagination":{"link":"","page":4,"pageSize":20,"totalItems":230,"totalPages":12}}
6
+ */
7
+ export interface ExemptionImpactedTargetsResult {
8
+ /**
9
+ * Impacted target details
10
+ * @example [{"executionId":"abcdef1234567890ghijkl","hash":"d1998db4b4651a4b9be9ecf320a2dfb8b4710e35","lastScanned":1634836529,"name":"NodeGoat","numExemptedOccurrences":150,"numOccurrences":150,"orgId":"example_org","parameters":{"branch":"main"},"pipelineId":"pipeline_1","projectId":"example_project","scanId":"abcdef1234567890ghijkl","targetId":"abcdef1234567890ghijkl","type":"repository"},{"executionId":"abcdef1234567890ghijkl","hash":"d1998db4b4651a4b9be9ecf320a2dfb8b4710e35","lastScanned":1634836529,"name":"NodeGoat","numExemptedOccurrences":150,"numOccurrences":150,"orgId":"example_org","parameters":{"branch":"main"},"pipelineId":"pipeline_1","projectId":"example_project","scanId":"abcdef1234567890ghijkl","targetId":"abcdef1234567890ghijkl","type":"repository"}]
11
+ */
12
+ impactedTargets: FrontendExemptionTargets[];
13
+ pagination: Pagination;
14
+ }
@@ -0,0 +1,78 @@
1
+ /**
2
+ * Impacted targets from an exemption for frontend issue details
3
+ * @example {"executionId":"abcdef1234567890ghijkl","hash":"d1998db4b4651a4b9be9ecf320a2dfb8b4710e35","lastScanned":1634836529,"name":"NodeGoat","numExemptedOccurrences":150,"numOccurrences":150,"orgId":"example_org","parameters":{"branch":"main"},"pipelineId":"pipeline_1","projectId":"example_project","scanId":"abcdef1234567890ghijkl","targetId":"abcdef1234567890ghijkl","type":"repository"}
4
+ */
5
+ export interface FrontendExemptionTargets {
6
+ /**
7
+ * Harness Execution ID
8
+ * @example "abcdef1234567890ghijkl"
9
+ */
10
+ executionId?: string;
11
+ /**
12
+ * Git Commit or Container Image hash
13
+ * @example "d1998db4b4651a4b9be9ecf320a2dfb8b4710e35"
14
+ */
15
+ hash?: string;
16
+ /**
17
+ * Timestamp of the last detection of this issue
18
+ * @format float
19
+ * @example 1634836529
20
+ */
21
+ lastScanned?: number;
22
+ /**
23
+ * Name of the Test Target
24
+ * @example "NodeGoat"
25
+ */
26
+ name?: string;
27
+ /**
28
+ * Total number of occurrences exempted for an impacted target
29
+ * @format int32
30
+ * @default 0
31
+ * @example 150
32
+ */
33
+ numExemptedOccurrences?: number;
34
+ /**
35
+ * Total number of occurrences for an impacted target
36
+ * @format int32
37
+ * @default 0
38
+ * @example 150
39
+ */
40
+ numOccurrences?: number;
41
+ /**
42
+ * Harness Organization ID
43
+ * @example "example_org"
44
+ */
45
+ orgId?: string;
46
+ /**
47
+ * Parameters for this Variant, as a JSON-encoded string
48
+ * @example {"branch":"main"}
49
+ */
50
+ parameters: {
51
+ [key: string]: string;
52
+ };
53
+ /**
54
+ * ID of the Harness pipeline of the scan
55
+ * @example "pipeline_1"
56
+ */
57
+ pipelineId?: string;
58
+ /**
59
+ * Harness Project ID
60
+ * @example "example_project"
61
+ */
62
+ projectId?: string;
63
+ /**
64
+ * The Security Scan execution that detected this Security Issue
65
+ * @example "abcdef1234567890ghijkl"
66
+ */
67
+ scanId?: string;
68
+ /**
69
+ * Associated Target ID
70
+ * @example "abcdef1234567890ghijkl"
71
+ */
72
+ targetId: string;
73
+ /**
74
+ * Test Target's type
75
+ * @example "repository"
76
+ */
77
+ type?: 'configuration' | 'container' | 'instance' | 'repository';
78
+ }
@@ -0,0 +1,4 @@
1
+ /* eslint-disable */
2
+ // This code is autogenerated using @harnessio/oats-cli.
3
+ // Please do not modify this code directly.
4
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { ExemptionImpactedTargetsResult } from '../schemas/ExemptionImpactedTargetsResult';
2
+ export type FrontendImpactedTargetsForExemptionResponseBody = ExemptionImpactedTargetsResult;
@@ -0,0 +1,2 @@
1
+ import type { IssueForExemptionResult } from '../schemas/IssueForExemptionResult';
2
+ export type FrontendIssueForExemptionResponseBody = IssueForExemptionResult;
@@ -0,0 +1,147 @@
1
+ import type { Pagination } from '../schemas/Pagination';
2
+ /**
3
+ * @example {"baselineVariantId":"abcdef1234567890ghijkl","created":1651578240,"currentStatus":"Rejected","details":{"package":"json-schema","version":"v0.2.3"},"exemptionCoverage":"Partially Exempted","exemptionId":"abcdef1234567890ghijkl","exemptionStatusAtScan":"Expired","harnessAugmentation":{"Est est suscipit dolorum ea numquam.":"Ut maiores veritatis voluptatibus error modi.","Velit autem.":"Neque totam magni atque."},"id":"abcdef1234567890ghijkl","key":"json-schema@0.2.3","numOccurrences":10,"occurrenceId":12345,"occurrences":[{"line":"42"},{"line":"666"}],"occurrencesPagination":{"link":"","page":4,"pageSize":20,"totalItems":230,"totalPages":12},"productId":"product1234567890abcde","severity":8.5,"severityCode":"High","status":"Remediated","subproduct":"product","targetId":"abcdef1234567890ghijkl","targetName":"abcdef1234567890ghijkl","targetType":"repository","targetVariantId":"abcdef1234567890ghijkl","targetVariantName":"nodegoat:master","targets":[{"targetId":"target2222222222222222","targetName":"Target 1"}],"title":"json-schema@0.2.3 is vulnerable to Prototype Pollution","type":"SAST"}
4
+ */
5
+ export interface IssueForExemptionResult {
6
+ /**
7
+ * The Baseline Target Variant related to this Security Issue
8
+ * @example "abcdef1234567890ghijkl"
9
+ */
10
+ baselineVariantId?: string;
11
+ /**
12
+ * Unix timestamp at which the resource was created
13
+ * @format int64
14
+ * @example 1651578240
15
+ */
16
+ created: number;
17
+ /**
18
+ * Current status of the Exemption
19
+ * @example "Rejected"
20
+ */
21
+ currentStatus?: 'Approved' | 'Expired' | 'Pending' | 'Rejected';
22
+ /**
23
+ * Issue details common to all occurrences
24
+ * @example {"package":"json-schema","version":"v0.2.3"}
25
+ */
26
+ details: {
27
+ [key: string]: any;
28
+ };
29
+ /**
30
+ * Indicates if the Security Issue was found to be Exempted, Partially Exempted.
31
+ * @example "Partially Exempted"
32
+ */
33
+ exemptionCoverage?: string;
34
+ /**
35
+ * ID of the associated Exemption
36
+ * @example "abcdef1234567890ghijkl"
37
+ */
38
+ exemptionId?: string;
39
+ /**
40
+ * Exemption's status at the Security Scan created time
41
+ * @example "Approved"
42
+ */
43
+ exemptionStatusAtScan?: 'Approved' | 'Expired' | 'Pending' | 'Rejected';
44
+ /**
45
+ * Harness Augmentation details
46
+ * @example {"Aliquid deserunt autem at.":"Quaerat veritatis temporibus doloremque.","Iste error necessitatibus eos deleniti quo.":"Delectus architecto.","Molestiae distinctio fugiat quae.":"Dignissimos qui rerum incidunt consequatur et."}
47
+ */
48
+ harnessAugmentation?: {
49
+ [key: string]: any;
50
+ };
51
+ /**
52
+ * Resource identifier
53
+ * @example "abcdef1234567890ghijkl"
54
+ */
55
+ id: string;
56
+ /**
57
+ * Compression/deduplication key
58
+ * @example "json-schema@0.2.3"
59
+ */
60
+ key: string;
61
+ /**
62
+ * Indicates the number of Occurrences on the Issue
63
+ * @format int32
64
+ * @example 10
65
+ */
66
+ numOccurrences?: number;
67
+ /**
68
+ * @format int64
69
+ * @example 12345
70
+ */
71
+ occurrenceId?: number;
72
+ /**
73
+ * Array of details unique to each occurrence
74
+ * @example [{"line":"42"},{"line":"666"}]
75
+ */
76
+ occurrences?: Array<{
77
+ [key: string]: any;
78
+ }>;
79
+ occurrencesPagination?: Pagination;
80
+ /**
81
+ * The scan tool that identified this Security Issue
82
+ * @example "product1234567890abcde"
83
+ */
84
+ productId: string;
85
+ /**
86
+ * Numeric severity, from 0 (lowest) to 10 (highest)
87
+ * @format float
88
+ * @example 8.5
89
+ */
90
+ severity: number;
91
+ /**
92
+ * Severity code
93
+ * @example "High"
94
+ */
95
+ severityCode: 'Critical' | 'High' | 'Info' | 'Low' | 'Medium' | 'Unassigned';
96
+ /**
97
+ * Indicates if the Security Issue was found to be remediated, ignored, etc.
98
+ * @example "Remediated"
99
+ */
100
+ status?: 'Acceptable Risk' | 'Acceptable Use' | 'Compensating Controls' | 'Exempted' | 'False Positive' | 'Fix Unavailable' | 'Remediated';
101
+ /**
102
+ * The subproduct that identified this Security Issue
103
+ * @example "product"
104
+ */
105
+ subproduct?: string;
106
+ /**
107
+ * The Target that this Security Issue affects
108
+ * @example "abcdef1234567890ghijkl"
109
+ */
110
+ targetId?: string;
111
+ /**
112
+ * The Name of the Target that this Security Issue affects
113
+ * @example "abcdef1234567890ghijkl"
114
+ */
115
+ targetName?: string;
116
+ /**
117
+ * The type of the Target that this Security Issue affects
118
+ * @example "repository"
119
+ */
120
+ targetType: 'configuration' | 'container' | 'instance' | 'repository';
121
+ /**
122
+ * The Target Variant that this Security Issue affects
123
+ * @example "abcdef1234567890ghijkl"
124
+ */
125
+ targetVariantId?: string;
126
+ /**
127
+ * Name of the associated Target and Variant
128
+ * @example "nodegoat:master"
129
+ */
130
+ targetVariantName?: string;
131
+ /**
132
+ * @example [{"targetId":"target2222222222222222","targetName":"Target 1"}]
133
+ */
134
+ targets: Array<{
135
+ [key: string]: any;
136
+ }>;
137
+ /**
138
+ * Title of the Security Issue
139
+ * @example "json-schema@0.2.3 is vulnerable to Prototype Pollution"
140
+ */
141
+ title: string;
142
+ /**
143
+ * The type of vulnerability or quality issue for this Issue
144
+ * @example "SAST"
145
+ */
146
+ type?: 'BUG_SMELLS' | 'CODE_COVERAGE' | 'CODE_SMELLS' | 'DAST' | 'EXTERNAL_POLICY' | 'IAC' | 'MISCONFIG' | 'SAST' | 'SCA' | 'SECRET';
147
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harnessio/react-sto-core-client",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "Harness STO service APIs integrated with react hooks",
5
5
  "author": "Harness Inc",
6
6
  "license": "MIT",