chore: 🚨 Linting

This commit is contained in:
ThatOneCalculator 2023-09-01 16:56:57 -07:00
parent 788b979734
commit 2e922c0a69
No known key found for this signature in database
GPG key ID: 8703CACD01000000
766 changed files with 3475 additions and 3587 deletions

View file

@ -14,7 +14,7 @@ const merge = (...args) =>
...c,
...Object.entries(a)
.filter(([k]) => c && typeof c[k] === "object")
.reduce((a, [k, v]) => ((a[k] = merge(v, c[k])), a), {}),
.reduce((a, [k, v]) => (a[k] === merge(v, c[k]), a), {}),
}),
{},
);
@ -26,7 +26,7 @@ fs.readdirSync(__dirname).forEach((file) => {
}
});
fs.readdirSync(__dirname + "/../custom/locales").forEach((file) => {
fs.readdirSync(`${__dirname}/../custom/locales`).forEach((file) => {
if (file.includes(".yml")) {
file = file.slice(0, file.indexOf("."));
languages_custom.push(file);
@ -45,21 +45,20 @@ const clean = (text) =>
const locales = languages.reduce(
(a, c) => (
(a[c] =
yaml.load(clean(fs.readFileSync(`${__dirname}/${c}.yml`, "utf-8"))) ||
{}),
a[c] ===
yaml.load(clean(fs.readFileSync(`${__dirname}/${c}.yml`, "utf-8"))) || {},
a
),
{},
);
const locales_custom = languages_custom.reduce(
(a, c) => (
(a[c] =
a[c] ===
yaml.load(
clean(
fs.readFileSync(`${__dirname}/../custom/locales/${c}.yml`, "utf-8"),
),
) || {}),
) || {},
a
),
{},
@ -68,23 +67,24 @@ Object.assign(locales, locales_custom);
module.exports = Object.entries(locales).reduce(
(a, [k, v]) => (
(a[k] = (() => {
const [lang] = k.split("-");
switch (k) {
case "en-US":
return v;
case "ja-JP":
case "ja-KS":
return merge(locales["en-US"], v);
default:
return merge(
locales["en-US"],
locales["ja-JP"],
locales[`${lang}-${primaries[lang]}`] || {},
v,
);
}
})()),
a[k] ===
(() => {
const [lang] = k.split("-");
switch (k) {
case "en-US":
return v;
case "ja-JP":
case "ja-KS":
return merge(locales["en-US"], v);
default:
return merge(
locales["en-US"],
locales["ja-JP"],
locales[`${lang}-${primaries[lang]}`] || {},
v,
);
}
})(),
a
),
{},

View file

@ -4,11 +4,11 @@ export class convertHardMutes1644010796173 {
name = "convertHardMutes1644010796173";
async up(queryRunner) {
let entries = await queryRunner.query(
const entries = await queryRunner.query(
`SELECT "userId", "mutedWords" FROM "user_profile" WHERE "userHost" IS NULL`,
);
for (let i = 0; i < entries.length; i++) {
let words = entries[i].mutedWords
const words = entries[i].mutedWords
.map((line) => {
if (typeof line === "string") return [];
const regexp = line.join(" ").match(/^\/(.+)\/(.*)$/);
@ -41,11 +41,11 @@ export class convertHardMutes1644010796173 {
}
async down(queryRunner) {
let entries = await queryRunner.query(
const entries = await queryRunner.query(
`SELECT "userId", "mutedWords" FROM "user_profile"`,
);
for (let i = 0; i < entries.length; i++) {
let words = entries[i].mutedWords
const words = entries[i].mutedWords
.map((line) => {
if (Array.isArray(line)) {
return line;

View file

@ -5,7 +5,7 @@ export class uniformThemecolor1652859567549 {
async up(queryRunner) {
const formatColor = (color) => {
let tc = new tinycolor(color);
const tc = new tinycolor(color);
if (tc.isValid()) {
return tc.toHexString();
} else {

View file

@ -47,6 +47,6 @@ export class noteRepliesFunction1658656633972 {
}
async down(queryRunner) {
await queryRunner.query(`DROP FUNCTION note_replies`);
await queryRunner.query("DROP FUNCTION note_replies");
}
}

View file

@ -12,7 +12,7 @@ export class addFkAbuseUserReportTargetUserIdToUserId1671199573000 {
async down(queryRunner) {
await queryRunner.query(
`ALTER TABLE abuse_user_report DROP CONSTRAINT fk_7f4e851a35d81b64dda28eee0`,
"ALTER TABLE abuse_user_report DROP CONSTRAINT fk_7f4e851a35d81b64dda28eee0",
);
}
}

View file

@ -4,22 +4,22 @@ export class CleanCharts1680375641101 {
}
async up(queryRunner) {
await queryRunner.query(
`delete from __chart__hashtag where ___local_users = 0 and ___remote_users = 0;`,
"delete from __chart__hashtag where ___local_users = 0 and ___remote_users = 0;",
);
await queryRunner.query(
`delete from __chart_day__hashtag where ___local_users = 0 and ___remote_users = 0;`,
"delete from __chart_day__hashtag where ___local_users = 0 and ___remote_users = 0;",
);
await queryRunner.query(`COMMIT;`);
await queryRunner.query(`vacuum __chart__hashtag;`);
await queryRunner.query(`vacuum __chart_day__hashtag;`);
await queryRunner.query(`COMMIT;`);
await queryRunner.query("COMMIT;");
await queryRunner.query("vacuum __chart__hashtag;");
await queryRunner.query("vacuum __chart_day__hashtag;");
await queryRunner.query("COMMIT;");
}
async down(queryRunner) {
await queryRunner.query(
`delete from __chart__hashtag where ___local_users = 0 and ___remote_users = 0;`,
"delete from __chart__hashtag where ___local_users = 0 and ___remote_users = 0;",
);
await queryRunner.query(
`delete from __chart_day__hashtag where ___local_users = 0 and ___remote_users = 0;`,
"delete from __chart_day__hashtag where ___local_users = 0 and ___remote_users = 0;",
);
}
}

View file

@ -1,18 +1,12 @@
{
"name": "native-utils-android-arm-eabi",
"version": "0.0.0",
"os": [
"android"
],
"cpu": [
"arm"
],
"main": "native-utils.android-arm-eabi.node",
"files": [
"native-utils.android-arm-eabi.node"
],
"license": "MIT",
"engines": {
"node": ">= 10"
}
}
"name": "native-utils-android-arm-eabi",
"version": "0.0.0",
"os": ["android"],
"cpu": ["arm"],
"main": "native-utils.android-arm-eabi.node",
"files": ["native-utils.android-arm-eabi.node"],
"license": "MIT",
"engines": {
"node": ">= 10"
}
}

View file

@ -1,18 +1,12 @@
{
"name": "native-utils-android-arm64",
"version": "0.0.0",
"os": [
"android"
],
"cpu": [
"arm64"
],
"main": "native-utils.android-arm64.node",
"files": [
"native-utils.android-arm64.node"
],
"license": "MIT",
"engines": {
"node": ">= 10"
}
}
"name": "native-utils-android-arm64",
"version": "0.0.0",
"os": ["android"],
"cpu": ["arm64"],
"main": "native-utils.android-arm64.node",
"files": ["native-utils.android-arm64.node"],
"license": "MIT",
"engines": {
"node": ">= 10"
}
}

View file

@ -1,18 +1,12 @@
{
"name": "native-utils-darwin-arm64",
"version": "0.0.0",
"os": [
"darwin"
],
"cpu": [
"arm64"
],
"main": "native-utils.darwin-arm64.node",
"files": [
"native-utils.darwin-arm64.node"
],
"license": "MIT",
"engines": {
"node": ">= 10"
}
}
"name": "native-utils-darwin-arm64",
"version": "0.0.0",
"os": ["darwin"],
"cpu": ["arm64"],
"main": "native-utils.darwin-arm64.node",
"files": ["native-utils.darwin-arm64.node"],
"license": "MIT",
"engines": {
"node": ">= 10"
}
}

View file

@ -1,15 +1,11 @@
{
"name": "native-utils-darwin-universal",
"version": "0.0.0",
"os": [
"darwin"
],
"main": "native-utils.darwin-universal.node",
"files": [
"native-utils.darwin-universal.node"
],
"license": "MIT",
"engines": {
"node": ">= 10"
}
}
"name": "native-utils-darwin-universal",
"version": "0.0.0",
"os": ["darwin"],
"main": "native-utils.darwin-universal.node",
"files": ["native-utils.darwin-universal.node"],
"license": "MIT",
"engines": {
"node": ">= 10"
}
}

View file

@ -1,18 +1,12 @@
{
"name": "native-utils-darwin-x64",
"version": "0.0.0",
"os": [
"darwin"
],
"cpu": [
"x64"
],
"main": "native-utils.darwin-x64.node",
"files": [
"native-utils.darwin-x64.node"
],
"license": "MIT",
"engines": {
"node": ">= 10"
}
}
"name": "native-utils-darwin-x64",
"version": "0.0.0",
"os": ["darwin"],
"cpu": ["x64"],
"main": "native-utils.darwin-x64.node",
"files": ["native-utils.darwin-x64.node"],
"license": "MIT",
"engines": {
"node": ">= 10"
}
}

View file

@ -1,18 +1,12 @@
{
"name": "native-utils-freebsd-x64",
"version": "0.0.0",
"os": [
"freebsd"
],
"cpu": [
"x64"
],
"main": "native-utils.freebsd-x64.node",
"files": [
"native-utils.freebsd-x64.node"
],
"license": "MIT",
"engines": {
"node": ">= 10"
}
}
"name": "native-utils-freebsd-x64",
"version": "0.0.0",
"os": ["freebsd"],
"cpu": ["x64"],
"main": "native-utils.freebsd-x64.node",
"files": ["native-utils.freebsd-x64.node"],
"license": "MIT",
"engines": {
"node": ">= 10"
}
}

View file

@ -1,18 +1,12 @@
{
"name": "native-utils-linux-arm-gnueabihf",
"version": "0.0.0",
"os": [
"linux"
],
"cpu": [
"arm"
],
"main": "native-utils.linux-arm-gnueabihf.node",
"files": [
"native-utils.linux-arm-gnueabihf.node"
],
"license": "MIT",
"engines": {
"node": ">= 10"
}
}
"name": "native-utils-linux-arm-gnueabihf",
"version": "0.0.0",
"os": ["linux"],
"cpu": ["arm"],
"main": "native-utils.linux-arm-gnueabihf.node",
"files": ["native-utils.linux-arm-gnueabihf.node"],
"license": "MIT",
"engines": {
"node": ">= 10"
}
}

View file

@ -1,21 +1,13 @@
{
"name": "native-utils-linux-arm64-gnu",
"version": "0.0.0",
"os": [
"linux"
],
"cpu": [
"arm64"
],
"main": "native-utils.linux-arm64-gnu.node",
"files": [
"native-utils.linux-arm64-gnu.node"
],
"license": "MIT",
"engines": {
"node": ">= 10"
},
"libc": [
"glibc"
]
}
"name": "native-utils-linux-arm64-gnu",
"version": "0.0.0",
"os": ["linux"],
"cpu": ["arm64"],
"main": "native-utils.linux-arm64-gnu.node",
"files": ["native-utils.linux-arm64-gnu.node"],
"license": "MIT",
"engines": {
"node": ">= 10"
},
"libc": ["glibc"]
}

View file

@ -1,21 +1,13 @@
{
"name": "native-utils-linux-arm64-musl",
"version": "0.0.0",
"os": [
"linux"
],
"cpu": [
"arm64"
],
"main": "native-utils.linux-arm64-musl.node",
"files": [
"native-utils.linux-arm64-musl.node"
],
"license": "MIT",
"engines": {
"node": ">= 10"
},
"libc": [
"musl"
]
}
"name": "native-utils-linux-arm64-musl",
"version": "0.0.0",
"os": ["linux"],
"cpu": ["arm64"],
"main": "native-utils.linux-arm64-musl.node",
"files": ["native-utils.linux-arm64-musl.node"],
"license": "MIT",
"engines": {
"node": ">= 10"
},
"libc": ["musl"]
}

View file

@ -1,21 +1,13 @@
{
"name": "native-utils-linux-x64-gnu",
"version": "0.0.0",
"os": [
"linux"
],
"cpu": [
"x64"
],
"main": "native-utils.linux-x64-gnu.node",
"files": [
"native-utils.linux-x64-gnu.node"
],
"license": "MIT",
"engines": {
"node": ">= 10"
},
"libc": [
"glibc"
]
}
"name": "native-utils-linux-x64-gnu",
"version": "0.0.0",
"os": ["linux"],
"cpu": ["x64"],
"main": "native-utils.linux-x64-gnu.node",
"files": ["native-utils.linux-x64-gnu.node"],
"license": "MIT",
"engines": {
"node": ">= 10"
},
"libc": ["glibc"]
}

View file

@ -1,21 +1,13 @@
{
"name": "native-utils-linux-x64-musl",
"version": "0.0.0",
"os": [
"linux"
],
"cpu": [
"x64"
],
"main": "native-utils.linux-x64-musl.node",
"files": [
"native-utils.linux-x64-musl.node"
],
"license": "MIT",
"engines": {
"node": ">= 10"
},
"libc": [
"musl"
]
}
"name": "native-utils-linux-x64-musl",
"version": "0.0.0",
"os": ["linux"],
"cpu": ["x64"],
"main": "native-utils.linux-x64-musl.node",
"files": ["native-utils.linux-x64-musl.node"],
"license": "MIT",
"engines": {
"node": ">= 10"
},
"libc": ["musl"]
}

View file

@ -1,18 +1,12 @@
{
"name": "native-utils-win32-arm64-msvc",
"version": "0.0.0",
"os": [
"win32"
],
"cpu": [
"arm64"
],
"main": "native-utils.win32-arm64-msvc.node",
"files": [
"native-utils.win32-arm64-msvc.node"
],
"license": "MIT",
"engines": {
"node": ">= 10"
}
}
"name": "native-utils-win32-arm64-msvc",
"version": "0.0.0",
"os": ["win32"],
"cpu": ["arm64"],
"main": "native-utils.win32-arm64-msvc.node",
"files": ["native-utils.win32-arm64-msvc.node"],
"license": "MIT",
"engines": {
"node": ">= 10"
}
}

View file

@ -1,18 +1,12 @@
{
"name": "native-utils-win32-ia32-msvc",
"version": "0.0.0",
"os": [
"win32"
],
"cpu": [
"ia32"
],
"main": "native-utils.win32-ia32-msvc.node",
"files": [
"native-utils.win32-ia32-msvc.node"
],
"license": "MIT",
"engines": {
"node": ">= 10"
}
}
"name": "native-utils-win32-ia32-msvc",
"version": "0.0.0",
"os": ["win32"],
"cpu": ["ia32"],
"main": "native-utils.win32-ia32-msvc.node",
"files": ["native-utils.win32-ia32-msvc.node"],
"license": "MIT",
"engines": {
"node": ">= 10"
}
}

View file

@ -1,18 +1,12 @@
{
"name": "native-utils-win32-x64-msvc",
"version": "0.0.0",
"os": [
"win32"
],
"cpu": [
"x64"
],
"main": "native-utils.win32-x64-msvc.node",
"files": [
"native-utils.win32-x64-msvc.node"
],
"license": "MIT",
"engines": {
"node": ">= 10"
}
}
"name": "native-utils-win32-x64-msvc",
"version": "0.0.0",
"os": ["win32"],
"cpu": ["x64"],
"main": "native-utils.win32-x64-msvc.node",
"files": ["native-utils.win32-x64-msvc.node"],
"license": "MIT",
"engines": {
"node": ">= 10"
}
}

View file

@ -5,11 +5,11 @@ import Xev from "xev";
import Logger from "@/services/logger.js";
import { envOption } from "../env.js";
import os from "node:os";
// for typeorm
import "reflect-metadata";
import { masterMain } from "./master.js";
import { workerMain } from "./worker.js";
import os from "node:os";
const logger = new Logger("core", "cyan");
const clusterLogger = logger.createSubLogger("cluster", "orange", false);

View file

@ -1,19 +1,19 @@
import * as fs from "node:fs";
import { fileURLToPath } from "node:url";
import { dirname } from "node:path";
import * as os from "node:os";
import cluster from "node:cluster";
import * as fs from "node:fs";
import * as os from "node:os";
import { dirname } from "node:path";
import { fileURLToPath } from "node:url";
import chalk from "chalk";
import chalkTemplate from "chalk-template";
import semver from "semver";
import Logger from "@/services/logger.js";
import loadConfig from "@/config/load.js";
import type { Config } from "@/config/types.js";
import { lessThan } from "@/prelude/array.js";
import { envOption } from "../env.js";
import { showMachineInfo } from "@/misc/show-machine-info.js";
import { lessThan } from "@/prelude/array.js";
import Logger from "@/services/logger.js";
import { db, initDb } from "../db/postgre.js";
import { envOption } from "../env.js";
const _filename = fileURLToPath(import.meta.url);
const _dirname = dirname(_filename);

View file

@ -1,6 +1,6 @@
import cluster from "node:cluster";
import { initDb } from "../db/postgre.js";
import config from "@/config/index.js";
import { initDb } from "../db/postgre.js";
/**
* Init worker process
@ -18,6 +18,6 @@ export async function workerMain() {
if (cluster.isWorker) {
// Send a 'ready' message to parent process
process.send!("ready");
process.send?.("ready");
}
}

View file

@ -3,10 +3,10 @@
*/
import * as fs from "node:fs";
import { fileURLToPath } from "node:url";
import { dirname } from "node:path";
import { fileURLToPath } from "node:url";
import * as yaml from "js-yaml";
import type { Source, Mixin } from "./types.js";
import type { Mixin, Source } from "./types.js";
const _filename = fileURLToPath(import.meta.url);
const _dirname = dirname(_filename);

View file

@ -1,7 +1,7 @@
import config from "@/config/index.js";
import {
DB_MAX_NOTE_TEXT_LENGTH,
DB_MAX_IMAGE_COMMENT_LENGTH,
DB_MAX_NOTE_TEXT_LENGTH,
} from "@/misc/hard-limits.js";
export const MAX_NOTE_TEXT_LENGTH = Math.min(

View file

@ -1,7 +1,7 @@
import { fetchMeta } from "@/misc/fetch-meta.js";
import * as osUtils from "os-utils";
import si from "systeminformation";
import Xev from "xev";
import * as osUtils from "os-utils";
import { fetchMeta } from "@/misc/fetch-meta.js";
import meilisearch from "../db/meilisearch.js";
const ev = new Xev();

View file

@ -1,5 +1,5 @@
import * as elasticsearch from "@elastic/elasticsearch";
import config from "@/config/index.js";
import * as elasticsearch from "@elastic/elasticsearch";
const index = {
settings: {

View file

@ -1,9 +1,9 @@
import { Health, Index, MeiliSearch, Stats } from "meilisearch";
import { dbLogger } from "./logger.js";
import * as url from "url";
import config from "@/config/index.js";
import { Note } from "@/models/entities/note.js";
import * as url from "url";
import { ILocalUser } from "@/models/entities/user.js";
import { Followings, Users } from "@/models/index.js";
@ -408,7 +408,7 @@ export default hasConfig
return {
health: health.status,
size: stats.databaseSize,
indexed_count: stats.indexes["posts"].numberOfDocuments,
indexed_count: stats.indexes.posts.numberOfDocuments,
};
},
deleteNotes: async (note: Note | Note[] | string | string[]) => {

View file

@ -2,82 +2,82 @@
import pg from "pg";
pg.types.setTypeParser(20, Number);
import config from "@/config/index.js";
import * as highlight from "cli-highlight";
import type { Logger } from "typeorm";
import { DataSource } from "typeorm";
import * as highlight from "cli-highlight";
import config from "@/config/index.js";
import { User } from "@/models/entities/user.js";
import { DriveFile } from "@/models/entities/drive-file.js";
import { DriveFolder } from "@/models/entities/drive-folder.js";
import { AccessToken } from "@/models/entities/access-token.js";
import { App } from "@/models/entities/app.js";
import { PollVote } from "@/models/entities/poll-vote.js";
import { Note } from "@/models/entities/note.js";
import { NoteReaction } from "@/models/entities/note-reaction.js";
import { NoteWatching } from "@/models/entities/note-watching.js";
import { NoteThreadMuting } from "@/models/entities/note-thread-muting.js";
import { NoteUnread } from "@/models/entities/note-unread.js";
import { Notification } from "@/models/entities/notification.js";
import { Meta } from "@/models/entities/meta.js";
import { Following } from "@/models/entities/following.js";
import { Instance } from "@/models/entities/instance.js";
import { Muting } from "@/models/entities/muting.js";
import { RenoteMuting } from "@/models/entities/renote-muting.js";
import { SwSubscription } from "@/models/entities/sw-subscription.js";
import { Blocking } from "@/models/entities/blocking.js";
import { UserList } from "@/models/entities/user-list.js";
import { UserListJoining } from "@/models/entities/user-list-joining.js";
import { UserGroup } from "@/models/entities/user-group.js";
import { UserGroupJoining } from "@/models/entities/user-group-joining.js";
import { UserGroupInvitation } from "@/models/entities/user-group-invitation.js";
import { Hashtag } from "@/models/entities/hashtag.js";
import { NoteFavorite } from "@/models/entities/note-favorite.js";
import { AbuseUserReport } from "@/models/entities/abuse-user-report.js";
import { RegistrationTicket } from "@/models/entities/registration-tickets.js";
import { MessagingMessage } from "@/models/entities/messaging-message.js";
import { Signin } from "@/models/entities/signin.js";
import { AuthSession } from "@/models/entities/auth-session.js";
import { FollowRequest } from "@/models/entities/follow-request.js";
import { Emoji } from "@/models/entities/emoji.js";
import { UserNotePining } from "@/models/entities/user-note-pining.js";
import { Poll } from "@/models/entities/poll.js";
import { UserKeypair } from "@/models/entities/user-keypair.js";
import { UserPublickey } from "@/models/entities/user-publickey.js";
import { UserProfile } from "@/models/entities/user-profile.js";
import { UserSecurityKey } from "@/models/entities/user-security-key.js";
import { AttestationChallenge } from "@/models/entities/attestation-challenge.js";
import { Page } from "@/models/entities/page.js";
import { PageLike } from "@/models/entities/page-like.js";
import { GalleryPost } from "@/models/entities/gallery-post.js";
import { GalleryLike } from "@/models/entities/gallery-like.js";
import { ModerationLog } from "@/models/entities/moderation-log.js";
import { UsedUsername } from "@/models/entities/used-username.js";
import { Announcement } from "@/models/entities/announcement.js";
import { AccessToken } from "@/models/entities/access-token.js";
import { Ad } from "@/models/entities/ad.js";
import { AnnouncementRead } from "@/models/entities/announcement-read.js";
import { Clip } from "@/models/entities/clip.js";
import { ClipNote } from "@/models/entities/clip-note.js";
import { Announcement } from "@/models/entities/announcement.js";
import { Antenna } from "@/models/entities/antenna.js";
import { PromoNote } from "@/models/entities/promo-note.js";
import { PromoRead } from "@/models/entities/promo-read.js";
import { Relay } from "@/models/entities/relay.js";
import { MutedNote } from "@/models/entities/muted-note.js";
import { Channel } from "@/models/entities/channel.js";
import { App } from "@/models/entities/app.js";
import { AttestationChallenge } from "@/models/entities/attestation-challenge.js";
import { AuthSession } from "@/models/entities/auth-session.js";
import { Blocking } from "@/models/entities/blocking.js";
import { ChannelFollowing } from "@/models/entities/channel-following.js";
import { ChannelNotePining } from "@/models/entities/channel-note-pining.js";
import { RegistryItem } from "@/models/entities/registry-item.js";
import { Ad } from "@/models/entities/ad.js";
import { PasswordResetRequest } from "@/models/entities/password-reset-request.js";
import { UserPending } from "@/models/entities/user-pending.js";
import { Webhook } from "@/models/entities/webhook.js";
import { UserIp } from "@/models/entities/user-ip.js";
import { Channel } from "@/models/entities/channel.js";
import { ClipNote } from "@/models/entities/clip-note.js";
import { Clip } from "@/models/entities/clip.js";
import { DriveFile } from "@/models/entities/drive-file.js";
import { DriveFolder } from "@/models/entities/drive-folder.js";
import { Emoji } from "@/models/entities/emoji.js";
import { FollowRequest } from "@/models/entities/follow-request.js";
import { Following } from "@/models/entities/following.js";
import { GalleryLike } from "@/models/entities/gallery-like.js";
import { GalleryPost } from "@/models/entities/gallery-post.js";
import { Hashtag } from "@/models/entities/hashtag.js";
import { Instance } from "@/models/entities/instance.js";
import { MessagingMessage } from "@/models/entities/messaging-message.js";
import { Meta } from "@/models/entities/meta.js";
import { ModerationLog } from "@/models/entities/moderation-log.js";
import { MutedNote } from "@/models/entities/muted-note.js";
import { Muting } from "@/models/entities/muting.js";
import { NoteEdit } from "@/models/entities/note-edit.js";
import { NoteFavorite } from "@/models/entities/note-favorite.js";
import { NoteReaction } from "@/models/entities/note-reaction.js";
import { NoteThreadMuting } from "@/models/entities/note-thread-muting.js";
import { NoteUnread } from "@/models/entities/note-unread.js";
import { NoteWatching } from "@/models/entities/note-watching.js";
import { Note } from "@/models/entities/note.js";
import { Notification } from "@/models/entities/notification.js";
import { PageLike } from "@/models/entities/page-like.js";
import { Page } from "@/models/entities/page.js";
import { PasswordResetRequest } from "@/models/entities/password-reset-request.js";
import { PollVote } from "@/models/entities/poll-vote.js";
import { Poll } from "@/models/entities/poll.js";
import { PromoNote } from "@/models/entities/promo-note.js";
import { PromoRead } from "@/models/entities/promo-read.js";
import { RegistrationTicket } from "@/models/entities/registration-tickets.js";
import { RegistryItem } from "@/models/entities/registry-item.js";
import { Relay } from "@/models/entities/relay.js";
import { RenoteMuting } from "@/models/entities/renote-muting.js";
import { Signin } from "@/models/entities/signin.js";
import { SwSubscription } from "@/models/entities/sw-subscription.js";
import { UsedUsername } from "@/models/entities/used-username.js";
import { UserGroupInvitation } from "@/models/entities/user-group-invitation.js";
import { UserGroupJoining } from "@/models/entities/user-group-joining.js";
import { UserGroup } from "@/models/entities/user-group.js";
import { UserIp } from "@/models/entities/user-ip.js";
import { UserKeypair } from "@/models/entities/user-keypair.js";
import { UserListJoining } from "@/models/entities/user-list-joining.js";
import { UserList } from "@/models/entities/user-list.js";
import { UserNotePining } from "@/models/entities/user-note-pining.js";
import { UserPending } from "@/models/entities/user-pending.js";
import { UserProfile } from "@/models/entities/user-profile.js";
import { UserPublickey } from "@/models/entities/user-publickey.js";
import { UserSecurityKey } from "@/models/entities/user-security-key.js";
import { User } from "@/models/entities/user.js";
import { Webhook } from "@/models/entities/webhook.js";
import { entities as charts } from "@/services/chart/entities.js";
import { nativeInitDatabase } from "native-utils/built/index.js";
import { envOption } from "../env.js";
import { dbLogger } from "./logger.js";
import { redisClient } from "./redis.js";
import { nativeInitDatabase } from "native-utils/built/index.js";
const sqlLogger = dbLogger.createSubLogger("sql", "gray", false);

View file

@ -1,5 +1,5 @@
import Redis from "ioredis";
import config from "@/config/index.js";
import Redis from "ioredis";
export function createConnection() {
let source = config.redis;

View file

@ -1,8 +1,8 @@
import config from "@/config/index.js";
import type { IMentionedRemoteUsers } from "@/models/entities/note.js";
import { intersperse } from "@/prelude/array.js";
import { JSDOM } from "jsdom";
import type * as mfm from "mfm-js";
import config from "@/config/index.js";
import { intersperse } from "@/prelude/array.js";
import type { IMentionedRemoteUsers } from "@/models/entities/note.js";
export function toHtml(
nodes: mfm.MfmNode[] | null,

View file

@ -1,6 +1,6 @@
import { Antennas } from "@/models/index.js";
import type { Antenna } from "@/models/entities/antenna.js";
import { subscriber } from "@/db/redis.js";
import type { Antenna } from "@/models/entities/antenna.js";
import { Antennas } from "@/models/index.js";
let antennasFetched = false;
let antennas: Antenna[] = [];

View file

@ -1,6 +1,6 @@
import { redisClient } from "../db/redis.js";
import { promisify } from "node:util";
import redisLock from "redis-lock";
import { redisClient } from "../db/redis.js";
/**
* Retry delay (ms) for lock acquisition

View file

@ -1,6 +1,6 @@
import { redisClient } from "@/db/redis.js";
import { encode, decode } from "msgpackr";
import { ChainableCommander } from "ioredis";
import { decode, encode } from "msgpackr";
export class Cache<T> {
private ttl: number;

View file

@ -1,7 +1,7 @@
import fetch from "node-fetch";
import { URLSearchParams } from "node:url";
import { getAgentByUrl } from "./fetch.js";
import config from "@/config/index.js";
import fetch from "node-fetch";
import { getAgentByUrl } from "./fetch.js";
export async function verifyRecaptcha(secret: string, response: string) {
const result = await getCaptchaResponse(

View file

@ -1,15 +1,15 @@
import * as Acct from "@/misc/acct.js";
import type { Antenna } from "@/models/entities/antenna.js";
import type { Note } from "@/models/entities/note.js";
import type { User } from "@/models/entities/user.js";
import {
UserListJoinings,
UserGroupJoinings,
Blockings,
UserGroupJoinings,
UserListJoinings,
} from "@/models/index.js";
import { getFullApAccount } from "./convert-host.js";
import * as Acct from "@/misc/acct.js";
import type { Packed } from "./schema.js";
import { Cache } from "./cache.js";
import { getFullApAccount } from "./convert-host.js";
import type { Packed } from "./schema.js";
const blockingCache = new Cache<User["id"][]>("blocking", 60 * 5);
@ -101,8 +101,8 @@ export async function checkHitAntenna(
const matched = keywords.some((and) =>
and.every((keyword) =>
antenna.caseSensitive
? note.text!.includes(keyword)
: note.text!.toLowerCase().includes(keyword.toLowerCase()),
? note.text?.includes(keyword)
: note.text?.toLowerCase().includes(keyword.toLowerCase()),
),
);
@ -120,8 +120,8 @@ export async function checkHitAntenna(
const matched = excludeKeywords.some((and) =>
and.every((keyword) =>
antenna.caseSensitive
? note.text!.includes(keyword)
: note.text!.toLowerCase().includes(keyword.toLowerCase()),
? note.text?.includes(keyword)
: note.text?.toLowerCase().includes(keyword.toLowerCase()),
),
);

View file

@ -1,6 +1,6 @@
import RE2 from "re2";
import type { Note } from "@/models/entities/note.js";
import type { User } from "@/models/entities/user.js";
import RE2 from "re2";
type NoteLike = {
userId: Note["userId"];

View file

@ -1,6 +1,6 @@
import { URL } from "node:url";
import config from "@/config/index.js";
import { toASCII } from "punycode";
import config from "@/config/index.js";
export function getFullApAccount(username: string, host: string | null) {
return host

View file

@ -1,13 +1,13 @@
import * as fs from "node:fs";
import * as stream from "node:stream";
import * as util from "node:util";
import got, * as Got from "got";
import { httpAgent, httpsAgent, StatusError } from "./fetch.js";
import config from "@/config/index.js";
import chalk from "chalk";
import Logger from "@/services/logger.js";
import chalk from "chalk";
import got, * as Got from "got";
import IPCIDR from "ip-cidr";
import PrivateIp from "private-ip";
import { StatusError, httpAgent, httpsAgent } from "./fetch.js";
const pipeline = util.promisify(stream.pipeline);

View file

@ -2,9 +2,9 @@ import probeImageSize from "probe-image-size";
import { Mutex } from "redis-semaphore";
import { FILE_TYPE_BROWSERSAFE } from "@/const.js";
import { redisClient } from "@/db/redis.js";
import Logger from "@/services/logger.js";
import { Cache } from "./cache.js";
import { redisClient } from "@/db/redis.js";
export type Size = {
width: number;

View file

@ -1,5 +1,5 @@
import * as mfm from "mfm-js";
import { unique } from "@/prelude/array.js";
import * as mfm from "mfm-js";
export function extractCustomEmojisFromMfm(nodes: mfm.MfmNode[]): string[] {
const emojiNodes = mfm.extract(nodes, (node) => {

View file

@ -1,5 +1,5 @@
import * as mfm from "mfm-js";
import { unique } from "@/prelude/array.js";
import * as mfm from "mfm-js";
export function extractHashtags(nodes: mfm.MfmNode[]): string[] {
const hashtagNodes = mfm.extract(nodes, (node) => node.type === "hashtag");

View file

@ -1,6 +1,6 @@
import { fetchMeta } from "./fetch-meta.js";
import type { ILocalUser } from "@/models/entities/user.js";
import { Users } from "@/models/index.js";
import { fetchMeta } from "./fetch-meta.js";
export async function fetchProxyAccount(): Promise<ILocalUser | null> {
const meta = await fetchMeta();

View file

@ -1,10 +1,10 @@
import * as http from "node:http";
import * as https from "node:https";
import type { URL } from "node:url";
import CacheableLookup from "cacheable-lookup";
import fetch from "node-fetch";
import { HttpProxyAgent, HttpsProxyAgent } from "hpagent";
import config from "@/config/index.js";
import CacheableLookup from "cacheable-lookup";
import { HttpProxyAgent, HttpsProxyAgent } from "hpagent";
import fetch from "node-fetch";
export async function getJson(
url: string,

View file

@ -1,8 +1,8 @@
import config from "@/config/index.js";
import {
nativeCreateId,
nativeInitIdGenerator,
nativeGetTimestamp,
nativeInitIdGenerator,
} from "native-utils/built/index.js";
const length = Math.min(Math.max(config.cuid?.length ?? 16, 16), 24);

View file

@ -1,17 +1,17 @@
import * as fs from "node:fs";
import * as crypto from "node:crypto";
import * as fs from "node:fs";
import { join } from "node:path";
import * as stream from "node:stream";
import * as util from "node:util";
import { detectSensitive } from "@/services/detect-sensitive.js";
import { encode } from "blurhash";
import { FSWatcher } from "chokidar";
import { fileTypeFromFile } from "file-type";
import probeImageSize from "probe-image-size";
import FFmpeg from "fluent-ffmpeg";
import isSvg from "is-svg";
import { type predictionType } from "nsfwjs";
import probeImageSize from "probe-image-size";
import sharp from "sharp";
import { encode } from "blurhash";
import { detectSensitive } from "@/services/detect-sensitive.js";
import { createTempDir } from "./create-temp.js";
const pipeline = util.promisify(stream.pipeline);

View file

@ -1,6 +1,6 @@
import { UserKeypairs } from "@/models/index.js";
import type { User } from "@/models/entities/user.js";
import type { UserKeypair } from "@/models/entities/user-keypair.js";
import type { User } from "@/models/entities/user.js";
import { UserKeypairs } from "@/models/index.js";
import { Cache } from "./cache.js";
const cache = new Cache<UserKeypair>("keypairStore", 60 * 30);

View file

@ -1,5 +1,5 @@
import bcrypt from "bcryptjs";
import * as argon2 from "argon2";
import bcrypt from "bcryptjs";
export async function hashPassword(password: string): Promise<string> {
return argon2.hash(password);

View file

@ -1,13 +1,13 @@
import { In, IsNull } from "typeorm";
import { Emojis } from "@/models/index.js";
import config from "@/config/index.js";
import { redisClient } from "@/db/redis.js";
import type { Emoji } from "@/models/entities/emoji.js";
import type { Note } from "@/models/entities/note.js";
import { Emojis } from "@/models/index.js";
import { query } from "@/prelude/url.js";
import { In, IsNull } from "typeorm";
import { Cache } from "./cache.js";
import { isSelfHost, toPunyNullable } from "./convert-host.js";
import { decodeReaction } from "./reaction-lib.js";
import config from "@/config/index.js";
import { query } from "@/prelude/url.js";
import { redisClient } from "@/db/redis.js";
const cache = new Cache<Emoji | null>("populateEmojis", 60 * 60 * 12);
@ -118,12 +118,12 @@ export function aggregateNoteEmojis(notes: Note[]) {
);
if (note.renote) {
emojis = emojis.concat(
note.renote.emojis.map((e) => parseEmojiStr(e, note.renote!.userHost)),
note.renote.emojis.map((e) => parseEmojiStr(e, note.renote?.userHost)),
);
if (note.renote.user) {
emojis = emojis.concat(
note.renote.user.emojis.map((e) =>
parseEmojiStr(e, note.renote!.userHost),
parseEmojiStr(e, note.renote?.userHost),
),
);
}

View file

@ -12,7 +12,7 @@ export function parse(acct: any): Post {
cw: acct.cw,
localOnly: acct.localOnly,
createdAt: new Date(acct.createdAt),
visibility: "hidden" + (acct.visibility || ""),
visibility: `hidden${acct.visibility || ""}`,
};
}

View file

@ -1,13 +1,13 @@
import * as fs from "node:fs";
import * as Path from "node:path";
import { Users } from "@/models/index.js";
import { addFile } from "@/services/drive/add-file.js";
import Logger from "@/services/logger.js";
import decompress from "decompress";
import gunzip from "gunzip-maybe";
import * as tar from "tar-stream";
import { createTemp, createTempDir } from "./create-temp.js";
import { downloadUrl } from "./download-url.js";
import { addFile } from "@/services/drive/add-file.js";
import { Users } from "@/models/index.js";
import * as tar from "tar-stream";
import gunzip from "gunzip-maybe";
import decompress from "decompress";
import * as Path from "node:path";
const logger = new Logger("process-masto-notes");
@ -108,7 +108,7 @@ function unzipTarGz(fn: string, dir: string) {
};
try {
const extract = tar.extract().on("error", onErr);
dir = dir.endsWith("/") ? dir : dir + "/";
dir = dir.endsWith("/") ? dir : `${dir}/`;
const ls: string[] = [];
extract.on("entry", function (header: any, stream: any, next: any) {
try {

View file

@ -1,8 +1,8 @@
import { Emojis } from "@/models/index.js";
import { IsNull } from "typeorm";
import { toPunyNullable } from "./convert-host.js";
import { emojiRegex } from "./emoji-regex.js";
import { fetchMeta } from "./fetch-meta.js";
import { Emojis } from "@/models/index.js";
import { toPunyNullable } from "./convert-host.js";
import { IsNull } from "typeorm";
const legacies = new Map([
["like", "👍"],
@ -38,7 +38,7 @@ export function convertLegacyReactions(reactions: Record<string, number>) {
decodedReactions.set(reaction, decodedReaction);
}
let emoji = legacies.get(decodedReaction.reaction);
const emoji = legacies.get(decodedReaction.reaction);
if (emoji) {
_reactions.set(emoji, (_reactions.get(emoji) || 0) + reactions[reaction]);
} else {

View file

@ -1,36 +1,36 @@
import {
packedUserLiteSchema,
packedUserDetailedNotMeOnlySchema,
packedMeDetailedOnlySchema,
packedUserDetailedNotMeSchema,
packedMeDetailedSchema,
packedUserDetailedSchema,
packedUserSchema,
} from "@/models/schema/user.js";
import { packedNoteSchema } from "@/models/schema/note.js";
import { packedUserListSchema } from "@/models/schema/user-list.js";
import { packedAntennaSchema } from "@/models/schema/antenna.js";
import { packedAppSchema } from "@/models/schema/app.js";
import { packedMessagingMessageSchema } from "@/models/schema/messaging-message.js";
import { packedNotificationSchema } from "@/models/schema/notification.js";
import { packedBlockingSchema } from "@/models/schema/blocking.js";
import { packedChannelSchema } from "@/models/schema/channel.js";
import { packedClipSchema } from "@/models/schema/clip.js";
import { packedDriveFileSchema } from "@/models/schema/drive-file.js";
import { packedDriveFolderSchema } from "@/models/schema/drive-folder.js";
import { packedFollowingSchema } from "@/models/schema/following.js";
import { packedMutingSchema } from "@/models/schema/muting.js";
import { packedRenoteMutingSchema } from "@/models/schema/renote-muting.js";
import { packedBlockingSchema } from "@/models/schema/blocking.js";
import { packedNoteReactionSchema } from "@/models/schema/note-reaction.js";
import { packedHashtagSchema } from "@/models/schema/hashtag.js";
import { packedPageSchema } from "@/models/schema/page.js";
import { packedUserGroupSchema } from "@/models/schema/user-group.js";
import { packedNoteFavoriteSchema } from "@/models/schema/note-favorite.js";
import { packedChannelSchema } from "@/models/schema/channel.js";
import { packedAntennaSchema } from "@/models/schema/antenna.js";
import { packedClipSchema } from "@/models/schema/clip.js";
import { packedFederationInstanceSchema } from "@/models/schema/federation-instance.js";
import { packedQueueCountSchema } from "@/models/schema/queue.js";
import { packedGalleryPostSchema } from "@/models/schema/gallery-post.js";
import { packedEmojiSchema } from "@/models/schema/emoji.js";
import { packedFederationInstanceSchema } from "@/models/schema/federation-instance.js";
import { packedFollowingSchema } from "@/models/schema/following.js";
import { packedGalleryPostSchema } from "@/models/schema/gallery-post.js";
import { packedHashtagSchema } from "@/models/schema/hashtag.js";
import { packedMessagingMessageSchema } from "@/models/schema/messaging-message.js";
import { packedMutingSchema } from "@/models/schema/muting.js";
import { packedNoteEdit } from "@/models/schema/note-edit.js";
import { packedNoteFavoriteSchema } from "@/models/schema/note-favorite.js";
import { packedNoteReactionSchema } from "@/models/schema/note-reaction.js";
import { packedNoteSchema } from "@/models/schema/note.js";
import { packedNotificationSchema } from "@/models/schema/notification.js";
import { packedPageSchema } from "@/models/schema/page.js";
import { packedQueueCountSchema } from "@/models/schema/queue.js";
import { packedRenoteMutingSchema } from "@/models/schema/renote-muting.js";
import { packedUserGroupSchema } from "@/models/schema/user-group.js";
import { packedUserListSchema } from "@/models/schema/user-list.js";
import {
packedMeDetailedOnlySchema,
packedMeDetailedSchema,
packedUserDetailedNotMeOnlySchema,
packedUserDetailedNotMeSchema,
packedUserDetailedSchema,
packedUserLiteSchema,
packedUserSchema,
} from "@/models/schema/user.js";
export const refs = {
UserLite: packedUserLiteSchema,

View file

@ -1,6 +1,6 @@
import * as os from "node:os";
import sysUtils from "systeminformation";
import type Logger from "@/services/logger.js";
import sysUtils from "systeminformation";
export async function showMachineInfo(parentLogger: Logger) {
const logger = parentLogger.createSubLogger("machine");

View file

@ -1,8 +1,8 @@
import { Brackets } from "typeorm";
import { fetchMeta } from "@/misc/fetch-meta.js";
import { Instances } from "@/models/index.js";
import type { Instance } from "@/models/entities/instance.js";
import { DAY } from "@/const.js";
import { fetchMeta } from "@/misc/fetch-meta.js";
import type { Instance } from "@/models/entities/instance.js";
import { Instances } from "@/models/index.js";
import { Brackets } from "typeorm";
import { shouldBlockInstance } from "./should-block-instance.js";
// Threshold from last contact after which an instance will be considered

View file

@ -1,6 +1,6 @@
import { Webhooks } from "@/models/index.js";
import type { Webhook } from "@/models/entities/webhook.js";
import { subscriber } from "@/db/redis.js";
import type { Webhook } from "@/models/entities/webhook.js";
import { Webhooks } from "@/models/index.js";
let webhooksFetched = false;
let webhooks: Webhook[] = [];

View file

@ -1,13 +1,13 @@
import {
PrimaryColumn,
Column,
Entity,
Index,
JoinColumn,
Column,
ManyToOne,
PrimaryColumn,
} from "typeorm";
import { User } from "./user.js";
import { id } from "../id.js";
import { User } from "./user.js";
@Entity()
export class AbuseUserReport {

View file

@ -1,14 +1,14 @@
import {
Entity,
PrimaryColumn,
Index,
Column,
ManyToOne,
Entity,
Index,
JoinColumn,
ManyToOne,
PrimaryColumn,
} from "typeorm";
import { User } from "./user.js";
import { App } from "./app.js";
import { id } from "../id.js";
import { App } from "./app.js";
import { User } from "./user.js";
@Entity()
export class AccessToken {

View file

@ -1,4 +1,4 @@
import { Entity, Index, Column, PrimaryColumn } from "typeorm";
import { Column, Entity, Index, PrimaryColumn } from "typeorm";
import { id } from "../id.js";
@Entity()

View file

@ -1,14 +1,14 @@
import {
PrimaryColumn,
Column,
Entity,
Index,
JoinColumn,
Column,
ManyToOne,
PrimaryColumn,
} from "typeorm";
import { User } from "./user.js";
import { Announcement } from "./announcement.js";
import { id } from "../id.js";
import { Announcement } from "./announcement.js";
import { User } from "./user.js";
@Entity()
@Index(["userId", "announcementId"], { unique: true })

View file

@ -1,4 +1,4 @@
import { Entity, Index, Column, PrimaryColumn } from "typeorm";
import { Column, Entity, Index, PrimaryColumn } from "typeorm";
import { id } from "../id.js";
@Entity()

View file

@ -1,15 +1,15 @@
import {
PrimaryColumn,
Column,
Entity,
Index,
JoinColumn,
Column,
ManyToOne,
PrimaryColumn,
} from "typeorm";
import { User } from "./user.js";
import { id } from "../id.js";
import { UserList } from "./user-list.js";
import { UserGroupJoining } from "./user-group-joining.js";
import { UserList } from "./user-list.js";
import { User } from "./user.js";
@Entity()
export class Antenna {

View file

@ -1,6 +1,6 @@
import { Entity, PrimaryColumn, Column, Index, ManyToOne } from "typeorm";
import { User } from "./user.js";
import { Column, Entity, Index, ManyToOne, PrimaryColumn } from "typeorm";
import { id } from "../id.js";
import { User } from "./user.js";
@Entity()
export class App {

View file

@ -1,13 +1,13 @@
import {
PrimaryColumn,
Entity,
JoinColumn,
Column,
ManyToOne,
Entity,
Index,
JoinColumn,
ManyToOne,
PrimaryColumn,
} from "typeorm";
import { User } from "./user.js";
import { id } from "../id.js";
import { User } from "./user.js";
@Entity()
export class AttestationChallenge {

View file

@ -1,14 +1,14 @@
import {
Entity,
PrimaryColumn,
Index,
Column,
ManyToOne,
Entity,
Index,
JoinColumn,
ManyToOne,
PrimaryColumn,
} from "typeorm";
import { User } from "./user.js";
import { App } from "./app.js";
import { id } from "../id.js";
import { App } from "./app.js";
import { User } from "./user.js";
@Entity()
export class AuthSession {

View file

@ -1,13 +1,13 @@
import {
PrimaryColumn,
Column,
Entity,
Index,
JoinColumn,
Column,
ManyToOne,
PrimaryColumn,
} from "typeorm";
import { User } from "./user.js";
import { id } from "../id.js";
import { User } from "./user.js";
@Entity()
@Index(["blockerId", "blockeeId"], { unique: true })

View file

@ -1,14 +1,14 @@
import {
PrimaryColumn,
Column,
Entity,
Index,
JoinColumn,
Column,
ManyToOne,
PrimaryColumn,
} from "typeorm";
import { User } from "./user.js";
import { id } from "../id.js";
import { Channel } from "./channel.js";
import { User } from "./user.js";
@Entity()
@Index(["followerId", "followeeId"], { unique: true })

View file

@ -1,14 +1,14 @@
import {
PrimaryColumn,
Column,
Entity,
Index,
JoinColumn,
Column,
ManyToOne,
PrimaryColumn,
} from "typeorm";
import { Note } from "./note.js";
import { Channel } from "./channel.js";
import { id } from "../id.js";
import { Channel } from "./channel.js";
import { Note } from "./note.js";
@Entity()
@Index(["channelId", "noteId"], { unique: true })

View file

@ -1,14 +1,14 @@
import {
PrimaryColumn,
Column,
Entity,
Index,
JoinColumn,
Column,
ManyToOne,
PrimaryColumn,
} from "typeorm";
import { User } from "./user.js";
import { id } from "../id.js";
import { DriveFile } from "./drive-file.js";
import { User } from "./user.js";
@Entity()
export class Channel {

View file

@ -1,14 +1,14 @@
import {
Column,
Entity,
Index,
JoinColumn,
Column,
ManyToOne,
PrimaryColumn,
} from "typeorm";
import { Note } from "./note.js";
import { Clip } from "./clip.js";
import { id } from "../id.js";
import { Clip } from "./clip.js";
import { Note } from "./note.js";
@Entity()
@Index(["noteId", "clipId"], { unique: true })

View file

@ -1,13 +1,13 @@
import {
PrimaryColumn,
Column,
Entity,
Index,
JoinColumn,
Column,
ManyToOne,
PrimaryColumn,
} from "typeorm";
import { User } from "./user.js";
import { id } from "../id.js";
import { User } from "./user.js";
@Entity()
export class Clip {

View file

@ -1,15 +1,15 @@
import { DB_MAX_IMAGE_COMMENT_LENGTH } from "@/misc/hard-limits.js";
import {
PrimaryColumn,
Column,
Entity,
Index,
JoinColumn,
Column,
ManyToOne,
PrimaryColumn,
} from "typeorm";
import { id } from "../id.js";
import { User } from "./user.js";
import { DriveFolder } from "./drive-folder.js";
import { DB_MAX_IMAGE_COMMENT_LENGTH } from "@/misc/hard-limits.js";
import { User } from "./user.js";
@Entity()
@Index(["userId", "folderId", "id"])

View file

@ -1,13 +1,13 @@
import {
Column,
Entity,
Index,
JoinColumn,
ManyToOne,
Entity,
PrimaryColumn,
Index,
Column,
} from "typeorm";
import { User } from "./user.js";
import { id } from "../id.js";
import { User } from "./user.js";
@Entity()
export class DriveFolder {

View file

@ -1,4 +1,4 @@
import { PrimaryColumn, Entity, Index, Column } from "typeorm";
import { Column, Entity, Index, PrimaryColumn } from "typeorm";
import { id } from "../id.js";
@Entity()

View file

@ -1,13 +1,13 @@
import {
PrimaryColumn,
Column,
Entity,
Index,
JoinColumn,
Column,
ManyToOne,
PrimaryColumn,
} from "typeorm";
import { User } from "./user.js";
import { id } from "../id.js";
import { User } from "./user.js";
@Entity()
@Index(["followerId", "followeeId"], { unique: true })

View file

@ -1,13 +1,13 @@
import {
PrimaryColumn,
Column,
Entity,
Index,
JoinColumn,
Column,
ManyToOne,
PrimaryColumn,
} from "typeorm";
import { User } from "./user.js";
import { id } from "../id.js";
import { User } from "./user.js";
@Entity()
@Index(["followerId", "followeeId"], { unique: true })

View file

@ -1,14 +1,14 @@
import {
PrimaryColumn,
Column,
Entity,
Index,
JoinColumn,
Column,
ManyToOne,
PrimaryColumn,
} from "typeorm";
import { User } from "./user.js";
import { id } from "../id.js";
import { GalleryPost } from "./gallery-post.js";
import { User } from "./user.js";
@Entity()
@Index(["userId", "postId"], { unique: true })

View file

@ -1,14 +1,14 @@
import {
Column,
Entity,
Index,
JoinColumn,
Column,
PrimaryColumn,
ManyToOne,
PrimaryColumn,
} from "typeorm";
import { User } from "./user.js";
import { id } from "../id.js";
import type { DriveFile } from "./drive-file.js";
import { User } from "./user.js";
@Entity()
export class GalleryPost {

View file

@ -1,6 +1,6 @@
import { Entity, PrimaryColumn, Index, Column } from "typeorm";
import type { User } from "./user.js";
import { Column, Entity, Index, PrimaryColumn } from "typeorm";
import { id } from "../id.js";
import type { User } from "./user.js";
@Entity()
export class Hashtag {

View file

@ -1,4 +1,4 @@
import { Entity, PrimaryColumn, Index, Column } from "typeorm";
import { Column, Entity, Index, PrimaryColumn } from "typeorm";
import { id } from "../id.js";
@Entity()

View file

@ -1,15 +1,15 @@
import {
PrimaryColumn,
Column,
Entity,
Index,
JoinColumn,
Column,
ManyToOne,
PrimaryColumn,
} from "typeorm";
import { User } from "./user.js";
import { DriveFile } from "./drive-file.js";
import { id } from "../id.js";
import { DriveFile } from "./drive-file.js";
import { UserGroup } from "./user-group.js";
import { User } from "./user.js";
@Entity()
export class MessagingMessage {

View file

@ -1,7 +1,7 @@
import { Entity, Column, PrimaryColumn, ManyToOne, JoinColumn } from "typeorm";
import { Column, Entity, JoinColumn, ManyToOne, PrimaryColumn } from "typeorm";
import { id } from "../id.js";
import { User } from "./user.js";
import type { Clip } from "./clip.js";
import { User } from "./user.js";
@Entity()
export class Meta {

View file

@ -1,13 +1,13 @@
import {
PrimaryColumn,
Column,
Entity,
Index,
JoinColumn,
Column,
ManyToOne,
PrimaryColumn,
} from "typeorm";
import { User } from "./user.js";
import { id } from "../id.js";
import { User } from "./user.js";
@Entity()
export class ModerationLog {

View file

@ -1,15 +1,15 @@
import {
Column,
Entity,
Index,
JoinColumn,
Column,
ManyToOne,
PrimaryColumn,
} from "typeorm";
import { mutedNoteReasons } from "../../types.js";
import { id } from "../id.js";
import { Note } from "./note.js";
import { User } from "./user.js";
import { id } from "../id.js";
import { mutedNoteReasons } from "../../types.js";
@Entity()
@Index(["noteId", "userId"], { unique: true })

View file

@ -1,13 +1,13 @@
import {
PrimaryColumn,
Column,
Entity,
Index,
JoinColumn,
Column,
ManyToOne,
PrimaryColumn,
} from "typeorm";
import { User } from "./user.js";
import { id } from "../id.js";
import { User } from "./user.js";
@Entity()
@Index(["muterId", "muteeId"], { unique: true })

View file

@ -1,14 +1,14 @@
import {
Entity,
JoinColumn,
Column,
Entity,
Index,
JoinColumn,
ManyToOne,
PrimaryColumn,
Index,
} from "typeorm";
import { Note } from "./note.js";
import { id } from "../id.js";
import { DriveFile } from "./drive-file.js";
import { Note } from "./note.js";
@Entity()
export class NoteEdit {

View file

@ -1,14 +1,14 @@
import {
PrimaryColumn,
Column,
Entity,
Index,
JoinColumn,
Column,
ManyToOne,
PrimaryColumn,
} from "typeorm";
import { id } from "../id.js";
import { Note } from "./note.js";
import { User } from "./user.js";
import { id } from "../id.js";
@Entity()
@Index(["userId", "noteId"], { unique: true })

View file

@ -1,14 +1,14 @@
import {
PrimaryColumn,
Column,
Entity,
Index,
JoinColumn,
Column,
ManyToOne,
PrimaryColumn,
} from "typeorm";
import { User } from "./user.js";
import { Note } from "./note.js";
import { id } from "../id.js";
import { Note } from "./note.js";
import { User } from "./user.js";
@Entity()
@Index(["userId", "noteId"], { unique: true })

View file

@ -1,14 +1,14 @@
import {
PrimaryColumn,
Column,
Entity,
Index,
JoinColumn,
Column,
ManyToOne,
PrimaryColumn,
} from "typeorm";
import { User } from "./user.js";
import { Note } from "./note.js";
import { id } from "../id.js";
import { Note } from "./note.js";
import { User } from "./user.js";
@Entity()
@Index(["userId", "threadId"], { unique: true })

View file

@ -1,15 +1,15 @@
import {
PrimaryColumn,
Column,
Entity,
Index,
JoinColumn,
Column,
ManyToOne,
PrimaryColumn,
} from "typeorm";
import { User } from "./user.js";
import { Note } from "./note.js";
import { id } from "../id.js";
import type { Channel } from "./channel.js";
import { Note } from "./note.js";
import { User } from "./user.js";
@Entity()
@Index(["userId", "noteId"], { unique: true })

View file

@ -1,14 +1,14 @@
import {
PrimaryColumn,
Column,
Entity,
Index,
JoinColumn,
Column,
ManyToOne,
PrimaryColumn,
} from "typeorm";
import { User } from "./user.js";
import { Note } from "./note.js";
import { id } from "../id.js";
import { Note } from "./note.js";
import { User } from "./user.js";
@Entity()
@Index(["userId", "noteId"], { unique: true })

View file

@ -1,16 +1,16 @@
import {
Column,
Entity,
Index,
JoinColumn,
Column,
PrimaryColumn,
ManyToOne,
PrimaryColumn,
} from "typeorm";
import { User } from "./user.js";
import type { DriveFile } from "./drive-file.js";
import { id } from "../id.js";
import { noteVisibilities } from "../../types.js";
import { id } from "../id.js";
import { Channel } from "./channel.js";
import type { DriveFile } from "./drive-file.js";
import { User } from "./user.js";
@Entity()
@Index("IDX_NOTE_TAGS", { synchronize: false })

View file

@ -1,18 +1,18 @@
import { notificationTypes } from "@/types.js";
import {
Column,
Entity,
Index,
JoinColumn,
ManyToOne,
Column,
PrimaryColumn,
} from "typeorm";
import { User } from "./user.js";
import { id } from "../id.js";
import { Note } from "./note.js";
import { FollowRequest } from "./follow-request.js";
import { UserGroupInvitation } from "./user-group-invitation.js";
import { AccessToken } from "./access-token.js";
import { notificationTypes } from "@/types.js";
import { FollowRequest } from "./follow-request.js";
import { Note } from "./note.js";
import { UserGroupInvitation } from "./user-group-invitation.js";
import { User } from "./user.js";
@Entity()
export class Notification {

View file

@ -1,14 +1,14 @@
import {
PrimaryColumn,
Column,
Entity,
Index,
JoinColumn,
Column,
ManyToOne,
PrimaryColumn,
} from "typeorm";
import { User } from "./user.js";
import { id } from "../id.js";
import { Page } from "./page.js";
import { User } from "./user.js";
@Entity()
@Index(["userId", "pageId"], { unique: true })

View file

@ -1,14 +1,14 @@
import {
Column,
Entity,
Index,
JoinColumn,
Column,
PrimaryColumn,
ManyToOne,
PrimaryColumn,
} from "typeorm";
import { User } from "./user.js";
import { id } from "../id.js";
import { DriveFile } from "./drive-file.js";
import { User } from "./user.js";
@Entity()
@Index(["userId", "name"], { unique: true })

View file

@ -1,10 +1,10 @@
import {
PrimaryColumn,
Column,
Entity,
Index,
Column,
ManyToOne,
JoinColumn,
ManyToOne,
PrimaryColumn,
} from "typeorm";
import { id } from "../id.js";
import { User } from "./user.js";

View file

@ -1,14 +1,14 @@
import {
PrimaryColumn,
Column,
Entity,
Index,
JoinColumn,
Column,
ManyToOne,
PrimaryColumn,
} from "typeorm";
import { User } from "./user.js";
import { Note } from "./note.js";
import { id } from "../id.js";
import { Note } from "./note.js";
import { User } from "./user.js";
@Entity()
@Index(["userId", "noteId", "choice"], { unique: true })

View file

@ -1,15 +1,15 @@
import {
PrimaryColumn,
Column,
Entity,
Index,
JoinColumn,
Column,
OneToOne,
PrimaryColumn,
} from "typeorm";
import { noteVisibilities } from "../../types.js";
import { id } from "../id.js";
import { Note } from "./note.js";
import type { User } from "./user.js";
import { noteVisibilities } from "../../types.js";
@Entity()
export class Poll {

View file

@ -1,14 +1,14 @@
import {
PrimaryColumn,
Column,
Entity,
Index,
JoinColumn,
Column,
OneToOne,
PrimaryColumn,
} from "typeorm";
import { id } from "../id.js";
import { Note } from "./note.js";
import type { User } from "./user.js";
import { id } from "../id.js";
@Entity()
export class PromoNote {

View file

@ -1,14 +1,14 @@
import {
PrimaryColumn,
Column,
Entity,
Index,
JoinColumn,
Column,
ManyToOne,
PrimaryColumn,
} from "typeorm";
import { id } from "../id.js";
import { Note } from "./note.js";
import { User } from "./user.js";
import { id } from "../id.js";
@Entity()
@Index(["userId", "noteId"], { unique: true })

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