2023-07-27 07:31:52 +02:00
|
|
|
/*
|
|
|
|
* SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
*/
|
|
|
|
|
2023-08-16 10:51:28 +02:00
|
|
|
import { MiUser } from './User.js';
|
|
|
|
import { MiNote } from './Note.js';
|
|
|
|
import { MiAccessToken } from './AccessToken.js';
|
2023-12-21 02:39:11 +01:00
|
|
|
import { MiRole } from './Role.js';
|
2019-04-07 14:50:36 +02:00
|
|
|
|
2023-08-16 10:51:28 +02:00
|
|
|
export type MiNotification = {
|
2023-11-02 07:57:55 +01: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'];
|
2023-12-21 02:39:11 +01:00
|
|
|
} | {
|
|
|
|
type: 'roleAssigned';
|
|
|
|
id: string;
|
|
|
|
createdAt: string;
|
|
|
|
roleId: MiRole['id'];
|
2023-11-02 07:57:55 +01:00
|
|
|
} | {
|
|
|
|
type: 'achievementEarned';
|
|
|
|
id: string;
|
|
|
|
createdAt: string;
|
|
|
|
achievement: string;
|
|
|
|
} | {
|
|
|
|
type: 'app';
|
2023-04-04 07:06:57 +02:00
|
|
|
id: string;
|
|
|
|
createdAt: string;
|
2023-01-21 05:14:55 +01:00
|
|
|
|
2020-03-28 10:07:41 +01:00
|
|
|
/**
|
|
|
|
* アプリ通知のbody
|
|
|
|
*/
|
2023-04-04 07:06:57 +02:00
|
|
|
customBody: string | null;
|
2020-03-28 10:07:41 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* アプリ通知のheader
|
|
|
|
* (省略時はアプリ名で表示されることを期待)
|
|
|
|
*/
|
2023-04-04 07:06:57 +02:00
|
|
|
customHeader: string | null;
|
2020-03-28 10:07:41 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* アプリ通知のicon(URL)
|
|
|
|
* (省略時はアプリアイコンで表示されることを期待)
|
|
|
|
*/
|
2023-04-04 07:06:57 +02:00
|
|
|
customIcon: string | null;
|
2020-03-28 10:07:41 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* アプリ通知のアプリ(のトークン)
|
|
|
|
*/
|
2023-08-16 10:51:28 +02:00
|
|
|
appAccessTokenId: MiAccessToken['id'] | null;
|
2023-11-02 07:57:55 +01: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[];
|
|
|
|
};
|