@harnessio/react-ssca-manager-client 0.0.3 → 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.
Files changed (25) hide show
  1. package/dist/ssca-manager/src/services/hooks/useGetPolicyViolationsQuery.d.ts +34 -0
  2. package/dist/ssca-manager/src/services/hooks/useGetPolicyViolationsQuery.js +14 -0
  3. package/dist/ssca-manager/src/services/index.d.ts +4 -10
  4. package/dist/ssca-manager/src/services/index.js +1 -1
  5. package/dist/ssca-manager/src/services/responses/PolicyViolationResponseResponse.d.ts +2 -0
  6. package/dist/ssca-manager/src/services/schemas/PolicyViolation.d.ts +19 -0
  7. package/package.json +1 -1
  8. package/dist/ssca-manager/src/services/hooks/useProcessSbomMutation.d.ts +0 -23
  9. package/dist/ssca-manager/src/services/hooks/useProcessSbomMutation.js +0 -14
  10. package/dist/ssca-manager/src/services/requestBodies/SbomProcessRequestBodyRequestBody.d.ts +0 -2
  11. package/dist/ssca-manager/src/services/responses/SbomProcessResponseBodyResponse.d.ts +0 -2
  12. package/dist/ssca-manager/src/services/responses/SbomProcessResponseBodyResponse.js +0 -1
  13. package/dist/ssca-manager/src/services/schemas/Artifact.d.ts +0 -28
  14. package/dist/ssca-manager/src/services/schemas/Attestation.d.ts +0 -11
  15. package/dist/ssca-manager/src/services/schemas/Attestation.js +0 -4
  16. package/dist/ssca-manager/src/services/schemas/SbomMetadata.d.ts +0 -47
  17. package/dist/ssca-manager/src/services/schemas/SbomMetadata.js +0 -4
  18. package/dist/ssca-manager/src/services/schemas/SbomProcess.d.ts +0 -22
  19. package/dist/ssca-manager/src/services/schemas/SbomProcess.js +0 -4
  20. package/dist/ssca-manager/src/services/schemas/SbomProcessRequestBody.d.ts +0 -10
  21. package/dist/ssca-manager/src/services/schemas/SbomProcessRequestBody.js +0 -1
  22. package/dist/ssca-manager/src/services/schemas/SbomProcessResponseBody.d.ts +0 -6
  23. package/dist/ssca-manager/src/services/schemas/SbomProcessResponseBody.js +0 -4
  24. /package/dist/ssca-manager/src/services/{requestBodies/SbomProcessRequestBodyRequestBody.js → responses/PolicyViolationResponseResponse.js} +0 -0
  25. /package/dist/ssca-manager/src/services/schemas/{Artifact.js → PolicyViolation.js} +0 -0
@@ -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,11 +1,5 @@
1
1
  export type { GetPathParamsType, ResponseWithPagination } from './helpers';
