chore: unsafe linting
This commit is contained in:
parent
1b517b584a
commit
7dfc52b681
688 changed files with 2873 additions and 2869 deletions
|
@ -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);
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
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 { db, initDb } from "@/db/postgre.js";
|
||||
import { envOption } from "@/env.js";
|
||||
import { showMachineInfo } from "@/misc/show-machine-info.js";
|
||||
import { db, initDb } from "@/db/postgre.js";
|
||||
import Logger from "@/services/logger.js";
|
||||
|
||||
const _filename = fileURLToPath(import.meta.url);
|
||||
const _dirname = dirname(_filename);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import cluster from "node:cluster";
|
||||
import { initDb } from "@/db/postgre.js";
|
||||
import os from "node:os";
|
||||
import { initDb } from "@/db/postgre.js";
|
||||
|
||||
/**
|
||||
* Init worker process
|
||||
|
@ -25,6 +25,6 @@ export async function workerMain() {
|
|||
|
||||
if (cluster.isWorker) {
|
||||
// Send a 'ready' message to parent process
|
||||
process.send!("ready");
|
||||
process.send?.("ready");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import Xev from "xev";
|
||||
import { deliverQueue, inboxQueue } from "@/queue/queues.js";
|
||||
import Xev from "xev";
|
||||
|
||||
const ev = new Xev();
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import meilisearch from "@/db/meilisearch.js";
|
||||
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();
|
||||
|
||||
|
|
|
@ -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: {
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
@ -154,7 +154,7 @@ function timestampToUnix(timestamp: string) {
|
|||
if (unix === 0) {
|
||||
// Try to parse the timestamp as JavaScript Date
|
||||
const date = Date.parse(timestamp);
|
||||
if (isNaN(date)) return 0;
|
||||
if (Number.isNaN(date)) return 0;
|
||||
unix = date / 1000;
|
||||
}
|
||||
|
||||
|
@ -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[]) => {
|
||||
|
|
|
@ -2,76 +2,76 @@
|
|||
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 { dbLogger } from "./logger.js";
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 { Window } from "happy-dom";
|
||||
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,
|
||||
|
|
|
@ -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[] = [];
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
// https://gist.github.com/nfantone/1eaa803772025df69d07f4dbf5df7e58
|
||||
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* @callback BeforeShutdownListener
|
||||
* @param {string} [signalOrEvent] The exit signal or event name received on the process.
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import fetch from "node-fetch";
|
||||
import { URLSearchParams } from "node:url";
|
||||
import { getAgentByUrl } from "@/misc/fetch.js";
|
||||
import config from "@/config/index.js";
|
||||
import { getAgentByUrl } from "@/misc/fetch.js";
|
||||
import fetch from "node-fetch";
|
||||
|
||||
export async function verifyRecaptcha(secret: string, response: string) {
|
||||
const result = await getCaptchaResponse(
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import * as Acct from "@/misc/acct.js";
|
||||
import { Cache } from "@/misc/cache.js";
|
||||
import { getWordHardMute } from "@/misc/check-word-mute.js";
|
||||
import type { Packed } from "@/misc/schema.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 { Blockings, Followings, UserProfiles } from "@/models/index.js";
|
||||
import { getFullApAccount } from "./convert-host.js";
|
||||
import * as Acct from "@/misc/acct.js";
|
||||
import type { Packed } from "@/misc/schema.js";
|
||||
import { Cache } from "@/misc/cache.js";
|
||||
import { getWordHardMute } from "@/misc/check-word-mute.js";
|
||||
|
||||
const blockingCache = new Cache<User["id"][]>("blocking", 60 * 5);
|
||||
const mutedWordsCache = new Cache<string[][] | undefined>("mutedWords", 60 * 5);
|
||||
|
@ -78,8 +78,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()),
|
||||
),
|
||||
);
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import RE2 from "re2";
|
||||
import type { Note } from "@/models/entities/note.js";
|
||||
import RE2 from "re2";
|
||||
|
||||
type NoteLike = {
|
||||
userId: Note["userId"];
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { detect } from "tinyld";
|
||||
import * as mfm from "mfm-js";
|
||||
import { detect } from "tinyld";
|
||||
|
||||
export default function detectLanguage(text: string): string {
|
||||
const nodes = mfm.parse(text);
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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) => {
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -19,7 +19,7 @@ function getNoise() {
|
|||
|
||||
export function genAid(date: Date): string {
|
||||
const t = date.getTime();
|
||||
if (isNaN(t)) throw "Failed to create AID: Invalid Date";
|
||||
if (Number.isNaN(t)) throw "Failed to create AID: Invalid Date";
|
||||
counter++;
|
||||
return getTime(t) + getNoise();
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -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 || ""}`,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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";
|
||||
|
||||
export function convertReactions(reactions: Record<string, number>) {
|
||||
const result = new Map();
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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[] = [];
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { Entity, Index, Column, PrimaryColumn } from "typeorm";
|
||||
import { Column, Entity, Index, PrimaryColumn } from "typeorm";
|
||||
import { id } from "../id.js";
|
||||
|
||||
@Entity()
|
||||
|
|
|
@ -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 })
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { Entity, Index, Column, PrimaryColumn } from "typeorm";
|
||||
import { Column, Entity, Index, PrimaryColumn } from "typeorm";
|
||||
import { id } from "../id.js";
|
||||
|
||||
@Entity()
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 })
|
||||
|
|
|
@ -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 })
|
||||
|
|
|
@ -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 })
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 })
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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"])
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { PrimaryColumn, Entity, Index, Column } from "typeorm";
|
||||
import { Column, Entity, Index, PrimaryColumn } from "typeorm";
|
||||
import { id } from "../id.js";
|
||||
|
||||
@Entity()
|
||||
|
|
|
@ -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 })
|
||||
|
|
|
@ -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 })
|
||||
|
|
|
@ -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 })
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { Entity, PrimaryColumn, Index, Column } from "typeorm";
|
||||
import { Column, Entity, Index, PrimaryColumn } from "typeorm";
|
||||
import { id } from "../id.js";
|
||||
|
||||
@Entity()
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 })
|
||||
|
|
|
@ -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 })
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 })
|
||||
|
|
|
@ -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 })
|
||||
|
|
|
@ -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(["userId", "threadId"], { unique: true })
|
||||
|
|
|
@ -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 })
|
||||
|
|
|
@ -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 })
|
||||
|
|
|
@ -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 })
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 })
|
||||
|
|
|
@ -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 })
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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 })
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 })
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { PrimaryColumn, Entity, Index, Column } from "typeorm";
|
||||
import { Column, Entity, Index, PrimaryColumn } from "typeorm";
|
||||
import { id } from "../id.js";
|
||||
|
||||
@Entity()
|
||||
|
|
|
@ -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";
|
||||
|
||||
// TODO: 同じdomain、同じscope、同じkeyのレコードは二つ以上存在しないように制約付けたい
|
||||
@Entity()
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { PrimaryColumn, Entity, Index, Column } from "typeorm";
|
||||
import { Column, Entity, Index, PrimaryColumn } from "typeorm";
|
||||
import { id } from "../id.js";
|
||||
|
||||
@Entity()
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import {
|
||||
PrimaryColumn,
|
||||
Column,
|
||||
Entity,
|
||||
Index,
|
||||
JoinColumn,
|
||||
Column,
|
||||
ManyToOne,
|
||||
PrimaryColumn,
|
||||
} from "typeorm";
|
||||
import { id } from "../id.js";
|
||||
import { User } from "./user.js";
|
||||
|
|
|
@ -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 Signin {
|
||||
|
|
|
@ -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 SwSubscription {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { PrimaryColumn, Entity, Column } from "typeorm";
|
||||
import { Column, Entity, PrimaryColumn } from "typeorm";
|
||||
|
||||
@Entity()
|
||||
export class UsedUsername {
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
import {
|
||||
PrimaryColumn,
|
||||
Column,
|
||||
Entity,
|
||||
Index,
|
||||
JoinColumn,
|
||||
Column,
|
||||
ManyToOne,
|
||||
PrimaryColumn,
|
||||
} from "typeorm";
|
||||
import { User } from "./user.js";
|
||||
import { UserGroup } from "./user-group.js";
|
||||
import { id } from "../id.js";
|
||||
import { UserGroup } from "./user-group.js";
|
||||
import { User } from "./user.js";
|
||||
|
||||
@Entity()
|
||||
@Index(["userId", "userGroupId"], { unique: true })
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
import {
|
||||
PrimaryColumn,
|
||||
Column,
|
||||
Entity,
|
||||
Index,
|
||||
JoinColumn,
|
||||
Column,
|
||||
ManyToOne,
|
||||
PrimaryColumn,
|
||||
} from "typeorm";
|
||||
import { User } from "./user.js";
|
||||
import { UserGroup } from "./user-group.js";
|
||||
import { id } from "../id.js";
|
||||
import { UserGroup } from "./user-group.js";
|
||||
import { User } from "./user.js";
|
||||
|
||||
@Entity()
|
||||
@Index(["userId", "userGroupId"], { unique: true })
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
import {
|
||||
Column,
|
||||
Entity,
|
||||
Index,
|
||||
JoinColumn,
|
||||
Column,
|
||||
PrimaryColumn,
|
||||
ManyToOne,
|
||||
PrimaryColumn,
|
||||
} from "typeorm";
|
||||
import { User } from "./user.js";
|
||||
import { id } from "../id.js";
|
||||
import { User } from "./user.js";
|
||||
|
||||
@Entity()
|
||||
export class UserGroup {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { Entity, Index, Column, PrimaryGeneratedColumn } from "typeorm";
|
||||
import { Column, Entity, Index, PrimaryGeneratedColumn } from "typeorm";
|
||||
import { id } from "../id.js";
|
||||
import type { User } from "./user.js";
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { PrimaryColumn, Entity, JoinColumn, Column, OneToOne } from "typeorm";
|
||||
import { User } from "./user.js";
|
||||
import { Column, Entity, JoinColumn, OneToOne, PrimaryColumn } from "typeorm";
|
||||
import { id } from "../id.js";
|
||||
import { User } from "./user.js";
|
||||
|
||||
@Entity()
|
||||
export class UserKeypair {
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
import {
|
||||
PrimaryColumn,
|
||||
Column,
|
||||
Entity,
|
||||
Index,
|
||||
JoinColumn,
|
||||
Column,
|
||||
ManyToOne,
|
||||
PrimaryColumn,
|
||||
} from "typeorm";
|
||||
import { User } from "./user.js";
|
||||
import { UserList } from "./user-list.js";
|
||||
import { id } from "../id.js";
|
||||
import { UserList } from "./user-list.js";
|
||||
import { User } from "./user.js";
|
||||
|
||||
@Entity()
|
||||
@Index(["userId", "userListId"], { unique: true })
|
||||
|
|
|
@ -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 UserList {
|
||||
|
|
|
@ -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 })
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { PrimaryColumn, Entity, Index, Column } from "typeorm";
|
||||
import { Column, Entity, Index, PrimaryColumn } from "typeorm";
|
||||
import { id } from "../id.js";
|
||||
|
||||
@Entity()
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
import { ffVisibility, notificationTypes } from "@/types.js";
|
||||
import {
|
||||
Entity,
|
||||
Column,
|
||||
Entity,
|
||||
Index,
|
||||
OneToOne,
|
||||
JoinColumn,
|
||||
OneToOne,
|
||||
PrimaryColumn,
|
||||
} from "typeorm";
|
||||
import { ffVisibility, notificationTypes } from "@/types.js";
|
||||
import { id } from "../id.js";
|
||||
import { User } from "./user.js";
|
||||
import { Page } from "./page.js";
|
||||
import { User } from "./user.js";
|
||||
|
||||
// TODO: このテーブルで管理している情報すべてレジストリで管理するようにしても良いかも
|
||||
// ただ、「emailVerified が true なユーザーを find する」のようなクエリは書けなくなるからウーン
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
import {
|
||||
PrimaryColumn,
|
||||
Column,
|
||||
Entity,
|
||||
Index,
|
||||
JoinColumn,
|
||||
Column,
|
||||
OneToOne,
|
||||
PrimaryColumn,
|
||||
} from "typeorm";
|
||||
import { User } from "./user.js";
|
||||
import { id } from "../id.js";
|
||||
import { User } from "./user.js";
|
||||
|
||||
@Entity()
|
||||
export class UserPublickey {
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue