2023-07-27 05:31:52 +00:00
|
|
|
/*
|
|
|
|
* SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
*/
|
|
|
|
|
2022-02-27 02:07:39 +00:00
|
|
|
import { notificationTypes } from '@/types.js';
|
2022-01-18 13:27:10 +00:00
|
|
|
|
|
|
|
export const packedNotificationSchema = {
|
|
|
|
type: 'object',
|
|
|
|
properties: {
|
|
|
|
id: {
|
|
|
|
type: 'string',
|
|
|
|
optional: false, nullable: false,
|
|
|
|
format: 'id',
|
|
|
|
},
|
|
|
|
createdAt: {
|
|
|
|
type: 'string',
|
|
|
|
optional: false, nullable: false,
|
|
|
|
format: 'date-time',
|
|
|
|
},
|
|
|
|
type: {
|
|
|
|
type: 'string',
|
|
|
|
optional: false, nullable: false,
|
2023-11-02 06:57:55 +00:00
|
|
|
enum: [...notificationTypes, 'reaction:grouped', 'renote:grouped'],
|
2022-01-18 13:27:10 +00:00
|
|
|
},
|
|
|
|
user: {
|
|
|
|
type: 'object',
|
|
|
|
ref: 'UserLite',
|
|
|
|
optional: true, nullable: true,
|
|
|
|
},
|
|
|
|
userId: {
|
|
|
|
type: 'string',
|
|
|
|
optional: true, nullable: true,
|
|
|
|
format: 'id',
|
|
|
|
},
|
|
|
|
note: {
|
|
|
|
type: 'object',
|
|
|
|
ref: 'Note',
|
|
|
|
optional: true, nullable: true,
|
|
|
|
},
|
|
|
|
reaction: {
|
|
|
|
type: 'string',
|
|
|
|
optional: true, nullable: true,
|
|
|
|
},
|
2023-11-21 02:13:56 +00:00
|
|
|
achievement: {
|
|
|
|
type: 'string',
|
|
|
|
optional: true, nullable: false,
|
2022-01-18 13:27:10 +00:00
|
|
|
},
|
|
|
|
body: {
|
|
|
|
type: 'string',
|
|
|
|
optional: true, nullable: true,
|
|
|
|
},
|
|
|
|
header: {
|
|
|
|
type: 'string',
|
|
|
|
optional: true, nullable: true,
|
|
|
|
},
|
|
|
|
icon: {
|
|
|
|
type: 'string',
|
|
|
|
optional: true, nullable: true,
|
|
|
|
},
|
2023-11-02 06:57:55 +00:00
|
|
|
reactions: {
|
|
|
|
type: 'array',
|
|
|
|
optional: true, nullable: true,
|
|
|
|
items: {
|
|
|
|
type: 'object',
|
|
|
|
properties: {
|
|
|
|
user: {
|
|
|
|
type: 'object',
|
|
|
|
ref: 'UserLite',
|
|
|
|
optional: false, nullable: false,
|
|
|
|
},
|
|
|
|
reaction: {
|
|
|
|
type: 'string',
|
|
|
|
optional: false, nullable: false,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
required: ['user', 'reaction'],
|
|
|
|
},
|
|
|
|
},
|
2023-11-21 02:13:56 +00:00
|
|
|
users: {
|
|
|
|
type: 'array',
|
|
|
|
optional: true, nullable: true,
|
|
|
|
items: {
|
|
|
|
type: 'object',
|
|
|
|
ref: 'UserLite',
|
|
|
|
optional: false, nullable: false,
|
|
|
|
},
|
2023-11-02 06:57:55 +00:00
|
|
|
},
|
2022-01-18 13:27:10 +00:00
|
|
|
},
|
|
|
|
} as const;
|