@harnessio/react-har-service-client 0.1.0 → 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.
- package/dist/har-service/src/services/hooks/useGetArtifactDetailsQuery.d.ts +27 -0
- package/dist/har-service/src/services/hooks/useGetArtifactDetailsQuery.js +14 -0
- package/dist/har-service/src/services/hooks/useGetArtifactFilesQuery.d.ts +23 -0
- package/dist/har-service/src/services/hooks/useGetArtifactFilesQuery.js +14 -0
- package/dist/har-service/src/services/index.d.ts +11 -0
- package/dist/har-service/src/services/index.js +2 -0
- package/dist/har-service/src/services/responses/ArtifactDetailResponseResponse.d.ts +6 -0
- package/dist/har-service/src/services/responses/ArtifactDetailResponseResponse.js +1 -0
- package/dist/har-service/src/services/responses/FileDetailResponseResponse.d.ts +32 -0
- package/dist/har-service/src/services/responses/FileDetailResponseResponse.js +1 -0
- package/dist/har-service/src/services/schemas/ArtifactDetail.d.ts +20 -0
- package/dist/har-service/src/services/schemas/ArtifactDetail.js +1 -0
- package/dist/har-service/src/services/schemas/DockerArtifactDetailConfig.d.ts +6 -0
- package/dist/har-service/src/services/schemas/DockerArtifactDetailConfig.js +4 -0
- package/dist/har-service/src/services/schemas/DockerManifestDetails.d.ts +4 -0
- package/dist/har-service/src/services/schemas/FileDetail.d.ts +10 -0
- package/dist/har-service/src/services/schemas/FileDetail.js +4 -0
- package/dist/har-service/src/services/schemas/GenericArtifactDetailConfig.d.ts +6 -0
- package/dist/har-service/src/services/schemas/GenericArtifactDetailConfig.js +4 -0
- package/dist/har-service/src/services/schemas/HelmArtifactDetailConfig.d.ts +6 -0
- package/dist/har-service/src/services/schemas/HelmArtifactDetailConfig.js +4 -0
- package/dist/har-service/src/services/schemas/RegistryConfig.d.ts +4 -1
- package/dist/har-service/src/services/schemas/UpstreamConfig.d.ts +1 -1
- package/package.json +4 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
+
import type { ArtifactDetailResponseResponse } from '../responses/ArtifactDetailResponseResponse';
|
|
3
|
+
import type { BadRequestResponse } from '../responses/BadRequestResponse';
|
|
4
|
+
import type { UnauthenticatedResponse } from '../responses/UnauthenticatedResponse';
|
|
5
|
+
import type { UnauthorizedResponse } from '../responses/UnauthorizedResponse';
|
|
6
|
+
import type { NotFoundResponse } from '../responses/NotFoundResponse';
|
|
7
|
+
import type { InternalServerErrorResponse } from '../responses/InternalServerErrorResponse';
|
|
8
|
+
import type { ResponseWithPagination } from '../helpers';
|
|
9
|
+
import { FetcherOptions } from '../../../../fetcher/index.js';
|
|
10
|
+
export interface GetArtifactDetailsQueryPathParams {
|
|
11
|
+
registry_ref: string;
|
|
12
|
+
artifact: string;
|
|
13
|
+
version: string;
|
|
14
|
+
}
|
|
15
|
+
export interface GetArtifactDetailsQueryQueryParams {
|
|
16
|
+
childVersion?: string;
|
|
17
|
+
}
|
|
18
|
+
export type GetArtifactDetailsOkResponse = ResponseWithPagination<ArtifactDetailResponseResponse>;
|
|
19
|
+
export type GetArtifactDetailsErrorResponse = BadRequestResponse | UnauthenticatedResponse | UnauthorizedResponse | NotFoundResponse | InternalServerErrorResponse;
|
|
20
|
+
export interface GetArtifactDetailsProps extends GetArtifactDetailsQueryPathParams, Omit<FetcherOptions<GetArtifactDetailsQueryQueryParams, unknown>, 'url'> {
|
|
21
|
+
queryParams: GetArtifactDetailsQueryQueryParams;
|
|
22
|
+
}
|
|
23
|
+
export declare function getArtifactDetails(props: GetArtifactDetailsProps): Promise<GetArtifactDetailsOkResponse>;
|
|
24
|
+
/**
|
|
25
|
+
* Get Artifact Details
|
|
26
|
+
*/
|
|
27
|
+
export declare function useGetArtifactDetailsQuery(props: GetArtifactDetailsProps, options?: Omit<UseQueryOptions<GetArtifactDetailsOkResponse, GetArtifactDetailsErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<GetArtifactDetailsOkResponse, import("..").Error>;
|
|
@@ -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 getArtifactDetails(props) {
|
|
7
|
+
return fetcher(Object.assign({ url: `/registry/${props.registry_ref}/artifact/${props.artifact}/version/${props.version}/details`, method: 'GET' }, props));
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Get Artifact Details
|
|
11
|
+
*/
|
|
12
|
+
export function useGetArtifactDetailsQuery(props, options) {
|
|
13
|
+
return useQuery(['GetArtifactDetails', props.registry_ref, props.artifact, props.version, props.queryParams], ({ signal }) => getArtifactDetails(Object.assign(Object.assign({}, props), { signal })), options);
|
|
14
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
+
import type { FileDetailResponseResponse } from '../responses/FileDetailResponseResponse';
|
|
3
|
+
import type { BadRequestResponse } from '../responses/BadRequestResponse';
|
|
4
|
+
import type { UnauthenticatedResponse } from '../responses/UnauthenticatedResponse';
|
|
5
|
+
import type { UnauthorizedResponse } from '../responses/UnauthorizedResponse';
|
|
6
|
+
import type { NotFoundResponse } from '../responses/NotFoundResponse';
|
|
7
|
+
import type { InternalServerErrorResponse } from '../responses/InternalServerErrorResponse';
|
|
8
|
+
import type { ResponseWithPagination } from '../helpers';
|
|
9
|
+
import { FetcherOptions } from '../../../../fetcher/index.js';
|
|
10
|
+
export interface GetArtifactFilesQueryPathParams {
|
|
11
|
+
registry_ref: string;
|
|
12
|
+
artifact: string;
|
|
13
|
+
version: string;
|
|
14
|
+
}
|
|
15
|
+
export type GetArtifactFilesOkResponse = ResponseWithPagination<FileDetailResponseResponse>;
|
|
16
|
+
export type GetArtifactFilesErrorResponse = BadRequestResponse | UnauthenticatedResponse | UnauthorizedResponse | NotFoundResponse | InternalServerErrorResponse;
|
|
17
|
+
export interface GetArtifactFilesProps extends GetArtifactFilesQueryPathParams, Omit<FetcherOptions<unknown, unknown>, 'url'> {
|
|
18
|
+
}
|
|
19
|
+
export declare function getArtifactFiles(props: GetArtifactFilesProps): Promise<GetArtifactFilesOkResponse>;
|
|
20
|
+
/**
|
|
21
|
+
* Get Artifact files
|
|
22
|
+
*/
|
|
23
|
+
export declare function useGetArtifactFilesQuery(props: GetArtifactFilesProps, options?: Omit<UseQueryOptions<GetArtifactFilesOkResponse, GetArtifactFilesErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<GetArtifactFilesOkResponse, import("..").Error>;
|
|
@@ -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 getArtifactFiles(props) {
|
|
7
|
+
return fetcher(Object.assign({ url: `/registry/${props.registry_ref}/artifact/${props.artifact}/version/${props.version}/files`, method: 'GET' }, props));
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Get Artifact files
|
|
11
|
+
*/
|
|
12
|
+
export function useGetArtifactFilesQuery(props, options) {
|
|
13
|
+
return useQuery(['GetArtifactFiles', props.registry_ref, props.artifact, props.version], ({ signal }) => getArtifactFiles(Object.assign(Object.assign({}, props), { signal })), options);
|
|
14
|
+
}
|
|
@@ -17,6 +17,10 @@ export type { GetAllRegistriesErrorResponse, GetAllRegistriesOkResponse, GetAllR
|
|
|
17
17
|
export { getAllRegistries, useGetAllRegistriesQuery } from './hooks/useGetAllRegistriesQuery';
|
|
18
18
|
export type { GetArtifactDeploymentsErrorResponse, GetArtifactDeploymentsOkResponse, GetArtifactDeploymentsProps, GetArtifactDeploymentsQueryPathParams, GetArtifactDeploymentsQueryQueryParams, } from './hooks/useGetArtifactDeploymentsQuery';
|
|
19
19
|
export { getArtifactDeployments, useGetArtifactDeploymentsQuery, } from './hooks/useGetArtifactDeploymentsQuery';
|
|
20
|
+
export type { GetArtifactDetailsErrorResponse, GetArtifactDetailsOkResponse, GetArtifactDetailsProps, GetArtifactDetailsQueryPathParams, GetArtifactDetailsQueryQueryParams, } from './hooks/useGetArtifactDetailsQuery';
|
|
21
|
+
export { getArtifactDetails, useGetArtifactDetailsQuery } from './hooks/useGetArtifactDetailsQuery';
|
|
22
|
+
export type { GetArtifactFilesErrorResponse, GetArtifactFilesOkResponse, GetArtifactFilesProps, GetArtifactFilesQueryPathParams, } from './hooks/useGetArtifactFilesQuery';
|
|
23
|
+
export { getArtifactFiles, useGetArtifactFilesQuery } from './hooks/useGetArtifactFilesQuery';
|
|
20
24
|
export type { GetArtifactStatsForRegistryErrorResponse, GetArtifactStatsForRegistryOkResponse, GetArtifactStatsForRegistryProps, GetArtifactStatsForRegistryQueryPathParams, GetArtifactStatsForRegistryQueryQueryParams, } from './hooks/useGetArtifactStatsForRegistryQuery';
|
|
21
25
|
export { getArtifactStatsForRegistry, useGetArtifactStatsForRegistryQuery, } from './hooks/useGetArtifactStatsForRegistryQuery';
|
|
22
26
|
export type { GetArtifactStatsForSpaceErrorResponse, GetArtifactStatsForSpaceOkResponse, GetArtifactStatsForSpaceProps, GetArtifactStatsForSpaceQueryPathParams, GetArtifactStatsForSpaceQueryQueryParams, } from './hooks/useGetArtifactStatsForSpaceQuery';
|
|
@@ -56,6 +60,7 @@ export { updateArtifactLabels, useUpdateArtifactLabelsMutation, } from './hooks/
|
|
|
56
60
|
export type { ArtifactLabelRequestRequestBody } from './requestBodies/ArtifactLabelRequestRequestBody';
|
|
57
61
|
export type { RegistryRequestRequestBody } from './requestBodies/RegistryRequestRequestBody';
|
|
58
62
|
export type { ArtifactDeploymentsResponseResponse } from './responses/ArtifactDeploymentsResponseResponse';
|
|
63
|
+
export type { ArtifactDetailResponseResponse } from './responses/ArtifactDetailResponseResponse';
|
|
59
64
|
export type { ArtifactLabelResponseResponse } from './responses/ArtifactLabelResponseResponse';
|
|
60
65
|
export type { ArtifactStatsResponseResponse } from './responses/ArtifactStatsResponseResponse';
|
|
61
66
|
export type { ArtifactSummaryResponseResponse } from './responses/ArtifactSummaryResponseResponse';
|
|
@@ -67,6 +72,7 @@ export type { DockerArtifactDetailResponseResponse } from './responses/DockerArt
|
|
|
67
72
|
export type { DockerArtifactManifestResponseResponse } from './responses/DockerArtifactManifestResponseResponse';
|
|
68
73
|
export type { DockerLayersResponseResponse } from './responses/DockerLayersResponseResponse';
|
|
69
74
|
export type { DockerManifestsResponseResponse } from './responses/DockerManifestsResponseResponse';
|
|
75
|
+
export type { FileDetailResponseResponse } from './responses/FileDetailResponseResponse';
|
|
70
76
|
export type { HelmArtifactDetailResponseResponse } from './responses/HelmArtifactDetailResponseResponse';
|
|
71
77
|
export type { HelmArtifactManifestResponseResponse } from './responses/HelmArtifactManifestResponseResponse';
|
|
72
78
|
export type { InternalServerErrorResponse } from './responses/InternalServerErrorResponse';
|
|
@@ -85,6 +91,7 @@ export type { Anonymous } from './schemas/Anonymous';
|
|
|
85
91
|
export type { ArtifactDeploymentsDetail } from './schemas/ArtifactDeploymentsDetail';
|
|
86
92
|
export type { ArtifactDeploymentsDetails } from './schemas/ArtifactDeploymentsDetails';
|
|
87
93
|
export type { ArtifactDeploymentsList } from './schemas/ArtifactDeploymentsList';
|
|
94
|
+
export type { ArtifactDetail } from './schemas/ArtifactDetail';
|
|
88
95
|
export type { ArtifactLabelRequest } from './schemas/ArtifactLabelRequest';
|
|
89
96
|
export type { ArtifactMetadata } from './schemas/ArtifactMetadata';
|
|
90
97
|
export type { ArtifactStats } from './schemas/ArtifactStats';
|
|
@@ -103,6 +110,7 @@ export type { DeploymentDetails } from './schemas/DeploymentDetails';
|
|
|
103
110
|
export type { DeploymentMetadata } from './schemas/DeploymentMetadata';
|
|
104
111
|
export type { DeploymentStats } from './schemas/DeploymentStats';
|
|
105
112
|
export type { DockerArtifactDetail } from './schemas/DockerArtifactDetail';
|
|
113
|
+
export type { DockerArtifactDetailConfig } from './schemas/DockerArtifactDetailConfig';
|
|
106
114
|
export type { DockerArtifactIntegrationDetail } from './schemas/DockerArtifactIntegrationDetail';
|
|
107
115
|
export type { DockerArtifactManifest } from './schemas/DockerArtifactManifest';
|
|
108
116
|
export type { DockerLayerEntry } from './schemas/DockerLayerEntry';
|
|
@@ -111,7 +119,10 @@ export type { DockerManifestDetails } from './schemas/DockerManifestDetails';
|
|
|
111
119
|
export type { DockerManifests } from './schemas/DockerManifests';
|
|
112
120
|
export type { EnvironmentType } from './schemas/EnvironmentType';
|
|
113
121
|
export type { Error } from './schemas/Error';
|
|
122
|
+
export type { FileDetail } from './schemas/FileDetail';
|
|
123
|
+
export type { GenericArtifactDetailConfig } from './schemas/GenericArtifactDetailConfig';
|
|
114
124
|
export type { HelmArtifactDetail } from './schemas/HelmArtifactDetail';
|
|
125
|
+
export type { HelmArtifactDetailConfig } from './schemas/HelmArtifactDetailConfig';
|
|
115
126
|
export type { HelmArtifactManifest } from './schemas/HelmArtifactManifest';
|
|
116
127
|
export type { ListArtifact } from './schemas/ListArtifact';
|
|
117
128
|
export type { ListArtifactLabel } from './schemas/ListArtifactLabel';
|
|
@@ -7,6 +7,8 @@ export { getAllArtifactsByRegistry, useGetAllArtifactsByRegistryQuery, } from '.
|
|
|
7
7
|
export { getAllHarnessArtifacts, useGetAllHarnessArtifactsQuery, } from './hooks/useGetAllHarnessArtifactsQuery';
|
|
8
8
|
export { getAllRegistries, useGetAllRegistriesQuery } from './hooks/useGetAllRegistriesQuery';
|
|
9
9
|
export { getArtifactDeployments, useGetArtifactDeploymentsQuery, } from './hooks/useGetArtifactDeploymentsQuery';
|
|
10
|
+
export { getArtifactDetails, useGetArtifactDetailsQuery } from './hooks/useGetArtifactDetailsQuery';
|
|
11
|
+
export { getArtifactFiles, useGetArtifactFilesQuery } from './hooks/useGetArtifactFilesQuery';
|
|
10
12
|
export { getArtifactStatsForRegistry, useGetArtifactStatsForRegistryQuery, } from './hooks/useGetArtifactStatsForRegistryQuery';
|
|
11
13
|
export { getArtifactStatsForSpace, useGetArtifactStatsForSpaceQuery, } from './hooks/useGetArtifactStatsForSpaceQuery';
|
|
12
14
|
export { getArtifactStats, useGetArtifactStatsQuery } from './hooks/useGetArtifactStatsQuery';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { FileDetail } from '../schemas/FileDetail';
|
|
2
|
+
import type { Status } from '../schemas/Status';
|
|
3
|
+
export interface FileDetailResponseResponse {
|
|
4
|
+
/**
|
|
5
|
+
* A list of Harness Artifact Files
|
|
6
|
+
*/
|
|
7
|
+
files: FileDetail[];
|
|
8
|
+
/**
|
|
9
|
+
* The total number of items
|
|
10
|
+
* @format int64
|
|
11
|
+
* @example 1
|
|
12
|
+
*/
|
|
13
|
+
itemCount?: number;
|
|
14
|
+
/**
|
|
15
|
+
* The total number of pages
|
|
16
|
+
* @format int64
|
|
17
|
+
* @example 100
|
|
18
|
+
*/
|
|
19
|
+
pageCount?: number;
|
|
20
|
+
/**
|
|
21
|
+
* The current page
|
|
22
|
+
* @format int64
|
|
23
|
+
* @example 0
|
|
24
|
+
*/
|
|
25
|
+
pageIndex?: number;
|
|
26
|
+
/**
|
|
27
|
+
* The number of items per page
|
|
28
|
+
* @example 1
|
|
29
|
+
*/
|
|
30
|
+
pageSize?: number;
|
|
31
|
+
status: Status;
|
|
32
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { DockerArtifactDetailConfig } from '../schemas/DockerArtifactDetailConfig';
|
|
2
|
+
import type { HelmArtifactDetailConfig } from '../schemas/HelmArtifactDetailConfig';
|
|
3
|
+
import type { GenericArtifactDetailConfig } from '../schemas/GenericArtifactDetailConfig';
|
|
4
|
+
import type { PackageType } from '../schemas/PackageType';
|
|
5
|
+
/**
|
|
6
|
+
* Artifact Detail
|
|
7
|
+
*/
|
|
8
|
+
export type ArtifactDetail = (DockerArtifactDetailConfig | HelmArtifactDetailConfig | GenericArtifactDetailConfig) & {
|
|
9
|
+
createdAt?: string;
|
|
10
|
+
createdBy?: string;
|
|
11
|
+
/**
|
|
12
|
+
* @format int64
|
|
13
|
+
*/
|
|
14
|
+
downloadCount?: number;
|
|
15
|
+
modifiedAt?: string;
|
|
16
|
+
name?: string;
|
|
17
|
+
packageType: PackageType;
|
|
18
|
+
size?: string;
|
|
19
|
+
version: string;
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { VirtualConfig } from '../schemas/VirtualConfig';
|
|
2
2
|
import type { UpstreamConfig } from '../schemas/UpstreamConfig';
|
|
3
|
+
import type { RegistryType } from '../schemas/RegistryType';
|
|
3
4
|
/**
|
|
4
5
|
* SubConfig specific for Virtual or Upstream Registry
|
|
5
6
|
*/
|
|
6
|
-
export type RegistryConfig = VirtualConfig &
|
|
7
|
+
export type RegistryConfig = (VirtualConfig | UpstreamConfig) & {
|
|
8
|
+
type: RegistryType;
|
|
9
|
+
};
|
|
@@ -5,7 +5,7 @@ import type { AuthType } from '../schemas/AuthType';
|
|
|
5
5
|
* Configuration for Harness Artifact UpstreamProxies
|
|
6
6
|
*/
|
|
7
7
|
export interface UpstreamConfig {
|
|
8
|
-
auth?: UserPassword
|
|
8
|
+
auth?: UserPassword | Anonymous;
|
|
9
9
|
authType: AuthType;
|
|
10
10
|
source?: 'Custom' | 'Dockerhub';
|
|
11
11
|
url?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@harnessio/react-har-service-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Harness HAR Service APIs integrated with react hooks",
|
|
5
5
|
"author": "Harness Inc",
|
|
6
6
|
"license": "MIT",
|
|
@@ -27,5 +27,8 @@
|
|
|
27
27
|
"build": "yarn generate && tsc",
|
|
28
28
|
"generate": "oats import --config='./oats.config.ts'",
|
|
29
29
|
"fmt": "prettier --write ./index.ts"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@harnessio/oats-cli": "^3.0.0"
|
|
30
33
|
}
|
|
31
34
|
}
|