summaryrefslogtreecommitdiff
path: root/packages/backend/src/models/json-schema/user.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/backend/src/models/json-schema/user.ts')
-rw-r--r--packages/backend/src/models/json-schema/user.ts61
1 files changed, 44 insertions, 17 deletions
diff --git a/packages/backend/src/models/json-schema/user.ts b/packages/backend/src/models/json-schema/user.ts
index dae8f26075..c7f86635da 100644
--- a/packages/backend/src/models/json-schema/user.ts
+++ b/packages/backend/src/models/json-schema/user.ts
@@ -3,16 +3,38 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/
-const notificationRecieveConfig = {
+export const notificationRecieveConfig = {
type: 'object',
- nullable: false, optional: true,
- properties: {
- type: {
- type: 'string',
- nullable: false, optional: false,
- enum: ['all', 'following', 'follower', 'mutualFollow', 'list', 'never'],
+ oneOf: [
+ {
+ type: 'object',
+ nullable: false,
+ properties: {
+ type: {
+ type: 'string',
+ nullable: false,
+ enum: ['all', 'following', 'follower', 'mutualFollow', 'never'],
+ },
+ },
+ required: ['type'],
},
- },
+ {
+ type: 'object',
+ nullable: false,
+ properties: {
+ type: {
+ type: 'string',
+ nullable: false,
+ enum: ['list'],
+ },
+ userListId: {
+ type: 'string',
+ format: 'misskey:id',
+ },
+ },
+ required: ['type', 'userListId'],
+ },
+ ],
} as const;
export const packedUserLiteSchema = {
@@ -546,15 +568,20 @@ export const packedMeDetailedOnlySchema = {
type: 'object',
nullable: false, optional: false,
properties: {
- app: notificationRecieveConfig,
- quote: notificationRecieveConfig,
- reply: notificationRecieveConfig,
- follow: notificationRecieveConfig,
- renote: notificationRecieveConfig,
- mention: notificationRecieveConfig,
- reaction: notificationRecieveConfig,
- pollEnded: notificationRecieveConfig,
- receiveFollowRequest: notificationRecieveConfig,
+ note: { optional: true, ...notificationRecieveConfig },
+ follow: { optional: true, ...notificationRecieveConfig },
+ mention: { optional: true, ...notificationRecieveConfig },
+ reply: { optional: true, ...notificationRecieveConfig },
+ renote: { optional: true, ...notificationRecieveConfig },
+ quote: { optional: true, ...notificationRecieveConfig },
+ reaction: { optional: true, ...notificationRecieveConfig },
+ pollEnded: { optional: true, ...notificationRecieveConfig },
+ receiveFollowRequest: { optional: true, ...notificationRecieveConfig },
+ followRequestAccepted: { optional: true, ...notificationRecieveConfig },
+ roleAssigned: { optional: true, ...notificationRecieveConfig },
+ achievementEarned: { optional: true, ...notificationRecieveConfig },
+ app: { optional: true, ...notificationRecieveConfig },
+ test: { optional: true, ...notificationRecieveConfig },
},
},
emailNotificationTypes: {