From 0e7f96cb4a73c552a92243042531c50899bcc140 Mon Sep 17 00:00:00 2001 From: Igor Zynov Date: Fri, 25 Jul 2025 18:04:27 +0400 Subject: [PATCH] feat(notifications): add `view-all` method for handling notification visibility --- src/endpoints.ts | 7 +++++++ .../notifications/methods/notice/view-all.ts | 14 ++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 src/interfaces/notifications/methods/notice/view-all.ts diff --git a/src/endpoints.ts b/src/endpoints.ts index 7a4627f..63384c0 100644 --- a/src/endpoints.ts +++ b/src/endpoints.ts @@ -62,6 +62,10 @@ import type { IEmailSendOutput, } from './interfaces/notifications/methods/email/send'; import type { IHideAllOutput } from './interfaces/notifications/methods/notice/hide-all'; +import type { + IViewAllInput, + IViewAllOutput, +} from './interfaces/notifications/methods/notice/view-all'; import type { IPhoneSendInput, IPhoneSendOutput, @@ -576,6 +580,9 @@ class Endpoints< update: this.createHandler, IView>('notification.notice.update'), count: this.createHandler, ICount>('notification.notice.count'), hideAll: this.createHandler('notification.notice.hide-all'), + viewAll: this.createHandler, IView>( + 'notification.notice.view-all', + ), }, task: { list: this.createHandler, IList>('notification.task.list'), diff --git a/src/interfaces/notifications/methods/notice/view-all.ts b/src/interfaces/notifications/methods/notice/view-all.ts new file mode 100644 index 0000000..247abe9 --- /dev/null +++ b/src/interfaces/notifications/methods/notice/view-all.ts @@ -0,0 +1,14 @@ +/** + * Input for view-all method + */ +export interface IViewAllInput { + userId: string; +} + +/** + * Output for view-all method + */ +export interface IViewAllOutput { + status: boolean; + affected?: number; +}