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
This commit is contained in:
zyoshoka 2024-02-16 14:27:33 +09:00 committed by GitHub
parent 147e8f1e3e
commit 40bbae3d6c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
31 changed files with 1038 additions and 160 deletions

View file

@ -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: {