refactor: prefix Mi for all entities (misskey-dev#11719) (MisskeyIO#160)

cheery-pick from misskey-dev@792622aeadf3e36d50cddec3c64b2ff0105ea927
This commit is contained in:
まっちゃとーにゅ 2023-08-26 08:42:29 +09:00 committed by GitHub
parent 651905e08f
commit 58bbff3738
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
234 changed files with 2061 additions and 2061 deletions

View file

@ -6,11 +6,11 @@
import ms from 'ms';
import { In } from 'typeorm';
import { Inject, Injectable } from '@nestjs/common';
import type { User } from '@/models/entities/User.js';
import type { MiUser } from '@/models/entities/User.js';
import type { UsersRepository, NotesRepository, BlockingsRepository, DriveFilesRepository, ChannelsRepository } from '@/models/index.js';
import type { DriveFile } from '@/models/entities/DriveFile.js';
import type { Note } from '@/models/entities/Note.js';
import type { Channel } from '@/models/entities/Channel.js';
import type { MiDriveFile } from '@/models/entities/DriveFile.js';
import type { MiNote } from '@/models/entities/Note.js';
import type { MiChannel } from '@/models/entities/Channel.js';
import { MAX_NOTE_TEXT_LENGTH } from '@/const.js';
import { Endpoint } from '@/server/api/endpoint-base.js';
import { NoteEntityService } from '@/core/entities/NoteEntityService.js';
@ -186,14 +186,14 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
private noteCreateService: NoteCreateService,
) {
super(meta, paramDef, async (ps, me) => {
let visibleUsers: User[] = [];
let visibleUsers: MiUser[] = [];
if (ps.visibleUserIds) {
visibleUsers = await this.usersRepository.findBy({
id: In(ps.visibleUserIds),
});
}
let files: DriveFile[] = [];
let files: MiDriveFile[] = [];
const fileIds = ps.fileIds != null ? ps.fileIds : ps.mediaIds != null ? ps.mediaIds : null;
if (fileIds != null) {
files = await this.driveFilesRepository.createQueryBuilder('file')
@ -210,7 +210,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
}
}
let renote: Note | null = null;
let renote: MiNote | null = null;
if (ps.renoteId != null) {
// Fetch renote to note
renote = await this.notesRepository.findOneBy({ id: ps.renoteId });
@ -235,7 +235,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
}
}
let reply: Note | null = null;
let reply: MiNote | null = null;
if (ps.replyId != null) {
// Fetch reply
reply = await this.notesRepository.findOneBy({ id: ps.replyId });
@ -270,7 +270,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
}
}
let channel: Channel | null = null;
let channel: MiChannel | null = null;
if (ps.channelId != null) {
channel = await this.channelsRepository.findOneBy({ id: ps.channelId, isArchived: false });