@harnessio/react-ssca-manager-client 0.1.1 → 0.3.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 (32) hide show
  1. package/dist/ssca-manager/src/services/hooks/useDownloadSbomQuery.d.ts +2 -2
  2. package/dist/ssca-manager/src/services/hooks/useDownloadSbomQuery.js +1 -1
  3. package/dist/ssca-manager/src/services/hooks/useGetArtifactDetailComponentViewMutation.d.ts +44 -0
  4. package/dist/ssca-manager/src/services/hooks/useGetArtifactDetailComponentViewMutation.js +14 -0
  5. package/dist/ssca-manager/src/services/hooks/useGetPolicyViolationsQuery.d.ts +8 -1
  6. package/dist/ssca-manager/src/services/hooks/useListArtifactsMutation.d.ts +42 -0
  7. package/dist/ssca-manager/src/services/hooks/useListArtifactsMutation.js +14 -0
  8. package/dist/ssca-manager/src/services/hooks/useListLatestArtifactsMutation.d.ts +39 -0
  9. package/dist/ssca-manager/src/services/hooks/useListLatestArtifactsMutation.js +14 -0
  10. package/dist/ssca-manager/src/services/index.d.ts +15 -2
  11. package/dist/ssca-manager/src/services/index.js +3 -0
  12. package/dist/ssca-manager/src/services/requestBodies/ArtifactListingRequestBodyRequestBody.d.ts +2 -0
  13. package/dist/ssca-manager/src/services/responses/ArtifactComponentViewResponseBodyResponse.d.ts +2 -0
  14. package/dist/ssca-manager/src/services/responses/ArtifactComponentViewResponseBodyResponse.js +1 -0
  15. package/dist/ssca-manager/src/services/responses/ArtifactListingResponseBodyResponse.d.ts +2 -0
  16. package/dist/ssca-manager/src/services/responses/ArtifactListingResponseBodyResponse.js +1 -0
  17. package/dist/ssca-manager/src/services/responses/ArtifactSbomResponseBodyResponse.d.ts +2 -0
  18. package/dist/ssca-manager/src/services/responses/ArtifactSbomResponseBodyResponse.js +1 -0
  19. package/dist/ssca-manager/src/services/schemas/ArtifactComponentViewRequestBody.d.ts +13 -0
  20. package/dist/ssca-manager/src/services/schemas/ArtifactComponentViewResponse.d.ts +8 -0
  21. package/dist/ssca-manager/src/services/schemas/ArtifactComponentViewResponse.js +4 -0
  22. package/dist/ssca-manager/src/services/schemas/ArtifactListingRequestBody.d.ts +14 -0
  23. package/dist/ssca-manager/src/services/schemas/ArtifactListingRequestBody.js +4 -0
  24. package/dist/ssca-manager/src/services/schemas/ArtifactListingResponse.d.ts +13 -0
  25. package/dist/ssca-manager/src/services/schemas/ArtifactListingResponse.js +4 -0
  26. package/dist/ssca-manager/src/services/schemas/ArtifactSbomResponseBody.d.ts +6 -0
  27. package/dist/ssca-manager/src/services/schemas/ArtifactSbomResponseBody.js +4 -0
  28. package/package.json +1 -1
  29. package/dist/ssca-manager/src/services/responses/TokenIssueResponseBodyResponse.d.ts +0 -2
  30. package/dist/ssca-manager/src/services/schemas/TokenIssueResponseBody.d.ts +0 -6
  31. /package/dist/ssca-manager/src/services/{responses/TokenIssueResponseBodyResponse.js → requestBodies/ArtifactListingRequestBodyRequestBody.js} +0 -0
  32. /package/dist/ssca-manager/src/services/schemas/{TokenIssueResponseBody.js → ArtifactComponentViewRequestBody.js} +0 -0
@@ -1,5 +1,5 @@
1
1
  import { UseQueryOptions } from '@tanstack/react-query';
2
- import type { TokenIssueResponseBodyResponse } from '../responses/TokenIssueResponseBodyResponse';
2
+ import type { ArtifactSbomResponseBodyResponse } from '../responses/ArtifactSbomResponseBodyResponse';
3
3
  import type { ResponseWithPagination } from '../helpers';
4
4
  import { FetcherOptions } from '../../../../fetcher/index.js';
