Note Edited notification type

This commit is contained in:
Marie 2024-02-20 15:10:41 +00:00 committed by Amelia Yukii
parent 15665d1533
commit 4a13508da0
17 changed files with 94 additions and 63 deletions

View file

@ -107,6 +107,12 @@ export type MiNotification = {
type: 'test';
id: string;
createdAt: string;
} | {
type: 'edited';
id: string;
createdAt: string;
notifierId: MiUser['id'];
noteId: MiNote['id'];
};
export type MiGroupedNotification = MiNotification | {

View file

@ -7,7 +7,7 @@ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typ
import { id } from './util/id.js';
import { MiUser } from './User.js';
export const webhookEventTypes = ['mention', 'unfollow', 'follow', 'followed', 'note', 'reply', 'renote', 'reaction'] as const;
export const webhookEventTypes = ['mention', 'unfollow', 'follow', 'followed', 'note', 'reply', 'renote', 'reaction', 'edited'] as const;
@Entity('webhook')
export class MiWebhook {

View file

@ -318,6 +318,31 @@ export const packedNotificationSchema = {
optional: false, nullable: false,
},
},
}, {
type: 'object',
properties: {
...baseSchema.properties,
type: {
type: 'string',
optional: false, nullable: false,
enum: ['edited'],
},
user: {
type: 'object',
ref: 'UserLite',
optional: false, nullable: false,
},
userId: {
type: 'string',
optional: false, nullable: false,
format: 'id',
},
note: {
type: 'object',
ref: 'Note',
optional: false, nullable: false,
},
},
}, {
type: 'object',
properties: {