@harnessio/react-ssca-manager-client 0.0.2 → 0.1.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.
@@ -0,0 +1,34 @@
1
+ import { UseQueryOptions } from '@tanstack/react-query';
2
+ import type { PolicyViolationResponseResponse } from '../responses/PolicyViolationResponseResponse';
3
+ import type { ResponseWithPagination } from '../helpers';
4
+ import { FetcherOptions } from '../../../../fetcher/index.js';
5
+ export interface GetPolicyViolationsQueryPathParams {
6
+ org: string;
7
+ project: string;
8
+ 'enforcement-id': string;
9
+ }
10
+ export interface GetPolicyViolationsQueryQueryParams {
11
+ /**
12
+ * @default 30
13
+ */
14
+ limit?: number;
15
+ order?: 'ASC' | 'DESC';
16
+ /**
17
+ * @default 0
18
+ */
19
+ page?: number;
20
+ sort?: 'created' | 'identifier' | 'name' | 'updated';
21
+ }
22
+ export interface GetPolicyViolationsQueryHeaderParams {
23
+ 'Harness-Account'?: string;
24
+ }
25
+ export type GetPolicyViolationsOkResponse = ResponseWithPagination<PolicyViolationResponseResponse>;
26
+ export type GetPolicyViolationsErrorResponse = unknown;
27
+ export interface GetPolicyViolationsProps extends GetPolicyViolationsQueryPathParams, Omit<FetcherOptions<GetPolicyViolationsQueryQueryParams, unknown, GetPolicyViolationsQueryHeaderParams>, 'url'> {
28
+ queryParams: GetPolicyViolationsQueryQueryParams;
29
+ }
30
+ export declare function getPolicyViolations(props: GetPolicyViolationsProps): Promise<GetPolicyViolationsOkResponse>;
31
+ /**
32
+ * List Policy Violations
33
+ */
34
+ export declare function useGetPolicyViolationsQuery(props: GetPolicyViolationsProps, options?: Omit<UseQueryOptions<GetPolicyViolationsOkResponse, GetPolicyViolationsErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<GetPolicyViolationsOkResponse, 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 getPolicyViolations(props) {
7
+ return fetcher(Object.assign({ url: `/v1/org/${props.org}/project/${props.project}/enforcement/${props['enforcement-id']}/policy-violations`, method: 'GET' }, props));
8
+ }
9
+ /**
10
+ * List Policy Violations
11
+ */
12
+ export function useGetPolicyViolationsQuery(props, options) {
13
+ return useQuery(['getPolicyViolations', props.org, props.project, props['enforcement-id'], props.queryParams], ({ signal }) => getPolicyViolations(Object.assign(Object.assign({}, props), { signal })), options);
14
+ }
@@ -1 +1,5 @@
1
1
  export type { GetPathParamsType, ResponseWithPagination } from './helpers';
2
+ export type { GetPolicyViolationsErrorResponse, GetPolicyViolationsOkResponse, GetPolicyViolationsProps, GetPolicyViolationsQueryPathParams, GetPolicyViolationsQueryQueryParams, } from './hooks/useGetPolicyViolationsQuery';
3
+ export { getPolicyViolations, useGetPolicyViolationsQuery, } from './hooks/useGetPolicyViolationsQuery';
4
+ export type { PolicyViolationResponseResponse } from './responses/PolicyViolationResponseResponse';
5
+ export type { PolicyViolation } from './schemas/PolicyViolation';
@@ -1 +1 @@
1
- export {};
1
+ export { getPolicyViolations, useGetPolicyViolationsQuery, } from './hooks/useGetPolicyViolationsQuery';
@@ -0,0 +1,2 @@
1
+ import type { PolicyViolation } from '../schemas/PolicyViolation';
2
+ export type PolicyViolationResponseResponse = PolicyViolation[];
@@ -0,0 +1,19 @@
1
+ export interface PolicyViolation {
2
+ account?: string;
3
+ artifact_id?: string;
4
+ enforcement_id?: string;
5
+ image_name?: string;
6
+ license?: string[];
7
+ name?: string;
8
+ orchestration_id?: string;
9
+ org?: string;
10
+ package_manager?: string;
11
+ project?: string;
12
+ purl?: string;
13
+ supplier?: string;
14
+ supplier_type?: string;
15
+ tag?: string;
16
+ version?: string;
17
+ violation_details?: string;
18
+ violation_type?: string;
19
+ }
@@ -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 {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harnessio/react-ssca-manager-client",
3
- "version": "0.0.2",
3
+ "version": "0.1.0",
4
4
  "description": "Harness SSCA manager APIs integrated with react hooks",
5
5
  "author": "Harness Inc",
6
6
  "license": "MIT",