2023-07-27 14:31:52 +09:00
|
|
|
/*
|
|
|
|
* SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
*/
|
|
|
|
|
2023-04-04 14:06:57 +09:00
|
|
|
import { notificationTypes } from '@/types.js';
|
2023-08-16 17:51:28 +09:00
|
|
|
import { MiUser } from './User.js';
|
|
|
|
import { MiNote } from './Note.js';
|
|
|
|
import { MiFollowRequest } from './FollowRequest.js';
|
|
|
|
import { MiAccessToken } from './AccessToken.js';
|
2019-04-07 21:50:36 +09:00
|
|
|
|
2023-08-16 17:51:28 +09:00
|
|
|
export type MiNotification = {
|
2023-11-02 15:57:55 +09:00
|
|
|
type: 'note';
|
|
|
|
id: string;
|
|
|
|
createdAt: string;
|
|
|
|
notifierId: MiUser['id'];
|
|
|
|
noteId: MiNote['id'];
|
|
|
|
} | {
|
|
|
|
type: 'follow';
|
|
|
|
id: string;
|
|
|
|
createdAt: string;
|
|
|
|
notifierId: MiUser['id'];
|
|
|
|
} | {
|
|
|
|
type: 'mention';
|
|
|
|
id: string;
|
|
|
|
createdAt: string;
|
|
|
|
notifierId: MiUser['id'];
|
|
|
|
noteId: MiNote['id'];
|
|
|
|
} | {
|
|
|
|
type: 'reply';
|
|
|
|
id: string;
|
|
|
|
createdAt: string;
|
|
|
|
notifierId: MiUser['id'];
|
|
|
|
noteId: MiNote['id'];
|
|
|
|
} | {
|
|
|
|
type: 'renote';
|
|
|
|
id: string;
|
|
|
|
createdAt: string;
|
|
|
|
notifierId: MiUser['id'];
|
|
|
|
noteId: MiNote['id'];
|
|
|
|
targetNoteId: MiNote['id'];
|
|
|
|
} | {
|
|
|
|
type: 'quote';
|
|
|
|
id: string;
|
|
|
|
createdAt: string;
|
|
|
|
notifierId: MiUser['id'];
|
|
|
|
noteId: MiNote['id'];
|
|
|
|
} | {
|
|
|
|
type: 'reaction';
|
|
|
|
id: string;
|
|
|
|
createdAt: string;
|
|
|
|
notifierId: MiUser['id'];
|
|
|
|
noteId: MiNote['id'];
|
|
|
|
reaction: string;
|
|
|
|
} | {
|
|
|
|
type: 'pollEnded';
|
|
|
|
id: string;
|
|
|
|
createdAt: string;
|
|
|
|
notifierId: MiUser['id'];
|
|
|
|
noteId: MiNote['id'];
|
|
|
|
} | {
|
|
|
|
type: 'receiveFollowRequest';
|
|
|
|
id: string;
|
|
|
|
createdAt: string;
|
|
|
|
notifierId: MiUser['id'];
|
|
|
|
} | {
|
|
|
|
type: 'followRequestAccepted';
|
|
|
|
id: string;
|
|
|
|
createdAt: string;
|
|
|
|
notifierId: MiUser['id'];
|
|
|
|
} | {
|
|
|
|
type: 'achievementEarned';
|
|
|
|
id: string;
|
|
|
|
createdAt: string;
|
|
|
|
achievement: string;
|
|
|
|
} | {
|
|
|
|
type: 'app';
|
2023-04-04 14:06:57 +09:00
|
|
|
id: string;
|
|
|
|
createdAt: string;
|
2023-01-21 13:14:55 +09:00
|
|
|
|
2020-03-28 18:07:41 +09:00
|
|
|
/**
|
|
|
|
* アプリ通知のbody
|
|
|
|
*/
|
2023-04-04 14:06:57 +09:00
|
|
|
customBody: string | null;
|
2020-03-28 18:07:41 +09:00
|
|
|
|
|
|
|
/**
|
|
|
|
* アプリ通知のheader
|
|
|
|
* (省略時はアプリ名で表示されることを期待)
|
|
|
|
*/
|
2023-04-04 14:06:57 +09:00
|
|
|
customHeader: string | null;
|
2020-03-28 18:07:41 +09:00
|
|
|
|
|
|
|
/**
|
|
|
|
* アプリ通知のicon(URL)
|
|
|
|
* (省略時はアプリアイコンで表示されることを期待)
|
|
|
|
*/
|
2023-04-04 14:06:57 +09:00
|
|
|
customIcon: string | null;
|
2020-03-28 18:07:41 +09:00
|
|
|
|
|
|
|
/**
|
|
|
|
* アプリ通知のアプリ(のトークン)
|
|
|
|
*/
|
2023-08-16 17:51:28 +09:00
|
|
|
appAccessTokenId: MiAccessToken['id'] | null;
|
2023-11-02 15:57:55 +09:00
|
|
|
} | {
|
|
|
|
type: 'test';
|
|
|
|
id: string;
|
|
|
|
createdAt: string;
|
|
|
|
};
|
|
|
|
|
|
|
|
export type MiGroupedNotification = MiNotification | {
|
|
|
|
type: 'reaction:grouped';
|
|
|
|
id: string;
|
|
|
|
createdAt: string;
|
|
|
|
noteId: MiNote['id'];
|
|
|
|
reactions: {
|
|
|
|
userId: string;
|
|
|
|
reaction: string;
|
|
|
|
}[];
|
|
|
|
} | {
|
|
|
|
type: 'renote:grouped';
|
|
|
|
id: string;
|
|
|
|
createdAt: string;
|
|
|
|
noteId: MiNote['id'];
|
|
|
|
userIds: string[];
|
|
|
|
};
|