update backend to the new templates

This commit is contained in:
Hazelnoot 2025-10-07 00:40:02 -04:00
parent 4e30986cda
commit 05be2596ea
44 changed files with 156 additions and 111 deletions

View file

@ -767,7 +767,7 @@ export class DriveService {
@bindThis
public async deleteFileSync(file: MiDriveFile, isExpired = false, deleter?: { id: string }) {
const promises = [];
const promises: Promise<void>[] = [];
if (file.storedInternal) {
promises.push(this.deleteLocalFile(file.accessKey!));

View file

@ -299,7 +299,7 @@ export class MfmService {
(note that the `rp` are to be ignored, they only exist
for browsers who don't understand ruby)
*/
let nonRtNodes = [];
let nonRtNodes: ChildNode[] = [];
// scan children, ignore `rp`, split on `rt`
for (const child of node.childNodes) {
if (isText(child)) {

View file

@ -147,7 +147,7 @@ export class ReactionsBufferingService implements OnApplicationShutdown {
// TODO: scanは重い可能性があるので、別途 bufferedNoteIds を直接Redis上に持っておいてもいいかもしれない
@bindThis
public async bake(): Promise<void> {
const bufferedNoteIds = [];
const bufferedNoteIds: string[] = [];
let cursor = '0';
do {
// https://github.com/redis/ioredis#transparent-key-prefixing

View file

@ -40,7 +40,7 @@ export class FlashEntityService {
// { schema: 'UserDetailed' } すると無限ループするので注意
const user = hint?.packedUser ?? await this.userEntityService.pack(flash.user ?? flash.userId, me);
let isLiked = undefined;
let isLiked: boolean | undefined = undefined;
if (meId) {
isLiked = hint?.likedFlashIds
? hint.likedFlashIds.includes(flash.id)

View file

@ -51,8 +51,8 @@ export class MetaEntityService {
.getMany();
// クライアントの手間を減らすためあらかじめJSONに変換しておく
let defaultLightTheme = null;
let defaultDarkTheme = null;
let defaultLightTheme: string | null = null;
let defaultDarkTheme: string | null = null;
if (instance.defaultLightTheme) {
try {
defaultLightTheme = JSON.stringify(JSON5.parse(instance.defaultLightTheme));

View file

@ -491,7 +491,7 @@ export class NoteEntityService implements OnModuleInit {
@bindThis
public async packAttachedFiles(fileIds: MiNote['fileIds'], packedFiles: Map<MiNote['fileIds'][number], Packed<'DriveFile'> | null>): Promise<Packed<'DriveFile'>[]> {
const missingIds = [];
const missingIds: string[] = [];
for (const id of fileIds) {
if (!packedFiles.has(id)) missingIds.push(id);
}

View file

@ -232,7 +232,7 @@ export class NotificationEntityService implements OnModuleInit {
validNotifications = validNotifications.filter(x => !('noteId' in x) || packedNotes.has(x.noteId));
const userIds = [];
const userIds: string[] = [];
for (const notification of validNotifications) {
if ('notifierId' in notification) userIds.push(notification.notifierId);
if (notification.type === 'reaction:grouped') userIds.push(...notification.reactions.map(x => x.userId));