Compare commits

..
Author SHA1 Message Date
syuilo 8cce6dff51 wip 2026-01-06 11:38:10 +09:00
412 changed files with 1829 additions and 2747 deletions
-3
View File
@@ -13,14 +13,11 @@
- Enhance: ドライブのファイル一覧で自動でもっと見るを利用可能に
- Enhance: ウィジェットの表示設定をプレビューを見ながら行えるように
- Enhance: ウィジェットの設定項目のラベルの多言語対応
- Enhance: パフォーマンスの向上
- Fix: ドライブクリーナーでファイルを削除しても画面に反映されない問題を修正 #16061
- Fix: 非ログイン時にログインを求めるダイアログが表示された後にダイアログのぼかしが解除されず操作不能になることがある問題を修正
- Fix: ドライブのソートが「登録日(昇順)」の場合に正しく動作しない問題を修正
- Fix: 高度なMFMのピッカーを使用する際の挙動を改善
- Fix: 管理画面でアーカイブ済のお知らせを表示した際にアクティブなお知らせが多い旨の警告が出る問題を修正
- Fix: ファイルタブのセンシティブメディアを開く際に確認ダイアログを出す設定が適用されない問題を修正
- Fix: 2月29日を誕生日に設定している場合、閏年以外は3月1日を誕生日として扱うように修正
### Server
- Enhance: OAuthのクライアント情報取得(Client Information Discovery)において、IndieWeb Living Standard 11 July 2024で定義されているJSONドキュメント形式に対応しました
-10
View File
@@ -51,13 +51,3 @@ Thanks to [Crowdin](https://crowdin.com/) for providing the localization platfor
<a href="https://hub.docker.com/"><img src="https://user-images.githubusercontent.com/20679825/230148221-f8e73a32-a49b-47c3-9029-9a15c3824f92.png" height="30" alt="Docker" /></a>
Thanks to [Docker](https://hub.docker.com/) for providing the container platform that helps us run Misskey in production.
---
<div align="center">
Support us with a ⭐ !
[![Star History Chart](https://api.star-history.com/svg?repos=misskey-dev/misskey&type=Date)](https://star-history.com/#misskey-dev/misskey&Date)
</div>
+7 -7
View File
@@ -1,12 +1,12 @@
{
"name": "misskey",
"version": "2026.1.0-alpha.4",
"version": "2026.1.0-alpha.1",
"codename": "nasubi",
"repository": {
"type": "git",
"url": "https://github.com/misskey-dev/misskey.git"
},
"packageManager": "pnpm@10.27.0",
"packageManager": "pnpm@10.26.2",
"workspaces": [
"packages/misskey-js",
"packages/i18n",
@@ -23,7 +23,7 @@
"private": true,
"scripts": {
"compile-config": "cd packages/backend && pnpm compile-config",
"build-pre": "node scripts/build-pre.mjs",
"build-pre": "node ./scripts/build-pre.js",
"build-assets": "node ./scripts/build-assets.mjs",
"build": "pnpm build-pre && pnpm -r build && pnpm build-assets",
"build-storybook": "pnpm --filter frontend build-storybook",
@@ -39,7 +39,7 @@
"migrateandstart": "pnpm migrate && pnpm start",
"watch": "pnpm dev",
"dev": "node scripts/dev.mjs",
"lint": "pnpm --no-bail -r lint",
"lint": "pnpm -r lint",
"cy:open": "pnpm cypress open --config-file=cypress.config.ts",
"cy:run": "pnpm cypress run",
"e2e": "pnpm start-server-and-test start:test http://localhost:61812 cy:run",
@@ -48,8 +48,8 @@
"jest-and-coverage": "cd packages/backend && pnpm jest-and-coverage",
"test": "pnpm -r test",
"test-and-coverage": "pnpm -r test-and-coverage",
"clean": "node scripts/clean.mjs",
"clean-all": "node scripts/clean-all.mjs",
"clean": "node ./scripts/clean.js",
"clean-all": "node ./scripts/clean-all.js",
"cleanall": "pnpm clean-all"
},
"resolutions": {
@@ -79,7 +79,7 @@
"eslint": "9.39.2",
"globals": "16.5.0",
"ncp": "2.0.0",
"pnpm": "10.27.0",
"pnpm": "10.26.2",
"typescript": "5.9.3",
"start-server-and-test": "2.1.3"
},
+1 -1
View File
@@ -9,7 +9,7 @@ window.onload = async () => {
const account = JSON.parse(localStorage.getItem('account'));
const i = account.token;
const _api = (endpoint, data = {}) => {
const api = (endpoint, data = {}) => {
const promise = new Promise((resolve, reject) => {
// Append a credential
if (i) data.i = i;
+61 -2
View File
@@ -1,7 +1,7 @@
import fs from 'node:fs';
import { fileURLToPath } from 'node:url';
import { dirname, join } from 'node:path';
import { build } from 'esbuild';
import * as esbuild from 'esbuild';
import { swcPlugin } from 'esbuild-plugin-swc';
const _filename = fileURLToPath(import.meta.url);
@@ -103,12 +103,16 @@ if (!args.includes('--no-clean')) {
fs.rmSync('./built', { recursive: true, force: true });
}
//await minifyJsFiles(join(_dirname, 'node_modules'));
await minifyJsFiles(join(_dirname, '../../node_modules'));
await buildSrc();
async function buildSrc() {
console.log(`[${_package.name}] start building...`);
await build(options)
await esbuild.build(options)
.then(() => {
console.log(`[${_package.name}] build succeeded.`);
})
@@ -119,3 +123,58 @@ async function buildSrc() {
console.log(`[${_package.name}] finish building.`);
}
async function minifyJsFile(fullPath) {
if (!fullPath.includes('node_modules') || fullPath.includes('storybook') || fullPath.includes('tensorflow') || fullPath.includes('vite') || fullPath.includes('vue') || fullPath.includes('esbuild') || fullPath.includes('typescript') || fullPath.includes('css') || fullPath.includes('lint') || fullPath.includes('roll') || fullPath.includes('sass')) {
console.log(`Skipped: ${fullPath}`);
return;
}
try {
const data = fs.readFileSync(fullPath, 'utf-8');
if (data.includes('0 && (module.exports')) {
console.log(`Skipped: ${fullPath}`);
return;
}
//await esbuild.build({
// entryPoints: [fullPath],
// minifyWhitespace: true,
// outdir: dirname(fullPath),
// allowOverwrite: true,
//});
const result = await esbuild.transform(data, {
minifyWhitespace: true,
minifyIdentifiers: true,
minifySyntax: false, // nestjsが壊れる
treeShaking: false,
});
fs.writeFileSync(fullPath, result.code, 'utf-8');
console.log(`Minified: ${fullPath}`);
// eslint-disable-next-line @typescript-eslint/no-unused-vars
} catch (err) {
console.log(`Skipped (error): ${fullPath}`);
}
}
async function minifyJsFiles(dir) {
const entries = fs.readdirSync(dir, { withFileTypes: true });
for (const entry of entries) {
const fullPath = join(dir, entry.name);
if (entry.isDirectory()) {
await minifyJsFiles(fullPath);
} else if (entry.isFile() && entry.name.endsWith('.js')) {
await minifyJsFile(fullPath);
} else {
// resolve symbolic link
const stats = fs.lstatSync(fullPath);
if (stats.isSymbolicLink()) {
const realPath = fs.realpathSync(fullPath);
const realStats = fs.statSync(realPath);
if (realStats.isDirectory()) {
await minifyJsFiles(realPath);
} else if (realStats.isFile() && realPath.endsWith('.js')) {
await minifyJsFile(realPath);
}
}
}
}
}
+1
View File
@@ -25,6 +25,7 @@ export default [
},
},
rules: {
'@typescript-eslint/no-unused-vars': 'off',
'import/order': ['warn', {
groups: [
'builtin',
+12 -10
View File
@@ -16,22 +16,24 @@ async function connectToPostgres() {
}
async function connectToRedis(redisOptions) {
let redis;
try {
redis = new Redis({
return await new Promise(async (resolve, reject) => {
const redis = new Redis({
...redisOptions,
lazyConnect: true,
reconnectOnError: false,
showFriendlyErrorStack: true,
});
redis.on('error', e => reject(e));
await Promise.race([
new Promise((_, reject) => redis.on('error', e => reject(e))),
redis.connect(),
]);
} finally {
redis.disconnect(false);
}
try {
await redis.connect();
resolve();
} catch (e) {
reject(e);
} finally {
redis.disconnect(false);
}
});
}
// If not all of these are defined, the default one gets reused.
+1 -1
View File
@@ -58,7 +58,7 @@ export async function masterMain() {
//await connectDb();
if (config.pidFile) fs.writeFileSync(config.pidFile, process.pid.toString());
} catch (e) {
bootLogger.error('Fatal error occurred during initialization: ' + e, null, true);
bootLogger.error('Fatal error occurred during initialization', null, true);
process.exit(1);
}
+1 -1
View File
@@ -352,7 +352,7 @@ export function loadConfig(): Config {
function tryCreateUrl(url: string) {
try {
return new URL(url);
} catch (_) {
} catch (e) {
throw new Error(`url="${url}" is not a valid URL.`);
}
}
@@ -75,7 +75,7 @@ export class AccountMoveService {
*/
@bindThis
public async moveFromLocal(src: MiLocalUser, dst: MiLocalUser | MiRemoteUser): Promise<unknown> {
const _srcUri = this.userEntityService.getUserUri(src);
const srcUri = this.userEntityService.getUserUri(src);
const dstUri = this.userEntityService.getUserUri(dst);
// add movedToUri to indicate that the user has moved
@@ -205,7 +205,7 @@ export class AnnouncementService {
announcementId: announcementId,
userId: user.id,
});
} catch (_) {
} catch (e) {
return;
}
@@ -39,7 +39,7 @@ export class AvatarDecorationService implements OnApplicationShutdown {
const obj = JSON.parse(data);
if (obj.channel === 'internal') {
const { type, body: _ } = obj.message as GlobalEvents['internal']['payload'];
const { type, body } = obj.message as GlobalEvents['internal']['payload'];
switch (type) {
case 'avatarDecorationCreated':
case 'avatarDecorationUpdated':
+1 -1
View File
@@ -366,7 +366,7 @@ export class EmailService {
valid: true,
reason: null,
};
} catch (_) {
} catch (error) {
return {
valid: false,
reason: 'network',
+20 -8
View File
@@ -484,13 +484,25 @@ export class FileInfoService {
* Calculate blurhash string of image
*/
@bindThis
private async getBlurhash(path: string, type: string): Promise<string> {
const sharp = await sharpBmp(path, type);
const { data: buffer, info } = await sharp
.raw()
.ensureAlpha()
.resize(64, 64, { fit: 'inside' })
.toBuffer({ resolveWithObject: true });
return blurhash.encode(new Uint8ClampedArray(buffer), info.width, info.height, 5, 5);
private getBlurhash(path: string, type: string): Promise<string> {
return new Promise(async (resolve, reject) => {
(await sharpBmp(path, type))
.raw()
.ensureAlpha()
.resize(64, 64, { fit: 'inside' })
.toBuffer((err, buffer, info) => {
if (err) return reject(err);
let hash;
try {
hash = blurhash.encode(new Uint8ClampedArray(buffer), info.width, info.height, 5, 5);
} catch (e) {
return reject(e);
}
resolve(hash);
});
});
}
}
@@ -38,7 +38,11 @@ export interface BroadcastTypes {
emojis: Packed<'EmojiDetailed'>[];
};
emojiDeleted: {
emojis: Packed<'EmojiDetailed'>[];
emojis: {
id?: string;
name: string;
[other: string]: any;
}[];
};
announcementCreated: {
announcement: Packed<'Announcement'>;
+4 -4
View File
@@ -308,7 +308,7 @@ export class MfmService {
try {
const date = new Date(parseInt(text, 10) * 1000);
return `<time datetime="${escapeHtml(date.toISOString())}">${escapeHtml(date.toISOString())}</time>`;
} catch (_) {
} catch (err) {
return fnDefault(node);
}
}
@@ -376,7 +376,7 @@ export class MfmService {
try {
const url = new URL(node.props.url);
return `<a href="${escapeHtml(url.href)}">${toHtml(node.children)}</a>`;
} catch (_) {
} catch (err) {
return `[${toHtml(node.children)}](${escapeHtml(node.props.url)})`;
}
},
@@ -390,7 +390,7 @@ export class MfmService {
try {
const url = new URL(href);
return `<a href="${escapeHtml(url.href)}" class="u-url mention">${escapeHtml(acct)}</a>`;
} catch (_) {
} catch (err) {
return escapeHtml(acct);
}
},
@@ -419,7 +419,7 @@ export class MfmService {
try {
const url = new URL(node.props.url);
return `<a href="${escapeHtml(url.href)}">${escapeHtml(node.props.url)}</a>`;
} catch (_) {
} catch (err) {
return escapeHtml(node.props.url);
}
},
@@ -187,9 +187,9 @@ export class NoteDraftService {
}
//#region visibleUsers
let _visibleUsers: MiUser[] = [];
let visibleUsers: MiUser[] = [];
if (data.visibleUserIds != null && data.visibleUserIds.length > 0) {
_visibleUsers = await this.usersRepository.findBy({
visibleUsers = await this.usersRepository.findBy({
id: In(data.visibleUserIds),
});
}
+1 -1
View File
@@ -314,7 +314,7 @@ export class RoleService implements OnApplicationShutdown, OnModuleInit {
default:
return false;
}
} catch (_) {
} catch (err) {
// TODO: log error
return false;
}
+2 -1
View File
@@ -190,7 +190,8 @@ export class SearchService {
return this.searchNoteByMeiliSearch(q, me, opts, pagination);
}
default: {
const _: never = this.provider;
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const typeCheck: never = this.provider;
return [];
}
}
@@ -49,8 +49,8 @@ export class UserSuspendService {
});
(async () => {
await this.postSuspend(user).catch(_ => {});
await this.unFollowAll(user).catch(_ => {});
await this.postSuspend(user).catch(e => {});
await this.unFollowAll(user).catch(e => {});
})();
}
@@ -67,7 +67,7 @@ export class UserSuspendService {
});
(async () => {
await this.postUnsuspend(user).catch(_ => {});
await this.postUnsuspend(user).catch(e => {});
})();
}
+1 -1
View File
@@ -98,7 +98,7 @@ export class UtilityService {
try {
// TODO: RE2インスタンスをキャッシュ
return new RE2(regexp[1], regexp[2]).test(text);
} catch (_) {
} catch (err) {
// This should never happen due to input sanitisation.
return false;
}
@@ -515,7 +515,7 @@ export class ApRendererService {
const restPart = maybeUrl.slice(match[0].length);
return `<a href="${urlPartParsed.href}" rel="me nofollow noopener" target="_blank">${urlPart}</a>${restPart}`;
} catch (_) {
} catch (e) {
return maybeUrl;
}
};
@@ -226,7 +226,7 @@ export class ApRequestService {
return await this.signedGet(href, user, allowSoftfail, false);
}
}
} catch (_) {
} catch (e) {
// something went wrong parsing the HTML, ignore the whole thing
}
}
@@ -138,7 +138,7 @@ export class ChatEntityService {
const reactions: { reaction: string; }[] = [];
for (const record of message.reactions) {
const [, reaction] = record.split('/');
const [userId, reaction] = record.split('/');
reactions.push({
reaction,
});
@@ -17,7 +17,6 @@ import { deepClone } from '@/misc/clone.js';
import { bindThis } from '@/decorators.js';
import { isMimeImage } from '@/misc/is-mime-image.js';
import { IdService } from '@/core/IdService.js';
import { uniqueByKey } from '@/misc/unique-by-key.js';
import { UtilityService } from '../UtilityService.js';
import { VideoProcessingService } from '../VideoProcessingService.js';
import { UserEntityService } from './UserEntityService.js';
@@ -227,7 +226,6 @@ export class DriveFileEntityService {
options?: PackOptions,
hint?: {
packedUser?: Packed<'UserLite'>
packedFolder?: Packed<'DriveFolder'>
},
): Promise<Packed<'DriveFile'> | null> {
const opts = Object.assign({
@@ -252,9 +250,9 @@ export class DriveFileEntityService {
thumbnailUrl: this.getThumbnailUrl(file),
comment: file.comment,
folderId: file.folderId,
folder: opts.detail && file.folderId ? (hint?.packedFolder ?? this.driveFolderEntityService.pack(file.folderId, {
folder: opts.detail && file.folderId ? this.driveFolderEntityService.pack(file.folderId, {
detail: true,
})) : null,
}) : null,
userId: file.userId,
user: (opts.withUser && file.userId) ? hint?.packedUser ?? this.userEntityService.pack(file.userId) : null,
});
@@ -265,41 +263,10 @@ export class DriveFileEntityService {
files: MiDriveFile[],
options?: PackOptions,
): Promise<Packed<'DriveFile'>[]> {
// -- ユーザ情報の事前取得 --
let userMap: Map<string, Packed<'UserLite'>> | null = null;
if (options?.withUser) {
const users = files
.map(({ user, userId }) => user ?? userId)
.filter(x => x != null);
const uniqueUsers = uniqueByKey(users, (user) => typeof user === 'string' ? user : user.id);
const packedUsers = await this.userEntityService.packMany(uniqueUsers);
userMap = new Map(packedUsers.map(user => [user.id, user]));
}
// -- フォルダ情報の事前取得 --
let folderMap: Map<string, Packed<'DriveFolder'>> | null = null;
if (options?.detail) {
const folders = files
.map(({ folder, folderId }) => folder ?? folderId)
.filter(x => x != null);
const uniqueFolders = uniqueByKey(folders, (folder) => typeof folder === 'string' ? folder : folder.id);
const packedFolders = await this.driveFolderEntityService.packMany(uniqueFolders, { detail: true });
folderMap = new Map(packedFolders.map(folder => [folder.id, folder]));
}
const items = await Promise.all(files.map(f => this.packNullable(
f,
options,
{
packedUser: f.userId ? userMap?.get(f.userId) : undefined,
packedFolder: f.folderId ? folderMap?.get(f.folderId) : undefined,
},
)));
const _user = files.map(({ user, userId }) => user ?? userId).filter(x => x != null);
const _userMap = await this.userEntityService.packMany(_user)
.then(users => new Map(users.map(user => [user.id, user])));
const items = await Promise.all(files.map(f => this.packNullable(f, options, f.userId ? { packedUser: _userMap.get(f.userId) } : {})));
return items.filter(x => x != null);
}
@@ -12,9 +12,6 @@ import type { } from '@/models/Blocking.js';
import type { MiDriveFolder } from '@/models/DriveFolder.js';
import { bindThis } from '@/decorators.js';
import { IdService } from '@/core/IdService.js';
import { In } from 'typeorm';
import { uniqueByKey } from '@/misc/unique-by-key.js';
import { splitIdAndObjects } from '@/misc/split-id-and-objects.js';
@Injectable()
export class DriveFolderEntityService {
@@ -35,20 +32,12 @@ export class DriveFolderEntityService {
options?: {
detail: boolean
},
hint?: {
folderMap?: Map<string, MiDriveFolder>;
foldersCountMap?: Map<string, number> | null;
filesCountMap?: Map<string, number> | null;
parentPacker?: (id: string) => Promise<Packed<'DriveFolder'>>;
},
): Promise<Packed<'DriveFolder'>> {
const opts = Object.assign({
detail: false,
}, options);
const folder = typeof src === 'object'
? src
: hint?.folderMap?.get(src) ?? await this.driveFoldersRepository.findOneByOrFail({ id: src });
const folder = typeof src === 'object' ? src : await this.driveFoldersRepository.findOneByOrFail({ id: src });
return await awaitAll({
id: folder.id,
@@ -57,141 +46,20 @@ export class DriveFolderEntityService {
parentId: folder.parentId,
...(opts.detail ? {
foldersCount: hint?.foldersCountMap?.get(folder.id)
?? this.driveFoldersRepository.countBy({
parentId: folder.id,
}),
filesCount: hint?.filesCountMap?.get(folder.id)
?? this.driveFilesRepository.countBy({
folderId: folder.id,
}),
foldersCount: this.driveFoldersRepository.countBy({
parentId: folder.id,
}),
filesCount: this.driveFilesRepository.countBy({
folderId: folder.id,
}),
...(folder.parentId ? {
parent: hint?.parentPacker
? hint.parentPacker(folder.parentId)
: this.pack(folder.parentId, { detail: true }, hint),
parent: this.pack(folder.parentId, {
detail: true,
}),
} : {}),
} : {}),
});
}
public async packMany(
src: Array<MiDriveFolder['id'] | MiDriveFolder>,
options?: {
detail: boolean
},
): Promise<Array<Packed<'DriveFolder'>>> {
/**
* 重複を除去しつつ、必要なDriveFolderオブジェクトをすべて取得する
*/
const collectUniqueObjects = async (src: Array<MiDriveFolder['id'] | MiDriveFolder>) => {
const uniqueSrc = uniqueByKey(
src,
(s) => typeof s === 'string' ? s : s.id,
);
const { ids, objects } = splitIdAndObjects(uniqueSrc);
const uniqueObjects = new Map<string, MiDriveFolder>(objects.map(s => [s.id, s]));
const needsFetchIds = ids.filter(id => !uniqueObjects.has(id));
if (needsFetchIds.length > 0) {
const fetchedObjects = await this.driveFoldersRepository.find({
where: {
id: In(needsFetchIds),
},
});
for (const obj of fetchedObjects) {
uniqueObjects.set(obj.id, obj);
}
}
return uniqueObjects;
};
/**
* 親フォルダーを再帰的に収集する
*/
const collectAncestors = async (folderMap: Map<string, MiDriveFolder>) => {
for (;;) {
const parentIds = new Set<string>();
for (const folder of folderMap.values()) {
if (folder.parentId != null && !folderMap.has(folder.parentId)) {
parentIds.add(folder.parentId);
}
}
if (parentIds.size === 0) break;
const fetchedParents = await this.driveFoldersRepository.find({
where: {
id: In([...parentIds]),
},
});
if (fetchedParents.length === 0) break;
for (const parent of fetchedParents) {
folderMap.set(parent.id, parent);
}
}
};
const opts = Object.assign({
detail: false,
}, options);
const folderMap = await collectUniqueObjects(src);
let foldersCountMap: Map<string, number> | null = null;
let filesCountMap: Map<string, number> | null = null;
if (opts.detail) {
await collectAncestors(folderMap);
const ids = [...folderMap.keys()];
if (ids.length > 0) {
const folderCounts = await this.driveFoldersRepository.createQueryBuilder('folder')
.select('folder.parentId', 'parentId')
.addSelect('COUNT(*)', 'count')
.where('folder.parentId IN (:...ids)', { ids })
.groupBy('folder.parentId')
.getRawMany<{ parentId: string; count: string }>();
const fileCounts = await this.driveFilesRepository.createQueryBuilder('file')
.select('file.folderId', 'folderId')
.addSelect('COUNT(*)', 'count')
.where('file.folderId IN (:...ids)', { ids })
.groupBy('file.folderId')
.getRawMany<{ folderId: string; count: string }>();
foldersCountMap = new Map(folderCounts.map(row => [row.parentId, Number(row.count)]));
filesCountMap = new Map(fileCounts.map(row => [row.folderId, Number(row.count)]));
} else {
foldersCountMap = new Map();
filesCountMap = new Map();
}
}
const packedMap = new Map<string, Promise<Packed<'DriveFolder'>>>();
const packFromId = (id: string): Promise<Packed<'DriveFolder'>> => {
const cached = packedMap.get(id);
if (cached) return cached;
const folder = folderMap.get(id);
if (!folder) {
throw new Error(`DriveFolder not found: ${id}`);
}
const packedPromise = this.pack(folder, options, {
folderMap,
foldersCountMap,
filesCountMap,
parentPacker: packFromId,
});
packedMap.set(id, packedPromise);
return packedPromise;
};
return Promise.all(src.map(s => packFromId(typeof s === 'string' ? s : s.id)));
}
}
@@ -41,7 +41,7 @@ export class EmojiEntityService {
@bindThis
public packSimpleMany(
emojis: (MiEmoji['id'] | MiEmoji)[],
emojis: any[],
) {
return Promise.all(emojis.map(x => this.packSimple(x)));
}
@@ -69,7 +69,7 @@ export class EmojiEntityService {
@bindThis
public packDetailedMany(
emojis: (MiEmoji['id'] | MiEmoji)[],
emojis: any[],
): Promise<Packed<'EmojiDetailed'>[]> {
return Promise.all(emojis.map(x => this.packDetailed(x)));
}
@@ -55,13 +55,13 @@ export class MetaEntityService {
if (instance.defaultLightTheme) {
try {
defaultLightTheme = JSON.stringify(JSON5.parse(instance.defaultLightTheme));
} catch (_) {
} catch (e) {
}
}
if (instance.defaultDarkTheme) {
try {
defaultDarkTheme = JSON.stringify(JSON5.parse(instance.defaultDarkTheme));
} catch (_) {
} catch (e) {
}
}
@@ -54,7 +54,7 @@ export class NoteReactionEntityService implements OnModuleInit {
packedUser?: Packed<'UserLite'>
},
): Promise<Packed<'NoteReaction'>> {
const _opts = Object.assign({
const opts = Object.assign({
}, options);
const reaction = typeof src === 'object' ? src : await this.noteReactionsRepository.findOneByOrFail({ id: src });
@@ -90,7 +90,7 @@ export class NoteReactionEntityService implements OnModuleInit {
packedUser?: Packed<'UserLite'>
},
): Promise<Packed<'NoteReactionWithNote'>> {
const _opts = Object.assign({
const opts = Object.assign({
}, options);
const reaction = typeof src === 'object' ? src : await this.noteReactionsRepository.findOneByOrFail({ id: src });
+1 -1
View File
@@ -56,7 +56,7 @@ export async function checkWordMute(note: NoteLike, me: UserLike | null | undefi
try {
return new RE2(regexp[1], regexp[2]).test(text);
} catch (_) {
} catch (err) {
// This should never happen due to input sanitisation.
return false;
}
+1 -1
View File
@@ -12,7 +12,7 @@ export function getIpHash(ip: string): string {
// (this means for IPv4 the entire address is used)
const prefix = IPCIDR.createAddress(ip).mask(64);
return 'ip-' + BigInt('0b' + prefix).toString(36);
} catch (_) {
} catch (e) {
const prefix = IPCIDR.createAddress(ip.replace(/:[0-9]+$/, '')).mask(64);
return 'ip-' + BigInt('0b' + prefix).toString(36);
}
+1 -1
View File
@@ -26,7 +26,7 @@ export class I18n<T extends Record<string, any>> {
}
}
return str;
} catch (_) {
} catch (e) {
console.warn(`missing localization '${key}'`);
return key;
}
+2
View File
@@ -262,6 +262,8 @@ type ObjectSchemaTypeDef<p extends Schema> =
never :
any;
type ObjectSchemaType<p extends Schema> = NullOrUndefined<p, ObjectSchemaTypeDef<p>>;
export type SchemaTypeDef<p extends Schema> =
p['type'] extends 'null' ? null :
p['type'] extends 'integer' ? number :
@@ -1,27 +0,0 @@
/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/
/**
* idとオブジェクトを分離する
* @param input idまたはオブジェクトの配列
* @returns idの配列とオブジェクトの配列
*/
export function splitIdAndObjects<T extends { id: string }>(input: (T | string)[]): { ids: string[]; objects: T[] } {
const ids: string[] = [];
const objects : T[] = [];
for (const item of input) {
if (typeof item === 'string') {
ids.push(item);
} else {
objects.push(item);
}
}
return {
ids,
objects,
};
}
@@ -1,21 +0,0 @@
/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/
/**
* itemsの中でkey関数が返す値が重複しないようにした配列を返す
* @param items 重複を除去したい配列
* @param key 重複判定に使うキーを返す関数
* @returns 重複を除去した配列
*/
export function uniqueByKey<TItem, TKey = string>(items: Iterable<TItem>, key: (item: TItem) => TKey): TItem[] {
const map = new Map<TKey, TItem>();
for (const item of items) {
const k = key(item);
if (!map.has(k)) {
map.set(k, item);
}
}
return [...map.values()];
}
@@ -67,7 +67,7 @@ export class MiAbuseReportNotificationRecipient {
/**
* 通知先のユーザ.
*/
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn({ name: 'userId', referencedColumnName: 'id', foreignKeyConstraintName: 'FK_abuse_report_notification_recipient_userId1' })
@@ -76,7 +76,7 @@ export class MiAbuseReportNotificationRecipient {
/**
* 通知先のユーザプロフィール.
*/
@ManyToOne(() => MiUserProfile, {
@ManyToOne(type => MiUserProfile, {
onDelete: 'CASCADE',
})
@JoinColumn({ name: 'userId', referencedColumnName: 'userId', foreignKeyConstraintName: 'FK_abuse_report_notification_recipient_userId2' })
@@ -96,7 +96,7 @@ export class MiAbuseReportNotificationRecipient {
/**
* 通知先のシステムWebhook.
*/
@ManyToOne(() => MiSystemWebhook, {
@ManyToOne(type => MiSystemWebhook, {
onDelete: 'CASCADE',
})
@JoinColumn({ name: 'systemWebhookId', referencedColumnName: 'id', foreignKeyConstraintName: 'FK_abuse_report_notification_recipient_systemWebhookId' })
@@ -18,7 +18,7 @@ export class MiAbuseUserReport {
@Column(id())
public targetUserId: MiUser['id'];
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
@@ -28,7 +28,7 @@ export class MiAbuseUserReport {
@Column(id())
public reporterId: MiUser['id'];
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
@@ -40,7 +40,7 @@ export class MiAbuseUserReport {
})
public assigneeId: MiUser['id'] | null;
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'SET NULL',
})
@JoinColumn()
+2 -2
View File
@@ -41,7 +41,7 @@ export class MiAccessToken {
@Column(id())
public userId: MiUser['id'];
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
@@ -53,7 +53,7 @@ export class MiAccessToken {
})
public appId: MiApp['id'] | null;
@ManyToOne(() => MiApp, {
@ManyToOne(type => MiApp, {
onDelete: 'CASCADE',
})
@JoinColumn()
+1 -1
View File
@@ -79,7 +79,7 @@ export class MiAnnouncement {
})
public userId: MiUser['id'] | null;
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
@@ -18,7 +18,7 @@ export class MiAnnouncementRead {
@Column(id())
public userId: MiUser['id'];
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
@@ -28,7 +28,7 @@ export class MiAnnouncementRead {
@Column(id())
public announcementId: MiAnnouncement['id'];
@ManyToOne(() => MiAnnouncement, {
@ManyToOne(type => MiAnnouncement, {
onDelete: 'CASCADE',
})
@JoinColumn()
+2 -2
View File
@@ -24,7 +24,7 @@ export class MiAntenna {
})
public userId: MiUser['id'];
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
@@ -45,7 +45,7 @@ export class MiAntenna {
})
public userListId: MiUserList['id'] | null;
@ManyToOne(() => MiUserList, {
@ManyToOne(type => MiUserList, {
onDelete: 'CASCADE',
})
@JoinColumn()
+1 -1
View File
@@ -20,7 +20,7 @@ export class MiApp {
})
public userId: MiUser['id'] | null;
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'SET NULL',
nullable: true,
})
+2 -2
View File
@@ -25,7 +25,7 @@ export class MiAuthSession {
})
public userId: MiUser['id'] | null;
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
nullable: true,
})
@@ -35,7 +35,7 @@ export class MiAuthSession {
@Column(id())
public appId: MiApp['id'];
@ManyToOne(() => MiApp, {
@ManyToOne(type => MiApp, {
onDelete: 'CASCADE',
})
@JoinColumn()
+2 -2
View File
@@ -20,7 +20,7 @@ export class MiBlocking {
})
public blockeeId: MiUser['id'];
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
@@ -33,7 +33,7 @@ export class MiBlocking {
})
public blockerId: MiUser['id'];
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
@@ -18,7 +18,7 @@ export class MiBubbleGameRecord {
})
public userId: MiUser['id'];
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
+2 -2
View File
@@ -27,7 +27,7 @@ export class MiChannel {
})
public userId: MiUser['id'] | null;
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'SET NULL',
})
@JoinColumn()
@@ -52,7 +52,7 @@ export class MiChannel {
})
public bannerId: MiDriveFile['id'] | null;
@ManyToOne(() => MiDriveFile, {
@ManyToOne(type => MiDriveFile, {
onDelete: 'SET NULL',
})
@JoinColumn()
@@ -20,7 +20,7 @@ export class MiChannelFavorite {
})
public channelId: MiChannel['id'];
@ManyToOne(() => MiChannel, {
@ManyToOne(type => MiChannel, {
onDelete: 'CASCADE',
})
@JoinColumn()
@@ -32,7 +32,7 @@ export class MiChannelFavorite {
})
public userId: MiUser['id'];
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
@@ -21,7 +21,7 @@ export class MiChannelFollowing {
})
public followeeId: MiChannel['id'];
@ManyToOne(() => MiChannel, {
@ManyToOne(type => MiChannel, {
onDelete: 'CASCADE',
})
@JoinColumn()
@@ -34,7 +34,7 @@ export class MiChannelFollowing {
})
public followerId: MiUser['id'];
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
+2 -2
View File
@@ -20,7 +20,7 @@ export class MiChannelMuting {
})
public userId: MiUser['id'];
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
@@ -32,7 +32,7 @@ export class MiChannelMuting {
})
public channelId: MiChannel['id'];
@ManyToOne(() => MiChannel, {
@ManyToOne(type => MiChannel, {
onDelete: 'CASCADE',
})
@JoinColumn()
+2 -2
View File
@@ -19,7 +19,7 @@ export class MiChatApproval {
})
public userId: MiUser['id'];
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
@@ -31,7 +31,7 @@ export class MiChatApproval {
})
public otherId: MiUser['id'];
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
+4 -4
View File
@@ -20,7 +20,7 @@ export class MiChatMessage {
})
public fromUserId: MiUser['id'];
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
@@ -32,7 +32,7 @@ export class MiChatMessage {
})
public toUserId: MiUser['id'] | null;
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
@@ -44,7 +44,7 @@ export class MiChatMessage {
})
public toRoomId: MiChatRoom['id'] | null;
@ManyToOne(() => MiChatRoom, {
@ManyToOne(type => MiChatRoom, {
onDelete: 'CASCADE',
})
@JoinColumn()
@@ -72,7 +72,7 @@ export class MiChatMessage {
})
public fileId: MiDriveFile['id'] | null;
@ManyToOne(() => MiDriveFile, {
@ManyToOne(type => MiDriveFile, {
onDelete: 'SET NULL',
})
@JoinColumn()
+1 -1
View File
@@ -23,7 +23,7 @@ export class MiChatRoom {
})
public ownerId: MiUser['id'];
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
@@ -20,7 +20,7 @@ export class MiChatRoomInvitation {
})
public userId: MiUser['id'];
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
@@ -32,7 +32,7 @@ export class MiChatRoomInvitation {
})
public roomId: MiChatRoom['id'];
@ManyToOne(() => MiChatRoom, {
@ManyToOne(type => MiChatRoom, {
onDelete: 'CASCADE',
})
@JoinColumn()
@@ -20,7 +20,7 @@ export class MiChatRoomMembership {
})
public userId: MiUser['id'];
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
@@ -32,7 +32,7 @@ export class MiChatRoomMembership {
})
public roomId: MiChatRoom['id'];
@ManyToOne(() => MiChatRoom, {
@ManyToOne(type => MiChatRoom, {
onDelete: 'CASCADE',
})
@JoinColumn()
+1 -1
View File
@@ -25,7 +25,7 @@ export class MiClip {
})
public userId: MiUser['id'];
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
+2 -2
View File
@@ -18,7 +18,7 @@ export class MiClipFavorite {
@Column(id())
public userId: MiUser['id'];
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
@@ -27,7 +27,7 @@ export class MiClipFavorite {
@Column(id())
public clipId: MiClip['id'];
@ManyToOne(() => MiClip, {
@ManyToOne(type => MiClip, {
onDelete: 'CASCADE',
})
@JoinColumn()
+2 -2
View File
@@ -21,7 +21,7 @@ export class MiClipNote {
})
public noteId: MiNote['id'];
@ManyToOne(() => MiNote, {
@ManyToOne(type => MiNote, {
onDelete: 'CASCADE',
})
@JoinColumn()
@@ -34,7 +34,7 @@ export class MiClipNote {
})
public clipId: MiClip['id'];
@ManyToOne(() => MiClip, {
@ManyToOne(type => MiClip, {
onDelete: 'CASCADE',
})
@JoinColumn()
+2 -2
View File
@@ -22,7 +22,7 @@ export class MiDriveFile {
})
public userId: MiUser['id'] | null;
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'SET NULL',
})
@JoinColumn()
@@ -142,7 +142,7 @@ export class MiDriveFile {
})
public folderId: MiDriveFolder['id'] | null;
@ManyToOne(() => MiDriveFolder, {
@ManyToOne(type => MiDriveFolder, {
onDelete: 'SET NULL',
})
@JoinColumn()
+2 -2
View File
@@ -26,7 +26,7 @@ export class MiDriveFolder {
})
public userId: MiUser['id'] | null;
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
@@ -40,7 +40,7 @@ export class MiDriveFolder {
})
public parentId: MiDriveFolder['id'] | null;
@ManyToOne(() => MiDriveFolder, {
@ManyToOne(type => MiDriveFolder, {
onDelete: 'SET NULL',
})
@JoinColumn()
+1 -1
View File
@@ -38,7 +38,7 @@ export class MiFlash {
})
public userId: MiUser['id'];
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
+2 -2
View File
@@ -18,7 +18,7 @@ export class MiFlashLike {
@Column(id())
public userId: MiUser['id'];
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
@@ -27,7 +27,7 @@ export class MiFlashLike {
@Column(id())
public flashId: MiFlash['id'];
@ManyToOne(() => MiFlash, {
@ManyToOne(type => MiFlash, {
onDelete: 'CASCADE',
})
@JoinColumn()
+2 -2
View File
@@ -20,7 +20,7 @@ export class MiFollowRequest {
})
public followeeId: MiUser['id'];
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
@@ -33,7 +33,7 @@ export class MiFollowRequest {
})
public followerId: MiUser['id'];
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
+2 -2
View File
@@ -21,7 +21,7 @@ export class MiFollowing {
})
public followeeId: MiUser['id'];
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
@@ -34,7 +34,7 @@ export class MiFollowing {
})
public followerId: MiUser['id'];
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
+2 -2
View File
@@ -18,7 +18,7 @@ export class MiGalleryLike {
@Column(id())
public userId: MiUser['id'];
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
@@ -27,7 +27,7 @@ export class MiGalleryLike {
@Column(id())
public postId: MiGalleryPost['id'];
@ManyToOne(() => MiGalleryPost, {
@ManyToOne(type => MiGalleryPost, {
onDelete: 'CASCADE',
})
@JoinColumn()
+1 -1
View File
@@ -36,7 +36,7 @@ export class MiGalleryPost {
})
public userId: MiUser['id'];
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
+1 -1
View File
@@ -21,7 +21,7 @@ export class MiMeta {
})
public rootUserId: MiUser['id'] | null;
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'SET NULL',
nullable: true,
})
+1 -1
View File
@@ -16,7 +16,7 @@ export class MiModerationLog {
@Column(id())
public userId: MiUser['id'];
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
+2 -2
View File
@@ -26,7 +26,7 @@ export class MiMuting {
})
public muteeId: MiUser['id'];
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
@@ -39,7 +39,7 @@ export class MiMuting {
})
public muterId: MiUser['id'];
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
+4 -4
View File
@@ -35,7 +35,7 @@ export class MiNote {
})
public replyId: MiNote['id'] | null;
@ManyToOne(() => MiNote, {
@ManyToOne(type => MiNote, {
createForeignKeyConstraints: false,
})
@JoinColumn()
@@ -49,7 +49,7 @@ export class MiNote {
})
public renoteId: MiNote['id'] | null;
@ManyToOne(() => MiNote, {
@ManyToOne(type => MiNote, {
createForeignKeyConstraints: false,
})
@JoinColumn()
@@ -83,7 +83,7 @@ export class MiNote {
})
public userId: MiUser['id'];
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
@@ -208,7 +208,7 @@ export class MiNote {
})
public channelId: MiChannel['id'] | null;
@ManyToOne(() => MiChannel, {
@ManyToOne(type => MiChannel, {
onDelete: 'CASCADE',
})
@JoinColumn()
+4 -4
View File
@@ -27,7 +27,7 @@ export class MiNoteDraft {
public replyId: MiNote['id'] | null;
// There is a possibility that replyId is not null but reply is null when the reply note is deleted.
@ManyToOne(() => MiNote, {
@ManyToOne(type => MiNote, {
createForeignKeyConstraints: false,
})
@JoinColumn()
@@ -42,7 +42,7 @@ export class MiNoteDraft {
public renoteId: MiNote['id'] | null;
// There is a possibility that renoteId is not null but renote is null when the renote note is deleted.
@ManyToOne(() => MiNote, {
@ManyToOne(type => MiNote, {
createForeignKeyConstraints: false,
})
@JoinColumn()
@@ -66,7 +66,7 @@ export class MiNoteDraft {
})
public userId: MiUser['id'];
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
@@ -120,7 +120,7 @@ export class MiNoteDraft {
// There is a possibility that channelId is not null but channel is null when the channel is deleted.
// (deleting channel is not implemented so it's not happening now but may happen in the future)
@ManyToOne(() => MiChannel, {
@ManyToOne(type => MiChannel, {
createForeignKeyConstraints: false,
})
@JoinColumn()
+2 -2
View File
@@ -18,7 +18,7 @@ export class MiNoteFavorite {
@Column(id())
public userId: MiUser['id'];
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
@@ -27,7 +27,7 @@ export class MiNoteFavorite {
@Column(id())
public noteId: MiNote['id'];
@ManyToOne(() => MiNote, {
@ManyToOne(type => MiNote, {
onDelete: 'CASCADE',
})
@JoinColumn()
+2 -2
View File
@@ -18,7 +18,7 @@ export class MiNoteReaction {
@Column(id())
public userId: MiUser['id'];
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
@@ -28,7 +28,7 @@ export class MiNoteReaction {
@Column(id())
public noteId: MiNote['id'];
@ManyToOne(() => MiNote, {
@ManyToOne(type => MiNote, {
onDelete: 'CASCADE',
})
@JoinColumn()
@@ -19,7 +19,7 @@ export class MiNoteThreadMuting {
})
public userId: MiUser['id'];
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
+2 -2
View File
@@ -56,7 +56,7 @@ export class MiPage {
})
public userId: MiUser['id'];
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
@@ -68,7 +68,7 @@ export class MiPage {
})
public eyeCatchingImageId: MiDriveFile['id'] | null;
@ManyToOne(() => MiDriveFile, {
@ManyToOne(type => MiDriveFile, {
onDelete: 'SET NULL',
})
@JoinColumn()
+2 -2
View File
@@ -18,7 +18,7 @@ export class MiPageLike {
@Column(id())
public userId: MiUser['id'];
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
@@ -27,7 +27,7 @@ export class MiPageLike {
@Column(id())
public pageId: MiPage['id'];
@ManyToOne(() => MiPage, {
@ManyToOne(type => MiPage, {
onDelete: 'CASCADE',
})
@JoinColumn()
@@ -24,7 +24,7 @@ export class MiPasswordResetRequest {
})
public userId: MiUser['id'];
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
+1 -1
View File
@@ -15,7 +15,7 @@ export class MiPoll {
@PrimaryColumn(id())
public noteId: MiNote['id'];
@OneToOne(() => MiNote, {
@OneToOne(type => MiNote, {
onDelete: 'CASCADE',
})
@JoinColumn()
+2 -2
View File
@@ -18,7 +18,7 @@ export class MiPollVote {
@Column(id())
public userId: MiUser['id'];
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
@@ -28,7 +28,7 @@ export class MiPollVote {
@Column(id())
public noteId: MiNote['id'];
@ManyToOne(() => MiNote, {
@ManyToOne(type => MiNote, {
onDelete: 'CASCADE',
})
@JoinColumn()
+1 -1
View File
@@ -13,7 +13,7 @@ export class MiPromoNote {
@PrimaryColumn(id())
public noteId: MiNote['id'];
@OneToOne(() => MiNote, {
@OneToOne(type => MiNote, {
onDelete: 'CASCADE',
})
@JoinColumn()
+2 -2
View File
@@ -18,7 +18,7 @@ export class MiPromoRead {
@Column(id())
public userId: MiUser['id'];
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
@@ -27,7 +27,7 @@ export class MiPromoRead {
@Column(id())
public noteId: MiNote['id'];
@ManyToOne(() => MiNote, {
@ManyToOne(type => MiNote, {
onDelete: 'CASCADE',
})
@JoinColumn()
@@ -23,7 +23,7 @@ export class MiRegistrationTicket {
})
public expiresAt: Date | null;
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
@@ -36,7 +36,7 @@ export class MiRegistrationTicket {
})
public createdById: MiUser['id'] | null;
@OneToOne(() => MiUser, {
@OneToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
+1 -1
View File
@@ -25,7 +25,7 @@ export class MiRegistryItem {
})
public userId: MiUser['id'];
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
+2 -2
View File
@@ -20,7 +20,7 @@ export class MiRenoteMuting {
})
public muteeId: MiUser['id'];
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
@@ -33,7 +33,7 @@ export class MiRenoteMuting {
})
public muterId: MiUser['id'];
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
+2 -2
View File
@@ -27,7 +27,7 @@ export class MiReversiGame {
@Column(id())
public user1Id: MiUser['id'];
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
@@ -36,7 +36,7 @@ export class MiReversiGame {
@Column(id())
public user2Id: MiUser['id'];
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
@@ -21,7 +21,7 @@ export class MiRoleAssignment {
})
public userId: MiUser['id'];
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
@@ -34,7 +34,7 @@ export class MiRoleAssignment {
})
public roleId: MiRole['id'];
@ManyToOne(() => MiRole, {
@ManyToOne(type => MiRole, {
onDelete: 'CASCADE',
})
@JoinColumn()
+1 -1
View File
@@ -16,7 +16,7 @@ export class MiSignin {
@Column(id())
public userId: MiUser['id'];
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
@@ -16,7 +16,7 @@ export class MiSwSubscription {
@Column(id())
public userId: MiUser['id'];
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
+1 -1
View File
@@ -18,7 +18,7 @@ export class MiSystemAccount {
@Column(id())
public userId: MiUser['id'];
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
+2 -2
View File
@@ -99,7 +99,7 @@ export class MiUser {
})
public avatarId: MiDriveFile['id'] | null;
@OneToOne(() => MiDriveFile, {
@OneToOne(type => MiDriveFile, {
onDelete: 'SET NULL',
})
@JoinColumn()
@@ -112,7 +112,7 @@ export class MiUser {
})
public bannerId: MiDriveFile['id'] | null;
@OneToOne(() => MiDriveFile, {
@OneToOne(type => MiDriveFile, {
onDelete: 'SET NULL',
})
@JoinColumn()
+1 -1
View File
@@ -12,7 +12,7 @@ export class MiUserKeypair {
@PrimaryColumn(id())
public userId: MiUser['id'];
@OneToOne(() => MiUser, {
@OneToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
+1 -1
View File
@@ -25,7 +25,7 @@ export class MiUserList {
})
public isPublic: boolean;
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
@@ -18,7 +18,7 @@ export class MiUserListFavorite {
@Column(id())
public userId: MiUser['id'];
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
@@ -27,7 +27,7 @@ export class MiUserListFavorite {
@Column(id())
public userListId: MiUserList['id'];
@ManyToOne(() => MiUserList, {
@ManyToOne(type => MiUserList, {
onDelete: 'CASCADE',
})
@JoinColumn()
@@ -21,7 +21,7 @@ export class MiUserListMembership {
})
public userId: MiUser['id'];
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
@@ -34,7 +34,7 @@ export class MiUserListMembership {
})
public userListId: MiUserList['id'];
@ManyToOne(() => MiUserList, {
@ManyToOne(type => MiUserList, {
onDelete: 'CASCADE',
})
@JoinColumn()
+2 -2
View File
@@ -20,7 +20,7 @@ export class MiUserMemo {
})
public userId: MiUser['id'];
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
@@ -33,7 +33,7 @@ export class MiUserMemo {
})
public targetUserId: MiUser['id'];
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
@@ -18,7 +18,7 @@ export class MiUserNotePining {
@Column(id())
public userId: MiUser['id'];
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
@@ -27,7 +27,7 @@ export class MiUserNotePining {
@Column(id())
public noteId: MiNote['id'];
@ManyToOne(() => MiNote, {
@ManyToOne(type => MiNote, {
onDelete: 'CASCADE',
})
@JoinColumn()
+2 -2
View File
@@ -17,7 +17,7 @@ export class MiUserProfile {
@PrimaryColumn(id())
public userId: MiUser['id'];
@OneToOne(() => MiUser, {
@OneToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
@@ -215,7 +215,7 @@ export class MiUserProfile {
})
public pinnedPageId: MiPage['id'] | null;
@OneToOne(() => MiPage, {
@OneToOne(type => MiPage, {
onDelete: 'SET NULL',
})
@JoinColumn()
+1 -1
View File
@@ -12,7 +12,7 @@ export class MiUserPublickey {
@PrimaryColumn(id())
public userId: MiUser['id'];
@OneToOne(() => MiUser, {
@OneToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
@@ -18,7 +18,7 @@ export class MiUserSecurityKey {
@Column(id())
public userId: MiUser['id'];
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
+1 -1
View File
@@ -22,7 +22,7 @@ export class MiWebhook {
})
public userId: MiUser['id'];
@ManyToOne(() => MiUser, {
@ManyToOne(type => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
@@ -618,9 +618,6 @@ export const packedMeDetailedOnlySchema = {
achievementEarned: { optional: true, ...notificationRecieveConfig },
app: { optional: true, ...notificationRecieveConfig },
test: { optional: true, ...notificationRecieveConfig },
login: { optional: true, ...notificationRecieveConfig },
createToken: { optional: true, ...notificationRecieveConfig },
exportCompleted: { optional: true, ...notificationRecieveConfig },
},
},
emailNotificationTypes: {

Some files were not shown because too many files have changed in this diff Show More