@harnessio/react-notification-service-client 0.6.2 → 0.7.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.
Files changed (19) hide show
  1. package/dist/notification-service/src/services/hooks/useCreateAttachmentMutation.d.ts +19 -0
  2. package/dist/notification-service/src/services/hooks/useCreateAttachmentMutation.js +14 -0
  3. package/dist/notification-service/src/services/index.d.ts +7 -0
  4. package/dist/notification-service/src/services/index.js +1 -0
  5. package/dist/notification-service/src/services/requestBodies/SaveAttachmentRequestRequestBody.d.ts +1 -0
  6. package/dist/notification-service/src/services/requestBodies/SaveAttachmentRequestRequestBody.js +1 -0
  7. package/dist/notification-service/src/services/responses/SaveAttachmentResponseResponse.d.ts +4 -0
  8. package/dist/notification-service/src/services/responses/SaveAttachmentResponseResponse.js +4 -0
  9. package/dist/notification-service/src/services/schemas/AttachmentDto.d.ts +10 -0
  10. package/dist/notification-service/src/services/schemas/AttachmentDto.js +4 -0
  11. package/dist/notification-service/src/services/schemas/ChaosExperimentEventNotificationParamsDto.d.ts +8 -0
  12. package/dist/notification-service/src/services/schemas/ChaosExperimentEventNotificationParamsDto.js +1 -0
  13. package/dist/notification-service/src/services/schemas/DelegateEventNotificationParamsDto.d.ts +4 -0
  14. package/dist/notification-service/src/services/schemas/NotificationChannelDto.d.ts +2 -2
  15. package/dist/notification-service/src/services/schemas/NotificationEventConfigDto.d.ts +1 -0
  16. package/dist/notification-service/src/services/schemas/PipelineEventNotificationParamsDto.d.ts +4 -0
  17. package/dist/notification-service/src/services/schemas/PipelineEventNotificationParamsDto.js +1 -0
  18. package/dist/notification-service/src/services/schemas/ResourceTypeEnum.d.ts +1 -1
  19. package/package.json +1 -1
