enhance: 通知の履歴をリセットできるように (#13335)

* enhance: 通知の履歴をリセットできるように

* Update Changelog

* 通知欄も連動して更新するように

* revert some changes

* Update CHANGELOG.md

* Remove unused part

* fix
This commit is contained in:
かっこかり
2024-02-29 20:03:30 +09:00
committed by GitHub
parent ec18991328
commit 39d6af135f
15 changed files with 139 additions and 1 deletions

View File

@@ -530,6 +530,7 @@ export type Channels = {
unreadNotification: (payload: Notification_2) => void;
unreadMention: (payload: Note['id']) => void;
readAllUnreadMentions: () => void;
notificationFlushed: () => void;
unreadSpecifiedNote: (payload: Note['id']) => void;
readAllUnreadSpecifiedNotes: () => void;
readAllAntennas: () => void;

View File

@@ -3195,6 +3195,17 @@ declare module '../api.js' {
credential?: string | null,
): Promise<SwitchCaseResponseType<E, P>>;
/**
* No description provided.
*
* **Credential required**: *Yes* / **Permission**: *write:notifications*
*/
request<E extends 'notifications/flush', P extends Endpoints[E]['req']>(
endpoint: E,
params: P,
credential?: string | null,
): Promise<SwitchCaseResponseType<E, P>>;
/**
* No description provided.
*

View File

@@ -841,6 +841,7 @@ export type Endpoints = {
'notes/unrenote': { req: NotesUnrenoteRequest; res: EmptyResponse };
'notes/user-list-timeline': { req: NotesUserListTimelineRequest; res: NotesUserListTimelineResponse };
'notifications/create': { req: NotificationsCreateRequest; res: EmptyResponse };
'notifications/flush': { req: EmptyRequest; res: EmptyResponse };
'notifications/mark-all-as-read': { req: EmptyRequest; res: EmptyResponse };
'notifications/test-notification': { req: EmptyRequest; res: EmptyResponse };
'page-push': { req: PagePushRequest; res: EmptyResponse };

View File

@@ -2770,6 +2770,15 @@ export type paths = {
*/
post: operations['notifications/create'];
};
'/notifications/flush': {
/**
* notifications/flush
* @description No description provided.
*
* **Credential required**: *Yes* / **Permission**: *write:notifications*
*/
post: operations['notifications/flush'];
};
'/notifications/mark-all-as-read': {
/**
* notifications/mark-all-as-read
@@ -22056,6 +22065,50 @@ export type operations = {
};
};
};
/**
* notifications/flush
* @description No description provided.
*
* **Credential required**: *Yes* / **Permission**: *write:notifications*
*/
'notifications/flush': {
responses: {
/** @description OK (without any results) */
204: {
content: never;
};
/** @description Client error */
400: {
content: {
'application/json': components['schemas']['Error'];
};
};
/** @description Authentication error */
401: {
content: {
'application/json': components['schemas']['Error'];
};
};
/** @description Forbidden error */
403: {
content: {
'application/json': components['schemas']['Error'];
};
};
/** @description I'm Ai */
418: {
content: {
'application/json': components['schemas']['Error'];
};
};
/** @description Internal server error */
500: {
content: {
'application/json': components['schemas']['Error'];
};
};
};
};
/**
* notifications/mark-all-as-read
* @description No description provided.

View File

@@ -40,6 +40,7 @@ export type Channels = {
unreadNotification: (payload: Notification) => void;
unreadMention: (payload: Note['id']) => void;
readAllUnreadMentions: () => void;
notificationFlushed: () => void;
unreadSpecifiedNote: (payload: Note['id']) => void;
readAllUnreadSpecifiedNotes: () => void;
readAllAntennas: () => void;