@harnessio/react-har-service-v2-client 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.
- package/README.md +39 -0
- package/dist/fetcher/index.d.ts +17 -0
- package/dist/fetcher/index.js +65 -0
- package/dist/har-service-v2/src/index.d.ts +6 -0
- package/dist/har-service-v2/src/index.js +10 -0
- package/dist/har-service-v2/src/services/helpers.d.ts +14 -0
- package/dist/har-service-v2/src/services/helpers.js +1 -0
- package/dist/har-service-v2/src/services/hooks/useGetAllArtifactVersionsQuery.d.ts +43 -0
- package/dist/har-service-v2/src/services/hooks/useGetAllArtifactVersionsQuery.js +14 -0
- package/dist/har-service-v2/src/services/hooks/useGetAllArtifactsByRegistryQuery.d.ts +42 -0
- package/dist/har-service-v2/src/services/hooks/useGetAllArtifactsByRegistryQuery.js +14 -0
- package/dist/har-service-v2/src/services/hooks/useGetAllHarnessArtifactsQuery.d.ts +43 -0
- package/dist/har-service-v2/src/services/hooks/useGetAllHarnessArtifactsQuery.js +14 -0
- package/dist/har-service-v2/src/services/hooks/useGetAllRegistriesQuery.d.ts +44 -0
- package/dist/har-service-v2/src/services/hooks/useGetAllRegistriesQuery.js +14 -0
- package/dist/har-service-v2/src/services/hooks/useGetMetadataKeysQuery.d.ts +35 -0
- package/dist/har-service-v2/src/services/hooks/useGetMetadataKeysQuery.js +14 -0
- package/dist/har-service-v2/src/services/hooks/useGetMetadataQuery.d.ts +30 -0
- package/dist/har-service-v2/src/services/hooks/useGetMetadataQuery.js +16 -0
- package/dist/har-service-v2/src/services/hooks/useGetMetadataValuesQuery.d.ts +36 -0
- package/dist/har-service-v2/src/services/hooks/useGetMetadataValuesQuery.js +14 -0
- package/dist/har-service-v2/src/services/hooks/useUpdateMetadataMutation.d.ts +34 -0
- package/dist/har-service-v2/src/services/hooks/useUpdateMetadataMutation.js +17 -0
- package/dist/har-service-v2/src/services/index.d.ts +50 -0
- package/dist/har-service-v2/src/services/index.js +8 -0
- package/dist/har-service-v2/src/services/requestBodies/MetadataRequestRequestBody.d.ts +2 -0
- package/dist/har-service-v2/src/services/requestBodies/MetadataRequestRequestBody.js +1 -0
- package/dist/har-service-v2/src/services/responses/BadRequestResponse.d.ts +2 -0
- package/dist/har-service-v2/src/services/responses/BadRequestResponse.js +1 -0
- package/dist/har-service-v2/src/services/responses/InternalServerErrorResponse.d.ts +2 -0
- package/dist/har-service-v2/src/services/responses/InternalServerErrorResponse.js +1 -0
- package/dist/har-service-v2/src/services/responses/ListArtifactResponseResponse.d.ts +6 -0
- package/dist/har-service-v2/src/services/responses/ListArtifactResponseResponse.js +1 -0
- package/dist/har-service-v2/src/services/responses/ListArtifactVersionResponseResponse.d.ts +6 -0
- package/dist/har-service-v2/src/services/responses/ListArtifactVersionResponseResponse.js +1 -0
- package/dist/har-service-v2/src/services/responses/ListRegistryArtifactResponseResponse.d.ts +6 -0
- package/dist/har-service-v2/src/services/responses/ListRegistryArtifactResponseResponse.js +1 -0
- package/dist/har-service-v2/src/services/responses/ListRegistryResponseResponse.d.ts +6 -0
- package/dist/har-service-v2/src/services/responses/ListRegistryResponseResponse.js +1 -0
- package/dist/har-service-v2/src/services/responses/MetadataKeysResponseResponse.d.ts +5 -0
- package/dist/har-service-v2/src/services/responses/MetadataKeysResponseResponse.js +1 -0
- package/dist/har-service-v2/src/services/responses/MetadataResponseResponse.d.ts +6 -0
- package/dist/har-service-v2/src/services/responses/MetadataResponseResponse.js +1 -0
- package/dist/har-service-v2/src/services/responses/MetadataValuesResponseResponse.d.ts +5 -0
- package/dist/har-service-v2/src/services/responses/MetadataValuesResponseResponse.js +1 -0
- package/dist/har-service-v2/src/services/responses/NotFoundResponse.d.ts +2 -0
- package/dist/har-service-v2/src/services/responses/NotFoundResponse.js +1 -0
- package/dist/har-service-v2/src/services/responses/UnauthenticatedResponse.d.ts +2 -0
- package/dist/har-service-v2/src/services/responses/UnauthenticatedResponse.js +1 -0
- package/dist/har-service-v2/src/services/responses/UnauthorizedResponse.d.ts +2 -0
- package/dist/har-service-v2/src/services/responses/UnauthorizedResponse.js +1 -0
- package/dist/har-service-v2/src/services/schemas/ArtifactEntityMetadata.d.ts +6 -0
- package/dist/har-service-v2/src/services/schemas/ArtifactEntityMetadata.js +4 -0
- package/dist/har-service-v2/src/services/schemas/ArtifactMetadata.d.ts +24 -0
- package/dist/har-service-v2/src/services/schemas/ArtifactMetadata.js +1 -0
- package/dist/har-service-v2/src/services/schemas/ArtifactType.d.ts +4 -0
- package/dist/har-service-v2/src/services/schemas/ArtifactType.js +4 -0
- package/dist/har-service-v2/src/services/schemas/ArtifactVersionMetadata.d.ts +32 -0
- package/dist/har-service-v2/src/services/schemas/ArtifactVersionMetadata.js +1 -0
- package/dist/har-service-v2/src/services/schemas/DeploymentMetadata.d.ts +4 -0
- package/dist/har-service-v2/src/services/schemas/DeploymentMetadata.js +4 -0
- package/dist/har-service-v2/src/services/schemas/Error.d.ts +24 -0
- package/dist/har-service-v2/src/services/schemas/Error.js +4 -0
- package/dist/har-service-v2/src/services/schemas/ListArtifact.d.ts +33 -0
- package/dist/har-service-v2/src/services/schemas/ListArtifact.js +1 -0
- package/dist/har-service-v2/src/services/schemas/ListArtifactVersion.d.ts +33 -0
- package/dist/har-service-v2/src/services/schemas/ListArtifactVersion.js +1 -0
- package/dist/har-service-v2/src/services/schemas/ListRegistry.d.ts +33 -0
- package/dist/har-service-v2/src/services/schemas/ListRegistry.js +1 -0
- package/dist/har-service-v2/src/services/schemas/ListRegistryArtifact.d.ts +33 -0
- package/dist/har-service-v2/src/services/schemas/ListRegistryArtifact.js +1 -0
- package/dist/har-service-v2/src/services/schemas/MetadataInput.d.ts +11 -0
- package/dist/har-service-v2/src/services/schemas/MetadataInput.js +1 -0
- package/dist/har-service-v2/src/services/schemas/MetadataItemInput.d.ts +15 -0
- package/dist/har-service-v2/src/services/schemas/MetadataItemInput.js +4 -0
- package/dist/har-service-v2/src/services/schemas/MetadataItemOutput.d.ts +22 -0
- package/dist/har-service-v2/src/services/schemas/MetadataItemOutput.js +1 -0
- package/dist/har-service-v2/src/services/schemas/MetadataOutput.d.ts +11 -0
- package/dist/har-service-v2/src/services/schemas/MetadataOutput.js +1 -0
- package/dist/har-service-v2/src/services/schemas/MetadataType.d.ts +5 -0
- package/dist/har-service-v2/src/services/schemas/MetadataType.js +4 -0
- package/dist/har-service-v2/src/services/schemas/PackageType.d.ts +4 -0
- package/dist/har-service-v2/src/services/schemas/PackageType.js +4 -0
- package/dist/har-service-v2/src/services/schemas/RegistryArtifactMetadata.d.ts +19 -0
- package/dist/har-service-v2/src/services/schemas/RegistryArtifactMetadata.js +1 -0
- package/dist/har-service-v2/src/services/schemas/RegistryMetadata.d.ts +24 -0
- package/dist/har-service-v2/src/services/schemas/RegistryMetadata.js +1 -0
- package/dist/har-service-v2/src/services/schemas/RegistryType.d.ts +4 -0
- package/dist/har-service-v2/src/services/schemas/RegistryType.js +4 -0
- package/dist/har-service-v2/src/services/schemas/Status.d.ts +4 -0
- package/dist/har-service-v2/src/services/schemas/Status.js +4 -0
- package/package.json +34 -0
package/README.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# React HAR Service Client(WIP)
|
|
2
|
+
|
|
3
|
+
**OpenAPI -> OA**
|
|
4
|
+
|
|
5
|
+
**TypeScript -> TS**
|
|
6
|
+
|
|
7
|
+
**OpenAPI + TypeScript -> OATS**
|
|
8
|
+
|
|
9
|
+
This React API client will store a collection of Harness HAR Service APIs and Interfaces contracts generated from Open API Spec using `OATS CLI` internally.
|
|
10
|
+
APIs are using hooks from `@tanstack/react-query`
|
|
11
|
+
|
|
12
|
+
## Steps To Generate API Client build as dist folder
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
yarn build
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## For NextGen UI adoption : HARServiceAPIClient should be initialized
|
|
19
|
+
|
|
20
|
+
Before using API Client, it must be initilaized with required `ClientCallbacks`.
|
|
21
|
+
|
|
22
|
+
Example:
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
new HARServiceV2APIClient({
|
|
26
|
+
getHeaders: () => {
|
|
27
|
+
return { token: SessionToken.getToken(), 'Harness-Account': accountId }
|
|
28
|
+
}}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Versioning
|
|
32
|
+
|
|
33
|
+

|
|
34
|
+
|
|
35
|
+
Once development phase is completed, this repo will have changes and versioning driven by API spec only.
|
|
36
|
+
|
|
37
|
+
## License
|
|
38
|
+
|
|
39
|
+
[MIT](./LICENSE.md). Copyright(c) [Harness Inc](https://harness.io)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { IStringifyOptions } from 'qs';
|
|
2
|
+
export interface FetcherOptions<TQueryParams = never, TBody = never, THeaderParams = HeadersInit> extends Omit<RequestInit, 'body' | 'headers'> {
|
|
3
|
+
url: string;
|
|
4
|
+
queryParams?: TQueryParams extends never ? undefined : TQueryParams;
|
|
5
|
+
body?: TBody extends never ? undefined : TBody;
|
|
6
|
+
stringifyQueryParamsOptions?: IStringifyOptions;
|
|
7
|
+
headers?: THeaderParams;
|
|
8
|
+
}
|
|
9
|
+
export interface ClientCallbacks {
|
|
10
|
+
responseInterceptor?: (response: Response) => Response;
|
|
11
|
+
requestInterceptor?: (request: Request) => Request;
|
|
12
|
+
urlInterceptor?: (url: string) => string;
|
|
13
|
+
getRequestHeaders?: () => Record<string, any>;
|
|
14
|
+
}
|
|
15
|
+
export declare function setupClient(callbacks: ClientCallbacks): void;
|
|
16
|
+
export declare const updateClientHeaders: (headers: Record<string, any>) => void;
|
|
17
|
+
export declare function fetcher<TResponse = unknown, TQueryParams = never, TBody = never, THeaderParams = HeadersInit>(options: FetcherOptions<TQueryParams, TBody, THeaderParams>): Promise<TResponse>;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { __awaiter, __rest } from "tslib";
|
|
2
|
+
import { stringify } from 'qs';
|
|
3
|
+
const JSON_CONTENT_TYPES = ['application/json'];
|
|
4
|
+
let APIClientInitialized = false;
|
|
5
|
+
let fetcherCallbacks;
|
|
6
|
+
let customHeaders = {
|
|
7
|
+
'Content-Type': JSON_CONTENT_TYPES[0],
|
|
8
|
+
};
|
|
9
|
+
export function setupClient(callbacks) {
|
|
10
|
+
fetcherCallbacks = callbacks;
|
|
11
|
+
customHeaders = Object.assign(Object.assign({}, customHeaders), ((fetcherCallbacks === null || fetcherCallbacks === void 0 ? void 0 : fetcherCallbacks.getRequestHeaders) ? fetcherCallbacks === null || fetcherCallbacks === void 0 ? void 0 : fetcherCallbacks.getRequestHeaders() : {}));
|
|
12
|
+
APIClientInitialized = true;
|
|
13
|
+
}
|
|
14
|
+
export const updateClientHeaders = (headers) => {
|
|
15
|
+
customHeaders = Object.assign(Object.assign({}, customHeaders), headers);
|
|
16
|
+
};
|
|
17
|
+
export function fetcher(options) {
|
|
18
|
+
var _a, _b;
|
|
19
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
// If not initialized throw error even without making request
|
|
21
|
+
if (!APIClientInitialized) {
|
|
22
|
+
throw { reason: 'HarnessReactAPIClient has not been initialized' };
|
|
23
|
+
}
|
|
24
|
+
const { stringifyQueryParamsOptions, headers, body, url, queryParams = { account: customHeaders['Harness-Account'] } } = options, rest = __rest(options, ["stringifyQueryParamsOptions", "headers", "body", "url", "queryParams"]);
|
|
25
|
+
const token = customHeaders.token;
|
|
26
|
+
let finalUrl = url;
|
|
27
|
+
if (queryParams) {
|
|
28
|
+
finalUrl += stringify(queryParams, Object.assign(Object.assign({}, stringifyQueryParamsOptions), { addQueryPrefix: true }));
|
|
29
|
+
}
|
|
30
|
+
if (fetcherCallbacks === null || fetcherCallbacks === void 0 ? void 0 : fetcherCallbacks.urlInterceptor) {
|
|
31
|
+
finalUrl = (_a = fetcherCallbacks === null || fetcherCallbacks === void 0 ? void 0 : fetcherCallbacks.urlInterceptor) === null || _a === void 0 ? void 0 : _a.call(fetcherCallbacks, finalUrl);
|
|
32
|
+
}
|
|
33
|
+
let request = new Request(finalUrl, Object.assign({ headers: Object.assign(Object.assign({ Authorization: `Bearer ${token}` }, headers), customHeaders), body: body ? JSON.stringify(body) : undefined }, rest));
|
|
34
|
+
if (fetcherCallbacks === null || fetcherCallbacks === void 0 ? void 0 : fetcherCallbacks.requestInterceptor) {
|
|
35
|
+
request = fetcherCallbacks.requestInterceptor(request.clone());
|
|
36
|
+
}
|
|
37
|
+
let response = yield fetch(request);
|
|
38
|
+
if (fetcherCallbacks === null || fetcherCallbacks === void 0 ? void 0 : fetcherCallbacks.responseInterceptor) {
|
|
39
|
+
response = (_b = fetcherCallbacks === null || fetcherCallbacks === void 0 ? void 0 : fetcherCallbacks.responseInterceptor) === null || _b === void 0 ? void 0 : _b.call(fetcherCallbacks, response.clone());
|
|
40
|
+
}
|
|
41
|
+
const contentType = response.headers.get('Content-Type');
|
|
42
|
+
let total, pageSize, pageNumber, pageCount, pagination;
|
|
43
|
+
try {
|
|
44
|
+
total = response.headers.get('x-total-elements');
|
|
45
|
+
pageSize = response.headers.get('x-page-size');
|
|
46
|
+
pageNumber = response.headers.get('x-page-number');
|
|
47
|
+
pagination = total || pageSize || pageNumber;
|
|
48
|
+
if (pagination) {
|
|
49
|
+
total = Number(total);
|
|
50
|
+
pageSize = Number(pageSize);
|
|
51
|
+
pageCount = Math.ceil(total / pageSize);
|
|
52
|
+
pageNumber = Number(pageNumber);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
catch (e) {
|
|
56
|
+
throw new Error('HarnessReactAPIClient: An error occurred while parsing pagination headers. ' + e);
|
|
57
|
+
}
|
|
58
|
+
const asJson = contentType && JSON_CONTENT_TYPES.some((h) => contentType.startsWith(h));
|
|
59
|
+
const data = yield (asJson ? response.json() : response.text());
|
|
60
|
+
if (response.ok) {
|
|
61
|
+
return Object.assign({ content: data }, (pagination ? { pagination: { total, pageCount, pageSize, pageNumber } } : {}));
|
|
62
|
+
}
|
|
63
|
+
throw data;
|
|
64
|
+
});
|
|
65
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { setupClient, updateClientHeaders } from '../../fetcher';
|
|
2
|
+
export * from './services/index';
|
|
3
|
+
export class HARServiceV2APIClient {
|
|
4
|
+
constructor(callbacks) {
|
|
5
|
+
setupClient(callbacks);
|
|
6
|
+
this.updateHeaders = (headers) => {
|
|
7
|
+
updateClientHeaders(headers);
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type GetPathParamsType<T> = T extends {
|
|
2
|
+
pathParams: infer R;
|
|
3
|
+
} ? R : never;
|
|
4
|
+
export interface ResponseWithPagination<T> {
|
|
5
|
+
content: T;
|
|
6
|
+
pagination?: {
|
|
7
|
+
total?: number;
|
|
8
|
+
pageSize?: number;
|
|
9
|
+
pageCount?: number;
|
|
10
|
+
pageNumber?: number;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export type WithOptional<TInput, Tkeys extends keyof TInput> = Omit<TInput, Tkeys> & Partial<Pick<TInput, Tkeys>>;
|
|
14
|
+
export type PickPartial<TInput, Tkeys extends keyof TInput> = Pick<Partial<TInput>, Tkeys>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
+
import type { ListArtifactVersionResponseResponse } from '../responses/ListArtifactVersionResponseResponse';
|
|
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 GetAllArtifactVersionsQueryPathParams {
|
|
11
|
+
registry: string;
|
|
12
|
+
artifact: string;
|
|
13
|
+
}
|
|
14
|
+
export interface GetAllArtifactVersionsQueryQueryParams {
|
|
15
|
+
artifact_type?: 'dataset' | 'model';
|
|
16
|
+
metadata?: string[];
|
|
17
|
+
/**
|
|
18
|
+
* @format int64
|
|
19
|
+
* @default 0
|
|
20
|
+
*/
|
|
21
|
+
page?: number;
|
|
22
|
+
/**
|
|
23
|
+
* @format int64
|
|
24
|
+
* @default 20
|
|
25
|
+
*/
|
|
26
|
+
size?: number;
|
|
27
|
+
/**
|
|
28
|
+
* @default "ASC"
|
|
29
|
+
*/
|
|
30
|
+
sort_order?: 'ASC' | 'DESC';
|
|
31
|
+
sort_field?: string;
|
|
32
|
+
search_term?: string;
|
|
33
|
+
}
|
|
34
|
+
export type GetAllArtifactVersionsOkResponse = ResponseWithPagination<ListArtifactVersionResponseResponse>;
|
|
35
|
+
export type GetAllArtifactVersionsErrorResponse = BadRequestResponse | UnauthenticatedResponse | UnauthorizedResponse | NotFoundResponse | InternalServerErrorResponse;
|
|
36
|
+
export interface GetAllArtifactVersionsProps extends GetAllArtifactVersionsQueryPathParams, Omit<FetcherOptions<GetAllArtifactVersionsQueryQueryParams, unknown>, 'url'> {
|
|
37
|
+
queryParams: GetAllArtifactVersionsQueryQueryParams;
|
|
38
|
+
}
|
|
39
|
+
export declare function getAllArtifactVersions(props: GetAllArtifactVersionsProps): Promise<GetAllArtifactVersionsOkResponse>;
|
|
40
|
+
/**
|
|
41
|
+
* Lists all the Artifact Versions.
|
|
42
|
+
*/
|
|
43
|
+
export declare function useGetAllArtifactVersionsQuery(props: GetAllArtifactVersionsProps, options?: Omit<UseQueryOptions<GetAllArtifactVersionsOkResponse, GetAllArtifactVersionsErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<GetAllArtifactVersionsOkResponse, 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 getAllArtifactVersions(props) {
|
|
7
|
+
return fetcher(Object.assign({ url: `/registry/${props.registry}/artifact/${props.artifact}/versions`, method: 'GET' }, props));
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Lists all the Artifact Versions.
|
|
11
|
+
*/
|
|
12
|
+
export function useGetAllArtifactVersionsQuery(props, options) {
|
|
13
|
+
return useQuery(['GetAllArtifactVersions', props.registry, props.artifact, props.queryParams], ({ signal }) => getAllArtifactVersions(Object.assign(Object.assign({}, props), { signal })), options);
|
|
14
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
+
import type { ListRegistryArtifactResponseResponse } from '../responses/ListRegistryArtifactResponseResponse';
|
|
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 GetAllArtifactsByRegistryQueryPathParams {
|
|
11
|
+
registry: string;
|
|
12
|
+
}
|
|
13
|
+
export interface GetAllArtifactsByRegistryQueryQueryParams {
|
|
14
|
+
metadata?: string[];
|
|
15
|
+
/**
|
|
16
|
+
* @format int64
|
|
17
|
+
* @default 0
|
|
18
|
+
*/
|
|
19
|
+
page?: number;
|
|
20
|
+
/**
|
|
21
|
+
* @format int64
|
|
22
|
+
* @default 20
|
|
23
|
+
*/
|
|
24
|
+
size?: number;
|
|
25
|
+
/**
|
|
26
|
+
* @default "ASC"
|
|
27
|
+
*/
|
|
28
|
+
sort_order?: 'ASC' | 'DESC';
|
|
29
|
+
sort_field?: string;
|
|
30
|
+
search_term?: string;
|
|
31
|
+
artifact_type?: 'dataset' | 'model';
|
|
32
|
+
}
|
|
33
|
+
export type GetAllArtifactsByRegistryOkResponse = ResponseWithPagination<ListRegistryArtifactResponseResponse>;
|
|
34
|
+
export type GetAllArtifactsByRegistryErrorResponse = BadRequestResponse | UnauthenticatedResponse | UnauthorizedResponse | NotFoundResponse | InternalServerErrorResponse;
|
|
35
|
+
export interface GetAllArtifactsByRegistryProps extends GetAllArtifactsByRegistryQueryPathParams, Omit<FetcherOptions<GetAllArtifactsByRegistryQueryQueryParams, unknown>, 'url'> {
|
|
36
|
+
queryParams: GetAllArtifactsByRegistryQueryQueryParams;
|
|
37
|
+
}
|
|
38
|
+
export declare function getAllArtifactsByRegistry(props: GetAllArtifactsByRegistryProps): Promise<GetAllArtifactsByRegistryOkResponse>;
|
|
39
|
+
/**
|
|
40
|
+
* Lists all the Artifacts for Registry
|
|
41
|
+
*/
|
|
42
|
+
export declare function useGetAllArtifactsByRegistryQuery(props: GetAllArtifactsByRegistryProps, options?: Omit<UseQueryOptions<GetAllArtifactsByRegistryOkResponse, GetAllArtifactsByRegistryErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<GetAllArtifactsByRegistryOkResponse, 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 getAllArtifactsByRegistry(props) {
|
|
7
|
+
return fetcher(Object.assign({ url: `/registry/${props.registry}/artifacts`, method: 'GET' }, props));
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Lists all the Artifacts for Registry
|
|
11
|
+
*/
|
|
12
|
+
export function useGetAllArtifactsByRegistryQuery(props, options) {
|
|
13
|
+
return useQuery(['GetAllArtifactsByRegistry', props.registry, props.queryParams], ({ signal }) => getAllArtifactsByRegistry(Object.assign(Object.assign({}, props), { signal })), options);
|
|
14
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
+
import type { ListArtifactResponseResponse } from '../responses/ListArtifactResponseResponse';
|
|
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 GetAllHarnessArtifactsQueryQueryParams {
|
|
11
|
+
account_identifier: string;
|
|
12
|
+
org_identifier?: string;
|
|
13
|
+
project_identifier?: string;
|
|
14
|
+
registry_identifier?: string[];
|
|
15
|
+
metadata?: string[];
|
|
16
|
+
/**
|
|
17
|
+
* @format int64
|
|
18
|
+
* @default 0
|
|
19
|
+
*/
|
|
20
|
+
page?: number;
|
|
21
|
+
/**
|
|
22
|
+
* @format int64
|
|
23
|
+
* @default 20
|
|
24
|
+
*/
|
|
25
|
+
size?: number;
|
|
26
|
+
/**
|
|
27
|
+
* @default "ASC"
|
|
28
|
+
*/
|
|
29
|
+
sort_order?: 'ASC' | 'DESC';
|
|
30
|
+
sort_field?: string;
|
|
31
|
+
search_term?: string;
|
|
32
|
+
package_type?: string[];
|
|
33
|
+
}
|
|
34
|
+
export type GetAllHarnessArtifactsOkResponse = ResponseWithPagination<ListArtifactResponseResponse>;
|
|
35
|
+
export type GetAllHarnessArtifactsErrorResponse = BadRequestResponse | UnauthenticatedResponse | UnauthorizedResponse | NotFoundResponse | InternalServerErrorResponse;
|
|
36
|
+
export interface GetAllHarnessArtifactsProps extends Omit<FetcherOptions<GetAllHarnessArtifactsQueryQueryParams, unknown>, 'url'> {
|
|
37
|
+
queryParams: GetAllHarnessArtifactsQueryQueryParams;
|
|
38
|
+
}
|
|
39
|
+
export declare function getAllHarnessArtifacts(props: GetAllHarnessArtifactsProps): Promise<GetAllHarnessArtifactsOkResponse>;
|
|
40
|
+
/**
|
|
41
|
+
* Lists all the Harness Artifacts.
|
|
42
|
+
*/
|
|
43
|
+
export declare function useGetAllHarnessArtifactsQuery(props: GetAllHarnessArtifactsProps, options?: Omit<UseQueryOptions<GetAllHarnessArtifactsOkResponse, GetAllHarnessArtifactsErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<GetAllHarnessArtifactsOkResponse, 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 getAllHarnessArtifacts(props) {
|
|
7
|
+
return fetcher(Object.assign({ url: `/artifacts`, method: 'GET' }, props));
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Lists all the Harness Artifacts.
|
|
11
|
+
*/
|
|
12
|
+
export function useGetAllHarnessArtifactsQuery(props, options) {
|
|
13
|
+
return useQuery(['GetAllHarnessArtifacts', props.queryParams], ({ signal }) => getAllHarnessArtifacts(Object.assign(Object.assign({}, props), { signal })), options);
|
|
14
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
+
import type { ListRegistryResponseResponse } from '../responses/ListRegistryResponseResponse';
|
|
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 GetAllRegistriesQueryQueryParams {
|
|
11
|
+
account_identifier: string;
|
|
12
|
+
org_identifier?: string;
|
|
13
|
+
project_identifier?: string;
|
|
14
|
+
package_type?: string[];
|
|
15
|
+
type?: 'UPSTREAM' | 'VIRTUAL';
|
|
16
|
+
metadata?: string[];
|
|
17
|
+
/**
|
|
18
|
+
* @format int64
|
|
19
|
+
* @default 0
|
|
20
|
+
*/
|
|
21
|
+
page?: number;
|
|
22
|
+
/**
|
|
23
|
+
* @format int64
|
|
24
|
+
* @default 20
|
|
25
|
+
*/
|
|
26
|
+
size?: number;
|
|
27
|
+
/**
|
|
28
|
+
* @default "ASC"
|
|
29
|
+
*/
|
|
30
|
+
sort_order?: 'ASC' | 'DESC';
|
|
31
|
+
sort_field?: string;
|
|
32
|
+
search_term?: string;
|
|
33
|
+
scope?: 'ancestors' | 'descendants' | 'none';
|
|
34
|
+
}
|
|
35
|
+
export type GetAllRegistriesOkResponse = ResponseWithPagination<ListRegistryResponseResponse>;
|
|
36
|
+
export type GetAllRegistriesErrorResponse = BadRequestResponse | UnauthenticatedResponse | UnauthorizedResponse | NotFoundResponse | InternalServerErrorResponse;
|
|
37
|
+
export interface GetAllRegistriesProps extends Omit<FetcherOptions<GetAllRegistriesQueryQueryParams, unknown>, 'url'> {
|
|
38
|
+
queryParams: GetAllRegistriesQueryQueryParams;
|
|
39
|
+
}
|
|
40
|
+
export declare function getAllRegistries(props: GetAllRegistriesProps): Promise<GetAllRegistriesOkResponse>;
|
|
41
|
+
/**
|
|
42
|
+
* Lists all the registries.
|
|
43
|
+
*/
|
|
44
|
+
export declare function useGetAllRegistriesQuery(props: GetAllRegistriesProps, options?: Omit<UseQueryOptions<GetAllRegistriesOkResponse, GetAllRegistriesErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<GetAllRegistriesOkResponse, 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 getAllRegistries(props) {
|
|
7
|
+
return fetcher(Object.assign({ url: `/registries`, method: 'GET' }, props));
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Lists all the registries.
|
|
11
|
+
*/
|
|
12
|
+
export function useGetAllRegistriesQuery(props, options) {
|
|
13
|
+
return useQuery(['GetAllRegistries', props.queryParams], ({ signal }) => getAllRegistries(Object.assign(Object.assign({}, props), { signal })), options);
|
|
14
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
+
import type { MetadataKeysResponseResponse } from '../responses/MetadataKeysResponseResponse';
|
|
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 GetMetadataKeysQueryQueryParams {
|
|
11
|
+
account_identifier: string;
|
|
12
|
+
org_identifier?: string;
|
|
13
|
+
project_identifier?: string;
|
|
14
|
+
/**
|
|
15
|
+
* @format int64
|
|
16
|
+
* @default 0
|
|
17
|
+
*/
|
|
18
|
+
page?: number;
|
|
19
|
+
/**
|
|
20
|
+
* @format int64
|
|
21
|
+
* @default 20
|
|
22
|
+
*/
|
|
23
|
+
size?: number;
|
|
24
|
+
search_term?: string;
|
|
25
|
+
}
|
|
26
|
+
export type GetMetadataKeysOkResponse = ResponseWithPagination<MetadataKeysResponseResponse>;
|
|
27
|
+
export type GetMetadataKeysErrorResponse = BadRequestResponse | UnauthenticatedResponse | UnauthorizedResponse | NotFoundResponse | InternalServerErrorResponse;
|
|
28
|
+
export interface GetMetadataKeysProps extends Omit<FetcherOptions<GetMetadataKeysQueryQueryParams, unknown>, 'url'> {
|
|
29
|
+
queryParams: GetMetadataKeysQueryQueryParams;
|
|
30
|
+
}
|
|
31
|
+
export declare function getMetadataKeys(props: GetMetadataKeysProps): Promise<GetMetadataKeysOkResponse>;
|
|
32
|
+
/**
|
|
33
|
+
* Retrieve a paginated list of all available metadata keys.
|
|
34
|
+
*/
|
|
35
|
+
export declare function useGetMetadataKeysQuery(props: GetMetadataKeysProps, options?: Omit<UseQueryOptions<GetMetadataKeysOkResponse, GetMetadataKeysErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<GetMetadataKeysOkResponse, 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 getMetadataKeys(props) {
|
|
7
|
+
return fetcher(Object.assign({ url: `/metadata/keys`, method: 'GET' }, props));
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Retrieve a paginated list of all available metadata keys.
|
|
11
|
+
*/
|
|
12
|
+
export function useGetMetadataKeysQuery(props, options) {
|
|
13
|
+
return useQuery(['GetMetadataKeys', props.queryParams], ({ signal }) => getMetadataKeys(Object.assign(Object.assign({}, props), { signal })), options);
|
|
14
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
+
import type { MetadataResponseResponse } from '../responses/MetadataResponseResponse';
|
|
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 GetMetadataQueryPathParams {
|
|
11
|
+
path: string;
|
|
12
|
+
}
|
|
13
|
+
export interface GetMetadataQueryQueryParams {
|
|
14
|
+
account_identifier: string;
|
|
15
|
+
org_identifier?: string;
|
|
16
|
+
project_identifier?: string;
|
|
17
|
+
registry_identifier: string;
|
|
18
|
+
}
|
|
19
|
+
export type GetMetadataOkResponse = ResponseWithPagination<MetadataResponseResponse>;
|
|
20
|
+
export type GetMetadataErrorResponse = BadRequestResponse | UnauthenticatedResponse | UnauthorizedResponse | NotFoundResponse | InternalServerErrorResponse;
|
|
21
|
+
export interface GetMetadataProps extends GetMetadataQueryPathParams, Omit<FetcherOptions<GetMetadataQueryQueryParams, unknown>, 'url'> {
|
|
22
|
+
queryParams: GetMetadataQueryQueryParams;
|
|
23
|
+
}
|
|
24
|
+
export declare function getMetadata(props: GetMetadataProps): Promise<GetMetadataOkResponse>;
|
|
25
|
+
/**
|
|
26
|
+
* Retrieves all metadata key-value pairs associated with a specific entity.
|
|
27
|
+
* This endpoint returns metadata for artifacts, versions, or registry-level entities based on the provided path.
|
|
28
|
+
*
|
|
29
|
+
*/
|
|
30
|
+
export declare function useGetMetadataQuery(props: GetMetadataProps, options?: Omit<UseQueryOptions<GetMetadataOkResponse, GetMetadataErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<GetMetadataOkResponse, import("..").Error>;
|
|
@@ -0,0 +1,16 @@
|
|
|
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 getMetadata(props) {
|
|
7
|
+
return fetcher(Object.assign({ url: `/metadata/path/${props.path}`, method: 'GET' }, props));
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Retrieves all metadata key-value pairs associated with a specific entity.
|
|
11
|
+
* This endpoint returns metadata for artifacts, versions, or registry-level entities based on the provided path.
|
|
12
|
+
*
|
|
13
|
+
*/
|
|
14
|
+
export function useGetMetadataQuery(props, options) {
|
|
15
|
+
return useQuery(['GetMetadata', props.path, props.queryParams], ({ signal }) => getMetadata(Object.assign(Object.assign({}, props), { signal })), options);
|
|
16
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
+
import type { MetadataValuesResponseResponse } from '../responses/MetadataValuesResponseResponse';
|
|
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 GetMetadataValuesQueryQueryParams {
|
|
11
|
+
account_identifier: string;
|
|
12
|
+
org_identifier?: string;
|
|
13
|
+
project_identifier?: string;
|
|
14
|
+
key: string;
|
|
15
|
+
/**
|
|
16
|
+
* @format int64
|
|
17
|
+
* @default 0
|
|
18
|
+
*/
|
|
19
|
+
page?: number;
|
|
20
|
+
/**
|
|
21
|
+
* @format int64
|
|
22
|
+
* @default 20
|
|
23
|
+
*/
|
|
24
|
+
size?: number;
|
|
25
|
+
search_term?: string;
|
|
26
|
+
}
|
|
27
|
+
export type GetMetadataValuesOkResponse = ResponseWithPagination<MetadataValuesResponseResponse>;
|
|
28
|
+
export type GetMetadataValuesErrorResponse = BadRequestResponse | UnauthenticatedResponse | UnauthorizedResponse | NotFoundResponse | InternalServerErrorResponse;
|
|
29
|
+
export interface GetMetadataValuesProps extends Omit<FetcherOptions<GetMetadataValuesQueryQueryParams, unknown>, 'url'> {
|
|
30
|
+
queryParams: GetMetadataValuesQueryQueryParams;
|
|
31
|
+
}
|
|
32
|
+
export declare function getMetadataValues(props: GetMetadataValuesProps): Promise<GetMetadataValuesOkResponse>;
|
|
33
|
+
/**
|
|
34
|
+
* Retrieve all possible values for a specific metadata key.
|
|
35
|
+
*/
|
|
36
|
+
export declare function useGetMetadataValuesQuery(props: GetMetadataValuesProps, options?: Omit<UseQueryOptions<GetMetadataValuesOkResponse, GetMetadataValuesErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<GetMetadataValuesOkResponse, 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 getMetadataValues(props) {
|
|
7
|
+
return fetcher(Object.assign({ url: `/metadata/values`, method: 'GET' }, props));
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Retrieve all possible values for a specific metadata key.
|
|
11
|
+
*/
|
|
12
|
+
export function useGetMetadataValuesQuery(props, options) {
|
|
13
|
+
return useQuery(['GetMetadataValues', props.queryParams], ({ signal }) => getMetadataValues(Object.assign(Object.assign({}, props), { signal })), options);
|
|
14
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { UseMutationOptions } from '@tanstack/react-query';
|
|
2
|
+
import type { MetadataResponseResponse } from '../responses/MetadataResponseResponse';
|
|
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 { MetadataRequestRequestBody } from '../requestBodies/MetadataRequestRequestBody';
|
|
9
|
+
import type { ResponseWithPagination } from '../helpers';
|
|
10
|
+
import { FetcherOptions } from '../../../../fetcher/index.js';
|
|
11
|
+
export interface UpdateMetadataMutationPathParams {
|
|
12
|
+
path: string;
|
|
13
|
+
}
|
|
14
|
+
export interface UpdateMetadataMutationQueryParams {
|
|
15
|
+
account_identifier: string;
|
|
16
|
+
org_identifier?: string;
|
|
17
|
+
project_identifier?: string;
|
|
18
|
+
registry_identifier: string;
|
|
19
|
+
}
|
|
20
|
+
export type UpdateMetadataRequestBody = MetadataRequestRequestBody;
|
|
21
|
+
export type UpdateMetadataOkResponse = ResponseWithPagination<MetadataResponseResponse>;
|
|
22
|
+
export type UpdateMetadataErrorResponse = BadRequestResponse | UnauthenticatedResponse | UnauthorizedResponse | NotFoundResponse | InternalServerErrorResponse;
|
|
23
|
+
export interface UpdateMetadataProps extends UpdateMetadataMutationPathParams, Omit<FetcherOptions<UpdateMetadataMutationQueryParams, UpdateMetadataRequestBody>, 'url'> {
|
|
24
|
+
queryParams: UpdateMetadataMutationQueryParams;
|
|
25
|
+
body: UpdateMetadataRequestBody;
|
|
26
|
+
}
|
|
27
|
+
export declare function updateMetadata(props: UpdateMetadataProps): Promise<UpdateMetadataOkResponse>;
|
|
28
|
+
/**
|
|
29
|
+
* Updates or creates metadata key-value pairs for a specific entity.
|
|
30
|
+
* This endpoint allows you to add new metadata or modify existing metadata for artifacts, versions, or registry-level entities.
|
|
31
|
+
* The operation supports both creating new metadata entries and updating existing ones in a single request.
|
|
32
|
+
*
|
|
33
|
+
*/
|
|
34
|
+
export declare function useUpdateMetadataMutation(options?: Omit<UseMutationOptions<UpdateMetadataOkResponse, UpdateMetadataErrorResponse, UpdateMetadataProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<UpdateMetadataOkResponse, import("..").Error, UpdateMetadataProps, unknown>;
|
|
@@ -0,0 +1,17 @@
|
|
|
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 updateMetadata(props) {
|
|
7
|
+
return fetcher(Object.assign({ url: `/metadata/path/${props.path}`, method: 'PUT' }, props));
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Updates or creates metadata key-value pairs for a specific entity.
|
|
11
|
+
* This endpoint allows you to add new metadata or modify existing metadata for artifacts, versions, or registry-level entities.
|
|
12
|
+
* The operation supports both creating new metadata entries and updating existing ones in a single request.
|
|
13
|
+
*
|
|
14
|
+
*/
|
|
15
|
+
export function useUpdateMetadataMutation(options) {
|
|
16
|
+
return useMutation((mutateProps) => updateMetadata(mutateProps), options);
|
|
17
|
+
}
|