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'>> { private async toPackedUserLite(user: MiUser, override?: Packed<'UserLite'>): Promise<Packed<'UserLite'>> {
return { return {
...user, ...user,
createdAt: new Date(Date.now() - oneDayMillis * 9).toISOString(),
id: user.id, id: user.id,
name: user.name, name: user.name,
username: user.username, username: user.username,
host: user.host, host: user.host,
description: 'dummy user',
avatarUrl: user.avatarId == null ? null : user.avatarUrl, avatarUrl: user.avatarId == null ? null : user.avatarUrl,
avatarBlurhash: user.avatarId == null ? null : user.avatarBlurhash, avatarBlurhash: user.avatarId == null ? null : user.avatarBlurhash,
avatarDecorations: user.avatarDecorations.map(it => ({ avatarDecorations: user.avatarDecorations.map(it => ({

View file

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

View file

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