@harnessio/react-notification-service-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/notification-service/src/index.d.ts +5 -0
- package/dist/notification-service/src/index.js +7 -0
- package/dist/notification-service/src/services/helpers.d.ts +14 -0
- package/dist/notification-service/src/services/helpers.js +1 -0
- package/dist/notification-service/src/services/hooks/useDeleteV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleMutation.d.ts +20 -0
- package/dist/notification-service/src/services/hooks/useDeleteV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleMutation.js +14 -0
- package/dist/notification-service/src/services/hooks/useDeletev1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelMutation.d.ts +20 -0
- package/dist/notification-service/src/services/hooks/useDeletev1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelMutation.js +14 -0
- package/dist/notification-service/src/services/hooks/useGetNotificationChannelQuery.d.ts +30 -0
- package/dist/notification-service/src/services/hooks/useGetNotificationChannelQuery.js +14 -0
- package/dist/notification-service/src/services/hooks/useGetNotificationChannelsNotificationChannelQuery.d.ts +21 -0
- package/dist/notification-service/src/services/hooks/useGetNotificationChannelsNotificationChannelQuery.js +19 -0
- package/dist/notification-service/src/services/hooks/useGetNotificationRuleListQuery.d.ts +33 -0
- package/dist/notification-service/src/services/hooks/useGetNotificationRuleListQuery.js +14 -0
- package/dist/notification-service/src/services/hooks/useGetV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleQuery.d.ts +21 -0
- package/dist/notification-service/src/services/hooks/useGetV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleQuery.js +19 -0
- package/dist/notification-service/src/services/hooks/usePostNotificationChannelMutation.d.ts +23 -0
- package/dist/notification-service/src/services/hooks/usePostNotificationChannelMutation.js +14 -0
- package/dist/notification-service/src/services/hooks/usePostNotificationRuleMutation.d.ts +23 -0
- package/dist/notification-service/src/services/hooks/usePostNotificationRuleMutation.js +14 -0
- package/dist/notification-service/src/services/hooks/usePutV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleMutation.d.ts +24 -0
- package/dist/notification-service/src/services/hooks/usePutV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleMutation.js +14 -0
- package/dist/notification-service/src/services/hooks/usePutv1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelMutation.d.ts +24 -0
- package/dist/notification-service/src/services/hooks/usePutv1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelMutation.js +14 -0
- package/dist/notification-service/src/services/index.d.ts +29 -0
- package/dist/notification-service/src/services/index.js +10 -0
- package/dist/notification-service/src/services/requestBodies/NotificationChannelRequestRequestBody.d.ts +2 -0
- package/dist/notification-service/src/services/requestBodies/NotificationChannelRequestRequestBody.js +1 -0
- package/dist/notification-service/src/services/requestBodies/NotificationRuleRequestRequestBody.d.ts +2 -0
- package/dist/notification-service/src/services/requestBodies/NotificationRuleRequestRequestBody.js +1 -0
- package/dist/notification-service/src/services/responses/NotificationChannelListResponseResponse.d.ts +2 -0
- package/dist/notification-service/src/services/responses/NotificationChannelListResponseResponse.js +1 -0
- package/dist/notification-service/src/services/responses/NotificationChannelResponseResponse.d.ts +2 -0
- package/dist/notification-service/src/services/responses/NotificationChannelResponseResponse.js +1 -0
- package/dist/notification-service/src/services/responses/NotificationRuleListResponseResponse.d.ts +2 -0
- package/dist/notification-service/src/services/responses/NotificationRuleListResponseResponse.js +1 -0
- package/dist/notification-service/src/services/responses/NotificationRuleResponseResponse.d.ts +2 -0
- package/dist/notification-service/src/services/responses/NotificationRuleResponseResponse.js +1 -0
- package/dist/notification-service/src/services/schemas/NotificationChannelDto.d.ts +22 -0
- package/dist/notification-service/src/services/schemas/NotificationChannelDto.js +4 -0
- package/dist/notification-service/src/services/schemas/NotificationRuleDto.d.ts +40 -0
- package/dist/notification-service/src/services/schemas/NotificationRuleDto.js +4 -0
- package/package.json +34 -0
package/README.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# React Notification 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 Notification 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 : HarnessReactAPIClient should be initialized
|
|
19
|
+
|
|
20
|
+
Before using API Client, it must be initilaized with required `ClientCallbacks`.
|
|
21
|
+
|
|
22
|
+
Example:
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
new NotificationServiceAPIClient({
|
|
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,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,20 @@
|
|
|
1
|
+
import { UseMutationOptions } from '@tanstack/react-query';
|
|
2
|
+
import type { ResponseWithPagination } from '../helpers';
|
|
3
|
+
import { FetcherOptions } from '../../../../fetcher/index.js';
|
|
4
|
+
export interface DeleteV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleMutationPathParams {
|
|
5
|
+
org: string;
|
|
6
|
+
project: string;
|
|
7
|
+
'notification-rule': string;
|
|
8
|
+
}
|
|
9
|
+
export interface DeleteV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleMutationHeaderParams {
|
|
10
|
+
'Harness-Account'?: string;
|
|
11
|
+
}
|
|
12
|
+
export type DeleteV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleOkResponse = ResponseWithPagination<unknown>;
|
|
13
|
+
export type DeleteV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleErrorResponse = unknown;
|
|
14
|
+
export interface DeleteV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleProps extends DeleteV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleMutationPathParams, Omit<FetcherOptions<unknown, unknown, DeleteV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleMutationHeaderParams>, 'url'> {
|
|
15
|
+
}
|
|
16
|
+
export declare function deleteV1OrgsOrgProjectsProjectNotificationRuleNotificationRule(props: DeleteV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleProps): Promise<DeleteV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleOkResponse>;
|
|
17
|
+
/**
|
|
18
|
+
* Delete notification rule
|
|
19
|
+
*/
|
|
20
|
+
export declare function useDeleteV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleMutation(options?: Omit<UseMutationOptions<DeleteV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleOkResponse, DeleteV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleErrorResponse, DeleteV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<DeleteV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleOkResponse, unknown, DeleteV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleProps, unknown>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// This code is autogenerated using @harnessio/oats-cli.
|
|
3
|
+
// Please do not modify this code directly.
|
|
4
|
+
import { useMutation } from '@tanstack/react-query';
|
|
5
|
+
import { fetcher } from '../../../../fetcher/index.js';
|
|
6
|
+
export function deleteV1OrgsOrgProjectsProjectNotificationRuleNotificationRule(props) {
|
|
7
|
+
return fetcher(Object.assign({ url: `/v1/orgs/${props.org}/projects/${props.project}/notification-rule/${props['notification-rule']}`, method: 'DELETE' }, props));
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Delete notification rule
|
|
11
|
+
*/
|
|
12
|
+
export function useDeleteV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleMutation(options) {
|
|
13
|
+
return useMutation((mutateProps) => deleteV1OrgsOrgProjectsProjectNotificationRuleNotificationRule(mutateProps), options);
|
|
14
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { UseMutationOptions } from '@tanstack/react-query';
|
|
2
|
+
import type { ResponseWithPagination } from '../helpers';
|
|
3
|
+
import { FetcherOptions } from '../../../../fetcher/index.js';
|
|
4
|
+
export interface Deletev1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelMutationPathParams {
|
|
5
|
+
'notification-channel': string;
|
|
6
|
+
org: string;
|
|
7
|
+
project: string;
|
|
8
|
+
}
|
|
9
|
+
export interface Deletev1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelMutationHeaderParams {
|
|
10
|
+
'Harness-Account'?: string;
|
|
11
|
+
}
|
|
12
|
+
export type Deletev1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelOkResponse = ResponseWithPagination<unknown>;
|
|
13
|
+
export type Deletev1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelErrorResponse = unknown;
|
|
14
|
+
export interface Deletev1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelProps extends Deletev1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelMutationPathParams, Omit<FetcherOptions<unknown, unknown, Deletev1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelMutationHeaderParams>, 'url'> {
|
|
15
|
+
}
|
|
16
|
+
export declare function deletev1OrgsOrgProjectsProjectNotificationChannelsNotificationChannel(props: Deletev1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelProps): Promise<Deletev1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelOkResponse>;
|
|
17
|
+
/**
|
|
18
|
+
* Delete notificatation channel
|
|
19
|
+
*/
|
|
20
|
+
export declare function useDeletev1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelMutation(options?: Omit<UseMutationOptions<Deletev1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelOkResponse, Deletev1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelErrorResponse, Deletev1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<Deletev1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelOkResponse, unknown, Deletev1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelProps, unknown>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// This code is autogenerated using @harnessio/oats-cli.
|
|
3
|
+
// Please do not modify this code directly.
|
|
4
|
+
import { useMutation } from '@tanstack/react-query';
|
|
5
|
+
import { fetcher } from '../../../../fetcher/index.js';
|
|
6
|
+
export function deletev1OrgsOrgProjectsProjectNotificationChannelsNotificationChannel(props) {
|
|
7
|
+
return fetcher(Object.assign({ url: `/v1/orgs/${props.org}/projects/${props.project}/notification-channels/${props['notification-channel']}`, method: 'DELETE' }, props));
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Delete notificatation channel
|
|
11
|
+
*/
|
|
12
|
+
export function useDeletev1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelMutation(options) {
|
|
13
|
+
return useMutation((mutateProps) => deletev1OrgsOrgProjectsProjectNotificationChannelsNotificationChannel(mutateProps), options);
|
|
14
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
+
import type { NotificationChannelListResponseResponse } from '../responses/NotificationChannelListResponseResponse';
|
|
3
|
+
import type { ResponseWithPagination } from '../helpers';
|
|
4
|
+
import { FetcherOptions } from '../../../../fetcher/index.js';
|
|
5
|
+
export interface GetNotificationChannelQueryPathParams {
|
|
6
|
+
org: string;
|
|
7
|
+
project: string;
|
|
8
|
+
}
|
|
9
|
+
export interface GetNotificationChannelQueryQueryParams {
|
|
10
|
+
/**
|
|
11
|
+
* @default 30
|
|
12
|
+
*/
|
|
13
|
+
limit?: number;
|
|
14
|
+
search_term?: string;
|
|
15
|
+
sort?: 'created' | 'identifier' | 'name' | 'updated';
|
|
16
|
+
order?: 'ASC' | 'DESC';
|
|
17
|
+
}
|
|
18
|
+
export interface GetNotificationChannelQueryHeaderParams {
|
|
19
|
+
'Harness-Account'?: string;
|
|
20
|
+
}
|
|
21
|
+
export type GetNotificationChannelOkResponse = ResponseWithPagination<NotificationChannelListResponseResponse>;
|
|
22
|
+
export type GetNotificationChannelErrorResponse = unknown;
|
|
23
|
+
export interface GetNotificationChannelProps extends GetNotificationChannelQueryPathParams, Omit<FetcherOptions<GetNotificationChannelQueryQueryParams, unknown, GetNotificationChannelQueryHeaderParams>, 'url'> {
|
|
24
|
+
queryParams: GetNotificationChannelQueryQueryParams;
|
|
25
|
+
}
|
|
26
|
+
export declare function getNotificationChannel(props: GetNotificationChannelProps): Promise<GetNotificationChannelOkResponse>;
|
|
27
|
+
/**
|
|
28
|
+
* Returns a list of notification channels for the scope.
|
|
29
|
+
*/
|
|
30
|
+
export declare function useGetNotificationChannelQuery(props: GetNotificationChannelProps, options?: Omit<UseQueryOptions<GetNotificationChannelOkResponse, GetNotificationChannelErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<GetNotificationChannelOkResponse, unknown>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// This code is autogenerated using @harnessio/oats-cli.
|
|
3
|
+
// Please do not modify this code directly.
|
|
4
|
+
import { useQuery } from '@tanstack/react-query';
|
|
5
|
+
import { fetcher } from '../../../../fetcher/index.js';
|
|
6
|
+
export function getNotificationChannel(props) {
|
|
7
|
+
return fetcher(Object.assign({ url: `/v1/orgs/${props.org}/projects/${props.project}/notification-channels`, method: 'GET' }, props));
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Returns a list of notification channels for the scope.
|
|
11
|
+
*/
|
|
12
|
+
export function useGetNotificationChannelQuery(props, options) {
|
|
13
|
+
return useQuery(['get-notification-channel', props.org, props.project, props.queryParams], ({ signal }) => getNotificationChannel(Object.assign(Object.assign({}, props), { signal })), options);
|
|
14
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
+
import type { NotificationChannelResponseResponse } from '../responses/NotificationChannelResponseResponse';
|
|
3
|
+
import type { ResponseWithPagination } from '../helpers';
|
|
4
|
+
import { FetcherOptions } from '../../../../fetcher/index.js';
|
|
5
|
+
export interface GetNotificationChannelsNotificationChannelQueryPathParams {
|
|
6
|
+
'notification-channel': string;
|
|
7
|
+
org: string;
|
|
8
|
+
project: string;
|
|
9
|
+
}
|
|
10
|
+
export interface GetNotificationChannelsNotificationChannelQueryHeaderParams {
|
|
11
|
+
'Harness-Account'?: string;
|
|
12
|
+
}
|
|
13
|
+
export type GetNotificationChannelsNotificationChannelOkResponse = ResponseWithPagination<NotificationChannelResponseResponse>;
|
|
14
|
+
export type GetNotificationChannelsNotificationChannelErrorResponse = unknown;
|
|
15
|
+
export interface GetNotificationChannelsNotificationChannelProps extends GetNotificationChannelsNotificationChannelQueryPathParams, Omit<FetcherOptions<unknown, unknown, GetNotificationChannelsNotificationChannelQueryHeaderParams>, 'url'> {
|
|
16
|
+
}
|
|
17
|
+
export declare function getNotificationChannelsNotificationChannel(props: GetNotificationChannelsNotificationChannelProps): Promise<GetNotificationChannelsNotificationChannelOkResponse>;
|
|
18
|
+
/**
|
|
19
|
+
* Get Notification Channel
|
|
20
|
+
*/
|
|
21
|
+
export declare function useGetNotificationChannelsNotificationChannelQuery(props: GetNotificationChannelsNotificationChannelProps, options?: Omit<UseQueryOptions<GetNotificationChannelsNotificationChannelOkResponse, GetNotificationChannelsNotificationChannelErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<GetNotificationChannelsNotificationChannelOkResponse, unknown>;
|
|
@@ -0,0 +1,19 @@
|
|
|
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 getNotificationChannelsNotificationChannel(props) {
|
|
7
|
+
return fetcher(Object.assign({ url: `/v1/orgs/${props.org}/projects/${props.project}/notification-channels/${props['notification-channel']}`, method: 'GET' }, props));
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Get Notification Channel
|
|
11
|
+
*/
|
|
12
|
+
export function useGetNotificationChannelsNotificationChannelQuery(props, options) {
|
|
13
|
+
return useQuery([
|
|
14
|
+
'get-notification-channels-notification-channel',
|
|
15
|
+
props['notification-channel'],
|
|
16
|
+
props.org,
|
|
17
|
+
props.project,
|
|
18
|
+
], ({ signal }) => getNotificationChannelsNotificationChannel(Object.assign(Object.assign({}, props), { signal })), options);
|
|
19
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
+
import type { NotificationRuleListResponseResponse } from '../responses/NotificationRuleListResponseResponse';
|
|
3
|
+
import type { ResponseWithPagination } from '../helpers';
|
|
4
|
+
import { FetcherOptions } from '../../../../fetcher/index.js';
|
|
5
|
+
export interface GetNotificationRuleListQueryPathParams {
|
|
6
|
+
org: string;
|
|
7
|
+
project: string;
|
|
8
|
+
}
|
|
9
|
+
export interface GetNotificationRuleListQueryQueryParams {
|
|
10
|
+
/**
|
|
11
|
+
* @default 0
|
|
12
|
+
*/
|
|
13
|
+
page?: number;
|
|
14
|
+
/**
|
|
15
|
+
* @default 30
|
|
16
|
+
*/
|
|
17
|
+
limit?: number;
|
|
18
|
+
sort?: 'created' | 'identifier' | 'name' | 'updated';
|
|
19
|
+
order?: 'ASC' | 'DESC';
|
|
20
|
+
}
|
|
21
|
+
export interface GetNotificationRuleListQueryHeaderParams {
|
|
22
|
+
'Harness-Account'?: string;
|
|
23
|
+
}
|
|
24
|
+
export type GetNotificationRuleListOkResponse = ResponseWithPagination<NotificationRuleListResponseResponse>;
|
|
25
|
+
export type GetNotificationRuleListErrorResponse = unknown;
|
|
26
|
+
export interface GetNotificationRuleListProps extends GetNotificationRuleListQueryPathParams, Omit<FetcherOptions<GetNotificationRuleListQueryQueryParams, unknown, GetNotificationRuleListQueryHeaderParams>, 'url'> {
|
|
27
|
+
queryParams: GetNotificationRuleListQueryQueryParams;
|
|
28
|
+
}
|
|
29
|
+
export declare function getNotificationRuleList(props: GetNotificationRuleListProps): Promise<GetNotificationRuleListOkResponse>;
|
|
30
|
+
/**
|
|
31
|
+
* Get list of notification rules
|
|
32
|
+
*/
|
|
33
|
+
export declare function useGetNotificationRuleListQuery(props: GetNotificationRuleListProps, options?: Omit<UseQueryOptions<GetNotificationRuleListOkResponse, GetNotificationRuleListErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<GetNotificationRuleListOkResponse, unknown>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// This code is autogenerated using @harnessio/oats-cli.
|
|
3
|
+
// Please do not modify this code directly.
|
|
4
|
+
import { useQuery } from '@tanstack/react-query';
|
|
5
|
+
import { fetcher } from '../../../../fetcher/index.js';
|
|
6
|
+
export function getNotificationRuleList(props) {
|
|
7
|
+
return fetcher(Object.assign({ url: `/v1/orgs/${props.org}/projects/${props.project}/notification-rules`, method: 'GET' }, props));
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Get list of notification rules
|
|
11
|
+
*/
|
|
12
|
+
export function useGetNotificationRuleListQuery(props, options) {
|
|
13
|
+
return useQuery(['get-notification-rule-list', props.org, props.project, props.queryParams], ({ signal }) => getNotificationRuleList(Object.assign(Object.assign({}, props), { signal })), options);
|
|
14
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
+
import type { NotificationRuleResponseResponse } from '../responses/NotificationRuleResponseResponse';
|
|
3
|
+
import type { ResponseWithPagination } from '../helpers';
|
|
4
|
+
import { FetcherOptions } from '../../../../fetcher/index.js';
|
|
5
|
+
export interface GetV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleQueryPathParams {
|
|
6
|
+
org: string;
|
|
7
|
+
project: string;
|
|
8
|
+
'notification-rule': string;
|
|
9
|
+
}
|
|
10
|
+
export interface GetV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleQueryHeaderParams {
|
|
11
|
+
'Harness-Account'?: string;
|
|
12
|
+
}
|
|
13
|
+
export type GetV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleOkResponse = ResponseWithPagination<NotificationRuleResponseResponse>;
|
|
14
|
+
export type GetV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleErrorResponse = unknown;
|
|
15
|
+
export interface GetV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleProps extends GetV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleQueryPathParams, Omit<FetcherOptions<unknown, unknown, GetV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleQueryHeaderParams>, 'url'> {
|
|
16
|
+
}
|
|
17
|
+
export declare function getV1OrgsOrgProjectsProjectNotificationRuleNotificationRule(props: GetV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleProps): Promise<GetV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleOkResponse>;
|
|
18
|
+
/**
|
|
19
|
+
* Get notification rule
|
|
20
|
+
*/
|
|
21
|
+
export declare function useGetV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleQuery(props: GetV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleProps, options?: Omit<UseQueryOptions<GetV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleOkResponse, GetV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<GetV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleOkResponse, unknown>;
|
|
@@ -0,0 +1,19 @@
|
|
|
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 getV1OrgsOrgProjectsProjectNotificationRuleNotificationRule(props) {
|
|
7
|
+
return fetcher(Object.assign({ url: `/v1/orgs/${props.org}/projects/${props.project}/notification-rule/${props['notification-rule']}`, method: 'GET' }, props));
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Get notification rule
|
|
11
|
+
*/
|
|
12
|
+
export function useGetV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleQuery(props, options) {
|
|
13
|
+
return useQuery([
|
|
14
|
+
'get-v1-orgs-org-projects-project-notification-rule-notification-rule',
|
|
15
|
+
props.org,
|
|
16
|
+
props.project,
|
|
17
|
+
props['notification-rule'],
|
|
18
|
+
], ({ signal }) => getV1OrgsOrgProjectsProjectNotificationRuleNotificationRule(Object.assign(Object.assign({}, props), { signal })), options);
|
|
19
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { UseMutationOptions } from '@tanstack/react-query';
|
|
2
|
+
import type { NotificationChannelResponseResponse } from '../responses/NotificationChannelResponseResponse';
|
|
3
|
+
import type { NotificationChannelRequestRequestBody } from '../requestBodies/NotificationChannelRequestRequestBody';
|
|
4
|
+
import type { ResponseWithPagination } from '../helpers';
|
|
5
|
+
import { FetcherOptions } from '../../../../fetcher/index.js';
|
|
6
|
+
export interface PostNotificationChannelMutationPathParams {
|
|
7
|
+
org: string;
|
|
8
|
+
project: string;
|
|
9
|
+
}
|
|
10
|
+
export interface PostNotificationChannelMutationHeaderParams {
|
|
11
|
+
'Harness-Account'?: string;
|
|
12
|
+
}
|
|
13
|
+
export type PostNotificationChannelRequestBody = NotificationChannelRequestRequestBody;
|
|
14
|
+
export type PostNotificationChannelOkResponse = ResponseWithPagination<NotificationChannelResponseResponse>;
|
|
15
|
+
export type PostNotificationChannelErrorResponse = unknown;
|
|
16
|
+
export interface PostNotificationChannelProps extends PostNotificationChannelMutationPathParams, Omit<FetcherOptions<unknown, PostNotificationChannelRequestBody, PostNotificationChannelMutationHeaderParams>, 'url'> {
|
|
17
|
+
body: PostNotificationChannelRequestBody;
|
|
18
|
+
}
|
|
19
|
+
export declare function postNotificationChannel(props: PostNotificationChannelProps): Promise<PostNotificationChannelOkResponse>;
|
|
20
|
+
/**
|
|
21
|
+
* Create Notification Channel
|
|
22
|
+
*/
|
|
23
|
+
export declare function usePostNotificationChannelMutation(options?: Omit<UseMutationOptions<PostNotificationChannelOkResponse, PostNotificationChannelErrorResponse, PostNotificationChannelProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<PostNotificationChannelOkResponse, unknown, PostNotificationChannelProps, unknown>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// This code is autogenerated using @harnessio/oats-cli.
|
|
3
|
+
// Please do not modify this code directly.
|
|
4
|
+
import { useMutation } from '@tanstack/react-query';
|
|
5
|
+
import { fetcher } from '../../../../fetcher/index.js';
|
|
6
|
+
export function postNotificationChannel(props) {
|
|
7
|
+
return fetcher(Object.assign({ url: `/v1/orgs/${props.org}/projects/${props.project}/notification-channels`, method: 'POST' }, props));
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Create Notification Channel
|
|
11
|
+
*/
|
|
12
|
+
export function usePostNotificationChannelMutation(options) {
|
|
13
|
+
return useMutation((mutateProps) => postNotificationChannel(mutateProps), options);
|
|
14
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { UseMutationOptions } from '@tanstack/react-query';
|
|
2
|
+
import type { NotificationRuleResponseResponse } from '../responses/NotificationRuleResponseResponse';
|
|
3
|
+
import type { NotificationRuleRequestRequestBody } from '../requestBodies/NotificationRuleRequestRequestBody';
|
|
4
|
+
import type { ResponseWithPagination } from '../helpers';
|
|
5
|
+
import { FetcherOptions } from '../../../../fetcher/index.js';
|
|
6
|
+
export interface PostNotificationRuleMutationPathParams {
|
|
7
|
+
org: string;
|
|
8
|
+
project: string;
|
|
9
|
+
}
|
|
10
|
+
export interface PostNotificationRuleMutationHeaderParams {
|
|
11
|
+
'Harness-Account'?: string;
|
|
12
|
+
}
|
|
13
|
+
export type PostNotificationRuleRequestBody = NotificationRuleRequestRequestBody;
|
|
14
|
+
export type PostNotificationRuleOkResponse = ResponseWithPagination<NotificationRuleResponseResponse>;
|
|
15
|
+
export type PostNotificationRuleErrorResponse = unknown;
|
|
16
|
+
export interface PostNotificationRuleProps extends PostNotificationRuleMutationPathParams, Omit<FetcherOptions<unknown, PostNotificationRuleRequestBody, PostNotificationRuleMutationHeaderParams>, 'url'> {
|
|
17
|
+
body: PostNotificationRuleRequestBody;
|
|
18
|
+
}
|
|
19
|
+
export declare function postNotificationRule(props: PostNotificationRuleProps): Promise<PostNotificationRuleOkResponse>;
|
|
20
|
+
/**
|
|
21
|
+
* Create Notification Rule
|
|
22
|
+
*/
|
|
23
|
+
export declare function usePostNotificationRuleMutation(options?: Omit<UseMutationOptions<PostNotificationRuleOkResponse, PostNotificationRuleErrorResponse, PostNotificationRuleProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<PostNotificationRuleOkResponse, unknown, PostNotificationRuleProps, unknown>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// This code is autogenerated using @harnessio/oats-cli.
|
|
3
|
+
// Please do not modify this code directly.
|
|
4
|
+
import { useMutation } from '@tanstack/react-query';
|
|
5
|
+
import { fetcher } from '../../../../fetcher/index.js';
|
|
6
|
+
export function postNotificationRule(props) {
|
|
7
|
+
return fetcher(Object.assign({ url: `/v1/orgs/${props.org}/projects/${props.project}/notification-rules`, method: 'POST' }, props));
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Create Notification Rule
|
|
11
|
+
*/
|
|
12
|
+
export function usePostNotificationRuleMutation(options) {
|
|
13
|
+
return useMutation((mutateProps) => postNotificationRule(mutateProps), options);
|
|
14
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { UseMutationOptions } from '@tanstack/react-query';
|
|
2
|
+
import type { NotificationRuleResponseResponse } from '../responses/NotificationRuleResponseResponse';
|
|
3
|
+
import type { NotificationRuleRequestRequestBody } from '../requestBodies/NotificationRuleRequestRequestBody';
|
|
4
|
+
import type { ResponseWithPagination } from '../helpers';
|
|
5
|
+
import { FetcherOptions } from '../../../../fetcher/index.js';
|
|
6
|
+
export interface PutV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleMutationPathParams {
|
|
7
|
+
org: string;
|
|
8
|
+
project: string;
|
|
9
|
+
'notification-rule': string;
|
|
10
|
+
}
|
|
11
|
+
export interface PutV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleMutationHeaderParams {
|
|
12
|
+
'Harness-Account'?: string;
|
|
13
|
+
}
|
|
14
|
+
export type PutV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleRequestBody = NotificationRuleRequestRequestBody;
|
|
15
|
+
export type PutV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleOkResponse = ResponseWithPagination<NotificationRuleResponseResponse>;
|
|
16
|
+
export type PutV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleErrorResponse = unknown;
|
|
17
|
+
export interface PutV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleProps extends PutV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleMutationPathParams, Omit<FetcherOptions<unknown, PutV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleRequestBody, PutV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleMutationHeaderParams>, 'url'> {
|
|
18
|
+
body: PutV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleRequestBody;
|
|
19
|
+
}
|
|
20
|
+
export declare function putV1OrgsOrgProjectsProjectNotificationRuleNotificationRule(props: PutV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleProps): Promise<PutV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleOkResponse>;
|
|
21
|
+
/**
|
|
22
|
+
* Update Notification Rule
|
|
23
|
+
*/
|
|
24
|
+
export declare function usePutV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleMutation(options?: Omit<UseMutationOptions<PutV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleOkResponse, PutV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleErrorResponse, PutV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<PutV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleOkResponse, unknown, PutV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleProps, unknown>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// This code is autogenerated using @harnessio/oats-cli.
|
|
3
|
+
// Please do not modify this code directly.
|
|
4
|
+
import { useMutation } from '@tanstack/react-query';
|
|
5
|
+
import { fetcher } from '../../../../fetcher/index.js';
|
|
6
|
+
export function putV1OrgsOrgProjectsProjectNotificationRuleNotificationRule(props) {
|
|
7
|
+
return fetcher(Object.assign({ url: `/v1/orgs/${props.org}/projects/${props.project}/notification-rule/${props['notification-rule']}`, method: 'PUT' }, props));
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Update Notification Rule
|
|
11
|
+
*/
|
|
12
|
+
export function usePutV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleMutation(options) {
|
|
13
|
+
return useMutation((mutateProps) => putV1OrgsOrgProjectsProjectNotificationRuleNotificationRule(mutateProps), options);
|
|
14
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { UseMutationOptions } from '@tanstack/react-query';
|
|
2
|
+
import type { NotificationChannelResponseResponse } from '../responses/NotificationChannelResponseResponse';
|
|
3
|
+
import type { NotificationChannelRequestRequestBody } from '../requestBodies/NotificationChannelRequestRequestBody';
|
|
4
|
+
import type { ResponseWithPagination } from '../helpers';
|
|
5
|
+
import { FetcherOptions } from '../../../../fetcher/index.js';
|
|
6
|
+
export interface Putv1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelMutationPathParams {
|
|
7
|
+
'notification-channel': string;
|
|
8
|
+
org: string;
|
|
9
|
+
project: string;
|
|
10
|
+
}
|
|
11
|
+
export interface Putv1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelMutationHeaderParams {
|
|
12
|
+
'Harness-Account'?: string;
|
|
13
|
+
}
|
|
14
|
+
export type Putv1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelRequestBody = NotificationChannelRequestRequestBody;
|
|
15
|
+
export type Putv1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelOkResponse = ResponseWithPagination<NotificationChannelResponseResponse>;
|
|
16
|
+
export type Putv1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelErrorResponse = unknown;
|
|
17
|
+
export interface Putv1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelProps extends Putv1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelMutationPathParams, Omit<FetcherOptions<unknown, Putv1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelRequestBody, Putv1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelMutationHeaderParams>, 'url'> {
|
|
18
|
+
body: Putv1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelRequestBody;
|
|
19
|
+
}
|
|
20
|
+
export declare function putv1OrgsOrgProjectsProjectNotificationChannelsNotificationChannel(props: Putv1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelProps): Promise<Putv1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelOkResponse>;
|
|
21
|
+
/**
|
|
22
|
+
* Update Notification Channel
|
|
23
|
+
*/
|
|
24
|
+
export declare function usePutv1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelMutation(options?: Omit<UseMutationOptions<Putv1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelOkResponse, Putv1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelErrorResponse, Putv1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<Putv1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelOkResponse, unknown, Putv1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelProps, unknown>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// This code is autogenerated using @harnessio/oats-cli.
|
|
3
|
+
// Please do not modify this code directly.
|
|
4
|
+
import { useMutation } from '@tanstack/react-query';
|
|
5
|
+
import { fetcher } from '../../../../fetcher/index.js';
|
|
6
|
+
export function putv1OrgsOrgProjectsProjectNotificationChannelsNotificationChannel(props) {
|
|
7
|
+
return fetcher(Object.assign({ url: `/v1/orgs/${props.org}/projects/${props.project}/notification-channels/${props['notification-channel']}`, method: 'PUT' }, props));
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Update Notification Channel
|
|
11
|
+
*/
|
|
12
|
+
export function usePutv1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelMutation(options) {
|
|
13
|
+
return useMutation((mutateProps) => putv1OrgsOrgProjectsProjectNotificationChannelsNotificationChannel(mutateProps), options);
|
|
14
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export type { GetPathParamsType, ResponseWithPagination } from './helpers';
|
|
2
|
+
export type { DeleteV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleErrorResponse, DeleteV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleMutationPathParams, DeleteV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleOkResponse, DeleteV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleProps, } from './hooks/useDeleteV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleMutation';
|
|
3
|
+
export { deleteV1OrgsOrgProjectsProjectNotificationRuleNotificationRule, useDeleteV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleMutation, } from './hooks/useDeleteV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleMutation';
|
|
4
|
+
export type { Deletev1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelErrorResponse, Deletev1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelMutationPathParams, Deletev1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelOkResponse, Deletev1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelProps, } from './hooks/useDeletev1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelMutation';
|
|
5
|
+
export { deletev1OrgsOrgProjectsProjectNotificationChannelsNotificationChannel, useDeletev1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelMutation, } from './hooks/useDeletev1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelMutation';
|
|
6
|
+
export type { GetNotificationChannelErrorResponse, GetNotificationChannelOkResponse, GetNotificationChannelProps, GetNotificationChannelQueryPathParams, GetNotificationChannelQueryQueryParams, } from './hooks/useGetNotificationChannelQuery';
|
|
7
|
+
export { getNotificationChannel, useGetNotificationChannelQuery, } from './hooks/useGetNotificationChannelQuery';
|
|
8
|
+
export type { GetNotificationChannelsNotificationChannelErrorResponse, GetNotificationChannelsNotificationChannelOkResponse, GetNotificationChannelsNotificationChannelProps, GetNotificationChannelsNotificationChannelQueryPathParams, } from './hooks/useGetNotificationChannelsNotificationChannelQuery';
|
|
9
|
+
export { getNotificationChannelsNotificationChannel, useGetNotificationChannelsNotificationChannelQuery, } from './hooks/useGetNotificationChannelsNotificationChannelQuery';
|
|
10
|
+
export type { GetNotificationRuleListErrorResponse, GetNotificationRuleListOkResponse, GetNotificationRuleListProps, GetNotificationRuleListQueryPathParams, GetNotificationRuleListQueryQueryParams, } from './hooks/useGetNotificationRuleListQuery';
|
|
11
|
+
export { getNotificationRuleList, useGetNotificationRuleListQuery, } from './hooks/useGetNotificationRuleListQuery';
|
|
12
|
+
export type { GetV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleErrorResponse, GetV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleOkResponse, GetV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleProps, GetV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleQueryPathParams, } from './hooks/useGetV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleQuery';
|
|
13
|
+
export { getV1OrgsOrgProjectsProjectNotificationRuleNotificationRule, useGetV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleQuery, } from './hooks/useGetV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleQuery';
|
|
14
|
+
export type { PostNotificationChannelErrorResponse, PostNotificationChannelMutationPathParams, PostNotificationChannelOkResponse, PostNotificationChannelProps, PostNotificationChannelRequestBody, } from './hooks/usePostNotificationChannelMutation';
|
|
15
|
+
export { postNotificationChannel, usePostNotificationChannelMutation, } from './hooks/usePostNotificationChannelMutation';
|
|
16
|
+
export type { PostNotificationRuleErrorResponse, PostNotificationRuleMutationPathParams, PostNotificationRuleOkResponse, PostNotificationRuleProps, PostNotificationRuleRequestBody, } from './hooks/usePostNotificationRuleMutation';
|
|
17
|
+
export { postNotificationRule, usePostNotificationRuleMutation, } from './hooks/usePostNotificationRuleMutation';
|
|
18
|
+
export type { PutV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleErrorResponse, PutV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleMutationPathParams, PutV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleOkResponse, PutV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleProps, PutV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleRequestBody, } from './hooks/usePutV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleMutation';
|
|
19
|
+
export { putV1OrgsOrgProjectsProjectNotificationRuleNotificationRule, usePutV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleMutation, } from './hooks/usePutV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleMutation';
|
|
20
|
+
export type { Putv1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelErrorResponse, Putv1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelMutationPathParams, Putv1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelOkResponse, Putv1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelProps, Putv1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelRequestBody, } from './hooks/usePutv1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelMutation';
|
|
21
|
+
export { putv1OrgsOrgProjectsProjectNotificationChannelsNotificationChannel, usePutv1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelMutation, } from './hooks/usePutv1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelMutation';
|
|
22
|
+
export type { NotificationChannelRequestRequestBody } from './requestBodies/NotificationChannelRequestRequestBody';
|
|
23
|
+
export type { NotificationRuleRequestRequestBody } from './requestBodies/NotificationRuleRequestRequestBody';
|
|
24
|
+
export type { NotificationChannelListResponseResponse } from './responses/NotificationChannelListResponseResponse';
|
|
25
|
+
export type { NotificationChannelResponseResponse } from './responses/NotificationChannelResponseResponse';
|
|
26
|
+
export type { NotificationRuleListResponseResponse } from './responses/NotificationRuleListResponseResponse';
|
|
27
|
+
export type { NotificationRuleResponseResponse } from './responses/NotificationRuleResponseResponse';
|
|
28
|
+
export type { NotificationChannelDto } from './schemas/NotificationChannelDto';
|
|
29
|
+
export type { NotificationRuleDto } from './schemas/NotificationRuleDto';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { deleteV1OrgsOrgProjectsProjectNotificationRuleNotificationRule, useDeleteV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleMutation, } from './hooks/useDeleteV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleMutation';
|
|
2
|
+
export { deletev1OrgsOrgProjectsProjectNotificationChannelsNotificationChannel, useDeletev1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelMutation, } from './hooks/useDeletev1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelMutation';
|
|
3
|
+
export { getNotificationChannel, useGetNotificationChannelQuery, } from './hooks/useGetNotificationChannelQuery';
|
|
4
|
+
export { getNotificationChannelsNotificationChannel, useGetNotificationChannelsNotificationChannelQuery, } from './hooks/useGetNotificationChannelsNotificationChannelQuery';
|
|
5
|
+
export { getNotificationRuleList, useGetNotificationRuleListQuery, } from './hooks/useGetNotificationRuleListQuery';
|
|
6
|
+
export { getV1OrgsOrgProjectsProjectNotificationRuleNotificationRule, useGetV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleQuery, } from './hooks/useGetV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleQuery';
|
|
7
|
+
export { postNotificationChannel, usePostNotificationChannelMutation, } from './hooks/usePostNotificationChannelMutation';
|
|
8
|
+
export { postNotificationRule, usePostNotificationRuleMutation, } from './hooks/usePostNotificationRuleMutation';
|
|
9
|
+
export { putV1OrgsOrgProjectsProjectNotificationRuleNotificationRule, usePutV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleMutation, } from './hooks/usePutV1OrgsOrgProjectsProjectNotificationRuleNotificationRuleMutation';
|
|
10
|
+
export { putv1OrgsOrgProjectsProjectNotificationChannelsNotificationChannel, usePutv1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelMutation, } from './hooks/usePutv1OrgsOrgProjectsProjectNotificationChannelsNotificationChannelMutation';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/notification-service/src/services/requestBodies/NotificationRuleRequestRequestBody.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/notification-service/src/services/responses/NotificationChannelListResponseResponse.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/notification-service/src/services/responses/NotificationChannelResponseResponse.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/notification-service/src/services/responses/NotificationRuleListResponseResponse.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Notification Channel DTO
|
|
3
|
+
*/
|
|
4
|
+
export interface NotificationChannelDto {
|
|
5
|
+
channel?: {
|
|
6
|
+
email_ids?: Array<{
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
}>;
|
|
9
|
+
user_groups?: Array<{
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
}>;
|
|
12
|
+
};
|
|
13
|
+
created?: number;
|
|
14
|
+
created_by?: {
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
};
|
|
17
|
+
identifier?: string;
|
|
18
|
+
notification_channel_type?: string;
|
|
19
|
+
org?: string;
|
|
20
|
+
project?: string;
|
|
21
|
+
status?: string;
|
|
22
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Notification Rule DTO
|
|
3
|
+
*/
|
|
4
|
+
export interface NotificationRuleDto {
|
|
5
|
+
account?: string;
|
|
6
|
+
created?: number;
|
|
7
|
+
created_by?: {
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
};
|
|
10
|
+
identifier?: string;
|
|
11
|
+
notification_conditions?: Array<{
|
|
12
|
+
condition_name?: string;
|
|
13
|
+
notification_event_configs?: Array<{
|
|
14
|
+
notification_channels?: Array<{
|
|
15
|
+
channel?: {
|
|
16
|
+
pager_duty_integration_keys?: Array<{
|
|
17
|
+
[key: string]: any;
|
|
18
|
+
}>;
|
|
19
|
+
user_groups?: Array<{
|
|
20
|
+
[key: string]: any;
|
|
21
|
+
}>;
|
|
22
|
+
};
|
|
23
|
+
created?: number;
|
|
24
|
+
created_by?: {
|
|
25
|
+
[key: string]: any;
|
|
26
|
+
};
|
|
27
|
+
name?: string;
|
|
28
|
+
notification_channel_type?: string;
|
|
29
|
+
org?: string;
|
|
30
|
+
project?: string;
|
|
31
|
+
status?: string;
|
|
32
|
+
}>;
|
|
33
|
+
notification_event?: string;
|
|
34
|
+
}>;
|
|
35
|
+
}>;
|
|
36
|
+
notification_entity?: string;
|
|
37
|
+
org?: string;
|
|
38
|
+
project?: string;
|
|
39
|
+
status?: string;
|
|
40
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@harnessio/react-notification-service-client",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Harness React Notification service client - Notification APIs integrated with react hooks",
|
|
5
|
+
"author": "Harness Inc",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"source": "src/index.ts",
|
|
8
|
+
"main": "./dist/notification-service/src/index.js",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": "./dist/notification-service/src/index.js"
|
|
11
|
+
},
|
|
12
|
+
"types": "./dist/notification-service/src/index.d.ts",
|
|
13
|
+
"files": [
|
|
14
|
+
"dist/*"
|
|
15
|
+
],
|
|
16
|
+
"homepage": "https://github.com/harness/react-api-client",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "https://github.com/harness/react-api-client.git"
|
|
20
|
+
},
|
|
21
|
+
"bugs": {
|
|
22
|
+
"url": "https://github.com/harness/react-api-client/issues"
|
|
23
|
+
},
|
|
24
|
+
"keywords": [],
|
|
25
|
+
"scripts": {
|
|
26
|
+
"prebuild": "rimraf dist",
|
|
27
|
+
"build": "yarn generate && tsc",
|
|
28
|
+
"generate": "oats import --config='./oats.config.ts'",
|
|
29
|
+
"fmt": "prettier --write ./index.ts"
|
|
30
|
+
},
|
|
31
|
+
"engines": {
|
|
32
|
+
"node": "^16"
|
|
33
|
+
}
|
|
34
|
+
}
|