5
5
  export interface DownloadSbomQueryPathParams {
@@ -10,7 +10,7 @@ export interface DownloadSbomQueryPathParams {
10
10
  export interface DownloadSbomQueryHeaderParams {
11
11
  'Harness-Account'?: string;
12
12
  }
13
- export type DownloadSbomOkResponse = ResponseWithPagination<TokenIssueResponseBodyResponse>;
13
+ export type DownloadSbomOkResponse = ResponseWithPagination<ArtifactSbomResponseBodyResponse>;
14
14
  export type DownloadSbomErrorResponse = unknown;
15
15
  export interface DownloadSbomProps extends DownloadSbomQueryPathParams, Omit<FetcherOptions<unknown, unknown, DownloadSbomQueryHeaderParams>, 'url'> {
16
16
  }
@@ -10,5 +10,5 @@ export function downloadSbom(props) {
10
10
  * Download SBOM for an artifact
11
11
  */
12
12
  export function useDownloadSbomQuery(props, options) {
13
- return useQuery(['download-sbom', props.org, props.project, props['orchestration-id']], ({ signal }) => downloadSbom(Object.assign(Object.assign({}, props), { signal })), options);
13
+ return useQuery(['downloadSbom', props.org, props.project, props['orchestration-id']], ({ signal }) => downloadSbom(Object.assign(Object.assign({}, props), { signal })), options);
14
14
  }
@@ -0,0 +1,44 @@
1
+ import { UseMutationOptions } from '@tanstack/react-query';
2
+ import type { ArtifactComponentViewResponseBodyResponse } from '../responses/ArtifactComponentViewResponseBodyResponse';
3
+ import type { ArtifactComponentViewRequestBody } from '../schemas/ArtifactComponentViewRequestBody';
4
+ import type { ResponseWithPagination } from '../helpers';
5
+ import { FetcherOptions } from '../../../../fetcher/index.js';
6
+ export interface GetArtifactDetailComponentViewMutationPathParams {
7
+ org: string;
8
+ project: string;
9
+ artifact: string;
10
+ tag: string;
11
+ }
12
+ export interface GetArtifactDetailComponentViewMutationQueryParams {
13
+ /**
14
+ * @default 30
15
+ */
16
+ limit?: number;
17
+ /**
18
+ * @default "ASC"
19
+ */
20
+ order?: 'ASC' | 'DESC';
21
+ /**
22
+ * @default 0
23
+ */
24
+ page?: number;
25
+ /**
26
+ * @default "name"
27
+ */
28
+ sort?: 'created' | 'identifier' | 'license' | 'name' | 'supplier' | 'updated';
29
+ }
30
+ export interface GetArtifactDetailComponentViewMutationHeaderParams {
31
+ 'Harness-Account'?: string;
32
+ }
33
+ export type GetArtifactDetailComponentViewRequestBody = ArtifactComponentViewRequestBody;
34
+ export type GetArtifactDetailComponentViewOkResponse = ResponseWithPagination<ArtifactComponentViewResponseBodyResponse>;
35
+ export type GetArtifactDetailComponentViewErrorResponse = unknown;
36
+ export interface GetArtifactDetailComponentViewProps extends GetArtifactDetailComponentViewMutationPathParams, Omit<FetcherOptions<GetArtifactDetailComponentViewMutationQueryParams, GetArtifactDetailComponentViewRequestBody, GetArtifactDetailComponentViewMutationHeaderParams>, 'url'> {
37
+ queryParams: GetArtifactDetailComponentViewMutationQueryParams;
38
+ body: GetArtifactDetailComponentViewRequestBody;
39
+ }
40
+ export declare function getArtifactDetailComponentView(props: GetArtifactDetailComponentViewProps): Promise<GetArtifactDetailComponentViewOkResponse>;
41
+ /**
42
+ * Get artifact detail component view
43
+ */
44
+ export declare function useGetArtifactDetailComponentViewMutation(options?: Omit<UseMutationOptions<GetArtifactDetailComponentViewOkResponse, GetArtifactDetailComponentViewErrorResponse, GetArtifactDetailComponentViewProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<GetArtifactDetailComponentViewOkResponse, unknown, GetArtifactDetailComponentViewProps, 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 getArtifactDetailComponentView(props) {
7
+ return fetcher(Object.assign({ url: `/v1/org/${props.org}/project/${props.project}/artifact/${props.artifact}/tag/${props.tag}/components`, method: 'POST' }, props));
8
+ }
9
+ /**
10
+ * Get artifact detail component view
11
+ */
12
+ export function useGetArtifactDetailComponentViewMutation(options) {
13
+ return useMutation((mutateProps) => getArtifactDetailComponentView(mutateProps), options);
14
+ }
@@ -12,12 +12,19 @@ export interface GetPolicyViolationsQueryQueryParams {
12
12
  * @default 30
13
13
  */
14
14
  limit?: number;
15
+ /**
16
+ * @default "ASC"
17
+ */
15
18
  order?: 'ASC' | 'DESC';
16
19
  /**
17
20
  * @default 0
18
21
  */
19
22
  page?: number;
20
- sort?: 'created' | 'identifier' | 'name' | 'updated';
23
+ /**
24
+ * @default "name"
25
+ */
26
+ sort?: 'created' | 'identifier' | 'license' | 'name' | 'supplier' | 'updated';
27
+ search_text?: string;
21
28
  }
22
29
  export interface GetPolicyViolationsQueryHeaderParams {
23
30
  'Harness-Account'?: string;
@@ -0,0 +1,42 @@
1
+ import { UseMutationOptions } from '@tanstack/react-query';
2
+ import type { ArtifactListingResponseBodyResponse } from '../responses/ArtifactListingResponseBodyResponse';
3
+ import type { ArtifactListingRequestBodyRequestBody } from '../requestBodies/ArtifactListingRequestBodyRequestBody';
4
+ import type { ResponseWithPagination } from '../helpers';
5
+ import { FetcherOptions } from '../../../../fetcher/index.js';
6
+ export interface ListArtifactsMutationPathParams {
7
+ org: string;
8
+ project: string;
9
+ }
10
+ export interface ListArtifactsMutationQueryParams {
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?: 'created' | 'identifier' | 'license' | 'name' | 'supplier' | 'updated';
27
+ }
28
+ export interface ListArtifactsMutationHeaderParams {
29
+ 'Harness-Account'?: string;
30
+ }
31
+ export type ListArtifactsRequestBody = ArtifactListingRequestBodyRequestBody;
32
+ export type ListArtifactsOkResponse = ResponseWithPagination<ArtifactListingResponseBodyResponse>;
33
+ export type ListArtifactsErrorResponse = unknown;
34
+ export interface ListArtifactsProps extends ListArtifactsMutationPathParams, Omit<FetcherOptions<ListArtifactsMutationQueryParams, ListArtifactsRequestBody, ListArtifactsMutationHeaderParams>, 'url'> {
35
+ queryParams: ListArtifactsMutationQueryParams;
36
+ body: ListArtifactsRequestBody;
37
+ }
38
+ export declare function listArtifacts(props: ListArtifactsProps): Promise<ListArtifactsOkResponse>;
39
+ /**
40
+ * List all artifacts
41
+ */
42
+ export declare function useListArtifactsMutation(options?: Omit<UseMutationOptions<ListArtifactsOkResponse, ListArtifactsErrorResponse, ListArtifactsProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<ListArtifactsOkResponse, unknown, ListArtifactsProps, 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 listArtifacts(props) {
7
+ return fetcher(Object.assign({ url: `/v1/org/${props.org}/project/${props.project}/artifacts`, method: 'POST' }, props));
8
+ }
9
+ /**
10
+ * List all artifacts
11
+ */
12
+ export function useListArtifactsMutation(options) {
13
+ return useMutation((mutateProps) => listArtifacts(mutateProps), options);
14
+ }
@@ -0,0 +1,39 @@
1
+ import { UseMutationOptions } from '@tanstack/react-query';
2
+ import type { ArtifactListingResponseBodyResponse } from '../responses/ArtifactListingResponseBodyResponse';
3
+ import type { ResponseWithPagination } from '../helpers';
4
+ import { FetcherOptions } from '../../../../fetcher/index.js';
5
+ export interface ListLatestArtifactsMutationPathParams {
6
+ org: string;
7
+ project: string;
8
+ }
9
+ export interface ListLatestArtifactsMutationQueryParams {
10
+ /**
11
+ * @default 30
12
+ */
13
+ limit?: number;
14
+ /**
15
+ * @default "ASC"
16
+ */
17
+ order?: 'ASC' | 'DESC';
18
+ /**
19
+ * @default 0
20
+ */
21
+ page?: number;
22
+ /**
23
+ * @default "name"
24
+ */
25
+ sort?: 'created' | 'identifier' | 'license' | 'name' | 'supplier' | 'updated';
26
+ }
27
+ export interface ListLatestArtifactsMutationHeaderParams {
28
+ 'Harness-Account'?: string;
29
+ }
30
+ export type ListLatestArtifactsOkResponse = ResponseWithPagination<ArtifactListingResponseBodyResponse>;
31
+ export type ListLatestArtifactsErrorResponse = unknown;
32
+ export interface ListLatestArtifactsProps extends ListLatestArtifactsMutationPathParams, Omit<FetcherOptions<ListLatestArtifactsMutationQueryParams, unknown, ListLatestArtifactsMutationHeaderParams>, 'url'> {
33
+ queryParams: ListLatestArtifactsMutationQueryParams;
34
+ }
35
+ export declare function listLatestArtifacts(props: ListLatestArtifactsProps): Promise<ListLatestArtifactsOkResponse>;
36
+ /**
37
+ * List latest version of all artifacts
38
+ */
39
+ export declare function useListLatestArtifactsMutation(options?: Omit<UseMutationOptions<ListLatestArtifactsOkResponse, ListLatestArtifactsErrorResponse, ListLatestArtifactsProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<ListLatestArtifactsOkResponse, unknown, ListLatestArtifactsProps, 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 listLatestArtifacts(props) {
7
+ return fetcher(Object.assign({ url: `/v1/org/${props.org}/project/${props.project}/grouped-artifacts`, method: 'POST' }, props));
8
+ }
9
+ /**
10
+ * List latest version of all artifacts
11
+ */
12
+ export function useListLatestArtifactsMutation(options) {
13
+ return useMutation((mutateProps) => listLatestArtifacts(mutateProps), options);
14
+ }
@@ -1,9 +1,22 @@
1
1
  export type { GetPathParamsType, ResponseWithPagination } from './helpers';
2
2
  export type { DownloadSbomErrorResponse, DownloadSbomOkResponse, DownloadSbomProps, DownloadSbomQueryPathParams, } from './hooks/useDownloadSbomQuery';
3
3
  export { downloadSbom, useDownloadSbomQuery } from './hooks/useDownloadSbomQuery';
4
+ export type { GetArtifactDetailComponentViewErrorResponse, GetArtifactDetailComponentViewMutationPathParams, GetArtifactDetailComponentViewMutationQueryParams, GetArtifactDetailComponentViewOkResponse, GetArtifactDetailComponentViewProps, GetArtifactDetailComponentViewRequestBody, } from './hooks/useGetArtifactDetailComponentViewMutation';
5
+ export { getArtifactDetailComponentView, useGetArtifactDetailComponentViewMutation, } from './hooks/useGetArtifactDetailComponentViewMutation';
4
6
  export type { GetPolicyViolationsErrorResponse, GetPolicyViolationsOkResponse, GetPolicyViolationsProps, GetPolicyViolationsQueryPathParams, GetPolicyViolationsQueryQueryParams, } from './hooks/useGetPolicyViolationsQuery';
5
7
  export { getPolicyViolations, useGetPolicyViolationsQuery, } from './hooks/useGetPolicyViolationsQuery';
8
+ export type { ListArtifactsErrorResponse, ListArtifactsMutationPathParams, ListArtifactsMutationQueryParams, ListArtifactsOkResponse, ListArtifactsProps, ListArtifactsRequestBody, } from './hooks/useListArtifactsMutation';
9
+ export { listArtifacts, useListArtifactsMutation } from './hooks/useListArtifactsMutation';
10
+ export type { ListLatestArtifactsErrorResponse, ListLatestArtifactsMutationPathParams, ListLatestArtifactsMutationQueryParams, ListLatestArtifactsOkResponse, ListLatestArtifactsProps, } from './hooks/useListLatestArtifactsMutation';
11
+ export { listLatestArtifacts, useListLatestArtifactsMutation, } from './hooks/useListLatestArtifactsMutation';
12
+ export type { ArtifactListingRequestBodyRequestBody } from './requestBodies/ArtifactListingRequestBodyRequestBody';
13
+ export type { ArtifactComponentViewResponseBodyResponse } from './responses/ArtifactComponentViewResponseBodyResponse';
14
+ export type { ArtifactListingResponseBodyResponse } from './responses/ArtifactListingResponseBodyResponse';
15
+ export type { ArtifactSbomResponseBodyResponse } from './responses/ArtifactSbomResponseBodyResponse';
6
16
  export type { PolicyViolationResponseResponse } from './responses/PolicyViolationResponseResponse';
7
- export type { TokenIssueResponseBodyResponse } from './responses/TokenIssueResponseBodyResponse';
17
+ export type { ArtifactComponentViewRequestBody } from './schemas/ArtifactComponentViewRequestBody';
18
+ export type { ArtifactComponentViewResponse } from './schemas/ArtifactComponentViewResponse';
19
+ export type { ArtifactListingRequestBody } from './schemas/ArtifactListingRequestBody';
20
+ export type { ArtifactListingResponse } from './schemas/ArtifactListingResponse';
21
+ export type { ArtifactSbomResponseBody } from './schemas/ArtifactSbomResponseBody';
8
22
  export type { PolicyViolation } from './schemas/PolicyViolation';
9
- export type { TokenIssueResponseBody } from './schemas/TokenIssueResponseBody';
@@ -1,2 +1,5 @@
1
1
  export { downloadSbom, useDownloadSbomQuery } from './hooks/useDownloadSbomQuery';
2
+ export { getArtifactDetailComponentView, useGetArtifactDetailComponentViewMutation, } from './hooks/useGetArtifactDetailComponentViewMutation';
2
3
  export { getPolicyViolations, useGetPolicyViolationsQuery, } from './hooks/useGetPolicyViolationsQuery';
4
+ export { listArtifacts, useListArtifactsMutation } from './hooks/useListArtifactsMutation';
5
+ export { listLatestArtifacts, useListLatestArtifactsMutation, } from './hooks/useListLatestArtifactsMutation';
@@ -0,0 +1,2 @@
1
+ import type { ArtifactListingRequestBody } from '../schemas/ArtifactListingRequestBody';
2
+ export type ArtifactListingRequestBodyRequestBody = ArtifactListingRequestBody;
@@ -0,0 +1,2 @@
1
+ import type { ArtifactComponentViewResponse } from '../schemas/ArtifactComponentViewResponse';
2
+ export type ArtifactComponentViewResponseBodyResponse = ArtifactComponentViewResponse[];
@@ -0,0 +1,2 @@
1
+ import type { ArtifactListingResponse } from '../schemas/ArtifactListingResponse';
2
+ export type ArtifactListingResponseBodyResponse = ArtifactListingResponse[];
@@ -0,0 +1,2 @@
1
+ import type { ArtifactSbomResponseBody } from '../schemas/ArtifactSbomResponseBody';
2
+ export type ArtifactSbomResponseBodyResponse = ArtifactSbomResponseBody;
@@ -0,0 +1,13 @@
1
+ export interface ArtifactComponentViewRequestBody {
2
+ component_filter?: {
3
+ field_name?: string;
4
+ operator?: string;
5
+ value?: string;
6
+ };
7
+ license_filter?: {
8
+ operator?: string;
9
+ value?: string;
10
+ };
11
+ package_manager?: string;
12
+ supplier?: string;
13
+ }
@@ -0,0 +1,8 @@
1
+ export interface ArtifactComponentViewResponse {
2
+ license?: string;
3
+ name?: string;
4
+ package_manager?: string;
5
+ purl?: string;
6
+ supplier?: string;
7
+ version?: string;
8
+ }
@@ -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,14 @@
1
+ export interface ArtifactListingRequestBody {
2
+ component_filter?: {
3
+ field_name?: 'ComponentName' | 'ComponentVersion';
4
+ operator?: 'EQ';
5
+ value?: string;
6
+ };
7
+ environment_type?: 'All' | 'NonProd' | 'None' | 'Prod';
8
+ license_filter?: {
9
+ operator?: 'EQ';
10
+ value?: string;
11
+ };
12
+ policy_violation?: 'ALLOW' | 'DENY';
13
+ search_term?: string;
14
+ }
@@ -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,13 @@
1
+ export interface ArtifactListingResponse {
2
+ activity?: 'DEPLOYED' | 'GENERATED';
3
+ allow_list_violation_count?: number;
4
+ artifact_id: string;
5
+ artifact_name: string;
6
+ components_count?: number;
7
+ deny_list_violation_count?: number;
8
+ non_prod_env_count?: number;
9
+ prod_env_count?: number;
10
+ sbom_url?: string;
11
+ tag: string;
12
+ updated_at?: string;
13
+ }
@@ -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,6 @@
1
+ /**
2
+ *
3
+ */
4
+ export interface ArtifactSbomResponseBody {
5
+ sbom?: string;
6
+ }
@@ -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.1.1",
3
+ "version": "0.3.0",
4
4
  "description": "Harness SSCA manager APIs integrated with react hooks",
5
5
  "author": "Harness Inc",
6
6
  "license": "MIT",
@@ -1,2 +0,0 @@
1
- import type { TokenIssueResponseBody } from '../schemas/TokenIssueResponseBody';
2
- export type TokenIssueResponseBodyResponse = TokenIssueResponseBody;
@@ -1,6 +0,0 @@
1
- export interface TokenIssueResponseBody {
2
- /**
3
- * Issued cross-service JWT
4
- */
5
- token: string;
6
- }