chore: organize backend imports
* remove unused/duplicate imports * replace paths like "../../../define.js" to be more readable * add missing @types packages
This commit is contained in:
parent
09c3825bce
commit
adee17b85a
437 changed files with 884 additions and 887 deletions
|
@ -146,6 +146,8 @@
|
|||
"@swc/core": "1.3.78",
|
||||
"@types/adm-zip": "^0.5.0",
|
||||
"@types/bcryptjs": "2.4.2",
|
||||
"@types/color-convert": "^2.0.2",
|
||||
"@types/content-disposition": "^0.5.7",
|
||||
"@types/escape-regexp": "0.0.1",
|
||||
"@types/fluent-ffmpeg": "2.1.21",
|
||||
"@types/js-yaml": "4.0.5",
|
||||
|
@ -167,6 +169,8 @@
|
|||
"@types/node-fetch": "3.0.3",
|
||||
"@types/nodemailer": "6.4.9",
|
||||
"@types/oauth": "0.9.1",
|
||||
"@types/opencc-js": "^1.0.2",
|
||||
"@types/pg": "^8.10.7",
|
||||
"@types/probe-image-size": "^7.2.0",
|
||||
"@types/pug": "2.0.6",
|
||||
"@types/punycode": "2.1.0",
|
||||
|
@ -179,6 +183,7 @@
|
|||
"@types/sanitize-html": "2.9.0",
|
||||
"@types/semver": "7.5.0",
|
||||
"@types/sinonjs__fake-timers": "8.1.2",
|
||||
"@types/syslog-pro": "^1.0.2",
|
||||
"@types/tinycolor2": "1.4.3",
|
||||
"@types/tmp": "0.2.3",
|
||||
"@types/uuid": "9.0.2",
|
||||
|
|
|
@ -10,10 +10,9 @@ 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 { envOption } from "@/env.js";
|
||||
import { showMachineInfo } from "@/misc/show-machine-info.js";
|
||||
import { db, initDb } from "../db/postgre.js";
|
||||
import { db, initDb } from "@/db/postgre.js";
|
||||
|
||||
const _filename = fileURLToPath(import.meta.url);
|
||||
const _dirname = dirname(_filename);
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import cluster from "node:cluster";
|
||||
import { initDb } from "../db/postgre.js";
|
||||
import config from "@/config/index.js";
|
||||
import { initDb } from "@/db/postgre.js";
|
||||
import os from "node:os";
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import Xev from "xev";
|
||||
import { deliverQueue, inboxQueue } from "../queue/queues.js";
|
||||
import { deliverQueue, inboxQueue } from "@/queue/queues.js";
|
||||
|
||||
const ev = new Xev();
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ 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";
|
||||
import meilisearch from "@/db/meilisearch.js";
|
||||
|
||||
const ev = new Xev();
|
||||
|
||||
|
|
|
@ -74,9 +74,10 @@ import { UserIp } from "@/models/entities/user-ip.js";
|
|||
import { NoteEdit } from "@/models/entities/note-edit.js";
|
||||
|
||||
import { entities as charts } from "@/services/chart/entities.js";
|
||||
import { envOption } from "../env.js";
|
||||
import { dbLogger } from "./logger.js";
|
||||
import { redisClient } from "./redis.js";
|
||||
|
||||
// TODO?: should we avoid importing things from built directory?
|
||||
import { nativeInitDatabase } from "native-utils/built/index.js";
|
||||
|
||||
const sqlLogger = dbLogger.createSubLogger("sql", "gray", false);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { redisClient } from "../db/redis.js";
|
||||
import { redisClient } from "@/db/redis.js";
|
||||
import { Mutex } from "redis-semaphore";
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import fetch from "node-fetch";
|
||||
import { URLSearchParams } from "node:url";
|
||||
import { getAgentByUrl } from "./fetch.js";
|
||||
import { getAgentByUrl } from "@/misc/fetch.js";
|
||||
import config from "@/config/index.js";
|
||||
|
||||
export async function verifyRecaptcha(secret: string, response: string) {
|
||||
|
|
|
@ -2,11 +2,11 @@ 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, UserProfiles } from "@/models/index.js";
|
||||
import { getFullApAccount } from "./convert-host.js";
|
||||
import { getFullApAccount } from "@/misc/convert-host.js";
|
||||
import * as Acct from "@/misc/acct.js";
|
||||
import type { Packed } from "./schema.js";
|
||||
import { Cache } from "./cache.js";
|
||||
import { getWordHardMute } from "./check-word-mute.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);
|
||||
|
|
|
@ -7,7 +7,6 @@ import {
|
|||
ManyToOne,
|
||||
} from "typeorm";
|
||||
import { User } from "./user.js";
|
||||
import { Note } from "./note.js";
|
||||
import { id } from "../id.js";
|
||||
|
||||
@Entity()
|
||||
|
|
|
@ -1,14 +1,5 @@
|
|||
import {
|
||||
PrimaryColumn,
|
||||
Entity,
|
||||
Index,
|
||||
JoinColumn,
|
||||
Column,
|
||||
ManyToOne,
|
||||
PrimaryGeneratedColumn,
|
||||
} from "typeorm";
|
||||
import { Entity, Index, Column, PrimaryGeneratedColumn } from "typeorm";
|
||||
import { id } from "../id.js";
|
||||
import { Note } from "./note.js";
|
||||
import type { User } from "./user.js";
|
||||
|
||||
@Entity()
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
import {} from "typeorm";
|
||||
import { db } from "@/db/postgre.js";
|
||||
|
||||
import { Announcement } from "./entities/announcement.js";
|
||||
import { AnnouncementRead } from "./entities/announcement-read.js";
|
||||
import { Instance } from "./entities/instance.js";
|
||||
import { Poll } from "./entities/poll.js";
|
||||
import { PollVote } from "./entities/poll-vote.js";
|
||||
import { Meta } from "./entities/meta.js";
|
||||
|
|
|
@ -2,12 +2,10 @@ import { db } from "@/db/postgre.js";
|
|||
import { DriveFile } from "@/models/entities/drive-file.js";
|
||||
import type { User } from "@/models/entities/user.js";
|
||||
import { toPuny } from "@/misc/convert-host.js";
|
||||
import { awaitAll, Promiseable } from "@/prelude/await-all.js";
|
||||
import { awaitAll } from "@/prelude/await-all.js";
|
||||
import type { Packed } from "@/misc/schema.js";
|
||||
import config from "@/config/index.js";
|
||||
import { query, appendQuery } from "@/prelude/url.js";
|
||||
import { Meta } from "@/models/entities/meta.js";
|
||||
import { fetchMeta } from "@/misc/fetch-meta.js";
|
||||
import { Users, DriveFolders } from "../index.js";
|
||||
import { deepClone } from "@/misc/clone.js";
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { In, Repository } from "typeorm";
|
||||
import { In } from "typeorm";
|
||||
import { Notification } from "@/models/entities/notification.js";
|
||||
import { awaitAll } from "@/prelude/await-all.js";
|
||||
import type { Packed } from "@/misc/schema.js";
|
||||
|
@ -6,7 +6,6 @@ import type { Note } from "@/models/entities/note.js";
|
|||
import type { NoteReaction } from "@/models/entities/note-reaction.js";
|
||||
import type { User } from "@/models/entities/user.js";
|
||||
import { aggregateNoteEmojis, prefetchEmojis } from "@/misc/populate-emojis.js";
|
||||
import { notificationTypes } from "@/types.js";
|
||||
import { db } from "@/db/postgre.js";
|
||||
import {
|
||||
Users,
|
||||
|
|
|
@ -7,7 +7,6 @@ import type { Packed } from "@/misc/schema.js";
|
|||
import type { Promiseable } from "@/prelude/await-all.js";
|
||||
import { awaitAll } from "@/prelude/await-all.js";
|
||||
import { populateEmojis } from "@/misc/populate-emojis.js";
|
||||
import { getAntennas } from "@/misc/antenna-cache.js";
|
||||
import { USER_ACTIVE_THRESHOLD, USER_ONLINE_THRESHOLD } from "@/const.js";
|
||||
import { Cache } from "@/misc/cache.js";
|
||||
import { db } from "@/db/postgre.js";
|
||||
|
|
|
@ -6,7 +6,7 @@ import { Notes } from "@/models/index.js";
|
|||
import { MoreThan } from "typeorm";
|
||||
import { index } from "@/services/note/create.js";
|
||||
import { Note } from "@/models/entities/note.js";
|
||||
import meilisearch from "../../../db/meilisearch.js";
|
||||
import meilisearch from "@/db/meilisearch.js";
|
||||
|
||||
const logger = queueLogger.createSubLogger("index-all-notes");
|
||||
|
||||
|
|
|
@ -1,14 +1,12 @@
|
|||
import type Bull from "bull";
|
||||
import * as fs from "node:fs";
|
||||
|
||||
import { ulid } from "ulid";
|
||||
import mime from "mime-types";
|
||||
import archiver from "archiver";
|
||||
import { queueLogger } from "../../logger.js";
|
||||
import { addFile } from "@/services/drive/add-file.js";
|
||||
import { format as dateFormat } from "date-fns";
|
||||
import { Users, Emojis } from "@/models/index.js";
|
||||
import {} from "@/queue/types.js";
|
||||
import { createTemp, createTempDir } from "@/misc/create-temp.js";
|
||||
import { downloadUrl } from "@/misc/download-url.js";
|
||||
import config from "@/config/index.js";
|
||||
|
|
|
@ -5,7 +5,7 @@ import * as Acct from "@/misc/acct.js";
|
|||
import { resolveUser } from "@/remote/resolve-user.js";
|
||||
import { downloadTextFile } from "@/misc/download-text-file.js";
|
||||
import { isSelfHost, toPuny } from "@/misc/convert-host.js";
|
||||
import { Users, DriveFiles, Blockings } from "@/models/index.js";
|
||||
import { Users, DriveFiles } from "@/models/index.js";
|
||||
import type { DbUserImportJobData } from "@/queue/types.js";
|
||||
import block from "@/services/blocking/create.js";
|
||||
import { IsNull } from "typeorm";
|
||||
|
|
|
@ -5,7 +5,6 @@ import { queueLogger } from "../../logger.js";
|
|||
import type Bull from "bull";
|
||||
import { htmlToMfm } from "@/remote/activitypub/misc/html-to-mfm.js";
|
||||
import { resolveNote } from "@/remote/activitypub/models/note.js";
|
||||
import { Note } from "@/models/entities/note.js";
|
||||
import { uploadFromUrl } from "@/services/drive/upload-from-url.js";
|
||||
import type { DriveFile } from "@/models/entities/drive-file.js";
|
||||
import { Notes, NoteEdits } from "@/models/index.js";
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
import type Bull from "bull";
|
||||
import { Notes, PollVotes } from "@/models/index.js";
|
||||
import { queueLogger } from "../logger.js";
|
||||
// import { queueLogger } from "../logger.js";
|
||||
import type { EndedPollNotificationJobData } from "@/queue/types.js";
|
||||
import { createNotification } from "@/services/create-notification.js";
|
||||
import { deliverQuestionUpdate } from "@/services/note/polls/update.js";
|
||||
|
||||
const logger = queueLogger.createSubLogger("ended-poll-notification");
|
||||
// unused
|
||||
// const logger = queueLogger.createSubLogger("ended-poll-notification");
|
||||
|
||||
export async function endedPollNotification(
|
||||
job: Bull.Job<EndedPollNotificationJobData>,
|
||||
|
|
|
@ -4,7 +4,6 @@ import { UserProfiles } from "@/models/index.js";
|
|||
import { Not } from "typeorm";
|
||||
import { queueLogger } from "../../logger.js";
|
||||
import { verifyLink } from "@/services/fetch-rel-me.js";
|
||||
import config from "@/config/index.js";
|
||||
|
||||
const logger = queueLogger.createSubLogger("verify-links");
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import { URL } from "node:url";
|
||||
import type Bull from "bull";
|
||||
import Logger from "@/services/logger.js";
|
||||
import type { WebhookDeliverJobData } from "../types.js";
|
||||
|
|
|
@ -8,7 +8,6 @@ import type {
|
|||
CacheableRemoteUser,
|
||||
CacheableUser,
|
||||
} from "@/models/entities/user.js";
|
||||
import { User } from "@/models/entities/user.js";
|
||||
|
||||
type Visibility = "public" | "home" | "followers" | "specified";
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ import type { IRead } from "../type.js";
|
|||
import { getApId } from "../type.js";
|
||||
import { isSelfHost, extractDbHost } from "@/misc/convert-host.js";
|
||||
import { MessagingMessages } from "@/models/index.js";
|
||||
import { readUserMessagingMessage } from "../../../server/api/common/read-messaging-message.js";
|
||||
import { readUserMessagingMessage } from "@/server/api/common/read-messaging-message.js";
|
||||
|
||||
export const performReadActivity = async (
|
||||
actor: CacheableRemoteUser,
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import unfollow from "@/services/following/delete.js";
|
||||
import cancelRequest from "@/services/following/requests/cancel.js";
|
||||
import type { IAccept } from "../../type.js";
|
||||
import type { CacheableRemoteUser } from "@/models/entities/user.js";
|
||||
import { Followings } from "@/models/index.js";
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import * as mfm from "mfm-js";
|
||||
import type { Note } from "@/models/entities/note.js";
|
||||
import { toHtml } from "../../../mfm/to-html.js";
|
||||
import { toHtml } from "@/mfm/to-html.js";
|
||||
|
||||
export default function (note: Note) {
|
||||
if (!note.text) return "";
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import type { IObject } from "../type.js";
|
||||
import { extractApHashtagObjects } from "../models/tag.js";
|
||||
import { fromHtml } from "../../../mfm/from-html.js";
|
||||
import { fromHtml } from "@/mfm/from-html.js";
|
||||
|
||||
export function htmlToMfm(html: string, tag?: IObject | IObject[]) {
|
||||
const hashtagNames = extractApHashtagObjects(tag)
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
import { uploadFromUrl } from "@/services/drive/upload-from-url.js";
|
||||
import type { CacheableRemoteUser } from "@/models/entities/user.js";
|
||||
import { IRemoteUser } from "@/models/entities/user.js";
|
||||
import Resolver from "../resolver.js";
|
||||
import { fetchMeta } from "@/misc/fetch-meta.js";
|
||||
import { apLogger } from "../logger.js";
|
||||
import type { DriveFile } from "@/models/entities/drive-file.js";
|
||||
import { DriveFiles, Users } from "@/models/index.js";
|
||||
import { DriveFiles } from "@/models/index.js";
|
||||
import { truncate } from "@/misc/truncate.js";
|
||||
import { DB_MAX_IMAGE_COMMENT_LENGTH } from "@/misc/hard-limits.js";
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import promiseLimit from "promise-limit";
|
||||
import { toArray, unique } from "@/prelude/array.js";
|
||||
import type { CacheableUser } from "@/models/entities/user.js";
|
||||
import { User } from "@/models/entities/user.js";
|
||||
import type { IObject, IApMention } from "../type.js";
|
||||
import { isMention } from "../type.js";
|
||||
import Resolver from "../resolver.js";
|
||||
|
|
|
@ -6,10 +6,7 @@ import post from "@/services/note/create.js";
|
|||
import { extractMentionedUsers } from "@/services/note/create.js";
|
||||
import { resolvePerson } from "./person.js";
|
||||
import { resolveImage } from "./image.js";
|
||||
import type {
|
||||
ILocalUser,
|
||||
CacheableRemoteUser,
|
||||
} from "@/models/entities/user.js";
|
||||
import type { CacheableRemoteUser } from "@/models/entities/user.js";
|
||||
import { htmlToMfm } from "../misc/html-to-mfm.js";
|
||||
import { extractApHashtags } from "./tag.js";
|
||||
import { unique, toArray, toSingle } from "@/prelude/array.js";
|
||||
|
@ -52,7 +49,6 @@ import { In } from "typeorm";
|
|||
import { DB_MAX_IMAGE_COMMENT_LENGTH } from "@/misc/hard-limits.js";
|
||||
import { truncate } from "@/misc/truncate.js";
|
||||
import { type Size, getEmojiSize } from "@/misc/emoji-meta.js";
|
||||
import { fetchMeta } from "@/misc/fetch-meta.js";
|
||||
import { langmap } from "@/misc/langmap.js";
|
||||
|
||||
const logger = apLogger;
|
||||
|
|
|
@ -8,7 +8,6 @@ import { updateUsertags } from "@/services/update-hashtag.js";
|
|||
import {
|
||||
Users,
|
||||
Instances,
|
||||
DriveFiles,
|
||||
Followings,
|
||||
UserProfiles,
|
||||
UserPublickeys,
|
||||
|
@ -33,8 +32,8 @@ import { publishInternalEvent } from "@/services/stream.js";
|
|||
import { db } from "@/db/postgre.js";
|
||||
import { apLogger } from "../logger.js";
|
||||
import { htmlToMfm } from "../misc/html-to-mfm.js";
|
||||
import { fromHtml } from "../../../mfm/from-html.js";
|
||||
import type { IActor, IObject, IApPropertyValue } from "../type.js";
|
||||
import { fromHtml } from "@/mfm/from-html.js";
|
||||
import type { IActor, IObject } from "../type.js";
|
||||
import {
|
||||
isCollectionOrOrderedCollection,
|
||||
isCollection,
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
import config from "@/config/index.js";
|
||||
import { IObject, IActivity } from "@/remote/activitypub/type.js";
|
||||
import type { ILocalUser } from "@/models/entities/user.js";
|
||||
import { IRemoteUser } from "@/models/entities/user.js";
|
||||
import { getInstanceActor } from "@/services/instance-actor.js";
|
||||
|
||||
// to anonymise reporters, the reporting actor must be a system user
|
||||
// object has to be a uri or array of uris
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import config from "@/config/index.js";
|
||||
import type { User } from "@/models/entities/user.js";
|
||||
import { ILocalUser } from "@/models/entities/user.js";
|
||||
|
||||
export default (object: any, user: { id: User["id"] }) => {
|
||||
if (object == null) return null;
|
||||
|
|
|
@ -7,13 +7,7 @@ import { extractDbHost, isSelfHost } from "@/misc/convert-host.js";
|
|||
import { signedGet } from "./request.js";
|
||||
import type { IObject, ICollection, IOrderedCollection } from "./type.js";
|
||||
import { isCollectionOrOrderedCollection, getApId } from "./type.js";
|
||||
import {
|
||||
FollowRequests,
|
||||
Notes,
|
||||
NoteReactions,
|
||||
Polls,
|
||||
Users,
|
||||
} from "@/models/index.js";
|
||||
import { Notes, NoteReactions, Polls, Users } from "@/models/index.js";
|
||||
import { parseUri } from "./db-resolver.js";
|
||||
import renderNote from "@/remote/activitypub/renderer/note.js";
|
||||
import { renderLike } from "@/remote/activitypub/renderer/like.js";
|
||||
|
|
|
@ -9,7 +9,7 @@ import renderKey from "@/remote/activitypub/renderer/key.js";
|
|||
import { renderPerson } from "@/remote/activitypub/renderer/person.js";
|
||||
import renderEmoji from "@/remote/activitypub/renderer/emoji.js";
|
||||
import { inbox as processInbox } from "@/queue/index.js";
|
||||
import { isSelfHost, toPuny } from "@/misc/convert-host.js";
|
||||
import { isSelfHost } from "@/misc/convert-host.js";
|
||||
import {
|
||||
Notes,
|
||||
Users,
|
||||
|
@ -22,7 +22,6 @@ import { renderLike } from "@/remote/activitypub/renderer/like.js";
|
|||
import { getUserKeypair } from "@/misc/keypair-store.js";
|
||||
import {
|
||||
checkFetch,
|
||||
hasSignature,
|
||||
getSignatureUser,
|
||||
} from "@/remote/activitypub/check-fetch.js";
|
||||
import { getInstanceActor } from "@/services/instance-actor.js";
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import { performance } from "perf_hooks";
|
||||
import type Koa from "koa";
|
||||
import type { CacheableLocalUser } from "@/models/entities/user.js";
|
||||
import { User } from "@/models/entities/user.js";
|
||||
import type { AccessToken } from "@/models/entities/access-token.js";
|
||||
import { getIpHash } from "@/misc/get-ip-hash.js";
|
||||
import { limiter } from "./limiter.js";
|
||||
|
@ -10,7 +9,6 @@ import endpoints from "./endpoints.js";
|
|||
import compatibility from "./compatibility.js";
|
||||
import { ApiError } from "./error.js";
|
||||
import { apiLogger } from "./logger.js";
|
||||
import type { AccessToken } from "@/models/entities/access-token.js";
|
||||
import { fetchMeta } from "@/misc/fetch-meta.js";
|
||||
|
||||
const accessDenied = {
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import * as fs from "node:fs";
|
||||
import Ajv from "ajv";
|
||||
import type { CacheableLocalUser } from "@/models/entities/user.js";
|
||||
import { ILocalUser } from "@/models/entities/user.js";
|
||||
import type { Schema, SchemaType } from "@/misc/schema.js";
|
||||
import type { AccessToken } from "@/models/entities/access-token.js";
|
||||
import type { IEndpointMeta } from "./endpoints.js";
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import define from "../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { AbuseUserReports } from "@/models/index.js";
|
||||
import { makePaginationQuery } from "../../common/make-pagination-query.js";
|
||||
import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js";
|
||||
|
||||
export const meta = {
|
||||
tags: ["admin"],
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import define from "../../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { Users } from "@/models/index.js";
|
||||
import { signup } from "../../../common/signup.js";
|
||||
import { signup } from "@/server/api/common/signup.js";
|
||||
import { IsNull } from "typeorm";
|
||||
|
||||
export const meta = {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import define from "../../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { Users } from "@/models/index.js";
|
||||
import { doPostSuspend } from "@/services/suspend-user.js";
|
||||
import { publishUserEvent } from "@/services/stream.js";
|
||||
|
|
|
@ -2,7 +2,7 @@ import config from "@/config/index.js";
|
|||
import { Meta } from "@/models/entities/meta.js";
|
||||
import { insertModerationLog } from "@/services/insert-moderation-log.js";
|
||||
import { db } from "@/db/postgre.js";
|
||||
import define from "../../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
|
||||
export const meta = {
|
||||
tags: ["admin"],
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import define from "../../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { Ads } from "@/models/index.js";
|
||||
import { genId } from "@/misc/gen-id.js";
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import define from "../../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { Ads } from "@/models/index.js";
|
||||
import { ApiError } from "../../../error.js";
|
||||
import { ApiError } from "@/server/api/error.js";
|
||||
|
||||
export const meta = {
|
||||
tags: ["admin"],
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import define from "../../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { Ads } from "@/models/index.js";
|
||||
import { makePaginationQuery } from "../../../common/make-pagination-query.js";
|
||||
import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js";
|
||||
|
||||
export const meta = {
|
||||
tags: ["admin"],
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import define from "../../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { Ads } from "@/models/index.js";
|
||||
import { ApiError } from "../../../error.js";
|
||||
import { ApiError } from "@/server/api/error.js";
|
||||
|
||||
export const meta = {
|
||||
tags: ["admin"],
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import define from "../../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { Announcements } from "@/models/index.js";
|
||||
import { genId } from "@/misc/gen-id.js";
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import define from "../../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { Announcements } from "@/models/index.js";
|
||||
import { ApiError } from "../../../error.js";
|
||||
import { ApiError } from "@/server/api/error.js";
|
||||
|
||||
export const meta = {
|
||||
tags: ["admin"],
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { Announcements, AnnouncementReads } from "@/models/index.js";
|
||||
import type { Announcement } from "@/models/entities/announcement.js";
|
||||
import define from "../../../define.js";
|
||||
import { makePaginationQuery } from "../../../common/make-pagination-query.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js";
|
||||
|
||||
export const meta = {
|
||||
tags: ["admin"],
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import define from "../../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { Announcements } from "@/models/index.js";
|
||||
import { ApiError } from "../../../error.js";
|
||||
import { ApiError } from "@/server/api/error.js";
|
||||
|
||||
export const meta = {
|
||||
tags: ["admin"],
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { Users, UserProfiles } from "@/models/index.js";
|
||||
import { publishMainStream } from "@/services/stream.js";
|
||||
import define from "../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
|
||||
export const meta = {
|
||||
tags: ["admin"],
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { Users } from "@/models/index.js";
|
||||
import { deleteAccount } from "@/services/delete-account.js";
|
||||
import define from "../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
|
||||
export const meta = {
|
||||
tags: ["admin"],
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import define from "../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { deleteFile } from "@/services/drive/delete-file.js";
|
||||
import { DriveFiles } from "@/models/index.js";
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { Users, UserProfiles, UserSecurityKeys } from "@/models/index.js";
|
||||
import { publishMainStream } from "@/services/stream.js";
|
||||
import define from "../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
|
||||
export const meta = {
|
||||
tags: ["admin"],
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import define from "../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { Users } from "@/models/index.js";
|
||||
import { insertModerationLog } from "@/services/insert-moderation-log.js";
|
||||
import { publishInternalEvent } from "@/services/stream.js";
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import define from "../../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { createCleanRemoteFilesJob } from "@/queue/index.js";
|
||||
|
||||
export const meta = {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { IsNull } from "typeorm";
|
||||
import define from "../../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { deleteFile } from "@/services/drive/delete-file.js";
|
||||
import { DriveFiles } from "@/models/index.js";
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { DriveFiles } from "@/models/index.js";
|
||||
import define from "../../../define.js";
|
||||
import { makePaginationQuery } from "../../../common/make-pagination-query.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js";
|
||||
|
||||
export const meta = {
|
||||
tags: ["admin"],
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { DriveFiles } from "@/models/index.js";
|
||||
import define from "../../../define.js";
|
||||
import { ApiError } from "../../../error.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { ApiError } from "@/server/api/error.js";
|
||||
|
||||
export const meta = {
|
||||
tags: ["admin"],
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import define from "../../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { Emojis } from "@/models/index.js";
|
||||
import { In } from "typeorm";
|
||||
import { ApiError } from "../../../error.js";
|
||||
import { db } from "@/db/postgre.js";
|
||||
|
||||
export const meta = {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import define from "../../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { Emojis, DriveFiles } from "@/models/index.js";
|
||||
import { genId } from "@/misc/gen-id.js";
|
||||
import { insertModerationLog } from "@/services/insert-moderation-log.js";
|
||||
import { ApiError } from "../../../error.js";
|
||||
import { ApiError } from "@/server/api/error.js";
|
||||
import rndstr from "rndstr";
|
||||
import { publishBroadcastStream } from "@/services/stream.js";
|
||||
import { db } from "@/db/postgre.js";
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import define from "../../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { Emojis } from "@/models/index.js";
|
||||
import { genId } from "@/misc/gen-id.js";
|
||||
import { ApiError } from "../../../error.js";
|
||||
import { ApiError } from "@/server/api/error.js";
|
||||
import type { DriveFile } from "@/models/entities/drive-file.js";
|
||||
import { uploadFromUrl } from "@/services/drive/upload-from-url.js";
|
||||
import { publishBroadcastStream } from "@/services/stream.js";
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
import define from "../../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { Emojis } from "@/models/index.js";
|
||||
import { In } from "typeorm";
|
||||
import { insertModerationLog } from "@/services/insert-moderation-log.js";
|
||||
import { ApiError } from "../../../error.js";
|
||||
import { db } from "@/db/postgre.js";
|
||||
|
||||
export const meta = {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import define from "../../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { Emojis } from "@/models/index.js";
|
||||
import { insertModerationLog } from "@/services/insert-moderation-log.js";
|
||||
import { ApiError } from "../../../error.js";
|
||||
import { ApiError } from "@/server/api/error.js";
|
||||
import { db } from "@/db/postgre.js";
|
||||
|
||||
export const meta = {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import define from "../../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { createImportCustomEmojisJob } from "@/queue/index.js";
|
||||
|
||||
export const meta = {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import define from "../../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { Emojis } from "@/models/index.js";
|
||||
import { toPuny } from "@/misc/convert-host.js";
|
||||
import { makePaginationQuery } from "../../../common/make-pagination-query.js";
|
||||
import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js";
|
||||
import { sqlLikeEscape } from "@/misc/sql-like-escape.js";
|
||||
|
||||
export const meta = {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import define from "../../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { Emojis } from "@/models/index.js";
|
||||
import { makePaginationQuery } from "../../../common/make-pagination-query.js";
|
||||
import type { Emoji } from "@/models/entities/emoji.js";
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import define from "../../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { Emojis } from "@/models/index.js";
|
||||
import { In } from "typeorm";
|
||||
import { ApiError } from "../../../error.js";
|
||||
import { db } from "@/db/postgre.js";
|
||||
|
||||
export const meta = {
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import define from "../../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { Emojis } from "@/models/index.js";
|
||||
import { In } from "typeorm";
|
||||
import { ApiError } from "../../../error.js";
|
||||
import { db } from "@/db/postgre.js";
|
||||
|
||||
export const meta = {
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import define from "../../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { Emojis } from "@/models/index.js";
|
||||
import { In } from "typeorm";
|
||||
import { ApiError } from "../../../error.js";
|
||||
import { db } from "@/db/postgre.js";
|
||||
|
||||
export const meta = {
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import define from "../../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { Emojis } from "@/models/index.js";
|
||||
import { In } from "typeorm";
|
||||
import { ApiError } from "../../../error.js";
|
||||
import { db } from "@/db/postgre.js";
|
||||
|
||||
export const meta = {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import define from "../../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { Emojis } from "@/models/index.js";
|
||||
import { ApiError } from "../../../error.js";
|
||||
import { ApiError } from "@/server/api/error.js";
|
||||
import { db } from "@/db/postgre.js";
|
||||
|
||||
export const meta = {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import define from "../../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { deleteFile } from "@/services/drive/delete-file.js";
|
||||
import { DriveFiles } from "@/models/index.js";
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import define from "../../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { Instances } from "@/models/index.js";
|
||||
import { toPuny } from "@/misc/convert-host.js";
|
||||
import { fetchInstanceMetadata } from "@/services/fetch-instance-metadata.js";
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import define from "../../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import deleteFollowing from "@/services/following/delete.js";
|
||||
import { Followings, Users } from "@/models/index.js";
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import define from "../../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { Instances } from "@/models/index.js";
|
||||
import { toPuny } from "@/misc/convert-host.js";
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import define from "../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { db } from "@/db/postgre.js";
|
||||
|
||||
export const meta = {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { db } from "@/db/postgre.js";
|
||||
import define from "../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
|
||||
export const meta = {
|
||||
requireCredential: true,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { UserIps } from "@/models/index.js";
|
||||
import define from "../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
|
||||
export const meta = {
|
||||
tags: ["admin"],
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import rndstr from "rndstr";
|
||||
import define from "../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { RegistrationTickets } from "@/models/index.js";
|
||||
import { genId } from "@/misc/gen-id.js";
|
||||
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
import config from "@/config/index.js";
|
||||
import { fetchMeta } from "@/misc/fetch-meta.js";
|
||||
import { MAX_NOTE_TEXT_LENGTH, MAX_CAPTION_TEXT_LENGTH } from "@/const.js";
|
||||
import define from "../../define.js";
|
||||
import { Exp } from "@tensorflow/tfjs";
|
||||
import define from "@/server/api/define.js";
|
||||
|
||||
export const meta = {
|
||||
tags: ["meta"],
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import define from "../../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { Users } from "@/models/index.js";
|
||||
import { publishInternalEvent } from "@/services/stream.js";
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import define from "../../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { Users } from "@/models/index.js";
|
||||
import { publishInternalEvent } from "@/services/stream.js";
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import define from "../../../define.js";
|
||||
import { ApiError } from "../../../error.js";
|
||||
import { getNote } from "../../../common/getters.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { ApiError } from "@/server/api/error.js";
|
||||
import { getNote } from "@/server/api/common/getters.js";
|
||||
import { PromoNotes } from "@/models/index.js";
|
||||
|
||||
export const meta = {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import define from "../../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { destroy } from "@/queue/index.js";
|
||||
import { insertModerationLog } from "@/services/insert-moderation-log.js";
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { deliverQueue } from "@/queue/queues.js";
|
||||
import { URL } from "node:url";
|
||||
import define from "../../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
|
||||
export const meta = {
|
||||
tags: ["admin"],
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { URL } from "node:url";
|
||||
import define from "../../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { inboxQueue } from "@/queue/queues.js";
|
||||
|
||||
export const meta = {
|
||||
|
|
|
@ -5,7 +5,7 @@ import {
|
|||
objectStorageQueue,
|
||||
backgroundQueue,
|
||||
} from "@/queue/queues.js";
|
||||
import define from "../../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
|
||||
export const meta = {
|
||||
tags: ["admin"],
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { URL } from "node:url";
|
||||
import define from "../../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { addRelay } from "@/services/relay.js";
|
||||
import { ApiError } from "../../../error.js";
|
||||
import { ApiError } from "@/server/api/error.js";
|
||||
|
||||
export const meta = {
|
||||
tags: ["admin"],
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import define from "../../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { listRelay } from "@/services/relay.js";
|
||||
|
||||
export const meta = {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import define from "../../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { removeRelay } from "@/services/relay.js";
|
||||
|
||||
export const meta = {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import define from "../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
// import bcrypt from "bcryptjs";
|
||||
import rndstr from "rndstr";
|
||||
import { Users, UserProfiles } from "@/models/index.js";
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import define from "../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { AbuseUserReports, Users } from "@/models/index.js";
|
||||
import { getInstanceActor } from "@/services/instance-actor.js";
|
||||
import { deliver } from "@/queue/index.js";
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import define from "../../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { createIndexAllNotesJob } from "@/queue/index.js";
|
||||
|
||||
export const meta = {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import define from "../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { sendEmail } from "@/services/send-email.js";
|
||||
|
||||
export const meta = {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import sanitizeHtml from "sanitize-html";
|
||||
import define from "../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { Users, UserProfiles } from "@/models/index.js";
|
||||
import { ApiError } from "../../error.js";
|
||||
import { ApiError } from "@/server/api/error.js";
|
||||
import { sendEmail } from "@/services/send-email.js";
|
||||
import { createNotification } from "@/services/create-notification.js";
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import * as os from "node:os";
|
||||
import si from "systeminformation";
|
||||
import define from "../../define.js";
|
||||
import { redisClient } from "../../../../db/redis.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { redisClient } from "@/db/redis.js";
|
||||
import { db } from "@/db/postgre.js";
|
||||
|
||||
export const meta = {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import define from "../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { ModerationLogs } from "@/models/index.js";
|
||||
import { makePaginationQuery } from "../../common/make-pagination-query.js";
|
||||
import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js";
|
||||
|
||||
export const meta = {
|
||||
tags: ["admin"],
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { Signins, UserProfiles, Users } from "@/models/index.js";
|
||||
import define from "../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
|
||||
export const meta = {
|
||||
tags: ["admin"],
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { Users } from "@/models/index.js";
|
||||
import define from "../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { sqlLikeEscape } from "@/misc/sql-like-escape.js";
|
||||
|
||||
export const meta = {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import define from "../../define.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { Users } from "@/models/index.js";
|
||||
import { insertModerationLog } from "@/services/insert-moderation-log.js";
|
||||
import { publishInternalEvent } from "@/services/stream.js";
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue