summaryrefslogtreecommitdiff
path: root/packages/backend/src
diff options
context:
space:
mode:
authoryupix <yupi0982@outlook.jp>2023-12-04 16:53:31 +0900
committerGitHub <noreply@github.com>2023-12-04 16:53:31 +0900
commit33034b0e02860513d277e8f8a08f96a84592b3e3 (patch)
tree5f18a2d7ac35b13021713ed01102faaf838554f7 /packages/backend/src
parentFilter User / Instance Mutes in FanoutTimelineEndpointService (#12565) (diff)
downloadmisskey-33034b0e02860513d277e8f8a08f96a84592b3e3.tar.gz
misskey-33034b0e02860513d277e8f8a08f96a84592b3e3.tar.bz2
misskey-33034b0e02860513d277e8f8a08f96a84592b3e3.zip
feat: ユーザースキーマの改善 (#12568)
* chore: notifyにenumを設定 * feat: securityKeysListの型を明確に * feat: notificationRecieveConfigにpropertiesを定義 * chore: misskey.jsのmodelを更新 * fix: as constをつけ忘れている
Diffstat (limited to 'packages/backend/src')
-rw-r--r--packages/backend/src/models/json-schema/user.ts43
1 files changed, 43 insertions, 0 deletions
diff --git a/packages/backend/src/models/json-schema/user.ts b/packages/backend/src/models/json-schema/user.ts
index a2ec203e96..2621e7e6c0 100644
--- a/packages/backend/src/models/json-schema/user.ts
+++ b/packages/backend/src/models/json-schema/user.ts
@@ -3,6 +3,18 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/
+const notificationRecieveConfig = {
+ type: 'object',
+ nullable: false, optional: true,
+ properties: {
+ type: {
+ type: 'string',
+ nullable: false, optional: false,
+ enum: ['all', 'following', 'follower', 'mutualFollow', 'list', 'never'],
+ },
+ },
+} as const;
+
export const packedUserLiteSchema = {
type: 'object',
properties: {
@@ -398,6 +410,7 @@ export const packedUserDetailedNotMeOnlySchema = {
notify: {
type: 'string',
nullable: false, optional: true,
+ enum: ['normal', 'none'],
},
withReplies: {
type: 'boolean',
@@ -553,6 +566,19 @@ export const packedMeDetailedOnlySchema = {
notificationRecieveConfig: {
type: 'object',
nullable: false, optional: false,
+ properties: {
+ app: notificationRecieveConfig,
+ quote: notificationRecieveConfig,
+ reply: notificationRecieveConfig,
+ follow: notificationRecieveConfig,
+ renote: notificationRecieveConfig,
+ mention: notificationRecieveConfig,
+ reaction: notificationRecieveConfig,
+ pollEnded: notificationRecieveConfig,
+ achievementEarned: notificationRecieveConfig,
+ receiveFollowRequest: notificationRecieveConfig,
+ followRequestAccepted: notificationRecieveConfig,
+ },
},
emailNotificationTypes: {
type: 'array',
@@ -697,6 +723,23 @@ export const packedMeDetailedOnlySchema = {
items: {
type: 'object',
nullable: false, optional: false,
+ properties: {
+ id: {
+ type: 'string',
+ nullable: false, optional: false,
+ format: 'id',
+ example: 'xxxxxxxxxx',
+ },
+ name: {
+ type: 'string',
+ nullable: false, optional: false,
+ },
+ lastUsed: {
+ type: 'string',
+ nullable: false, optional: false,
+ format: 'date-time',
+ },
+ },
},
},
//#endregion