@@ -0,0 +1,19 @@
1
+ import { UseMutationOptions } from '@tanstack/react-query';
2
+ import type { SaveAttachmentResponseResponse } from '../responses/SaveAttachmentResponseResponse';
3
+ import type { SaveAttachmentRequestRequestBody } from '../requestBodies/SaveAttachmentRequestRequestBody';
4
+ import type { ResponseWithPagination } from '../helpers';
5
+ import { FetcherOptions } from '../../../../fetcher/index.js';
6
+ export interface CreateAttachmentMutationHeaderParams {
7
+ 'Harness-Account'?: string;
8
+ }
9
+ export type CreateAttachmentRequestBody = SaveAttachmentRequestRequestBody;
10
+ export type CreateAttachmentOkResponse = ResponseWithPagination<SaveAttachmentResponseResponse>;
11
+ export type CreateAttachmentErrorResponse = unknown;
12
+ export interface CreateAttachmentProps extends Omit<FetcherOptions<unknown, CreateAttachmentRequestBody, CreateAttachmentMutationHeaderParams>, 'url'> {
13
+ body: CreateAttachmentRequestBody;
14
+ }
15
+ export declare function createAttachment(props: CreateAttachmentProps): Promise<CreateAttachmentOkResponse>;
16
+ /**
17
+ * Save Notification Attachment
18
+ */
19
+ export declare function useCreateAttachmentMutation(options?: Omit<UseMutationOptions<CreateAttachmentOkResponse, CreateAttachmentErrorResponse, CreateAttachmentProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<CreateAttachmentOkResponse, unknown, CreateAttachmentProps, 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 createAttachment(props) {
7
+ return fetcher(Object.assign({ url: `/v1/attachments`, method: 'POST' }, props));
8
+ }
9
+ /**
10
+ * Save Notification Attachment
11
+ */
12
+ export function useCreateAttachmentMutation(options) {
13
+ return useMutation((mutateProps) => createAttachment(mutateProps), options);
14
+ }
@@ -1,4 +1,6 @@
1
1
  export type { GetPathParamsType, ResponseWithPagination } from './helpers';
2
+ export type { CreateAttachmentErrorResponse, CreateAttachmentOkResponse, CreateAttachmentProps, CreateAttachmentRequestBody, } from './hooks/useCreateAttachmentMutation';
3
+ export { createAttachment, useCreateAttachmentMutation } from './hooks/useCreateAttachmentMutation';
2
4
  export type { CreateNotificationChannelRefAccountErrorResponse, CreateNotificationChannelRefAccountOKResponse, CreateNotificationChannelRefAccountRequestBody, CreateNotificationChannelRefOrgErrorResponse, CreateNotificationChannelRefOrgOKResponse, CreateNotificationChannelRefOrgPathParams, CreateNotificationChannelRefOrgRequestBody, CreateNotificationChannelRefProjectErrorResponse, CreateNotificationChannelRefProjectOKResponse, CreateNotificationChannelRefProjectPathParams, CreateNotificationChannelRefProjectRequestBody, CreateNotificationChannelRefProps, } from './hooks/useCreateNotificationChannelRefMutation';
3
5
  export { createNotificationChannelRef, useCreateNotificationChannelRefMutation, } from './hooks/useCreateNotificationChannelRefMutation';
4
6
  export type { CreateNotificationRuleRefAccountErrorResponse, CreateNotificationRuleRefAccountOKResponse, CreateNotificationRuleRefAccountRequestBody, CreateNotificationRuleRefOrgErrorResponse, CreateNotificationRuleRefOrgOKResponse, CreateNotificationRuleRefOrgPathParams, CreateNotificationRuleRefOrgRequestBody, CreateNotificationRuleRefProjectErrorResponse, CreateNotificationRuleRefProjectOKResponse, CreateNotificationRuleRefProjectPathParams, CreateNotificationRuleRefProjectRequestBody, CreateNotificationRuleRefProps, } from './hooks/useCreateNotificationRuleRefMutation';
@@ -35,14 +37,18 @@ export type { ValidateNotificationRuleRefAccountErrorResponse, ValidateNotificat
35
37
  export { useValidateNotificationRuleRefMutation, validateNotificationRuleRef, } from './hooks/useValidateNotificationRuleRefMutation';
36
38
  export type { NotificationChannelRequestRequestBody } from './requestBodies/NotificationChannelRequestRequestBody';
37
39
  export type { NotificationRuleRequestRequestBody } from './requestBodies/NotificationRuleRequestRequestBody';
40
+ export type { SaveAttachmentRequestRequestBody } from './requestBodies/SaveAttachmentRequestRequestBody';
38
41
  export type { NotificationChannelListResponseResponse } from './responses/NotificationChannelListResponseResponse';
39
42
  export type { NotificationChannelResponseResponse } from './responses/NotificationChannelResponseResponse';
40
43
  export type { NotificationResourceListResponse } from './responses/NotificationResourceListResponse';
41
44
  export type { NotificationRuleListResponseResponse } from './responses/NotificationRuleListResponseResponse';
42
45
  export type { NotificationRuleResponseResponse } from './responses/NotificationRuleResponseResponse';
46
+ export type { SaveAttachmentResponseResponse } from './responses/SaveAttachmentResponseResponse';
43
47
  export type { ValidateIdentifierResponseResponse } from './responses/ValidateIdentifierResponseResponse';
48
+ export type { AttachmentDto } from './schemas/AttachmentDto';
44
49
  export type { ChannelDto } from './schemas/ChannelDto';
45
50
  export type { ChannelType } from './schemas/ChannelType';
51
+ export type { ChaosExperimentEventNotificationParamsDto } from './schemas/ChaosExperimentEventNotificationParamsDto';
46
52
  export type { DelegateEventNotificationParamsDto } from './schemas/DelegateEventNotificationParamsDto';
47
53
  export type { FrequencyDto } from './schemas/FrequencyDto';
48
54
  export type { NotificationChannelDto } from './schemas/NotificationChannelDto';
@@ -51,6 +57,7 @@ export type { NotificationEventConfigDto } from './schemas/NotificationEventConf
51
57
  export type { NotificationEventParamsDto } from './schemas/NotificationEventParamsDto';
52
58
  export type { NotificationResourceDto } from './schemas/NotificationResourceDto';
53
59
  export type { NotificationRuleDto } from './schemas/NotificationRuleDto';
60
+ export type { PipelineEventNotificationParamsDto } from './schemas/PipelineEventNotificationParamsDto';
54
61
  export type { ResourceTypeEnum } from './schemas/ResourceTypeEnum';
55
62
  export type { Status } from './schemas/Status';
56
63
  export type { UserGroupDto } from './schemas/UserGroupDto';
@@ -1,3 +1,4 @@
1
+ export { createAttachment, useCreateAttachmentMutation } from './hooks/useCreateAttachmentMutation';
1
2
  export { createNotificationChannelRef, useCreateNotificationChannelRefMutation, } from './hooks/useCreateNotificationChannelRefMutation';
2
3
  export { createNotificationRuleRef, useCreateNotificationRuleRefMutation, } from './hooks/useCreateNotificationRuleRefMutation';
3
4
  export { deleteNotificationChannelRef, useDeleteNotificationChannelRefMutation, } from './hooks/useDeleteNotificationChannelRefMutation';
@@ -0,0 +1 @@
1
+ export type SaveAttachmentRequestRequestBody = unknown;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * File Id of the attachment saved
3
+ */
4
+ export type SaveAttachmentResponseResponse = string;
@@ -0,0 +1,4 @@
1
+ /* eslint-disable */
2
+ // This code is autogenerated using @harnessio/oats-cli.
3
+ // Please do not modify this code directly.
4
+ export {};
@@ -0,0 +1,10 @@
1
+ export interface AttachmentDto {
2
+ /**
3
+ * mime type of the file
4
+ */
5
+ mimeType: string;
6
+ /**
7
+ * Name of the file with proper extention
8
+ */
9
+ name: string;
10
+ }
@@ -0,0 +1,4 @@
1
+ /* eslint-disable */
2
+ // This code is autogenerated using @harnessio/oats-cli.
3
+ // Please do not modify this code directly.
4
+ export {};
@@ -0,0 +1,8 @@
1
+ import type { NotificationEventParamsDto } from '../schemas/NotificationEventParamsDto';
2
+ export interface ChaosExperimentEventNotificationParamsDto extends NotificationEventParamsDto {
3
+ /**
4
+ * Deprecated, Use notificationEventConfig.entity_identifiers instead
5
+ * @deprecated
6
+ */
7
+ chaos_experiment_ids?: string[];
8
+ }
@@ -1,6 +1,10 @@
1
1
  import type { FrequencyDto } from '../schemas/FrequencyDto';
2
2
  import type { NotificationEventParamsDto } from '../schemas/NotificationEventParamsDto';
3
3
  export interface DelegateEventNotificationParamsDto extends NotificationEventParamsDto {
4
+ /**
5
+ * Deprecated, Use notificationEventConfig.entity_identifiers instead
6
+ * @deprecated
7
+ */
4
8
  delegate_group_ids?: string[];
5
9
  frequency?: FrequencyDto;
6
10
  }
@@ -6,7 +6,7 @@ import type { Status } from '../schemas/Status';
6
6
  */
7
7
  export interface NotificationChannelDto {
8
8
  account?: string;
9
- channel?: ChannelDto;
9
+ channel: ChannelDto;
10
10
  /**
11
11
  * @format int64
12
12
  */
@@ -17,7 +17,7 @@ export interface NotificationChannelDto {
17
17
  */
18
18
  last_modified?: number;
19
19
  name?: string;
20
- notification_channel_type?: ChannelType;
20
+ notification_channel_type: ChannelType;
21
21
  org?: string;
22
22
  project?: string;
23
23
  status?: Status;
@@ -1,5 +1,6 @@
1
1
  import type { NotificationEventParamsDto } from '../schemas/NotificationEventParamsDto';
2
2
  export interface NotificationEventConfigDto<T0 extends NotificationEventParamsDto = NotificationEventParamsDto> {
3
+ entity_identifiers?: string[];
3
4
  notification_entity?: string;
4
5
  notification_event?: string;
5
6
  notification_event_data?: T0;
@@ -0,0 +1,4 @@
1
+ import type { NotificationEventParamsDto } from '../schemas/NotificationEventParamsDto';
2
+ export interface PipelineEventNotificationParamsDto extends NotificationEventParamsDto {
3
+ scope_identifiers?: string[];
4
+ }
@@ -1 +1 @@
1
- export type ResourceTypeEnum = 'DELEGATE';
1
+ export type ResourceTypeEnum = 'CHAOS_EXPERIMENT' | 'DELEGATE' | 'PIPELINE';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harnessio/react-notification-service-client",
3
- "version": "0.6.2",
3
+ "version": "0.7.1",
4
4
  "description": "Harness React Notification service client - Notification APIs integrated with react hooks",
5
5
  "author": "Harness Inc",
6
6
  "license": "MIT",