diff options
Diffstat (limited to 'src/models/repositories/user.ts')
| -rw-r--r-- | src/models/repositories/user.ts | 263 |
1 files changed, 222 insertions, 41 deletions
diff --git a/src/models/repositories/user.ts b/src/models/repositories/user.ts index 7502e7a08e..3a6ab48c5f 100644 --- a/src/models/repositories/user.ts +++ b/src/models/repositories/user.ts @@ -330,22 +330,22 @@ export const packedUserSchema = { description: 'The unique identifier for this User.', example: 'xxxxxxxxxx', }, + name: { + type: 'string' as const, + nullable: true as const, optional: false as const, + description: 'The name of the user, as they’ve defined it.', + example: '藍' + }, username: { type: 'string' as const, nullable: false as const, optional: false as const, description: 'The screen name, handle, or alias that this user identifies themselves with.', example: 'ai' }, - name: { + host: { type: 'string' as const, nullable: true as const, optional: false as const, - description: 'The name of the user, as they’ve defined it.', - example: '藍' - }, - url: { - type: 'string' as const, - format: 'url', - nullable: true as const, optional: true as const, + example: 'misskey.example.com' }, avatarUrl: { type: 'string' as const, @@ -356,6 +356,80 @@ export const packedUserSchema = { type: 'any' as const, nullable: true as const, optional: false as const, }, + avatarColor: { + type: 'any' as const, + nullable: true as const, optional: false as const, + default: null + }, + isAdmin: { + type: 'boolean' as const, + nullable: false as const, optional: false as const, + description: 'Whether this account is the admin.', + default: false + }, + isModerator: { + type: 'boolean' as const, + nullable: false as const, optional: false as const, + description: 'Whether this account is a moderator.', + default: false + }, + isBot: { + type: 'boolean' as const, + nullable: false as const, optional: true as const, + description: 'Whether this account is a bot.' + }, + isCat: { + type: 'boolean' as const, + nullable: false as const, optional: true as const, + description: 'Whether this account is a cat.' + }, + emojis: { + type: 'array' as const, + nullable: false as const, optional: false as const, + items: { + type: 'object' as const, + nullable: false as const, optional: false as const, + properties: { + name: { + type: 'string' as const, + nullable: false as const, optional: false as const + }, + host: { + type: 'string' as const, + nullable: true as const, optional: false as const + }, + url: { + type: 'string' as const, + nullable: false as const, optional: false as const, + format: 'url' + }, + aliases: { + type: 'array' as const, + nullable: false as const, optional: false as const, + items: { + type: 'string' as const, + nullable: false as const, optional: false as const + } + } + } + } + }, + url: { + type: 'string' as const, + format: 'url', + nullable: true as const, optional: true as const, + }, + createdAt: { + type: 'string' as const, + nullable: false as const, optional: true as const, + format: 'date-time', + description: 'The date that the user account was created on Misskey.' + }, + updatedAt: { + type: 'string' as const, + nullable: true as const, optional: true as const, + format: 'date-time', + }, bannerUrl: { type: 'string' as const, format: 'url', @@ -365,14 +439,19 @@ export const packedUserSchema = { type: 'any' as const, nullable: true as const, optional: true as const, }, - emojis: { + bannerColor: { type: 'any' as const, - nullable: true as const, optional: false as const, + nullable: true as const, optional: true as const, + default: null }, - host: { - type: 'string' as const, - nullable: true as const, optional: false as const, - example: 'misskey.example.com' + isLocked: { + type: 'boolean' as const, + nullable: false as const, optional: true as const, + }, + isSuspended: { + type: 'boolean' as const, + nullable: false as const, optional: false as const, + example: false }, description: { type: 'string' as const, @@ -380,25 +459,33 @@ export const packedUserSchema = { description: 'The user-defined UTF-8 string describing their account.', example: 'Hi masters, I am Ai!' }, - birthday: { + location: { type: 'string' as const, nullable: true as const, optional: true as const, - example: '2018-03-12' - }, - createdAt: { - type: 'string' as const, - nullable: false as const, optional: true as const, - format: 'date-time', - description: 'The date that the user account was created on Misskey.' }, - updatedAt: { + birthday: { type: 'string' as const, nullable: true as const, optional: true as const, - format: 'date-time', + example: '2018-03-12' }, - location: { - type: 'string' as const, - nullable: true as const, optional: true as const, + fields: { + type: 'array' as const, + nullable: false as const, optional: false as const, + items: { + type: 'object' as const, + nullable: false as const, optional: false as const, + properties: { + name: { + type: 'string' as const, + nullable: false as const, optional: false as const + }, + value: { + type: 'string' as const, + nullable: false as const, optional: false as const + } + }, + maxLength: 4 + } }, followersCount: { type: 'number' as const, @@ -415,11 +502,6 @@ export const packedUserSchema = { nullable: false as const, optional: true as const, description: 'The number of Notes (including renotes) issued by the user.' }, - isBot: { - type: 'boolean' as const, - nullable: false as const, optional: true as const, - description: 'Whether this account is a bot.' - }, pinnedNoteIds: { type: 'array' as const, nullable: false as const, optional: true as const, @@ -438,32 +520,131 @@ export const packedUserSchema = { ref: 'Note' } }, - isCat: { + pinnedPageId: { + type: 'string' as const, + nullable: true as const, optional: false as const + }, + pinnedPage: { + type: 'object' as const, + nullable: true as const, optional: false as const, + ref: 'Page' + }, + twoFactorEnabled: { + type: 'boolean' as const, + nullable: false as const, optional: false as const, + default: false + }, + usePasswordLessLogin: { + type: 'boolean' as const, + nullable: false as const, optional: false as const, + default: false + }, + securityKeys: { + type: 'boolean' as const, + nullable: false as const, optional: false as const, + default: false + }, + avatarId: { + type: 'string' as const, + nullable: true as const, optional: true as const, + format: 'id' + }, + bannerId: { + type: 'string' as const, + nullable: true as const, optional: true as const, + format: 'id' + }, + autoWatch: { + type: 'boolean' as const, + nullable: false as const, optional: true as const + }, + injectFeaturedNote: { + type: 'boolean' as const, + nullable: false as const, optional: true as const + }, + alwaysMarkNsfw: { + type: 'boolean' as const, + nullable: false as const, optional: true as const + }, + carefulBot: { + type: 'boolean' as const, + nullable: false as const, optional: true as const + }, + autoAcceptFollowed: { + type: 'boolean' as const, + nullable: false as const, optional: true as const + }, + hasUnreadSpecifiedNotes: { type: 'boolean' as const, nullable: false as const, optional: true as const, - description: 'Whether this account is a cat.' }, - isAdmin: { + hasUnreadMentions: { type: 'boolean' as const, nullable: false as const, optional: true as const, - description: 'Whether this account is the admin.' }, - isModerator: { + hasUnreadAnnouncement: { type: 'boolean' as const, nullable: false as const, optional: true as const, - description: 'Whether this account is a moderator.' }, - isLocked: { + hasUnreadAntenna: { type: 'boolean' as const, nullable: false as const, optional: true as const, }, - hasUnreadSpecifiedNotes: { + hasUnreadChannel: { type: 'boolean' as const, nullable: false as const, optional: true as const, }, - hasUnreadMentions: { + hasUnreadMessagingMessage: { type: 'boolean' as const, nullable: false as const, optional: true as const, }, + hasUnreadNotification: { + type: 'boolean' as const, + nullable: false as const, optional: true as const, + }, + hasPendingReceivedFollowRequest: { + type: 'boolean' as const, + nullable: false as const, optional: true as const, + }, + integrations: { + type: 'object' as const, + nullable: false as const, optional: true as const + }, + mutedWords: { + type: 'array' as const, + nullable: false as const, optional: true as const + }, + mutingNotificationTypes: { + type: 'array' as const, + nullable: false as const, optional: true as const + }, + isFollowing: { + type: 'boolean' as const, + optional: true as const, nullable: false as const + }, + hasPendingFollowRequestFromYou: { + type: 'boolean' as const, + optional: true as const, nullable: false as const + }, + hasPendingFollowRequestToYou: { + type: 'boolean' as const, + optional: true as const, nullable: false as const + }, + isFollowed: { + type: 'boolean' as const, + optional: true as const, nullable: false as const + }, + isBlocking: { + type: 'boolean' as const, + optional: true as const, nullable: false as const + }, + isBlocked: { + type: 'boolean' as const, + optional: true as const, nullable: false as const + }, + isMuted: { + type: 'boolean' as const, + optional: true as const, nullable: false as const + } }, }; |