fix packed user schema

This commit is contained in:
dakkar 2025-05-13 16:27:35 +01:00
parent 1b27fb1a65
commit 8e31774670
3 changed files with 41 additions and 29 deletions

View file

@ -427,10 +427,12 @@ export class WebhookTestService {
private async toPackedUserLite(user: MiUser, override?: Packed<'UserLite'>): Promise<Packed<'UserLite'>> {
return {
...user,
createdAt: new Date(Date.now() - oneDayMillis * 9).toISOString(),
id: user.id,
name: user.name,
username: user.username,
host: user.host,
description: 'dummy user',
avatarUrl: user.avatarId == null ? null : user.avatarUrl,
avatarBlurhash: user.avatarId == null ? null : user.avatarBlurhash,
avatarDecorations: user.avatarDecorations.map(it => ({

View file

@ -64,6 +64,20 @@ export const packedUserLiteSchema = {
example: 'misskey.example.com',
description: 'The local host is represented with `null`.',
},
createdAt: {
type: 'string',
nullable: false, optional: false,
format: 'date-time',
},
approved: {
type: 'boolean',
nullable: false, optional: false,
},
description: {
type: 'string',
nullable: true, optional: false,
example: 'Hi masters, I am Ai!',
},
avatarUrl: {
type: 'string',
format: 'url',
@ -202,6 +216,18 @@ export const packedUserLiteSchema = {
},
},
},
followersCount: {
type: 'number',
nullable: false, optional: false,
},
followingCount: {
type: 'number',
nullable: false, optional: false,
},
notesCount: {
type: 'number',
nullable: false, optional: false,
},
emojis: {
type: 'object',
nullable: false, optional: false,
@ -266,11 +292,6 @@ export const packedUserDetailedNotMeOnlySchema = {
nullable: false, optional: false,
},
},
createdAt: {
type: 'string',
nullable: false, optional: false,
format: 'date-time',
},
updatedAt: {
type: 'string',
nullable: true, optional: false,
@ -312,11 +333,6 @@ export const packedUserDetailedNotMeOnlySchema = {
nullable: false, optional: false,
example: false,
},
description: {
type: 'string',
nullable: true, optional: false,
example: 'Hi masters, I am Ai!',
},
location: {
type: 'string',
nullable: true, optional: false,
@ -365,18 +381,6 @@ export const packedUserDetailedNotMeOnlySchema = {
format: 'url',
},
},
followersCount: {
type: 'number',
nullable: false, optional: false,
},
followingCount: {
type: 'number',
nullable: false, optional: false,
},
notesCount: {
type: 'number',
nullable: false, optional: false,
},
pinnedNoteIds: {
type: 'array',
nullable: false, optional: false,
@ -739,6 +743,10 @@ export const packedMeDetailedOnlySchema = {
type: 'boolean',
nullable: true, optional: true,
},
signupReason: {
type: 'string',
nullable: true, optional: true,
},
securityKeysList: {
type: 'array',
nullable: false, optional: true,

View file

@ -4243,6 +4243,11 @@ export type components = {
* @example misskey.example.com
*/
host: string | null;
/** Format: date-time */
createdAt: string;
approved: boolean;
/** @example Hi masters, I am Ai! */
description: string | null;
/** Format: url */
avatarUrl: string | null;
avatarBlurhash: string | null;
@ -4282,6 +4287,9 @@ export type components = {
faviconUrl: string | null;
themeColor: string | null;
};
followersCount: number;
followingCount: number;
notesCount: number;
emojis: {
[key: string]: string;
};
@ -4302,8 +4310,6 @@ export type components = {
movedTo: string | null;
alsoKnownAs: string[] | null;
/** Format: date-time */
createdAt: string;
/** Format: date-time */
updatedAt: string | null;
/** Format: date-time */
lastFetchedAt: string | null;
@ -4317,8 +4323,6 @@ export type components = {
isSilenced: boolean;
/** @example false */
isSuspended: boolean;
/** @example Hi masters, I am Ai! */
description: string | null;
location: string | null;
/** @example 2018-03-12 */
birthday: string | null;
@ -4331,9 +4335,6 @@ export type components = {
value: string;
}[];
verifiedLinks: string[];
followersCount: number;
followingCount: number;
notesCount: number;
pinnedNoteIds: string[];
pinnedNotes: components['schemas']['Note'][];
pinnedPageId: string | null;
@ -4552,6 +4553,7 @@ export type components = {
securityKeys: boolean;
email?: string | null;
emailVerified?: boolean | null;
signupReason?: string | null;
securityKeysList?: {
/**
* Format: id