diff options
| author | zyoshoka <107108195+zyoshoka@users.noreply.github.com> | 2024-02-16 14:27:33 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-16 14:27:33 +0900 |
| commit | 40bbae3d6c200afb8ed9a70ca20ef03ebaed4e57 (patch) | |
| tree | 784a5253038a4e014334291454564dd0cab0b089 /packages/backend/src/models/json-schema/user.ts | |
| parent | feat(backend): likeOnlyなどでハートにフォールバックする際異... (diff) | |
| download | sharkey-40bbae3d6c200afb8ed9a70ca20ef03ebaed4e57.tar.gz sharkey-40bbae3d6c200afb8ed9a70ca20ef03ebaed4e57.tar.bz2 sharkey-40bbae3d6c200afb8ed9a70ca20ef03ebaed4e57.zip | |
fix(backend): add missing schemas and fix incorrect schemas (#13295)
* fix(backend): add missing schemas and fix incorrect schemas
* fix: ci
* fix: ci (本命)
* fix: run `pnpm build-misskey-js-with-types`
* fix: typos
* fix: role-condition-formula-value contains `id`
* fix: incorrect schema
Diffstat (limited to 'packages/backend/src/models/json-schema/user.ts')
| -rw-r--r-- | packages/backend/src/models/json-schema/user.ts | 61 |
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: { |