2
- export type { ProcessSbomErrorResponse, ProcessSbomMutationPathParams, ProcessSbomOkResponse, ProcessSbomProps, ProcessSbomRequestBody, } from './hooks/useProcessSbomMutation';
3
- export { processSbom, useProcessSbomMutation } from './hooks/useProcessSbomMutation';
4
- export type { SbomProcessRequestBodyRequestBody } from './requestBodies/SbomProcessRequestBodyRequestBody';
5
- export type { SbomProcessResponseBodyResponse } from './responses/SbomProcessResponseBodyResponse';
6
- export type { Artifact } from './schemas/Artifact';
7
- export type { Attestation } from './schemas/Attestation';
8
- export type { SbomMetadata } from './schemas/SbomMetadata';
9
- export type { SbomProcess } from './schemas/SbomProcess';
10
- export type { SbomProcessRequestBody } from './schemas/SbomProcessRequestBody';
11
- export type { SbomProcessResponseBody } from './schemas/SbomProcessResponseBody';
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 { processSbom, useProcessSbomMutation } from './hooks/useProcessSbomMutation';
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
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harnessio/react-ssca-manager-client",
3
- "version": "0.0.3",
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",
@@ -1,23 +0,0 @@
1
- import { UseMutationOptions } from '@tanstack/react-query';
2
- import type { SbomProcessResponseBodyResponse } from '../responses/SbomProcessResponseBodyResponse';
3
- import type { SbomProcessRequestBodyRequestBody } from '../requestBodies/SbomProcessRequestBodyRequestBody';
4
- import type { ResponseWithPagination } from '../helpers';
5
- import { FetcherOptions } from '../../../../fetcher/index.js';
6
- export interface ProcessSbomMutationPathParams {
7
- org: string;
8
- project: string;
9
- }
10
- export interface ProcessSbomMutationHeaderParams {
11
- 'Harness-Account'?: string;
12
- }
13
- export type ProcessSbomRequestBody = SbomProcessRequestBodyRequestBody;
14
- export type ProcessSbomOkResponse = ResponseWithPagination<SbomProcessResponseBodyResponse>;
15
- export type ProcessSbomErrorResponse = unknown;
16
- export interface ProcessSbomProps extends ProcessSbomMutationPathParams, Omit<FetcherOptions<unknown, ProcessSbomRequestBody, ProcessSbomMutationHeaderParams>, 'url'> {
17
- body: ProcessSbomRequestBody;
18
- }
19
- export declare function processSbom(props: ProcessSbomProps): Promise<ProcessSbomOkResponse>;
20
- /**
21
- * process & inject sbom
22
- */
23
- export declare function useProcessSbomMutation(options?: Omit<UseMutationOptions<ProcessSbomOkResponse, ProcessSbomErrorResponse, ProcessSbomProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<ProcessSbomOkResponse, unknown, ProcessSbomProps, unknown>;
@@ -1,14 +0,0 @@
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 processSbom(props) {
7
- return fetcher(Object.assign({ url: `/v1/org/${props.org}/project/${props.project}/sbom/process`, method: 'POST' }, props));
8
- }
9
- /**
10
- * process & inject sbom
11
- */
12
- export function useProcessSbomMutation(options) {
13
- return useMutation((mutateProps) => processSbom(mutateProps), options);
14
- }
@@ -1,2 +0,0 @@
1
- import type { SbomProcessRequestBody } from '../schemas/SbomProcessRequestBody';
2
- export type SbomProcessRequestBodyRequestBody = SbomProcessRequestBody;
@@ -1,2 +0,0 @@
1
- import type { SbomProcessResponseBody } from '../schemas/SbomProcessResponseBody';
2
- export type SbomProcessResponseBodyResponse = SbomProcessResponseBody;
@@ -1,28 +0,0 @@
1
- export interface Artifact {
2
- /**
3
- * id of the artifact
4
- * @example "089855ea-f90e-4bea-a5c9-b5ddf85d3180"
5
- */
6
- id?: string;
7
- /**
8
- * name of the artifact
9
- * @example "harness/image"
10
- */
11
- name: string;
12
- /**
13
- * url of the artifact
14
- * @example "https://console.cloud.google.com/gcr/images/imageName"
15
- */
16
- registry_url: string;
17
- /**
18
- * tag of the artifact
19
- * @default "latest"
20
- * @example "latest"
21
- */
22
- tag?: string;
23
- /**
24
- * type of the artifact
25
- * @example "repo/image"
26
- */
27
- type?: string;
28
- }
@@ -1,11 +0,0 @@
1
- export interface Attestation {
2
- /**
3
- * is the sbom attested or not
4
- */
5
- is_attested?: boolean;
6
- /**
7
- * url of the attested file
8
- * @example "https://storage.googleapis.com/sbom_store_public/kmpySmUISimoRrJL6NL73w/default/SSCS_CI_Plugin_Demo/CKO_SSCA_Pipeline/Build/39/q940CvjoQj-GEInJQfWiwg/sbom"
9
- */
10
- url?: string;
11
- }
@@ -1,4 +0,0 @@
1
- /* eslint-disable */
2
- // This code is autogenerated using @harnessio/oats-cli.
3
- // Please do not modify this code directly.
4
- export {};
@@ -1,47 +0,0 @@
1
- export interface SbomMetadata {
2
- /**
3
- * BuildURL
4
- * @example "https://app.harness.io/ng/#/account/acc/ci/orgs/org/projects/dummyProject/pipelines/CKO_SSCA_Pipeline/executions/q940CvjoQj-GEInJQfWiwg/pipeline?storeType=INLINE"
5
- */
6
- build_url?: string;
7
- /**
8
- * stage name where sbom is generated
9
- * @example "spdx-json"
10
- */
11
- format?: string;
12
- /**
13
- * name of the package
14
- * @example "z940CvjoQj-GEInJQfWiwq"
15
- */
16
- pipeline_execution_id?: string;
17
- /**
18
- * name of the package
19
- * @example "SSCA_Pipeline"
20
- */
21
- pipeline_identifier?: string;
22
- /**
23
- * name of the package
24
- * @example "1"
25
- */
26
- sequence_id?: string;
27
- /**
28
- * name of the Stage
29
- * @example "Build"
30
- */
31
- stage_identifier?: string;
32
- /**
33
- * StepExecutionId
34
- * @example "betatest1"
35
- */
36
- step_execution_id?: string;
37
- /**
38
- * id of the step
39
- * @example "Orchestrate"
40
- */
41
- step_identifier?: string;
42
- /**
43
- * name of the package
44
- * @example "synk"
45
- */
46
- tool?: string;
47
- }
@@ -1,4 +0,0 @@
1
- /* eslint-disable */
2
- // This code is autogenerated using @harnessio/oats-cli.
3
- // Please do not modify this code directly.
4
- export {};
@@ -1,22 +0,0 @@
1
- export interface SbomProcess {
2
- /**
3
- * serialised sbom data
4
- * @format byte
5
- */
6
- data?: string;
7
- /**
8
- * format of the SBOM
9
- * @example "spdx-json"
10
- */
11
- format: string;
12
- /**
13
- * name of the sbom
14
- * @example "SBOM_Name"
15
- */
16
- name: string;
17
- /**
18
- * URL of the sbom
19
- * @example "https://console.google.com/storage"
20
- */
21
- url?: string;
22
- }
@@ -1,4 +0,0 @@
1
- /* eslint-disable */
2
- // This code is autogenerated using @harnessio/oats-cli.
3
- // Please do not modify this code directly.
4
- export {};
@@ -1,10 +0,0 @@
1
- import type { Artifact } from '../schemas/Artifact';
2
- import type { Attestation } from '../schemas/Attestation';
3
- import type { SbomMetadata } from '../schemas/SbomMetadata';
4
- import type { SbomProcess } from '../schemas/SbomProcess';
5
- export interface SbomProcessRequestBody {
6
- artifact?: Artifact;
7
- attestation?: Attestation;
8
- sbom_metadata?: SbomMetadata;
9
- sbom_process?: SbomProcess;
10
- }
@@ -1,6 +0,0 @@
1
- export interface SbomProcessResponseBody {
2
- /**
3
- * Id of created artifact
4
- */
5
- artifact_id?: string;
6
- }
@@ -1,4 +0,0 @@
1
- /* eslint-disable */
2
- // This code is autogenerated using @harnessio/oats-cli.
3
- // Please do not modify this code directly.
4
- export {};