move user.lastFetchedAt to UserLite

This commit is contained in:
Hazelnoot 2025-07-04 12:31:36 -04:00
parent 69402e3abb
commit f163e15602
4 changed files with 9 additions and 8 deletions

View file

@ -444,6 +444,7 @@ export class WebhookTestService {
...user,
createdAt: this.idService.parse(user.id).date.toISOString(),
updatedAt: null,
lastFetchedAt: null,
id: user.id,
name: user.name,
username: user.username,

View file

@ -547,6 +547,7 @@ export class UserEntityService implements OnModuleInit {
description: mastoapi ? mastoapi.description : profile ? profile.description : '',
createdAt: this.idService.parse(user.id).date.toISOString(),
updatedAt: user.updatedAt ? user.updatedAt.toISOString() : null,
lastFetchedAt: user.lastFetchedAt ? user.lastFetchedAt.toISOString() : null,
avatarDecorations: user.avatarDecorations.length > 0 ? this.avatarDecorationService.getAll().then(decorations => user.avatarDecorations.filter(ud => decorations.some(d => d.id === ud.id)).map(ud => ({
id: ud.id,
angle: ud.angle || undefined,
@ -602,7 +603,6 @@ export class UserEntityService implements OnModuleInit {
? Promise.all(user.alsoKnownAs.map(uri => Promise.resolve(opts.userIdsByUri?.get(uri) ?? this.apPersonService.fetchPerson(uri).then(user => user?.id).catch(() => null))))
.then(xs => xs.length === 0 ? null : xs.filter(x => x != null))
: null,
lastFetchedAt: user.lastFetchedAt ? user.lastFetchedAt.toISOString() : null,
bannerUrl: user.bannerId == null ? null : user.bannerUrl,
bannerBlurhash: user.bannerId == null ? null : user.bannerBlurhash,
backgroundUrl: user.backgroundId == null ? null : user.backgroundUrl,

View file

@ -74,6 +74,11 @@ export const packedUserLiteSchema = {
nullable: true, optional: false,
format: 'date-time',
},
lastFetchedAt: {
type: 'string',
nullable: true, optional: false,
format: 'date-time',
},
approved: {
type: 'boolean',
nullable: false, optional: false,
@ -309,11 +314,6 @@ export const packedUserDetailedNotMeOnlySchema = {
nullable: false, optional: false,
},
},
lastFetchedAt: {
type: 'string',
nullable: true, optional: false,
format: 'date-time',
},
bannerUrl: {
type: 'string',
format: 'url',

View file

@ -4256,6 +4256,8 @@ export type components = {
createdAt: string;
/** Format: date-time */
updatedAt: string | null;
/** Format: date-time */
lastFetchedAt: string | null;
approved: boolean;
/** @example Hi masters, I am Ai! */
description: string | null;
@ -4322,8 +4324,6 @@ export type components = {
/** Format: uri */
movedTo: string | null;
alsoKnownAs: string[] | null;
/** Format: date-time */
lastFetchedAt: string | null;
/** Format: url */
bannerUrl: string | null;
bannerBlurhash: string | null;