@harnessio/react-integration-service-client 0.0.0-stage → 0.0.1
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 +38 -2
- package/dist/fetcher/index.d.ts +17 -0
- package/dist/fetcher/index.js +65 -0
- package/dist/integration-service/src/index.d.ts +6 -0
- package/dist/integration-service/src/index.js +10 -0
- package/dist/integration-service/src/services/helpers.d.ts +14 -0
- package/dist/integration-service/src/services/helpers.js +1 -0
- package/dist/integration-service/src/services/hooks/useCancelIngestionRunMutation.d.ts +16 -0
- package/dist/integration-service/src/services/hooks/useCancelIngestionRunMutation.js +11 -0
- package/dist/integration-service/src/services/hooks/useCheckIntegrationRefMutation.d.ts +42 -0
- package/dist/integration-service/src/services/hooks/useCheckIntegrationRefMutation.js +30 -0
- package/dist/integration-service/src/services/hooks/useClearDefaultIntegrationJobRefMutation.d.ts +41 -0
- package/dist/integration-service/src/services/hooks/useClearDefaultIntegrationJobRefMutation.js +30 -0
- package/dist/integration-service/src/services/hooks/useCreateIntegrationJobRefMutation.d.ts +42 -0
- package/dist/integration-service/src/services/hooks/useCreateIntegrationJobRefMutation.js +30 -0
- package/dist/integration-service/src/services/hooks/useCreateIntegrationRefMutation.d.ts +39 -0
- package/dist/integration-service/src/services/hooks/useCreateIntegrationRefMutation.js +30 -0
- package/dist/integration-service/src/services/hooks/useDeleteIngestionJobSinkMutation.d.ts +12 -0
- package/dist/integration-service/src/services/hooks/useDeleteIngestionJobSinkMutation.js +11 -0
- package/dist/integration-service/src/services/hooks/useDeleteIngestionLimitMutation.d.ts +13 -0
- package/dist/integration-service/src/services/hooks/useDeleteIngestionLimitMutation.js +11 -0
- package/dist/integration-service/src/services/hooks/useDeleteIntegrationJobRefMutation.d.ts +40 -0
- package/dist/integration-service/src/services/hooks/useDeleteIntegrationJobRefMutation.js +30 -0
- package/dist/integration-service/src/services/hooks/useDeleteIntegrationRefMutation.d.ts +37 -0
- package/dist/integration-service/src/services/hooks/useDeleteIntegrationRefMutation.js +30 -0
- package/dist/integration-service/src/services/hooks/useDiscoverIntegrationRefMutation.d.ts +42 -0
- package/dist/integration-service/src/services/hooks/useDiscoverIntegrationRefMutation.js +30 -0
- package/dist/integration-service/src/services/hooks/useGetDefinitionQuery.d.ts +13 -0
- package/dist/integration-service/src/services/hooks/useGetDefinitionQuery.js +11 -0
- package/dist/integration-service/src/services/hooks/useGetIngestionLimitQuery.d.ts +14 -0
- package/dist/integration-service/src/services/hooks/useGetIngestionLimitQuery.js +11 -0
- package/dist/integration-service/src/services/hooks/useGetIngestionRunQuery.d.ts +16 -0
- package/dist/integration-service/src/services/hooks/useGetIngestionRunQuery.js +11 -0
- package/dist/integration-service/src/services/hooks/useGetIntegrationJobRefQuery.d.ts +41 -0
- package/dist/integration-service/src/services/hooks/useGetIntegrationJobRefQuery.js +30 -0
- package/dist/integration-service/src/services/hooks/useGetIntegrationRefQuery.d.ts +38 -0
- package/dist/integration-service/src/services/hooks/useGetIntegrationRefQuery.js +30 -0
- package/dist/integration-service/src/services/hooks/useIngestionRunStdoutMutation.d.ts +16 -0
- package/dist/integration-service/src/services/hooks/useIngestionRunStdoutMutation.js +11 -0
- package/dist/integration-service/src/services/hooks/useListDefinitionsQuery.d.ts +14 -0
- package/dist/integration-service/src/services/hooks/useListDefinitionsQuery.js +11 -0
- package/dist/integration-service/src/services/hooks/useListIngestionJobsQuery.d.ts +26 -0
- package/dist/integration-service/src/services/hooks/useListIngestionJobsQuery.js +11 -0
- package/dist/integration-service/src/services/hooks/useListIngestionLimitsQuery.d.ts +10 -0
- package/dist/integration-service/src/services/hooks/useListIngestionLimitsQuery.js +11 -0
- package/dist/integration-service/src/services/hooks/useListIntegrationJobRunsRefQuery.d.ts +77 -0
- package/dist/integration-service/src/services/hooks/useListIntegrationJobRunsRefQuery.js +30 -0
- package/dist/integration-service/src/services/hooks/useListIntegrationJobsRefQuery.d.ts +38 -0
- package/dist/integration-service/src/services/hooks/useListIntegrationJobsRefQuery.js +30 -0
- package/dist/integration-service/src/services/hooks/useListIntegrationsRefQuery.d.ts +86 -0
- package/dist/integration-service/src/services/hooks/useListIntegrationsRefQuery.js +30 -0
- package/dist/integration-service/src/services/hooks/usePublishLibraryRevisionMutation.d.ts +16 -0
- package/dist/integration-service/src/services/hooks/usePublishLibraryRevisionMutation.js +11 -0
- package/dist/integration-service/src/services/hooks/usePutIngestionJobSinkMutation.d.ts +15 -0
- package/dist/integration-service/src/services/hooks/usePutIngestionJobSinkMutation.js +11 -0
- package/dist/integration-service/src/services/hooks/usePutIngestionLimitMutation.d.ts +16 -0
- package/dist/integration-service/src/services/hooks/usePutIngestionLimitMutation.js +11 -0
- package/dist/integration-service/src/services/hooks/useRepinIntegrationJobRefMutation.d.ts +41 -0
- package/dist/integration-service/src/services/hooks/useRepinIntegrationJobRefMutation.js +30 -0
- package/dist/integration-service/src/services/hooks/useResetIntegrationJobCheckpointsRefMutation.d.ts +49 -0
- package/dist/integration-service/src/services/hooks/useResetIntegrationJobCheckpointsRefMutation.js +30 -0
- package/dist/integration-service/src/services/hooks/useRotateIntegrationJobWebhookTokenRefMutation.d.ts +46 -0
- package/dist/integration-service/src/services/hooks/useRotateIntegrationJobWebhookTokenRefMutation.js +30 -0
- package/dist/integration-service/src/services/hooks/useSetDefaultIntegrationJobRefMutation.d.ts +41 -0
- package/dist/integration-service/src/services/hooks/useSetDefaultIntegrationJobRefMutation.js +30 -0
- package/dist/integration-service/src/services/hooks/useSyncIntegrationJobRefMutation.d.ts +41 -0
- package/dist/integration-service/src/services/hooks/useSyncIntegrationJobRefMutation.js +30 -0
- package/dist/integration-service/src/services/hooks/useUpdateIntegrationJobRefMutation.d.ts +45 -0
- package/dist/integration-service/src/services/hooks/useUpdateIntegrationJobRefMutation.js +30 -0
- package/dist/integration-service/src/services/hooks/useUpdateIntegrationRefMutation.d.ts +42 -0
- package/dist/integration-service/src/services/hooks/useUpdateIntegrationRefMutation.js +30 -0
- package/dist/integration-service/src/services/index.d.ts +89 -0
- package/dist/integration-service/src/services/index.js +32 -0
- package/dist/integration-service/src/services/schemas/CheckpointView.d.ts +7 -0
- package/dist/integration-service/src/services/schemas/CheckpointView.js +4 -0
- package/dist/integration-service/src/services/schemas/Composition.d.ts +6 -0
- package/dist/integration-service/src/services/schemas/Composition.js +4 -0
- package/dist/integration-service/src/services/schemas/Detail.d.ts +11 -0
- package/dist/integration-service/src/services/schemas/Detail.js +1 -0
- package/dist/integration-service/src/services/schemas/Failure.d.ts +4 -0
- package/dist/integration-service/src/services/schemas/Failure.js +4 -0
- package/dist/integration-service/src/services/schemas/Health.d.ts +16 -0
- package/dist/integration-service/src/services/schemas/Health.js +4 -0
- package/dist/integration-service/src/services/schemas/IntegrationRequest.d.ts +17 -0
- package/dist/integration-service/src/services/schemas/IntegrationRequest.js +1 -0
- package/dist/integration-service/src/services/schemas/IntegrationResponse.d.ts +33 -0
- package/dist/integration-service/src/services/schemas/IntegrationResponse.js +1 -0
- package/dist/integration-service/src/services/schemas/JobView.d.ts +41 -0
- package/dist/integration-service/src/services/schemas/JobView.js +1 -0
- package/dist/integration-service/src/services/schemas/JsonNode.d.ts +29 -0
- package/dist/integration-service/src/services/schemas/JsonNode.js +4 -0
- package/dist/integration-service/src/services/schemas/LastRun.d.ts +9 -0
- package/dist/integration-service/src/services/schemas/LastRun.js +4 -0
- package/dist/integration-service/src/services/schemas/Limits.d.ts +35 -0
- package/dist/integration-service/src/services/schemas/Limits.js +4 -0
- package/dist/integration-service/src/services/schemas/LimitsDoc.d.ts +10 -0
- package/dist/integration-service/src/services/schemas/LimitsDoc.js +1 -0
- package/dist/integration-service/src/services/schemas/LoadIssue.d.ts +4 -0
- package/dist/integration-service/src/services/schemas/LoadIssue.js +4 -0
- package/dist/integration-service/src/services/schemas/PublishRequest.d.ts +5 -0
- package/dist/integration-service/src/services/schemas/PublishRequest.js +4 -0
- package/dist/integration-service/src/services/schemas/Result.d.ts +9 -0
- package/dist/integration-service/src/services/schemas/Result.js +1 -0
- package/dist/integration-service/src/services/schemas/Run.d.ts +48 -0
- package/dist/integration-service/src/services/schemas/Run.js +1 -0
- package/dist/integration-service/src/services/schemas/RunnerTarget.d.ts +4 -0
- package/dist/integration-service/src/services/schemas/RunnerTarget.js +4 -0
- package/dist/integration-service/src/services/schemas/SinkRequest.d.ts +3 -0
- package/dist/integration-service/src/services/schemas/SinkRequest.js +4 -0
- package/dist/integration-service/src/services/schemas/State.d.ts +4 -0
- package/dist/integration-service/src/services/schemas/State.js +4 -0
- package/dist/integration-service/src/services/schemas/StreamRun.d.ts +11 -0
- package/dist/integration-service/src/services/schemas/StreamRun.js +4 -0
- package/dist/integration-service/src/services/schemas/StreamSchema.d.ts +6 -0
- package/dist/integration-service/src/services/schemas/StreamSchema.js +4 -0
- package/dist/integration-service/src/services/schemas/Trigger.d.ts +6 -0
- package/dist/integration-service/src/services/schemas/Trigger.js +4 -0
- package/dist/integration-service/src/services/schemas/Use.d.ts +6 -0
- package/dist/integration-service/src/services/schemas/Use.js +4 -0
- package/dist/integration-service/src/services/schemas/WebhookView.d.ts +4 -0
- package/dist/integration-service/src/services/schemas/WebhookView.js +4 -0
- package/package.json +29 -4
package/README.md
CHANGED
|
@@ -1,3 +1,39 @@
|
|
|
1
|
-
#
|
|
1
|
+
# React Integration Service Client
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**OpenAPI -> OA**
|
|
4
|
+
|
|
5
|
+
**TypeScript -> TS**
|
|
6
|
+
|
|
7
|
+
**OpenAPI + TypeScript -> OATS**
|
|
8
|
+
|
|
9
|
+
This React API client will store a collection of Harness Integration 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 : IntegrationServiceAPIClient should be initialized
|
|
19
|
+
|
|
20
|
+
Before using API Client, it must be initialized with required `ClientCallbacks`.
|
|
21
|
+
|
|
22
|
+
Example:
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
new IntegrationServiceAPIClient({
|
|
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(Object.assign({}, (token ? { 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 IntegrationServiceAPIClient {
|
|
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,16 @@
|
|
|
1
|
+
import { UseMutationOptions } from '@tanstack/react-query';
|
|
2
|
+
import type { Run } from '../schemas/Run';
|
|
3
|
+
import type { ResponseWithPagination } from '../helpers';
|
|
4
|
+
import { FetcherOptions } from '../../../../fetcher/index.js';
|
|
5
|
+
export interface CancelIngestionRunMutationPathParams {
|
|
6
|
+
id: string;
|
|
7
|
+
}
|
|
8
|
+
export interface CancelIngestionRunMutationHeaderParams {
|
|
9
|
+
'Harness-Account': string;
|
|
10
|
+
}
|
|
11
|
+
export type CancelIngestionRunOkResponse = ResponseWithPagination<Run>;
|
|
12
|
+
export type CancelIngestionRunErrorResponse = unknown;
|
|
13
|
+
export interface CancelIngestionRunProps extends CancelIngestionRunMutationPathParams, Omit<FetcherOptions<unknown, unknown, CancelIngestionRunMutationHeaderParams>, 'url'> {
|
|
14
|
+
}
|
|
15
|
+
export declare function cancelIngestionRun(props: CancelIngestionRunProps): Promise<CancelIngestionRunOkResponse>;
|
|
16
|
+
export declare function useCancelIngestionRunMutation(options?: Omit<UseMutationOptions<CancelIngestionRunOkResponse, CancelIngestionRunErrorResponse, CancelIngestionRunProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<CancelIngestionRunOkResponse, unknown, CancelIngestionRunProps, unknown>;
|
|
@@ -0,0 +1,11 @@
|
|
|
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 cancelIngestionRun(props) {
|
|
7
|
+
return fetcher(Object.assign({ url: `/v1/ingestion/runs/${props.id}/cancel`, method: 'POST' }, props));
|
|
8
|
+
}
|
|
9
|
+
export function useCancelIngestionRunMutation(options) {
|
|
10
|
+
return useMutation((mutateProps) => cancelIngestionRun(mutateProps), options);
|
|
11
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { UseMutationOptions } from '@tanstack/react-query';
|
|
2
|
+
import type { Result } from '../schemas/Result';
|
|
3
|
+
import type { JsonNode } from '../schemas/JsonNode';
|
|
4
|
+
import type { GetPathParamsType, ResponseWithPagination } from '../helpers';
|
|
5
|
+
import { FetcherOptions } from '../../../../fetcher/index.js';
|
|
6
|
+
export interface CheckIntegrationRefAccountPathParams {
|
|
7
|
+
integration: string;
|
|
8
|
+
}
|
|
9
|
+
export interface CheckIntegrationRefAccountHeaderParams {
|
|
10
|
+
'Harness-Account': string;
|
|
11
|
+
}
|
|
12
|
+
export type CheckIntegrationRefAccountRequestBody = JsonNode;
|
|
13
|
+
export type CheckIntegrationRefAccountOKResponse = Result;
|
|
14
|
+
export type CheckIntegrationRefAccountErrorResponse = unknown;
|
|
15
|
+
export interface CheckIntegrationRefOrgPathParams {
|
|
16
|
+
org: string;
|
|
17
|
+
integration: string;
|
|
18
|
+
}
|
|
19
|
+
export interface CheckIntegrationRefOrgHeaderParams {
|
|
20
|
+
'Harness-Account': string;
|
|
21
|
+
}
|
|
22
|
+
export type CheckIntegrationRefOrgRequestBody = JsonNode;
|
|
23
|
+
export type CheckIntegrationRefOrgOKResponse = Result;
|
|
24
|
+
export type CheckIntegrationRefOrgErrorResponse = unknown;
|
|
25
|
+
export interface CheckIntegrationRefProjectPathParams {
|
|
26
|
+
org: string;
|
|
27
|
+
project: string;
|
|
28
|
+
integration: string;
|
|
29
|
+
}
|
|
30
|
+
export interface CheckIntegrationRefProjectHeaderParams {
|
|
31
|
+
'Harness-Account': string;
|
|
32
|
+
}
|
|
33
|
+
export type CheckIntegrationRefProjectRequestBody = JsonNode;
|
|
34
|
+
export type CheckIntegrationRefProjectOKResponse = Result;
|
|
35
|
+
export type CheckIntegrationRefProjectErrorResponse = unknown;
|
|
36
|
+
export type CheckIntegrationRefOKResponse<T> = T extends CheckIntegrationRefProjectPathParams ? ResponseWithPagination<CheckIntegrationRefProjectOKResponse> : T extends CheckIntegrationRefOrgPathParams ? ResponseWithPagination<CheckIntegrationRefOrgOKResponse> : ResponseWithPagination<CheckIntegrationRefAccountOKResponse>;
|
|
37
|
+
export type CheckIntegrationRefErrorResponse<T> = T extends CheckIntegrationRefProjectPathParams ? CheckIntegrationRefProjectErrorResponse : T extends CheckIntegrationRefOrgPathParams ? CheckIntegrationRefOrgErrorResponse : CheckIntegrationRefAccountErrorResponse;
|
|
38
|
+
export interface CheckIntegrationRefProps extends Omit<FetcherOptions<unknown, unknown>, 'url'> {
|
|
39
|
+
pathParams: CheckIntegrationRefAccountPathParams | CheckIntegrationRefOrgPathParams | CheckIntegrationRefProjectPathParams;
|
|
40
|
+
}
|
|
41
|
+
export declare function checkIntegrationRef<T extends CheckIntegrationRefProps = CheckIntegrationRefProps>(props: T): Promise<CheckIntegrationRefOKResponse<GetPathParamsType<T>>>;
|
|
42
|
+
export declare function useCheckIntegrationRefMutation(options?: Omit<UseMutationOptions<CheckIntegrationRefOKResponse<unknown>, CheckIntegrationRefErrorResponse<unknown>, CheckIntegrationRefProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<ResponseWithPagination<Result>, unknown, CheckIntegrationRefProps, unknown>;
|
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
function isProjectPathParams(pathParams) {
|
|
7
|
+
return !!(pathParams.org &&
|
|
8
|
+
pathParams.project);
|
|
9
|
+
}
|
|
10
|
+
function isOrgPathParams(pathParams) {
|
|
11
|
+
return !!(pathParams.org &&
|
|
12
|
+
!pathParams.project);
|
|
13
|
+
}
|
|
14
|
+
export function checkIntegrationRef(props) {
|
|
15
|
+
let url = `/v1/integrations/${props.pathParams.integration}/check`;
|
|
16
|
+
let method = 'POST';
|
|
17
|
+
if (isProjectPathParams(props.pathParams)) {
|
|
18
|
+
url = `/v1/orgs/${props.pathParams.org}/projects/${props.pathParams.project}/integrations/${props.pathParams.integration}/check`;
|
|
19
|
+
method = 'POST';
|
|
20
|
+
}
|
|
21
|
+
else if (isOrgPathParams(props.pathParams)) {
|
|
22
|
+
url = `/v1/orgs/${props.pathParams.org}/integrations/${props.pathParams.integration}/check`;
|
|
23
|
+
method = 'POST';
|
|
24
|
+
}
|
|
25
|
+
return fetcher(Object.assign({ url,
|
|
26
|
+
method }, props));
|
|
27
|
+
}
|
|
28
|
+
export function useCheckIntegrationRefMutation(options) {
|
|
29
|
+
return useMutation((mutateProps) => checkIntegrationRef(mutateProps), options);
|
|
30
|
+
}
|
package/dist/integration-service/src/services/hooks/useClearDefaultIntegrationJobRefMutation.d.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { UseMutationOptions } from '@tanstack/react-query';
|
|
2
|
+
import type { JobView } from '../schemas/JobView';
|
|
3
|
+
import type { GetPathParamsType, ResponseWithPagination } from '../helpers';
|
|
4
|
+
import { FetcherOptions } from '../../../../fetcher/index.js';
|
|
5
|
+
export interface ClearDefaultIntegrationJobRefAccountPathParams {
|
|
6
|
+
integration: string;
|
|
7
|
+
job: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ClearDefaultIntegrationJobRefAccountHeaderParams {
|
|
10
|
+
'Harness-Account': string;
|
|
11
|
+
}
|
|
12
|
+
export type ClearDefaultIntegrationJobRefAccountOKResponse = JobView;
|
|
13
|
+
export type ClearDefaultIntegrationJobRefAccountErrorResponse = unknown;
|
|
14
|
+
export interface ClearDefaultIntegrationJobRefOrgPathParams {
|
|
15
|
+
org: string;
|
|
16
|
+
integration: string;
|
|
17
|
+
job: string;
|
|
18
|
+
}
|
|
19
|
+
export interface ClearDefaultIntegrationJobRefOrgHeaderParams {
|
|
20
|
+
'Harness-Account': string;
|
|
21
|
+
}
|
|
22
|
+
export type ClearDefaultIntegrationJobRefOrgOKResponse = JobView;
|
|
23
|
+
export type ClearDefaultIntegrationJobRefOrgErrorResponse = unknown;
|
|
24
|
+
export interface ClearDefaultIntegrationJobRefProjectPathParams {
|
|
25
|
+
org: string;
|
|
26
|
+
project: string;
|
|
27
|
+
integration: string;
|
|
28
|
+
job: string;
|
|
29
|
+
}
|
|
30
|
+
export interface ClearDefaultIntegrationJobRefProjectHeaderParams {
|
|
31
|
+
'Harness-Account': string;
|
|
32
|
+
}
|
|
33
|
+
export type ClearDefaultIntegrationJobRefProjectOKResponse = JobView;
|
|
34
|
+
export type ClearDefaultIntegrationJobRefProjectErrorResponse = unknown;
|
|
35
|
+
export type ClearDefaultIntegrationJobRefOKResponse<T> = T extends ClearDefaultIntegrationJobRefProjectPathParams ? ResponseWithPagination<ClearDefaultIntegrationJobRefProjectOKResponse> : T extends ClearDefaultIntegrationJobRefOrgPathParams ? ResponseWithPagination<ClearDefaultIntegrationJobRefOrgOKResponse> : ResponseWithPagination<ClearDefaultIntegrationJobRefAccountOKResponse>;
|
|
36
|
+
export type ClearDefaultIntegrationJobRefErrorResponse<T> = T extends ClearDefaultIntegrationJobRefProjectPathParams ? ClearDefaultIntegrationJobRefProjectErrorResponse : T extends ClearDefaultIntegrationJobRefOrgPathParams ? ClearDefaultIntegrationJobRefOrgErrorResponse : ClearDefaultIntegrationJobRefAccountErrorResponse;
|
|
37
|
+
export interface ClearDefaultIntegrationJobRefProps extends Omit<FetcherOptions<unknown, unknown>, 'url'> {
|
|
38
|
+
pathParams: ClearDefaultIntegrationJobRefAccountPathParams | ClearDefaultIntegrationJobRefOrgPathParams | ClearDefaultIntegrationJobRefProjectPathParams;
|
|
39
|
+
}
|
|
40
|
+
export declare function clearDefaultIntegrationJobRef<T extends ClearDefaultIntegrationJobRefProps = ClearDefaultIntegrationJobRefProps>(props: T): Promise<ClearDefaultIntegrationJobRefOKResponse<GetPathParamsType<T>>>;
|
|
41
|
+
export declare function useClearDefaultIntegrationJobRefMutation(options?: Omit<UseMutationOptions<ClearDefaultIntegrationJobRefOKResponse<unknown>, ClearDefaultIntegrationJobRefErrorResponse<unknown>, ClearDefaultIntegrationJobRefProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<ResponseWithPagination<JobView>, unknown, ClearDefaultIntegrationJobRefProps, unknown>;
|
package/dist/integration-service/src/services/hooks/useClearDefaultIntegrationJobRefMutation.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
function isProjectPathParams(pathParams) {
|
|
7
|
+
return !!(pathParams.org &&
|
|
8
|
+
pathParams.project);
|
|
9
|
+
}
|
|
10
|
+
function isOrgPathParams(pathParams) {
|
|
11
|
+
return !!(pathParams.org &&
|
|
12
|
+
!pathParams.project);
|
|
13
|
+
}
|
|
14
|
+
export function clearDefaultIntegrationJobRef(props) {
|
|
15
|
+
let url = `/v1/integrations/${props.pathParams.integration}/jobs/${props.pathParams.job}/default`;
|
|
16
|
+
let method = 'DELETE';
|
|
17
|
+
if (isProjectPathParams(props.pathParams)) {
|
|
18
|
+
url = `/v1/orgs/${props.pathParams.org}/projects/${props.pathParams.project}/integrations/${props.pathParams.integration}/jobs/${props.pathParams.job}/default`;
|
|
19
|
+
method = 'DELETE';
|
|
20
|
+
}
|
|
21
|
+
else if (isOrgPathParams(props.pathParams)) {
|
|
22
|
+
url = `/v1/orgs/${props.pathParams.org}/integrations/${props.pathParams.integration}/jobs/${props.pathParams.job}/default`;
|
|
23
|
+
method = 'DELETE';
|
|
24
|
+
}
|
|
25
|
+
return fetcher(Object.assign({ url,
|
|
26
|
+
method }, props));
|
|
27
|
+
}
|
|
28
|
+
export function useClearDefaultIntegrationJobRefMutation(options) {
|
|
29
|
+
return useMutation((mutateProps) => clearDefaultIntegrationJobRef(mutateProps), options);
|
|
30
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { UseMutationOptions } from '@tanstack/react-query';
|
|
2
|
+
import type { JobView } from '../schemas/JobView';
|
|
3
|
+
import type { JsonNode } from '../schemas/JsonNode';
|
|
4
|
+
import type { GetPathParamsType, ResponseWithPagination } from '../helpers';
|
|
5
|
+
import { FetcherOptions } from '../../../../fetcher/index.js';
|
|
6
|
+
export interface CreateIntegrationJobRefAccountPathParams {
|
|
7
|
+
integration: string;
|
|
8
|
+
}
|
|
9
|
+
export interface CreateIntegrationJobRefAccountHeaderParams {
|
|
10
|
+
'Harness-Account': string;
|
|
11
|
+
}
|
|
12
|
+
export type CreateIntegrationJobRefAccountRequestBody = JsonNode;
|
|
13
|
+
export type CreateIntegrationJobRefAccountOKResponse = JobView;
|
|
14
|
+
export type CreateIntegrationJobRefAccountErrorResponse = unknown;
|
|
15
|
+
export interface CreateIntegrationJobRefOrgPathParams {
|
|
16
|
+
org: string;
|
|
17
|
+
integration: string;
|
|
18
|
+
}
|
|
19
|
+
export interface CreateIntegrationJobRefOrgHeaderParams {
|
|
20
|
+
'Harness-Account': string;
|
|
21
|
+
}
|
|
22
|
+
export type CreateIntegrationJobRefOrgRequestBody = JsonNode;
|
|
23
|
+
export type CreateIntegrationJobRefOrgOKResponse = JobView;
|
|
24
|
+
export type CreateIntegrationJobRefOrgErrorResponse = unknown;
|
|
25
|
+
export interface CreateIntegrationJobRefProjectPathParams {
|
|
26
|
+
org: string;
|
|
27
|
+
project: string;
|
|
28
|
+
integration: string;
|
|
29
|
+
}
|
|
30
|
+
export interface CreateIntegrationJobRefProjectHeaderParams {
|
|
31
|
+
'Harness-Account': string;
|
|
32
|
+
}
|
|
33
|
+
export type CreateIntegrationJobRefProjectRequestBody = JsonNode;
|
|
34
|
+
export type CreateIntegrationJobRefProjectOKResponse = JobView;
|
|
35
|
+
export type CreateIntegrationJobRefProjectErrorResponse = unknown;
|
|
36
|
+
export type CreateIntegrationJobRefOKResponse<T> = T extends CreateIntegrationJobRefProjectPathParams ? ResponseWithPagination<CreateIntegrationJobRefProjectOKResponse> : T extends CreateIntegrationJobRefOrgPathParams ? ResponseWithPagination<CreateIntegrationJobRefOrgOKResponse> : ResponseWithPagination<CreateIntegrationJobRefAccountOKResponse>;
|
|
37
|
+
export type CreateIntegrationJobRefErrorResponse<T> = T extends CreateIntegrationJobRefProjectPathParams ? CreateIntegrationJobRefProjectErrorResponse : T extends CreateIntegrationJobRefOrgPathParams ? CreateIntegrationJobRefOrgErrorResponse : CreateIntegrationJobRefAccountErrorResponse;
|
|
38
|
+
export interface CreateIntegrationJobRefProps extends Omit<FetcherOptions<unknown, unknown>, 'url'> {
|
|
39
|
+
pathParams: CreateIntegrationJobRefAccountPathParams | CreateIntegrationJobRefOrgPathParams | CreateIntegrationJobRefProjectPathParams;
|
|
40
|
+
}
|
|
41
|
+
export declare function createIntegrationJobRef<T extends CreateIntegrationJobRefProps = CreateIntegrationJobRefProps>(props: T): Promise<CreateIntegrationJobRefOKResponse<GetPathParamsType<T>>>;
|
|
42
|
+
export declare function useCreateIntegrationJobRefMutation(options?: Omit<UseMutationOptions<CreateIntegrationJobRefOKResponse<unknown>, CreateIntegrationJobRefErrorResponse<unknown>, CreateIntegrationJobRefProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<ResponseWithPagination<JobView>, unknown, CreateIntegrationJobRefProps, unknown>;
|
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
function isProjectPathParams(pathParams) {
|
|
7
|
+
return !!(pathParams.org &&
|
|
8
|
+
pathParams.project);
|
|
9
|
+
}
|
|
10
|
+
function isOrgPathParams(pathParams) {
|
|
11
|
+
return !!(pathParams.org &&
|
|
12
|
+
!pathParams.project);
|
|
13
|
+
}
|
|
14
|
+
export function createIntegrationJobRef(props) {
|
|
15
|
+
let url = `/v1/integrations/${props.pathParams.integration}/jobs`;
|
|
16
|
+
let method = 'POST';
|
|
17
|
+
if (isProjectPathParams(props.pathParams)) {
|
|
18
|
+
url = `/v1/orgs/${props.pathParams.org}/projects/${props.pathParams.project}/integrations/${props.pathParams.integration}/jobs`;
|
|
19
|
+
method = 'POST';
|
|
20
|
+
}
|
|
21
|
+
else if (isOrgPathParams(props.pathParams)) {
|
|
22
|
+
url = `/v1/orgs/${props.pathParams.org}/integrations/${props.pathParams.integration}/jobs`;
|
|
23
|
+
method = 'POST';
|
|
24
|
+
}
|
|
25
|
+
return fetcher(Object.assign({ url,
|
|
26
|
+
method }, props));
|
|
27
|
+
}
|
|
28
|
+
export function useCreateIntegrationJobRefMutation(options) {
|
|
29
|
+
return useMutation((mutateProps) => createIntegrationJobRef(mutateProps), options);
|
|
30
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { UseMutationOptions } from '@tanstack/react-query';
|
|
2
|
+
import type { IntegrationResponse } from '../schemas/IntegrationResponse';
|
|
3
|
+
import type { IntegrationRequest } from '../schemas/IntegrationRequest';
|
|
4
|
+
import type { GetPathParamsType, ResponseWithPagination } from '../helpers';
|
|
5
|
+
import { FetcherOptions } from '../../../../fetcher/index.js';
|
|
6
|
+
export interface CreateIntegrationRefAccountPathParams {
|
|
7
|
+
}
|
|
8
|
+
export interface CreateIntegrationRefAccountHeaderParams {
|
|
9
|
+
'Harness-Account': string;
|
|
10
|
+
}
|
|
11
|
+
export type CreateIntegrationRefAccountRequestBody = IntegrationRequest;
|
|
12
|
+
export type CreateIntegrationRefAccountOKResponse = IntegrationResponse;
|
|
13
|
+
export type CreateIntegrationRefAccountErrorResponse = unknown;
|
|
14
|
+
export interface CreateIntegrationRefOrgPathParams {
|
|
15
|
+
org: string;
|
|
16
|
+
}
|
|
17
|
+
export interface CreateIntegrationRefOrgHeaderParams {
|
|
18
|
+
'Harness-Account': string;
|
|
19
|
+
}
|
|
20
|
+
export type CreateIntegrationRefOrgRequestBody = IntegrationRequest;
|
|
21
|
+
export type CreateIntegrationRefOrgOKResponse = IntegrationResponse;
|
|
22
|
+
export type CreateIntegrationRefOrgErrorResponse = unknown;
|
|
23
|
+
export interface CreateIntegrationRefProjectPathParams {
|
|
24
|
+
org: string;
|
|
25
|
+
project: string;
|
|
26
|
+
}
|
|
27
|
+
export interface CreateIntegrationRefProjectHeaderParams {
|
|
28
|
+
'Harness-Account': string;
|
|
29
|
+
}
|
|
30
|
+
export type CreateIntegrationRefProjectRequestBody = IntegrationRequest;
|
|
31
|
+
export type CreateIntegrationRefProjectOKResponse = IntegrationResponse;
|
|
32
|
+
export type CreateIntegrationRefProjectErrorResponse = unknown;
|
|
33
|
+
export type CreateIntegrationRefOKResponse<T> = T extends CreateIntegrationRefProjectPathParams ? ResponseWithPagination<CreateIntegrationRefProjectOKResponse> : T extends CreateIntegrationRefOrgPathParams ? ResponseWithPagination<CreateIntegrationRefOrgOKResponse> : ResponseWithPagination<CreateIntegrationRefAccountOKResponse>;
|
|
34
|
+
export type CreateIntegrationRefErrorResponse<T> = T extends CreateIntegrationRefProjectPathParams ? CreateIntegrationRefProjectErrorResponse : T extends CreateIntegrationRefOrgPathParams ? CreateIntegrationRefOrgErrorResponse : CreateIntegrationRefAccountErrorResponse;
|
|
35
|
+
export interface CreateIntegrationRefProps extends Omit<FetcherOptions<unknown, unknown>, 'url'> {
|
|
36
|
+
pathParams: CreateIntegrationRefAccountPathParams | CreateIntegrationRefOrgPathParams | CreateIntegrationRefProjectPathParams;
|
|
37
|
+
}
|
|
38
|
+
export declare function createIntegrationRef<T extends CreateIntegrationRefProps = CreateIntegrationRefProps>(props: T): Promise<CreateIntegrationRefOKResponse<GetPathParamsType<T>>>;
|
|
39
|
+
export declare function useCreateIntegrationRefMutation(options?: Omit<UseMutationOptions<CreateIntegrationRefOKResponse<unknown>, CreateIntegrationRefErrorResponse<unknown>, CreateIntegrationRefProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<ResponseWithPagination<IntegrationResponse>, unknown, CreateIntegrationRefProps, unknown>;
|
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
function isProjectPathParams(pathParams) {
|
|
7
|
+
return !!(pathParams.org &&
|
|
8
|
+
pathParams.project);
|
|
9
|
+
}
|
|
10
|
+
function isOrgPathParams(pathParams) {
|
|
11
|
+
return !!(pathParams.org &&
|
|
12
|
+
!pathParams.project);
|
|
13
|
+
}
|
|
14
|
+
export function createIntegrationRef(props) {
|
|
15
|
+
let url = `/v1/integrations`;
|
|
16
|
+
let method = 'POST';
|
|
17
|
+
if (isProjectPathParams(props.pathParams)) {
|
|
18
|
+
url = `/v1/orgs/${props.pathParams.org}/projects/${props.pathParams.project}/integrations`;
|
|
19
|
+
method = 'POST';
|
|
20
|
+
}
|
|
21
|
+
else if (isOrgPathParams(props.pathParams)) {
|
|
22
|
+
url = `/v1/orgs/${props.pathParams.org}/integrations`;
|
|
23
|
+
method = 'POST';
|
|
24
|
+
}
|
|
25
|
+
return fetcher(Object.assign({ url,
|
|
26
|
+
method }, props));
|
|
27
|
+
}
|
|
28
|
+
export function useCreateIntegrationRefMutation(options) {
|
|
29
|
+
return useMutation((mutateProps) => createIntegrationRef(mutateProps), options);
|
|
30
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { UseMutationOptions } from '@tanstack/react-query';
|
|
2
|
+
import type { ResponseWithPagination } from '../helpers';
|
|
3
|
+
import { FetcherOptions } from '../../../../fetcher/index.js';
|
|
4
|
+
export interface DeleteIngestionJobSinkMutationPathParams {
|
|
5
|
+
jobId: string;
|
|
6
|
+
}
|
|
7
|
+
export type DeleteIngestionJobSinkOkResponse = ResponseWithPagination<unknown>;
|
|
8
|
+
export type DeleteIngestionJobSinkErrorResponse = unknown;
|
|
9
|
+
export interface DeleteIngestionJobSinkProps extends DeleteIngestionJobSinkMutationPathParams, Omit<FetcherOptions<unknown, unknown>, 'url'> {
|
|
10
|
+
}
|
|
11
|
+
export declare function deleteIngestionJobSink(props: DeleteIngestionJobSinkProps): Promise<DeleteIngestionJobSinkOkResponse>;
|
|
12
|
+
export declare function useDeleteIngestionJobSinkMutation(options?: Omit<UseMutationOptions<DeleteIngestionJobSinkOkResponse, DeleteIngestionJobSinkErrorResponse, DeleteIngestionJobSinkProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<DeleteIngestionJobSinkOkResponse, unknown, DeleteIngestionJobSinkProps, unknown>;
|
|
@@ -0,0 +1,11 @@
|
|
|
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 deleteIngestionJobSink(props) {
|
|
7
|
+
return fetcher(Object.assign({ url: `/v1/ingestion/admin/jobs/${props.jobId}/sink`, method: 'DELETE' }, props));
|
|
8
|
+
}
|
|
9
|
+
export function useDeleteIngestionJobSinkMutation(options) {
|
|
10
|
+
return useMutation((mutateProps) => deleteIngestionJobSink(mutateProps), options);
|
|
11
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { UseMutationOptions } from '@tanstack/react-query';
|
|
2
|
+
import type { ResponseWithPagination } from '../helpers';
|
|
3
|
+
import { FetcherOptions } from '../../../../fetcher/index.js';
|
|
4
|
+
export interface DeleteIngestionLimitMutationPathParams {
|
|
5
|
+
scope: string;
|
|
6
|
+
id: string;
|
|
7
|
+
}
|
|
8
|
+
export type DeleteIngestionLimitOkResponse = ResponseWithPagination<unknown>;
|
|
9
|
+
export type DeleteIngestionLimitErrorResponse = unknown;
|
|
10
|
+
export interface DeleteIngestionLimitProps extends DeleteIngestionLimitMutationPathParams, Omit<FetcherOptions<unknown, unknown>, 'url'> {
|
|
11
|
+
}
|
|
12
|
+
export declare function deleteIngestionLimit(props: DeleteIngestionLimitProps): Promise<DeleteIngestionLimitOkResponse>;
|
|
13
|
+
export declare function useDeleteIngestionLimitMutation(options?: Omit<UseMutationOptions<DeleteIngestionLimitOkResponse, DeleteIngestionLimitErrorResponse, DeleteIngestionLimitProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<DeleteIngestionLimitOkResponse, unknown, DeleteIngestionLimitProps, unknown>;
|
|
@@ -0,0 +1,11 @@
|
|
|
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 deleteIngestionLimit(props) {
|
|
7
|
+
return fetcher(Object.assign({ url: `/v1/ingestion/admin/limits/${props.scope}/${props.id}`, method: 'DELETE' }, props));
|
|
8
|
+
}
|
|
9
|
+
export function useDeleteIngestionLimitMutation(options) {
|
|
10
|
+
return useMutation((mutateProps) => deleteIngestionLimit(mutateProps), options);
|
|
11
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { UseMutationOptions } from '@tanstack/react-query';
|
|
2
|
+
import type { GetPathParamsType, ResponseWithPagination } from '../helpers';
|
|
3
|
+
import { FetcherOptions } from '../../../../fetcher/index.js';
|
|
4
|
+
export interface DeleteIntegrationJobRefAccountPathParams {
|
|
5
|
+
integration: string;
|
|
6
|
+
job: string;
|
|
7
|
+
}
|
|
8
|
+
export interface DeleteIntegrationJobRefAccountHeaderParams {
|
|
9
|
+
'Harness-Account': string;
|
|
10
|
+
}
|
|
11
|
+
export type DeleteIntegrationJobRefAccountOKResponse = unknown;
|
|
12
|
+
export type DeleteIntegrationJobRefAccountErrorResponse = unknown;
|
|
13
|
+
export interface DeleteIntegrationJobRefOrgPathParams {
|
|
14
|
+
org: string;
|
|
15
|
+
integration: string;
|
|
16
|
+
job: string;
|
|
17
|
+
}
|
|
18
|
+
export interface DeleteIntegrationJobRefOrgHeaderParams {
|
|
19
|
+
'Harness-Account': string;
|
|
20
|
+
}
|
|
21
|
+
export type DeleteIntegrationJobRefOrgOKResponse = unknown;
|
|
22
|
+
export type DeleteIntegrationJobRefOrgErrorResponse = unknown;
|
|
23
|
+
export interface DeleteIntegrationJobRefProjectPathParams {
|
|
24
|
+
org: string;
|
|
25
|
+
project: string;
|
|
26
|
+
integration: string;
|
|
27
|
+
job: string;
|
|
28
|
+
}
|
|
29
|
+
export interface DeleteIntegrationJobRefProjectHeaderParams {
|
|
30
|
+
'Harness-Account': string;
|
|
31
|
+
}
|
|
32
|
+
export type DeleteIntegrationJobRefProjectOKResponse = unknown;
|
|
33
|
+
export type DeleteIntegrationJobRefProjectErrorResponse = unknown;
|
|
34
|
+
export type DeleteIntegrationJobRefOKResponse<T> = T extends DeleteIntegrationJobRefProjectPathParams ? ResponseWithPagination<DeleteIntegrationJobRefProjectOKResponse> : T extends DeleteIntegrationJobRefOrgPathParams ? ResponseWithPagination<DeleteIntegrationJobRefOrgOKResponse> : ResponseWithPagination<DeleteIntegrationJobRefAccountOKResponse>;
|
|
35
|
+
export type DeleteIntegrationJobRefErrorResponse<T> = T extends DeleteIntegrationJobRefProjectPathParams ? DeleteIntegrationJobRefProjectErrorResponse : T extends DeleteIntegrationJobRefOrgPathParams ? DeleteIntegrationJobRefOrgErrorResponse : DeleteIntegrationJobRefAccountErrorResponse;
|
|
36
|
+
export interface DeleteIntegrationJobRefProps extends Omit<FetcherOptions<unknown, unknown>, 'url'> {
|
|
37
|
+
pathParams: DeleteIntegrationJobRefAccountPathParams | DeleteIntegrationJobRefOrgPathParams | DeleteIntegrationJobRefProjectPathParams;
|
|
38
|
+
}
|
|
39
|
+
export declare function deleteIntegrationJobRef<T extends DeleteIntegrationJobRefProps = DeleteIntegrationJobRefProps>(props: T): Promise<DeleteIntegrationJobRefOKResponse<GetPathParamsType<T>>>;
|
|
40
|
+
export declare function useDeleteIntegrationJobRefMutation(options?: Omit<UseMutationOptions<DeleteIntegrationJobRefOKResponse<unknown>, DeleteIntegrationJobRefErrorResponse<unknown>, DeleteIntegrationJobRefProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<ResponseWithPagination<unknown>, unknown, DeleteIntegrationJobRefProps, unknown>;
|
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
function isProjectPathParams(pathParams) {
|
|
7
|
+
return !!(pathParams.org &&
|
|
8
|
+
pathParams.project);
|
|
9
|
+
}
|
|
10
|
+
function isOrgPathParams(pathParams) {
|
|
11
|
+
return !!(pathParams.org &&
|
|
12
|
+
!pathParams.project);
|
|
13
|
+
}
|
|
14
|
+
export function deleteIntegrationJobRef(props) {
|
|
15
|
+
let url = `/v1/integrations/${props.pathParams.integration}/jobs/${props.pathParams.job}`;
|
|
16
|
+
let method = 'DELETE';
|
|
17
|
+
if (isProjectPathParams(props.pathParams)) {
|
|
18
|
+
url = `/v1/orgs/${props.pathParams.org}/projects/${props.pathParams.project}/integrations/${props.pathParams.integration}/jobs/${props.pathParams.job}`;
|
|
19
|
+
method = 'DELETE';
|
|
20
|
+
}
|
|
21
|
+
else if (isOrgPathParams(props.pathParams)) {
|
|
22
|
+
url = `/v1/orgs/${props.pathParams.org}/integrations/${props.pathParams.integration}/jobs/${props.pathParams.job}`;
|
|
23
|
+
method = 'DELETE';
|
|
24
|
+
}
|
|
25
|
+
return fetcher(Object.assign({ url,
|
|
26
|
+
method }, props));
|
|
27
|
+
}
|
|
28
|
+
export function useDeleteIntegrationJobRefMutation(options) {
|
|
29
|
+
return useMutation((mutateProps) => deleteIntegrationJobRef(mutateProps), options);
|
|
30
|
+
}
|