diff --git a/src/argv.ts b/src/argv.ts index 5d1aeb70a0..106ecf2675 100644 --- a/src/argv.ts +++ b/src/argv.ts @@ -1,5 +1,5 @@ import { Command } from 'commander'; -import config from '@/config/index.js'; +import config from '@/config/index'; const program = new Command(); diff --git a/src/boot/index.ts b/src/boot/index.ts index 091793e530..20c53a366c 100644 --- a/src/boot/index.ts +++ b/src/boot/index.ts @@ -2,13 +2,13 @@ import * as cluster from 'cluster'; import * as chalk from 'chalk'; import Xev from 'xev'; -import Logger from '@/services/logger.js'; -import { program } from '../argv.js'; +import Logger from '@/services/logger'; +import { program } from '../argv'; // for typeorm import 'reflect-metadata'; -import { masterMain } from './master.js'; -import { workerMain } from './worker.js'; +import { masterMain } from './master'; +import { workerMain } from './worker'; const logger = new Logger('core', 'cyan'); const clusterLogger = logger.createSubLogger('cluster', 'orange', false); diff --git a/src/boot/master.ts b/src/boot/master.ts index 98da016f44..4cd91dc66a 100644 --- a/src/boot/master.ts +++ b/src/boot/master.ts @@ -4,13 +4,13 @@ import * as chalk from 'chalk'; import * as portscanner from 'portscanner'; import { getConnection } from 'typeorm'; -import Logger from '@/services/logger.js'; -import loadConfig from '@/config/load.js'; -import { Config } from '@/config/types.js'; -import { lessThan } from '../prelude/array.js'; -import { program } from '../argv.js'; -import { showMachineInfo } from '@/misc/show-machine-info.js'; -import { initDb } from '../db/postgre.js'; +import Logger from '@/services/logger'; +import loadConfig from '@/config/load'; +import { Config } from '@/config/types'; +import { lessThan } from '../prelude/array'; +import { program } from '../argv'; +import { showMachineInfo } from '@/misc/show-machine-info'; +import { initDb } from '../db/postgre'; import * as meta from '../meta.json'; const logger = new Logger('core', 'cyan'); diff --git a/src/boot/worker.ts b/src/boot/worker.ts index 881e6c723d..362fa3f26b 100644 --- a/src/boot/worker.ts +++ b/src/boot/worker.ts @@ -1,5 +1,5 @@ import * as cluster from 'cluster'; -import { initDb } from '../db/postgre.js'; +import { initDb } from '../db/postgre'; /** * Init worker process diff --git a/src/config/index.ts b/src/config/index.ts index 3e53b00036..7bfdca4612 100644 --- a/src/config/index.ts +++ b/src/config/index.ts @@ -1,3 +1,3 @@ -import load from './load.js'; +import load from './load'; export default load(); diff --git a/src/config/load.ts b/src/config/load.ts index 920efad4d6..6a1cf60a41 100644 --- a/src/config/load.ts +++ b/src/config/load.ts @@ -6,7 +6,7 @@ import * as fs from 'fs'; import { fileURLToPath } from 'url'; import { dirname } from 'path'; import * as yaml from 'js-yaml'; -import { Source, Mixin } from './types.js'; +import { Source, Mixin } from './types'; import * as meta from '../meta.json'; //const _filename = fileURLToPath(import.meta.url); diff --git a/src/daemons/janitor.ts b/src/daemons/janitor.ts index 2bffbc55d1..72568cfe18 100644 --- a/src/daemons/janitor.ts +++ b/src/daemons/janitor.ts @@ -1,7 +1,7 @@ // TODO: 消したい const interval = 30 * 60 * 1000; -import { AttestationChallenges } from '@/models/index.js'; +import { AttestationChallenges } from '@/models/index'; import { LessThan } from 'typeorm'; /** diff --git a/src/daemons/queue-stats.ts b/src/daemons/queue-stats.ts index 945bb1bd02..77f09b18d6 100644 --- a/src/daemons/queue-stats.ts +++ b/src/daemons/queue-stats.ts @@ -1,5 +1,5 @@ import Xev from 'xev'; -import { deliverQueue, inboxQueue } from '../queue/queues.js'; +import { deliverQueue, inboxQueue } from '../queue/queues'; const ev = new Xev(); diff --git a/src/db/elasticsearch.ts b/src/db/elasticsearch.ts index b21685069c..c99183007a 100644 --- a/src/db/elasticsearch.ts +++ b/src/db/elasticsearch.ts @@ -1,5 +1,5 @@ import * as elasticsearch from '@elastic/elasticsearch'; -import config from '@/config/index.js'; +import config from '@/config/index'; const index = { settings: { diff --git a/src/db/logger.ts b/src/db/logger.ts index 22f4c6b1b0..62f90555a0 100644 --- a/src/db/logger.ts +++ b/src/db/logger.ts @@ -1,3 +1,3 @@ -import Logger from '@/services/logger.js'; +import Logger from '@/services/logger'; export const dbLogger = new Logger('db'); diff --git a/src/db/postgre.ts b/src/db/postgre.ts index 881f1e4da3..c963242488 100644 --- a/src/db/postgre.ts +++ b/src/db/postgre.ts @@ -3,75 +3,75 @@ const types = require('pg').types; types.setTypeParser(20, Number); import { createConnection, Logger, getConnection } from 'typeorm'; -import config from '@/config/index.js'; -import { entities as charts } from '@/services/chart/entities.js'; -import { dbLogger } from './logger.js'; +import config from '@/config/index'; +import { entities as charts } from '@/services/chart/entities'; +import { dbLogger } from './logger'; import * as highlight from 'cli-highlight'; -import { Log } from '@/models/entities/log.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 { 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 { 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 { ReversiGame } from '@/models/entities/games/reversi/game.js'; -import { ReversiMatching } from '@/models/entities/games/reversi/matching.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 { AnnouncementRead } from '@/models/entities/announcement-read.js'; -import { Clip } from '@/models/entities/clip.js'; -import { ClipNote } from '@/models/entities/clip-note.js'; -import { Antenna } from '@/models/entities/antenna.js'; -import { AntennaNote } from '@/models/entities/antenna-note.js'; -import { PromoNote } from '@/models/entities/promo-note.js'; -import { PromoRead } from '@/models/entities/promo-read.js'; -import { program } from '../argv.js'; -import { Relay } from '@/models/entities/relay.js'; -import { MutedNote } from '@/models/entities/muted-note.js'; -import { Channel } from '@/models/entities/channel.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 { Log } from '@/models/entities/log'; +import { User } from '@/models/entities/user'; +import { DriveFile } from '@/models/entities/drive-file'; +import { DriveFolder } from '@/models/entities/drive-folder'; +import { AccessToken } from '@/models/entities/access-token'; +import { App } from '@/models/entities/app'; +import { PollVote } from '@/models/entities/poll-vote'; +import { Note } from '@/models/entities/note'; +import { NoteReaction } from '@/models/entities/note-reaction'; +import { NoteWatching } from '@/models/entities/note-watching'; +import { NoteUnread } from '@/models/entities/note-unread'; +import { Notification } from '@/models/entities/notification'; +import { Meta } from '@/models/entities/meta'; +import { Following } from '@/models/entities/following'; +import { Instance } from '@/models/entities/instance'; +import { Muting } from '@/models/entities/muting'; +import { SwSubscription } from '@/models/entities/sw-subscription'; +import { Blocking } from '@/models/entities/blocking'; +import { UserList } from '@/models/entities/user-list'; +import { UserListJoining } from '@/models/entities/user-list-joining'; +import { UserGroup } from '@/models/entities/user-group'; +import { UserGroupJoining } from '@/models/entities/user-group-joining'; +import { UserGroupInvitation } from '@/models/entities/user-group-invitation'; +import { Hashtag } from '@/models/entities/hashtag'; +import { NoteFavorite } from '@/models/entities/note-favorite'; +import { AbuseUserReport } from '@/models/entities/abuse-user-report'; +import { RegistrationTicket } from '@/models/entities/registration-tickets'; +import { MessagingMessage } from '@/models/entities/messaging-message'; +import { Signin } from '@/models/entities/signin'; +import { AuthSession } from '@/models/entities/auth-session'; +import { FollowRequest } from '@/models/entities/follow-request'; +import { Emoji } from '@/models/entities/emoji'; +import { ReversiGame } from '@/models/entities/games/reversi/game'; +import { ReversiMatching } from '@/models/entities/games/reversi/matching'; +import { UserNotePining } from '@/models/entities/user-note-pining'; +import { Poll } from '@/models/entities/poll'; +import { UserKeypair } from '@/models/entities/user-keypair'; +import { UserPublickey } from '@/models/entities/user-publickey'; +import { UserProfile } from '@/models/entities/user-profile'; +import { UserSecurityKey } from '@/models/entities/user-security-key'; +import { AttestationChallenge } from '@/models/entities/attestation-challenge'; +import { Page } from '@/models/entities/page'; +import { PageLike } from '@/models/entities/page-like'; +import { GalleryPost } from '@/models/entities/gallery-post'; +import { GalleryLike } from '@/models/entities/gallery-like'; +import { ModerationLog } from '@/models/entities/moderation-log'; +import { UsedUsername } from '@/models/entities/used-username'; +import { Announcement } from '@/models/entities/announcement'; +import { AnnouncementRead } from '@/models/entities/announcement-read'; +import { Clip } from '@/models/entities/clip'; +import { ClipNote } from '@/models/entities/clip-note'; +import { Antenna } from '@/models/entities/antenna'; +import { AntennaNote } from '@/models/entities/antenna-note'; +import { PromoNote } from '@/models/entities/promo-note'; +import { PromoRead } from '@/models/entities/promo-read'; +import { program } from '../argv'; +import { Relay } from '@/models/entities/relay'; +import { MutedNote } from '@/models/entities/muted-note'; +import { Channel } from '@/models/entities/channel'; +import { ChannelFollowing } from '@/models/entities/channel-following'; +import { ChannelNotePining } from '@/models/entities/channel-note-pining'; +import { RegistryItem } from '@/models/entities/registry-item'; +import { Ad } from '@/models/entities/ad'; +import { PasswordResetRequest } from '@/models/entities/password-reset-request'; const sqlLogger = dbLogger.createSubLogger('sql', 'white', false); diff --git a/src/db/redis.ts b/src/db/redis.ts index 97500e02b3..7e0ee1e3ce 100644 --- a/src/db/redis.ts +++ b/src/db/redis.ts @@ -1,5 +1,5 @@ import * as redis from 'redis'; -import config from '@/config/index.js'; +import config from '@/config/index'; export function createConnection() { return redis.createClient( diff --git a/src/index.ts b/src/index.ts index 7c131b2618..db1b53f51b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -6,7 +6,7 @@ Error.stackTraceLimit = Infinity; require('events').EventEmitter.defaultMaxListeners = 128; -import boot from './boot/index.js'; +import boot from './boot/index'; export default function() { return boot(); diff --git a/src/mfm/to-html.ts b/src/mfm/to-html.ts index 6ce7d35efa..6dbcc17d29 100644 --- a/src/mfm/to-html.ts +++ b/src/mfm/to-html.ts @@ -1,9 +1,9 @@ import { JSDOM } from 'jsdom'; import * as mfm from 'mfm-js'; -import config from '@/config/index.js'; -import { intersperse } from '../prelude/array.js'; -import { IMentionedRemoteUsers } from '@/models/entities/note.js'; -import { wellKnownServices } from '../well-known-services.js'; +import config from '@/config/index'; +import { intersperse } from '../prelude/array'; +import { IMentionedRemoteUsers } from '@/models/entities/note'; +import { wellKnownServices } from '../well-known-services'; export function toHtml(nodes: mfm.MfmNode[] | null, mentionedRemoteUsers: IMentionedRemoteUsers = []) { if (nodes == null) { diff --git a/src/misc/antenna-cache.ts b/src/misc/antenna-cache.ts index dcf96c1610..a23eeb45ec 100644 --- a/src/misc/antenna-cache.ts +++ b/src/misc/antenna-cache.ts @@ -1,6 +1,6 @@ -import { Antennas } from '@/models/index.js'; -import { Antenna } from '@/models/entities/antenna.js'; -import { subsdcriber } from '../db/redis.js'; +import { Antennas } from '@/models/index'; +import { Antenna } from '@/models/entities/antenna'; +import { subsdcriber } from '../db/redis'; let antennasFetched = false; let antennas: Antenna[] = []; diff --git a/src/misc/app-lock.ts b/src/misc/app-lock.ts index 52ac680715..a32b600612 100644 --- a/src/misc/app-lock.ts +++ b/src/misc/app-lock.ts @@ -1,4 +1,4 @@ -import { redisClient } from '../db/redis.js'; +import { redisClient } from '../db/redis'; import { promisify } from 'util'; import * as redisLock from 'redis-lock'; diff --git a/src/misc/captcha.ts b/src/misc/captcha.ts index 4623565c3c..f36943b589 100644 --- a/src/misc/captcha.ts +++ b/src/misc/captcha.ts @@ -1,7 +1,7 @@ import fetch from 'node-fetch'; import { URLSearchParams } from 'url'; -import { getAgentByUrl } from './fetch.js'; -import config from '@/config/index.js'; +import { getAgentByUrl } from './fetch'; +import config from '@/config/index'; export async function verifyRecaptcha(secret: string, response: string) { const result = await getCaptchaResponse('https://www.recaptcha.net/recaptcha/api/siteverify', secret, response).catch(e => { diff --git a/src/misc/check-hit-antenna.ts b/src/misc/check-hit-antenna.ts index fdba66b640..38965f4b0d 100644 --- a/src/misc/check-hit-antenna.ts +++ b/src/misc/check-hit-antenna.ts @@ -1,10 +1,10 @@ -import { Antenna } from '@/models/entities/antenna.js'; -import { Note } from '@/models/entities/note.js'; -import { User } from '@/models/entities/user.js'; -import { UserListJoinings, UserGroupJoinings } from '@/models/index.js'; -import { getFullApAccount } from './convert-host.js'; -import { PackedNote } from '../models/repositories/note.js'; -import { parseAcct } from '@/misc/acct.js'; +import { Antenna } from '@/models/entities/antenna'; +import { Note } from '@/models/entities/note'; +import { User } from '@/models/entities/user'; +import { UserListJoinings, UserGroupJoinings } from '@/models/index'; +import { getFullApAccount } from './convert-host'; +import { PackedNote } from '../models/repositories/note'; +import { parseAcct } from '@/misc/acct'; /** * noteUserFollowers / antennaUserFollowing はどちらか一方が指定されていればよい diff --git a/src/misc/check-word-mute.ts b/src/misc/check-word-mute.ts index f12e552ebd..e2e871dd2b 100644 --- a/src/misc/check-word-mute.ts +++ b/src/misc/check-word-mute.ts @@ -1,6 +1,6 @@ const RE2 = require('re2'); -import { Note } from '@/models/entities/note.js'; -import { User } from '@/models/entities/user.js'; +import { Note } from '@/models/entities/note'; +import { User } from '@/models/entities/user'; type NoteLike = { userId: Note['userId']; diff --git a/src/misc/convert-host.ts b/src/misc/convert-host.ts index 2e705cb6b1..6e9f6ed3e9 100644 --- a/src/misc/convert-host.ts +++ b/src/misc/convert-host.ts @@ -1,5 +1,5 @@ import { URL } from 'url'; -import config from '@/config/index.js'; +import config from '@/config/index'; import { toASCII } from 'punycode/'; export function getFullApAccount(username: string, host: string | null) { diff --git a/src/misc/count-same-renotes.ts b/src/misc/count-same-renotes.ts index b7f8ce90c8..6628761182 100644 --- a/src/misc/count-same-renotes.ts +++ b/src/misc/count-same-renotes.ts @@ -1,4 +1,4 @@ -import { Notes } from '@/models/index.js'; +import { Notes } from '@/models/index'; export async function countSameRenotes(userId: string, renoteId: string, excludeNoteId: string | undefined): Promise { // 指定したユーザーの指定したノートのリノートがいくつあるか数える diff --git a/src/misc/detect-url-mime.ts b/src/misc/detect-url-mime.ts index cd143cf2fb..274c291737 100644 --- a/src/misc/detect-url-mime.ts +++ b/src/misc/detect-url-mime.ts @@ -1,6 +1,6 @@ -import { createTemp } from './create-temp.js'; -import { downloadUrl } from './download-url.js'; -import { detectType } from './get-file-info.js'; +import { createTemp } from './create-temp'; +import { downloadUrl } from './download-url'; +import { detectType } from './get-file-info'; export async function detectUrlMime(url: string) { const [path, cleanup] = await createTemp(); diff --git a/src/misc/download-text-file.ts b/src/misc/download-text-file.ts index 745604c19c..e8e23cc120 100644 --- a/src/misc/download-text-file.ts +++ b/src/misc/download-text-file.ts @@ -1,8 +1,8 @@ import * as fs from 'fs'; import * as util from 'util'; -import Logger from '@/services/logger.js'; -import { createTemp } from './create-temp.js'; -import { downloadUrl } from './download-url.js'; +import Logger from '@/services/logger'; +import { createTemp } from './create-temp'; +import { downloadUrl } from './download-url'; const logger = new Logger('download-text-file'); diff --git a/src/misc/download-url.ts b/src/misc/download-url.ts index f01f34e6db..43e061c715 100644 --- a/src/misc/download-url.ts +++ b/src/misc/download-url.ts @@ -3,11 +3,11 @@ import * as stream from 'stream'; import * as util from 'util'; import { URL } from 'url'; import fetch from 'node-fetch'; -import { getAgentByUrl } from './fetch.js'; +import { getAgentByUrl } from './fetch'; import { AbortController } from 'abort-controller'; -import config from '@/config/index.js'; +import config from '@/config/index'; import * as chalk from 'chalk'; -import Logger from '@/services/logger.js'; +import Logger from '@/services/logger'; const pipeline = util.promisify(stream.pipeline); diff --git a/src/misc/extract-custom-emojis-from-mfm.ts b/src/misc/extract-custom-emojis-from-mfm.ts index a0319d8dd5..b29ce281b3 100644 --- a/src/misc/extract-custom-emojis-from-mfm.ts +++ b/src/misc/extract-custom-emojis-from-mfm.ts @@ -1,5 +1,5 @@ import * as mfm from 'mfm-js'; -import { unique } from '@/prelude/array.js'; +import { unique } from '@/prelude/array'; export function extractCustomEmojisFromMfm(nodes: mfm.MfmNode[]): string[] { const emojiNodes = mfm.extract(nodes, (node) => { diff --git a/src/misc/extract-hashtags.ts b/src/misc/extract-hashtags.ts index 0b0418eefd..b0a74df219 100644 --- a/src/misc/extract-hashtags.ts +++ b/src/misc/extract-hashtags.ts @@ -1,5 +1,5 @@ import * as mfm from 'mfm-js'; -import { unique } from '@/prelude/array.js'; +import { unique } from '@/prelude/array'; export function extractHashtags(nodes: mfm.MfmNode[]): string[] { const hashtagNodes = mfm.extract(nodes, (node) => node.type === 'hashtag'); diff --git a/src/misc/fetch-meta.ts b/src/misc/fetch-meta.ts index 3d7e69f2da..a0bcdd4d48 100644 --- a/src/misc/fetch-meta.ts +++ b/src/misc/fetch-meta.ts @@ -1,4 +1,4 @@ -import { Meta } from '@/models/entities/meta.js'; +import { Meta } from '@/models/entities/meta'; import { getConnection } from 'typeorm'; let cache: Meta; diff --git a/src/misc/fetch-proxy-account.ts b/src/misc/fetch-proxy-account.ts index ed8a4c794d..e0eedea4c8 100644 --- a/src/misc/fetch-proxy-account.ts +++ b/src/misc/fetch-proxy-account.ts @@ -1,6 +1,6 @@ -import { fetchMeta } from './fetch-meta.js'; -import { ILocalUser } from '@/models/entities/user.js'; -import { Users } from '@/models/index.js'; +import { fetchMeta } from './fetch-meta'; +import { ILocalUser } from '@/models/entities/user'; +import { Users } from '@/models/index'; export async function fetchProxyAccount(): Promise { const meta = await fetchMeta(); diff --git a/src/misc/fetch.ts b/src/misc/fetch.ts index 11e8a69205..82db2f2f8c 100644 --- a/src/misc/fetch.ts +++ b/src/misc/fetch.ts @@ -3,7 +3,7 @@ import * as https from 'https'; import CacheableLookup from 'cacheable-lookup'; import fetch, { HeadersInit } from 'node-fetch'; import { HttpProxyAgent, HttpsProxyAgent } from 'hpagent'; -import config from '@/config/index.js'; +import config from '@/config/index'; import { URL } from 'url'; export async function getJson(url: string, accept = 'application/json, */*', timeout = 10000, headers?: HeadersInit) { diff --git a/src/misc/gen-id.ts b/src/misc/gen-id.ts index fcf476857f..b1b542dc4b 100644 --- a/src/misc/gen-id.ts +++ b/src/misc/gen-id.ts @@ -1,9 +1,9 @@ import { ulid } from 'ulid'; -import { genAid } from './id/aid.js'; -import { genMeid } from './id/meid.js'; -import { genMeidg } from './id/meidg.js'; -import { genObjectId } from './id/object-id.js'; -import config from '@/config/index.js'; +import { genAid } from './id/aid'; +import { genMeid } from './id/meid'; +import { genMeidg } from './id/meidg'; +import { genObjectId } from './id/object-id'; +import config from '@/config/index'; const metohd = config.id.toLowerCase(); diff --git a/src/misc/get-user-name.ts b/src/misc/get-user-name.ts index 805dbba529..3545e986e8 100644 --- a/src/misc/get-user-name.ts +++ b/src/misc/get-user-name.ts @@ -1,4 +1,4 @@ -import { User } from '@/models/entities/user.js'; +import { User } from '@/models/entities/user'; export default function(user: User): string { return user.name || user.username; diff --git a/src/misc/is-quote.ts b/src/misc/is-quote.ts index 779f548b03..2b57f036a2 100644 --- a/src/misc/is-quote.ts +++ b/src/misc/is-quote.ts @@ -1,4 +1,4 @@ -import { Note } from '@/models/entities/note.js'; +import { Note } from '@/models/entities/note'; export default function(note: Note): boolean { return note.renoteId != null && (note.text != null || note.hasPoll || (note.fileIds != null && note.fileIds.length > 0)); diff --git a/src/misc/keypair-store.ts b/src/misc/keypair-store.ts index 3d505c0abb..c018013b7b 100644 --- a/src/misc/keypair-store.ts +++ b/src/misc/keypair-store.ts @@ -1,7 +1,7 @@ -import { UserKeypairs } from '@/models/index.js'; -import { User } from '@/models/entities/user.js'; -import { UserKeypair } from '@/models/entities/user-keypair.js'; -import { Cache } from './cache.js'; +import { UserKeypairs } from '@/models/index'; +import { User } from '@/models/entities/user'; +import { UserKeypair } from '@/models/entities/user-keypair'; +import { Cache } from './cache'; const cache = new Cache(Infinity); diff --git a/src/misc/populate-emojis.ts b/src/misc/populate-emojis.ts index e1ec87a95b..f0a8bde31e 100644 --- a/src/misc/populate-emojis.ts +++ b/src/misc/populate-emojis.ts @@ -1,12 +1,12 @@ import { In } from 'typeorm'; -import { Emojis } from '@/models/index.js'; -import { Emoji } from '@/models/entities/emoji.js'; -import { Note } from '@/models/entities/note.js'; -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 { Emojis } from '@/models/index'; +import { Emoji } from '@/models/entities/emoji'; +import { Note } from '@/models/entities/note'; +import { Cache } from './cache'; +import { isSelfHost, toPunyNullable } from './convert-host'; +import { decodeReaction } from './reaction-lib'; +import config from '@/config/index'; +import { query } from '@/prelude/url'; const cache = new Cache(1000 * 60 * 60 * 12); diff --git a/src/misc/reaction-lib.ts b/src/misc/reaction-lib.ts index beff1b32bc..46dedfa24b 100644 --- a/src/misc/reaction-lib.ts +++ b/src/misc/reaction-lib.ts @@ -1,7 +1,7 @@ -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 { emojiRegex } from './emoji-regex'; +import { fetchMeta } from './fetch-meta'; +import { Emojis } from '@/models/index'; +import { toPunyNullable } from './convert-host'; const legacies: Record = { 'like': '👍', diff --git a/src/misc/show-machine-info.ts b/src/misc/show-machine-info.ts index 5ce466af26..58747c1152 100644 --- a/src/misc/show-machine-info.ts +++ b/src/misc/show-machine-info.ts @@ -1,6 +1,6 @@ import * as os from 'os'; import * as sysUtils from 'systeminformation'; -import Logger from '@/services/logger.js'; +import Logger from '@/services/logger'; export async function showMachineInfo(parentLogger: Logger) { const logger = parentLogger.createSubLogger('machine'); diff --git a/src/models/entities/abuse-user-report.ts b/src/models/entities/abuse-user-report.ts index cb13921222..c0cff139f6 100644 --- a/src/models/entities/abuse-user-report.ts +++ b/src/models/entities/abuse-user-report.ts @@ -1,6 +1,6 @@ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { User } from './user.js'; -import { id } from '../id.js'; +import { User } from './user'; +import { id } from '../id'; @Entity() export class AbuseUserReport { diff --git a/src/models/entities/access-token.ts b/src/models/entities/access-token.ts index c2d034af87..5f41b3c1fc 100644 --- a/src/models/entities/access-token.ts +++ b/src/models/entities/access-token.ts @@ -1,7 +1,7 @@ import { Entity, PrimaryColumn, Index, Column, ManyToOne, JoinColumn } from 'typeorm'; -import { User } from './user.js'; -import { App } from './app.js'; -import { id } from '../id.js'; +import { User } from './user'; +import { App } from './app'; +import { id } from '../id'; @Entity() export class AccessToken { diff --git a/src/models/entities/ad.ts b/src/models/entities/ad.ts index 1b0cfa06d3..b2fc04c4f0 100644 --- a/src/models/entities/ad.ts +++ b/src/models/entities/ad.ts @@ -1,5 +1,5 @@ import { Entity, Index, Column, PrimaryColumn } from 'typeorm'; -import { id } from '../id.js'; +import { id } from '../id'; @Entity() export class Ad { diff --git a/src/models/entities/announcement-read.ts b/src/models/entities/announcement-read.ts index 56ee2e6905..892beb826f 100644 --- a/src/models/entities/announcement-read.ts +++ b/src/models/entities/announcement-read.ts @@ -1,7 +1,7 @@ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { User } from './user.js'; -import { Announcement } from './announcement.js'; -import { id } from '../id.js'; +import { User } from './user'; +import { Announcement } from './announcement'; +import { id } from '../id'; @Entity() @Index(['userId', 'announcementId'], { unique: true }) diff --git a/src/models/entities/announcement.ts b/src/models/entities/announcement.ts index 1569ca89c7..06d379c229 100644 --- a/src/models/entities/announcement.ts +++ b/src/models/entities/announcement.ts @@ -1,5 +1,5 @@ import { Entity, Index, Column, PrimaryColumn } from 'typeorm'; -import { id } from '../id.js'; +import { id } from '../id'; @Entity() export class Announcement { diff --git a/src/models/entities/antenna-note.ts b/src/models/entities/antenna-note.ts index ecf2973919..9b911524ef 100644 --- a/src/models/entities/antenna-note.ts +++ b/src/models/entities/antenna-note.ts @@ -1,7 +1,7 @@ import { Entity, Index, JoinColumn, Column, ManyToOne, PrimaryColumn } from 'typeorm'; -import { Note } from './note.js'; -import { Antenna } from './antenna.js'; -import { id } from '../id.js'; +import { Note } from './note'; +import { Antenna } from './antenna'; +import { id } from '../id'; @Entity() @Index(['noteId', 'antennaId'], { unique: true }) diff --git a/src/models/entities/antenna.ts b/src/models/entities/antenna.ts index 5dc814e1d5..bcfe09a829 100644 --- a/src/models/entities/antenna.ts +++ b/src/models/entities/antenna.ts @@ -1,8 +1,8 @@ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } 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 { User } from './user'; +import { id } from '../id'; +import { UserList } from './user-list'; +import { UserGroupJoining } from './user-group-joining'; @Entity() export class Antenna { diff --git a/src/models/entities/app.ts b/src/models/entities/app.ts index c3a6a0a107..ea87546311 100644 --- a/src/models/entities/app.ts +++ b/src/models/entities/app.ts @@ -1,6 +1,6 @@ import { Entity, PrimaryColumn, Column, Index, ManyToOne } from 'typeorm'; -import { User } from './user.js'; -import { id } from '../id.js'; +import { User } from './user'; +import { id } from '../id'; @Entity() export class App { diff --git a/src/models/entities/attestation-challenge.ts b/src/models/entities/attestation-challenge.ts index 26a212e0c6..942747c02f 100644 --- a/src/models/entities/attestation-challenge.ts +++ b/src/models/entities/attestation-challenge.ts @@ -1,6 +1,6 @@ import { PrimaryColumn, Entity, JoinColumn, Column, ManyToOne, Index } from 'typeorm'; -import { User } from './user.js'; -import { id } from '../id.js'; +import { User } from './user'; +import { id } from '../id'; @Entity() export class AttestationChallenge { diff --git a/src/models/entities/auth-session.ts b/src/models/entities/auth-session.ts index f0480abcc6..4eec27e3f6 100644 --- a/src/models/entities/auth-session.ts +++ b/src/models/entities/auth-session.ts @@ -1,7 +1,7 @@ import { Entity, PrimaryColumn, Index, Column, ManyToOne, JoinColumn } from 'typeorm'; -import { User } from './user.js'; -import { App } from './app.js'; -import { id } from '../id.js'; +import { User } from './user'; +import { App } from './app'; +import { id } from '../id'; @Entity() export class AuthSession { diff --git a/src/models/entities/blocking.ts b/src/models/entities/blocking.ts index 2fff80cfc1..48487cb086 100644 --- a/src/models/entities/blocking.ts +++ b/src/models/entities/blocking.ts @@ -1,6 +1,6 @@ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { User } from './user.js'; -import { id } from '../id.js'; +import { User } from './user'; +import { id } from '../id'; @Entity() @Index(['blockerId', 'blockeeId'], { unique: true }) diff --git a/src/models/entities/channel-following.ts b/src/models/entities/channel-following.ts index 6e5c9cba04..fca801e5ab 100644 --- a/src/models/entities/channel-following.ts +++ b/src/models/entities/channel-following.ts @@ -1,7 +1,7 @@ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { User } from './user.js'; -import { id } from '../id.js'; -import { Channel } from './channel.js'; +import { User } from './user'; +import { id } from '../id'; +import { Channel } from './channel'; @Entity() @Index(['followerId', 'followeeId'], { unique: true }) diff --git a/src/models/entities/channel-note-pining.ts b/src/models/entities/channel-note-pining.ts index 751af4a183..26a7eb501f 100644 --- a/src/models/entities/channel-note-pining.ts +++ b/src/models/entities/channel-note-pining.ts @@ -1,7 +1,7 @@ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { Note } from './note.js'; -import { Channel } from './channel.js'; -import { id } from '../id.js'; +import { Note } from './note'; +import { Channel } from './channel'; +import { id } from '../id'; @Entity() @Index(['channelId', 'noteId'], { unique: true }) diff --git a/src/models/entities/channel.ts b/src/models/entities/channel.ts index adf937c0b4..f2d713612d 100644 --- a/src/models/entities/channel.ts +++ b/src/models/entities/channel.ts @@ -1,7 +1,7 @@ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { User } from './user.js'; -import { id } from '../id.js'; -import { DriveFile } from './drive-file.js'; +import { User } from './user'; +import { id } from '../id'; +import { DriveFile } from './drive-file'; @Entity() export class Channel { diff --git a/src/models/entities/clip-note.ts b/src/models/entities/clip-note.ts index 41d92b0c74..7d96b2ef7a 100644 --- a/src/models/entities/clip-note.ts +++ b/src/models/entities/clip-note.ts @@ -1,7 +1,7 @@ import { Entity, Index, JoinColumn, Column, ManyToOne, PrimaryColumn } from 'typeorm'; -import { Note } from './note.js'; -import { Clip } from './clip.js'; -import { id } from '../id.js'; +import { Note } from './note'; +import { Clip } from './clip'; +import { id } from '../id'; @Entity() @Index(['noteId', 'clipId'], { unique: true }) diff --git a/src/models/entities/clip.ts b/src/models/entities/clip.ts index 1cdf4c52eb..66b5b8847e 100644 --- a/src/models/entities/clip.ts +++ b/src/models/entities/clip.ts @@ -1,6 +1,6 @@ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { User } from './user.js'; -import { id } from '../id.js'; +import { User } from './user'; +import { id } from '../id'; @Entity() export class Clip { diff --git a/src/models/entities/drive-file.ts b/src/models/entities/drive-file.ts index 41d68a1334..698dfac222 100644 --- a/src/models/entities/drive-file.ts +++ b/src/models/entities/drive-file.ts @@ -1,7 +1,7 @@ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { User } from './user.js'; -import { DriveFolder } from './drive-folder.js'; -import { id } from '../id.js'; +import { User } from './user'; +import { DriveFolder } from './drive-folder'; +import { id } from '../id'; @Entity() @Index(['userId', 'folderId', 'id']) diff --git a/src/models/entities/drive-folder.ts b/src/models/entities/drive-folder.ts index f137dd5c6a..a80d075855 100644 --- a/src/models/entities/drive-folder.ts +++ b/src/models/entities/drive-folder.ts @@ -1,6 +1,6 @@ import { JoinColumn, ManyToOne, Entity, PrimaryColumn, Index, Column } from 'typeorm'; -import { User } from './user.js'; -import { id } from '../id.js'; +import { User } from './user'; +import { id } from '../id'; @Entity() export class DriveFolder { diff --git a/src/models/entities/emoji.ts b/src/models/entities/emoji.ts index 3da4c6b416..d6080ae099 100644 --- a/src/models/entities/emoji.ts +++ b/src/models/entities/emoji.ts @@ -1,5 +1,5 @@ import { PrimaryColumn, Entity, Index, Column } from 'typeorm'; -import { id } from '../id.js'; +import { id } from '../id'; @Entity() @Index(['name', 'host'], { unique: true }) diff --git a/src/models/entities/follow-request.ts b/src/models/entities/follow-request.ts index e661c9933a..22ec263962 100644 --- a/src/models/entities/follow-request.ts +++ b/src/models/entities/follow-request.ts @@ -1,6 +1,6 @@ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { User } from './user.js'; -import { id } from '../id.js'; +import { User } from './user'; +import { id } from '../id'; @Entity() @Index(['followerId', 'followeeId'], { unique: true }) diff --git a/src/models/entities/following.ts b/src/models/entities/following.ts index 5f9b548dab..ee3286a1a1 100644 --- a/src/models/entities/following.ts +++ b/src/models/entities/following.ts @@ -1,6 +1,6 @@ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { User } from './user.js'; -import { id } from '../id.js'; +import { User } from './user'; +import { id } from '../id'; @Entity() @Index(['followerId', 'followeeId'], { unique: true }) diff --git a/src/models/entities/gallery-like.ts b/src/models/entities/gallery-like.ts index f1610b8aae..7d084a2275 100644 --- a/src/models/entities/gallery-like.ts +++ b/src/models/entities/gallery-like.ts @@ -1,7 +1,7 @@ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { User } from './user.js'; -import { id } from '../id.js'; -import { GalleryPost } from './gallery-post.js'; +import { User } from './user'; +import { id } from '../id'; +import { GalleryPost } from './gallery-post'; @Entity() @Index(['userId', 'postId'], { unique: true }) diff --git a/src/models/entities/gallery-post.ts b/src/models/entities/gallery-post.ts index cc4ed640a4..f59cd671f3 100644 --- a/src/models/entities/gallery-post.ts +++ b/src/models/entities/gallery-post.ts @@ -1,7 +1,7 @@ import { Entity, Index, JoinColumn, Column, PrimaryColumn, ManyToOne } from 'typeorm'; -import { User } from './user.js'; -import { id } from '../id.js'; -import { DriveFile } from './drive-file.js'; +import { User } from './user'; +import { id } from '../id'; +import { DriveFile } from './drive-file'; @Entity() export class GalleryPost { diff --git a/src/models/entities/games/reversi/game.ts b/src/models/entities/games/reversi/game.ts index b63c72e9fb..9deacaf5c6 100644 --- a/src/models/entities/games/reversi/game.ts +++ b/src/models/entities/games/reversi/game.ts @@ -1,6 +1,6 @@ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { User } from '../../user.js'; -import { id } from '../../../id.js'; +import { User } from '../../user'; +import { id } from '../../../id'; @Entity() export class ReversiGame { diff --git a/src/models/entities/games/reversi/matching.ts b/src/models/entities/games/reversi/matching.ts index 690a080b2b..477a29316e 100644 --- a/src/models/entities/games/reversi/matching.ts +++ b/src/models/entities/games/reversi/matching.ts @@ -1,6 +1,6 @@ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { User } from '../../user.js'; -import { id } from '../../../id.js'; +import { User } from '../../user'; +import { id } from '../../../id'; @Entity() export class ReversiMatching { diff --git a/src/models/entities/hashtag.ts b/src/models/entities/hashtag.ts index b99ac80b58..842cdaa562 100644 --- a/src/models/entities/hashtag.ts +++ b/src/models/entities/hashtag.ts @@ -1,6 +1,6 @@ import { Entity, PrimaryColumn, Index, Column } from 'typeorm'; -import { User } from './user.js'; -import { id } from '../id.js'; +import { User } from './user'; +import { id } from '../id'; @Entity() export class Hashtag { diff --git a/src/models/entities/instance.ts b/src/models/entities/instance.ts index f4637096fa..7c8719e06a 100644 --- a/src/models/entities/instance.ts +++ b/src/models/entities/instance.ts @@ -1,5 +1,5 @@ import { Entity, PrimaryColumn, Index, Column } from 'typeorm'; -import { id } from '../id.js'; +import { id } from '../id'; @Entity() export class Instance { diff --git a/src/models/entities/log.ts b/src/models/entities/log.ts index 17c5cba7d6..182a9fbed8 100644 --- a/src/models/entities/log.ts +++ b/src/models/entities/log.ts @@ -1,5 +1,5 @@ import { Entity, PrimaryColumn, Index, Column } from 'typeorm'; -import { id } from '../id.js'; +import { id } from '../id'; @Entity() export class Log { diff --git a/src/models/entities/messaging-message.ts b/src/models/entities/messaging-message.ts index 04a1637f44..ac0764674c 100644 --- a/src/models/entities/messaging-message.ts +++ b/src/models/entities/messaging-message.ts @@ -1,8 +1,8 @@ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { User } from './user.js'; -import { DriveFile } from './drive-file.js'; -import { id } from '../id.js'; -import { UserGroup } from './user-group.js'; +import { User } from './user'; +import { DriveFile } from './drive-file'; +import { id } from '../id'; +import { UserGroup } from './user-group'; @Entity() export class MessagingMessage { diff --git a/src/models/entities/meta.ts b/src/models/entities/meta.ts index a03891622d..2a0632c87c 100644 --- a/src/models/entities/meta.ts +++ b/src/models/entities/meta.ts @@ -1,7 +1,7 @@ import { Entity, Column, PrimaryColumn, ManyToOne, JoinColumn } from 'typeorm'; -import { User } from './user.js'; -import { id } from '../id.js'; -import { Clip } from './clip.js'; +import { User } from './user'; +import { id } from '../id'; +import { Clip } from './clip'; @Entity() export class Meta { diff --git a/src/models/entities/moderation-log.ts b/src/models/entities/moderation-log.ts index d96b63f523..33d3d683ae 100644 --- a/src/models/entities/moderation-log.ts +++ b/src/models/entities/moderation-log.ts @@ -1,6 +1,6 @@ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { User } from './user.js'; -import { id } from '../id.js'; +import { User } from './user'; +import { id } from '../id'; @Entity() export class ModerationLog { diff --git a/src/models/entities/muted-note.ts b/src/models/entities/muted-note.ts index 07763b2dbf..521876688c 100644 --- a/src/models/entities/muted-note.ts +++ b/src/models/entities/muted-note.ts @@ -1,8 +1,8 @@ import { Entity, Index, JoinColumn, Column, ManyToOne, PrimaryColumn } from 'typeorm'; -import { Note } from './note.js'; -import { User } from './user.js'; -import { id } from '../id.js'; -import { mutedNoteReasons } from '../../types.js'; +import { Note } from './note'; +import { User } from './user'; +import { id } from '../id'; +import { mutedNoteReasons } from '../../types'; @Entity() @Index(['noteId', 'userId'], { unique: true }) diff --git a/src/models/entities/muting.ts b/src/models/entities/muting.ts index 9c9134949f..0084213bcc 100644 --- a/src/models/entities/muting.ts +++ b/src/models/entities/muting.ts @@ -1,6 +1,6 @@ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { User } from './user.js'; -import { id } from '../id.js'; +import { User } from './user'; +import { id } from '../id'; @Entity() @Index(['muterId', 'muteeId'], { unique: true }) diff --git a/src/models/entities/note-favorite.ts b/src/models/entities/note-favorite.ts index 54792d225b..0713c3ae56 100644 --- a/src/models/entities/note-favorite.ts +++ b/src/models/entities/note-favorite.ts @@ -1,7 +1,7 @@ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { Note } from './note.js'; -import { User } from './user.js'; -import { id } from '../id.js'; +import { Note } from './note'; +import { User } from './user'; +import { id } from '../id'; @Entity() @Index(['userId', 'noteId'], { unique: true }) diff --git a/src/models/entities/note-reaction.ts b/src/models/entities/note-reaction.ts index 5bca5c3d36..674dc3639e 100644 --- a/src/models/entities/note-reaction.ts +++ b/src/models/entities/note-reaction.ts @@ -1,7 +1,7 @@ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { User } from './user.js'; -import { Note } from './note.js'; -import { id } from '../id.js'; +import { User } from './user'; +import { Note } from './note'; +import { id } from '../id'; @Entity() @Index(['userId', 'noteId'], { unique: true }) diff --git a/src/models/entities/note-unread.ts b/src/models/entities/note-unread.ts index 5a88c7f7d5..57dda4fafd 100644 --- a/src/models/entities/note-unread.ts +++ b/src/models/entities/note-unread.ts @@ -1,8 +1,8 @@ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { User } from './user.js'; -import { Note } from './note.js'; -import { id } from '../id.js'; -import { Channel } from './channel.js'; +import { User } from './user'; +import { Note } from './note'; +import { id } from '../id'; +import { Channel } from './channel'; @Entity() @Index(['userId', 'noteId'], { unique: true }) diff --git a/src/models/entities/note-watching.ts b/src/models/entities/note-watching.ts index 458fac3a40..741a1c0c8b 100644 --- a/src/models/entities/note-watching.ts +++ b/src/models/entities/note-watching.ts @@ -1,7 +1,7 @@ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { User } from './user.js'; -import { Note } from './note.js'; -import { id } from '../id.js'; +import { User } from './user'; +import { Note } from './note'; +import { id } from '../id'; @Entity() @Index(['userId', 'noteId'], { unique: true }) diff --git a/src/models/entities/note.ts b/src/models/entities/note.ts index 74d69de13c..9a85532637 100644 --- a/src/models/entities/note.ts +++ b/src/models/entities/note.ts @@ -1,9 +1,9 @@ import { Entity, Index, JoinColumn, Column, PrimaryColumn, ManyToOne } from 'typeorm'; -import { User } from './user.js'; -import { DriveFile } from './drive-file.js'; -import { id } from '../id.js'; -import { noteVisibilities } from '../../types.js'; -import { Channel } from './channel.js'; +import { User } from './user'; +import { DriveFile } from './drive-file'; +import { id } from '../id'; +import { noteVisibilities } from '../../types'; +import { Channel } from './channel'; @Entity() @Index('IDX_NOTE_TAGS', { synchronize: false }) diff --git a/src/models/entities/notification.ts b/src/models/entities/notification.ts index 1114910a80..988fdb341f 100644 --- a/src/models/entities/notification.ts +++ b/src/models/entities/notification.ts @@ -1,11 +1,11 @@ import { 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 { User } from './user'; +import { id } from '../id'; +import { Note } from './note'; +import { FollowRequest } from './follow-request'; +import { UserGroupInvitation } from './user-group-invitation'; +import { AccessToken } from './access-token'; +import { notificationTypes } from '../../types'; @Entity() export class Notification { diff --git a/src/models/entities/page-like.ts b/src/models/entities/page-like.ts index 49f3f0ef52..ca84ece8fd 100644 --- a/src/models/entities/page-like.ts +++ b/src/models/entities/page-like.ts @@ -1,7 +1,7 @@ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { User } from './user.js'; -import { id } from '../id.js'; -import { Page } from './page.js'; +import { User } from './user'; +import { id } from '../id'; +import { Page } from './page'; @Entity() @Index(['userId', 'pageId'], { unique: true }) diff --git a/src/models/entities/page.ts b/src/models/entities/page.ts index 7bc35aa69a..ed0411a3d0 100644 --- a/src/models/entities/page.ts +++ b/src/models/entities/page.ts @@ -1,7 +1,7 @@ import { Entity, Index, JoinColumn, Column, PrimaryColumn, ManyToOne } from 'typeorm'; -import { User } from './user.js'; -import { id } from '../id.js'; -import { DriveFile } from './drive-file.js'; +import { User } from './user'; +import { id } from '../id'; +import { DriveFile } from './drive-file'; @Entity() @Index(['userId', 'name'], { unique: true }) diff --git a/src/models/entities/password-reset-request.ts b/src/models/entities/password-reset-request.ts index 95ba14db18..6d41d38a93 100644 --- a/src/models/entities/password-reset-request.ts +++ b/src/models/entities/password-reset-request.ts @@ -1,6 +1,6 @@ import { PrimaryColumn, Entity, Index, Column, ManyToOne, JoinColumn } from 'typeorm'; -import { id } from '../id.js'; -import { User } from './user.js'; +import { id } from '../id'; +import { User } from './user'; @Entity() export class PasswordResetRequest { diff --git a/src/models/entities/poll-vote.ts b/src/models/entities/poll-vote.ts index f8b5ad7d81..709376f909 100644 --- a/src/models/entities/poll-vote.ts +++ b/src/models/entities/poll-vote.ts @@ -1,7 +1,7 @@ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { User } from './user.js'; -import { Note } from './note.js'; -import { id } from '../id.js'; +import { User } from './user'; +import { Note } from './note'; +import { id } from '../id'; @Entity() @Index(['userId', 'noteId', 'choice'], { unique: true }) diff --git a/src/models/entities/poll.ts b/src/models/entities/poll.ts index a201b1198b..e3bbb1c3f2 100644 --- a/src/models/entities/poll.ts +++ b/src/models/entities/poll.ts @@ -1,8 +1,8 @@ import { PrimaryColumn, Entity, Index, JoinColumn, Column, OneToOne } from 'typeorm'; -import { id } from '../id.js'; -import { Note } from './note.js'; -import { User } from './user.js'; -import { noteVisibilities } from '../../types.js'; +import { id } from '../id'; +import { Note } from './note'; +import { User } from './user'; +import { noteVisibilities } from '../../types'; @Entity() export class Poll { diff --git a/src/models/entities/promo-note.ts b/src/models/entities/promo-note.ts index d21b2adac3..474f1cb235 100644 --- a/src/models/entities/promo-note.ts +++ b/src/models/entities/promo-note.ts @@ -1,7 +1,7 @@ import { PrimaryColumn, Entity, Index, JoinColumn, Column, OneToOne } from 'typeorm'; -import { Note } from './note.js'; -import { User } from './user.js'; -import { id } from '../id.js'; +import { Note } from './note'; +import { User } from './user'; +import { id } from '../id'; @Entity() export class PromoNote { diff --git a/src/models/entities/promo-read.ts b/src/models/entities/promo-read.ts index d949061b99..2e0977b6b5 100644 --- a/src/models/entities/promo-read.ts +++ b/src/models/entities/promo-read.ts @@ -1,7 +1,7 @@ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { Note } from './note.js'; -import { User } from './user.js'; -import { id } from '../id.js'; +import { Note } from './note'; +import { User } from './user'; +import { id } from '../id'; @Entity() @Index(['userId', 'noteId'], { unique: true }) diff --git a/src/models/entities/registration-tickets.ts b/src/models/entities/registration-tickets.ts index 139e40f85e..d962f78a78 100644 --- a/src/models/entities/registration-tickets.ts +++ b/src/models/entities/registration-tickets.ts @@ -1,5 +1,5 @@ import { PrimaryColumn, Entity, Index, Column } from 'typeorm'; -import { id } from '../id.js'; +import { id } from '../id'; @Entity() export class RegistrationTicket { diff --git a/src/models/entities/registry-item.ts b/src/models/entities/registry-item.ts index f1904e6120..54d2ef2082 100644 --- a/src/models/entities/registry-item.ts +++ b/src/models/entities/registry-item.ts @@ -1,6 +1,6 @@ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { User } from './user.js'; -import { id } from '../id.js'; +import { User } from './user'; +import { id } from '../id'; // TODO: 同じdomain、同じscope、同じkeyのレコードは二つ以上存在しないように制約付けたい @Entity() diff --git a/src/models/entities/relay.ts b/src/models/entities/relay.ts index 94d1929574..4c82ccb125 100644 --- a/src/models/entities/relay.ts +++ b/src/models/entities/relay.ts @@ -1,5 +1,5 @@ import { PrimaryColumn, Entity, Index, Column } from 'typeorm'; -import { id } from '../id.js'; +import { id } from '../id'; @Entity() export class Relay { diff --git a/src/models/entities/signin.ts b/src/models/entities/signin.ts index 1db5c48ca1..7e047084b1 100644 --- a/src/models/entities/signin.ts +++ b/src/models/entities/signin.ts @@ -1,6 +1,6 @@ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { User } from './user.js'; -import { id } from '../id.js'; +import { User } from './user'; +import { id } from '../id'; @Entity() export class Signin { diff --git a/src/models/entities/sw-subscription.ts b/src/models/entities/sw-subscription.ts index 254dd70b4f..7c3f6f0a6c 100644 --- a/src/models/entities/sw-subscription.ts +++ b/src/models/entities/sw-subscription.ts @@ -1,6 +1,6 @@ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { User } from './user.js'; -import { id } from '../id.js'; +import { User } from './user'; +import { id } from '../id'; @Entity() export class SwSubscription { diff --git a/src/models/entities/user-group-invitation.ts b/src/models/entities/user-group-invitation.ts index 9e71c78e1d..6fe8f20134 100644 --- a/src/models/entities/user-group-invitation.ts +++ b/src/models/entities/user-group-invitation.ts @@ -1,7 +1,7 @@ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { User } from './user.js'; -import { UserGroup } from './user-group.js'; -import { id } from '../id.js'; +import { User } from './user'; +import { UserGroup } from './user-group'; +import { id } from '../id'; @Entity() @Index(['userId', 'userGroupId'], { unique: true }) diff --git a/src/models/entities/user-group-joining.ts b/src/models/entities/user-group-joining.ts index fbed44c79f..e09c3230f1 100644 --- a/src/models/entities/user-group-joining.ts +++ b/src/models/entities/user-group-joining.ts @@ -1,7 +1,7 @@ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { User } from './user.js'; -import { UserGroup } from './user-group.js'; -import { id } from '../id.js'; +import { User } from './user'; +import { UserGroup } from './user-group'; +import { id } from '../id'; @Entity() @Index(['userId', 'userGroupId'], { unique: true }) diff --git a/src/models/entities/user-group.ts b/src/models/entities/user-group.ts index ae4cd5485f..f4bac03223 100644 --- a/src/models/entities/user-group.ts +++ b/src/models/entities/user-group.ts @@ -1,6 +1,6 @@ import { Entity, Index, JoinColumn, Column, PrimaryColumn, ManyToOne } from 'typeorm'; -import { User } from './user.js'; -import { id } from '../id.js'; +import { User } from './user'; +import { id } from '../id'; @Entity() export class UserGroup { diff --git a/src/models/entities/user-keypair.ts b/src/models/entities/user-keypair.ts index 026f823f7b..603321d758 100644 --- a/src/models/entities/user-keypair.ts +++ b/src/models/entities/user-keypair.ts @@ -1,6 +1,6 @@ import { PrimaryColumn, Entity, JoinColumn, Column, OneToOne } from 'typeorm'; -import { User } from './user.js'; -import { id } from '../id.js'; +import { User } from './user'; +import { id } from '../id'; @Entity() export class UserKeypair { diff --git a/src/models/entities/user-list-joining.ts b/src/models/entities/user-list-joining.ts index 91cff3cd54..bb7dc40b95 100644 --- a/src/models/entities/user-list-joining.ts +++ b/src/models/entities/user-list-joining.ts @@ -1,7 +1,7 @@ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { User } from './user.js'; -import { UserList } from './user-list.js'; -import { id } from '../id.js'; +import { User } from './user'; +import { UserList } from './user-list'; +import { id } from '../id'; @Entity() @Index(['userId', 'userListId'], { unique: true }) diff --git a/src/models/entities/user-list.ts b/src/models/entities/user-list.ts index 51031e3c1f..35a83ef8c3 100644 --- a/src/models/entities/user-list.ts +++ b/src/models/entities/user-list.ts @@ -1,6 +1,6 @@ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { User } from './user.js'; -import { id } from '../id.js'; +import { User } from './user'; +import { id } from '../id'; @Entity() export class UserList { diff --git a/src/models/entities/user-note-pining.ts b/src/models/entities/user-note-pining.ts index 0495c4b2f5..04a6f8f645 100644 --- a/src/models/entities/user-note-pining.ts +++ b/src/models/entities/user-note-pining.ts @@ -1,7 +1,7 @@ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { Note } from './note.js'; -import { User } from './user.js'; -import { id } from '../id.js'; +import { Note } from './note'; +import { User } from './user'; +import { id } from '../id'; @Entity() @Index(['userId', 'noteId'], { unique: true }) diff --git a/src/models/entities/user-profile.ts b/src/models/entities/user-profile.ts index fd05522797..3a9043fac6 100644 --- a/src/models/entities/user-profile.ts +++ b/src/models/entities/user-profile.ts @@ -1,8 +1,8 @@ import { Entity, Column, Index, OneToOne, JoinColumn, PrimaryColumn } from 'typeorm'; -import { id } from '../id.js'; -import { User } from './user.js'; -import { Page } from './page.js'; -import { notificationTypes } from '../../types.js'; +import { id } from '../id'; +import { User } from './user'; +import { Page } from './page'; +import { notificationTypes } from '../../types'; // TODO: このテーブルで管理している情報すべてレジストリで管理するようにしても良いかも // ただ、「emailVerified が true なユーザーを find する」のようなクエリは書けなくなるからウーン diff --git a/src/models/entities/user-publickey.ts b/src/models/entities/user-publickey.ts index adfff74f8a..21edc3e9e2 100644 --- a/src/models/entities/user-publickey.ts +++ b/src/models/entities/user-publickey.ts @@ -1,6 +1,6 @@ import { PrimaryColumn, Entity, Index, JoinColumn, Column, OneToOne } from 'typeorm'; -import { User } from './user.js'; -import { id } from '../id.js'; +import { User } from './user'; +import { id } from '../id'; @Entity() export class UserPublickey { diff --git a/src/models/entities/user-security-key.ts b/src/models/entities/user-security-key.ts index ec8ac81c47..d54c728e53 100644 --- a/src/models/entities/user-security-key.ts +++ b/src/models/entities/user-security-key.ts @@ -1,6 +1,6 @@ import { PrimaryColumn, Entity, JoinColumn, Column, ManyToOne, Index } from 'typeorm'; -import { User } from './user.js'; -import { id } from '../id.js'; +import { User } from './user'; +import { id } from '../id'; @Entity() export class UserSecurityKey { diff --git a/src/models/entities/user.ts b/src/models/entities/user.ts index 36c5068205..060ec06b9a 100644 --- a/src/models/entities/user.ts +++ b/src/models/entities/user.ts @@ -1,6 +1,6 @@ import { Entity, Column, Index, OneToOne, JoinColumn, PrimaryColumn } from 'typeorm'; -import { DriveFile } from './drive-file.js'; -import { id } from '../id.js'; +import { DriveFile } from './drive-file'; +import { id } from '../id'; @Entity() @Index(['usernameLower', 'host'], { unique: true }) diff --git a/src/models/index.ts b/src/models/index.ts index 51ee88bb7f..9f8bd104e9 100644 --- a/src/models/index.ts +++ b/src/models/index.ts @@ -1,67 +1,67 @@ import { getRepository, getCustomRepository } from 'typeorm'; -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'; -import { SwSubscription } from './entities/sw-subscription.js'; -import { NoteWatching } from './entities/note-watching.js'; -import { NoteUnread } from './entities/note-unread.js'; -import { RegistrationTicket } from './entities/registration-tickets.js'; -import { UserRepository } from './repositories/user.js'; -import { NoteRepository } from './repositories/note.js'; -import { DriveFileRepository } from './repositories/drive-file.js'; -import { DriveFolderRepository } from './repositories/drive-folder.js'; -import { Log } from './entities/log.js'; -import { AccessToken } from './entities/access-token.js'; -import { UserNotePining } from './entities/user-note-pining.js'; -import { SigninRepository } from './repositories/signin.js'; -import { MessagingMessageRepository } from './repositories/messaging-message.js'; -import { ReversiGameRepository } from './repositories/games/reversi/game.js'; -import { UserListRepository } from './repositories/user-list.js'; -import { UserListJoining } from './entities/user-list-joining.js'; -import { UserGroupRepository } from './repositories/user-group.js'; -import { UserGroupJoining } from './entities/user-group-joining.js'; -import { UserGroupInvitationRepository } from './repositories/user-group-invitation.js'; -import { FollowRequestRepository } from './repositories/follow-request.js'; -import { MutingRepository } from './repositories/muting.js'; -import { BlockingRepository } from './repositories/blocking.js'; -import { NoteReactionRepository } from './repositories/note-reaction.js'; -import { NotificationRepository } from './repositories/notification.js'; -import { NoteFavoriteRepository } from './repositories/note-favorite.js'; -import { ReversiMatchingRepository } from './repositories/games/reversi/matching.js'; -import { UserPublickey } from './entities/user-publickey.js'; -import { UserKeypair } from './entities/user-keypair.js'; -import { AppRepository } from './repositories/app.js'; -import { FollowingRepository } from './repositories/following.js'; -import { AbuseUserReportRepository } from './repositories/abuse-user-report.js'; -import { AuthSessionRepository } from './repositories/auth-session.js'; -import { UserProfile } from './entities/user-profile.js'; -import { AttestationChallenge } from './entities/attestation-challenge.js'; -import { UserSecurityKey } from './entities/user-security-key.js'; -import { HashtagRepository } from './repositories/hashtag.js'; -import { PageRepository } from './repositories/page.js'; -import { PageLikeRepository } from './repositories/page-like.js'; -import { GalleryPostRepository } from './repositories/gallery-post.js'; -import { GalleryLikeRepository } from './repositories/gallery-like.js'; -import { ModerationLogRepository } from './repositories/moderation-logs.js'; -import { UsedUsername } from './entities/used-username.js'; -import { ClipRepository } from './repositories/clip.js'; -import { ClipNote } from './entities/clip-note.js'; -import { AntennaRepository } from './repositories/antenna.js'; -import { AntennaNote } from './entities/antenna-note.js'; -import { PromoNote } from './entities/promo-note.js'; -import { PromoRead } from './entities/promo-read.js'; -import { EmojiRepository } from './repositories/emoji.js'; -import { RelayRepository } from './repositories/relay.js'; -import { ChannelRepository } from './repositories/channel.js'; -import { MutedNote } from './entities/muted-note.js'; -import { ChannelFollowing } from './entities/channel-following.js'; -import { ChannelNotePining } from './entities/channel-note-pining.js'; -import { RegistryItem } from './entities/registry-item.js'; -import { Ad } from './entities/ad.js'; -import { PasswordResetRequest } from './entities/password-reset-request.js'; +import { Announcement } from './entities/announcement'; +import { AnnouncementRead } from './entities/announcement-read'; +import { Instance } from './entities/instance'; +import { Poll } from './entities/poll'; +import { PollVote } from './entities/poll-vote'; +import { Meta } from './entities/meta'; +import { SwSubscription } from './entities/sw-subscription'; +import { NoteWatching } from './entities/note-watching'; +import { NoteUnread } from './entities/note-unread'; +import { RegistrationTicket } from './entities/registration-tickets'; +import { UserRepository } from './repositories/user'; +import { NoteRepository } from './repositories/note'; +import { DriveFileRepository } from './repositories/drive-file'; +import { DriveFolderRepository } from './repositories/drive-folder'; +import { Log } from './entities/log'; +import { AccessToken } from './entities/access-token'; +import { UserNotePining } from './entities/user-note-pining'; +import { SigninRepository } from './repositories/signin'; +import { MessagingMessageRepository } from './repositories/messaging-message'; +import { ReversiGameRepository } from './repositories/games/reversi/game'; +import { UserListRepository } from './repositories/user-list'; +import { UserListJoining } from './entities/user-list-joining'; +import { UserGroupRepository } from './repositories/user-group'; +import { UserGroupJoining } from './entities/user-group-joining'; +import { UserGroupInvitationRepository } from './repositories/user-group-invitation'; +import { FollowRequestRepository } from './repositories/follow-request'; +import { MutingRepository } from './repositories/muting'; +import { BlockingRepository } from './repositories/blocking'; +import { NoteReactionRepository } from './repositories/note-reaction'; +import { NotificationRepository } from './repositories/notification'; +import { NoteFavoriteRepository } from './repositories/note-favorite'; +import { ReversiMatchingRepository } from './repositories/games/reversi/matching'; +import { UserPublickey } from './entities/user-publickey'; +import { UserKeypair } from './entities/user-keypair'; +import { AppRepository } from './repositories/app'; +import { FollowingRepository } from './repositories/following'; +import { AbuseUserReportRepository } from './repositories/abuse-user-report'; +import { AuthSessionRepository } from './repositories/auth-session'; +import { UserProfile } from './entities/user-profile'; +import { AttestationChallenge } from './entities/attestation-challenge'; +import { UserSecurityKey } from './entities/user-security-key'; +import { HashtagRepository } from './repositories/hashtag'; +import { PageRepository } from './repositories/page'; +import { PageLikeRepository } from './repositories/page-like'; +import { GalleryPostRepository } from './repositories/gallery-post'; +import { GalleryLikeRepository } from './repositories/gallery-like'; +import { ModerationLogRepository } from './repositories/moderation-logs'; +import { UsedUsername } from './entities/used-username'; +import { ClipRepository } from './repositories/clip'; +import { ClipNote } from './entities/clip-note'; +import { AntennaRepository } from './repositories/antenna'; +import { AntennaNote } from './entities/antenna-note'; +import { PromoNote } from './entities/promo-note'; +import { PromoRead } from './entities/promo-read'; +import { EmojiRepository } from './repositories/emoji'; +import { RelayRepository } from './repositories/relay'; +import { ChannelRepository } from './repositories/channel'; +import { MutedNote } from './entities/muted-note'; +import { ChannelFollowing } from './entities/channel-following'; +import { ChannelNotePining } from './entities/channel-note-pining'; +import { RegistryItem } from './entities/registry-item'; +import { Ad } from './entities/ad'; +import { PasswordResetRequest } from './entities/password-reset-request'; export const Announcements = getRepository(Announcement); export const AnnouncementReads = getRepository(AnnouncementRead); diff --git a/src/models/repositories/abuse-user-report.ts b/src/models/repositories/abuse-user-report.ts index 16a121576f..a8c6344966 100644 --- a/src/models/repositories/abuse-user-report.ts +++ b/src/models/repositories/abuse-user-report.ts @@ -1,7 +1,7 @@ import { EntityRepository, Repository } from 'typeorm'; -import { Users } from '../index.js'; -import { AbuseUserReport } from '../entities/abuse-user-report.js'; -import { awaitAll } from '../../prelude/await-all.js'; +import { Users } from '../index'; +import { AbuseUserReport } from '../entities/abuse-user-report'; +import { awaitAll } from '../../prelude/await-all'; @EntityRepository(AbuseUserReport) export class AbuseUserReportRepository extends Repository { diff --git a/src/models/repositories/antenna.ts b/src/models/repositories/antenna.ts index 5117bcb033..afda5ccaaa 100644 --- a/src/models/repositories/antenna.ts +++ b/src/models/repositories/antenna.ts @@ -1,7 +1,7 @@ import { EntityRepository, Repository } from 'typeorm'; -import { Antenna } from '../entities/antenna.js'; -import { SchemaType } from '@/misc/schema.js'; -import { AntennaNotes, UserGroupJoinings } from '../index.js'; +import { Antenna } from '../entities/antenna'; +import { SchemaType } from '@/misc/schema'; +import { AntennaNotes, UserGroupJoinings } from '../index'; export type PackedAntenna = SchemaType; diff --git a/src/models/repositories/app.ts b/src/models/repositories/app.ts index 3c96909ddd..698191de7e 100644 --- a/src/models/repositories/app.ts +++ b/src/models/repositories/app.ts @@ -1,7 +1,7 @@ import { EntityRepository, Repository } from 'typeorm'; -import { App } from '../entities/app.js'; -import { AccessTokens } from '../index.js'; -import { SchemaType } from '@/misc/schema.js'; +import { App } from '../entities/app'; +import { AccessTokens } from '../index'; +import { SchemaType } from '@/misc/schema'; export type PackedApp = SchemaType; diff --git a/src/models/repositories/auth-session.ts b/src/models/repositories/auth-session.ts index 0eac1348c7..aa1cddebcf 100644 --- a/src/models/repositories/auth-session.ts +++ b/src/models/repositories/auth-session.ts @@ -1,8 +1,8 @@ import { EntityRepository, Repository } from 'typeorm'; -import { Apps } from '../index.js'; -import { AuthSession } from '../entities/auth-session.js'; -import { awaitAll } from '../../prelude/await-all.js'; -import { User } from '../entities/user.js'; +import { Apps } from '../index'; +import { AuthSession } from '../entities/auth-session'; +import { awaitAll } from '../../prelude/await-all'; +import { User } from '../entities/user'; @EntityRepository(AuthSession) export class AuthSessionRepository extends Repository { diff --git a/src/models/repositories/blocking.ts b/src/models/repositories/blocking.ts index 41b9ed5ab9..3349a54ae9 100644 --- a/src/models/repositories/blocking.ts +++ b/src/models/repositories/blocking.ts @@ -1,9 +1,9 @@ import { EntityRepository, Repository } from 'typeorm'; -import { Users } from '../index.js'; -import { Blocking } from '../entities/blocking.js'; -import { awaitAll } from '../../prelude/await-all.js'; -import { SchemaType } from '@/misc/schema.js'; -import { User } from '../entities/user.js'; +import { Users } from '../index'; +import { Blocking } from '../entities/blocking'; +import { awaitAll } from '../../prelude/await-all'; +import { SchemaType } from '@/misc/schema'; +import { User } from '../entities/user'; export type PackedBlocking = SchemaType; diff --git a/src/models/repositories/channel.ts b/src/models/repositories/channel.ts index c889fc164b..1b1a30e7a2 100644 --- a/src/models/repositories/channel.ts +++ b/src/models/repositories/channel.ts @@ -1,8 +1,8 @@ import { EntityRepository, Repository } from 'typeorm'; -import { Channel } from '../entities/channel.js'; -import { SchemaType } from '@/misc/schema.js'; -import { DriveFiles, ChannelFollowings, NoteUnreads } from '../index.js'; -import { User } from '../entities/user.js'; +import { Channel } from '../entities/channel'; +import { SchemaType } from '@/misc/schema'; +import { DriveFiles, ChannelFollowings, NoteUnreads } from '../index'; +import { User } from '../entities/user'; export type PackedChannel = SchemaType; diff --git a/src/models/repositories/clip.ts b/src/models/repositories/clip.ts index 3fae8a7aee..608101d34b 100644 --- a/src/models/repositories/clip.ts +++ b/src/models/repositories/clip.ts @@ -1,8 +1,8 @@ import { EntityRepository, Repository } from 'typeorm'; -import { Clip } from '../entities/clip.js'; -import { SchemaType } from '@/misc/schema.js'; -import { Users } from '../index.js'; -import { awaitAll } from '../../prelude/await-all.js'; +import { Clip } from '../entities/clip'; +import { SchemaType } from '@/misc/schema'; +import { Users } from '../index'; +import { awaitAll } from '../../prelude/await-all'; export type PackedClip = SchemaType; diff --git a/src/models/repositories/drive-file.ts b/src/models/repositories/drive-file.ts index 3edd9dd66a..eecb477ac0 100644 --- a/src/models/repositories/drive-file.ts +++ b/src/models/repositories/drive-file.ts @@ -1,14 +1,14 @@ import { EntityRepository, Repository } from 'typeorm'; -import { DriveFile } from '../entities/drive-file.js'; -import { Users, DriveFolders } from '../index.js'; -import { User } from '../entities/user.js'; -import { toPuny } from '@/misc/convert-host.js'; -import { awaitAll } from '../../prelude/await-all.js'; -import { SchemaType } from '@/misc/schema.js'; -import config from '@/config/index.js'; -import { query, appendQuery } from '../../prelude/url.js'; -import { Meta } from '../entities/meta.js'; -import { fetchMeta } from '@/misc/fetch-meta.js'; +import { DriveFile } from '../entities/drive-file'; +import { Users, DriveFolders } from '../index'; +import { User } from '../entities/user'; +import { toPuny } from '@/misc/convert-host'; +import { awaitAll } from '../../prelude/await-all'; +import { SchemaType } from '@/misc/schema'; +import config from '@/config/index'; +import { query, appendQuery } from '../../prelude/url'; +import { Meta } from '../entities/meta'; +import { fetchMeta } from '@/misc/fetch-meta'; export type PackedDriveFile = SchemaType; diff --git a/src/models/repositories/drive-folder.ts b/src/models/repositories/drive-folder.ts index e78c50149c..de286ba218 100644 --- a/src/models/repositories/drive-folder.ts +++ b/src/models/repositories/drive-folder.ts @@ -1,8 +1,8 @@ import { EntityRepository, Repository } from 'typeorm'; -import { DriveFolders, DriveFiles } from '../index.js'; -import { DriveFolder } from '../entities/drive-folder.js'; -import { awaitAll } from '../../prelude/await-all.js'; -import { SchemaType } from '@/misc/schema.js'; +import { DriveFolders, DriveFiles } from '../index'; +import { DriveFolder } from '../entities/drive-folder'; +import { awaitAll } from '../../prelude/await-all'; +import { SchemaType } from '@/misc/schema'; export type PackedDriveFolder = SchemaType; diff --git a/src/models/repositories/emoji.ts b/src/models/repositories/emoji.ts index ecef68325a..3490a6ac86 100644 --- a/src/models/repositories/emoji.ts +++ b/src/models/repositories/emoji.ts @@ -1,5 +1,5 @@ import { EntityRepository, Repository } from 'typeorm'; -import { Emoji } from '../entities/emoji.js'; +import { Emoji } from '../entities/emoji'; @EntityRepository(Emoji) export class EmojiRepository extends Repository { diff --git a/src/models/repositories/federation-instance.ts b/src/models/repositories/federation-instance.ts index ad14cfc962..4b70971ecf 100644 --- a/src/models/repositories/federation-instance.ts +++ b/src/models/repositories/federation-instance.ts @@ -1,4 +1,4 @@ -import config from '@/config/index.js'; +import config from '@/config/index'; export const packedFederationInstanceSchema = { type: 'object' as const, diff --git a/src/models/repositories/follow-request.ts b/src/models/repositories/follow-request.ts index 6fe86972e5..253e03ca7b 100644 --- a/src/models/repositories/follow-request.ts +++ b/src/models/repositories/follow-request.ts @@ -1,7 +1,7 @@ import { EntityRepository, Repository } from 'typeorm'; -import { FollowRequest } from '../entities/follow-request.js'; -import { Users } from '../index.js'; -import { User } from '../entities/user.js'; +import { FollowRequest } from '../entities/follow-request'; +import { Users } from '../index'; +import { User } from '../entities/user'; @EntityRepository(FollowRequest) export class FollowRequestRepository extends Repository { diff --git a/src/models/repositories/following.ts b/src/models/repositories/following.ts index 0cc3626c26..dbbb0e6c75 100644 --- a/src/models/repositories/following.ts +++ b/src/models/repositories/following.ts @@ -1,9 +1,9 @@ import { EntityRepository, Repository } from 'typeorm'; -import { Users } from '../index.js'; -import { Following } from '../entities/following.js'; -import { awaitAll } from '../../prelude/await-all.js'; -import { SchemaType } from '@/misc/schema.js'; -import { User } from '../entities/user.js'; +import { Users } from '../index'; +import { Following } from '../entities/following'; +import { awaitAll } from '../../prelude/await-all'; +import { SchemaType } from '@/misc/schema'; +import { User } from '../entities/user'; type LocalFollowerFollowing = Following & { followerHost: null; diff --git a/src/models/repositories/gallery-like.ts b/src/models/repositories/gallery-like.ts index 550405d659..d0de01d8fd 100644 --- a/src/models/repositories/gallery-like.ts +++ b/src/models/repositories/gallery-like.ts @@ -1,6 +1,6 @@ import { EntityRepository, Repository } from 'typeorm'; -import { GalleryLike } from '../entities/gallery-like.js'; -import { GalleryPosts } from '../index.js'; +import { GalleryLike } from '../entities/gallery-like'; +import { GalleryPosts } from '../index'; @EntityRepository(GalleryLike) export class GalleryLikeRepository extends Repository { diff --git a/src/models/repositories/gallery-post.ts b/src/models/repositories/gallery-post.ts index b2c989481a..fe44d7c93e 100644 --- a/src/models/repositories/gallery-post.ts +++ b/src/models/repositories/gallery-post.ts @@ -1,9 +1,9 @@ import { EntityRepository, Repository } from 'typeorm'; -import { GalleryPost } from '../entities/gallery-post.js'; -import { SchemaType } from '../../misc/schema.js'; -import { Users, DriveFiles, GalleryLikes } from '../index.js'; -import { awaitAll } from '../../prelude/await-all.js'; -import { User } from '../entities/user.js'; +import { GalleryPost } from '../entities/gallery-post'; +import { SchemaType } from '../../misc/schema'; +import { Users, DriveFiles, GalleryLikes } from '../index'; +import { awaitAll } from '../../prelude/await-all'; +import { User } from '../entities/user'; export type PackedGalleryPost = SchemaType; diff --git a/src/models/repositories/games/reversi/game.ts b/src/models/repositories/games/reversi/game.ts index 0a1d67f960..021eba1da3 100644 --- a/src/models/repositories/games/reversi/game.ts +++ b/src/models/repositories/games/reversi/game.ts @@ -1,7 +1,7 @@ -import { User } from '@/models/entities/user.js'; +import { User } from '@/models/entities/user'; import { EntityRepository, Repository } from 'typeorm'; -import { Users } from '../../../index.js'; -import { ReversiGame } from '../../../entities/games/reversi/game.js'; +import { Users } from '../../../index'; +import { ReversiGame } from '../../../entities/games/reversi/game'; @EntityRepository(ReversiGame) export class ReversiGameRepository extends Repository { diff --git a/src/models/repositories/games/reversi/matching.ts b/src/models/repositories/games/reversi/matching.ts index 942194410b..f8ee646cb7 100644 --- a/src/models/repositories/games/reversi/matching.ts +++ b/src/models/repositories/games/reversi/matching.ts @@ -1,8 +1,8 @@ import { EntityRepository, Repository } from 'typeorm'; -import { ReversiMatching } from '../../../entities/games/reversi/matching.js'; -import { Users } from '../../../index.js'; -import { awaitAll } from '../../../../prelude/await-all.js'; -import { User } from '@/models/entities/user.js'; +import { ReversiMatching } from '../../../entities/games/reversi/matching'; +import { Users } from '../../../index'; +import { awaitAll } from '../../../../prelude/await-all'; +import { User } from '@/models/entities/user'; @EntityRepository(ReversiMatching) export class ReversiMatchingRepository extends Repository { diff --git a/src/models/repositories/hashtag.ts b/src/models/repositories/hashtag.ts index f16e2dcd86..3fee2f771d 100644 --- a/src/models/repositories/hashtag.ts +++ b/src/models/repositories/hashtag.ts @@ -1,6 +1,6 @@ import { EntityRepository, Repository } from 'typeorm'; -import { Hashtag } from '../entities/hashtag.js'; -import { SchemaType } from '@/misc/schema.js'; +import { Hashtag } from '../entities/hashtag'; +import { SchemaType } from '@/misc/schema'; export type PackedHashtag = SchemaType; diff --git a/src/models/repositories/messaging-message.ts b/src/models/repositories/messaging-message.ts index 1413105c55..47f6d4227a 100644 --- a/src/models/repositories/messaging-message.ts +++ b/src/models/repositories/messaging-message.ts @@ -1,8 +1,8 @@ import { EntityRepository, Repository } from 'typeorm'; -import { MessagingMessage } from '../entities/messaging-message.js'; -import { Users, DriveFiles, UserGroups } from '../index.js'; -import { SchemaType } from '@/misc/schema.js'; -import { User } from '../entities/user.js'; +import { MessagingMessage } from '../entities/messaging-message'; +import { Users, DriveFiles, UserGroups } from '../index'; +import { SchemaType } from '@/misc/schema'; +import { User } from '../entities/user'; export type PackedMessagingMessage = SchemaType; diff --git a/src/models/repositories/moderation-logs.ts b/src/models/repositories/moderation-logs.ts index ea074a4532..4e9ef1b31b 100644 --- a/src/models/repositories/moderation-logs.ts +++ b/src/models/repositories/moderation-logs.ts @@ -1,7 +1,7 @@ import { EntityRepository, Repository } from 'typeorm'; -import { Users } from '../index.js'; -import { ModerationLog } from '../entities/moderation-log.js'; -import { awaitAll } from '../../prelude/await-all.js'; +import { Users } from '../index'; +import { ModerationLog } from '../entities/moderation-log'; +import { awaitAll } from '../../prelude/await-all'; @EntityRepository(ModerationLog) export class ModerationLogRepository extends Repository { diff --git a/src/models/repositories/muting.ts b/src/models/repositories/muting.ts index 78dfa29215..806a7accd2 100644 --- a/src/models/repositories/muting.ts +++ b/src/models/repositories/muting.ts @@ -1,9 +1,9 @@ import { EntityRepository, Repository } from 'typeorm'; -import { Users } from '../index.js'; -import { Muting } from '../entities/muting.js'; -import { awaitAll } from '../../prelude/await-all.js'; -import { SchemaType } from '@/misc/schema.js'; -import { User } from '../entities/user.js'; +import { Users } from '../index'; +import { Muting } from '../entities/muting'; +import { awaitAll } from '../../prelude/await-all'; +import { SchemaType } from '@/misc/schema'; +import { User } from '../entities/user'; export type PackedMuting = SchemaType; diff --git a/src/models/repositories/note-favorite.ts b/src/models/repositories/note-favorite.ts index a192bbbc07..624e125ddf 100644 --- a/src/models/repositories/note-favorite.ts +++ b/src/models/repositories/note-favorite.ts @@ -1,7 +1,7 @@ import { EntityRepository, Repository } from 'typeorm'; -import { NoteFavorite } from '../entities/note-favorite.js'; -import { Notes } from '../index.js'; -import { User } from '../entities/user.js'; +import { NoteFavorite } from '../entities/note-favorite'; +import { Notes } from '../index'; +import { User } from '../entities/user'; @EntityRepository(NoteFavorite) export class NoteFavoriteRepository extends Repository { diff --git a/src/models/repositories/note-reaction.ts b/src/models/repositories/note-reaction.ts index 6c72008d24..6671b0cd75 100644 --- a/src/models/repositories/note-reaction.ts +++ b/src/models/repositories/note-reaction.ts @@ -1,9 +1,9 @@ import { EntityRepository, Repository } from 'typeorm'; -import { NoteReaction } from '../entities/note-reaction.js'; -import { Users } from '../index.js'; -import { SchemaType } from '@/misc/schema.js'; -import { convertLegacyReaction } from '@/misc/reaction-lib.js'; -import { User } from '../entities/user.js'; +import { NoteReaction } from '../entities/note-reaction'; +import { Users } from '../index'; +import { SchemaType } from '@/misc/schema'; +import { convertLegacyReaction } from '@/misc/reaction-lib'; +import { User } from '../entities/user'; export type PackedNoteReaction = SchemaType; diff --git a/src/models/repositories/note.ts b/src/models/repositories/note.ts index 60a5e1ab3d..f178c091f1 100644 --- a/src/models/repositories/note.ts +++ b/src/models/repositories/note.ts @@ -1,14 +1,14 @@ import { EntityRepository, Repository, In } from 'typeorm'; import * as mfm from 'mfm-js'; -import { Note } from '../entities/note.js'; -import { User } from '../entities/user.js'; -import { Users, PollVotes, DriveFiles, NoteReactions, Followings, Polls, Channels } from '../index.js'; -import { SchemaType } from '@/misc/schema.js'; -import { nyaize } from '@/misc/nyaize.js'; -import { awaitAll } from '../../prelude/await-all.js'; -import { convertLegacyReaction, convertLegacyReactions, decodeReaction } from '@/misc/reaction-lib.js'; -import { NoteReaction } from '../entities/note-reaction.js'; -import { aggregateNoteEmojis, populateEmojis, prefetchEmojis } from '@/misc/populate-emojis.js'; +import { Note } from '../entities/note'; +import { User } from '../entities/user'; +import { Users, PollVotes, DriveFiles, NoteReactions, Followings, Polls, Channels } from '../index'; +import { SchemaType } from '@/misc/schema'; +import { nyaize } from '@/misc/nyaize'; +import { awaitAll } from '../../prelude/await-all'; +import { convertLegacyReaction, convertLegacyReactions, decodeReaction } from '@/misc/reaction-lib'; +import { NoteReaction } from '../entities/note-reaction'; +import { aggregateNoteEmojis, populateEmojis, prefetchEmojis } from '@/misc/populate-emojis'; export type PackedNote = SchemaType; diff --git a/src/models/repositories/notification.ts b/src/models/repositories/notification.ts index 8199534e34..2b2ae22602 100644 --- a/src/models/repositories/notification.ts +++ b/src/models/repositories/notification.ts @@ -1,12 +1,12 @@ import { EntityRepository, In, Repository } from 'typeorm'; -import { Users, Notes, UserGroupInvitations, AccessTokens, NoteReactions } from '../index.js'; -import { Notification } from '../entities/notification.js'; -import { awaitAll } from '../../prelude/await-all.js'; -import { SchemaType } from '@/misc/schema.js'; -import { Note } from '../entities/note.js'; -import { NoteReaction } from '../entities/note-reaction.js'; -import { User } from '../entities/user.js'; -import { aggregateNoteEmojis, prefetchEmojis } from '@/misc/populate-emojis.js'; +import { Users, Notes, UserGroupInvitations, AccessTokens, NoteReactions } from '../index'; +import { Notification } from '../entities/notification'; +import { awaitAll } from '../../prelude/await-all'; +import { SchemaType } from '@/misc/schema'; +import { Note } from '../entities/note'; +import { NoteReaction } from '../entities/note-reaction'; +import { User } from '../entities/user'; +import { aggregateNoteEmojis, prefetchEmojis } from '@/misc/populate-emojis'; export type PackedNotification = SchemaType; diff --git a/src/models/repositories/page-like.ts b/src/models/repositories/page-like.ts index 81147a9ee0..2f9977de93 100644 --- a/src/models/repositories/page-like.ts +++ b/src/models/repositories/page-like.ts @@ -1,7 +1,7 @@ import { EntityRepository, Repository } from 'typeorm'; -import { PageLike } from '../entities/page-like.js'; -import { Pages } from '../index.js'; -import { User } from '../entities/user.js'; +import { PageLike } from '../entities/page-like'; +import { Pages } from '../index'; +import { User } from '../entities/user'; @EntityRepository(PageLike) export class PageLikeRepository extends Repository { diff --git a/src/models/repositories/page.ts b/src/models/repositories/page.ts index 45f8c81786..cac1a9545f 100644 --- a/src/models/repositories/page.ts +++ b/src/models/repositories/page.ts @@ -1,10 +1,10 @@ import { EntityRepository, Repository } from 'typeorm'; -import { Page } from '../entities/page.js'; -import { SchemaType } from '@/misc/schema.js'; -import { Users, DriveFiles, PageLikes } from '../index.js'; -import { awaitAll } from '../../prelude/await-all.js'; -import { DriveFile } from '../entities/drive-file.js'; -import { User } from '../entities/user.js'; +import { Page } from '../entities/page'; +import { SchemaType } from '@/misc/schema'; +import { Users, DriveFiles, PageLikes } from '../index'; +import { awaitAll } from '../../prelude/await-all'; +import { DriveFile } from '../entities/drive-file'; +import { User } from '../entities/user'; export type PackedPage = SchemaType; diff --git a/src/models/repositories/relay.ts b/src/models/repositories/relay.ts index c1b04a8ea0..601bb5eb39 100644 --- a/src/models/repositories/relay.ts +++ b/src/models/repositories/relay.ts @@ -1,5 +1,5 @@ import { EntityRepository, Repository } from 'typeorm'; -import { Relay } from '../entities/relay.js'; +import { Relay } from '../entities/relay'; @EntityRepository(Relay) export class RelayRepository extends Repository { diff --git a/src/models/repositories/signin.ts b/src/models/repositories/signin.ts index 8490ac6a59..f5b90c0e9e 100644 --- a/src/models/repositories/signin.ts +++ b/src/models/repositories/signin.ts @@ -1,5 +1,5 @@ import { EntityRepository, Repository } from 'typeorm'; -import { Signin } from '../entities/signin.js'; +import { Signin } from '../entities/signin'; @EntityRepository(Signin) export class SigninRepository extends Repository { diff --git a/src/models/repositories/user-group-invitation.ts b/src/models/repositories/user-group-invitation.ts index 6552f23d96..fb34dc9c29 100644 --- a/src/models/repositories/user-group-invitation.ts +++ b/src/models/repositories/user-group-invitation.ts @@ -1,6 +1,6 @@ import { EntityRepository, Repository } from 'typeorm'; -import { UserGroupInvitation } from '../entities/user-group-invitation.js'; -import { UserGroups } from '../index.js'; +import { UserGroupInvitation } from '../entities/user-group-invitation'; +import { UserGroups } from '../index'; @EntityRepository(UserGroupInvitation) export class UserGroupInvitationRepository extends Repository { diff --git a/src/models/repositories/user-group.ts b/src/models/repositories/user-group.ts index 6a2cd2caa2..ad144290ab 100644 --- a/src/models/repositories/user-group.ts +++ b/src/models/repositories/user-group.ts @@ -1,7 +1,7 @@ import { EntityRepository, Repository } from 'typeorm'; -import { UserGroup } from '../entities/user-group.js'; -import { UserGroupJoinings } from '../index.js'; -import { SchemaType } from '@/misc/schema.js'; +import { UserGroup } from '../entities/user-group'; +import { UserGroupJoinings } from '../index'; +import { SchemaType } from '@/misc/schema'; export type PackedUserGroup = SchemaType; diff --git a/src/models/repositories/user-list.ts b/src/models/repositories/user-list.ts index 6027e346a2..38b8c2f1b7 100644 --- a/src/models/repositories/user-list.ts +++ b/src/models/repositories/user-list.ts @@ -1,7 +1,7 @@ import { EntityRepository, Repository } from 'typeorm'; -import { UserList } from '../entities/user-list.js'; -import { UserListJoinings } from '../index.js'; -import { SchemaType } from '@/misc/schema.js'; +import { UserList } from '../entities/user-list'; +import { UserListJoinings } from '../index'; +import { SchemaType } from '@/misc/schema'; export type PackedUserList = SchemaType; diff --git a/src/models/repositories/user.ts b/src/models/repositories/user.ts index 494ab3c979..a4e5a43a00 100644 --- a/src/models/repositories/user.ts +++ b/src/models/repositories/user.ts @@ -1,13 +1,13 @@ import $ from 'cafy'; import { EntityRepository, Repository, In, Not } from 'typeorm'; -import { User, ILocalUser, IRemoteUser } from '../entities/user.js'; -import { Notes, NoteUnreads, FollowRequests, Notifications, MessagingMessages, UserNotePinings, Followings, Blockings, Mutings, UserProfiles, UserSecurityKeys, UserGroupJoinings, Pages, Announcements, AnnouncementReads, Antennas, AntennaNotes, ChannelFollowings, Instances } from '../index.js'; -import config from '@/config/index.js'; -import { SchemaType } from '@/misc/schema.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 { User, ILocalUser, IRemoteUser } from '../entities/user'; +import { Notes, NoteUnreads, FollowRequests, Notifications, MessagingMessages, UserNotePinings, Followings, Blockings, Mutings, UserProfiles, UserSecurityKeys, UserGroupJoinings, Pages, Announcements, AnnouncementReads, Antennas, AntennaNotes, ChannelFollowings, Instances } from '../index'; +import config from '@/config/index'; +import { SchemaType } from '@/misc/schema'; +import { awaitAll } from '../../prelude/await-all'; +import { populateEmojis } from '@/misc/populate-emojis'; +import { getAntennas } from '@/misc/antenna-cache'; +import { USER_ACTIVE_THRESHOLD, USER_ONLINE_THRESHOLD } from '@/const'; export type PackedUser = SchemaType; diff --git a/src/prelude/array.ts b/src/prelude/array.ts index 3846c31af2..d63f0475d0 100644 --- a/src/prelude/array.ts +++ b/src/prelude/array.ts @@ -1,4 +1,4 @@ -import { EndoRelation, Predicate } from './relation.js'; +import { EndoRelation, Predicate } from './relation'; /** * Count the number of elements that satisfy the predicate diff --git a/src/queue/index.ts b/src/queue/index.ts index 7b6824f803..2facd9c8e1 100644 --- a/src/queue/index.ts +++ b/src/queue/index.ts @@ -1,18 +1,18 @@ import * as httpSignature from 'http-signature'; -import config from '@/config/index.js'; -import { program } from '../argv.js'; +import config from '@/config/index'; +import { program } from '../argv'; -import processDeliver from './processors/deliver.js'; -import processInbox from './processors/inbox.js'; -import processDb from './processors/db/index.js'; -import procesObjectStorage from './processors/object-storage/index.js'; -import { queueLogger } from './logger.js'; -import { DriveFile } from '@/models/entities/drive-file.js'; -import { getJobInfo } from './get-job-info.js'; -import { dbQueue, deliverQueue, inboxQueue, objectStorageQueue } from './queues.js'; -import { ThinUser } from './types.js'; -import { IActivity } from '@/remote/activitypub/type.js'; +import processDeliver from './processors/deliver'; +import processInbox from './processors/inbox'; +import processDb from './processors/db/index'; +import procesObjectStorage from './processors/object-storage/index'; +import { queueLogger } from './logger'; +import { DriveFile } from '@/models/entities/drive-file'; +import { getJobInfo } from './get-job-info'; +import { dbQueue, deliverQueue, inboxQueue, objectStorageQueue } from './queues'; +import { ThinUser } from './types'; +import { IActivity } from '@/remote/activitypub/type'; function renderError(e: Error): any { return { diff --git a/src/queue/initialize.ts b/src/queue/initialize.ts index bed368967b..5fe5a9f6f3 100644 --- a/src/queue/initialize.ts +++ b/src/queue/initialize.ts @@ -1,5 +1,5 @@ import * as Bull from 'bull'; -import config from '@/config/index.js'; +import config from '@/config/index'; export function initialize(name: string, limitPerSec = -1) { return new Bull(name, { diff --git a/src/queue/logger.ts b/src/queue/logger.ts index 2843a3c263..f789b9d079 100644 --- a/src/queue/logger.ts +++ b/src/queue/logger.ts @@ -1,3 +1,3 @@ -import Logger from '@/services/logger.js'; +import Logger from '@/services/logger'; export const queueLogger = new Logger('queue', 'orange'); diff --git a/src/queue/processors/db/delete-drive-files.ts b/src/queue/processors/db/delete-drive-files.ts index 1d3876ac15..8a28468b0d 100644 --- a/src/queue/processors/db/delete-drive-files.ts +++ b/src/queue/processors/db/delete-drive-files.ts @@ -1,10 +1,10 @@ import * as Bull from 'bull'; -import { queueLogger } from '../../logger.js'; -import { deleteFileSync } from '@/services/drive/delete-file.js'; -import { Users, DriveFiles } from '@/models/index.js'; +import { queueLogger } from '../../logger'; +import { deleteFileSync } from '@/services/drive/delete-file'; +import { Users, DriveFiles } from '@/models/index'; import { MoreThan } from 'typeorm'; -import { DbUserJobData } from '@/queue/types.js'; +import { DbUserJobData } from '@/queue/types'; const logger = queueLogger.createSubLogger('delete-drive-files'); diff --git a/src/queue/processors/db/export-blocking.ts b/src/queue/processors/db/export-blocking.ts index 41344826e8..a0fc385006 100644 --- a/src/queue/processors/db/export-blocking.ts +++ b/src/queue/processors/db/export-blocking.ts @@ -2,13 +2,13 @@ import * as Bull from 'bull'; import * as tmp from 'tmp'; import * as fs from 'fs'; -import { queueLogger } from '../../logger.js'; -import addFile from '@/services/drive/add-file.js'; +import { queueLogger } from '../../logger'; +import addFile from '@/services/drive/add-file'; import dateFormat from 'dateformat'; -import { getFullApAccount } from '@/misc/convert-host.js'; -import { Users, Blockings } from '@/models/index.js'; +import { getFullApAccount } from '@/misc/convert-host'; +import { Users, Blockings } from '@/models/index'; import { MoreThan } from 'typeorm'; -import { DbUserJobData } from '@/queue/types.js'; +import { DbUserJobData } from '@/queue/types'; const logger = queueLogger.createSubLogger('export-blocking'); diff --git a/src/queue/processors/db/export-following.ts b/src/queue/processors/db/export-following.ts index c299479afd..3612150363 100644 --- a/src/queue/processors/db/export-following.ts +++ b/src/queue/processors/db/export-following.ts @@ -2,13 +2,13 @@ import * as Bull from 'bull'; import * as tmp from 'tmp'; import * as fs from 'fs'; -import { queueLogger } from '../../logger.js'; -import addFile from '@/services/drive/add-file.js'; +import { queueLogger } from '../../logger'; +import addFile from '@/services/drive/add-file'; import dateFormat from 'dateformat'; -import { getFullApAccount } from '@/misc/convert-host.js'; -import { Users, Followings } from '@/models/index.js'; +import { getFullApAccount } from '@/misc/convert-host'; +import { Users, Followings } from '@/models/index'; import { MoreThan } from 'typeorm'; -import { DbUserJobData } from '@/queue/types.js'; +import { DbUserJobData } from '@/queue/types'; const logger = queueLogger.createSubLogger('export-following'); diff --git a/src/queue/processors/db/export-mute.ts b/src/queue/processors/db/export-mute.ts index 8a16ab0b1e..70b2272cdb 100644 --- a/src/queue/processors/db/export-mute.ts +++ b/src/queue/processors/db/export-mute.ts @@ -2,13 +2,13 @@ import * as Bull from 'bull'; import * as tmp from 'tmp'; import * as fs from 'fs'; -import { queueLogger } from '../../logger.js'; -import addFile from '@/services/drive/add-file.js'; +import { queueLogger } from '../../logger'; +import addFile from '@/services/drive/add-file'; import dateFormat from 'dateformat'; -import { getFullApAccount } from '@/misc/convert-host.js'; -import { Users, Mutings } from '@/models/index.js'; +import { getFullApAccount } from '@/misc/convert-host'; +import { Users, Mutings } from '@/models/index'; import { MoreThan } from 'typeorm'; -import { DbUserJobData } from '@/queue/types.js'; +import { DbUserJobData } from '@/queue/types'; const logger = queueLogger.createSubLogger('export-mute'); diff --git a/src/queue/processors/db/export-notes.ts b/src/queue/processors/db/export-notes.ts index 9a2f71b9cc..3f146aff1b 100644 --- a/src/queue/processors/db/export-notes.ts +++ b/src/queue/processors/db/export-notes.ts @@ -2,14 +2,14 @@ import * as Bull from 'bull'; import * as tmp from 'tmp'; import * as fs from 'fs'; -import { queueLogger } from '../../logger.js'; -import addFile from '@/services/drive/add-file.js'; +import { queueLogger } from '../../logger'; +import addFile from '@/services/drive/add-file'; import dateFormat from 'dateformat'; -import { Users, Notes, Polls } from '@/models/index.js'; +import { Users, Notes, Polls } from '@/models/index'; import { MoreThan } from 'typeorm'; -import { Note } from '@/models/entities/note.js'; -import { Poll } from '@/models/entities/poll.js'; -import { DbUserJobData } from '@/queue/types.js'; +import { Note } from '@/models/entities/note'; +import { Poll } from '@/models/entities/poll'; +import { DbUserJobData } from '@/queue/types'; const logger = queueLogger.createSubLogger('export-notes'); diff --git a/src/queue/processors/db/export-user-lists.ts b/src/queue/processors/db/export-user-lists.ts index 6b54638f08..89bbd5af18 100644 --- a/src/queue/processors/db/export-user-lists.ts +++ b/src/queue/processors/db/export-user-lists.ts @@ -2,13 +2,13 @@ import * as Bull from 'bull'; import * as tmp from 'tmp'; import * as fs from 'fs'; -import { queueLogger } from '../../logger.js'; -import addFile from '@/services/drive/add-file.js'; +import { queueLogger } from '../../logger'; +import addFile from '@/services/drive/add-file'; import dateFormat from 'dateformat'; -import { getFullApAccount } from '@/misc/convert-host.js'; -import { Users, UserLists, UserListJoinings } from '@/models/index.js'; +import { getFullApAccount } from '@/misc/convert-host'; +import { Users, UserLists, UserListJoinings } from '@/models/index'; import { In } from 'typeorm'; -import { DbUserJobData } from '@/queue/types.js'; +import { DbUserJobData } from '@/queue/types'; const logger = queueLogger.createSubLogger('export-user-lists'); diff --git a/src/queue/processors/db/import-following.ts b/src/queue/processors/db/import-following.ts index bc8166c72c..3d7b7ea404 100644 --- a/src/queue/processors/db/import-following.ts +++ b/src/queue/processors/db/import-following.ts @@ -1,13 +1,13 @@ import * as Bull from 'bull'; -import { queueLogger } from '../../logger.js'; -import follow from '@/services/following/create.js'; -import { parseAcct } 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 } from '@/models/index.js'; -import { DbUserImportJobData } from '@/queue/types.js'; +import { queueLogger } from '../../logger'; +import follow from '@/services/following/create'; +import { parseAcct } from '@/misc/acct'; +import { resolveUser } from '@/remote/resolve-user'; +import { downloadTextFile } from '@/misc/download-text-file'; +import { isSelfHost, toPuny } from '@/misc/convert-host'; +import { Users, DriveFiles } from '@/models/index'; +import { DbUserImportJobData } from '@/queue/types'; const logger = queueLogger.createSubLogger('import-following'); diff --git a/src/queue/processors/db/import-user-lists.ts b/src/queue/processors/db/import-user-lists.ts index 6748e748ec..3b8c13262a 100644 --- a/src/queue/processors/db/import-user-lists.ts +++ b/src/queue/processors/db/import-user-lists.ts @@ -1,14 +1,14 @@ import * as Bull from 'bull'; -import { queueLogger } from '../../logger.js'; -import { parseAcct } from '@/misc/acct.js'; -import { resolveUser } from '@/remote/resolve-user.js'; -import { pushUserToUserList } from '@/services/user-list/push.js'; -import { downloadTextFile } from '@/misc/download-text-file.js'; -import { isSelfHost, toPuny } from '@/misc/convert-host.js'; -import { DriveFiles, Users, UserLists, UserListJoinings } from '@/models/index.js'; -import { genId } from '@/misc/gen-id.js'; -import { DbUserImportJobData } from '@/queue/types.js'; +import { queueLogger } from '../../logger'; +import { parseAcct } from '@/misc/acct'; +import { resolveUser } from '@/remote/resolve-user'; +import { pushUserToUserList } from '@/services/user-list/push'; +import { downloadTextFile } from '@/misc/download-text-file'; +import { isSelfHost, toPuny } from '@/misc/convert-host'; +import { DriveFiles, Users, UserLists, UserListJoinings } from '@/models/index'; +import { genId } from '@/misc/gen-id'; +import { DbUserImportJobData } from '@/queue/types'; const logger = queueLogger.createSubLogger('import-user-lists'); diff --git a/src/queue/processors/db/index.ts b/src/queue/processors/db/index.ts index 0936daf7aa..b56b7bfa2c 100644 --- a/src/queue/processors/db/index.ts +++ b/src/queue/processors/db/index.ts @@ -1,13 +1,13 @@ import * as Bull from 'bull'; -import { DbJobData } from '@/queue/types.js'; -import { deleteDriveFiles } from './delete-drive-files.js'; -import { exportNotes } from './export-notes.js'; -import { exportFollowing } from './export-following.js'; -import { exportMute } from './export-mute.js'; -import { exportBlocking } from './export-blocking.js'; -import { exportUserLists } from './export-user-lists.js'; -import { importFollowing } from './import-following.js'; -import { importUserLists } from './import-user-lists.js'; +import { DbJobData } from '@/queue/types'; +import { deleteDriveFiles } from './delete-drive-files'; +import { exportNotes } from './export-notes'; +import { exportFollowing } from './export-following'; +import { exportMute } from './export-mute'; +import { exportBlocking } from './export-blocking'; +import { exportUserLists } from './export-user-lists'; +import { importFollowing } from './import-following'; +import { importUserLists } from './import-user-lists'; const jobs = { deleteDriveFiles, diff --git a/src/queue/processors/deliver.ts b/src/queue/processors/deliver.ts index aeb7fc5f92..373e57cbd5 100644 --- a/src/queue/processors/deliver.ts +++ b/src/queue/processors/deliver.ts @@ -1,16 +1,16 @@ import { URL } from 'url'; import * as Bull from 'bull'; -import request from '@/remote/activitypub/request.js'; -import { registerOrFetchInstanceDoc } from '@/services/register-or-fetch-instance-doc.js'; -import Logger from '@/services/logger.js'; -import { Instances } from '@/models/index.js'; -import { instanceChart } from '@/services/chart/index.js'; -import { fetchInstanceMetadata } from '@/services/fetch-instance-metadata.js'; -import { fetchMeta } from '@/misc/fetch-meta.js'; -import { toPuny } from '@/misc/convert-host.js'; -import { Cache } from '@/misc/cache.js'; -import { Instance } from '@/models/entities/instance.js'; -import { DeliverJobData } from '../types.js'; +import request from '@/remote/activitypub/request'; +import { registerOrFetchInstanceDoc } from '@/services/register-or-fetch-instance-doc'; +import Logger from '@/services/logger'; +import { Instances } from '@/models/index'; +import { instanceChart } from '@/services/chart/index'; +import { fetchInstanceMetadata } from '@/services/fetch-instance-metadata'; +import { fetchMeta } from '@/misc/fetch-meta'; +import { toPuny } from '@/misc/convert-host'; +import { Cache } from '@/misc/cache'; +import { Instance } from '@/models/entities/instance'; +import { DeliverJobData } from '../types'; const logger = new Logger('deliver'); diff --git a/src/queue/processors/inbox.ts b/src/queue/processors/inbox.ts index b13828096d..e2c271cdf8 100644 --- a/src/queue/processors/inbox.ts +++ b/src/queue/processors/inbox.ts @@ -1,19 +1,19 @@ import { URL } from 'url'; import * as Bull from 'bull'; import * as httpSignature from 'http-signature'; -import perform from '@/remote/activitypub/perform.js'; -import Logger from '@/services/logger.js'; -import { registerOrFetchInstanceDoc } from '@/services/register-or-fetch-instance-doc.js'; -import { Instances } from '@/models/index.js'; -import { instanceChart } from '@/services/chart/index.js'; -import { fetchMeta } from '@/misc/fetch-meta.js'; -import { toPuny, extractDbHost } from '@/misc/convert-host.js'; -import { getApId } from '@/remote/activitypub/type.js'; -import { fetchInstanceMetadata } from '@/services/fetch-instance-metadata.js'; -import { InboxJobData } from '../types.js'; -import DbResolver from '@/remote/activitypub/db-resolver.js'; -import { resolvePerson } from '@/remote/activitypub/models/person.js'; -import { LdSignature } from '@/remote/activitypub/misc/ld-signature.js'; +import perform from '@/remote/activitypub/perform'; +import Logger from '@/services/logger'; +import { registerOrFetchInstanceDoc } from '@/services/register-or-fetch-instance-doc'; +import { Instances } from '@/models/index'; +import { instanceChart } from '@/services/chart/index'; +import { fetchMeta } from '@/misc/fetch-meta'; +import { toPuny, extractDbHost } from '@/misc/convert-host'; +import { getApId } from '@/remote/activitypub/type'; +import { fetchInstanceMetadata } from '@/services/fetch-instance-metadata'; +import { InboxJobData } from '../types'; +import DbResolver from '@/remote/activitypub/db-resolver'; +import { resolvePerson } from '@/remote/activitypub/models/person'; +import { LdSignature } from '@/remote/activitypub/misc/ld-signature'; const logger = new Logger('inbox'); diff --git a/src/queue/processors/object-storage/clean-remote-files.ts b/src/queue/processors/object-storage/clean-remote-files.ts index 96cb912c1c..3b2e4ea939 100644 --- a/src/queue/processors/object-storage/clean-remote-files.ts +++ b/src/queue/processors/object-storage/clean-remote-files.ts @@ -1,8 +1,8 @@ import * as Bull from 'bull'; -import { queueLogger } from '../../logger.js'; -import { deleteFileSync } from '@/services/drive/delete-file.js'; -import { DriveFiles } from '@/models/index.js'; +import { queueLogger } from '../../logger'; +import { deleteFileSync } from '@/services/drive/delete-file'; +import { DriveFiles } from '@/models/index'; import { MoreThan, Not, IsNull } from 'typeorm'; const logger = queueLogger.createSubLogger('clean-remote-files'); diff --git a/src/queue/processors/object-storage/delete-file.ts b/src/queue/processors/object-storage/delete-file.ts index 08f2977816..ed22968a27 100644 --- a/src/queue/processors/object-storage/delete-file.ts +++ b/src/queue/processors/object-storage/delete-file.ts @@ -1,6 +1,6 @@ -import { ObjectStorageFileJobData } from '@/queue/types.js'; +import { ObjectStorageFileJobData } from '@/queue/types'; import * as Bull from 'bull'; -import { deleteObjectStorageFile } from '@/services/drive/delete-file.js'; +import { deleteObjectStorageFile } from '@/services/drive/delete-file'; export default async (job: Bull.Job) => { const key: string = job.data.key; diff --git a/src/queue/processors/object-storage/index.ts b/src/queue/processors/object-storage/index.ts index b00d493719..0d9570e179 100644 --- a/src/queue/processors/object-storage/index.ts +++ b/src/queue/processors/object-storage/index.ts @@ -1,7 +1,7 @@ import * as Bull from 'bull'; -import { ObjectStorageJobData } from '@/queue/types.js'; -import deleteFile from './delete-file.js'; -import cleanRemoteFiles from './clean-remote-files.js'; +import { ObjectStorageJobData } from '@/queue/types'; +import deleteFile from './delete-file'; +import cleanRemoteFiles from './clean-remote-files'; const jobs = { deleteFile, diff --git a/src/queue/queues.ts b/src/queue/queues.ts index a3084ae4f6..d8c09ef86e 100644 --- a/src/queue/queues.ts +++ b/src/queue/queues.ts @@ -1,6 +1,6 @@ -import config from '@/config/index.js'; -import { initialize as initializeQueue } from './initialize.js'; -import { DeliverJobData, InboxJobData, DbJobData, ObjectStorageJobData } from './types.js'; +import config from '@/config/index'; +import { initialize as initializeQueue } from './initialize'; +import { DeliverJobData, InboxJobData, DbJobData, ObjectStorageJobData } from './types'; export const deliverQueue = initializeQueue('deliver', config.deliverJobPerSec || 128); export const inboxQueue = initializeQueue('inbox', config.inboxJobPerSec || 16); diff --git a/src/queue/types.ts b/src/queue/types.ts index 79067ca05f..a782fc6b97 100644 --- a/src/queue/types.ts +++ b/src/queue/types.ts @@ -1,6 +1,6 @@ -import { DriveFile } from '@/models/entities/drive-file.js'; -import { User } from '@/models/entities/user.js'; -import { IActivity } from '@/remote/activitypub/type.js'; +import { DriveFile } from '@/models/entities/drive-file'; +import { User } from '@/models/entities/user'; +import { IActivity } from '@/remote/activitypub/type'; import * as httpSignature from 'http-signature'; export type DeliverJobData = { diff --git a/src/remote/activitypub/audience.ts b/src/remote/activitypub/audience.ts index 1ced62e50a..7feef5ee7a 100644 --- a/src/remote/activitypub/audience.ts +++ b/src/remote/activitypub/audience.ts @@ -1,9 +1,9 @@ -import { ApObject, getApIds } from './type.js'; -import Resolver from './resolver.js'; -import { resolvePerson } from './models/person.js'; -import { unique, concat } from '../../prelude/array.js'; +import { ApObject, getApIds } from './type'; +import Resolver from './resolver'; +import { resolvePerson } from './models/person'; +import { unique, concat } from '../../prelude/array'; import * as promiseLimit from 'promise-limit'; -import { User, IRemoteUser } from '@/models/entities/user.js'; +import { User, IRemoteUser } from '@/models/entities/user'; type Visibility = 'public' | 'home' | 'followers' | 'specified'; diff --git a/src/remote/activitypub/db-resolver.ts b/src/remote/activitypub/db-resolver.ts index b73ac1e52a..289b6f0ee8 100644 --- a/src/remote/activitypub/db-resolver.ts +++ b/src/remote/activitypub/db-resolver.ts @@ -1,11 +1,11 @@ -import config from '@/config/index.js'; -import { Note } from '@/models/entities/note.js'; -import { User, IRemoteUser } from '@/models/entities/user.js'; -import { UserPublickey } from '@/models/entities/user-publickey.js'; -import { MessagingMessage } from '@/models/entities/messaging-message.js'; -import { Notes, Users, UserPublickeys, MessagingMessages } from '@/models/index.js'; -import { IObject, getApId } from './type.js'; -import { resolvePerson } from './models/person.js'; +import config from '@/config/index'; +import { Note } from '@/models/entities/note'; +import { User, IRemoteUser } from '@/models/entities/user'; +import { UserPublickey } from '@/models/entities/user-publickey'; +import { MessagingMessage } from '@/models/entities/messaging-message'; +import { Notes, Users, UserPublickeys, MessagingMessages } from '@/models/index'; +import { IObject, getApId } from './type'; +import { resolvePerson } from './models/person'; import escapeRegexp = require('escape-regexp'); export default class DbResolver { diff --git a/src/remote/activitypub/deliver-manager.ts b/src/remote/activitypub/deliver-manager.ts index b4b2df6ee4..d37f97a447 100644 --- a/src/remote/activitypub/deliver-manager.ts +++ b/src/remote/activitypub/deliver-manager.ts @@ -1,6 +1,6 @@ -import { Users, Followings } from '@/models/index.js'; -import { ILocalUser, IRemoteUser, User } from '@/models/entities/user.js'; -import { deliver } from '@/queue/index.js'; +import { Users, Followings } from '@/models/index'; +import { ILocalUser, IRemoteUser, User } from '@/models/entities/user'; +import { deliver } from '@/queue/index'; //#region types interface IRecipe { diff --git a/src/remote/activitypub/kernel/accept/follow.ts b/src/remote/activitypub/kernel/accept/follow.ts index 393516addf..1afb733ab5 100644 --- a/src/remote/activitypub/kernel/accept/follow.ts +++ b/src/remote/activitypub/kernel/accept/follow.ts @@ -1,8 +1,8 @@ -import { IRemoteUser } from '@/models/entities/user.js'; -import accept from '@/services/following/requests/accept.js'; -import { IFollow } from '../../type.js'; -import DbResolver from '../../db-resolver.js'; -import { relayAccepted } from '@/services/relay.js'; +import { IRemoteUser } from '@/models/entities/user'; +import accept from '@/services/following/requests/accept'; +import { IFollow } from '../../type'; +import DbResolver from '../../db-resolver'; +import { relayAccepted } from '@/services/relay'; export default async (actor: IRemoteUser, activity: IFollow): Promise => { // ※ activityはこっちから投げたフォローリクエストなので、activity.actorは存在するローカルユーザーである必要がある diff --git a/src/remote/activitypub/kernel/accept/index.ts b/src/remote/activitypub/kernel/accept/index.ts index 354bd4f6e1..5c6f81b2e3 100644 --- a/src/remote/activitypub/kernel/accept/index.ts +++ b/src/remote/activitypub/kernel/accept/index.ts @@ -1,8 +1,8 @@ -import Resolver from '../../resolver.js'; -import { IRemoteUser } from '@/models/entities/user.js'; -import acceptFollow from './follow.js'; -import { IAccept, isFollow, getApType } from '../../type.js'; -import { apLogger } from '../../logger.js'; +import Resolver from '../../resolver'; +import { IRemoteUser } from '@/models/entities/user'; +import acceptFollow from './follow'; +import { IAccept, isFollow, getApType } from '../../type'; +import { apLogger } from '../../logger'; const logger = apLogger; diff --git a/src/remote/activitypub/kernel/add/index.ts b/src/remote/activitypub/kernel/add/index.ts index 9a2fac1e74..b33be0cc85 100644 --- a/src/remote/activitypub/kernel/add/index.ts +++ b/src/remote/activitypub/kernel/add/index.ts @@ -1,7 +1,7 @@ -import { IRemoteUser } from '@/models/entities/user.js'; -import { IAdd } from '../../type.js'; -import { resolveNote } from '../../models/note.js'; -import { addPinned } from '@/services/i/pin.js'; +import { IRemoteUser } from '@/models/entities/user'; +import { IAdd } from '../../type'; +import { resolveNote } from '../../models/note'; +import { addPinned } from '@/services/i/pin'; export default async (actor: IRemoteUser, activity: IAdd): Promise => { if ('actor' in activity && actor.uri !== activity.actor) { diff --git a/src/remote/activitypub/kernel/announce/index.ts b/src/remote/activitypub/kernel/announce/index.ts index 7e2e73bdd5..581357e577 100644 --- a/src/remote/activitypub/kernel/announce/index.ts +++ b/src/remote/activitypub/kernel/announce/index.ts @@ -1,8 +1,8 @@ -import Resolver from '../../resolver.js'; -import { IRemoteUser } from '@/models/entities/user.js'; -import announceNote from './note.js'; -import { IAnnounce, getApId } from '../../type.js'; -import { apLogger } from '../../logger.js'; +import Resolver from '../../resolver'; +import { IRemoteUser } from '@/models/entities/user'; +import announceNote from './note'; +import { IAnnounce, getApId } from '../../type'; +import { apLogger } from '../../logger'; const logger = apLogger; diff --git a/src/remote/activitypub/kernel/announce/note.ts b/src/remote/activitypub/kernel/announce/note.ts index 9a6402e3b8..b6ec090b99 100644 --- a/src/remote/activitypub/kernel/announce/note.ts +++ b/src/remote/activitypub/kernel/announce/note.ts @@ -1,13 +1,13 @@ -import Resolver from '../../resolver.js'; -import post from '@/services/note/create.js'; -import { IRemoteUser } from '@/models/entities/user.js'; -import { IAnnounce, getApId } from '../../type.js'; -import { fetchNote, resolveNote } from '../../models/note.js'; -import { apLogger } from '../../logger.js'; -import { extractDbHost } from '@/misc/convert-host.js'; -import { fetchMeta } from '@/misc/fetch-meta.js'; -import { getApLock } from '@/misc/app-lock.js'; -import { parseAudience } from '../../audience.js'; +import Resolver from '../../resolver'; +import post from '@/services/note/create'; +import { IRemoteUser } from '@/models/entities/user'; +import { IAnnounce, getApId } from '../../type'; +import { fetchNote, resolveNote } from '../../models/note'; +import { apLogger } from '../../logger'; +import { extractDbHost } from '@/misc/convert-host'; +import { fetchMeta } from '@/misc/fetch-meta'; +import { getApLock } from '@/misc/app-lock'; +import { parseAudience } from '../../audience'; const logger = apLogger; diff --git a/src/remote/activitypub/kernel/block/index.ts b/src/remote/activitypub/kernel/block/index.ts index 9e4f1b316e..4fd1e07b9b 100644 --- a/src/remote/activitypub/kernel/block/index.ts +++ b/src/remote/activitypub/kernel/block/index.ts @@ -1,7 +1,7 @@ -import { IBlock } from '../../type.js'; -import block from '@/services/blocking/create.js'; -import { IRemoteUser } from '@/models/entities/user.js'; -import DbResolver from '../../db-resolver.js'; +import { IBlock } from '../../type'; +import block from '@/services/blocking/create'; +import { IRemoteUser } from '@/models/entities/user'; +import DbResolver from '../../db-resolver'; export default async (actor: IRemoteUser, activity: IBlock): Promise => { // ※ activity.objectにブロック対象があり、それは存在するローカルユーザーのはず diff --git a/src/remote/activitypub/kernel/create/index.ts b/src/remote/activitypub/kernel/create/index.ts index 4aa10d85df..a44a6ced2b 100644 --- a/src/remote/activitypub/kernel/create/index.ts +++ b/src/remote/activitypub/kernel/create/index.ts @@ -1,9 +1,9 @@ -import Resolver from '../../resolver.js'; -import { IRemoteUser } from '@/models/entities/user.js'; -import createNote from './note.js'; -import { ICreate, getApId, isPost, getApType } from '../../type.js'; -import { apLogger } from '../../logger.js'; -import { toArray, concat, unique } from '../../../../prelude/array.js'; +import Resolver from '../../resolver'; +import { IRemoteUser } from '@/models/entities/user'; +import createNote from './note'; +import { ICreate, getApId, isPost, getApType } from '../../type'; +import { apLogger } from '../../logger'; +import { toArray, concat, unique } from '../../../../prelude/array'; const logger = apLogger; diff --git a/src/remote/activitypub/kernel/create/note.ts b/src/remote/activitypub/kernel/create/note.ts index b0a7be5ea5..5dda85d0f5 100644 --- a/src/remote/activitypub/kernel/create/note.ts +++ b/src/remote/activitypub/kernel/create/note.ts @@ -1,9 +1,9 @@ -import Resolver from '../../resolver.js'; -import { IRemoteUser } from '@/models/entities/user.js'; -import { createNote, fetchNote } from '../../models/note.js'; -import { getApId, IObject, ICreate } from '../../type.js'; -import { getApLock } from '@/misc/app-lock.js'; -import { extractDbHost } from '@/misc/convert-host.js'; +import Resolver from '../../resolver'; +import { IRemoteUser } from '@/models/entities/user'; +import { createNote, fetchNote } from '../../models/note'; +import { getApId, IObject, ICreate } from '../../type'; +import { getApLock } from '@/misc/app-lock'; +import { extractDbHost } from '@/misc/convert-host'; /** * 投稿作成アクティビティを捌きます diff --git a/src/remote/activitypub/kernel/delete/index.ts b/src/remote/activitypub/kernel/delete/index.ts index 130b0aeec9..fe919975e7 100644 --- a/src/remote/activitypub/kernel/delete/index.ts +++ b/src/remote/activitypub/kernel/delete/index.ts @@ -1,7 +1,7 @@ -import deleteNote from './note.js'; -import { IRemoteUser } from '@/models/entities/user.js'; -import { IDelete, getApId, isTombstone, IObject, validPost, validActor } from '../../type.js'; -import { toSingle } from '../../../../prelude/array.js'; +import deleteNote from './note'; +import { IRemoteUser } from '@/models/entities/user'; +import { IDelete, getApId, isTombstone, IObject, validPost, validActor } from '../../type'; +import { toSingle } from '../../../../prelude/array'; /** * 削除アクティビティを捌きます diff --git a/src/remote/activitypub/kernel/delete/note.ts b/src/remote/activitypub/kernel/delete/note.ts index ad5e1a2edc..3875a33d13 100644 --- a/src/remote/activitypub/kernel/delete/note.ts +++ b/src/remote/activitypub/kernel/delete/note.ts @@ -1,9 +1,9 @@ -import { IRemoteUser } from '@/models/entities/user.js'; -import deleteNode from '@/services/note/delete.js'; -import { apLogger } from '../../logger.js'; -import DbResolver from '../../db-resolver.js'; -import { getApLock } from '@/misc/app-lock.js'; -import { deleteMessage } from '@/services/messages/delete.js'; +import { IRemoteUser } from '@/models/entities/user'; +import deleteNode from '@/services/note/delete'; +import { apLogger } from '../../logger'; +import DbResolver from '../../db-resolver'; +import { getApLock } from '@/misc/app-lock'; +import { deleteMessage } from '@/services/messages/delete'; const logger = apLogger; diff --git a/src/remote/activitypub/kernel/flag/index.ts b/src/remote/activitypub/kernel/flag/index.ts index 62f3ac5ed5..7abfd694cd 100644 --- a/src/remote/activitypub/kernel/flag/index.ts +++ b/src/remote/activitypub/kernel/flag/index.ts @@ -1,9 +1,9 @@ -import { IRemoteUser } from '@/models/entities/user.js'; -import config from '@/config/index.js'; -import { IFlag, getApIds } from '../../type.js'; -import { AbuseUserReports, Users } from '@/models/index.js'; +import { IRemoteUser } from '@/models/entities/user'; +import config from '@/config/index'; +import { IFlag, getApIds } from '../../type'; +import { AbuseUserReports, Users } from '@/models/index'; import { In } from 'typeorm'; -import { genId } from '@/misc/gen-id.js'; +import { genId } from '@/misc/gen-id'; export default async (actor: IRemoteUser, activity: IFlag): Promise => { // objectは `(User|Note) | (User|Note)[]` だけど、全パターンDBスキーマと対応させられないので diff --git a/src/remote/activitypub/kernel/follow.ts b/src/remote/activitypub/kernel/follow.ts index 49c1a7ee01..3183207afa 100644 --- a/src/remote/activitypub/kernel/follow.ts +++ b/src/remote/activitypub/kernel/follow.ts @@ -1,7 +1,7 @@ -import { IRemoteUser } from '@/models/entities/user.js'; -import follow from '@/services/following/create.js'; -import { IFollow } from '../type.js'; -import DbResolver from '../db-resolver.js'; +import { IRemoteUser } from '@/models/entities/user'; +import follow from '@/services/following/create'; +import { IFollow } from '../type'; +import DbResolver from '../db-resolver'; export default async (actor: IRemoteUser, activity: IFollow): Promise => { const dbResolver = new DbResolver(); diff --git a/src/remote/activitypub/kernel/index.ts b/src/remote/activitypub/kernel/index.ts index fa0df9753f..0bd0814340 100644 --- a/src/remote/activitypub/kernel/index.ts +++ b/src/remote/activitypub/kernel/index.ts @@ -1,22 +1,22 @@ -import { IObject, isCreate, isDelete, isUpdate, isRead, isFollow, isAccept, isReject, isAdd, isRemove, isAnnounce, isLike, isUndo, isBlock, isCollectionOrOrderedCollection, isCollection, isFlag } from '../type.js'; -import { IRemoteUser } from '@/models/entities/user.js'; -import create from './create/index.js'; -import performDeleteActivity from './delete/index.js'; -import performUpdateActivity from './update/index.js'; -import { performReadActivity } from './read.js'; -import follow from './follow.js'; -import undo from './undo/index.js'; -import like from './like.js'; -import announce from './announce/index.js'; -import accept from './accept/index.js'; -import reject from './reject/index.js'; -import add from './add/index.js'; -import remove from './remove/index.js'; -import block from './block/index.js'; -import flag from './flag/index.js'; -import { apLogger } from '../logger.js'; -import Resolver from '../resolver.js'; -import { toArray } from '../../../prelude/array.js'; +import { IObject, isCreate, isDelete, isUpdate, isRead, isFollow, isAccept, isReject, isAdd, isRemove, isAnnounce, isLike, isUndo, isBlock, isCollectionOrOrderedCollection, isCollection, isFlag } from '../type'; +import { IRemoteUser } from '@/models/entities/user'; +import create from './create/index'; +import performDeleteActivity from './delete/index'; +import performUpdateActivity from './update/index'; +import { performReadActivity } from './read'; +import follow from './follow'; +import undo from './undo/index'; +import like from './like'; +import announce from './announce/index'; +import accept from './accept/index'; +import reject from './reject/index'; +import add from './add/index'; +import remove from './remove/index'; +import block from './block/index'; +import flag from './flag/index'; +import { apLogger } from '../logger'; +import Resolver from '../resolver'; +import { toArray } from '../../../prelude/array'; export async function performActivity(actor: IRemoteUser, activity: IObject) { if (isCollectionOrOrderedCollection(activity)) { diff --git a/src/remote/activitypub/kernel/like.ts b/src/remote/activitypub/kernel/like.ts index 715cc379b9..58d5aefefc 100644 --- a/src/remote/activitypub/kernel/like.ts +++ b/src/remote/activitypub/kernel/like.ts @@ -1,7 +1,7 @@ -import { IRemoteUser } from '@/models/entities/user.js'; -import { ILike, getApId } from '../type.js'; -import create from '@/services/note/reaction/create.js'; -import { fetchNote, extractEmojis } from '../models/note.js'; +import { IRemoteUser } from '@/models/entities/user'; +import { ILike, getApId } from '../type'; +import create from '@/services/note/reaction/create'; +import { fetchNote, extractEmojis } from '../models/note'; export default async (actor: IRemoteUser, activity: ILike) => { const targetUri = getApId(activity.object); diff --git a/src/remote/activitypub/kernel/read.ts b/src/remote/activitypub/kernel/read.ts index 93cc36ec46..11a1731869 100644 --- a/src/remote/activitypub/kernel/read.ts +++ b/src/remote/activitypub/kernel/read.ts @@ -1,8 +1,8 @@ -import { IRemoteUser } from '@/models/entities/user.js'; -import { IRead, 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 { IRemoteUser } from '@/models/entities/user'; +import { IRead, getApId } from '../type'; +import { isSelfHost, extractDbHost } from '@/misc/convert-host'; +import { MessagingMessages } from '@/models/index'; +import { readUserMessagingMessage } from '../../../server/api/common/read-messaging-message'; export const performReadActivity = async (actor: IRemoteUser, activity: IRead): Promise => { const id = await getApId(activity.object); diff --git a/src/remote/activitypub/kernel/reject/follow.ts b/src/remote/activitypub/kernel/reject/follow.ts index 7099864e76..356547440f 100644 --- a/src/remote/activitypub/kernel/reject/follow.ts +++ b/src/remote/activitypub/kernel/reject/follow.ts @@ -1,8 +1,8 @@ -import { IRemoteUser } from '@/models/entities/user.js'; -import reject from '@/services/following/requests/reject.js'; -import { IFollow } from '../../type.js'; -import DbResolver from '../../db-resolver.js'; -import { relayRejected } from '@/services/relay.js'; +import { IRemoteUser } from '@/models/entities/user'; +import reject from '@/services/following/requests/reject'; +import { IFollow } from '../../type'; +import DbResolver from '../../db-resolver'; +import { relayRejected } from '@/services/relay'; export default async (actor: IRemoteUser, activity: IFollow): Promise => { // ※ activityはこっちから投げたフォローリクエストなので、activity.actorは存在するローカルユーザーである必要がある diff --git a/src/remote/activitypub/kernel/reject/index.ts b/src/remote/activitypub/kernel/reject/index.ts index ed86a4aa2f..d0de9c329b 100644 --- a/src/remote/activitypub/kernel/reject/index.ts +++ b/src/remote/activitypub/kernel/reject/index.ts @@ -1,8 +1,8 @@ -import Resolver from '../../resolver.js'; -import { IRemoteUser } from '@/models/entities/user.js'; -import rejectFollow from './follow.js'; -import { IReject, isFollow, getApType } from '../../type.js'; -import { apLogger } from '../../logger.js'; +import Resolver from '../../resolver'; +import { IRemoteUser } from '@/models/entities/user'; +import rejectFollow from './follow'; +import { IReject, isFollow, getApType } from '../../type'; +import { apLogger } from '../../logger'; const logger = apLogger; diff --git a/src/remote/activitypub/kernel/remove/index.ts b/src/remote/activitypub/kernel/remove/index.ts index 7d7b3386c0..d59953e653 100644 --- a/src/remote/activitypub/kernel/remove/index.ts +++ b/src/remote/activitypub/kernel/remove/index.ts @@ -1,7 +1,7 @@ -import { IRemoteUser } from '@/models/entities/user.js'; -import { IRemove } from '../../type.js'; -import { resolveNote } from '../../models/note.js'; -import { removePinned } from '@/services/i/pin.js'; +import { IRemoteUser } from '@/models/entities/user'; +import { IRemove } from '../../type'; +import { resolveNote } from '../../models/note'; +import { removePinned } from '@/services/i/pin'; export default async (actor: IRemoteUser, activity: IRemove): Promise => { if ('actor' in activity && actor.uri !== activity.actor) { diff --git a/src/remote/activitypub/kernel/undo/announce.ts b/src/remote/activitypub/kernel/undo/announce.ts index d0c8c7cb66..7bb9d7fcad 100644 --- a/src/remote/activitypub/kernel/undo/announce.ts +++ b/src/remote/activitypub/kernel/undo/announce.ts @@ -1,7 +1,7 @@ -import { Notes } from '@/models/index.js'; -import { IRemoteUser } from '@/models/entities/user.js'; -import { IAnnounce, getApId } from '../../type.js'; -import deleteNote from '@/services/note/delete.js'; +import { Notes } from '@/models/index'; +import { IRemoteUser } from '@/models/entities/user'; +import { IAnnounce, getApId } from '../../type'; +import deleteNote from '@/services/note/delete'; export const undoAnnounce = async (actor: IRemoteUser, activity: IAnnounce): Promise => { const uri = getApId(activity); diff --git a/src/remote/activitypub/kernel/undo/block.ts b/src/remote/activitypub/kernel/undo/block.ts index 844b067e2b..61940486be 100644 --- a/src/remote/activitypub/kernel/undo/block.ts +++ b/src/remote/activitypub/kernel/undo/block.ts @@ -1,7 +1,7 @@ -import { IBlock } from '../../type.js'; -import unblock from '@/services/blocking/delete.js'; -import { IRemoteUser } from '@/models/entities/user.js'; -import DbResolver from '../../db-resolver.js'; +import { IBlock } from '../../type'; +import unblock from '@/services/blocking/delete'; +import { IRemoteUser } from '@/models/entities/user'; +import DbResolver from '../../db-resolver'; export default async (actor: IRemoteUser, activity: IBlock): Promise => { const dbResolver = new DbResolver(); diff --git a/src/remote/activitypub/kernel/undo/follow.ts b/src/remote/activitypub/kernel/undo/follow.ts index cbf9b2e800..d85c7e4a71 100644 --- a/src/remote/activitypub/kernel/undo/follow.ts +++ b/src/remote/activitypub/kernel/undo/follow.ts @@ -1,9 +1,9 @@ -import unfollow from '@/services/following/delete.js'; -import cancelRequest from '@/services/following/requests/cancel.js'; -import { IFollow } from '../../type.js'; -import { IRemoteUser } from '@/models/entities/user.js'; -import { FollowRequests, Followings } from '@/models/index.js'; -import DbResolver from '../../db-resolver.js'; +import unfollow from '@/services/following/delete'; +import cancelRequest from '@/services/following/requests/cancel'; +import { IFollow } from '../../type'; +import { IRemoteUser } from '@/models/entities/user'; +import { FollowRequests, Followings } from '@/models/index'; +import DbResolver from '../../db-resolver'; export default async (actor: IRemoteUser, activity: IFollow): Promise => { const dbResolver = new DbResolver(); diff --git a/src/remote/activitypub/kernel/undo/index.ts b/src/remote/activitypub/kernel/undo/index.ts index a03a785c0b..14b1add152 100644 --- a/src/remote/activitypub/kernel/undo/index.ts +++ b/src/remote/activitypub/kernel/undo/index.ts @@ -1,11 +1,11 @@ -import { IRemoteUser } from '@/models/entities/user.js'; -import { IUndo, isFollow, isBlock, isLike, isAnnounce, getApType } from '../../type.js'; -import unfollow from './follow.js'; -import unblock from './block.js'; -import undoLike from './like.js'; -import { undoAnnounce } from './announce.js'; -import Resolver from '../../resolver.js'; -import { apLogger } from '../../logger.js'; +import { IRemoteUser } from '@/models/entities/user'; +import { IUndo, isFollow, isBlock, isLike, isAnnounce, getApType } from '../../type'; +import unfollow from './follow'; +import unblock from './block'; +import undoLike from './like'; +import { undoAnnounce } from './announce'; +import Resolver from '../../resolver'; +import { apLogger } from '../../logger'; const logger = apLogger; diff --git a/src/remote/activitypub/kernel/undo/like.ts b/src/remote/activitypub/kernel/undo/like.ts index 283e556b35..7f821cada0 100644 --- a/src/remote/activitypub/kernel/undo/like.ts +++ b/src/remote/activitypub/kernel/undo/like.ts @@ -1,7 +1,7 @@ -import { IRemoteUser } from '@/models/entities/user.js'; -import { ILike, getApId } from '../../type.js'; -import deleteReaction from '@/services/note/reaction/delete.js'; -import { fetchNote } from '../../models/note.js'; +import { IRemoteUser } from '@/models/entities/user'; +import { ILike, getApId } from '../../type'; +import deleteReaction from '@/services/note/reaction/delete'; +import { fetchNote } from '../../models/note'; /** * Process Undo.Like activity diff --git a/src/remote/activitypub/kernel/update/index.ts b/src/remote/activitypub/kernel/update/index.ts index 7888c698e3..52bfc5002e 100644 --- a/src/remote/activitypub/kernel/update/index.ts +++ b/src/remote/activitypub/kernel/update/index.ts @@ -1,9 +1,9 @@ -import { IRemoteUser } from '@/models/entities/user.js'; -import { getApType, IUpdate, isActor } from '../../type.js'; -import { apLogger } from '../../logger.js'; -import { updateQuestion } from '../../models/question.js'; -import Resolver from '../../resolver.js'; -import { updatePerson } from '../../models/person.js'; +import { IRemoteUser } from '@/models/entities/user'; +import { getApType, IUpdate, isActor } from '../../type'; +import { apLogger } from '../../logger'; +import { updateQuestion } from '../../models/question'; +import Resolver from '../../resolver'; +import { updatePerson } from '../../models/person'; /** * Updateアクティビティを捌きます diff --git a/src/remote/activitypub/logger.ts b/src/remote/activitypub/logger.ts index cab51b3bf5..e13add01db 100644 --- a/src/remote/activitypub/logger.ts +++ b/src/remote/activitypub/logger.ts @@ -1,3 +1,3 @@ -import { remoteLogger } from '../logger.js'; +import { remoteLogger } from '../logger'; export const apLogger = remoteLogger.createSubLogger('ap', 'magenta'); diff --git a/src/remote/activitypub/misc/get-note-html.ts b/src/remote/activitypub/misc/get-note-html.ts index 3800b40608..043335a5be 100644 --- a/src/remote/activitypub/misc/get-note-html.ts +++ b/src/remote/activitypub/misc/get-note-html.ts @@ -1,6 +1,6 @@ import * as mfm from 'mfm-js'; -import { Note } from '@/models/entities/note.js'; -import { toHtml } from '../../../mfm/to-html.js'; +import { Note } from '@/models/entities/note'; +import { toHtml } from '../../../mfm/to-html'; export default function(note: Note) { let html = note.text ? toHtml(mfm.parse(note.text), JSON.parse(note.mentionedRemoteUsers)) : null; diff --git a/src/remote/activitypub/misc/html-to-mfm.ts b/src/remote/activitypub/misc/html-to-mfm.ts index bb1ba7925c..5cca04df21 100644 --- a/src/remote/activitypub/misc/html-to-mfm.ts +++ b/src/remote/activitypub/misc/html-to-mfm.ts @@ -1,6 +1,6 @@ -import { IObject } from '../type.js'; -import { extractApHashtagObjects } from '../models/tag.js'; -import { fromHtml } from '../../../mfm/from-html.js'; +import { IObject } from '../type'; +import { extractApHashtagObjects } from '../models/tag'; +import { fromHtml } from '../../../mfm/from-html'; export function htmlToMfm(html: string, tag?: IObject | IObject[]) { const hashtagNames = extractApHashtagObjects(tag).map(x => x.name).filter((x): x is string => x != null); diff --git a/src/remote/activitypub/misc/ld-signature.ts b/src/remote/activitypub/misc/ld-signature.ts index c73cef81e1..dec07ea81b 100644 --- a/src/remote/activitypub/misc/ld-signature.ts +++ b/src/remote/activitypub/misc/ld-signature.ts @@ -1,8 +1,8 @@ import * as crypto from 'crypto'; import * as jsonld from 'jsonld'; -import { CONTEXTS } from './contexts.js'; +import { CONTEXTS } from './contexts'; import fetch from 'node-fetch'; -import { httpAgent, httpsAgent } from '@/misc/fetch.js'; +import { httpAgent, httpsAgent } from '@/misc/fetch'; // RsaSignature2017 based from https://github.com/transmute-industries/RsaSignature2017 diff --git a/src/remote/activitypub/models/image.ts b/src/remote/activitypub/models/image.ts index ea2584407a..cd28d59a16 100644 --- a/src/remote/activitypub/models/image.ts +++ b/src/remote/activitypub/models/image.ts @@ -1,10 +1,10 @@ -import uploadFromUrl from '@/services/drive/upload-from-url.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 { DriveFile } from '@/models/entities/drive-file.js'; -import { DriveFiles } from '@/models/index.js'; +import uploadFromUrl from '@/services/drive/upload-from-url'; +import { IRemoteUser } from '@/models/entities/user'; +import Resolver from '../resolver'; +import { fetchMeta } from '@/misc/fetch-meta'; +import { apLogger } from '../logger'; +import { DriveFile } from '@/models/entities/drive-file'; +import { DriveFiles } from '@/models/index'; const logger = apLogger; diff --git a/src/remote/activitypub/models/mention.ts b/src/remote/activitypub/models/mention.ts index e84429815d..0db0324aba 100644 --- a/src/remote/activitypub/models/mention.ts +++ b/src/remote/activitypub/models/mention.ts @@ -1,9 +1,9 @@ -import { toArray, unique } from '../../../prelude/array.js'; -import { IObject, isMention, IApMention } from '../type.js'; -import { resolvePerson } from './person.js'; +import { toArray, unique } from '../../../prelude/array'; +import { IObject, isMention, IApMention } from '../type'; +import { resolvePerson } from './person'; import * as promiseLimit from 'promise-limit'; -import Resolver from '../resolver.js'; -import { User } from '@/models/entities/user.js'; +import Resolver from '../resolver'; +import { User } from '@/models/entities/user'; export async function extractApMentions(tags: IObject | IObject[] | null | undefined) { const hrefs = unique(extractApMentionObjects(tags).map(x => x.href as string)); diff --git a/src/remote/activitypub/models/note.ts b/src/remote/activitypub/models/note.ts index 2a4f51bb3b..d28d642a0a 100644 --- a/src/remote/activitypub/models/note.ts +++ b/src/remote/activitypub/models/note.ts @@ -1,31 +1,31 @@ import * as promiseLimit from 'promise-limit'; -import config from '@/config/index.js'; -import Resolver from '../resolver.js'; -import post from '@/services/note/create.js'; -import { resolvePerson, updatePerson } from './person.js'; -import { resolveImage } from './image.js'; -import { IRemoteUser } 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'; -import { extractPollFromQuestion } from './question.js'; -import vote from '@/services/note/polls/vote.js'; -import { apLogger } from '../logger.js'; -import { DriveFile } from '@/models/entities/drive-file.js'; -import { deliverQuestionUpdate } from '@/services/note/polls/update.js'; -import { extractDbHost, toPuny } from '@/misc/convert-host.js'; -import { Emojis, Polls, MessagingMessages } from '@/models/index.js'; -import { Note } from '@/models/entities/note.js'; -import { IObject, getOneApId, getApId, getOneApHrefNullable, validPost, IPost, isEmoji, getApType } from '../type.js'; -import { Emoji } from '@/models/entities/emoji.js'; -import { genId } from '@/misc/gen-id.js'; -import { fetchMeta } from '@/misc/fetch-meta.js'; -import { getApLock } from '@/misc/app-lock.js'; -import { createMessage } from '@/services/messages/create.js'; -import { parseAudience } from '../audience.js'; -import { extractApMentions } from './mention.js'; -import DbResolver from '../db-resolver.js'; +import config from '@/config/index'; +import Resolver from '../resolver'; +import post from '@/services/note/create'; +import { resolvePerson, updatePerson } from './person'; +import { resolveImage } from './image'; +import { IRemoteUser } from '@/models/entities/user'; +import { htmlToMfm } from '../misc/html-to-mfm'; +import { extractApHashtags } from './tag'; +import { unique, toArray, toSingle } from '../../../prelude/array'; +import { extractPollFromQuestion } from './question'; +import vote from '@/services/note/polls/vote'; +import { apLogger } from '../logger'; +import { DriveFile } from '@/models/entities/drive-file'; +import { deliverQuestionUpdate } from '@/services/note/polls/update'; +import { extractDbHost, toPuny } from '@/misc/convert-host'; +import { Emojis, Polls, MessagingMessages } from '@/models/index'; +import { Note } from '@/models/entities/note'; +import { IObject, getOneApId, getApId, getOneApHrefNullable, validPost, IPost, isEmoji, getApType } from '../type'; +import { Emoji } from '@/models/entities/emoji'; +import { genId } from '@/misc/gen-id'; +import { fetchMeta } from '@/misc/fetch-meta'; +import { getApLock } from '@/misc/app-lock'; +import { createMessage } from '@/services/messages/create'; +import { parseAudience } from '../audience'; +import { extractApMentions } from './mention'; +import DbResolver from '../db-resolver'; const logger = apLogger; diff --git a/src/remote/activitypub/models/person.ts b/src/remote/activitypub/models/person.ts index 2b7d707ac8..3ae13135e3 100644 --- a/src/remote/activitypub/models/person.ts +++ b/src/remote/activitypub/models/person.ts @@ -2,32 +2,32 @@ import { URL } from 'url'; import * as promiseLimit from 'promise-limit'; import $, { Context } from 'cafy'; -import config from '@/config/index.js'; -import Resolver from '../resolver.js'; -import { resolveImage } from './image.js'; -import { isCollectionOrOrderedCollection, isCollection, IActor, getApId, getOneApHrefNullable, IObject, isPropertyValue, IApPropertyValue, getApType, isActor } from '../type.js'; -import { fromHtml } from '../../../mfm/from-html.js'; -import { htmlToMfm } from '../misc/html-to-mfm.js'; -import { resolveNote, extractEmojis } from './note.js'; -import { registerOrFetchInstanceDoc } from '@/services/register-or-fetch-instance-doc.js'; -import { extractApHashtags } from './tag.js'; -import { apLogger } from '../logger.js'; -import { Note } from '@/models/entities/note.js'; -import { updateUsertags } from '@/services/update-hashtag.js'; -import { Users, Instances, DriveFiles, Followings, UserProfiles, UserPublickeys } from '@/models/index.js'; -import { User, IRemoteUser } from '@/models/entities/user.js'; -import { Emoji } from '@/models/entities/emoji.js'; -import { UserNotePining } from '@/models/entities/user-note-pining.js'; -import { genId } from '@/misc/gen-id.js'; -import { instanceChart, usersChart } from '@/services/chart/index.js'; -import { UserPublickey } from '@/models/entities/user-publickey.js'; -import { isDuplicateKeyValueError } from '@/misc/is-duplicate-key-value-error.js'; -import { toPuny } from '@/misc/convert-host.js'; -import { UserProfile } from '@/models/entities/user-profile.js'; +import config from '@/config/index'; +import Resolver from '../resolver'; +import { resolveImage } from './image'; +import { isCollectionOrOrderedCollection, isCollection, IActor, getApId, getOneApHrefNullable, IObject, isPropertyValue, IApPropertyValue, getApType, isActor } from '../type'; +import { fromHtml } from '../../../mfm/from-html'; +import { htmlToMfm } from '../misc/html-to-mfm'; +import { resolveNote, extractEmojis } from './note'; +import { registerOrFetchInstanceDoc } from '@/services/register-or-fetch-instance-doc'; +import { extractApHashtags } from './tag'; +import { apLogger } from '../logger'; +import { Note } from '@/models/entities/note'; +import { updateUsertags } from '@/services/update-hashtag'; +import { Users, Instances, DriveFiles, Followings, UserProfiles, UserPublickeys } from '@/models/index'; +import { User, IRemoteUser } from '@/models/entities/user'; +import { Emoji } from '@/models/entities/emoji'; +import { UserNotePining } from '@/models/entities/user-note-pining'; +import { genId } from '@/misc/gen-id'; +import { instanceChart, usersChart } from '@/services/chart/index'; +import { UserPublickey } from '@/models/entities/user-publickey'; +import { isDuplicateKeyValueError } from '@/misc/is-duplicate-key-value-error'; +import { toPuny } from '@/misc/convert-host'; +import { UserProfile } from '@/models/entities/user-profile'; import { getConnection } from 'typeorm'; -import { toArray } from '../../../prelude/array.js'; -import { fetchInstanceMetadata } from '@/services/fetch-instance-metadata.js'; -import { normalizeForSearch } from '@/misc/normalize-for-search.js'; +import { toArray } from '../../../prelude/array'; +import { fetchInstanceMetadata } from '@/services/fetch-instance-metadata'; +import { normalizeForSearch } from '@/misc/normalize-for-search'; const logger = apLogger; diff --git a/src/remote/activitypub/models/question.ts b/src/remote/activitypub/models/question.ts index f954a38e8b..79f93c3a30 100644 --- a/src/remote/activitypub/models/question.ts +++ b/src/remote/activitypub/models/question.ts @@ -1,9 +1,9 @@ -import config from '@/config/index.js'; -import Resolver from '../resolver.js'; -import { IObject, IQuestion, isQuestion, } from '../type.js'; -import { apLogger } from '../logger.js'; -import { Notes, Polls } from '@/models/index.js'; -import { IPoll } from '@/models/entities/poll.js'; +import config from '@/config/index'; +import Resolver from '../resolver'; +import { IObject, IQuestion, isQuestion, } from '../type'; +import { apLogger } from '../logger'; +import { Notes, Polls } from '@/models/index'; +import { IPoll } from '@/models/entities/poll'; export async function extractPollFromQuestion(source: string | IObject, resolver?: Resolver): Promise { if (resolver == null) resolver = new Resolver(); diff --git a/src/remote/activitypub/models/tag.ts b/src/remote/activitypub/models/tag.ts index cb8c753365..d25cb463fe 100644 --- a/src/remote/activitypub/models/tag.ts +++ b/src/remote/activitypub/models/tag.ts @@ -1,5 +1,5 @@ -import { toArray } from '../../../prelude/array.js'; -import { IObject, isHashtag, IApHashtag } from '../type.js'; +import { toArray } from '../../../prelude/array'; +import { IObject, isHashtag, IApHashtag } from '../type'; export function extractApHashtags(tags: IObject | IObject[] | null | undefined) { if (tags == null) return []; diff --git a/src/remote/activitypub/perform.ts b/src/remote/activitypub/perform.ts index 3e18815586..01f0e3676e 100644 --- a/src/remote/activitypub/perform.ts +++ b/src/remote/activitypub/perform.ts @@ -1,6 +1,6 @@ -import { IObject } from './type.js'; -import { IRemoteUser } from '@/models/entities/user.js'; -import { performActivity } from './kernel/index.js'; +import { IObject } from './type'; +import { IRemoteUser } from '@/models/entities/user'; +import { performActivity } from './kernel/index'; export default async (actor: IRemoteUser, activity: IObject): Promise => { await performActivity(actor, activity); diff --git a/src/remote/activitypub/renderer/accept.ts b/src/remote/activitypub/renderer/accept.ts index f1037e95f2..f1e61f4c6a 100644 --- a/src/remote/activitypub/renderer/accept.ts +++ b/src/remote/activitypub/renderer/accept.ts @@ -1,5 +1,5 @@ -import config from '@/config/index.js'; -import { User } from '@/models/entities/user.js'; +import config from '@/config/index'; +import { User } from '@/models/entities/user'; export default (object: any, user: { id: User['id']; host: null }) => ({ type: 'Accept', diff --git a/src/remote/activitypub/renderer/add.ts b/src/remote/activitypub/renderer/add.ts index fce541bcdc..21414a9380 100644 --- a/src/remote/activitypub/renderer/add.ts +++ b/src/remote/activitypub/renderer/add.ts @@ -1,5 +1,5 @@ -import config from '@/config/index.js'; -import { ILocalUser } from '@/models/entities/user.js'; +import config from '@/config/index'; +import { ILocalUser } from '@/models/entities/user'; export default (user: ILocalUser, target: any, object: any) => ({ type: 'Add', diff --git a/src/remote/activitypub/renderer/announce.ts b/src/remote/activitypub/renderer/announce.ts index dfbe4714c9..7bf90922be 100644 --- a/src/remote/activitypub/renderer/announce.ts +++ b/src/remote/activitypub/renderer/announce.ts @@ -1,5 +1,5 @@ -import config from '@/config/index.js'; -import { Note } from '@/models/entities/note.js'; +import config from '@/config/index'; +import { Note } from '@/models/entities/note'; export default (object: any, note: Note) => { const attributedTo = `${config.url}/users/${note.userId}`; diff --git a/src/remote/activitypub/renderer/block.ts b/src/remote/activitypub/renderer/block.ts index 4e9102e6f0..bb3d74295a 100644 --- a/src/remote/activitypub/renderer/block.ts +++ b/src/remote/activitypub/renderer/block.ts @@ -1,5 +1,5 @@ -import config from '@/config/index.js'; -import { ILocalUser, IRemoteUser } from '@/models/entities/user.js'; +import config from '@/config/index'; +import { ILocalUser, IRemoteUser } from '@/models/entities/user'; export default (blocker: ILocalUser, blockee: IRemoteUser) => ({ type: 'Block', diff --git a/src/remote/activitypub/renderer/create.ts b/src/remote/activitypub/renderer/create.ts index 103ce4bfd5..04aa993a91 100644 --- a/src/remote/activitypub/renderer/create.ts +++ b/src/remote/activitypub/renderer/create.ts @@ -1,5 +1,5 @@ -import config from '@/config/index.js'; -import { Note } from '@/models/entities/note.js'; +import config from '@/config/index'; +import { Note } from '@/models/entities/note'; export default (object: any, note: Note) => { const activity = { diff --git a/src/remote/activitypub/renderer/delete.ts b/src/remote/activitypub/renderer/delete.ts index 159a486e08..83b27fa866 100644 --- a/src/remote/activitypub/renderer/delete.ts +++ b/src/remote/activitypub/renderer/delete.ts @@ -1,5 +1,5 @@ -import config from '@/config/index.js'; -import { User } from '@/models/entities/user.js'; +import config from '@/config/index'; +import { User } from '@/models/entities/user'; export default (object: any, user: { id: User['id']; host: null }) => ({ type: 'Delete', diff --git a/src/remote/activitypub/renderer/document.ts b/src/remote/activitypub/renderer/document.ts index c973de4c4c..a9d86dea15 100644 --- a/src/remote/activitypub/renderer/document.ts +++ b/src/remote/activitypub/renderer/document.ts @@ -1,5 +1,5 @@ -import { DriveFile } from '@/models/entities/drive-file.js'; -import { DriveFiles } from '@/models/index.js'; +import { DriveFile } from '@/models/entities/drive-file'; +import { DriveFiles } from '@/models/index'; export default (file: DriveFile) => ({ type: 'Document', diff --git a/src/remote/activitypub/renderer/emoji.ts b/src/remote/activitypub/renderer/emoji.ts index a58c0c1ad9..ca514c56b5 100644 --- a/src/remote/activitypub/renderer/emoji.ts +++ b/src/remote/activitypub/renderer/emoji.ts @@ -1,5 +1,5 @@ -import config from '@/config/index.js'; -import { Emoji } from '@/models/entities/emoji.js'; +import config from '@/config/index'; +import { Emoji } from '@/models/entities/emoji'; export default (emoji: Emoji) => ({ id: `${config.url}/emojis/${emoji.name}`, diff --git a/src/remote/activitypub/renderer/follow-relay.ts b/src/remote/activitypub/renderer/follow-relay.ts index 4340b70537..984c3c7639 100644 --- a/src/remote/activitypub/renderer/follow-relay.ts +++ b/src/remote/activitypub/renderer/follow-relay.ts @@ -1,6 +1,6 @@ -import config from '@/config/index.js'; -import { Relay } from '@/models/entities/relay.js'; -import { ILocalUser } from '@/models/entities/user.js'; +import config from '@/config/index'; +import { Relay } from '@/models/entities/relay'; +import { ILocalUser } from '@/models/entities/user'; export function renderFollowRelay(relay: Relay, relayActor: ILocalUser) { const follow = { diff --git a/src/remote/activitypub/renderer/follow-user.ts b/src/remote/activitypub/renderer/follow-user.ts index ad1d63b933..e3dde7f7fe 100644 --- a/src/remote/activitypub/renderer/follow-user.ts +++ b/src/remote/activitypub/renderer/follow-user.ts @@ -1,6 +1,6 @@ -import config from '@/config/index.js'; -import { Users } from '@/models/index.js'; -import { User } from '@/models/entities/user.js'; +import config from '@/config/index'; +import { Users } from '@/models/index'; +import { User } from '@/models/entities/user'; /** * Convert (local|remote)(Follower|Followee)ID to URL diff --git a/src/remote/activitypub/renderer/follow.ts b/src/remote/activitypub/renderer/follow.ts index 9f80bf829b..c8a7946799 100644 --- a/src/remote/activitypub/renderer/follow.ts +++ b/src/remote/activitypub/renderer/follow.ts @@ -1,6 +1,6 @@ -import config from '@/config/index.js'; -import { User } from '@/models/entities/user.js'; -import { Users } from '@/models/index.js'; +import config from '@/config/index'; +import { User } from '@/models/entities/user'; +import { Users } from '@/models/index'; export default (follower: { id: User['id']; host: User['host']; uri: User['host'] }, followee: { id: User['id']; host: User['host']; uri: User['host'] }, requestId?: string) => { const follow = { diff --git a/src/remote/activitypub/renderer/hashtag.ts b/src/remote/activitypub/renderer/hashtag.ts index faa0efe924..290c74c7fe 100644 --- a/src/remote/activitypub/renderer/hashtag.ts +++ b/src/remote/activitypub/renderer/hashtag.ts @@ -1,4 +1,4 @@ -import config from '@/config/index.js'; +import config from '@/config/index'; export default (tag: string) => ({ type: 'Hashtag', diff --git a/src/remote/activitypub/renderer/image.ts b/src/remote/activitypub/renderer/image.ts index 6440248a4a..0cb3d6ed65 100644 --- a/src/remote/activitypub/renderer/image.ts +++ b/src/remote/activitypub/renderer/image.ts @@ -1,5 +1,5 @@ -import { DriveFile } from '@/models/entities/drive-file.js'; -import { DriveFiles } from '@/models/index.js'; +import { DriveFile } from '@/models/entities/drive-file'; +import { DriveFiles } from '@/models/index'; export default (file: DriveFile) => ({ type: 'Image', diff --git a/src/remote/activitypub/renderer/index.ts b/src/remote/activitypub/renderer/index.ts index 5ab5b1cdbe..f6ec6583d0 100644 --- a/src/remote/activitypub/renderer/index.ts +++ b/src/remote/activitypub/renderer/index.ts @@ -1,9 +1,9 @@ -import config from '@/config/index.js'; +import config from '@/config/index'; import { v4 as uuid } from 'uuid'; -import { IActivity } from '../type.js'; -import { LdSignature } from '../misc/ld-signature.js'; -import { getUserKeypair } from '@/misc/keypair-store.js'; -import { User } from '@/models/entities/user.js'; +import { IActivity } from '../type'; +import { LdSignature } from '../misc/ld-signature'; +import { getUserKeypair } from '@/misc/keypair-store'; +import { User } from '@/models/entities/user'; export const renderActivity = (x: any): IActivity | null => { if (x == null) return null; diff --git a/src/remote/activitypub/renderer/key.ts b/src/remote/activitypub/renderer/key.ts index 4db1d83262..992f98d79a 100644 --- a/src/remote/activitypub/renderer/key.ts +++ b/src/remote/activitypub/renderer/key.ts @@ -1,6 +1,6 @@ -import config from '@/config/index.js'; -import { ILocalUser } from '@/models/entities/user.js'; -import { UserKeypair } from '@/models/entities/user-keypair.js'; +import config from '@/config/index'; +import { ILocalUser } from '@/models/entities/user'; +import { UserKeypair } from '@/models/entities/user-keypair'; import { createPublicKey } from 'crypto'; export default (user: ILocalUser, key: UserKeypair, postfix?: string) => ({ diff --git a/src/remote/activitypub/renderer/like.ts b/src/remote/activitypub/renderer/like.ts index 6ec0bfb034..a7e79a176f 100644 --- a/src/remote/activitypub/renderer/like.ts +++ b/src/remote/activitypub/renderer/like.ts @@ -1,8 +1,8 @@ -import config from '@/config/index.js'; -import { NoteReaction } from '@/models/entities/note-reaction.js'; -import { Note } from '@/models/entities/note.js'; -import { Emojis } from '@/models/index.js'; -import renderEmoji from './emoji.js'; +import config from '@/config/index'; +import { NoteReaction } from '@/models/entities/note-reaction'; +import { Note } from '@/models/entities/note'; +import { Emojis } from '@/models/index'; +import renderEmoji from './emoji'; export const renderLike = async (noteReaction: NoteReaction, note: Note) => { const reaction = noteReaction.reaction; diff --git a/src/remote/activitypub/renderer/mention.ts b/src/remote/activitypub/renderer/mention.ts index c7e62e8840..06d2d33e59 100644 --- a/src/remote/activitypub/renderer/mention.ts +++ b/src/remote/activitypub/renderer/mention.ts @@ -1,6 +1,6 @@ -import config from '@/config/index.js'; -import { User, ILocalUser } from '@/models/entities/user.js'; -import { Users } from '@/models/index.js'; +import config from '@/config/index'; +import { User, ILocalUser } from '@/models/entities/user'; +import { Users } from '@/models/index'; export default (mention: User) => ({ type: 'Mention', diff --git a/src/remote/activitypub/renderer/note.ts b/src/remote/activitypub/renderer/note.ts index 0f4513fca7..84a1786784 100644 --- a/src/remote/activitypub/renderer/note.ts +++ b/src/remote/activitypub/renderer/note.ts @@ -1,15 +1,15 @@ -import renderDocument from './document.js'; -import renderHashtag from './hashtag.js'; -import renderMention from './mention.js'; -import renderEmoji from './emoji.js'; -import config from '@/config/index.js'; -import toHtml from '../misc/get-note-html.js'; -import { Note, IMentionedRemoteUsers } from '@/models/entities/note.js'; -import { DriveFile } from '@/models/entities/drive-file.js'; -import { DriveFiles, Notes, Users, Emojis, Polls } from '@/models/index.js'; +import renderDocument from './document'; +import renderHashtag from './hashtag'; +import renderMention from './mention'; +import renderEmoji from './emoji'; +import config from '@/config/index'; +import toHtml from '../misc/get-note-html'; +import { Note, IMentionedRemoteUsers } from '@/models/entities/note'; +import { DriveFile } from '@/models/entities/drive-file'; +import { DriveFiles, Notes, Users, Emojis, Polls } from '@/models/index'; import { In } from 'typeorm'; -import { Emoji } from '@/models/entities/emoji.js'; -import { Poll } from '@/models/entities/poll.js'; +import { Emoji } from '@/models/entities/emoji'; +import { Poll } from '@/models/entities/poll'; export default async function renderNote(note: Note, dive = true, isTalk = false): Promise { const getPromisedFiles = async (ids: string[]) => { diff --git a/src/remote/activitypub/renderer/person.ts b/src/remote/activitypub/renderer/person.ts index edcb68ef6a..f2a283a870 100644 --- a/src/remote/activitypub/renderer/person.ts +++ b/src/remote/activitypub/renderer/person.ts @@ -1,16 +1,16 @@ import { URL } from 'url'; import * as mfm from 'mfm-js'; -import renderImage from './image.js'; -import renderKey from './key.js'; -import config from '@/config/index.js'; -import { ILocalUser } from '@/models/entities/user.js'; -import { toHtml } from '../../../mfm/to-html.js'; -import { getEmojis } from './note.js'; -import renderEmoji from './emoji.js'; -import { IIdentifier } from '../models/identifier.js'; -import renderHashtag from './hashtag.js'; -import { DriveFiles, UserProfiles } from '@/models/index.js'; -import { getUserKeypair } from '@/misc/keypair-store.js'; +import renderImage from './image'; +import renderKey from './key'; +import config from '@/config/index'; +import { ILocalUser } from '@/models/entities/user'; +import { toHtml } from '../../../mfm/to-html'; +import { getEmojis } from './note'; +import renderEmoji from './emoji'; +import { IIdentifier } from '../models/identifier'; +import renderHashtag from './hashtag'; +import { DriveFiles, UserProfiles } from '@/models/index'; +import { getUserKeypair } from '@/misc/keypair-store'; export async function renderPerson(user: ILocalUser) { const id = `${config.url}/users/${user.id}`; diff --git a/src/remote/activitypub/renderer/question.ts b/src/remote/activitypub/renderer/question.ts index 388398a7d8..246d599bab 100644 --- a/src/remote/activitypub/renderer/question.ts +++ b/src/remote/activitypub/renderer/question.ts @@ -1,7 +1,7 @@ -import config from '@/config/index.js'; -import { User } from '@/models/entities/user.js'; -import { Note } from '@/models/entities/note.js'; -import { Poll } from '@/models/entities/poll.js'; +import config from '@/config/index'; +import { User } from '@/models/entities/user'; +import { Note } from '@/models/entities/note'; +import { Poll } from '@/models/entities/poll'; export default async function renderQuestion(user: { id: User['id'] }, note: Note, poll: Poll) { const question = { diff --git a/src/remote/activitypub/renderer/read.ts b/src/remote/activitypub/renderer/read.ts index 39a852fcb5..95357f64d3 100644 --- a/src/remote/activitypub/renderer/read.ts +++ b/src/remote/activitypub/renderer/read.ts @@ -1,6 +1,6 @@ -import config from '@/config/index.js'; -import { User } from '@/models/entities/user.js'; -import { MessagingMessage } from '@/models/entities/messaging-message.js'; +import config from '@/config/index'; +import { User } from '@/models/entities/user'; +import { MessagingMessage } from '@/models/entities/messaging-message'; export const renderReadActivity = (user: { id: User['id'] }, message: MessagingMessage) => ({ type: 'Read', diff --git a/src/remote/activitypub/renderer/reject.ts b/src/remote/activitypub/renderer/reject.ts index 474b67d680..42beffecf2 100644 --- a/src/remote/activitypub/renderer/reject.ts +++ b/src/remote/activitypub/renderer/reject.ts @@ -1,5 +1,5 @@ -import config from '@/config/index.js'; -import { User } from '@/models/entities/user.js'; +import config from '@/config/index'; +import { User } from '@/models/entities/user'; export default (object: any, user: { id: User['id'] }) => ({ type: 'Reject', diff --git a/src/remote/activitypub/renderer/remove.ts b/src/remote/activitypub/renderer/remove.ts index 1f6bc19404..79d60edbaa 100644 --- a/src/remote/activitypub/renderer/remove.ts +++ b/src/remote/activitypub/renderer/remove.ts @@ -1,5 +1,5 @@ -import config from '@/config/index.js'; -import { User } from '@/models/entities/user.js'; +import config from '@/config/index'; +import { User } from '@/models/entities/user'; export default (user: { id: User['id'] }, target: any, object: any) => ({ type: 'Remove', diff --git a/src/remote/activitypub/renderer/undo.ts b/src/remote/activitypub/renderer/undo.ts index 968d59fae6..f9082ffdfc 100644 --- a/src/remote/activitypub/renderer/undo.ts +++ b/src/remote/activitypub/renderer/undo.ts @@ -1,5 +1,5 @@ -import config from '@/config/index.js'; -import { ILocalUser, User } from '@/models/entities/user.js'; +import config from '@/config/index'; +import { ILocalUser, User } from '@/models/entities/user'; export default (object: any, user: { id: User['id'] }) => { if (object == null) return null; diff --git a/src/remote/activitypub/renderer/update.ts b/src/remote/activitypub/renderer/update.ts index c696a9c34b..d9a8149af3 100644 --- a/src/remote/activitypub/renderer/update.ts +++ b/src/remote/activitypub/renderer/update.ts @@ -1,5 +1,5 @@ -import config from '@/config/index.js'; -import { User } from '@/models/entities/user.js'; +import config from '@/config/index'; +import { User } from '@/models/entities/user'; export default (object: any, user: { id: User['id'] }) => { const activity = { diff --git a/src/remote/activitypub/renderer/vote.ts b/src/remote/activitypub/renderer/vote.ts index 201845a189..ff038070f7 100644 --- a/src/remote/activitypub/renderer/vote.ts +++ b/src/remote/activitypub/renderer/vote.ts @@ -1,8 +1,8 @@ -import config from '@/config/index.js'; -import { Note } from '@/models/entities/note.js'; -import { IRemoteUser, User } from '@/models/entities/user.js'; -import { PollVote } from '@/models/entities/poll-vote.js'; -import { Poll } from '@/models/entities/poll.js'; +import config from '@/config/index'; +import { Note } from '@/models/entities/note'; +import { IRemoteUser, User } from '@/models/entities/user'; +import { PollVote } from '@/models/entities/poll-vote'; +import { Poll } from '@/models/entities/poll'; export default async function renderVote(user: { id: User['id'] }, vote: PollVote, note: Note, poll: Poll, pollOwner: IRemoteUser): Promise { return { diff --git a/src/remote/activitypub/request.ts b/src/remote/activitypub/request.ts index 2711c85874..fe1009243c 100644 --- a/src/remote/activitypub/request.ts +++ b/src/remote/activitypub/request.ts @@ -3,13 +3,13 @@ import * as https from 'https'; import { sign } from 'http-signature'; import * as crypto from 'crypto'; -import config from '@/config/index.js'; -import { User } from '@/models/entities/user.js'; -import { getAgentByUrl } from '@/misc/fetch.js'; +import config from '@/config/index'; +import { User } from '@/models/entities/user'; +import { getAgentByUrl } from '@/misc/fetch'; import { URL } from 'url'; import got from 'got'; import * as Got from 'got'; -import { getUserKeypair } from '@/misc/keypair-store.js'; +import { getUserKeypair } from '@/misc/keypair-store'; export default async (user: { id: User['id'] }, url: string, object: any) => { const timeout = 10 * 1000; diff --git a/src/remote/activitypub/resolver.ts b/src/remote/activitypub/resolver.ts index 8351058312..32f3d9ef26 100644 --- a/src/remote/activitypub/resolver.ts +++ b/src/remote/activitypub/resolver.ts @@ -1,9 +1,9 @@ -import config from '@/config/index.js'; -import { getJson } from '@/misc/fetch.js'; -import { ILocalUser } from '@/models/entities/user.js'; -import { getInstanceActor } from '@/services/instance-actor.js'; -import { signedGet } from './request.js'; -import { IObject, isCollectionOrOrderedCollection, ICollection, IOrderedCollection } from './type.js'; +import config from '@/config/index'; +import { getJson } from '@/misc/fetch'; +import { ILocalUser } from '@/models/entities/user'; +import { getInstanceActor } from '@/services/instance-actor'; +import { signedGet } from './request'; +import { IObject, isCollectionOrOrderedCollection, ICollection, IOrderedCollection } from './type'; export default class Resolver { private history: Set; diff --git a/src/remote/logger.ts b/src/remote/logger.ts index 4921f53bd8..9ffad4d716 100644 --- a/src/remote/logger.ts +++ b/src/remote/logger.ts @@ -1,3 +1,3 @@ -import Logger from '@/services/logger.js'; +import Logger from '@/services/logger'; export const remoteLogger = new Logger('remote', 'cyan'); diff --git a/src/remote/resolve-user.ts b/src/remote/resolve-user.ts index 1869204399..a12396abc8 100644 --- a/src/remote/resolve-user.ts +++ b/src/remote/resolve-user.ts @@ -1,12 +1,12 @@ import { URL } from 'url'; -import webFinger from './webfinger.js'; -import config from '@/config/index.js'; -import { createPerson, updatePerson } from './activitypub/models/person.js'; -import { remoteLogger } from './logger.js'; +import webFinger from './webfinger'; +import config from '@/config/index'; +import { createPerson, updatePerson } from './activitypub/models/person'; +import { remoteLogger } from './logger'; import * as chalk from 'chalk'; -import { User, IRemoteUser } from '@/models/entities/user.js'; -import { Users } from '@/models/index.js'; -import { toPuny } from '@/misc/convert-host.js'; +import { User, IRemoteUser } from '@/models/entities/user'; +import { Users } from '@/models/index'; +import { toPuny } from '@/misc/convert-host'; const logger = remoteLogger.createSubLogger('resolve-user'); diff --git a/src/remote/webfinger.ts b/src/remote/webfinger.ts index e885e9d7cb..744ab3639a 100644 --- a/src/remote/webfinger.ts +++ b/src/remote/webfinger.ts @@ -1,6 +1,6 @@ import { URL } from 'url'; -import { getJson } from '@/misc/fetch.js'; -import { query as urlQuery } from '../prelude/url.js'; +import { getJson } from '@/misc/fetch'; +import { query as urlQuery } from '../prelude/url'; type ILink = { href: string; diff --git a/src/server/activitypub.ts b/src/server/activitypub.ts index 834293a5a7..eabe681136 100644 --- a/src/server/activitypub.ts +++ b/src/server/activitypub.ts @@ -2,22 +2,22 @@ import * as Router from '@koa/router'; import * as json from 'koa-json-body'; import * as httpSignature from 'http-signature'; -import { renderActivity } from '@/remote/activitypub/renderer/index.js'; -import renderNote from '@/remote/activitypub/renderer/note.js'; -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 Outbox, { packActivity } from './activitypub/outbox.js'; -import Followers from './activitypub/followers.js'; -import Following from './activitypub/following.js'; -import Featured from './activitypub/featured.js'; -import { inbox as processInbox } from '@/queue/index.js'; -import { isSelfHost } from '@/misc/convert-host.js'; -import { Notes, Users, Emojis, NoteReactions } from '@/models/index.js'; -import { ILocalUser, User } from '@/models/entities/user.js'; +import { renderActivity } from '@/remote/activitypub/renderer/index'; +import renderNote from '@/remote/activitypub/renderer/note'; +import renderKey from '@/remote/activitypub/renderer/key'; +import { renderPerson } from '@/remote/activitypub/renderer/person'; +import renderEmoji from '@/remote/activitypub/renderer/emoji'; +import Outbox, { packActivity } from './activitypub/outbox'; +import Followers from './activitypub/followers'; +import Following from './activitypub/following'; +import Featured from './activitypub/featured'; +import { inbox as processInbox } from '@/queue/index'; +import { isSelfHost } from '@/misc/convert-host'; +import { Notes, Users, Emojis, NoteReactions } from '@/models/index'; +import { ILocalUser, User } from '@/models/entities/user'; import { In } from 'typeorm'; -import { renderLike } from '@/remote/activitypub/renderer/like.js'; -import { getUserKeypair } from '@/misc/keypair-store.js'; +import { renderLike } from '@/remote/activitypub/renderer/like'; +import { getUserKeypair } from '@/misc/keypair-store'; // Init router const router = new Router(); diff --git a/src/server/activitypub/featured.ts b/src/server/activitypub/featured.ts index 69de201137..1598cc680f 100644 --- a/src/server/activitypub/featured.ts +++ b/src/server/activitypub/featured.ts @@ -1,10 +1,10 @@ import * as Router from '@koa/router'; -import config from '@/config/index.js'; -import { renderActivity } from '@/remote/activitypub/renderer/index.js'; -import renderOrderedCollection from '@/remote/activitypub/renderer/ordered-collection.js'; -import { setResponseType } from '../activitypub.js'; -import renderNote from '@/remote/activitypub/renderer/note.js'; -import { Users, Notes, UserNotePinings } from '@/models/index.js'; +import config from '@/config/index'; +import { renderActivity } from '@/remote/activitypub/renderer/index'; +import renderOrderedCollection from '@/remote/activitypub/renderer/ordered-collection'; +import { setResponseType } from '../activitypub'; +import renderNote from '@/remote/activitypub/renderer/note'; +import { Users, Notes, UserNotePinings } from '@/models/index'; export default async (ctx: Router.RouterContext) => { const userId = ctx.params.user; diff --git a/src/server/activitypub/followers.ts b/src/server/activitypub/followers.ts index 13a3ae91ad..0fad6b13c1 100644 --- a/src/server/activitypub/followers.ts +++ b/src/server/activitypub/followers.ts @@ -1,14 +1,14 @@ import * as Router from '@koa/router'; -import config from '@/config/index.js'; +import config from '@/config/index'; import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import * as url from '../../prelude/url.js'; -import { renderActivity } from '@/remote/activitypub/renderer/index.js'; -import renderOrderedCollection from '@/remote/activitypub/renderer/ordered-collection.js'; -import renderOrderedCollectionPage from '@/remote/activitypub/renderer/ordered-collection-page.js'; -import renderFollowUser from '@/remote/activitypub/renderer/follow-user.js'; -import { setResponseType } from '../activitypub.js'; -import { Users, Followings } from '@/models/index.js'; +import { ID } from '@/misc/cafy-id'; +import * as url from '../../prelude/url'; +import { renderActivity } from '@/remote/activitypub/renderer/index'; +import renderOrderedCollection from '@/remote/activitypub/renderer/ordered-collection'; +import renderOrderedCollectionPage from '@/remote/activitypub/renderer/ordered-collection-page'; +import renderFollowUser from '@/remote/activitypub/renderer/follow-user'; +import { setResponseType } from '../activitypub'; +import { Users, Followings } from '@/models/index'; import { LessThan } from 'typeorm'; export default async (ctx: Router.RouterContext) => { diff --git a/src/server/activitypub/following.ts b/src/server/activitypub/following.ts index 1f7938bec4..e7316d3e4d 100644 --- a/src/server/activitypub/following.ts +++ b/src/server/activitypub/following.ts @@ -1,16 +1,16 @@ import * as Router from '@koa/router'; -import config from '@/config/index.js'; +import config from '@/config/index'; import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import * as url from '../../prelude/url.js'; -import { renderActivity } from '@/remote/activitypub/renderer/index.js'; -import renderOrderedCollection from '@/remote/activitypub/renderer/ordered-collection.js'; -import renderOrderedCollectionPage from '@/remote/activitypub/renderer/ordered-collection-page.js'; -import renderFollowUser from '@/remote/activitypub/renderer/follow-user.js'; -import { setResponseType } from '../activitypub.js'; -import { Users, Followings } from '@/models/index.js'; +import { ID } from '@/misc/cafy-id'; +import * as url from '../../prelude/url'; +import { renderActivity } from '@/remote/activitypub/renderer/index'; +import renderOrderedCollection from '@/remote/activitypub/renderer/ordered-collection'; +import renderOrderedCollectionPage from '@/remote/activitypub/renderer/ordered-collection-page'; +import renderFollowUser from '@/remote/activitypub/renderer/follow-user'; +import { setResponseType } from '../activitypub'; +import { Users, Followings } from '@/models/index'; import { LessThan, FindConditions } from 'typeorm'; -import { Following } from '@/models/entities/following.js'; +import { Following } from '@/models/entities/following'; export default async (ctx: Router.RouterContext) => { const userId = ctx.params.user; diff --git a/src/server/activitypub/outbox.ts b/src/server/activitypub/outbox.ts index eed489e59d..c6cf10de5e 100644 --- a/src/server/activitypub/outbox.ts +++ b/src/server/activitypub/outbox.ts @@ -1,20 +1,20 @@ import * as Router from '@koa/router'; -import config from '@/config/index.js'; +import config from '@/config/index'; import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import { renderActivity } from '@/remote/activitypub/renderer/index.js'; -import renderOrderedCollection from '@/remote/activitypub/renderer/ordered-collection.js'; -import renderOrderedCollectionPage from '@/remote/activitypub/renderer/ordered-collection-page.js'; -import { setResponseType } from '../activitypub.js'; -import renderNote from '@/remote/activitypub/renderer/note.js'; -import renderCreate from '@/remote/activitypub/renderer/create.js'; -import renderAnnounce from '@/remote/activitypub/renderer/announce.js'; -import { countIf } from '../../prelude/array.js'; -import * as url from '../../prelude/url.js'; -import { Users, Notes } from '@/models/index.js'; -import { makePaginationQuery } from '../api/common/make-pagination-query.js'; +import { ID } from '@/misc/cafy-id'; +import { renderActivity } from '@/remote/activitypub/renderer/index'; +import renderOrderedCollection from '@/remote/activitypub/renderer/ordered-collection'; +import renderOrderedCollectionPage from '@/remote/activitypub/renderer/ordered-collection-page'; +import { setResponseType } from '../activitypub'; +import renderNote from '@/remote/activitypub/renderer/note'; +import renderCreate from '@/remote/activitypub/renderer/create'; +import renderAnnounce from '@/remote/activitypub/renderer/announce'; +import { countIf } from '../../prelude/array'; +import * as url from '../../prelude/url'; +import { Users, Notes } from '@/models/index'; +import { makePaginationQuery } from '../api/common/make-pagination-query'; import { Brackets } from 'typeorm'; -import { Note } from '@/models/entities/note.js'; +import { Note } from '@/models/entities/note'; export default async (ctx: Router.RouterContext) => { const userId = ctx.params.user; diff --git a/src/server/api/2fa.ts b/src/server/api/2fa.ts index ee92caf55a..117446383d 100644 --- a/src/server/api/2fa.ts +++ b/src/server/api/2fa.ts @@ -1,5 +1,5 @@ import * as crypto from 'crypto'; -import config from '@/config/index.js'; +import config from '@/config/index'; import * as jsrsasign from 'jsrsasign'; const ECC_PRELUDE = Buffer.from([0x04]); diff --git a/src/server/api/api-handler.ts b/src/server/api/api-handler.ts index e2660d7b6f..cbace8917e 100644 --- a/src/server/api/api-handler.ts +++ b/src/server/api/api-handler.ts @@ -1,9 +1,9 @@ import * as Koa from 'koa'; -import { IEndpoint } from './endpoints.js'; -import authenticate, { AuthenticationError } from './authenticate.js'; -import call from './call.js'; -import { ApiError } from './error.js'; +import { IEndpoint } from './endpoints'; +import authenticate, { AuthenticationError } from './authenticate'; +import call from './call'; +import { ApiError } from './error'; export default (endpoint: IEndpoint, ctx: Koa.Context) => new Promise((res) => { const body = ctx.request.body; diff --git a/src/server/api/authenticate.ts b/src/server/api/authenticate.ts index cd5b01cd51..b8e216edc4 100644 --- a/src/server/api/authenticate.ts +++ b/src/server/api/authenticate.ts @@ -1,7 +1,7 @@ -import isNativeToken from './common/is-native-token.js'; -import { User } from '@/models/entities/user.js'; -import { Users, AccessTokens, Apps } from '@/models/index.js'; -import { AccessToken } from '@/models/entities/access-token.js'; +import isNativeToken from './common/is-native-token'; +import { User } from '@/models/entities/user'; +import { Users, AccessTokens, Apps } from '@/models/index'; +import { AccessToken } from '@/models/entities/access-token'; export class AuthenticationError extends Error { constructor(message: string) { diff --git a/src/server/api/call.ts b/src/server/api/call.ts index 899a5a6c72..2768bde07e 100644 --- a/src/server/api/call.ts +++ b/src/server/api/call.ts @@ -1,10 +1,10 @@ import { performance } from 'perf_hooks'; -import limiter from './limiter.js'; -import { User } from '@/models/entities/user.js'; -import endpoints from './endpoints.js'; -import { ApiError } from './error.js'; -import { apiLogger } from './logger.js'; -import { AccessToken } from '@/models/entities/access-token.js'; +import limiter from './limiter'; +import { User } from '@/models/entities/user'; +import endpoints from './endpoints'; +import { ApiError } from './error'; +import { apiLogger } from './logger'; +import { AccessToken } from '@/models/entities/access-token'; const accessDenied = { message: 'Access denied.', diff --git a/src/server/api/common/generate-block-query.ts b/src/server/api/common/generate-block-query.ts index 60db1e731b..4fd6184738 100644 --- a/src/server/api/common/generate-block-query.ts +++ b/src/server/api/common/generate-block-query.ts @@ -1,5 +1,5 @@ -import { User } from '@/models/entities/user.js'; -import { Blockings } from '@/models/index.js'; +import { User } from '@/models/entities/user'; +import { Blockings } from '@/models/index'; import { Brackets, SelectQueryBuilder } from 'typeorm'; // ここでいうBlockedは被Blockedの意 diff --git a/src/server/api/common/generate-channel-query.ts b/src/server/api/common/generate-channel-query.ts index 333bb73b86..80a0acf7f9 100644 --- a/src/server/api/common/generate-channel-query.ts +++ b/src/server/api/common/generate-channel-query.ts @@ -1,5 +1,5 @@ -import { User } from '@/models/entities/user.js'; -import { ChannelFollowings } from '@/models/index.js'; +import { User } from '@/models/entities/user'; +import { ChannelFollowings } from '@/models/index'; import { Brackets, SelectQueryBuilder } from 'typeorm'; export function generateChannelQuery(q: SelectQueryBuilder, me?: { id: User['id'] } | null) { diff --git a/src/server/api/common/generate-muted-note-query.ts b/src/server/api/common/generate-muted-note-query.ts index f544e334d3..0737842613 100644 --- a/src/server/api/common/generate-muted-note-query.ts +++ b/src/server/api/common/generate-muted-note-query.ts @@ -1,5 +1,5 @@ -import { User } from '@/models/entities/user.js'; -import { MutedNotes } from '@/models/index.js'; +import { User } from '@/models/entities/user'; +import { MutedNotes } from '@/models/index'; import { SelectQueryBuilder } from 'typeorm'; export function generateMutedNoteQuery(q: SelectQueryBuilder, me: { id: User['id'] }) { diff --git a/src/server/api/common/generate-muted-user-query.ts b/src/server/api/common/generate-muted-user-query.ts index 79cb3ff894..7e200b87ef 100644 --- a/src/server/api/common/generate-muted-user-query.ts +++ b/src/server/api/common/generate-muted-user-query.ts @@ -1,5 +1,5 @@ -import { User } from '@/models/entities/user.js'; -import { Mutings } from '@/models/index.js'; +import { User } from '@/models/entities/user'; +import { Mutings } from '@/models/index'; import { SelectQueryBuilder, Brackets } from 'typeorm'; export function generateMutedUserQuery(q: SelectQueryBuilder, me: { id: User['id'] }, exclude?: User) { diff --git a/src/server/api/common/generate-native-user-token.ts b/src/server/api/common/generate-native-user-token.ts index 5d8a4c5378..1f791c57ce 100644 --- a/src/server/api/common/generate-native-user-token.ts +++ b/src/server/api/common/generate-native-user-token.ts @@ -1,3 +1,3 @@ -import { secureRndstr } from '@/misc/secure-rndstr.js'; +import { secureRndstr } from '@/misc/secure-rndstr'; export default () => secureRndstr(16, true); diff --git a/src/server/api/common/generate-replies-query.ts b/src/server/api/common/generate-replies-query.ts index e59a3334ef..fbc41b2c25 100644 --- a/src/server/api/common/generate-replies-query.ts +++ b/src/server/api/common/generate-replies-query.ts @@ -1,4 +1,4 @@ -import { User } from '@/models/entities/user.js'; +import { User } from '@/models/entities/user'; import { Brackets, SelectQueryBuilder } from 'typeorm'; export function generateRepliesQuery(q: SelectQueryBuilder, me?: { id: User['id'] } | null) { diff --git a/src/server/api/common/generate-visibility-query.ts b/src/server/api/common/generate-visibility-query.ts index 715982934c..813e8b6c09 100644 --- a/src/server/api/common/generate-visibility-query.ts +++ b/src/server/api/common/generate-visibility-query.ts @@ -1,5 +1,5 @@ -import { User } from '@/models/entities/user.js'; -import { Followings } from '@/models/index.js'; +import { User } from '@/models/entities/user'; +import { Followings } from '@/models/index'; import { Brackets, SelectQueryBuilder } from 'typeorm'; export function generateVisibilityQuery(q: SelectQueryBuilder, me?: { id: User['id'] } | null) { diff --git a/src/server/api/common/getters.ts b/src/server/api/common/getters.ts index c5a47876d0..4b2ee8f1da 100644 --- a/src/server/api/common/getters.ts +++ b/src/server/api/common/getters.ts @@ -1,7 +1,7 @@ -import { IdentifiableError } from '@/misc/identifiable-error.js'; -import { User } from '@/models/entities/user.js'; -import { Note } from '@/models/entities/note.js'; -import { Notes, Users } from '@/models/index.js'; +import { IdentifiableError } from '@/misc/identifiable-error'; +import { User } from '@/models/entities/user'; +import { Note } from '@/models/entities/note'; +import { Notes, Users } from '@/models/index'; /** * Get note for API processing diff --git a/src/server/api/common/inject-featured.ts b/src/server/api/common/inject-featured.ts index b7dd8028b5..1dc13c83ef 100644 --- a/src/server/api/common/inject-featured.ts +++ b/src/server/api/common/inject-featured.ts @@ -1,9 +1,9 @@ import rndstr from 'rndstr'; -import { Note } from '@/models/entities/note.js'; -import { User } from '@/models/entities/user.js'; -import { Notes, UserProfiles, NoteReactions } from '@/models/index.js'; -import { generateMutedUserQuery } from './generate-muted-user-query.js'; -import { generateBlockedUserQuery } from './generate-block-query.js'; +import { Note } from '@/models/entities/note'; +import { User } from '@/models/entities/user'; +import { Notes, UserProfiles, NoteReactions } from '@/models/index'; +import { generateMutedUserQuery } from './generate-muted-user-query'; +import { generateBlockedUserQuery } from './generate-block-query'; // TODO: リアクション、Renote、返信などをしたノートは除外する diff --git a/src/server/api/common/inject-promo.ts b/src/server/api/common/inject-promo.ts index 971770f32a..87767a65bf 100644 --- a/src/server/api/common/inject-promo.ts +++ b/src/server/api/common/inject-promo.ts @@ -1,7 +1,7 @@ import rndstr from 'rndstr'; -import { Note } from '@/models/entities/note.js'; -import { User } from '@/models/entities/user.js'; -import { PromoReads, PromoNotes, Notes, Users } from '@/models/index.js'; +import { Note } from '@/models/entities/note'; +import { User } from '@/models/entities/user'; +import { PromoReads, PromoNotes, Notes, Users } from '@/models/index'; export async function injectPromo(timeline: Note[], user?: User | null) { if (timeline.length < 5) return; diff --git a/src/server/api/common/read-messaging-message.ts b/src/server/api/common/read-messaging-message.ts index 638aff3d58..8e030faa3d 100644 --- a/src/server/api/common/read-messaging-message.ts +++ b/src/server/api/common/read-messaging-message.ts @@ -1,17 +1,17 @@ -import { publishMainStream, publishGroupMessagingStream } from '@/services/stream.js'; -import { publishMessagingStream } from '@/services/stream.js'; -import { publishMessagingIndexStream } from '@/services/stream.js'; -import { User, IRemoteUser } from '@/models/entities/user.js'; -import { MessagingMessage } from '@/models/entities/messaging-message.js'; -import { MessagingMessages, UserGroupJoinings, Users } from '@/models/index.js'; +import { publishMainStream, publishGroupMessagingStream } from '@/services/stream'; +import { publishMessagingStream } from '@/services/stream'; +import { publishMessagingIndexStream } from '@/services/stream'; +import { User, IRemoteUser } from '@/models/entities/user'; +import { MessagingMessage } from '@/models/entities/messaging-message'; +import { MessagingMessages, UserGroupJoinings, Users } from '@/models/index'; import { In } from 'typeorm'; -import { IdentifiableError } from '@/misc/identifiable-error.js'; -import { UserGroup } from '@/models/entities/user-group.js'; -import { toArray } from '../../../prelude/array.js'; -import { renderReadActivity } from '@/remote/activitypub/renderer/read.js'; -import { renderActivity } from '@/remote/activitypub/renderer/index.js'; -import { deliver } from '@/queue/index.js'; -import orderedCollection from '@/remote/activitypub/renderer/ordered-collection.js'; +import { IdentifiableError } from '@/misc/identifiable-error'; +import { UserGroup } from '@/models/entities/user-group'; +import { toArray } from '../../../prelude/array'; +import { renderReadActivity } from '@/remote/activitypub/renderer/read'; +import { renderActivity } from '@/remote/activitypub/renderer/index'; +import { deliver } from '@/queue/index'; +import orderedCollection from '@/remote/activitypub/renderer/ordered-collection'; /** * Mark messages as read diff --git a/src/server/api/common/read-notification.ts b/src/server/api/common/read-notification.ts index ce958c479f..a4406c9eeb 100644 --- a/src/server/api/common/read-notification.ts +++ b/src/server/api/common/read-notification.ts @@ -1,7 +1,7 @@ -import { publishMainStream } from '@/services/stream.js'; -import { User } from '@/models/entities/user.js'; -import { Notification } from '@/models/entities/notification.js'; -import { Notifications, Users } from '@/models/index.js'; +import { publishMainStream } from '@/services/stream'; +import { User } from '@/models/entities/user'; +import { Notification } from '@/models/entities/notification'; +import { Notifications, Users } from '@/models/index'; import { In } from 'typeorm'; export async function readNotification( diff --git a/src/server/api/common/signin.ts b/src/server/api/common/signin.ts index adc5aafe85..4c7aacf1cd 100644 --- a/src/server/api/common/signin.ts +++ b/src/server/api/common/signin.ts @@ -1,10 +1,10 @@ import * as Koa from 'koa'; -import config from '@/config/index.js'; -import { ILocalUser } from '@/models/entities/user.js'; -import { Signins } from '@/models/index.js'; -import { genId } from '@/misc/gen-id.js'; -import { publishMainStream } from '@/services/stream.js'; +import config from '@/config/index'; +import { ILocalUser } from '@/models/entities/user'; +import { Signins } from '@/models/index'; +import { genId } from '@/misc/gen-id'; +import { publishMainStream } from '@/services/stream'; export default function(ctx: Koa.Context, user: ILocalUser, redirect = false) { if (redirect) { diff --git a/src/server/api/common/signup.ts b/src/server/api/common/signup.ts index c5605e2b8f..eb3aa09c8c 100644 --- a/src/server/api/common/signup.ts +++ b/src/server/api/common/signup.ts @@ -1,15 +1,15 @@ import * as bcrypt from 'bcryptjs'; import { generateKeyPair } from 'crypto'; -import generateUserToken from './generate-native-user-token.js'; -import { User } from '@/models/entities/user.js'; -import { Users, UsedUsernames } from '@/models/index.js'; -import { UserProfile } from '@/models/entities/user-profile.js'; +import generateUserToken from './generate-native-user-token'; +import { User } from '@/models/entities/user'; +import { Users, UsedUsernames } from '@/models/index'; +import { UserProfile } from '@/models/entities/user-profile'; import { getConnection } from 'typeorm'; -import { genId } from '@/misc/gen-id.js'; -import { toPunyNullable } from '@/misc/convert-host.js'; -import { UserKeypair } from '@/models/entities/user-keypair.js'; -import { usersChart } from '@/services/chart/index.js'; -import { UsedUsername } from '@/models/entities/used-username.js'; +import { genId } from '@/misc/gen-id'; +import { toPunyNullable } from '@/misc/convert-host'; +import { UserKeypair } from '@/models/entities/user-keypair'; +import { usersChart } from '@/services/chart/index'; +import { UsedUsername } from '@/models/entities/used-username'; export async function signup(username: User['username'], password: UserProfile['password'], host: string | null = null) { // Validate username diff --git a/src/server/api/define.ts b/src/server/api/define.ts index 18e8f62016..4bd8f95e31 100644 --- a/src/server/api/define.ts +++ b/src/server/api/define.ts @@ -1,9 +1,9 @@ import * as fs from 'fs'; -import { ILocalUser } from '@/models/entities/user.js'; -import { IEndpointMeta } from './endpoints.js'; -import { ApiError } from './error.js'; -import { SchemaType } from '@/misc/schema.js'; -import { AccessToken } from '@/models/entities/access-token.js'; +import { ILocalUser } from '@/models/entities/user'; +import { IEndpointMeta } from './endpoints'; +import { ApiError } from './error'; +import { SchemaType } from '@/misc/schema'; +import { AccessToken } from '@/models/entities/access-token'; type NonOptional = T extends undefined ? never : T; diff --git a/src/server/api/endpoints.ts b/src/server/api/endpoints.ts index 4c0baf2242..640b14ed6a 100644 --- a/src/server/api/endpoints.ts +++ b/src/server/api/endpoints.ts @@ -3,7 +3,7 @@ import { dirname } from 'path'; import { Context } from 'cafy'; import * as path from 'path'; import * as glob from 'glob'; -import { Schema } from '@/misc/schema.js'; +import { Schema } from '@/misc/schema'; //const _filename = fileURLToPath(import.meta.url); const _filename = __filename; diff --git a/src/server/api/endpoints/admin/abuse-user-reports.ts b/src/server/api/endpoints/admin/abuse-user-reports.ts index 5bc5618ab3..403eb24191 100644 --- a/src/server/api/endpoints/admin/abuse-user-reports.ts +++ b/src/server/api/endpoints/admin/abuse-user-reports.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { AbuseUserReports } from '@/models/index.js'; -import { makePaginationQuery } from '../../common/make-pagination-query.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { AbuseUserReports } from '@/models/index'; +import { makePaginationQuery } from '../../common/make-pagination-query'; export const meta = { tags: ['admin'], diff --git a/src/server/api/endpoints/admin/accounts/create.ts b/src/server/api/endpoints/admin/accounts/create.ts index f9a6c10b87..9691b9c7e3 100644 --- a/src/server/api/endpoints/admin/accounts/create.ts +++ b/src/server/api/endpoints/admin/accounts/create.ts @@ -1,6 +1,6 @@ -import define from '../../../define.js'; -import { Users } from '@/models/index.js'; -import { signup } from '../../../common/signup.js'; +import define from '../../../define'; +import { Users } from '@/models/index'; +import { signup } from '../../../common/signup'; export const meta = { tags: ['admin'], diff --git a/src/server/api/endpoints/admin/ad/create.ts b/src/server/api/endpoints/admin/ad/create.ts index 55cc037182..27c7b5d318 100644 --- a/src/server/api/endpoints/admin/ad/create.ts +++ b/src/server/api/endpoints/admin/ad/create.ts @@ -1,7 +1,7 @@ import $ from 'cafy'; -import define from '../../../define.js'; -import { Ads } from '@/models/index.js'; -import { genId } from '@/misc/gen-id.js'; +import define from '../../../define'; +import { Ads } from '@/models/index'; +import { genId } from '@/misc/gen-id'; export const meta = { tags: ['admin'], diff --git a/src/server/api/endpoints/admin/ad/delete.ts b/src/server/api/endpoints/admin/ad/delete.ts index 9f11f968ee..91934e1aab 100644 --- a/src/server/api/endpoints/admin/ad/delete.ts +++ b/src/server/api/endpoints/admin/ad/delete.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import define from '../../../define.js'; -import { ID } from '@/misc/cafy-id.js'; -import { Ads } from '@/models/index.js'; -import { ApiError } from '../../../error.js'; +import define from '../../../define'; +import { ID } from '@/misc/cafy-id'; +import { Ads } from '@/models/index'; +import { ApiError } from '../../../error'; export const meta = { tags: ['admin'], diff --git a/src/server/api/endpoints/admin/ad/list.ts b/src/server/api/endpoints/admin/ad/list.ts index a2d843ec16..000aaaba9d 100644 --- a/src/server/api/endpoints/admin/ad/list.ts +++ b/src/server/api/endpoints/admin/ad/list.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../../define.js'; -import { Ads } from '@/models/index.js'; -import { makePaginationQuery } from '../../../common/make-pagination-query.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../../define'; +import { Ads } from '@/models/index'; +import { makePaginationQuery } from '../../../common/make-pagination-query'; export const meta = { tags: ['admin'], diff --git a/src/server/api/endpoints/admin/ad/update.ts b/src/server/api/endpoints/admin/ad/update.ts index 2d7a32585d..36c87895c2 100644 --- a/src/server/api/endpoints/admin/ad/update.ts +++ b/src/server/api/endpoints/admin/ad/update.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import define from '../../../define.js'; -import { ID } from '@/misc/cafy-id.js'; -import { Ads } from '@/models/index.js'; -import { ApiError } from '../../../error.js'; +import define from '../../../define'; +import { ID } from '@/misc/cafy-id'; +import { Ads } from '@/models/index'; +import { ApiError } from '../../../error'; export const meta = { tags: ['admin'], diff --git a/src/server/api/endpoints/admin/announcements/create.ts b/src/server/api/endpoints/admin/announcements/create.ts index ab1b9a3c20..f1c07745f9 100644 --- a/src/server/api/endpoints/admin/announcements/create.ts +++ b/src/server/api/endpoints/admin/announcements/create.ts @@ -1,7 +1,7 @@ import $ from 'cafy'; -import define from '../../../define.js'; -import { Announcements } from '@/models/index.js'; -import { genId } from '@/misc/gen-id.js'; +import define from '../../../define'; +import { Announcements } from '@/models/index'; +import { genId } from '@/misc/gen-id'; export const meta = { tags: ['admin'], diff --git a/src/server/api/endpoints/admin/announcements/delete.ts b/src/server/api/endpoints/admin/announcements/delete.ts index 52d7cb26c5..7dbc05b4c9 100644 --- a/src/server/api/endpoints/admin/announcements/delete.ts +++ b/src/server/api/endpoints/admin/announcements/delete.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import define from '../../../define.js'; -import { ID } from '@/misc/cafy-id.js'; -import { Announcements } from '@/models/index.js'; -import { ApiError } from '../../../error.js'; +import define from '../../../define'; +import { ID } from '@/misc/cafy-id'; +import { Announcements } from '@/models/index'; +import { ApiError } from '../../../error'; export const meta = { tags: ['admin'], diff --git a/src/server/api/endpoints/admin/announcements/list.ts b/src/server/api/endpoints/admin/announcements/list.ts index ff62b7806a..4039bcd88f 100644 --- a/src/server/api/endpoints/admin/announcements/list.ts +++ b/src/server/api/endpoints/admin/announcements/list.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../../define.js'; -import { Announcements, AnnouncementReads } from '@/models/index.js'; -import { makePaginationQuery } from '../../../common/make-pagination-query.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../../define'; +import { Announcements, AnnouncementReads } from '@/models/index'; +import { makePaginationQuery } from '../../../common/make-pagination-query'; export const meta = { tags: ['admin'], diff --git a/src/server/api/endpoints/admin/announcements/update.ts b/src/server/api/endpoints/admin/announcements/update.ts index e45a185ad6..343f37d626 100644 --- a/src/server/api/endpoints/admin/announcements/update.ts +++ b/src/server/api/endpoints/admin/announcements/update.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import define from '../../../define.js'; -import { ID } from '@/misc/cafy-id.js'; -import { Announcements } from '@/models/index.js'; -import { ApiError } from '../../../error.js'; +import define from '../../../define'; +import { ID } from '@/misc/cafy-id'; +import { Announcements } from '@/models/index'; +import { ApiError } from '../../../error'; export const meta = { tags: ['admin'], diff --git a/src/server/api/endpoints/admin/delete-all-files-of-a-user.ts b/src/server/api/endpoints/admin/delete-all-files-of-a-user.ts index 9001e01a1a..988ab29558 100644 --- a/src/server/api/endpoints/admin/delete-all-files-of-a-user.ts +++ b/src/server/api/endpoints/admin/delete-all-files-of-a-user.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import define from '../../define.js'; -import { deleteFile } from '@/services/drive/delete-file.js'; -import { DriveFiles } from '@/models/index.js'; -import { ID } from '@/misc/cafy-id.js'; +import define from '../../define'; +import { deleteFile } from '@/services/drive/delete-file'; +import { DriveFiles } from '@/models/index'; +import { ID } from '@/misc/cafy-id'; export const meta = { tags: ['admin'], diff --git a/src/server/api/endpoints/admin/delete-logs.ts b/src/server/api/endpoints/admin/delete-logs.ts index be3f58d738..9d37ceb434 100644 --- a/src/server/api/endpoints/admin/delete-logs.ts +++ b/src/server/api/endpoints/admin/delete-logs.ts @@ -1,5 +1,5 @@ -import define from '../../define.js'; -import { Logs } from '@/models/index.js'; +import define from '../../define'; +import { Logs } from '@/models/index'; export const meta = { tags: ['admin'], diff --git a/src/server/api/endpoints/admin/drive/clean-remote-files.ts b/src/server/api/endpoints/admin/drive/clean-remote-files.ts index f945f0f049..76a6acff59 100644 --- a/src/server/api/endpoints/admin/drive/clean-remote-files.ts +++ b/src/server/api/endpoints/admin/drive/clean-remote-files.ts @@ -1,5 +1,5 @@ -import define from '../../../define.js'; -import { createCleanRemoteFilesJob } from '@/queue/index.js'; +import define from '../../../define'; +import { createCleanRemoteFilesJob } from '@/queue/index'; export const meta = { tags: ['admin'], diff --git a/src/server/api/endpoints/admin/drive/cleanup.ts b/src/server/api/endpoints/admin/drive/cleanup.ts index d5ad221a62..8497478da9 100644 --- a/src/server/api/endpoints/admin/drive/cleanup.ts +++ b/src/server/api/endpoints/admin/drive/cleanup.ts @@ -1,7 +1,7 @@ import { IsNull } from 'typeorm'; -import define from '../../../define.js'; -import { deleteFile } from '@/services/drive/delete-file.js'; -import { DriveFiles } from '@/models/index.js'; +import define from '../../../define'; +import { deleteFile } from '@/services/drive/delete-file'; +import { DriveFiles } from '@/models/index'; export const meta = { tags: ['admin'], diff --git a/src/server/api/endpoints/admin/drive/files.ts b/src/server/api/endpoints/admin/drive/files.ts index 65980bfea2..c0788c8e02 100644 --- a/src/server/api/endpoints/admin/drive/files.ts +++ b/src/server/api/endpoints/admin/drive/files.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import define from '../../../define.js'; -import { DriveFiles } from '@/models/index.js'; -import { makePaginationQuery } from '../../../common/make-pagination-query.js'; -import { ID } from '@/misc/cafy-id.js'; +import define from '../../../define'; +import { DriveFiles } from '@/models/index'; +import { makePaginationQuery } from '../../../common/make-pagination-query'; +import { ID } from '@/misc/cafy-id'; export const meta = { tags: ['admin'], diff --git a/src/server/api/endpoints/admin/drive/show-file.ts b/src/server/api/endpoints/admin/drive/show-file.ts index 9dfa0cacf9..270b89c4fa 100644 --- a/src/server/api/endpoints/admin/drive/show-file.ts +++ b/src/server/api/endpoints/admin/drive/show-file.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../../define.js'; -import { ApiError } from '../../../error.js'; -import { DriveFiles } from '@/models/index.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../../define'; +import { ApiError } from '../../../error'; +import { DriveFiles } from '@/models/index'; export const meta = { tags: ['admin'], diff --git a/src/server/api/endpoints/admin/emoji/add.ts b/src/server/api/endpoints/admin/emoji/add.ts index b797fb30a3..1af81fe46d 100644 --- a/src/server/api/endpoints/admin/emoji/add.ts +++ b/src/server/api/endpoints/admin/emoji/add.ts @@ -1,13 +1,13 @@ import $ from 'cafy'; -import define from '../../../define.js'; -import { Emojis, DriveFiles } from '@/models/index.js'; -import { genId } from '@/misc/gen-id.js'; +import define from '../../../define'; +import { Emojis, DriveFiles } from '@/models/index'; +import { genId } from '@/misc/gen-id'; import { getConnection } from 'typeorm'; -import { insertModerationLog } from '@/services/insert-moderation-log.js'; -import { ApiError } from '../../../error.js'; -import { ID } from '@/misc/cafy-id.js'; +import { insertModerationLog } from '@/services/insert-moderation-log'; +import { ApiError } from '../../../error'; +import { ID } from '@/misc/cafy-id'; import rndstr from 'rndstr'; -import { publishBroadcastStream } from '@/services/stream.js'; +import { publishBroadcastStream } from '@/services/stream'; export const meta = { tags: ['admin'], diff --git a/src/server/api/endpoints/admin/emoji/copy.ts b/src/server/api/endpoints/admin/emoji/copy.ts index 4c5f7bf36c..4c8ab99f7c 100644 --- a/src/server/api/endpoints/admin/emoji/copy.ts +++ b/src/server/api/endpoints/admin/emoji/copy.ts @@ -1,13 +1,13 @@ import $ from 'cafy'; -import define from '../../../define.js'; -import { Emojis } from '@/models/index.js'; -import { genId } from '@/misc/gen-id.js'; +import define from '../../../define'; +import { Emojis } from '@/models/index'; +import { genId } from '@/misc/gen-id'; import { getConnection } from 'typeorm'; -import { ApiError } from '../../../error.js'; -import { DriveFile } from '@/models/entities/drive-file.js'; -import { ID } from '@/misc/cafy-id.js'; -import uploadFromUrl from '@/services/drive/upload-from-url.js'; -import { publishBroadcastStream } from '@/services/stream.js'; +import { ApiError } from '../../../error'; +import { DriveFile } from '@/models/entities/drive-file'; +import { ID } from '@/misc/cafy-id'; +import uploadFromUrl from '@/services/drive/upload-from-url'; +import { publishBroadcastStream } from '@/services/stream'; export const meta = { tags: ['admin'], diff --git a/src/server/api/endpoints/admin/emoji/list-remote.ts b/src/server/api/endpoints/admin/emoji/list-remote.ts index cc284123b5..3c8ca22170 100644 --- a/src/server/api/endpoints/admin/emoji/list-remote.ts +++ b/src/server/api/endpoints/admin/emoji/list-remote.ts @@ -1,9 +1,9 @@ import $ from 'cafy'; -import define from '../../../define.js'; -import { Emojis } from '@/models/index.js'; -import { toPuny } from '@/misc/convert-host.js'; -import { makePaginationQuery } from '../../../common/make-pagination-query.js'; -import { ID } from '@/misc/cafy-id.js'; +import define from '../../../define'; +import { Emojis } from '@/models/index'; +import { toPuny } from '@/misc/convert-host'; +import { makePaginationQuery } from '../../../common/make-pagination-query'; +import { ID } from '@/misc/cafy-id'; export const meta = { tags: ['admin'], diff --git a/src/server/api/endpoints/admin/emoji/list.ts b/src/server/api/endpoints/admin/emoji/list.ts index da72ac13e7..cb1e79e0fe 100644 --- a/src/server/api/endpoints/admin/emoji/list.ts +++ b/src/server/api/endpoints/admin/emoji/list.ts @@ -1,9 +1,9 @@ import $ from 'cafy'; -import define from '../../../define.js'; -import { Emojis } from '@/models/index.js'; -import { makePaginationQuery } from '../../../common/make-pagination-query.js'; -import { ID } from '@/misc/cafy-id.js'; -import { Emoji } from '@/models/entities/emoji.js'; +import define from '../../../define'; +import { Emojis } from '@/models/index'; +import { makePaginationQuery } from '../../../common/make-pagination-query'; +import { ID } from '@/misc/cafy-id'; +import { Emoji } from '@/models/entities/emoji'; export const meta = { tags: ['admin'], diff --git a/src/server/api/endpoints/admin/emoji/remove.ts b/src/server/api/endpoints/admin/emoji/remove.ts index d81c0b9bbd..259950e362 100644 --- a/src/server/api/endpoints/admin/emoji/remove.ts +++ b/src/server/api/endpoints/admin/emoji/remove.ts @@ -1,10 +1,10 @@ import $ from 'cafy'; -import define from '../../../define.js'; -import { ID } from '@/misc/cafy-id.js'; -import { Emojis } from '@/models/index.js'; +import define from '../../../define'; +import { ID } from '@/misc/cafy-id'; +import { Emojis } from '@/models/index'; import { getConnection } from 'typeorm'; -import { insertModerationLog } from '@/services/insert-moderation-log.js'; -import { ApiError } from '../../../error.js'; +import { insertModerationLog } from '@/services/insert-moderation-log'; +import { ApiError } from '../../../error'; export const meta = { tags: ['admin'], diff --git a/src/server/api/endpoints/admin/emoji/update.ts b/src/server/api/endpoints/admin/emoji/update.ts index 912c96c7dc..3fd547d7e5 100644 --- a/src/server/api/endpoints/admin/emoji/update.ts +++ b/src/server/api/endpoints/admin/emoji/update.ts @@ -1,9 +1,9 @@ import $ from 'cafy'; -import define from '../../../define.js'; -import { ID } from '@/misc/cafy-id.js'; -import { Emojis } from '@/models/index.js'; +import define from '../../../define'; +import { ID } from '@/misc/cafy-id'; +import { Emojis } from '@/models/index'; import { getConnection } from 'typeorm'; -import { ApiError } from '../../../error.js'; +import { ApiError } from '../../../error'; export const meta = { tags: ['admin'], diff --git a/src/server/api/endpoints/admin/federation/delete-all-files.ts b/src/server/api/endpoints/admin/federation/delete-all-files.ts index f32c6b9776..82540c5447 100644 --- a/src/server/api/endpoints/admin/federation/delete-all-files.ts +++ b/src/server/api/endpoints/admin/federation/delete-all-files.ts @@ -1,7 +1,7 @@ import $ from 'cafy'; -import define from '../../../define.js'; -import { deleteFile } from '@/services/drive/delete-file.js'; -import { DriveFiles } from '@/models/index.js'; +import define from '../../../define'; +import { deleteFile } from '@/services/drive/delete-file'; +import { DriveFiles } from '@/models/index'; export const meta = { tags: ['admin'], diff --git a/src/server/api/endpoints/admin/federation/refresh-remote-instance-metadata.ts b/src/server/api/endpoints/admin/federation/refresh-remote-instance-metadata.ts index 125be42e80..65a6947ba0 100644 --- a/src/server/api/endpoints/admin/federation/refresh-remote-instance-metadata.ts +++ b/src/server/api/endpoints/admin/federation/refresh-remote-instance-metadata.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import define from '../../../define.js'; -import { Instances } from '@/models/index.js'; -import { toPuny } from '@/misc/convert-host.js'; -import { fetchInstanceMetadata } from '@/services/fetch-instance-metadata.js'; +import define from '../../../define'; +import { Instances } from '@/models/index'; +import { toPuny } from '@/misc/convert-host'; +import { fetchInstanceMetadata } from '@/services/fetch-instance-metadata'; export const meta = { tags: ['admin'], diff --git a/src/server/api/endpoints/admin/federation/remove-all-following.ts b/src/server/api/endpoints/admin/federation/remove-all-following.ts index 6b3d621c8b..7935eaa631 100644 --- a/src/server/api/endpoints/admin/federation/remove-all-following.ts +++ b/src/server/api/endpoints/admin/federation/remove-all-following.ts @@ -1,7 +1,7 @@ import $ from 'cafy'; -import define from '../../../define.js'; -import deleteFollowing from '@/services/following/delete.js'; -import { Followings, Users } from '@/models/index.js'; +import define from '../../../define'; +import deleteFollowing from '@/services/following/delete'; +import { Followings, Users } from '@/models/index'; export const meta = { tags: ['admin'], diff --git a/src/server/api/endpoints/admin/federation/update-instance.ts b/src/server/api/endpoints/admin/federation/update-instance.ts index b5f13027a3..34eab27c78 100644 --- a/src/server/api/endpoints/admin/federation/update-instance.ts +++ b/src/server/api/endpoints/admin/federation/update-instance.ts @@ -1,7 +1,7 @@ import $ from 'cafy'; -import define from '../../../define.js'; -import { Instances } from '@/models/index.js'; -import { toPuny } from '@/misc/convert-host.js'; +import define from '../../../define'; +import { Instances } from '@/models/index'; +import { toPuny } from '@/misc/convert-host'; export const meta = { tags: ['admin'], diff --git a/src/server/api/endpoints/admin/get-index-stats.ts b/src/server/api/endpoints/admin/get-index-stats.ts index e7e8d0b219..f2b06d0ef2 100644 --- a/src/server/api/endpoints/admin/get-index-stats.ts +++ b/src/server/api/endpoints/admin/get-index-stats.ts @@ -1,4 +1,4 @@ -import define from '../../define.js'; +import define from '../../define'; import { getConnection } from 'typeorm'; export const meta = { diff --git a/src/server/api/endpoints/admin/get-table-stats.ts b/src/server/api/endpoints/admin/get-table-stats.ts index c7f2a614b0..bce813232b 100644 --- a/src/server/api/endpoints/admin/get-table-stats.ts +++ b/src/server/api/endpoints/admin/get-table-stats.ts @@ -1,4 +1,4 @@ -import define from '../../define.js'; +import define from '../../define'; import { getConnection } from 'typeorm'; export const meta = { diff --git a/src/server/api/endpoints/admin/invite.ts b/src/server/api/endpoints/admin/invite.ts index 0a63b69ee9..2c69eec535 100644 --- a/src/server/api/endpoints/admin/invite.ts +++ b/src/server/api/endpoints/admin/invite.ts @@ -1,7 +1,7 @@ import rndstr from 'rndstr'; -import define from '../../define.js'; -import { RegistrationTickets } from '@/models/index.js'; -import { genId } from '@/misc/gen-id.js'; +import define from '../../define'; +import { RegistrationTickets } from '@/models/index'; +import { genId } from '@/misc/gen-id'; export const meta = { tags: ['admin'], diff --git a/src/server/api/endpoints/admin/logs.ts b/src/server/api/endpoints/admin/logs.ts index e0d97b4abe..776403a62e 100644 --- a/src/server/api/endpoints/admin/logs.ts +++ b/src/server/api/endpoints/admin/logs.ts @@ -1,6 +1,6 @@ import $ from 'cafy'; -import define from '../../define.js'; -import { Logs } from '@/models/index.js'; +import define from '../../define'; +import { Logs } from '@/models/index'; import { Brackets } from 'typeorm'; export const meta = { diff --git a/src/server/api/endpoints/admin/moderators/add.ts b/src/server/api/endpoints/admin/moderators/add.ts index bff9b63359..2b87fc217f 100644 --- a/src/server/api/endpoints/admin/moderators/add.ts +++ b/src/server/api/endpoints/admin/moderators/add.ts @@ -1,7 +1,7 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../../define.js'; -import { Users } from '@/models/index.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../../define'; +import { Users } from '@/models/index'; export const meta = { tags: ['admin'], diff --git a/src/server/api/endpoints/admin/moderators/remove.ts b/src/server/api/endpoints/admin/moderators/remove.ts index cacb788b4d..cbb0625224 100644 --- a/src/server/api/endpoints/admin/moderators/remove.ts +++ b/src/server/api/endpoints/admin/moderators/remove.ts @@ -1,7 +1,7 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../../define.js'; -import { Users } from '@/models/index.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../../define'; +import { Users } from '@/models/index'; export const meta = { tags: ['admin'], diff --git a/src/server/api/endpoints/admin/promo/create.ts b/src/server/api/endpoints/admin/promo/create.ts index faba458fed..3bdaaad4d9 100644 --- a/src/server/api/endpoints/admin/promo/create.ts +++ b/src/server/api/endpoints/admin/promo/create.ts @@ -1,9 +1,9 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../../define.js'; -import { ApiError } from '../../../error.js'; -import { getNote } from '../../../common/getters.js'; -import { PromoNotes } from '@/models/index.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../../define'; +import { ApiError } from '../../../error'; +import { getNote } from '../../../common/getters'; +import { PromoNotes } from '@/models/index'; export const meta = { tags: ['admin'], diff --git a/src/server/api/endpoints/admin/queue/clear.ts b/src/server/api/endpoints/admin/queue/clear.ts index 4bab2f20cd..fedb7065ab 100644 --- a/src/server/api/endpoints/admin/queue/clear.ts +++ b/src/server/api/endpoints/admin/queue/clear.ts @@ -1,6 +1,6 @@ -import define from '../../../define.js'; -import { destroy } from '@/queue/index.js'; -import { insertModerationLog } from '@/services/insert-moderation-log.js'; +import define from '../../../define'; +import { destroy } from '@/queue/index'; +import { insertModerationLog } from '@/services/insert-moderation-log'; export const meta = { tags: ['admin'], diff --git a/src/server/api/endpoints/admin/queue/deliver-delayed.ts b/src/server/api/endpoints/admin/queue/deliver-delayed.ts index ed34228108..cd7b640983 100644 --- a/src/server/api/endpoints/admin/queue/deliver-delayed.ts +++ b/src/server/api/endpoints/admin/queue/deliver-delayed.ts @@ -1,6 +1,6 @@ -import { deliverQueue } from '@/queue/queues.js'; +import { deliverQueue } from '@/queue/queues'; import { URL } from 'url'; -import define from '../../../define.js'; +import define from '../../../define'; export const meta = { tags: ['admin'], diff --git a/src/server/api/endpoints/admin/queue/inbox-delayed.ts b/src/server/api/endpoints/admin/queue/inbox-delayed.ts index 8870722f23..59e5c834ed 100644 --- a/src/server/api/endpoints/admin/queue/inbox-delayed.ts +++ b/src/server/api/endpoints/admin/queue/inbox-delayed.ts @@ -1,6 +1,6 @@ import { URL } from 'url'; -import define from '../../../define.js'; -import { inboxQueue } from '@/queue/index.js'; +import define from '../../../define'; +import { inboxQueue } from '@/queue/index'; export const meta = { tags: ['admin'], diff --git a/src/server/api/endpoints/admin/queue/jobs.ts b/src/server/api/endpoints/admin/queue/jobs.ts index 164379f721..c426e5f39b 100644 --- a/src/server/api/endpoints/admin/queue/jobs.ts +++ b/src/server/api/endpoints/admin/queue/jobs.ts @@ -1,6 +1,6 @@ -import { deliverQueue, inboxQueue, dbQueue, objectStorageQueue } from '@/queue/queues.js'; +import { deliverQueue, inboxQueue, dbQueue, objectStorageQueue } from '@/queue/queues'; import $ from 'cafy'; -import define from '../../../define.js'; +import define from '../../../define'; export const meta = { tags: ['admin'], diff --git a/src/server/api/endpoints/admin/queue/stats.ts b/src/server/api/endpoints/admin/queue/stats.ts index 60a3416c39..38f18459dd 100644 --- a/src/server/api/endpoints/admin/queue/stats.ts +++ b/src/server/api/endpoints/admin/queue/stats.ts @@ -1,5 +1,5 @@ -import { deliverQueue, inboxQueue, dbQueue, objectStorageQueue } from '@/queue/queues.js'; -import define from '../../../define.js'; +import { deliverQueue, inboxQueue, dbQueue, objectStorageQueue } from '@/queue/queues'; +import define from '../../../define'; export const meta = { tags: ['admin'], diff --git a/src/server/api/endpoints/admin/relays/add.ts b/src/server/api/endpoints/admin/relays/add.ts index e3b9a8afcb..567035fd3a 100644 --- a/src/server/api/endpoints/admin/relays/add.ts +++ b/src/server/api/endpoints/admin/relays/add.ts @@ -1,8 +1,8 @@ import { URL } from 'url'; import $ from 'cafy'; -import define from '../../../define.js'; -import { addRelay } from '@/services/relay.js'; -import { ApiError } from '../../../error.js'; +import define from '../../../define'; +import { addRelay } from '@/services/relay'; +import { ApiError } from '../../../error'; export const meta = { tags: ['admin'], diff --git a/src/server/api/endpoints/admin/relays/list.ts b/src/server/api/endpoints/admin/relays/list.ts index 1707b8cd34..031ebe85d0 100644 --- a/src/server/api/endpoints/admin/relays/list.ts +++ b/src/server/api/endpoints/admin/relays/list.ts @@ -1,5 +1,5 @@ -import define from '../../../define.js'; -import { listRelay } from '@/services/relay.js'; +import define from '../../../define'; +import { listRelay } from '@/services/relay'; export const meta = { tags: ['admin'], diff --git a/src/server/api/endpoints/admin/relays/remove.ts b/src/server/api/endpoints/admin/relays/remove.ts index 406257fdf2..c1c50f5dc0 100644 --- a/src/server/api/endpoints/admin/relays/remove.ts +++ b/src/server/api/endpoints/admin/relays/remove.ts @@ -1,6 +1,6 @@ import $ from 'cafy'; -import define from '../../../define.js'; -import { removeRelay } from '@/services/relay.js'; +import define from '../../../define'; +import { removeRelay } from '@/services/relay'; export const meta = { tags: ['admin'], diff --git a/src/server/api/endpoints/admin/reset-password.ts b/src/server/api/endpoints/admin/reset-password.ts index 0bc32e07a1..0fc2c6a868 100644 --- a/src/server/api/endpoints/admin/reset-password.ts +++ b/src/server/api/endpoints/admin/reset-password.ts @@ -1,9 +1,9 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; import * as bcrypt from 'bcryptjs'; import rndstr from 'rndstr'; -import { Users, UserProfiles } from '@/models/index.js'; +import { Users, UserProfiles } from '@/models/index'; export const meta = { tags: ['admin'], diff --git a/src/server/api/endpoints/admin/resolve-abuse-user-report.ts b/src/server/api/endpoints/admin/resolve-abuse-user-report.ts index 4c7ef37923..7b71f8e000 100644 --- a/src/server/api/endpoints/admin/resolve-abuse-user-report.ts +++ b/src/server/api/endpoints/admin/resolve-abuse-user-report.ts @@ -1,7 +1,7 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { AbuseUserReports } from '@/models/index.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { AbuseUserReports } from '@/models/index'; export const meta = { tags: ['admin'], diff --git a/src/server/api/endpoints/admin/resync-chart.ts b/src/server/api/endpoints/admin/resync-chart.ts index 613cdbdfad..b0e687333f 100644 --- a/src/server/api/endpoints/admin/resync-chart.ts +++ b/src/server/api/endpoints/admin/resync-chart.ts @@ -1,6 +1,6 @@ -import define from '../../define.js'; -import { driveChart, notesChart, usersChart, instanceChart } from '@/services/chart/index.js'; -import { insertModerationLog } from '@/services/insert-moderation-log.js'; +import define from '../../define'; +import { driveChart, notesChart, usersChart, instanceChart } from '@/services/chart/index'; +import { insertModerationLog } from '@/services/insert-moderation-log'; export const meta = { tags: ['admin'], diff --git a/src/server/api/endpoints/admin/send-email.ts b/src/server/api/endpoints/admin/send-email.ts index 353add59ba..6f67b78542 100644 --- a/src/server/api/endpoints/admin/send-email.ts +++ b/src/server/api/endpoints/admin/send-email.ts @@ -1,6 +1,6 @@ import $ from 'cafy'; -import define from '../../define.js'; -import { sendEmail } from '@/services/send-email.js'; +import define from '../../define'; +import { sendEmail } from '@/services/send-email'; export const meta = { tags: ['admin'], diff --git a/src/server/api/endpoints/admin/server-info.ts b/src/server/api/endpoints/admin/server-info.ts index daac6395ea..bb2d35e397 100644 --- a/src/server/api/endpoints/admin/server-info.ts +++ b/src/server/api/endpoints/admin/server-info.ts @@ -1,8 +1,8 @@ import * as os from 'os'; import * as si from 'systeminformation'; import { getConnection } from 'typeorm'; -import define from '../../define.js'; -import { redisClient } from '../../../../db/redis.js'; +import define from '../../define'; +import { redisClient } from '../../../../db/redis'; export const meta = { requireCredential: true as const, diff --git a/src/server/api/endpoints/admin/show-moderation-logs.ts b/src/server/api/endpoints/admin/show-moderation-logs.ts index 833c49ee64..e9509568d0 100644 --- a/src/server/api/endpoints/admin/show-moderation-logs.ts +++ b/src/server/api/endpoints/admin/show-moderation-logs.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { ModerationLogs } from '@/models/index.js'; -import { makePaginationQuery } from '../../common/make-pagination-query.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { ModerationLogs } from '@/models/index'; +import { makePaginationQuery } from '../../common/make-pagination-query'; export const meta = { tags: ['admin'], diff --git a/src/server/api/endpoints/admin/show-user.ts b/src/server/api/endpoints/admin/show-user.ts index e4935fe90f..963c123255 100644 --- a/src/server/api/endpoints/admin/show-user.ts +++ b/src/server/api/endpoints/admin/show-user.ts @@ -1,7 +1,7 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { Users } from '@/models/index.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { Users } from '@/models/index'; export const meta = { tags: ['admin'], diff --git a/src/server/api/endpoints/admin/show-users.ts b/src/server/api/endpoints/admin/show-users.ts index 0ac2112f4b..20b63e7be6 100644 --- a/src/server/api/endpoints/admin/show-users.ts +++ b/src/server/api/endpoints/admin/show-users.ts @@ -1,6 +1,6 @@ import $ from 'cafy'; -import define from '../../define.js'; -import { Users } from '@/models/index.js'; +import define from '../../define'; +import { Users } from '@/models/index'; export const meta = { tags: ['admin'], diff --git a/src/server/api/endpoints/admin/silence-user.ts b/src/server/api/endpoints/admin/silence-user.ts index 0a2b080aa4..9bfed2310a 100644 --- a/src/server/api/endpoints/admin/silence-user.ts +++ b/src/server/api/endpoints/admin/silence-user.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { Users } from '@/models/index.js'; -import { insertModerationLog } from '@/services/insert-moderation-log.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { Users } from '@/models/index'; +import { insertModerationLog } from '@/services/insert-moderation-log'; export const meta = { tags: ['admin'], diff --git a/src/server/api/endpoints/admin/suspend-user.ts b/src/server/api/endpoints/admin/suspend-user.ts index 8026b9ec83..364f258ce8 100644 --- a/src/server/api/endpoints/admin/suspend-user.ts +++ b/src/server/api/endpoints/admin/suspend-user.ts @@ -1,12 +1,12 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import deleteFollowing from '@/services/following/delete.js'; -import { Users, Followings, Notifications } from '@/models/index.js'; -import { User } from '@/models/entities/user.js'; -import { insertModerationLog } from '@/services/insert-moderation-log.js'; -import { doPostSuspend } from '@/services/suspend-user.js'; -import { publishUserEvent } from '@/services/stream.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import deleteFollowing from '@/services/following/delete'; +import { Users, Followings, Notifications } from '@/models/index'; +import { User } from '@/models/entities/user'; +import { insertModerationLog } from '@/services/insert-moderation-log'; +import { doPostSuspend } from '@/services/suspend-user'; +import { publishUserEvent } from '@/services/stream'; export const meta = { tags: ['admin'], diff --git a/src/server/api/endpoints/admin/unsilence-user.ts b/src/server/api/endpoints/admin/unsilence-user.ts index 1e581df494..9994fbf462 100644 --- a/src/server/api/endpoints/admin/unsilence-user.ts +++ b/src/server/api/endpoints/admin/unsilence-user.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { Users } from '@/models/index.js'; -import { insertModerationLog } from '@/services/insert-moderation-log.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { Users } from '@/models/index'; +import { insertModerationLog } from '@/services/insert-moderation-log'; export const meta = { tags: ['admin'], diff --git a/src/server/api/endpoints/admin/unsuspend-user.ts b/src/server/api/endpoints/admin/unsuspend-user.ts index e839377435..ab4c2d3dfe 100644 --- a/src/server/api/endpoints/admin/unsuspend-user.ts +++ b/src/server/api/endpoints/admin/unsuspend-user.ts @@ -1,9 +1,9 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { Users } from '@/models/index.js'; -import { insertModerationLog } from '@/services/insert-moderation-log.js'; -import { doPostUnsuspend } from '@/services/unsuspend-user.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { Users } from '@/models/index'; +import { insertModerationLog } from '@/services/insert-moderation-log'; +import { doPostUnsuspend } from '@/services/unsuspend-user'; export const meta = { tags: ['admin'], diff --git a/src/server/api/endpoints/admin/update-meta.ts b/src/server/api/endpoints/admin/update-meta.ts index 2d34b5a219..5962dba98a 100644 --- a/src/server/api/endpoints/admin/update-meta.ts +++ b/src/server/api/endpoints/admin/update-meta.ts @@ -1,10 +1,10 @@ import $ from 'cafy'; -import define from '../../define.js'; +import define from '../../define'; import { getConnection } from 'typeorm'; -import { Meta } from '@/models/entities/meta.js'; -import { insertModerationLog } from '@/services/insert-moderation-log.js'; -import { DB_MAX_NOTE_TEXT_LENGTH } from '@/misc/hard-limits.js'; -import { ID } from '@/misc/cafy-id.js'; +import { Meta } from '@/models/entities/meta'; +import { insertModerationLog } from '@/services/insert-moderation-log'; +import { DB_MAX_NOTE_TEXT_LENGTH } from '@/misc/hard-limits'; +import { ID } from '@/misc/cafy-id'; export const meta = { tags: ['admin'], diff --git a/src/server/api/endpoints/admin/vacuum.ts b/src/server/api/endpoints/admin/vacuum.ts index 9ff9711a00..9a80d88c44 100644 --- a/src/server/api/endpoints/admin/vacuum.ts +++ b/src/server/api/endpoints/admin/vacuum.ts @@ -1,7 +1,7 @@ import $ from 'cafy'; -import define from '../../define.js'; +import define from '../../define'; import { getConnection } from 'typeorm'; -import { insertModerationLog } from '@/services/insert-moderation-log.js'; +import { insertModerationLog } from '@/services/insert-moderation-log'; export const meta = { tags: ['admin'], diff --git a/src/server/api/endpoints/announcements.ts b/src/server/api/endpoints/announcements.ts index 83a8b3a71c..a67737b2ff 100644 --- a/src/server/api/endpoints/announcements.ts +++ b/src/server/api/endpoints/announcements.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../define.js'; -import { Announcements, AnnouncementReads } from '@/models/index.js'; -import { makePaginationQuery } from '../common/make-pagination-query.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../define'; +import { Announcements, AnnouncementReads } from '@/models/index'; +import { makePaginationQuery } from '../common/make-pagination-query'; export const meta = { tags: ['meta'], diff --git a/src/server/api/endpoints/antennas/create.ts b/src/server/api/endpoints/antennas/create.ts index 2310ee6d51..4bdae8cc33 100644 --- a/src/server/api/endpoints/antennas/create.ts +++ b/src/server/api/endpoints/antennas/create.ts @@ -1,10 +1,10 @@ import $ from 'cafy'; -import define from '../../define.js'; -import { genId } from '@/misc/gen-id.js'; -import { Antennas, UserLists, UserGroupJoinings } from '@/models/index.js'; -import { ID } from '@/misc/cafy-id.js'; -import { ApiError } from '../../error.js'; -import { publishInternalEvent } from '@/services/stream.js'; +import define from '../../define'; +import { genId } from '@/misc/gen-id'; +import { Antennas, UserLists, UserGroupJoinings } from '@/models/index'; +import { ID } from '@/misc/cafy-id'; +import { ApiError } from '../../error'; +import { publishInternalEvent } from '@/services/stream'; export const meta = { tags: ['antennas'], diff --git a/src/server/api/endpoints/antennas/delete.ts b/src/server/api/endpoints/antennas/delete.ts index 59a29a9511..1cd136183e 100644 --- a/src/server/api/endpoints/antennas/delete.ts +++ b/src/server/api/endpoints/antennas/delete.ts @@ -1,9 +1,9 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { ApiError } from '../../error.js'; -import { Antennas } from '@/models/index.js'; -import { publishInternalEvent } from '@/services/stream.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { ApiError } from '../../error'; +import { Antennas } from '@/models/index'; +import { publishInternalEvent } from '@/services/stream'; export const meta = { tags: ['antennas'], diff --git a/src/server/api/endpoints/antennas/list.ts b/src/server/api/endpoints/antennas/list.ts index eceec945aa..8baae8435b 100644 --- a/src/server/api/endpoints/antennas/list.ts +++ b/src/server/api/endpoints/antennas/list.ts @@ -1,5 +1,5 @@ -import define from '../../define.js'; -import { Antennas } from '@/models/index.js'; +import define from '../../define'; +import { Antennas } from '@/models/index'; export const meta = { tags: ['antennas', 'account'], diff --git a/src/server/api/endpoints/antennas/notes.ts b/src/server/api/endpoints/antennas/notes.ts index 11f69f354b..3c8a4fbdae 100644 --- a/src/server/api/endpoints/antennas/notes.ts +++ b/src/server/api/endpoints/antennas/notes.ts @@ -1,12 +1,12 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { Antennas, Notes, AntennaNotes } from '@/models/index.js'; -import { makePaginationQuery } from '../../common/make-pagination-query.js'; -import { generateVisibilityQuery } from '../../common/generate-visibility-query.js'; -import { generateMutedUserQuery } from '../../common/generate-muted-user-query.js'; -import { ApiError } from '../../error.js'; -import { generateBlockedUserQuery } from '../../common/generate-block-query.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { Antennas, Notes, AntennaNotes } from '@/models/index'; +import { makePaginationQuery } from '../../common/make-pagination-query'; +import { generateVisibilityQuery } from '../../common/generate-visibility-query'; +import { generateMutedUserQuery } from '../../common/generate-muted-user-query'; +import { ApiError } from '../../error'; +import { generateBlockedUserQuery } from '../../common/generate-block-query'; export const meta = { tags: ['antennas', 'account', 'notes'], diff --git a/src/server/api/endpoints/antennas/show.ts b/src/server/api/endpoints/antennas/show.ts index 0d9a716bf4..3cdf4dcb61 100644 --- a/src/server/api/endpoints/antennas/show.ts +++ b/src/server/api/endpoints/antennas/show.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { ApiError } from '../../error.js'; -import { Antennas } from '@/models/index.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { ApiError } from '../../error'; +import { Antennas } from '@/models/index'; export const meta = { tags: ['antennas', 'account'], diff --git a/src/server/api/endpoints/antennas/update.ts b/src/server/api/endpoints/antennas/update.ts index 37f3b01641..ff13e89bcc 100644 --- a/src/server/api/endpoints/antennas/update.ts +++ b/src/server/api/endpoints/antennas/update.ts @@ -1,9 +1,9 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { ApiError } from '../../error.js'; -import { Antennas, UserLists, UserGroupJoinings } from '@/models/index.js'; -import { publishInternalEvent } from '@/services/stream.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { ApiError } from '../../error'; +import { Antennas, UserLists, UserGroupJoinings } from '@/models/index'; +import { publishInternalEvent } from '@/services/stream'; export const meta = { tags: ['antennas'], diff --git a/src/server/api/endpoints/ap/get.ts b/src/server/api/endpoints/ap/get.ts index 33734b7cbd..2cffce1f16 100644 --- a/src/server/api/endpoints/ap/get.ts +++ b/src/server/api/endpoints/ap/get.ts @@ -1,7 +1,7 @@ import $ from 'cafy'; -import define from '../../define.js'; -import Resolver from '@/remote/activitypub/resolver.js'; -import { ApiError } from '../../error.js'; +import define from '../../define'; +import Resolver from '@/remote/activitypub/resolver'; +import { ApiError } from '../../error'; export const meta = { tags: ['federation'], diff --git a/src/server/api/endpoints/ap/show.ts b/src/server/api/endpoints/ap/show.ts index 0472d28a65..aa0dae070c 100644 --- a/src/server/api/endpoints/ap/show.ts +++ b/src/server/api/endpoints/ap/show.ts @@ -1,16 +1,16 @@ import $ from 'cafy'; -import define from '../../define.js'; -import config from '@/config/index.js'; -import { createPerson } from '@/remote/activitypub/models/person.js'; -import { createNote } from '@/remote/activitypub/models/note.js'; -import Resolver from '@/remote/activitypub/resolver.js'; -import { ApiError } from '../../error.js'; -import { extractDbHost } from '@/misc/convert-host.js'; -import { Users, Notes } from '@/models/index.js'; -import { Note } from '@/models/entities/note.js'; -import { User } from '@/models/entities/user.js'; -import { fetchMeta } from '@/misc/fetch-meta.js'; -import { isActor, isPost, getApId } from '@/remote/activitypub/type.js'; +import define from '../../define'; +import config from '@/config/index'; +import { createPerson } from '@/remote/activitypub/models/person'; +import { createNote } from '@/remote/activitypub/models/note'; +import Resolver from '@/remote/activitypub/resolver'; +import { ApiError } from '../../error'; +import { extractDbHost } from '@/misc/convert-host'; +import { Users, Notes } from '@/models/index'; +import { Note } from '@/models/entities/note'; +import { User } from '@/models/entities/user'; +import { fetchMeta } from '@/misc/fetch-meta'; +import { isActor, isPost, getApId } from '@/remote/activitypub/type'; export const meta = { tags: ['federation'], diff --git a/src/server/api/endpoints/app/create.ts b/src/server/api/endpoints/app/create.ts index f013fa91ca..5dbafa07ee 100644 --- a/src/server/api/endpoints/app/create.ts +++ b/src/server/api/endpoints/app/create.ts @@ -1,9 +1,9 @@ import $ from 'cafy'; -import define from '../../define.js'; -import { Apps } from '@/models/index.js'; -import { genId } from '@/misc/gen-id.js'; -import { unique } from '../../../../prelude/array.js'; -import { secureRndstr } from '@/misc/secure-rndstr.js'; +import define from '../../define'; +import { Apps } from '@/models/index'; +import { genId } from '@/misc/gen-id'; +import { unique } from '../../../../prelude/array'; +import { secureRndstr } from '@/misc/secure-rndstr'; export const meta = { tags: ['app'], diff --git a/src/server/api/endpoints/app/show.ts b/src/server/api/endpoints/app/show.ts index 919d65b12f..27f12eb44f 100644 --- a/src/server/api/endpoints/app/show.ts +++ b/src/server/api/endpoints/app/show.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { ApiError } from '../../error.js'; -import { Apps } from '@/models/index.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { ApiError } from '../../error'; +import { Apps } from '@/models/index'; export const meta = { tags: ['app'], diff --git a/src/server/api/endpoints/auth/accept.ts b/src/server/api/endpoints/auth/accept.ts index e4fcb6dc42..1d1d8ac227 100644 --- a/src/server/api/endpoints/auth/accept.ts +++ b/src/server/api/endpoints/auth/accept.ts @@ -1,10 +1,10 @@ import * as crypto from 'crypto'; import $ from 'cafy'; -import define from '../../define.js'; -import { ApiError } from '../../error.js'; -import { AuthSessions, AccessTokens, Apps } from '@/models/index.js'; -import { genId } from '@/misc/gen-id.js'; -import { secureRndstr } from '@/misc/secure-rndstr.js'; +import define from '../../define'; +import { ApiError } from '../../error'; +import { AuthSessions, AccessTokens, Apps } from '@/models/index'; +import { genId } from '@/misc/gen-id'; +import { secureRndstr } from '@/misc/secure-rndstr'; export const meta = { tags: ['auth'], diff --git a/src/server/api/endpoints/auth/session/generate.ts b/src/server/api/endpoints/auth/session/generate.ts index 4ea5967b08..859cf52ed3 100644 --- a/src/server/api/endpoints/auth/session/generate.ts +++ b/src/server/api/endpoints/auth/session/generate.ts @@ -1,10 +1,10 @@ import { v4 as uuid } from 'uuid'; import $ from 'cafy'; -import config from '@/config/index.js'; -import define from '../../../define.js'; -import { ApiError } from '../../../error.js'; -import { Apps, AuthSessions } from '@/models/index.js'; -import { genId } from '@/misc/gen-id.js'; +import config from '@/config/index'; +import define from '../../../define'; +import { ApiError } from '../../../error'; +import { Apps, AuthSessions } from '@/models/index'; +import { genId } from '@/misc/gen-id'; export const meta = { tags: ['auth'], diff --git a/src/server/api/endpoints/auth/session/show.ts b/src/server/api/endpoints/auth/session/show.ts index 420facb8fb..23f1a56a37 100644 --- a/src/server/api/endpoints/auth/session/show.ts +++ b/src/server/api/endpoints/auth/session/show.ts @@ -1,7 +1,7 @@ import $ from 'cafy'; -import define from '../../../define.js'; -import { ApiError } from '../../../error.js'; -import { AuthSessions } from '@/models/index.js'; +import define from '../../../define'; +import { ApiError } from '../../../error'; +import { AuthSessions } from '@/models/index'; export const meta = { tags: ['auth'], diff --git a/src/server/api/endpoints/auth/session/userkey.ts b/src/server/api/endpoints/auth/session/userkey.ts index 240ff57f1e..72201cb207 100644 --- a/src/server/api/endpoints/auth/session/userkey.ts +++ b/src/server/api/endpoints/auth/session/userkey.ts @@ -1,7 +1,7 @@ import $ from 'cafy'; -import define from '../../../define.js'; -import { ApiError } from '../../../error.js'; -import { Apps, AuthSessions, AccessTokens, Users } from '@/models/index.js'; +import define from '../../../define'; +import { ApiError } from '../../../error'; +import { Apps, AuthSessions, AccessTokens, Users } from '@/models/index'; export const meta = { tags: ['auth'], diff --git a/src/server/api/endpoints/blocking/create.ts b/src/server/api/endpoints/blocking/create.ts index c82b6eb920..1bf5cf374b 100644 --- a/src/server/api/endpoints/blocking/create.ts +++ b/src/server/api/endpoints/blocking/create.ts @@ -1,11 +1,11 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; +import { ID } from '@/misc/cafy-id'; import * as ms from 'ms'; -import create from '@/services/blocking/create.js'; -import define from '../../define.js'; -import { ApiError } from '../../error.js'; -import { getUser } from '../../common/getters.js'; -import { Blockings, NoteWatchings, Users } from '@/models/index.js'; +import create from '@/services/blocking/create'; +import define from '../../define'; +import { ApiError } from '../../error'; +import { getUser } from '../../common/getters'; +import { Blockings, NoteWatchings, Users } from '@/models/index'; export const meta = { tags: ['account'], diff --git a/src/server/api/endpoints/blocking/delete.ts b/src/server/api/endpoints/blocking/delete.ts index 9d075f272c..a66e46fdf0 100644 --- a/src/server/api/endpoints/blocking/delete.ts +++ b/src/server/api/endpoints/blocking/delete.ts @@ -1,11 +1,11 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; +import { ID } from '@/misc/cafy-id'; import * as ms from 'ms'; -import deleteBlocking from '@/services/blocking/delete.js'; -import define from '../../define.js'; -import { ApiError } from '../../error.js'; -import { getUser } from '../../common/getters.js'; -import { Blockings, Users } from '@/models/index.js'; +import deleteBlocking from '@/services/blocking/delete'; +import define from '../../define'; +import { ApiError } from '../../error'; +import { getUser } from '../../common/getters'; +import { Blockings, Users } from '@/models/index'; export const meta = { tags: ['account'], diff --git a/src/server/api/endpoints/blocking/list.ts b/src/server/api/endpoints/blocking/list.ts index a616d0b7c1..fe25fdaba1 100644 --- a/src/server/api/endpoints/blocking/list.ts +++ b/src/server/api/endpoints/blocking/list.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { Blockings } from '@/models/index.js'; -import { makePaginationQuery } from '../../common/make-pagination-query.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { Blockings } from '@/models/index'; +import { makePaginationQuery } from '../../common/make-pagination-query'; export const meta = { tags: ['account'], diff --git a/src/server/api/endpoints/channels/create.ts b/src/server/api/endpoints/channels/create.ts index 48348cf35a..0cedfd6c6a 100644 --- a/src/server/api/endpoints/channels/create.ts +++ b/src/server/api/endpoints/channels/create.ts @@ -1,10 +1,10 @@ import $ from 'cafy'; -import define from '../../define.js'; -import { ApiError } from '../../error.js'; -import { Channels, DriveFiles } from '@/models/index.js'; -import { Channel } from '@/models/entities/channel.js'; -import { genId } from '@/misc/gen-id.js'; -import { ID } from '@/misc/cafy-id.js'; +import define from '../../define'; +import { ApiError } from '../../error'; +import { Channels, DriveFiles } from '@/models/index'; +import { Channel } from '@/models/entities/channel'; +import { genId } from '@/misc/gen-id'; +import { ID } from '@/misc/cafy-id'; export const meta = { tags: ['channels'], diff --git a/src/server/api/endpoints/channels/featured.ts b/src/server/api/endpoints/channels/featured.ts index 7cfc33e639..dc1f49f960 100644 --- a/src/server/api/endpoints/channels/featured.ts +++ b/src/server/api/endpoints/channels/featured.ts @@ -1,5 +1,5 @@ -import define from '../../define.js'; -import { Channels } from '@/models/index.js'; +import define from '../../define'; +import { Channels } from '@/models/index'; export const meta = { tags: ['channels'], diff --git a/src/server/api/endpoints/channels/follow.ts b/src/server/api/endpoints/channels/follow.ts index 37fb8ff1b4..d4664e6996 100644 --- a/src/server/api/endpoints/channels/follow.ts +++ b/src/server/api/endpoints/channels/follow.ts @@ -1,10 +1,10 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { ApiError } from '../../error.js'; -import { Channels, ChannelFollowings } from '@/models/index.js'; -import { genId } from '@/misc/gen-id.js'; -import { publishUserEvent } from '@/services/stream.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { ApiError } from '../../error'; +import { Channels, ChannelFollowings } from '@/models/index'; +import { genId } from '@/misc/gen-id'; +import { publishUserEvent } from '@/services/stream'; export const meta = { tags: ['channels'], diff --git a/src/server/api/endpoints/channels/followed.ts b/src/server/api/endpoints/channels/followed.ts index 7fc83c933d..be239a01d6 100644 --- a/src/server/api/endpoints/channels/followed.ts +++ b/src/server/api/endpoints/channels/followed.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { Channels, ChannelFollowings } from '@/models/index.js'; -import { makePaginationQuery } from '../../common/make-pagination-query.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { Channels, ChannelFollowings } from '@/models/index'; +import { makePaginationQuery } from '../../common/make-pagination-query'; export const meta = { tags: ['channels', 'account'], diff --git a/src/server/api/endpoints/channels/owned.ts b/src/server/api/endpoints/channels/owned.ts index 2f08e52615..4a2e9db17b 100644 --- a/src/server/api/endpoints/channels/owned.ts +++ b/src/server/api/endpoints/channels/owned.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { Channels } from '@/models/index.js'; -import { makePaginationQuery } from '../../common/make-pagination-query.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { Channels } from '@/models/index'; +import { makePaginationQuery } from '../../common/make-pagination-query'; export const meta = { tags: ['channels', 'account'], diff --git a/src/server/api/endpoints/channels/show.ts b/src/server/api/endpoints/channels/show.ts index f2c351f557..803ce6363d 100644 --- a/src/server/api/endpoints/channels/show.ts +++ b/src/server/api/endpoints/channels/show.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { ApiError } from '../../error.js'; -import { Channels } from '@/models/index.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { ApiError } from '../../error'; +import { Channels } from '@/models/index'; export const meta = { tags: ['channels'], diff --git a/src/server/api/endpoints/channels/timeline.ts b/src/server/api/endpoints/channels/timeline.ts index 3032e7ee6f..0ed057a11e 100644 --- a/src/server/api/endpoints/channels/timeline.ts +++ b/src/server/api/endpoints/channels/timeline.ts @@ -1,10 +1,10 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { ApiError } from '../../error.js'; -import { Notes, Channels } from '@/models/index.js'; -import { makePaginationQuery } from '../../common/make-pagination-query.js'; -import { activeUsersChart } from '@/services/chart/index.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { ApiError } from '../../error'; +import { Notes, Channels } from '@/models/index'; +import { makePaginationQuery } from '../../common/make-pagination-query'; +import { activeUsersChart } from '@/services/chart/index'; export const meta = { tags: ['notes', 'channels'], diff --git a/src/server/api/endpoints/channels/unfollow.ts b/src/server/api/endpoints/channels/unfollow.ts index 1c2ab307af..700f8e93ba 100644 --- a/src/server/api/endpoints/channels/unfollow.ts +++ b/src/server/api/endpoints/channels/unfollow.ts @@ -1,9 +1,9 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { ApiError } from '../../error.js'; -import { Channels, ChannelFollowings } from '@/models/index.js'; -import { publishUserEvent } from '@/services/stream.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { ApiError } from '../../error'; +import { Channels, ChannelFollowings } from '@/models/index'; +import { publishUserEvent } from '@/services/stream'; export const meta = { tags: ['channels'], diff --git a/src/server/api/endpoints/channels/update.ts b/src/server/api/endpoints/channels/update.ts index 255c664307..9b447bd04b 100644 --- a/src/server/api/endpoints/channels/update.ts +++ b/src/server/api/endpoints/channels/update.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { ApiError } from '../../error.js'; -import { Channels, DriveFiles } from '@/models/index.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { ApiError } from '../../error'; +import { Channels, DriveFiles } from '@/models/index'; export const meta = { tags: ['channels'], diff --git a/src/server/api/endpoints/charts/active-users.ts b/src/server/api/endpoints/charts/active-users.ts index dc080d3bc6..c4878f7d61 100644 --- a/src/server/api/endpoints/charts/active-users.ts +++ b/src/server/api/endpoints/charts/active-users.ts @@ -1,7 +1,7 @@ import $ from 'cafy'; -import define from '../../define.js'; -import { convertLog } from '@/services/chart/core.js'; -import { activeUsersChart } from '@/services/chart/index.js'; +import define from '../../define'; +import { convertLog } from '@/services/chart/core'; +import { activeUsersChart } from '@/services/chart/index'; export const meta = { tags: ['charts', 'users'], diff --git a/src/server/api/endpoints/charts/drive.ts b/src/server/api/endpoints/charts/drive.ts index 5bad71a9fa..07bff82cf4 100644 --- a/src/server/api/endpoints/charts/drive.ts +++ b/src/server/api/endpoints/charts/drive.ts @@ -1,7 +1,7 @@ import $ from 'cafy'; -import define from '../../define.js'; -import { convertLog } from '@/services/chart/core.js'; -import { driveChart } from '@/services/chart/index.js'; +import define from '../../define'; +import { convertLog } from '@/services/chart/core'; +import { driveChart } from '@/services/chart/index'; export const meta = { tags: ['charts', 'drive'], diff --git a/src/server/api/endpoints/charts/federation.ts b/src/server/api/endpoints/charts/federation.ts index 83ec290023..9575f9a7b7 100644 --- a/src/server/api/endpoints/charts/federation.ts +++ b/src/server/api/endpoints/charts/federation.ts @@ -1,7 +1,7 @@ import $ from 'cafy'; -import define from '../../define.js'; -import { convertLog } from '@/services/chart/core.js'; -import { federationChart } from '@/services/chart/index.js'; +import define from '../../define'; +import { convertLog } from '@/services/chart/core'; +import { federationChart } from '@/services/chart/index'; export const meta = { tags: ['charts'], diff --git a/src/server/api/endpoints/charts/hashtag.ts b/src/server/api/endpoints/charts/hashtag.ts index 12d3c2ba4c..53dc61e51e 100644 --- a/src/server/api/endpoints/charts/hashtag.ts +++ b/src/server/api/endpoints/charts/hashtag.ts @@ -1,7 +1,7 @@ import $ from 'cafy'; -import define from '../../define.js'; -import { convertLog } from '@/services/chart/core.js'; -import { hashtagChart } from '@/services/chart/index.js'; +import define from '../../define'; +import { convertLog } from '@/services/chart/core'; +import { hashtagChart } from '@/services/chart/index'; export const meta = { tags: ['charts', 'hashtags'], diff --git a/src/server/api/endpoints/charts/instance.ts b/src/server/api/endpoints/charts/instance.ts index ed3f8bbe93..1835023188 100644 --- a/src/server/api/endpoints/charts/instance.ts +++ b/src/server/api/endpoints/charts/instance.ts @@ -1,7 +1,7 @@ import $ from 'cafy'; -import define from '../../define.js'; -import { convertLog } from '@/services/chart/core.js'; -import { instanceChart } from '@/services/chart/index.js'; +import define from '../../define'; +import { convertLog } from '@/services/chart/core'; +import { instanceChart } from '@/services/chart/index'; export const meta = { tags: ['charts'], diff --git a/src/server/api/endpoints/charts/network.ts b/src/server/api/endpoints/charts/network.ts index a4700f045a..b524df93be 100644 --- a/src/server/api/endpoints/charts/network.ts +++ b/src/server/api/endpoints/charts/network.ts @@ -1,7 +1,7 @@ import $ from 'cafy'; -import define from '../../define.js'; -import { convertLog } from '@/services/chart/core.js'; -import { networkChart } from '@/services/chart/index.js'; +import define from '../../define'; +import { convertLog } from '@/services/chart/core'; +import { networkChart } from '@/services/chart/index'; export const meta = { tags: ['charts'], diff --git a/src/server/api/endpoints/charts/notes.ts b/src/server/api/endpoints/charts/notes.ts index 7c92a11882..676f302939 100644 --- a/src/server/api/endpoints/charts/notes.ts +++ b/src/server/api/endpoints/charts/notes.ts @@ -1,7 +1,7 @@ import $ from 'cafy'; -import define from '../../define.js'; -import { convertLog } from '@/services/chart/core.js'; -import { notesChart } from '@/services/chart/index.js'; +import define from '../../define'; +import { convertLog } from '@/services/chart/core'; +import { notesChart } from '@/services/chart/index'; export const meta = { tags: ['charts', 'notes'], diff --git a/src/server/api/endpoints/charts/user/drive.ts b/src/server/api/endpoints/charts/user/drive.ts index 8649ac69c7..f2770e2df8 100644 --- a/src/server/api/endpoints/charts/user/drive.ts +++ b/src/server/api/endpoints/charts/user/drive.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import define from '../../../define.js'; -import { ID } from '@/misc/cafy-id.js'; -import { convertLog } from '@/services/chart/core.js'; -import { perUserDriveChart } from '@/services/chart/index.js'; +import define from '../../../define'; +import { ID } from '@/misc/cafy-id'; +import { convertLog } from '@/services/chart/core'; +import { perUserDriveChart } from '@/services/chart/index'; export const meta = { tags: ['charts', 'drive', 'users'], diff --git a/src/server/api/endpoints/charts/user/following.ts b/src/server/api/endpoints/charts/user/following.ts index 8905be2d9b..8c97b63e89 100644 --- a/src/server/api/endpoints/charts/user/following.ts +++ b/src/server/api/endpoints/charts/user/following.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import define from '../../../define.js'; -import { ID } from '@/misc/cafy-id.js'; -import { convertLog } from '@/services/chart/core.js'; -import { perUserFollowingChart } from '@/services/chart/index.js'; +import define from '../../../define'; +import { ID } from '@/misc/cafy-id'; +import { convertLog } from '@/services/chart/core'; +import { perUserFollowingChart } from '@/services/chart/index'; export const meta = { tags: ['charts', 'users', 'following'], diff --git a/src/server/api/endpoints/charts/user/notes.ts b/src/server/api/endpoints/charts/user/notes.ts index 9c6152fa9e..0d5f5a8b6a 100644 --- a/src/server/api/endpoints/charts/user/notes.ts +++ b/src/server/api/endpoints/charts/user/notes.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import define from '../../../define.js'; -import { ID } from '@/misc/cafy-id.js'; -import { convertLog } from '@/services/chart/core.js'; -import { perUserNotesChart } from '@/services/chart/index.js'; +import define from '../../../define'; +import { ID } from '@/misc/cafy-id'; +import { convertLog } from '@/services/chart/core'; +import { perUserNotesChart } from '@/services/chart/index'; export const meta = { tags: ['charts', 'users', 'notes'], diff --git a/src/server/api/endpoints/charts/user/reactions.ts b/src/server/api/endpoints/charts/user/reactions.ts index 28629a0259..3cabe40d56 100644 --- a/src/server/api/endpoints/charts/user/reactions.ts +++ b/src/server/api/endpoints/charts/user/reactions.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import define from '../../../define.js'; -import { ID } from '@/misc/cafy-id.js'; -import { convertLog } from '@/services/chart/core.js'; -import { perUserReactionsChart } from '@/services/chart/index.js'; +import define from '../../../define'; +import { ID } from '@/misc/cafy-id'; +import { convertLog } from '@/services/chart/core'; +import { perUserReactionsChart } from '@/services/chart/index'; export const meta = { tags: ['charts', 'users', 'reactions'], diff --git a/src/server/api/endpoints/charts/users.ts b/src/server/api/endpoints/charts/users.ts index 8d312e1a14..deac89b59d 100644 --- a/src/server/api/endpoints/charts/users.ts +++ b/src/server/api/endpoints/charts/users.ts @@ -1,7 +1,7 @@ import $ from 'cafy'; -import define from '../../define.js'; -import { convertLog } from '@/services/chart/core.js'; -import { usersChart } from '@/services/chart/index.js'; +import define from '../../define'; +import { convertLog } from '@/services/chart/core'; +import { usersChart } from '@/services/chart/index'; export const meta = { tags: ['charts', 'users'], diff --git a/src/server/api/endpoints/clips/add-note.ts b/src/server/api/endpoints/clips/add-note.ts index 909d05bc82..79d7b8adde 100644 --- a/src/server/api/endpoints/clips/add-note.ts +++ b/src/server/api/endpoints/clips/add-note.ts @@ -1,10 +1,10 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { ClipNotes, Clips } from '@/models/index.js'; -import { ApiError } from '../../error.js'; -import { genId } from '@/misc/gen-id.js'; -import { getNote } from '../../common/getters.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { ClipNotes, Clips } from '@/models/index'; +import { ApiError } from '../../error'; +import { genId } from '@/misc/gen-id'; +import { getNote } from '../../common/getters'; export const meta = { tags: ['account', 'notes', 'clips'], diff --git a/src/server/api/endpoints/clips/create.ts b/src/server/api/endpoints/clips/create.ts index 06286ed8ec..02d2773709 100644 --- a/src/server/api/endpoints/clips/create.ts +++ b/src/server/api/endpoints/clips/create.ts @@ -1,7 +1,7 @@ import $ from 'cafy'; -import define from '../../define.js'; -import { genId } from '@/misc/gen-id.js'; -import { Clips } from '@/models/index.js'; +import define from '../../define'; +import { genId } from '@/misc/gen-id'; +import { Clips } from '@/models/index'; export const meta = { tags: ['clips'], diff --git a/src/server/api/endpoints/clips/delete.ts b/src/server/api/endpoints/clips/delete.ts index 93e69dae34..ca489af3bf 100644 --- a/src/server/api/endpoints/clips/delete.ts +++ b/src/server/api/endpoints/clips/delete.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { ApiError } from '../../error.js'; -import { Clips } from '@/models/index.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { ApiError } from '../../error'; +import { Clips } from '@/models/index'; export const meta = { tags: ['clips'], diff --git a/src/server/api/endpoints/clips/list.ts b/src/server/api/endpoints/clips/list.ts index 1eeac8b45b..1f6db9b979 100644 --- a/src/server/api/endpoints/clips/list.ts +++ b/src/server/api/endpoints/clips/list.ts @@ -1,5 +1,5 @@ -import define from '../../define.js'; -import { Clips } from '@/models/index.js'; +import define from '../../define'; +import { Clips } from '@/models/index'; export const meta = { tags: ['clips', 'account'], diff --git a/src/server/api/endpoints/clips/notes.ts b/src/server/api/endpoints/clips/notes.ts index 41fa2b2bcc..5a9fed52fa 100644 --- a/src/server/api/endpoints/clips/notes.ts +++ b/src/server/api/endpoints/clips/notes.ts @@ -1,12 +1,12 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { ClipNotes, Clips, Notes } from '@/models/index.js'; -import { makePaginationQuery } from '../../common/make-pagination-query.js'; -import { generateVisibilityQuery } from '../../common/generate-visibility-query.js'; -import { generateMutedUserQuery } from '../../common/generate-muted-user-query.js'; -import { ApiError } from '../../error.js'; -import { generateBlockedUserQuery } from '../../common/generate-block-query.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { ClipNotes, Clips, Notes } from '@/models/index'; +import { makePaginationQuery } from '../../common/make-pagination-query'; +import { generateVisibilityQuery } from '../../common/generate-visibility-query'; +import { generateMutedUserQuery } from '../../common/generate-muted-user-query'; +import { ApiError } from '../../error'; +import { generateBlockedUserQuery } from '../../common/generate-block-query'; export const meta = { tags: ['account', 'notes', 'clips'], diff --git a/src/server/api/endpoints/clips/show.ts b/src/server/api/endpoints/clips/show.ts index ab368e6a09..8f245cd18e 100644 --- a/src/server/api/endpoints/clips/show.ts +++ b/src/server/api/endpoints/clips/show.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { ApiError } from '../../error.js'; -import { Clips } from '@/models/index.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { ApiError } from '../../error'; +import { Clips } from '@/models/index'; export const meta = { tags: ['clips', 'account'], diff --git a/src/server/api/endpoints/clips/update.ts b/src/server/api/endpoints/clips/update.ts index 07a9d585c7..7f645560bb 100644 --- a/src/server/api/endpoints/clips/update.ts +++ b/src/server/api/endpoints/clips/update.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { ApiError } from '../../error.js'; -import { Clips } from '@/models/index.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { ApiError } from '../../error'; +import { Clips } from '@/models/index'; export const meta = { tags: ['clips'], diff --git a/src/server/api/endpoints/drive.ts b/src/server/api/endpoints/drive.ts index 6a99cd1246..2974ccfab9 100644 --- a/src/server/api/endpoints/drive.ts +++ b/src/server/api/endpoints/drive.ts @@ -1,6 +1,6 @@ -import define from '../define.js'; -import { fetchMeta } from '@/misc/fetch-meta.js'; -import { DriveFiles } from '@/models/index.js'; +import define from '../define'; +import { fetchMeta } from '@/misc/fetch-meta'; +import { DriveFiles } from '@/models/index'; export const meta = { tags: ['drive', 'account'], diff --git a/src/server/api/endpoints/drive/files.ts b/src/server/api/endpoints/drive/files.ts index 60cf3eb948..95435e1e43 100644 --- a/src/server/api/endpoints/drive/files.ts +++ b/src/server/api/endpoints/drive/files.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { DriveFiles } from '@/models/index.js'; -import { makePaginationQuery } from '../../common/make-pagination-query.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { DriveFiles } from '@/models/index'; +import { makePaginationQuery } from '../../common/make-pagination-query'; export const meta = { tags: ['drive'], diff --git a/src/server/api/endpoints/drive/files/attached-notes.ts b/src/server/api/endpoints/drive/files/attached-notes.ts index 5aafe0ea1f..eec7d7877e 100644 --- a/src/server/api/endpoints/drive/files/attached-notes.ts +++ b/src/server/api/endpoints/drive/files/attached-notes.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../../define.js'; -import { ApiError } from '../../../error.js'; -import { DriveFiles, Notes } from '@/models/index.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../../define'; +import { ApiError } from '../../../error'; +import { DriveFiles, Notes } from '@/models/index'; export const meta = { tags: ['drive', 'notes'], diff --git a/src/server/api/endpoints/drive/files/check-existence.ts b/src/server/api/endpoints/drive/files/check-existence.ts index a53a4f7f91..2c36078421 100644 --- a/src/server/api/endpoints/drive/files/check-existence.ts +++ b/src/server/api/endpoints/drive/files/check-existence.ts @@ -1,6 +1,6 @@ import $ from 'cafy'; -import define from '../../../define.js'; -import { DriveFiles } from '@/models/index.js'; +import define from '../../../define'; +import { DriveFiles } from '@/models/index'; export const meta = { tags: ['drive'], diff --git a/src/server/api/endpoints/drive/files/create.ts b/src/server/api/endpoints/drive/files/create.ts index 1f7b712439..2abc104e6c 100644 --- a/src/server/api/endpoints/drive/files/create.ts +++ b/src/server/api/endpoints/drive/files/create.ts @@ -1,11 +1,11 @@ import * as ms from 'ms'; import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import create from '@/services/drive/add-file.js'; -import define from '../../../define.js'; -import { apiLogger } from '../../../logger.js'; -import { ApiError } from '../../../error.js'; -import { DriveFiles } from '@/models/index.js'; +import { ID } from '@/misc/cafy-id'; +import create from '@/services/drive/add-file'; +import define from '../../../define'; +import { apiLogger } from '../../../logger'; +import { ApiError } from '../../../error'; +import { DriveFiles } from '@/models/index'; export const meta = { tags: ['drive'], diff --git a/src/server/api/endpoints/drive/files/delete.ts b/src/server/api/endpoints/drive/files/delete.ts index ae1381ee13..038325694d 100644 --- a/src/server/api/endpoints/drive/files/delete.ts +++ b/src/server/api/endpoints/drive/files/delete.ts @@ -1,10 +1,10 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import { deleteFile } from '@/services/drive/delete-file.js'; -import { publishDriveStream } from '@/services/stream.js'; -import define from '../../../define.js'; -import { ApiError } from '../../../error.js'; -import { DriveFiles } from '@/models/index.js'; +import { ID } from '@/misc/cafy-id'; +import { deleteFile } from '@/services/drive/delete-file'; +import { publishDriveStream } from '@/services/stream'; +import define from '../../../define'; +import { ApiError } from '../../../error'; +import { DriveFiles } from '@/models/index'; export const meta = { tags: ['drive'], diff --git a/src/server/api/endpoints/drive/files/find-by-hash.ts b/src/server/api/endpoints/drive/files/find-by-hash.ts index 492a7ee593..5fea7bbbb0 100644 --- a/src/server/api/endpoints/drive/files/find-by-hash.ts +++ b/src/server/api/endpoints/drive/files/find-by-hash.ts @@ -1,6 +1,6 @@ import $ from 'cafy'; -import define from '../../../define.js'; -import { DriveFiles } from '@/models/index.js'; +import define from '../../../define'; +import { DriveFiles } from '@/models/index'; export const meta = { tags: ['drive'], diff --git a/src/server/api/endpoints/drive/files/find.ts b/src/server/api/endpoints/drive/files/find.ts index 724424500d..dd419f4c04 100644 --- a/src/server/api/endpoints/drive/files/find.ts +++ b/src/server/api/endpoints/drive/files/find.ts @@ -1,7 +1,7 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../../define.js'; -import { DriveFiles } from '@/models/index.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../../define'; +import { DriveFiles } from '@/models/index'; export const meta = { requireCredential: true as const, diff --git a/src/server/api/endpoints/drive/files/show.ts b/src/server/api/endpoints/drive/files/show.ts index 7a2ea1b76f..a96ebaa123 100644 --- a/src/server/api/endpoints/drive/files/show.ts +++ b/src/server/api/endpoints/drive/files/show.ts @@ -1,9 +1,9 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../../define.js'; -import { ApiError } from '../../../error.js'; -import { DriveFile } from '@/models/entities/drive-file.js'; -import { DriveFiles } from '@/models/index.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../../define'; +import { ApiError } from '../../../error'; +import { DriveFile } from '@/models/entities/drive-file'; +import { DriveFiles } from '@/models/index'; export const meta = { tags: ['drive'], diff --git a/src/server/api/endpoints/drive/files/update.ts b/src/server/api/endpoints/drive/files/update.ts index d75da00119..1ef445625c 100644 --- a/src/server/api/endpoints/drive/files/update.ts +++ b/src/server/api/endpoints/drive/files/update.ts @@ -1,9 +1,9 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import { publishDriveStream } from '@/services/stream.js'; -import define from '../../../define.js'; -import { ApiError } from '../../../error.js'; -import { DriveFiles, DriveFolders } from '@/models/index.js'; +import { ID } from '@/misc/cafy-id'; +import { publishDriveStream } from '@/services/stream'; +import define from '../../../define'; +import { ApiError } from '../../../error'; +import { DriveFiles, DriveFolders } from '@/models/index'; export const meta = { tags: ['drive'], diff --git a/src/server/api/endpoints/drive/files/upload-from-url.ts b/src/server/api/endpoints/drive/files/upload-from-url.ts index 5f0c461dc3..f37f316efb 100644 --- a/src/server/api/endpoints/drive/files/upload-from-url.ts +++ b/src/server/api/endpoints/drive/files/upload-from-url.ts @@ -1,10 +1,10 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; +import { ID } from '@/misc/cafy-id'; import * as ms from 'ms'; -import uploadFromUrl from '@/services/drive/upload-from-url.js'; -import define from '../../../define.js'; -import { DriveFiles } from '@/models/index.js'; -import { publishMainStream } from '@/services/stream.js'; +import uploadFromUrl from '@/services/drive/upload-from-url'; +import define from '../../../define'; +import { DriveFiles } from '@/models/index'; +import { publishMainStream } from '@/services/stream'; export const meta = { tags: ['drive'], diff --git a/src/server/api/endpoints/drive/folders.ts b/src/server/api/endpoints/drive/folders.ts index 5e0561d579..6f16878b13 100644 --- a/src/server/api/endpoints/drive/folders.ts +++ b/src/server/api/endpoints/drive/folders.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { DriveFolders } from '@/models/index.js'; -import { makePaginationQuery } from '../../common/make-pagination-query.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { DriveFolders } from '@/models/index'; +import { makePaginationQuery } from '../../common/make-pagination-query'; export const meta = { tags: ['drive'], diff --git a/src/server/api/endpoints/drive/folders/create.ts b/src/server/api/endpoints/drive/folders/create.ts index 5167ac0d19..80f96bd641 100644 --- a/src/server/api/endpoints/drive/folders/create.ts +++ b/src/server/api/endpoints/drive/folders/create.ts @@ -1,10 +1,10 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import { publishDriveStream } from '@/services/stream.js'; -import define from '../../../define.js'; -import { ApiError } from '../../../error.js'; -import { DriveFolders } from '@/models/index.js'; -import { genId } from '@/misc/gen-id.js'; +import { ID } from '@/misc/cafy-id'; +import { publishDriveStream } from '@/services/stream'; +import define from '../../../define'; +import { ApiError } from '../../../error'; +import { DriveFolders } from '@/models/index'; +import { genId } from '@/misc/gen-id'; export const meta = { tags: ['drive'], diff --git a/src/server/api/endpoints/drive/folders/delete.ts b/src/server/api/endpoints/drive/folders/delete.ts index 3f2ef8f2c0..38b4aef103 100644 --- a/src/server/api/endpoints/drive/folders/delete.ts +++ b/src/server/api/endpoints/drive/folders/delete.ts @@ -1,9 +1,9 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../../define.js'; -import { publishDriveStream } from '@/services/stream.js'; -import { ApiError } from '../../../error.js'; -import { DriveFolders, DriveFiles } from '@/models/index.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../../define'; +import { publishDriveStream } from '@/services/stream'; +import { ApiError } from '../../../error'; +import { DriveFolders, DriveFiles } from '@/models/index'; export const meta = { tags: ['drive'], diff --git a/src/server/api/endpoints/drive/folders/find.ts b/src/server/api/endpoints/drive/folders/find.ts index 7299dceccf..a6c5a49988 100644 --- a/src/server/api/endpoints/drive/folders/find.ts +++ b/src/server/api/endpoints/drive/folders/find.ts @@ -1,7 +1,7 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../../define.js'; -import { DriveFolders } from '@/models/index.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../../define'; +import { DriveFolders } from '@/models/index'; export const meta = { tags: ['drive'], diff --git a/src/server/api/endpoints/drive/folders/show.ts b/src/server/api/endpoints/drive/folders/show.ts index 7d46e853ba..e907a24f05 100644 --- a/src/server/api/endpoints/drive/folders/show.ts +++ b/src/server/api/endpoints/drive/folders/show.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../../define.js'; -import { ApiError } from '../../../error.js'; -import { DriveFolders } from '@/models/index.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../../define'; +import { ApiError } from '../../../error'; +import { DriveFolders } from '@/models/index'; export const meta = { tags: ['drive'], diff --git a/src/server/api/endpoints/drive/folders/update.ts b/src/server/api/endpoints/drive/folders/update.ts index 6598b6a8a4..612252e6df 100644 --- a/src/server/api/endpoints/drive/folders/update.ts +++ b/src/server/api/endpoints/drive/folders/update.ts @@ -1,9 +1,9 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import { publishDriveStream } from '@/services/stream.js'; -import define from '../../../define.js'; -import { ApiError } from '../../../error.js'; -import { DriveFolders } from '@/models/index.js'; +import { ID } from '@/misc/cafy-id'; +import { publishDriveStream } from '@/services/stream'; +import define from '../../../define'; +import { ApiError } from '../../../error'; +import { DriveFolders } from '@/models/index'; export const meta = { tags: ['drive'], diff --git a/src/server/api/endpoints/drive/stream.ts b/src/server/api/endpoints/drive/stream.ts index da70b7b36c..141e02f748 100644 --- a/src/server/api/endpoints/drive/stream.ts +++ b/src/server/api/endpoints/drive/stream.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { DriveFiles } from '@/models/index.js'; -import { makePaginationQuery } from '../../common/make-pagination-query.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { DriveFiles } from '@/models/index'; +import { makePaginationQuery } from '../../common/make-pagination-query'; export const meta = { tags: ['drive'], diff --git a/src/server/api/endpoints/endpoint.ts b/src/server/api/endpoints/endpoint.ts index c8fb0f5f34..1a04d8bee8 100644 --- a/src/server/api/endpoints/endpoint.ts +++ b/src/server/api/endpoints/endpoint.ts @@ -1,6 +1,6 @@ import $ from 'cafy'; -import define from '../define.js'; -import endpoints from '../endpoints.js'; +import define from '../define'; +import endpoints from '../endpoints'; export const meta = { requireCredential: false as const, diff --git a/src/server/api/endpoints/endpoints.ts b/src/server/api/endpoints/endpoints.ts index cd7bf45c4f..f7b9757d8d 100644 --- a/src/server/api/endpoints/endpoints.ts +++ b/src/server/api/endpoints/endpoints.ts @@ -1,5 +1,5 @@ -import define from '../define.js'; -import endpoints from '../endpoints.js'; +import define from '../define'; +import endpoints from '../endpoints'; export const meta = { requireCredential: false as const, diff --git a/src/server/api/endpoints/federation/dns.ts b/src/server/api/endpoints/federation/dns.ts index 4605cd5576..7ba566301a 100644 --- a/src/server/api/endpoints/federation/dns.ts +++ b/src/server/api/endpoints/federation/dns.ts @@ -1,8 +1,8 @@ import { promises as dns } from 'dns'; import $ from 'cafy'; -import define from '../../define.js'; -import { Instances } from '@/models/index.js'; -import { toPuny } from '@/misc/convert-host.js'; +import define from '../../define'; +import { Instances } from '@/models/index'; +import { toPuny } from '@/misc/convert-host'; const resolver = new dns.Resolver(); resolver.setServers(['1.1.1.1']); diff --git a/src/server/api/endpoints/federation/followers.ts b/src/server/api/endpoints/federation/followers.ts index 1c74f45030..655e7b7b9a 100644 --- a/src/server/api/endpoints/federation/followers.ts +++ b/src/server/api/endpoints/federation/followers.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { Followings } from '@/models/index.js'; -import { makePaginationQuery } from '../../common/make-pagination-query.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { Followings } from '@/models/index'; +import { makePaginationQuery } from '../../common/make-pagination-query'; export const meta = { tags: ['federation'], diff --git a/src/server/api/endpoints/federation/following.ts b/src/server/api/endpoints/federation/following.ts index b30f67af39..5b283581a6 100644 --- a/src/server/api/endpoints/federation/following.ts +++ b/src/server/api/endpoints/federation/following.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { Followings } from '@/models/index.js'; -import { makePaginationQuery } from '../../common/make-pagination-query.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { Followings } from '@/models/index'; +import { makePaginationQuery } from '../../common/make-pagination-query'; export const meta = { tags: ['federation'], diff --git a/src/server/api/endpoints/federation/instances.ts b/src/server/api/endpoints/federation/instances.ts index f16c04f5d5..cf5e44ebd5 100644 --- a/src/server/api/endpoints/federation/instances.ts +++ b/src/server/api/endpoints/federation/instances.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import config from '@/config/index.js'; -import define from '../../define.js'; -import { Instances } from '@/models/index.js'; -import { fetchMeta } from '@/misc/fetch-meta.js'; +import config from '@/config/index'; +import define from '../../define'; +import { Instances } from '@/models/index'; +import { fetchMeta } from '@/misc/fetch-meta'; export const meta = { tags: ['federation'], diff --git a/src/server/api/endpoints/federation/show-instance.ts b/src/server/api/endpoints/federation/show-instance.ts index d613a940ab..f8352aefb3 100644 --- a/src/server/api/endpoints/federation/show-instance.ts +++ b/src/server/api/endpoints/federation/show-instance.ts @@ -1,7 +1,7 @@ import $ from 'cafy'; -import define from '../../define.js'; -import { Instances } from '@/models/index.js'; -import { toPuny } from '@/misc/convert-host.js'; +import define from '../../define'; +import { Instances } from '@/models/index'; +import { toPuny } from '@/misc/convert-host'; export const meta = { tags: ['federation'], diff --git a/src/server/api/endpoints/federation/update-remote-user.ts b/src/server/api/endpoints/federation/update-remote-user.ts index b8a383410d..580c3cb3d9 100644 --- a/src/server/api/endpoints/federation/update-remote-user.ts +++ b/src/server/api/endpoints/federation/update-remote-user.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { getRemoteUser } from '../../common/getters.js'; -import { updatePerson } from '@/remote/activitypub/models/person.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { getRemoteUser } from '../../common/getters'; +import { updatePerson } from '@/remote/activitypub/models/person'; export const meta = { tags: ['federation'], diff --git a/src/server/api/endpoints/federation/users.ts b/src/server/api/endpoints/federation/users.ts index 9c7390b68e..0e35df3e1c 100644 --- a/src/server/api/endpoints/federation/users.ts +++ b/src/server/api/endpoints/federation/users.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { Users } from '@/models/index.js'; -import { makePaginationQuery } from '../../common/make-pagination-query.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { Users } from '@/models/index'; +import { makePaginationQuery } from '../../common/make-pagination-query'; export const meta = { tags: ['federation'], diff --git a/src/server/api/endpoints/following/create.ts b/src/server/api/endpoints/following/create.ts index 91b49b481d..ba9ca1092d 100644 --- a/src/server/api/endpoints/following/create.ts +++ b/src/server/api/endpoints/following/create.ts @@ -1,11 +1,11 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; +import { ID } from '@/misc/cafy-id'; import * as ms from 'ms'; -import create from '@/services/following/create.js'; -import define from '../../define.js'; -import { ApiError } from '../../error.js'; -import { getUser } from '../../common/getters.js'; -import { Followings, Users } from '@/models/index.js'; +import create from '@/services/following/create'; +import define from '../../define'; +import { ApiError } from '../../error'; +import { getUser } from '../../common/getters'; +import { Followings, Users } from '@/models/index'; export const meta = { tags: ['following', 'users'], diff --git a/src/server/api/endpoints/following/delete.ts b/src/server/api/endpoints/following/delete.ts index 7b2d006f4f..0b0158b86e 100644 --- a/src/server/api/endpoints/following/delete.ts +++ b/src/server/api/endpoints/following/delete.ts @@ -1,11 +1,11 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; +import { ID } from '@/misc/cafy-id'; import * as ms from 'ms'; -import deleteFollowing from '@/services/following/delete.js'; -import define from '../../define.js'; -import { ApiError } from '../../error.js'; -import { getUser } from '../../common/getters.js'; -import { Followings, Users } from '@/models/index.js'; +import deleteFollowing from '@/services/following/delete'; +import define from '../../define'; +import { ApiError } from '../../error'; +import { getUser } from '../../common/getters'; +import { Followings, Users } from '@/models/index'; export const meta = { tags: ['following', 'users'], diff --git a/src/server/api/endpoints/following/requests/accept.ts b/src/server/api/endpoints/following/requests/accept.ts index bf3c315c3c..af39ea1d90 100644 --- a/src/server/api/endpoints/following/requests/accept.ts +++ b/src/server/api/endpoints/following/requests/accept.ts @@ -1,9 +1,9 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import acceptFollowRequest from '@/services/following/requests/accept.js'; -import define from '../../../define.js'; -import { ApiError } from '../../../error.js'; -import { getUser } from '../../../common/getters.js'; +import { ID } from '@/misc/cafy-id'; +import acceptFollowRequest from '@/services/following/requests/accept'; +import define from '../../../define'; +import { ApiError } from '../../../error'; +import { getUser } from '../../../common/getters'; export const meta = { tags: ['following', 'account'], diff --git a/src/server/api/endpoints/following/requests/cancel.ts b/src/server/api/endpoints/following/requests/cancel.ts index 37e4c73096..b69c9d2fe1 100644 --- a/src/server/api/endpoints/following/requests/cancel.ts +++ b/src/server/api/endpoints/following/requests/cancel.ts @@ -1,10 +1,10 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import cancelFollowRequest from '@/services/following/requests/cancel.js'; -import define from '../../../define.js'; -import { ApiError } from '../../../error.js'; -import { getUser } from '../../../common/getters.js'; -import { Users } from '@/models/index.js'; +import { ID } from '@/misc/cafy-id'; +import cancelFollowRequest from '@/services/following/requests/cancel'; +import define from '../../../define'; +import { ApiError } from '../../../error'; +import { getUser } from '../../../common/getters'; +import { Users } from '@/models/index'; export const meta = { tags: ['following', 'account'], diff --git a/src/server/api/endpoints/following/requests/list.ts b/src/server/api/endpoints/following/requests/list.ts index 1d6880d35d..84440ccac7 100644 --- a/src/server/api/endpoints/following/requests/list.ts +++ b/src/server/api/endpoints/following/requests/list.ts @@ -1,5 +1,5 @@ -import define from '../../../define.js'; -import { FollowRequests } from '@/models/index.js'; +import define from '../../../define'; +import { FollowRequests } from '@/models/index'; export const meta = { tags: ['following', 'account'], diff --git a/src/server/api/endpoints/following/requests/reject.ts b/src/server/api/endpoints/following/requests/reject.ts index 5e41473545..620324361f 100644 --- a/src/server/api/endpoints/following/requests/reject.ts +++ b/src/server/api/endpoints/following/requests/reject.ts @@ -1,9 +1,9 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import rejectFollowRequest from '@/services/following/requests/reject.js'; -import define from '../../../define.js'; -import { ApiError } from '../../../error.js'; -import { getUser } from '../../../common/getters.js'; +import { ID } from '@/misc/cafy-id'; +import rejectFollowRequest from '@/services/following/requests/reject'; +import define from '../../../define'; +import { ApiError } from '../../../error'; +import { getUser } from '../../../common/getters'; export const meta = { tags: ['following', 'account'], diff --git a/src/server/api/endpoints/gallery/featured.ts b/src/server/api/endpoints/gallery/featured.ts index 6e8118850c..30ef8cedec 100644 --- a/src/server/api/endpoints/gallery/featured.ts +++ b/src/server/api/endpoints/gallery/featured.ts @@ -1,5 +1,5 @@ -import define from '../../define.js'; -import { GalleryPosts } from '@/models/index.js'; +import define from '../../define'; +import { GalleryPosts } from '@/models/index'; export const meta = { tags: ['gallery'], diff --git a/src/server/api/endpoints/gallery/popular.ts b/src/server/api/endpoints/gallery/popular.ts index 6c3db479c3..18449b9654 100644 --- a/src/server/api/endpoints/gallery/popular.ts +++ b/src/server/api/endpoints/gallery/popular.ts @@ -1,5 +1,5 @@ -import define from '../../define.js'; -import { GalleryPosts } from '@/models/index.js'; +import define from '../../define'; +import { GalleryPosts } from '@/models/index'; export const meta = { tags: ['gallery'], diff --git a/src/server/api/endpoints/gallery/posts.ts b/src/server/api/endpoints/gallery/posts.ts index 625070ca29..53d3236d2d 100644 --- a/src/server/api/endpoints/gallery/posts.ts +++ b/src/server/api/endpoints/gallery/posts.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { makePaginationQuery } from '../../common/make-pagination-query.js'; -import { GalleryPosts } from '@/models/index.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { makePaginationQuery } from '../../common/make-pagination-query'; +import { GalleryPosts } from '@/models/index'; export const meta = { tags: ['gallery'], diff --git a/src/server/api/endpoints/gallery/posts/create.ts b/src/server/api/endpoints/gallery/posts/create.ts index e1c7345171..38b487e6ea 100644 --- a/src/server/api/endpoints/gallery/posts/create.ts +++ b/src/server/api/endpoints/gallery/posts/create.ts @@ -1,12 +1,12 @@ import $ from 'cafy'; import * as ms from 'ms'; -import define from '../../../define.js'; -import { ID } from '../../../../../misc/cafy-id.js'; -import { DriveFiles, GalleryPosts } from '@/models/index.js'; -import { genId } from '../../../../../misc/gen-id.js'; -import { GalleryPost } from '@/models/entities/gallery-post.js'; -import { ApiError } from '../../../error.js'; -import { DriveFile } from '@/models/entities/drive-file.js'; +import define from '../../../define'; +import { ID } from '../../../../../misc/cafy-id'; +import { DriveFiles, GalleryPosts } from '@/models/index'; +import { genId } from '../../../../../misc/gen-id'; +import { GalleryPost } from '@/models/entities/gallery-post'; +import { ApiError } from '../../../error'; +import { DriveFile } from '@/models/entities/drive-file'; export const meta = { tags: ['gallery'], diff --git a/src/server/api/endpoints/gallery/posts/delete.ts b/src/server/api/endpoints/gallery/posts/delete.ts index 65819206c8..e5b7c07f2f 100644 --- a/src/server/api/endpoints/gallery/posts/delete.ts +++ b/src/server/api/endpoints/gallery/posts/delete.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import define from '../../../define.js'; -import { ApiError } from '../../../error.js'; -import { GalleryPosts } from '@/models/index.js'; -import { ID } from '@/misc/cafy-id.js'; +import define from '../../../define'; +import { ApiError } from '../../../error'; +import { GalleryPosts } from '@/models/index'; +import { ID } from '@/misc/cafy-id'; export const meta = { tags: ['gallery'], diff --git a/src/server/api/endpoints/gallery/posts/like.ts b/src/server/api/endpoints/gallery/posts/like.ts index 80ec1b8745..81a25c0ad1 100644 --- a/src/server/api/endpoints/gallery/posts/like.ts +++ b/src/server/api/endpoints/gallery/posts/like.ts @@ -1,9 +1,9 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../../define.js'; -import { ApiError } from '../../../error.js'; -import { GalleryPosts, GalleryLikes } from '@/models/index.js'; -import { genId } from '@/misc/gen-id.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../../define'; +import { ApiError } from '../../../error'; +import { GalleryPosts, GalleryLikes } from '@/models/index'; +import { genId } from '@/misc/gen-id'; export const meta = { tags: ['gallery'], diff --git a/src/server/api/endpoints/gallery/posts/show.ts b/src/server/api/endpoints/gallery/posts/show.ts index 777fb76e3a..93852a5f8d 100644 --- a/src/server/api/endpoints/gallery/posts/show.ts +++ b/src/server/api/endpoints/gallery/posts/show.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../../define.js'; -import { ApiError } from '../../../error.js'; -import { GalleryPosts } from '@/models/index.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../../define'; +import { ApiError } from '../../../error'; +import { GalleryPosts } from '@/models/index'; export const meta = { tags: ['gallery'], diff --git a/src/server/api/endpoints/gallery/posts/unlike.ts b/src/server/api/endpoints/gallery/posts/unlike.ts index 1ddafcec90..0347cdf79e 100644 --- a/src/server/api/endpoints/gallery/posts/unlike.ts +++ b/src/server/api/endpoints/gallery/posts/unlike.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../../define.js'; -import { ApiError } from '../../../error.js'; -import { GalleryPosts, GalleryLikes } from '@/models/index.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../../define'; +import { ApiError } from '../../../error'; +import { GalleryPosts, GalleryLikes } from '@/models/index'; export const meta = { tags: ['gallery'], diff --git a/src/server/api/endpoints/gallery/posts/update.ts b/src/server/api/endpoints/gallery/posts/update.ts index 5906f29e86..54eea130d3 100644 --- a/src/server/api/endpoints/gallery/posts/update.ts +++ b/src/server/api/endpoints/gallery/posts/update.ts @@ -1,11 +1,11 @@ import $ from 'cafy'; import * as ms from 'ms'; -import define from '../../../define.js'; -import { ID } from '../../../../../misc/cafy-id.js'; -import { DriveFiles, GalleryPosts } from '@/models/index.js'; -import { GalleryPost } from '@/models/entities/gallery-post.js'; -import { ApiError } from '../../../error.js'; -import { DriveFile } from '@/models/entities/drive-file.js'; +import define from '../../../define'; +import { ID } from '../../../../../misc/cafy-id'; +import { DriveFiles, GalleryPosts } from '@/models/index'; +import { GalleryPost } from '@/models/entities/gallery-post'; +import { ApiError } from '../../../error'; +import { DriveFile } from '@/models/entities/drive-file'; export const meta = { tags: ['gallery'], diff --git a/src/server/api/endpoints/games/reversi/games.ts b/src/server/api/endpoints/games/reversi/games.ts index d62a039e16..4db9ecb69f 100644 --- a/src/server/api/endpoints/games/reversi/games.ts +++ b/src/server/api/endpoints/games/reversi/games.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../../define.js'; -import { ReversiGames } from '@/models/index.js'; -import { makePaginationQuery } from '../../../common/make-pagination-query.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../../define'; +import { ReversiGames } from '@/models/index'; +import { makePaginationQuery } from '../../../common/make-pagination-query'; import { Brackets } from 'typeorm'; export const meta = { diff --git a/src/server/api/endpoints/games/reversi/games/show.ts b/src/server/api/endpoints/games/reversi/games/show.ts index 02da583f47..93afffdb1f 100644 --- a/src/server/api/endpoints/games/reversi/games/show.ts +++ b/src/server/api/endpoints/games/reversi/games/show.ts @@ -1,9 +1,9 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import Reversi from '../../../../../../games/reversi/core.js'; -import define from '../../../../define.js'; -import { ApiError } from '../../../../error.js'; -import { ReversiGames } from '@/models/index.js'; +import { ID } from '@/misc/cafy-id'; +import Reversi from '../../../../../../games/reversi/core'; +import define from '../../../../define'; +import { ApiError } from '../../../../error'; +import { ReversiGames } from '@/models/index'; export const meta = { tags: ['games'], diff --git a/src/server/api/endpoints/games/reversi/games/surrender.ts b/src/server/api/endpoints/games/reversi/games/surrender.ts index 371d2475f3..00d58b19e3 100644 --- a/src/server/api/endpoints/games/reversi/games/surrender.ts +++ b/src/server/api/endpoints/games/reversi/games/surrender.ts @@ -1,9 +1,9 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import { publishReversiGameStream } from '@/services/stream.js'; -import define from '../../../../define.js'; -import { ApiError } from '../../../../error.js'; -import { ReversiGames } from '@/models/index.js'; +import { ID } from '@/misc/cafy-id'; +import { publishReversiGameStream } from '@/services/stream'; +import define from '../../../../define'; +import { ApiError } from '../../../../error'; +import { ReversiGames } from '@/models/index'; export const meta = { tags: ['games'], diff --git a/src/server/api/endpoints/games/reversi/invitations.ts b/src/server/api/endpoints/games/reversi/invitations.ts index 5745ba566e..c8629377b2 100644 --- a/src/server/api/endpoints/games/reversi/invitations.ts +++ b/src/server/api/endpoints/games/reversi/invitations.ts @@ -1,5 +1,5 @@ -import define from '../../../define.js'; -import { ReversiMatchings } from '@/models/index.js'; +import define from '../../../define'; +import { ReversiMatchings } from '@/models/index'; export const meta = { tags: ['games'], diff --git a/src/server/api/endpoints/games/reversi/match.ts b/src/server/api/endpoints/games/reversi/match.ts index e02d11f4eb..5ceb16c7d7 100644 --- a/src/server/api/endpoints/games/reversi/match.ts +++ b/src/server/api/endpoints/games/reversi/match.ts @@ -1,14 +1,14 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import { publishMainStream, publishReversiStream } from '@/services/stream.js'; -import { eighteight } from '../../../../../games/reversi/maps.js'; -import define from '../../../define.js'; -import { ApiError } from '../../../error.js'; -import { getUser } from '../../../common/getters.js'; -import { genId } from '@/misc/gen-id.js'; -import { ReversiMatchings, ReversiGames } from '@/models/index.js'; -import { ReversiGame } from '@/models/entities/games/reversi/game.js'; -import { ReversiMatching } from '@/models/entities/games/reversi/matching.js'; +import { ID } from '@/misc/cafy-id'; +import { publishMainStream, publishReversiStream } from '@/services/stream'; +import { eighteight } from '../../../../../games/reversi/maps'; +import define from '../../../define'; +import { ApiError } from '../../../error'; +import { getUser } from '../../../common/getters'; +import { genId } from '@/misc/gen-id'; +import { ReversiMatchings, ReversiGames } from '@/models/index'; +import { ReversiGame } from '@/models/entities/games/reversi/game'; +import { ReversiMatching } from '@/models/entities/games/reversi/matching'; export const meta = { tags: ['games'], diff --git a/src/server/api/endpoints/games/reversi/match/cancel.ts b/src/server/api/endpoints/games/reversi/match/cancel.ts index 2e5c086572..e4a138bb87 100644 --- a/src/server/api/endpoints/games/reversi/match/cancel.ts +++ b/src/server/api/endpoints/games/reversi/match/cancel.ts @@ -1,5 +1,5 @@ -import define from '../../../../define.js'; -import { ReversiMatchings } from '@/models/index.js'; +import define from '../../../../define'; +import { ReversiMatchings } from '@/models/index'; export const meta = { tags: ['games'], diff --git a/src/server/api/endpoints/get-online-users-count.ts b/src/server/api/endpoints/get-online-users-count.ts index 00b838ddcd..5c80d588d3 100644 --- a/src/server/api/endpoints/get-online-users-count.ts +++ b/src/server/api/endpoints/get-online-users-count.ts @@ -1,7 +1,7 @@ -import { USER_ONLINE_THRESHOLD } from '@/const.js'; -import { Users } from '@/models/index.js'; +import { USER_ONLINE_THRESHOLD } from '@/const'; +import { Users } from '@/models/index'; import { MoreThan } from 'typeorm'; -import define from '../define.js'; +import define from '../define'; export const meta = { tags: ['meta'], diff --git a/src/server/api/endpoints/hashtags/list.ts b/src/server/api/endpoints/hashtags/list.ts index 0453b0acf8..821016a50c 100644 --- a/src/server/api/endpoints/hashtags/list.ts +++ b/src/server/api/endpoints/hashtags/list.ts @@ -1,6 +1,6 @@ import $ from 'cafy'; -import define from '../../define.js'; -import { Hashtags } from '@/models/index.js'; +import define from '../../define'; +import { Hashtags } from '@/models/index'; export const meta = { tags: ['hashtags'], diff --git a/src/server/api/endpoints/hashtags/search.ts b/src/server/api/endpoints/hashtags/search.ts index 025023f54e..fd0cac3983 100644 --- a/src/server/api/endpoints/hashtags/search.ts +++ b/src/server/api/endpoints/hashtags/search.ts @@ -1,6 +1,6 @@ import $ from 'cafy'; -import define from '../../define.js'; -import { Hashtags } from '@/models/index.js'; +import define from '../../define'; +import { Hashtags } from '@/models/index'; export const meta = { tags: ['hashtags'], diff --git a/src/server/api/endpoints/hashtags/show.ts b/src/server/api/endpoints/hashtags/show.ts index 50f330fef1..f22edbfffd 100644 --- a/src/server/api/endpoints/hashtags/show.ts +++ b/src/server/api/endpoints/hashtags/show.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import define from '../../define.js'; -import { ApiError } from '../../error.js'; -import { Hashtags } from '@/models/index.js'; -import { normalizeForSearch } from '@/misc/normalize-for-search.js'; +import define from '../../define'; +import { ApiError } from '../../error'; +import { Hashtags } from '@/models/index'; +import { normalizeForSearch } from '@/misc/normalize-for-search'; export const meta = { tags: ['hashtags'], diff --git a/src/server/api/endpoints/hashtags/trend.ts b/src/server/api/endpoints/hashtags/trend.ts index 21ac69057b..3d67241ab6 100644 --- a/src/server/api/endpoints/hashtags/trend.ts +++ b/src/server/api/endpoints/hashtags/trend.ts @@ -1,10 +1,10 @@ import { Brackets } from 'typeorm'; -import define from '../../define.js'; -import { fetchMeta } from '@/misc/fetch-meta.js'; -import { Notes } from '@/models/index.js'; -import { Note } from '@/models/entities/note.js'; -import { safeForSql } from '@/misc/safe-for-sql.js'; -import { normalizeForSearch } from '@/misc/normalize-for-search.js'; +import define from '../../define'; +import { fetchMeta } from '@/misc/fetch-meta'; +import { Notes } from '@/models/index'; +import { Note } from '@/models/entities/note'; +import { safeForSql } from '@/misc/safe-for-sql'; +import { normalizeForSearch } from '@/misc/normalize-for-search'; /* トレンドに載るためには「『直近a分間のユニーク投稿数が今からa分前~今からb分前の間のユニーク投稿数のn倍以上』のハッシュタグの上位5位以内に入る」ことが必要 diff --git a/src/server/api/endpoints/hashtags/users.ts b/src/server/api/endpoints/hashtags/users.ts index 2ddf066e90..8c8cd1510b 100644 --- a/src/server/api/endpoints/hashtags/users.ts +++ b/src/server/api/endpoints/hashtags/users.ts @@ -1,7 +1,7 @@ import $ from 'cafy'; -import define from '../../define.js'; -import { Users } from '@/models/index.js'; -import { normalizeForSearch } from '@/misc/normalize-for-search.js'; +import define from '../../define'; +import { Users } from '@/models/index'; +import { normalizeForSearch } from '@/misc/normalize-for-search'; export const meta = { requireCredential: false as const, diff --git a/src/server/api/endpoints/i.ts b/src/server/api/endpoints/i.ts index 12b97e9911..0568a962d8 100644 --- a/src/server/api/endpoints/i.ts +++ b/src/server/api/endpoints/i.ts @@ -1,5 +1,5 @@ -import define from '../define.js'; -import { Users } from '@/models/index.js'; +import define from '../define'; +import { Users } from '@/models/index'; export const meta = { tags: ['account'], diff --git a/src/server/api/endpoints/i/2fa/done.ts b/src/server/api/endpoints/i/2fa/done.ts index 1c1f0557da..2bd2128cce 100644 --- a/src/server/api/endpoints/i/2fa/done.ts +++ b/src/server/api/endpoints/i/2fa/done.ts @@ -1,7 +1,7 @@ import $ from 'cafy'; import * as speakeasy from 'speakeasy'; -import define from '../../../define.js'; -import { UserProfiles } from '@/models/index.js'; +import define from '../../../define'; +import { UserProfiles } from '@/models/index'; export const meta = { requireCredential: true as const, diff --git a/src/server/api/endpoints/i/2fa/key-done.ts b/src/server/api/endpoints/i/2fa/key-done.ts index ea9976bd56..b4d3af235a 100644 --- a/src/server/api/endpoints/i/2fa/key-done.ts +++ b/src/server/api/endpoints/i/2fa/key-done.ts @@ -2,16 +2,16 @@ import $ from 'cafy'; import * as bcrypt from 'bcryptjs'; import { promisify } from 'util'; import * as cbor from 'cbor'; -import define from '../../../define.js'; +import define from '../../../define'; import { UserProfiles, UserSecurityKeys, AttestationChallenges, Users -} from '@/models/index.js'; -import config from '@/config/index.js'; -import { procedures, hash } from '../../../2fa.js'; -import { publishMainStream } from '@/services/stream.js'; +} from '@/models/index'; +import config from '@/config/index'; +import { procedures, hash } from '../../../2fa'; +import { publishMainStream } from '@/services/stream'; const cborDecodeFirst = promisify(cbor.decodeFirst) as any; diff --git a/src/server/api/endpoints/i/2fa/password-less.ts b/src/server/api/endpoints/i/2fa/password-less.ts index b62ba25b98..064828b638 100644 --- a/src/server/api/endpoints/i/2fa/password-less.ts +++ b/src/server/api/endpoints/i/2fa/password-less.ts @@ -1,6 +1,6 @@ import $ from 'cafy'; -import define from '../../../define.js'; -import { UserProfiles } from '@/models/index.js'; +import define from '../../../define'; +import { UserProfiles } from '@/models/index'; export const meta = { requireCredential: true as const, diff --git a/src/server/api/endpoints/i/2fa/register-key.ts b/src/server/api/endpoints/i/2fa/register-key.ts index 12e0afd93e..1b385a10ee 100644 --- a/src/server/api/endpoints/i/2fa/register-key.ts +++ b/src/server/api/endpoints/i/2fa/register-key.ts @@ -1,11 +1,11 @@ import $ from 'cafy'; import * as bcrypt from 'bcryptjs'; -import define from '../../../define.js'; -import { UserProfiles, AttestationChallenges } from '@/models/index.js'; +import define from '../../../define'; +import { UserProfiles, AttestationChallenges } from '@/models/index'; import { promisify } from 'util'; import * as crypto from 'crypto'; -import { genId } from '@/misc/gen-id.js'; -import { hash } from '../../../2fa.js'; +import { genId } from '@/misc/gen-id'; +import { hash } from '../../../2fa'; const randomBytes = promisify(crypto.randomBytes); diff --git a/src/server/api/endpoints/i/2fa/register.ts b/src/server/api/endpoints/i/2fa/register.ts index 7a3a6ec4cf..b03b98188a 100644 --- a/src/server/api/endpoints/i/2fa/register.ts +++ b/src/server/api/endpoints/i/2fa/register.ts @@ -2,9 +2,9 @@ import $ from 'cafy'; import * as bcrypt from 'bcryptjs'; import * as speakeasy from 'speakeasy'; import * as QRCode from 'qrcode'; -import config from '@/config/index.js'; -import define from '../../../define.js'; -import { UserProfiles } from '@/models/index.js'; +import config from '@/config/index'; +import define from '../../../define'; +import { UserProfiles } from '@/models/index'; export const meta = { requireCredential: true as const, diff --git a/src/server/api/endpoints/i/2fa/remove-key.ts b/src/server/api/endpoints/i/2fa/remove-key.ts index 2c74a8a856..dea56301ab 100644 --- a/src/server/api/endpoints/i/2fa/remove-key.ts +++ b/src/server/api/endpoints/i/2fa/remove-key.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; import * as bcrypt from 'bcryptjs'; -import define from '../../../define.js'; -import { UserProfiles, UserSecurityKeys, Users } from '@/models/index.js'; -import { publishMainStream } from '@/services/stream.js'; +import define from '../../../define'; +import { UserProfiles, UserSecurityKeys, Users } from '@/models/index'; +import { publishMainStream } from '@/services/stream'; export const meta = { requireCredential: true as const, diff --git a/src/server/api/endpoints/i/2fa/unregister.ts b/src/server/api/endpoints/i/2fa/unregister.ts index 47f6c0f876..af53033daa 100644 --- a/src/server/api/endpoints/i/2fa/unregister.ts +++ b/src/server/api/endpoints/i/2fa/unregister.ts @@ -1,7 +1,7 @@ import $ from 'cafy'; import * as bcrypt from 'bcryptjs'; -import define from '../../../define.js'; -import { UserProfiles } from '@/models/index.js'; +import define from '../../../define'; +import { UserProfiles } from '@/models/index'; export const meta = { requireCredential: true as const, diff --git a/src/server/api/endpoints/i/apps.ts b/src/server/api/endpoints/i/apps.ts index 3cb7038a53..994528e5c9 100644 --- a/src/server/api/endpoints/i/apps.ts +++ b/src/server/api/endpoints/i/apps.ts @@ -1,6 +1,6 @@ import $ from 'cafy'; -import define from '../../define.js'; -import { AccessTokens } from '@/models/index.js'; +import define from '../../define'; +import { AccessTokens } from '@/models/index'; export const meta = { requireCredential: true as const, diff --git a/src/server/api/endpoints/i/authorized-apps.ts b/src/server/api/endpoints/i/authorized-apps.ts index 63cb87cf09..042fcd14e8 100644 --- a/src/server/api/endpoints/i/authorized-apps.ts +++ b/src/server/api/endpoints/i/authorized-apps.ts @@ -1,6 +1,6 @@ import $ from 'cafy'; -import define from '../../define.js'; -import { AccessTokens, Apps } from '@/models/index.js'; +import define from '../../define'; +import { AccessTokens, Apps } from '@/models/index'; export const meta = { requireCredential: true as const, diff --git a/src/server/api/endpoints/i/change-password.ts b/src/server/api/endpoints/i/change-password.ts index 545df032cd..7ea5f8c488 100644 --- a/src/server/api/endpoints/i/change-password.ts +++ b/src/server/api/endpoints/i/change-password.ts @@ -1,7 +1,7 @@ import $ from 'cafy'; import * as bcrypt from 'bcryptjs'; -import define from '../../define.js'; -import { UserProfiles } from '@/models/index.js'; +import define from '../../define'; +import { UserProfiles } from '@/models/index'; export const meta = { requireCredential: true as const, diff --git a/src/server/api/endpoints/i/delete-account.ts b/src/server/api/endpoints/i/delete-account.ts index 02c03e5ba0..f761e5cc34 100644 --- a/src/server/api/endpoints/i/delete-account.ts +++ b/src/server/api/endpoints/i/delete-account.ts @@ -1,9 +1,9 @@ import $ from 'cafy'; import * as bcrypt from 'bcryptjs'; -import define from '../../define.js'; -import { Users, UserProfiles } from '@/models/index.js'; -import { doPostSuspend } from '@/services/suspend-user.js'; -import { publishUserEvent } from '@/services/stream.js'; +import define from '../../define'; +import { Users, UserProfiles } from '@/models/index'; +import { doPostSuspend } from '@/services/suspend-user'; +import { publishUserEvent } from '@/services/stream'; export const meta = { requireCredential: true as const, diff --git a/src/server/api/endpoints/i/export-blocking.ts b/src/server/api/endpoints/i/export-blocking.ts index 219fbb1ef1..e4797da0c1 100644 --- a/src/server/api/endpoints/i/export-blocking.ts +++ b/src/server/api/endpoints/i/export-blocking.ts @@ -1,5 +1,5 @@ -import define from '../../define.js'; -import { createExportBlockingJob } from '@/queue/index.js'; +import define from '../../define'; +import { createExportBlockingJob } from '@/queue/index'; import * as ms from 'ms'; export const meta = { diff --git a/src/server/api/endpoints/i/export-following.ts b/src/server/api/endpoints/i/export-following.ts index 2d6a8c2e3a..b0f154cda8 100644 --- a/src/server/api/endpoints/i/export-following.ts +++ b/src/server/api/endpoints/i/export-following.ts @@ -1,5 +1,5 @@ -import define from '../../define.js'; -import { createExportFollowingJob } from '@/queue/index.js'; +import define from '../../define'; +import { createExportFollowingJob } from '@/queue/index'; import * as ms from 'ms'; export const meta = { diff --git a/src/server/api/endpoints/i/export-mute.ts b/src/server/api/endpoints/i/export-mute.ts index a96ca1d5bb..46d547fa53 100644 --- a/src/server/api/endpoints/i/export-mute.ts +++ b/src/server/api/endpoints/i/export-mute.ts @@ -1,5 +1,5 @@ -import define from '../../define.js'; -import { createExportMuteJob } from '@/queue/index.js'; +import define from '../../define'; +import { createExportMuteJob } from '@/queue/index'; import * as ms from 'ms'; export const meta = { diff --git a/src/server/api/endpoints/i/export-notes.ts b/src/server/api/endpoints/i/export-notes.ts index ff8e02a01b..441bf16896 100644 --- a/src/server/api/endpoints/i/export-notes.ts +++ b/src/server/api/endpoints/i/export-notes.ts @@ -1,5 +1,5 @@ -import define from '../../define.js'; -import { createExportNotesJob } from '@/queue/index.js'; +import define from '../../define'; +import { createExportNotesJob } from '@/queue/index'; import * as ms from 'ms'; export const meta = { diff --git a/src/server/api/endpoints/i/export-user-lists.ts b/src/server/api/endpoints/i/export-user-lists.ts index 4554e512d3..24043a862a 100644 --- a/src/server/api/endpoints/i/export-user-lists.ts +++ b/src/server/api/endpoints/i/export-user-lists.ts @@ -1,5 +1,5 @@ -import define from '../../define.js'; -import { createExportUserListsJob } from '@/queue/index.js'; +import define from '../../define'; +import { createExportUserListsJob } from '@/queue/index'; import * as ms from 'ms'; export const meta = { diff --git a/src/server/api/endpoints/i/favorites.ts b/src/server/api/endpoints/i/favorites.ts index 99ce45e9b5..b79d68ae73 100644 --- a/src/server/api/endpoints/i/favorites.ts +++ b/src/server/api/endpoints/i/favorites.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { NoteFavorites } from '@/models/index.js'; -import { makePaginationQuery } from '../../common/make-pagination-query.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { NoteFavorites } from '@/models/index'; +import { makePaginationQuery } from '../../common/make-pagination-query'; export const meta = { tags: ['account', 'notes', 'favorites'], diff --git a/src/server/api/endpoints/i/gallery/likes.ts b/src/server/api/endpoints/i/gallery/likes.ts index 0ddcdad5b9..7a2935a5ec 100644 --- a/src/server/api/endpoints/i/gallery/likes.ts +++ b/src/server/api/endpoints/i/gallery/likes.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../../define.js'; -import { GalleryLikes } from '@/models/index.js'; -import { makePaginationQuery } from '../../../common/make-pagination-query.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../../define'; +import { GalleryLikes } from '@/models/index'; +import { makePaginationQuery } from '../../../common/make-pagination-query'; export const meta = { tags: ['account', 'gallery'], diff --git a/src/server/api/endpoints/i/gallery/posts.ts b/src/server/api/endpoints/i/gallery/posts.ts index 74518c792c..21bb8759fc 100644 --- a/src/server/api/endpoints/i/gallery/posts.ts +++ b/src/server/api/endpoints/i/gallery/posts.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../../define.js'; -import { GalleryPosts } from '@/models/index.js'; -import { makePaginationQuery } from '../../../common/make-pagination-query.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../../define'; +import { GalleryPosts } from '@/models/index'; +import { makePaginationQuery } from '../../../common/make-pagination-query'; export const meta = { tags: ['account', 'gallery'], diff --git a/src/server/api/endpoints/i/get-word-muted-notes-count.ts b/src/server/api/endpoints/i/get-word-muted-notes-count.ts index a18a5c779b..6b9be98582 100644 --- a/src/server/api/endpoints/i/get-word-muted-notes-count.ts +++ b/src/server/api/endpoints/i/get-word-muted-notes-count.ts @@ -1,5 +1,5 @@ -import define from '../../define.js'; -import { MutedNotes } from '@/models/index.js'; +import define from '../../define'; +import { MutedNotes } from '@/models/index'; export const meta = { tags: ['account'], diff --git a/src/server/api/endpoints/i/import-following.ts b/src/server/api/endpoints/i/import-following.ts index bb4558cc5c..b3de397661 100644 --- a/src/server/api/endpoints/i/import-following.ts +++ b/src/server/api/endpoints/i/import-following.ts @@ -1,10 +1,10 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { createImportFollowingJob } from '@/queue/index.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { createImportFollowingJob } from '@/queue/index'; import * as ms from 'ms'; -import { ApiError } from '../../error.js'; -import { DriveFiles } from '@/models/index.js'; +import { ApiError } from '../../error'; +import { DriveFiles } from '@/models/index'; export const meta = { secure: true, diff --git a/src/server/api/endpoints/i/import-user-lists.ts b/src/server/api/endpoints/i/import-user-lists.ts index 99465b1fed..9069a019a9 100644 --- a/src/server/api/endpoints/i/import-user-lists.ts +++ b/src/server/api/endpoints/i/import-user-lists.ts @@ -1,10 +1,10 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { createImportUserListsJob } from '@/queue/index.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { createImportUserListsJob } from '@/queue/index'; import * as ms from 'ms'; -import { ApiError } from '../../error.js'; -import { DriveFiles } from '@/models/index.js'; +import { ApiError } from '../../error'; +import { DriveFiles } from '@/models/index'; export const meta = { secure: true, diff --git a/src/server/api/endpoints/i/notifications.ts b/src/server/api/endpoints/i/notifications.ts index fb7fcea579..3c265a10c1 100644 --- a/src/server/api/endpoints/i/notifications.ts +++ b/src/server/api/endpoints/i/notifications.ts @@ -1,11 +1,11 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import { readNotification } from '../../common/read-notification.js'; -import define from '../../define.js'; -import { makePaginationQuery } from '../../common/make-pagination-query.js'; -import { Notifications, Followings, Mutings, Users } from '@/models/index.js'; -import { notificationTypes } from '../../../../types.js'; -import read from '@/services/note/read.js'; +import { ID } from '@/misc/cafy-id'; +import { readNotification } from '../../common/read-notification'; +import define from '../../define'; +import { makePaginationQuery } from '../../common/make-pagination-query'; +import { Notifications, Followings, Mutings, Users } from '@/models/index'; +import { notificationTypes } from '../../../../types'; +import read from '@/services/note/read'; export const meta = { tags: ['account', 'notifications'], diff --git a/src/server/api/endpoints/i/page-likes.ts b/src/server/api/endpoints/i/page-likes.ts index 231b029b28..fa2bc31730 100644 --- a/src/server/api/endpoints/i/page-likes.ts +++ b/src/server/api/endpoints/i/page-likes.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { PageLikes } from '@/models/index.js'; -import { makePaginationQuery } from '../../common/make-pagination-query.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { PageLikes } from '@/models/index'; +import { makePaginationQuery } from '../../common/make-pagination-query'; export const meta = { tags: ['account', 'pages'], diff --git a/src/server/api/endpoints/i/pages.ts b/src/server/api/endpoints/i/pages.ts index 1547212197..ee87fffa2d 100644 --- a/src/server/api/endpoints/i/pages.ts +++ b/src/server/api/endpoints/i/pages.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { Pages } from '@/models/index.js'; -import { makePaginationQuery } from '../../common/make-pagination-query.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { Pages } from '@/models/index'; +import { makePaginationQuery } from '../../common/make-pagination-query'; export const meta = { tags: ['account', 'pages'], diff --git a/src/server/api/endpoints/i/pin.ts b/src/server/api/endpoints/i/pin.ts index 689e1ae641..de94220ba9 100644 --- a/src/server/api/endpoints/i/pin.ts +++ b/src/server/api/endpoints/i/pin.ts @@ -1,9 +1,9 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import { addPinned } from '@/services/i/pin.js'; -import define from '../../define.js'; -import { ApiError } from '../../error.js'; -import { Users } from '@/models/index.js'; +import { ID } from '@/misc/cafy-id'; +import { addPinned } from '@/services/i/pin'; +import define from '../../define'; +import { ApiError } from '../../error'; +import { Users } from '@/models/index'; export const meta = { tags: ['account', 'notes'], diff --git a/src/server/api/endpoints/i/read-all-messaging-messages.ts b/src/server/api/endpoints/i/read-all-messaging-messages.ts index fe0e6e558a..9aca7611c9 100644 --- a/src/server/api/endpoints/i/read-all-messaging-messages.ts +++ b/src/server/api/endpoints/i/read-all-messaging-messages.ts @@ -1,6 +1,6 @@ -import { publishMainStream } from '@/services/stream.js'; -import define from '../../define.js'; -import { MessagingMessages, UserGroupJoinings } from '@/models/index.js'; +import { publishMainStream } from '@/services/stream'; +import define from '../../define'; +import { MessagingMessages, UserGroupJoinings } from '@/models/index'; export const meta = { tags: ['account', 'messaging'], diff --git a/src/server/api/endpoints/i/read-all-unread-notes.ts b/src/server/api/endpoints/i/read-all-unread-notes.ts index 635c483b75..2a7102a590 100644 --- a/src/server/api/endpoints/i/read-all-unread-notes.ts +++ b/src/server/api/endpoints/i/read-all-unread-notes.ts @@ -1,6 +1,6 @@ -import { publishMainStream } from '@/services/stream.js'; -import define from '../../define.js'; -import { NoteUnreads } from '@/models/index.js'; +import { publishMainStream } from '@/services/stream'; +import define from '../../define'; +import { NoteUnreads } from '@/models/index'; export const meta = { tags: ['account'], diff --git a/src/server/api/endpoints/i/read-announcement.ts b/src/server/api/endpoints/i/read-announcement.ts index 6a1050c05e..2f5036f953 100644 --- a/src/server/api/endpoints/i/read-announcement.ts +++ b/src/server/api/endpoints/i/read-announcement.ts @@ -1,10 +1,10 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { ApiError } from '../../error.js'; -import { genId } from '@/misc/gen-id.js'; -import { AnnouncementReads, Announcements, Users } from '@/models/index.js'; -import { publishMainStream } from '@/services/stream.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { ApiError } from '../../error'; +import { genId } from '@/misc/gen-id'; +import { AnnouncementReads, Announcements, Users } from '@/models/index'; +import { publishMainStream } from '@/services/stream'; export const meta = { tags: ['account'], diff --git a/src/server/api/endpoints/i/regenerate-token.ts b/src/server/api/endpoints/i/regenerate-token.ts index af22d53770..1cce2d37be 100644 --- a/src/server/api/endpoints/i/regenerate-token.ts +++ b/src/server/api/endpoints/i/regenerate-token.ts @@ -1,9 +1,9 @@ import $ from 'cafy'; import * as bcrypt from 'bcryptjs'; -import { publishMainStream, publishUserEvent } from '@/services/stream.js'; -import generateUserToken from '../../common/generate-native-user-token.js'; -import define from '../../define.js'; -import { Users, UserProfiles } from '@/models/index.js'; +import { publishMainStream, publishUserEvent } from '@/services/stream'; +import generateUserToken from '../../common/generate-native-user-token'; +import define from '../../define'; +import { Users, UserProfiles } from '@/models/index'; export const meta = { requireCredential: true as const, diff --git a/src/server/api/endpoints/i/registry/get-all.ts b/src/server/api/endpoints/i/registry/get-all.ts index 6d5a4ec31f..c8eaf83a25 100644 --- a/src/server/api/endpoints/i/registry/get-all.ts +++ b/src/server/api/endpoints/i/registry/get-all.ts @@ -1,6 +1,6 @@ import $ from 'cafy'; -import define from '../../../define.js'; -import { RegistryItems } from '@/models/index.js'; +import define from '../../../define'; +import { RegistryItems } from '@/models/index'; export const meta = { requireCredential: true as const, diff --git a/src/server/api/endpoints/i/registry/get-detail.ts b/src/server/api/endpoints/i/registry/get-detail.ts index 81a81b0217..992800c44c 100644 --- a/src/server/api/endpoints/i/registry/get-detail.ts +++ b/src/server/api/endpoints/i/registry/get-detail.ts @@ -1,7 +1,7 @@ import $ from 'cafy'; -import define from '../../../define.js'; -import { RegistryItems } from '@/models/index.js'; -import { ApiError } from '../../../error.js'; +import define from '../../../define'; +import { RegistryItems } from '@/models/index'; +import { ApiError } from '../../../error'; export const meta = { requireCredential: true as const, diff --git a/src/server/api/endpoints/i/registry/get.ts b/src/server/api/endpoints/i/registry/get.ts index 8bdec7986a..569c3a9280 100644 --- a/src/server/api/endpoints/i/registry/get.ts +++ b/src/server/api/endpoints/i/registry/get.ts @@ -1,7 +1,7 @@ import $ from 'cafy'; -import define from '../../../define.js'; -import { RegistryItems } from '@/models/index.js'; -import { ApiError } from '../../../error.js'; +import define from '../../../define'; +import { RegistryItems } from '@/models/index'; +import { ApiError } from '../../../error'; export const meta = { requireCredential: true as const, diff --git a/src/server/api/endpoints/i/registry/keys-with-type.ts b/src/server/api/endpoints/i/registry/keys-with-type.ts index 1aeba71fe2..16a4fee374 100644 --- a/src/server/api/endpoints/i/registry/keys-with-type.ts +++ b/src/server/api/endpoints/i/registry/keys-with-type.ts @@ -1,6 +1,6 @@ import $ from 'cafy'; -import define from '../../../define.js'; -import { RegistryItems } from '@/models/index.js'; +import define from '../../../define'; +import { RegistryItems } from '@/models/index'; export const meta = { requireCredential: true as const, diff --git a/src/server/api/endpoints/i/registry/keys.ts b/src/server/api/endpoints/i/registry/keys.ts index 1c3836d7a0..3a8aeaa195 100644 --- a/src/server/api/endpoints/i/registry/keys.ts +++ b/src/server/api/endpoints/i/registry/keys.ts @@ -1,6 +1,6 @@ import $ from 'cafy'; -import define from '../../../define.js'; -import { RegistryItems } from '@/models/index.js'; +import define from '../../../define'; +import { RegistryItems } from '@/models/index'; export const meta = { requireCredential: true as const, diff --git a/src/server/api/endpoints/i/registry/remove.ts b/src/server/api/endpoints/i/registry/remove.ts index 64cf5fbb74..07bc23d4a6 100644 --- a/src/server/api/endpoints/i/registry/remove.ts +++ b/src/server/api/endpoints/i/registry/remove.ts @@ -1,7 +1,7 @@ import $ from 'cafy'; -import define from '../../../define.js'; -import { RegistryItems } from '@/models/index.js'; -import { ApiError } from '../../../error.js'; +import define from '../../../define'; +import { RegistryItems } from '@/models/index'; +import { ApiError } from '../../../error'; export const meta = { requireCredential: true as const, diff --git a/src/server/api/endpoints/i/registry/scopes.ts b/src/server/api/endpoints/i/registry/scopes.ts index 094dfbef88..ecbdb05a8e 100644 --- a/src/server/api/endpoints/i/registry/scopes.ts +++ b/src/server/api/endpoints/i/registry/scopes.ts @@ -1,5 +1,5 @@ -import define from '../../../define.js'; -import { RegistryItems } from '@/models/index.js'; +import define from '../../../define'; +import { RegistryItems } from '@/models/index'; export const meta = { requireCredential: true as const, diff --git a/src/server/api/endpoints/i/registry/set.ts b/src/server/api/endpoints/i/registry/set.ts index 099ccd27ba..f129ee1b70 100644 --- a/src/server/api/endpoints/i/registry/set.ts +++ b/src/server/api/endpoints/i/registry/set.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import { publishMainStream } from '@/services/stream.js'; -import define from '../../../define.js'; -import { RegistryItems } from '@/models/index.js'; -import { genId } from '@/misc/gen-id.js'; +import { publishMainStream } from '@/services/stream'; +import define from '../../../define'; +import { RegistryItems } from '@/models/index'; +import { genId } from '@/misc/gen-id'; export const meta = { requireCredential: true as const, diff --git a/src/server/api/endpoints/i/revoke-token.ts b/src/server/api/endpoints/i/revoke-token.ts index 3f3a2fa939..bed868def4 100644 --- a/src/server/api/endpoints/i/revoke-token.ts +++ b/src/server/api/endpoints/i/revoke-token.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import define from '../../define.js'; -import { AccessTokens } from '@/models/index.js'; -import { ID } from '@/misc/cafy-id.js'; -import { publishUserEvent } from '@/services/stream.js'; +import define from '../../define'; +import { AccessTokens } from '@/models/index'; +import { ID } from '@/misc/cafy-id'; +import { publishUserEvent } from '@/services/stream'; export const meta = { requireCredential: true as const, diff --git a/src/server/api/endpoints/i/signin-history.ts b/src/server/api/endpoints/i/signin-history.ts index 215c7b1fc9..a2c10148c6 100644 --- a/src/server/api/endpoints/i/signin-history.ts +++ b/src/server/api/endpoints/i/signin-history.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { Signins } from '@/models/index.js'; -import { makePaginationQuery } from '../../common/make-pagination-query.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { Signins } from '@/models/index'; +import { makePaginationQuery } from '../../common/make-pagination-query'; export const meta = { requireCredential: true as const, diff --git a/src/server/api/endpoints/i/unpin.ts b/src/server/api/endpoints/i/unpin.ts index f8c451aa2e..dc79e255ab 100644 --- a/src/server/api/endpoints/i/unpin.ts +++ b/src/server/api/endpoints/i/unpin.ts @@ -1,9 +1,9 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import { removePinned } from '@/services/i/pin.js'; -import define from '../../define.js'; -import { ApiError } from '../../error.js'; -import { Users } from '@/models/index.js'; +import { ID } from '@/misc/cafy-id'; +import { removePinned } from '@/services/i/pin'; +import define from '../../define'; +import { ApiError } from '../../error'; +import { Users } from '@/models/index'; export const meta = { tags: ['account', 'notes'], diff --git a/src/server/api/endpoints/i/update-email.ts b/src/server/api/endpoints/i/update-email.ts index 142a7aa75c..14aedad88b 100644 --- a/src/server/api/endpoints/i/update-email.ts +++ b/src/server/api/endpoints/i/update-email.ts @@ -1,13 +1,13 @@ import $ from 'cafy'; -import { publishMainStream } from '@/services/stream.js'; -import define from '../../define.js'; +import { publishMainStream } from '@/services/stream'; +import define from '../../define'; import rndstr from 'rndstr'; -import config from '@/config/index.js'; +import config from '@/config/index'; import * as ms from 'ms'; import * as bcrypt from 'bcryptjs'; -import { Users, UserProfiles } from '@/models/index.js'; -import { sendEmail } from '@/services/send-email.js'; -import { ApiError } from '../../error.js'; +import { Users, UserProfiles } from '@/models/index'; +import { sendEmail } from '@/services/send-email'; +import { ApiError } from '../../error'; export const meta = { requireCredential: true as const, diff --git a/src/server/api/endpoints/i/update.ts b/src/server/api/endpoints/i/update.ts index e8881f94de..fb7e12760e 100644 --- a/src/server/api/endpoints/i/update.ts +++ b/src/server/api/endpoints/i/update.ts @@ -1,20 +1,20 @@ import $ from 'cafy'; import * as mfm from 'mfm-js'; -import { ID } from '@/misc/cafy-id.js'; -import { publishMainStream, publishUserEvent } from '@/services/stream.js'; -import acceptAllFollowRequests from '@/services/following/requests/accept-all.js'; -import { publishToFollowers } from '@/services/i/update.js'; -import define from '../../define.js'; -import { extractCustomEmojisFromMfm } from '@/misc/extract-custom-emojis-from-mfm.js'; -import { extractHashtags } from '@/misc/extract-hashtags.js'; +import { ID } from '@/misc/cafy-id'; +import { publishMainStream, publishUserEvent } from '@/services/stream'; +import acceptAllFollowRequests from '@/services/following/requests/accept-all'; +import { publishToFollowers } from '@/services/i/update'; +import define from '../../define'; +import { extractCustomEmojisFromMfm } from '@/misc/extract-custom-emojis-from-mfm'; +import { extractHashtags } from '@/misc/extract-hashtags'; import * as langmap from 'langmap'; -import { updateUsertags } from '@/services/update-hashtag.js'; -import { ApiError } from '../../error.js'; -import { Users, DriveFiles, UserProfiles, Pages } from '@/models/index.js'; -import { User } from '@/models/entities/user.js'; -import { UserProfile } from '@/models/entities/user-profile.js'; -import { notificationTypes } from '../../../../types.js'; -import { normalizeForSearch } from '@/misc/normalize-for-search.js'; +import { updateUsertags } from '@/services/update-hashtag'; +import { ApiError } from '../../error'; +import { Users, DriveFiles, UserProfiles, Pages } from '@/models/index'; +import { User } from '@/models/entities/user'; +import { UserProfile } from '@/models/entities/user-profile'; +import { notificationTypes } from '../../../../types'; +import { normalizeForSearch } from '@/misc/normalize-for-search'; export const meta = { tags: ['account'], diff --git a/src/server/api/endpoints/i/user-group-invites.ts b/src/server/api/endpoints/i/user-group-invites.ts index 57148bac5d..1ebde243ca 100644 --- a/src/server/api/endpoints/i/user-group-invites.ts +++ b/src/server/api/endpoints/i/user-group-invites.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { UserGroupInvitations } from '@/models/index.js'; -import { makePaginationQuery } from '../../common/make-pagination-query.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { UserGroupInvitations } from '@/models/index'; +import { makePaginationQuery } from '../../common/make-pagination-query'; export const meta = { tags: ['account', 'groups'], diff --git a/src/server/api/endpoints/messaging/history.ts b/src/server/api/endpoints/messaging/history.ts index 6f098a0940..e447703546 100644 --- a/src/server/api/endpoints/messaging/history.ts +++ b/src/server/api/endpoints/messaging/history.ts @@ -1,7 +1,7 @@ import $ from 'cafy'; -import define from '../../define.js'; -import { MessagingMessage } from '@/models/entities/messaging-message.js'; -import { MessagingMessages, Mutings, UserGroupJoinings } from '@/models/index.js'; +import define from '../../define'; +import { MessagingMessage } from '@/models/entities/messaging-message'; +import { MessagingMessages, Mutings, UserGroupJoinings } from '@/models/index'; import { Brackets } from 'typeorm'; export const meta = { diff --git a/src/server/api/endpoints/messaging/messages.ts b/src/server/api/endpoints/messaging/messages.ts index 3541001ae1..6baa24609e 100644 --- a/src/server/api/endpoints/messaging/messages.ts +++ b/src/server/api/endpoints/messaging/messages.ts @@ -1,12 +1,12 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { ApiError } from '../../error.js'; -import { getUser } from '../../common/getters.js'; -import { MessagingMessages, UserGroups, UserGroupJoinings, Users } from '@/models/index.js'; -import { makePaginationQuery } from '../../common/make-pagination-query.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { ApiError } from '../../error'; +import { getUser } from '../../common/getters'; +import { MessagingMessages, UserGroups, UserGroupJoinings, Users } from '@/models/index'; +import { makePaginationQuery } from '../../common/make-pagination-query'; import { Brackets } from 'typeorm'; -import { readUserMessagingMessage, readGroupMessagingMessage, deliverReadActivity } from '../../common/read-messaging-message.js'; +import { readUserMessagingMessage, readGroupMessagingMessage, deliverReadActivity } from '../../common/read-messaging-message'; export const meta = { tags: ['messaging'], diff --git a/src/server/api/endpoints/messaging/messages/create.ts b/src/server/api/endpoints/messaging/messages/create.ts index c6902dc1b6..df0b455cbe 100644 --- a/src/server/api/endpoints/messaging/messages/create.ts +++ b/src/server/api/endpoints/messaging/messages/create.ts @@ -1,12 +1,12 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../../define.js'; -import { ApiError } from '../../../error.js'; -import { getUser } from '../../../common/getters.js'; -import { MessagingMessages, DriveFiles, UserGroups, UserGroupJoinings, Blockings } from '@/models/index.js'; -import { User } from '@/models/entities/user.js'; -import { UserGroup } from '@/models/entities/user-group.js'; -import { createMessage } from '@/services/messages/create.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../../define'; +import { ApiError } from '../../../error'; +import { getUser } from '../../../common/getters'; +import { MessagingMessages, DriveFiles, UserGroups, UserGroupJoinings, Blockings } from '@/models/index'; +import { User } from '@/models/entities/user'; +import { UserGroup } from '@/models/entities/user-group'; +import { createMessage } from '@/services/messages/create'; export const meta = { tags: ['messaging'], diff --git a/src/server/api/endpoints/messaging/messages/delete.ts b/src/server/api/endpoints/messaging/messages/delete.ts index 54559560c9..bd4890fc8a 100644 --- a/src/server/api/endpoints/messaging/messages/delete.ts +++ b/src/server/api/endpoints/messaging/messages/delete.ts @@ -1,10 +1,10 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../../define.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../../define'; import * as ms from 'ms'; -import { ApiError } from '../../../error.js'; -import { MessagingMessages } from '@/models/index.js'; -import { deleteMessage } from '@/services/messages/delete.js'; +import { ApiError } from '../../../error'; +import { MessagingMessages } from '@/models/index'; +import { deleteMessage } from '@/services/messages/delete'; export const meta = { tags: ['messaging'], diff --git a/src/server/api/endpoints/messaging/messages/read.ts b/src/server/api/endpoints/messaging/messages/read.ts index ac822b6a36..a1747310d3 100644 --- a/src/server/api/endpoints/messaging/messages/read.ts +++ b/src/server/api/endpoints/messaging/messages/read.ts @@ -1,9 +1,9 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../../define.js'; -import { ApiError } from '../../../error.js'; -import { MessagingMessages } from '@/models/index.js'; -import { readUserMessagingMessage, readGroupMessagingMessage } from '../../../common/read-messaging-message.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../../define'; +import { ApiError } from '../../../error'; +import { MessagingMessages } from '@/models/index'; +import { readUserMessagingMessage, readGroupMessagingMessage } from '../../../common/read-messaging-message'; export const meta = { tags: ['messaging'], diff --git a/src/server/api/endpoints/meta.ts b/src/server/api/endpoints/meta.ts index 579e963af9..1c87952f6a 100644 --- a/src/server/api/endpoints/meta.ts +++ b/src/server/api/endpoints/meta.ts @@ -1,9 +1,9 @@ import $ from 'cafy'; -import config from '@/config/index.js'; -import define from '../define.js'; -import { fetchMeta } from '@/misc/fetch-meta.js'; -import { Ads, Emojis, Users } from '@/models/index.js'; -import { DB_MAX_NOTE_TEXT_LENGTH } from '@/misc/hard-limits.js'; +import config from '@/config/index'; +import define from '../define'; +import { fetchMeta } from '@/misc/fetch-meta'; +import { Ads, Emojis, Users } from '@/models/index'; +import { DB_MAX_NOTE_TEXT_LENGTH } from '@/misc/hard-limits'; import { MoreThan } from 'typeorm'; export const meta = { diff --git a/src/server/api/endpoints/miauth/gen-token.ts b/src/server/api/endpoints/miauth/gen-token.ts index b026d995a5..321fa42fc9 100644 --- a/src/server/api/endpoints/miauth/gen-token.ts +++ b/src/server/api/endpoints/miauth/gen-token.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import define from '../../define.js'; -import { AccessTokens } from '@/models/index.js'; -import { genId } from '@/misc/gen-id.js'; -import { secureRndstr } from '@/misc/secure-rndstr.js'; +import define from '../../define'; +import { AccessTokens } from '@/models/index'; +import { genId } from '@/misc/gen-id'; +import { secureRndstr } from '@/misc/secure-rndstr'; export const meta = { tags: ['auth'], diff --git a/src/server/api/endpoints/mute/create.ts b/src/server/api/endpoints/mute/create.ts index 5fdb21a449..5163ed63db 100644 --- a/src/server/api/endpoints/mute/create.ts +++ b/src/server/api/endpoints/mute/create.ts @@ -1,12 +1,12 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { ApiError } from '../../error.js'; -import { getUser } from '../../common/getters.js'; -import { genId } from '@/misc/gen-id.js'; -import { Mutings, NoteWatchings } from '@/models/index.js'; -import { Muting } from '@/models/entities/muting.js'; -import { publishUserEvent } from '@/services/stream.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { ApiError } from '../../error'; +import { getUser } from '../../common/getters'; +import { genId } from '@/misc/gen-id'; +import { Mutings, NoteWatchings } from '@/models/index'; +import { Muting } from '@/models/entities/muting'; +import { publishUserEvent } from '@/services/stream'; export const meta = { tags: ['account'], diff --git a/src/server/api/endpoints/mute/delete.ts b/src/server/api/endpoints/mute/delete.ts index 041e5df208..3ffd1f4562 100644 --- a/src/server/api/endpoints/mute/delete.ts +++ b/src/server/api/endpoints/mute/delete.ts @@ -1,10 +1,10 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { ApiError } from '../../error.js'; -import { getUser } from '../../common/getters.js'; -import { Mutings } from '@/models/index.js'; -import { publishUserEvent } from '@/services/stream.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { ApiError } from '../../error'; +import { getUser } from '../../common/getters'; +import { Mutings } from '@/models/index'; +import { publishUserEvent } from '@/services/stream'; export const meta = { tags: ['account'], diff --git a/src/server/api/endpoints/mute/list.ts b/src/server/api/endpoints/mute/list.ts index 0024506eb0..ae4c3a719d 100644 --- a/src/server/api/endpoints/mute/list.ts +++ b/src/server/api/endpoints/mute/list.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { makePaginationQuery } from '../../common/make-pagination-query.js'; -import { Mutings } from '@/models/index.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { makePaginationQuery } from '../../common/make-pagination-query'; +import { Mutings } from '@/models/index'; export const meta = { tags: ['account'], diff --git a/src/server/api/endpoints/my/apps.ts b/src/server/api/endpoints/my/apps.ts index 268408698b..d91562b62f 100644 --- a/src/server/api/endpoints/my/apps.ts +++ b/src/server/api/endpoints/my/apps.ts @@ -1,6 +1,6 @@ import $ from 'cafy'; -import define from '../../define.js'; -import { Apps } from '@/models/index.js'; +import define from '../../define'; +import { Apps } from '@/models/index'; export const meta = { tags: ['account', 'app'], diff --git a/src/server/api/endpoints/notes.ts b/src/server/api/endpoints/notes.ts index 6a9766d289..a3f6e187f2 100644 --- a/src/server/api/endpoints/notes.ts +++ b/src/server/api/endpoints/notes.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../define.js'; -import { makePaginationQuery } from '../common/make-pagination-query.js'; -import { Notes } from '@/models/index.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../define'; +import { makePaginationQuery } from '../common/make-pagination-query'; +import { Notes } from '@/models/index'; export const meta = { tags: ['notes'], diff --git a/src/server/api/endpoints/notes/children.ts b/src/server/api/endpoints/notes/children.ts index de17c32f51..68881fda9e 100644 --- a/src/server/api/endpoints/notes/children.ts +++ b/src/server/api/endpoints/notes/children.ts @@ -1,12 +1,12 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { makePaginationQuery } from '../../common/make-pagination-query.js'; -import { generateVisibilityQuery } from '../../common/generate-visibility-query.js'; -import { generateMutedUserQuery } from '../../common/generate-muted-user-query.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { makePaginationQuery } from '../../common/make-pagination-query'; +import { generateVisibilityQuery } from '../../common/generate-visibility-query'; +import { generateMutedUserQuery } from '../../common/generate-muted-user-query'; import { Brackets } from 'typeorm'; -import { Notes } from '@/models/index.js'; -import { generateBlockedUserQuery } from '../../common/generate-block-query.js'; +import { Notes } from '@/models/index'; +import { generateBlockedUserQuery } from '../../common/generate-block-query'; export const meta = { tags: ['notes'], diff --git a/src/server/api/endpoints/notes/clips.ts b/src/server/api/endpoints/notes/clips.ts index c3360d6f22..6b303d87ec 100644 --- a/src/server/api/endpoints/notes/clips.ts +++ b/src/server/api/endpoints/notes/clips.ts @@ -1,9 +1,9 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { ClipNotes, Clips } from '@/models/index.js'; -import { getNote } from '../../common/getters.js'; -import { ApiError } from '../../error.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { ClipNotes, Clips } from '@/models/index'; +import { getNote } from '../../common/getters'; +import { ApiError } from '../../error'; import { In } from 'typeorm'; export const meta = { diff --git a/src/server/api/endpoints/notes/conversation.ts b/src/server/api/endpoints/notes/conversation.ts index adf4ca2e10..0fe323ea00 100644 --- a/src/server/api/endpoints/notes/conversation.ts +++ b/src/server/api/endpoints/notes/conversation.ts @@ -1,10 +1,10 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { ApiError } from '../../error.js'; -import { getNote } from '../../common/getters.js'; -import { Note } from '@/models/entities/note.js'; -import { Notes } from '@/models/index.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { ApiError } from '../../error'; +import { getNote } from '../../common/getters'; +import { Note } from '@/models/entities/note'; +import { Notes } from '@/models/index'; export const meta = { tags: ['notes'], diff --git a/src/server/api/endpoints/notes/create.ts b/src/server/api/endpoints/notes/create.ts index 8c2db5213e..751673f955 100644 --- a/src/server/api/endpoints/notes/create.ts +++ b/src/server/api/endpoints/notes/create.ts @@ -1,18 +1,18 @@ import $ from 'cafy'; import * as ms from 'ms'; import { length } from 'stringz'; -import create from '@/services/note/create.js'; -import define from '../../define.js'; -import { fetchMeta } from '@/misc/fetch-meta.js'; -import { ApiError } from '../../error.js'; -import { ID } from '@/misc/cafy-id.js'; -import { User } from '@/models/entities/user.js'; -import { Users, DriveFiles, Notes, Channels, Blockings } from '@/models/index.js'; -import { DriveFile } from '@/models/entities/drive-file.js'; -import { Note } from '@/models/entities/note.js'; -import { DB_MAX_NOTE_TEXT_LENGTH } from '@/misc/hard-limits.js'; -import { noteVisibilities } from '../../../../types.js'; -import { Channel } from '@/models/entities/channel.js'; +import create from '@/services/note/create'; +import define from '../../define'; +import { fetchMeta } from '@/misc/fetch-meta'; +import { ApiError } from '../../error'; +import { ID } from '@/misc/cafy-id'; +import { User } from '@/models/entities/user'; +import { Users, DriveFiles, Notes, Channels, Blockings } from '@/models/index'; +import { DriveFile } from '@/models/entities/drive-file'; +import { Note } from '@/models/entities/note'; +import { DB_MAX_NOTE_TEXT_LENGTH } from '@/misc/hard-limits'; +import { noteVisibilities } from '../../../../types'; +import { Channel } from '@/models/entities/channel'; let maxNoteTextLength = 500; diff --git a/src/server/api/endpoints/notes/delete.ts b/src/server/api/endpoints/notes/delete.ts index e66718001b..7163a2b9d2 100644 --- a/src/server/api/endpoints/notes/delete.ts +++ b/src/server/api/endpoints/notes/delete.ts @@ -1,11 +1,11 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import deleteNote from '@/services/note/delete.js'; -import define from '../../define.js'; +import { ID } from '@/misc/cafy-id'; +import deleteNote from '@/services/note/delete'; +import define from '../../define'; import * as ms from 'ms'; -import { getNote } from '../../common/getters.js'; -import { ApiError } from '../../error.js'; -import { Users } from '@/models/index.js'; +import { getNote } from '../../common/getters'; +import { ApiError } from '../../error'; +import { Users } from '@/models/index'; export const meta = { tags: ['notes'], diff --git a/src/server/api/endpoints/notes/favorites/create.ts b/src/server/api/endpoints/notes/favorites/create.ts index f406d6238a..1bb25edd7f 100644 --- a/src/server/api/endpoints/notes/favorites/create.ts +++ b/src/server/api/endpoints/notes/favorites/create.ts @@ -1,10 +1,10 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../../define.js'; -import { ApiError } from '../../../error.js'; -import { getNote } from '../../../common/getters.js'; -import { NoteFavorites } from '@/models/index.js'; -import { genId } from '@/misc/gen-id.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../../define'; +import { ApiError } from '../../../error'; +import { getNote } from '../../../common/getters'; +import { NoteFavorites } from '@/models/index'; +import { genId } from '@/misc/gen-id'; export const meta = { tags: ['notes', 'favorites'], diff --git a/src/server/api/endpoints/notes/favorites/delete.ts b/src/server/api/endpoints/notes/favorites/delete.ts index 624cf18948..75eb9a359a 100644 --- a/src/server/api/endpoints/notes/favorites/delete.ts +++ b/src/server/api/endpoints/notes/favorites/delete.ts @@ -1,9 +1,9 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../../define.js'; -import { ApiError } from '../../../error.js'; -import { getNote } from '../../../common/getters.js'; -import { NoteFavorites } from '@/models/index.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../../define'; +import { ApiError } from '../../../error'; +import { getNote } from '../../../common/getters'; +import { NoteFavorites } from '@/models/index'; export const meta = { tags: ['notes', 'favorites'], diff --git a/src/server/api/endpoints/notes/featured.ts b/src/server/api/endpoints/notes/featured.ts index aa8a8c09aa..8d33c0e73d 100644 --- a/src/server/api/endpoints/notes/featured.ts +++ b/src/server/api/endpoints/notes/featured.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import define from '../../define.js'; -import { generateMutedUserQuery } from '../../common/generate-muted-user-query.js'; -import { Notes } from '@/models/index.js'; -import { generateBlockedUserQuery } from '../../common/generate-block-query.js'; +import define from '../../define'; +import { generateMutedUserQuery } from '../../common/generate-muted-user-query'; +import { Notes } from '@/models/index'; +import { generateBlockedUserQuery } from '../../common/generate-block-query'; export const meta = { tags: ['notes'], diff --git a/src/server/api/endpoints/notes/global-timeline.ts b/src/server/api/endpoints/notes/global-timeline.ts index ae2408ef40..5902c0415c 100644 --- a/src/server/api/endpoints/notes/global-timeline.ts +++ b/src/server/api/endpoints/notes/global-timeline.ts @@ -1,15 +1,15 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { fetchMeta } from '@/misc/fetch-meta.js'; -import { ApiError } from '../../error.js'; -import { makePaginationQuery } from '../../common/make-pagination-query.js'; -import { Notes } from '@/models/index.js'; -import { generateMutedUserQuery } from '../../common/generate-muted-user-query.js'; -import { activeUsersChart } from '@/services/chart/index.js'; -import { generateRepliesQuery } from '../../common/generate-replies-query.js'; -import { generateMutedNoteQuery } from '../../common/generate-muted-note-query.js'; -import { generateBlockedUserQuery } from '../../common/generate-block-query.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { fetchMeta } from '@/misc/fetch-meta'; +import { ApiError } from '../../error'; +import { makePaginationQuery } from '../../common/make-pagination-query'; +import { Notes } from '@/models/index'; +import { generateMutedUserQuery } from '../../common/generate-muted-user-query'; +import { activeUsersChart } from '@/services/chart/index'; +import { generateRepliesQuery } from '../../common/generate-replies-query'; +import { generateMutedNoteQuery } from '../../common/generate-muted-note-query'; +import { generateBlockedUserQuery } from '../../common/generate-block-query'; export const meta = { tags: ['notes'], diff --git a/src/server/api/endpoints/notes/hybrid-timeline.ts b/src/server/api/endpoints/notes/hybrid-timeline.ts index 4bebeab998..47f08f208b 100644 --- a/src/server/api/endpoints/notes/hybrid-timeline.ts +++ b/src/server/api/endpoints/notes/hybrid-timeline.ts @@ -1,18 +1,18 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { fetchMeta } from '@/misc/fetch-meta.js'; -import { ApiError } from '../../error.js'; -import { makePaginationQuery } from '../../common/make-pagination-query.js'; -import { Followings, Notes } from '@/models/index.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { fetchMeta } from '@/misc/fetch-meta'; +import { ApiError } from '../../error'; +import { makePaginationQuery } from '../../common/make-pagination-query'; +import { Followings, Notes } from '@/models/index'; import { Brackets } from 'typeorm'; -import { generateVisibilityQuery } from '../../common/generate-visibility-query.js'; -import { generateMutedUserQuery } from '../../common/generate-muted-user-query.js'; -import { activeUsersChart } from '@/services/chart/index.js'; -import { generateRepliesQuery } from '../../common/generate-replies-query.js'; -import { generateMutedNoteQuery } from '../../common/generate-muted-note-query.js'; -import { generateChannelQuery } from '../../common/generate-channel-query.js'; -import { generateBlockedUserQuery } from '../../common/generate-block-query.js'; +import { generateVisibilityQuery } from '../../common/generate-visibility-query'; +import { generateMutedUserQuery } from '../../common/generate-muted-user-query'; +import { activeUsersChart } from '@/services/chart/index'; +import { generateRepliesQuery } from '../../common/generate-replies-query'; +import { generateMutedNoteQuery } from '../../common/generate-muted-note-query'; +import { generateChannelQuery } from '../../common/generate-channel-query'; +import { generateBlockedUserQuery } from '../../common/generate-block-query'; export const meta = { tags: ['notes'], diff --git a/src/server/api/endpoints/notes/local-timeline.ts b/src/server/api/endpoints/notes/local-timeline.ts index 95e748fae6..f670d478bf 100644 --- a/src/server/api/endpoints/notes/local-timeline.ts +++ b/src/server/api/endpoints/notes/local-timeline.ts @@ -1,18 +1,18 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { fetchMeta } from '@/misc/fetch-meta.js'; -import { ApiError } from '../../error.js'; -import { Notes } from '@/models/index.js'; -import { generateMutedUserQuery } from '../../common/generate-muted-user-query.js'; -import { makePaginationQuery } from '../../common/make-pagination-query.js'; -import { generateVisibilityQuery } from '../../common/generate-visibility-query.js'; -import { activeUsersChart } from '@/services/chart/index.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { fetchMeta } from '@/misc/fetch-meta'; +import { ApiError } from '../../error'; +import { Notes } from '@/models/index'; +import { generateMutedUserQuery } from '../../common/generate-muted-user-query'; +import { makePaginationQuery } from '../../common/make-pagination-query'; +import { generateVisibilityQuery } from '../../common/generate-visibility-query'; +import { activeUsersChart } from '@/services/chart/index'; import { Brackets } from 'typeorm'; -import { generateRepliesQuery } from '../../common/generate-replies-query.js'; -import { generateMutedNoteQuery } from '../../common/generate-muted-note-query.js'; -import { generateChannelQuery } from '../../common/generate-channel-query.js'; -import { generateBlockedUserQuery } from '../../common/generate-block-query.js'; +import { generateRepliesQuery } from '../../common/generate-replies-query'; +import { generateMutedNoteQuery } from '../../common/generate-muted-note-query'; +import { generateChannelQuery } from '../../common/generate-channel-query'; +import { generateBlockedUserQuery } from '../../common/generate-block-query'; export const meta = { tags: ['notes'], diff --git a/src/server/api/endpoints/notes/mentions.ts b/src/server/api/endpoints/notes/mentions.ts index f3b8eecad6..74f7911bfe 100644 --- a/src/server/api/endpoints/notes/mentions.ts +++ b/src/server/api/endpoints/notes/mentions.ts @@ -1,13 +1,13 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import read from '@/services/note/read.js'; -import { Notes, Followings } from '@/models/index.js'; -import { generateVisibilityQuery } from '../../common/generate-visibility-query.js'; -import { generateMutedUserQuery } from '../../common/generate-muted-user-query.js'; -import { makePaginationQuery } from '../../common/make-pagination-query.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import read from '@/services/note/read'; +import { Notes, Followings } from '@/models/index'; +import { generateVisibilityQuery } from '../../common/generate-visibility-query'; +import { generateMutedUserQuery } from '../../common/generate-muted-user-query'; +import { makePaginationQuery } from '../../common/make-pagination-query'; import { Brackets } from 'typeorm'; -import { generateBlockedUserQuery } from '../../common/generate-block-query.js'; +import { generateBlockedUserQuery } from '../../common/generate-block-query'; export const meta = { tags: ['notes'], diff --git a/src/server/api/endpoints/notes/polls/recommendation.ts b/src/server/api/endpoints/notes/polls/recommendation.ts index 194c2ae276..0763f0c8fd 100644 --- a/src/server/api/endpoints/notes/polls/recommendation.ts +++ b/src/server/api/endpoints/notes/polls/recommendation.ts @@ -1,6 +1,6 @@ import $ from 'cafy'; -import define from '../../../define.js'; -import { Polls, Mutings, Notes, PollVotes } from '@/models/index.js'; +import define from '../../../define'; +import { Polls, Mutings, Notes, PollVotes } from '@/models/index'; import { Brackets, In } from 'typeorm'; export const meta = { diff --git a/src/server/api/endpoints/notes/polls/vote.ts b/src/server/api/endpoints/notes/polls/vote.ts index 0fde90b592..f670501385 100644 --- a/src/server/api/endpoints/notes/polls/vote.ts +++ b/src/server/api/endpoints/notes/polls/vote.ts @@ -1,18 +1,18 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import { publishNoteStream } from '@/services/stream.js'; -import { createNotification } from '@/services/create-notification.js'; -import define from '../../../define.js'; -import { ApiError } from '../../../error.js'; -import { getNote } from '../../../common/getters.js'; -import { deliver } from '@/queue/index.js'; -import { renderActivity } from '@/remote/activitypub/renderer/index.js'; -import renderVote from '@/remote/activitypub/renderer/vote.js'; -import { deliverQuestionUpdate } from '@/services/note/polls/update.js'; -import { PollVotes, NoteWatchings, Users, Polls, Blockings } from '@/models/index.js'; +import { ID } from '@/misc/cafy-id'; +import { publishNoteStream } from '@/services/stream'; +import { createNotification } from '@/services/create-notification'; +import define from '../../../define'; +import { ApiError } from '../../../error'; +import { getNote } from '../../../common/getters'; +import { deliver } from '@/queue/index'; +import { renderActivity } from '@/remote/activitypub/renderer/index'; +import renderVote from '@/remote/activitypub/renderer/vote'; +import { deliverQuestionUpdate } from '@/services/note/polls/update'; +import { PollVotes, NoteWatchings, Users, Polls, Blockings } from '@/models/index'; import { Not } from 'typeorm'; -import { IRemoteUser } from '@/models/entities/user.js'; -import { genId } from '@/misc/gen-id.js'; +import { IRemoteUser } from '@/models/entities/user'; +import { genId } from '@/misc/gen-id'; export const meta = { tags: ['notes'], diff --git a/src/server/api/endpoints/notes/reactions.ts b/src/server/api/endpoints/notes/reactions.ts index a67851d3b7..09dd6b600b 100644 --- a/src/server/api/endpoints/notes/reactions.ts +++ b/src/server/api/endpoints/notes/reactions.ts @@ -1,11 +1,11 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { getNote } from '../../common/getters.js'; -import { ApiError } from '../../error.js'; -import { NoteReactions } from '@/models/index.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { getNote } from '../../common/getters'; +import { ApiError } from '../../error'; +import { NoteReactions } from '@/models/index'; import { DeepPartial } from 'typeorm'; -import { NoteReaction } from '@/models/entities/note-reaction.js'; +import { NoteReaction } from '@/models/entities/note-reaction'; export const meta = { tags: ['notes', 'reactions'], diff --git a/src/server/api/endpoints/notes/reactions/create.ts b/src/server/api/endpoints/notes/reactions/create.ts index 41109746f8..24a73a8d4f 100644 --- a/src/server/api/endpoints/notes/reactions/create.ts +++ b/src/server/api/endpoints/notes/reactions/create.ts @@ -1,9 +1,9 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import createReaction from '@/services/note/reaction/create.js'; -import define from '../../../define.js'; -import { getNote } from '../../../common/getters.js'; -import { ApiError } from '../../../error.js'; +import { ID } from '@/misc/cafy-id'; +import createReaction from '@/services/note/reaction/create'; +import define from '../../../define'; +import { getNote } from '../../../common/getters'; +import { ApiError } from '../../../error'; export const meta = { tags: ['reactions', 'notes'], diff --git a/src/server/api/endpoints/notes/reactions/delete.ts b/src/server/api/endpoints/notes/reactions/delete.ts index b9eaf6978c..69550f96de 100644 --- a/src/server/api/endpoints/notes/reactions/delete.ts +++ b/src/server/api/endpoints/notes/reactions/delete.ts @@ -1,10 +1,10 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../../define.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../../define'; import * as ms from 'ms'; -import deleteReaction from '@/services/note/reaction/delete.js'; -import { getNote } from '../../../common/getters.js'; -import { ApiError } from '../../../error.js'; +import deleteReaction from '@/services/note/reaction/delete'; +import { getNote } from '../../../common/getters'; +import { ApiError } from '../../../error'; export const meta = { tags: ['reactions', 'notes'], diff --git a/src/server/api/endpoints/notes/renotes.ts b/src/server/api/endpoints/notes/renotes.ts index b08173f249..26bfc1657d 100644 --- a/src/server/api/endpoints/notes/renotes.ts +++ b/src/server/api/endpoints/notes/renotes.ts @@ -1,13 +1,13 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { getNote } from '../../common/getters.js'; -import { ApiError } from '../../error.js'; -import { generateVisibilityQuery } from '../../common/generate-visibility-query.js'; -import { generateMutedUserQuery } from '../../common/generate-muted-user-query.js'; -import { makePaginationQuery } from '../../common/make-pagination-query.js'; -import { Notes } from '@/models/index.js'; -import { generateBlockedUserQuery } from '../../common/generate-block-query.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { getNote } from '../../common/getters'; +import { ApiError } from '../../error'; +import { generateVisibilityQuery } from '../../common/generate-visibility-query'; +import { generateMutedUserQuery } from '../../common/generate-muted-user-query'; +import { makePaginationQuery } from '../../common/make-pagination-query'; +import { Notes } from '@/models/index'; +import { generateBlockedUserQuery } from '../../common/generate-block-query'; export const meta = { tags: ['notes'], diff --git a/src/server/api/endpoints/notes/replies.ts b/src/server/api/endpoints/notes/replies.ts index 5a96c16fd2..0bb62413ae 100644 --- a/src/server/api/endpoints/notes/replies.ts +++ b/src/server/api/endpoints/notes/replies.ts @@ -1,11 +1,11 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { Notes } from '@/models/index.js'; -import { makePaginationQuery } from '../../common/make-pagination-query.js'; -import { generateVisibilityQuery } from '../../common/generate-visibility-query.js'; -import { generateMutedUserQuery } from '../../common/generate-muted-user-query.js'; -import { generateBlockedUserQuery } from '../../common/generate-block-query.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { Notes } from '@/models/index'; +import { makePaginationQuery } from '../../common/make-pagination-query'; +import { generateVisibilityQuery } from '../../common/generate-visibility-query'; +import { generateMutedUserQuery } from '../../common/generate-muted-user-query'; +import { generateBlockedUserQuery } from '../../common/generate-block-query'; export const meta = { tags: ['notes'], diff --git a/src/server/api/endpoints/notes/search-by-tag.ts b/src/server/api/endpoints/notes/search-by-tag.ts index 2c0ad74635..40e1499736 100644 --- a/src/server/api/endpoints/notes/search-by-tag.ts +++ b/src/server/api/endpoints/notes/search-by-tag.ts @@ -1,14 +1,14 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { makePaginationQuery } from '../../common/make-pagination-query.js'; -import { Notes } from '@/models/index.js'; -import { generateMutedUserQuery } from '../../common/generate-muted-user-query.js'; -import { generateVisibilityQuery } from '../../common/generate-visibility-query.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { makePaginationQuery } from '../../common/make-pagination-query'; +import { Notes } from '@/models/index'; +import { generateMutedUserQuery } from '../../common/generate-muted-user-query'; +import { generateVisibilityQuery } from '../../common/generate-visibility-query'; import { Brackets } from 'typeorm'; -import { safeForSql } from '@/misc/safe-for-sql.js'; -import { normalizeForSearch } from '@/misc/normalize-for-search.js'; -import { generateBlockedUserQuery } from '../../common/generate-block-query.js'; +import { safeForSql } from '@/misc/safe-for-sql'; +import { normalizeForSearch } from '@/misc/normalize-for-search'; +import { generateBlockedUserQuery } from '../../common/generate-block-query'; export const meta = { tags: ['notes', 'hashtags'], diff --git a/src/server/api/endpoints/notes/search.ts b/src/server/api/endpoints/notes/search.ts index 45442c2548..eb832a6b31 100644 --- a/src/server/api/endpoints/notes/search.ts +++ b/src/server/api/endpoints/notes/search.ts @@ -1,14 +1,14 @@ import $ from 'cafy'; -import es from '../../../../db/elasticsearch.js'; -import define from '../../define.js'; -import { Notes } from '@/models/index.js'; +import es from '../../../../db/elasticsearch'; +import define from '../../define'; +import { Notes } from '@/models/index'; import { In } from 'typeorm'; -import { ID } from '@/misc/cafy-id.js'; -import config from '@/config/index.js'; -import { makePaginationQuery } from '../../common/make-pagination-query.js'; -import { generateVisibilityQuery } from '../../common/generate-visibility-query.js'; -import { generateMutedUserQuery } from '../../common/generate-muted-user-query.js'; -import { generateBlockedUserQuery } from '../../common/generate-block-query.js'; +import { ID } from '@/misc/cafy-id'; +import config from '@/config/index'; +import { makePaginationQuery } from '../../common/make-pagination-query'; +import { generateVisibilityQuery } from '../../common/generate-visibility-query'; +import { generateMutedUserQuery } from '../../common/generate-muted-user-query'; +import { generateBlockedUserQuery } from '../../common/generate-block-query'; export const meta = { tags: ['notes'], diff --git a/src/server/api/endpoints/notes/show.ts b/src/server/api/endpoints/notes/show.ts index 8387279b17..fad63d6483 100644 --- a/src/server/api/endpoints/notes/show.ts +++ b/src/server/api/endpoints/notes/show.ts @@ -1,9 +1,9 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { getNote } from '../../common/getters.js'; -import { ApiError } from '../../error.js'; -import { Notes } from '@/models/index.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { getNote } from '../../common/getters'; +import { ApiError } from '../../error'; +import { Notes } from '@/models/index'; export const meta = { tags: ['notes'], diff --git a/src/server/api/endpoints/notes/state.ts b/src/server/api/endpoints/notes/state.ts index bd2e85ea9d..489902435d 100644 --- a/src/server/api/endpoints/notes/state.ts +++ b/src/server/api/endpoints/notes/state.ts @@ -1,7 +1,7 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { NoteFavorites, NoteWatchings } from '@/models/index.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { NoteFavorites, NoteWatchings } from '@/models/index'; export const meta = { tags: ['notes'], diff --git a/src/server/api/endpoints/notes/timeline.ts b/src/server/api/endpoints/notes/timeline.ts index e1fd2d5fca..1bd0e57d34 100644 --- a/src/server/api/endpoints/notes/timeline.ts +++ b/src/server/api/endpoints/notes/timeline.ts @@ -1,16 +1,16 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { makePaginationQuery } from '../../common/make-pagination-query.js'; -import { Notes, Followings } from '@/models/index.js'; -import { generateVisibilityQuery } from '../../common/generate-visibility-query.js'; -import { generateMutedUserQuery } from '../../common/generate-muted-user-query.js'; -import { activeUsersChart } from '@/services/chart/index.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { makePaginationQuery } from '../../common/make-pagination-query'; +import { Notes, Followings } from '@/models/index'; +import { generateVisibilityQuery } from '../../common/generate-visibility-query'; +import { generateMutedUserQuery } from '../../common/generate-muted-user-query'; +import { activeUsersChart } from '@/services/chart/index'; import { Brackets } from 'typeorm'; -import { generateRepliesQuery } from '../../common/generate-replies-query.js'; -import { generateMutedNoteQuery } from '../../common/generate-muted-note-query.js'; -import { generateChannelQuery } from '../../common/generate-channel-query.js'; -import { generateBlockedUserQuery } from '../../common/generate-block-query.js'; +import { generateRepliesQuery } from '../../common/generate-replies-query'; +import { generateMutedNoteQuery } from '../../common/generate-muted-note-query'; +import { generateChannelQuery } from '../../common/generate-channel-query'; +import { generateBlockedUserQuery } from '../../common/generate-block-query'; export const meta = { tags: ['notes'], diff --git a/src/server/api/endpoints/notes/translate.ts b/src/server/api/endpoints/notes/translate.ts index 66354a2ea4..a5fdf70ce6 100644 --- a/src/server/api/endpoints/notes/translate.ts +++ b/src/server/api/endpoints/notes/translate.ts @@ -1,13 +1,13 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { getNote } from '../../common/getters.js'; -import { ApiError } from '../../error.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { getNote } from '../../common/getters'; +import { ApiError } from '../../error'; import fetch from 'node-fetch'; -import config from '@/config/index.js'; -import { getAgentByUrl } from '@/misc/fetch.js'; +import config from '@/config/index'; +import { getAgentByUrl } from '@/misc/fetch'; import { URLSearchParams } from 'url'; -import { fetchMeta } from '@/misc/fetch-meta.js'; +import { fetchMeta } from '@/misc/fetch-meta'; export const meta = { tags: ['notes'], diff --git a/src/server/api/endpoints/notes/unrenote.ts b/src/server/api/endpoints/notes/unrenote.ts index eec7a21515..dce43d9d9c 100644 --- a/src/server/api/endpoints/notes/unrenote.ts +++ b/src/server/api/endpoints/notes/unrenote.ts @@ -1,11 +1,11 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import deleteNote from '@/services/note/delete.js'; -import define from '../../define.js'; +import { ID } from '@/misc/cafy-id'; +import deleteNote from '@/services/note/delete'; +import define from '../../define'; import * as ms from 'ms'; -import { getNote } from '../../common/getters.js'; -import { ApiError } from '../../error.js'; -import { Notes, Users } from '@/models/index.js'; +import { getNote } from '../../common/getters'; +import { ApiError } from '../../error'; +import { Notes, Users } from '@/models/index'; export const meta = { tags: ['notes'], diff --git a/src/server/api/endpoints/notes/user-list-timeline.ts b/src/server/api/endpoints/notes/user-list-timeline.ts index 15abaa6c22..32c370004c 100644 --- a/src/server/api/endpoints/notes/user-list-timeline.ts +++ b/src/server/api/endpoints/notes/user-list-timeline.ts @@ -1,11 +1,11 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { ApiError } from '../../error.js'; -import { UserLists, UserListJoinings, Notes } from '@/models/index.js'; -import { makePaginationQuery } from '../../common/make-pagination-query.js'; -import { generateVisibilityQuery } from '../../common/generate-visibility-query.js'; -import { activeUsersChart } from '@/services/chart/index.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { ApiError } from '../../error'; +import { UserLists, UserListJoinings, Notes } from '@/models/index'; +import { makePaginationQuery } from '../../common/make-pagination-query'; +import { generateVisibilityQuery } from '../../common/generate-visibility-query'; +import { activeUsersChart } from '@/services/chart/index'; import { Brackets } from 'typeorm'; export const meta = { diff --git a/src/server/api/endpoints/notes/watching/create.ts b/src/server/api/endpoints/notes/watching/create.ts index 1c2c1652ae..4d182d3715 100644 --- a/src/server/api/endpoints/notes/watching/create.ts +++ b/src/server/api/endpoints/notes/watching/create.ts @@ -1,9 +1,9 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../../define.js'; -import watch from '@/services/note/watch.js'; -import { getNote } from '../../../common/getters.js'; -import { ApiError } from '../../../error.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../../define'; +import watch from '@/services/note/watch'; +import { getNote } from '../../../common/getters'; +import { ApiError } from '../../../error'; export const meta = { tags: ['notes'], diff --git a/src/server/api/endpoints/notes/watching/delete.ts b/src/server/api/endpoints/notes/watching/delete.ts index b418d3af2b..dd58c52b57 100644 --- a/src/server/api/endpoints/notes/watching/delete.ts +++ b/src/server/api/endpoints/notes/watching/delete.ts @@ -1,9 +1,9 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../../define.js'; -import unwatch from '@/services/note/unwatch.js'; -import { getNote } from '../../../common/getters.js'; -import { ApiError } from '../../../error.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../../define'; +import unwatch from '@/services/note/unwatch'; +import { getNote } from '../../../common/getters'; +import { ApiError } from '../../../error'; export const meta = { tags: ['notes'], diff --git a/src/server/api/endpoints/notifications/create.ts b/src/server/api/endpoints/notifications/create.ts index 5231d9011b..8003c497ee 100644 --- a/src/server/api/endpoints/notifications/create.ts +++ b/src/server/api/endpoints/notifications/create.ts @@ -1,6 +1,6 @@ import $ from 'cafy'; -import define from '../../define.js'; -import { createNotification } from '@/services/create-notification.js'; +import define from '../../define'; +import { createNotification } from '@/services/create-notification'; export const meta = { tags: ['notifications'], diff --git a/src/server/api/endpoints/notifications/mark-all-as-read.ts b/src/server/api/endpoints/notifications/mark-all-as-read.ts index d0dc7be31b..8d4e512750 100644 --- a/src/server/api/endpoints/notifications/mark-all-as-read.ts +++ b/src/server/api/endpoints/notifications/mark-all-as-read.ts @@ -1,6 +1,6 @@ -import { publishMainStream } from '@/services/stream.js'; -import define from '../../define.js'; -import { Notifications } from '@/models/index.js'; +import { publishMainStream } from '@/services/stream'; +import define from '../../define'; +import { Notifications } from '@/models/index'; export const meta = { tags: ['notifications', 'account'], diff --git a/src/server/api/endpoints/notifications/read.ts b/src/server/api/endpoints/notifications/read.ts index 94140db82e..66bbc4efd7 100644 --- a/src/server/api/endpoints/notifications/read.ts +++ b/src/server/api/endpoints/notifications/read.ts @@ -1,10 +1,10 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import { publishMainStream } from '@/services/stream.js'; -import define from '../../define.js'; -import { Notifications } from '@/models/index.js'; -import { readNotification } from '../../common/read-notification.js'; -import { ApiError } from '../../error.js'; +import { ID } from '@/misc/cafy-id'; +import { publishMainStream } from '@/services/stream'; +import define from '../../define'; +import { Notifications } from '@/models/index'; +import { readNotification } from '../../common/read-notification'; +import { ApiError } from '../../error'; export const meta = { tags: ['notifications', 'account'], diff --git a/src/server/api/endpoints/page-push.ts b/src/server/api/endpoints/page-push.ts index 1d48303394..a0412e89f1 100644 --- a/src/server/api/endpoints/page-push.ts +++ b/src/server/api/endpoints/page-push.ts @@ -1,9 +1,9 @@ import $ from 'cafy'; -import define from '../define.js'; -import { ID } from '@/misc/cafy-id.js'; -import { publishMainStream } from '@/services/stream.js'; -import { Users, Pages } from '@/models/index.js'; -import { ApiError } from '../error.js'; +import define from '../define'; +import { ID } from '@/misc/cafy-id'; +import { publishMainStream } from '@/services/stream'; +import { Users, Pages } from '@/models/index'; +import { ApiError } from '../error'; export const meta = { requireCredential: true as const, diff --git a/src/server/api/endpoints/pages/create.ts b/src/server/api/endpoints/pages/create.ts index 4f8a09b02a..c23978f093 100644 --- a/src/server/api/endpoints/pages/create.ts +++ b/src/server/api/endpoints/pages/create.ts @@ -1,11 +1,11 @@ import $ from 'cafy'; import * as ms from 'ms'; -import define from '../../define.js'; -import { ID } from '@/misc/cafy-id.js'; -import { Pages, DriveFiles } from '@/models/index.js'; -import { genId } from '@/misc/gen-id.js'; -import { Page } from '@/models/entities/page.js'; -import { ApiError } from '../../error.js'; +import define from '../../define'; +import { ID } from '@/misc/cafy-id'; +import { Pages, DriveFiles } from '@/models/index'; +import { genId } from '@/misc/gen-id'; +import { Page } from '@/models/entities/page'; +import { ApiError } from '../../error'; export const meta = { tags: ['pages'], diff --git a/src/server/api/endpoints/pages/delete.ts b/src/server/api/endpoints/pages/delete.ts index 8777c65e42..b1f8c8a709 100644 --- a/src/server/api/endpoints/pages/delete.ts +++ b/src/server/api/endpoints/pages/delete.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import define from '../../define.js'; -import { ApiError } from '../../error.js'; -import { Pages } from '@/models/index.js'; -import { ID } from '@/misc/cafy-id.js'; +import define from '../../define'; +import { ApiError } from '../../error'; +import { Pages } from '@/models/index'; +import { ID } from '@/misc/cafy-id'; export const meta = { tags: ['pages'], diff --git a/src/server/api/endpoints/pages/featured.ts b/src/server/api/endpoints/pages/featured.ts index 68adac930d..f891c45f05 100644 --- a/src/server/api/endpoints/pages/featured.ts +++ b/src/server/api/endpoints/pages/featured.ts @@ -1,5 +1,5 @@ -import define from '../../define.js'; -import { Pages } from '@/models/index.js'; +import define from '../../define'; +import { Pages } from '@/models/index'; export const meta = { tags: ['pages'], diff --git a/src/server/api/endpoints/pages/like.ts b/src/server/api/endpoints/pages/like.ts index ac0f577eb8..a95a377802 100644 --- a/src/server/api/endpoints/pages/like.ts +++ b/src/server/api/endpoints/pages/like.ts @@ -1,9 +1,9 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { ApiError } from '../../error.js'; -import { Pages, PageLikes } from '@/models/index.js'; -import { genId } from '@/misc/gen-id.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { ApiError } from '../../error'; +import { Pages, PageLikes } from '@/models/index'; +import { genId } from '@/misc/gen-id'; export const meta = { tags: ['pages'], diff --git a/src/server/api/endpoints/pages/show.ts b/src/server/api/endpoints/pages/show.ts index 21084d3b9a..7c55d4a9e6 100644 --- a/src/server/api/endpoints/pages/show.ts +++ b/src/server/api/endpoints/pages/show.ts @@ -1,9 +1,9 @@ import $ from 'cafy'; -import define from '../../define.js'; -import { ApiError } from '../../error.js'; -import { Pages, Users } from '@/models/index.js'; -import { ID } from '@/misc/cafy-id.js'; -import { Page } from '@/models/entities/page.js'; +import define from '../../define'; +import { ApiError } from '../../error'; +import { Pages, Users } from '@/models/index'; +import { ID } from '@/misc/cafy-id'; +import { Page } from '@/models/entities/page'; export const meta = { tags: ['pages'], diff --git a/src/server/api/endpoints/pages/unlike.ts b/src/server/api/endpoints/pages/unlike.ts index dddecccf62..facf2d6d5f 100644 --- a/src/server/api/endpoints/pages/unlike.ts +++ b/src/server/api/endpoints/pages/unlike.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { ApiError } from '../../error.js'; -import { Pages, PageLikes } from '@/models/index.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { ApiError } from '../../error'; +import { Pages, PageLikes } from '@/models/index'; export const meta = { tags: ['pages'], diff --git a/src/server/api/endpoints/pages/update.ts b/src/server/api/endpoints/pages/update.ts index d1df9b08a2..b3a7f26963 100644 --- a/src/server/api/endpoints/pages/update.ts +++ b/src/server/api/endpoints/pages/update.ts @@ -1,9 +1,9 @@ import $ from 'cafy'; import * as ms from 'ms'; -import define from '../../define.js'; -import { ApiError } from '../../error.js'; -import { Pages, DriveFiles } from '@/models/index.js'; -import { ID } from '@/misc/cafy-id.js'; +import define from '../../define'; +import { ApiError } from '../../error'; +import { Pages, DriveFiles } from '@/models/index'; +import { ID } from '@/misc/cafy-id'; import { Not } from 'typeorm'; export const meta = { diff --git a/src/server/api/endpoints/ping.ts b/src/server/api/endpoints/ping.ts index 1d342dac33..0b1bb6e164 100644 --- a/src/server/api/endpoints/ping.ts +++ b/src/server/api/endpoints/ping.ts @@ -1,4 +1,4 @@ -import define from '../define.js'; +import define from '../define'; export const meta = { requireCredential: false as const, diff --git a/src/server/api/endpoints/pinned-users.ts b/src/server/api/endpoints/pinned-users.ts index 0ea5e9b390..e88dfbd535 100644 --- a/src/server/api/endpoints/pinned-users.ts +++ b/src/server/api/endpoints/pinned-users.ts @@ -1,8 +1,8 @@ -import define from '../define.js'; -import { Users } from '@/models/index.js'; -import { fetchMeta } from '@/misc/fetch-meta.js'; -import { parseAcct } from '@/misc/acct.js'; -import { User } from '@/models/entities/user.js'; +import define from '../define'; +import { Users } from '@/models/index'; +import { fetchMeta } from '@/misc/fetch-meta'; +import { parseAcct } from '@/misc/acct'; +import { User } from '@/models/entities/user'; export const meta = { tags: ['users'], diff --git a/src/server/api/endpoints/promo/read.ts b/src/server/api/endpoints/promo/read.ts index 92a6768988..ae57bf9cf1 100644 --- a/src/server/api/endpoints/promo/read.ts +++ b/src/server/api/endpoints/promo/read.ts @@ -1,10 +1,10 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { ApiError } from '../../error.js'; -import { getNote } from '../../common/getters.js'; -import { PromoReads } from '@/models/index.js'; -import { genId } from '@/misc/gen-id.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { ApiError } from '../../error'; +import { getNote } from '../../common/getters'; +import { PromoReads } from '@/models/index'; +import { genId } from '@/misc/gen-id'; export const meta = { tags: ['notes'], diff --git a/src/server/api/endpoints/request-reset-password.ts b/src/server/api/endpoints/request-reset-password.ts index 754a5a1c87..f9928c2ee6 100644 --- a/src/server/api/endpoints/request-reset-password.ts +++ b/src/server/api/endpoints/request-reset-password.ts @@ -1,13 +1,13 @@ import $ from 'cafy'; -import { publishMainStream } from '@/services/stream.js'; -import define from '../define.js'; +import { publishMainStream } from '@/services/stream'; +import define from '../define'; import rndstr from 'rndstr'; -import config from '@/config/index.js'; +import config from '@/config/index'; import * as ms from 'ms'; -import { Users, UserProfiles, PasswordResetRequests } from '@/models/index.js'; -import { sendEmail } from '@/services/send-email.js'; -import { ApiError } from '../error.js'; -import { genId } from '@/misc/gen-id.js'; +import { Users, UserProfiles, PasswordResetRequests } from '@/models/index'; +import { sendEmail } from '@/services/send-email'; +import { ApiError } from '../error'; +import { genId } from '@/misc/gen-id'; import { IsNull } from 'typeorm'; export const meta = { diff --git a/src/server/api/endpoints/reset-db.ts b/src/server/api/endpoints/reset-db.ts index c6ad8303fa..f430869302 100644 --- a/src/server/api/endpoints/reset-db.ts +++ b/src/server/api/endpoints/reset-db.ts @@ -1,7 +1,7 @@ import $ from 'cafy'; -import define from '../define.js'; -import { ApiError } from '../error.js'; -import { resetDb } from '@/db/postgre.js'; +import define from '../define'; +import { ApiError } from '../error'; +import { resetDb } from '@/db/postgre'; export const meta = { requireCredential: false as const, diff --git a/src/server/api/endpoints/reset-password.ts b/src/server/api/endpoints/reset-password.ts index f32e499e01..53b0bfde0b 100644 --- a/src/server/api/endpoints/reset-password.ts +++ b/src/server/api/endpoints/reset-password.ts @@ -1,9 +1,9 @@ import $ from 'cafy'; import * as bcrypt from 'bcryptjs'; -import { publishMainStream } from '@/services/stream.js'; -import define from '../define.js'; -import { Users, UserProfiles, PasswordResetRequests } from '@/models/index.js'; -import { ApiError } from '../error.js'; +import { publishMainStream } from '@/services/stream'; +import define from '../define'; +import { Users, UserProfiles, PasswordResetRequests } from '@/models/index'; +import { ApiError } from '../error'; export const meta = { requireCredential: false as const, diff --git a/src/server/api/endpoints/room/show.ts b/src/server/api/endpoints/room/show.ts index dcedde5db3..a6461d4a6e 100644 --- a/src/server/api/endpoints/room/show.ts +++ b/src/server/api/endpoints/room/show.ts @@ -1,9 +1,9 @@ import $ from 'cafy'; -import define from '../../define.js'; -import { ApiError } from '../../error.js'; -import { Users, UserProfiles } from '@/models/index.js'; -import { ID } from '@/misc/cafy-id.js'; -import { toPunyNullable } from '@/misc/convert-host.js'; +import define from '../../define'; +import { ApiError } from '../../error'; +import { Users, UserProfiles } from '@/models/index'; +import { ID } from '@/misc/cafy-id'; +import { toPunyNullable } from '@/misc/convert-host'; export const meta = { tags: ['room'], diff --git a/src/server/api/endpoints/room/update.ts b/src/server/api/endpoints/room/update.ts index 2ee44e157c..8c4cfbdea6 100644 --- a/src/server/api/endpoints/room/update.ts +++ b/src/server/api/endpoints/room/update.ts @@ -1,7 +1,7 @@ import $ from 'cafy'; -import { publishMainStream } from '@/services/stream.js'; -import define from '../../define.js'; -import { Users, UserProfiles } from '@/models/index.js'; +import { publishMainStream } from '@/services/stream'; +import define from '../../define'; +import { Users, UserProfiles } from '@/models/index'; export const meta = { tags: ['room'], diff --git a/src/server/api/endpoints/server-info.ts b/src/server/api/endpoints/server-info.ts index 23a7aabba4..4e636d331c 100644 --- a/src/server/api/endpoints/server-info.ts +++ b/src/server/api/endpoints/server-info.ts @@ -1,6 +1,6 @@ import * as os from 'os'; import * as si from 'systeminformation'; -import define from '../define.js'; +import define from '../define'; export const meta = { requireCredential: false as const, diff --git a/src/server/api/endpoints/stats.ts b/src/server/api/endpoints/stats.ts index 84b56c0ba9..15c8001742 100644 --- a/src/server/api/endpoints/stats.ts +++ b/src/server/api/endpoints/stats.ts @@ -1,6 +1,6 @@ -import define from '../define.js'; -import { NoteReactions, Notes, Users } from '@/models/index.js'; -import { federationChart, driveChart } from '@/services/chart/index.js'; +import define from '../define'; +import { NoteReactions, Notes, Users } from '@/models/index'; +import { federationChart, driveChart } from '@/services/chart/index'; export const meta = { requireCredential: false as const, diff --git a/src/server/api/endpoints/sw/register.ts b/src/server/api/endpoints/sw/register.ts index c008e6ec70..6e14ba2669 100644 --- a/src/server/api/endpoints/sw/register.ts +++ b/src/server/api/endpoints/sw/register.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import define from '../../define.js'; -import { fetchMeta } from '@/misc/fetch-meta.js'; -import { genId } from '@/misc/gen-id.js'; -import { SwSubscriptions } from '@/models/index.js'; +import define from '../../define'; +import { fetchMeta } from '@/misc/fetch-meta'; +import { genId } from '@/misc/gen-id'; +import { SwSubscriptions } from '@/models/index'; export const meta = { tags: ['account'], diff --git a/src/server/api/endpoints/username/available.ts b/src/server/api/endpoints/username/available.ts index 38442fdc9c..1ae75448ea 100644 --- a/src/server/api/endpoints/username/available.ts +++ b/src/server/api/endpoints/username/available.ts @@ -1,6 +1,6 @@ import $ from 'cafy'; -import define from '../../define.js'; -import { Users, UsedUsernames } from '@/models/index.js'; +import define from '../../define'; +import { Users, UsedUsernames } from '@/models/index'; export const meta = { tags: ['users'], diff --git a/src/server/api/endpoints/users.ts b/src/server/api/endpoints/users.ts index 462055b285..130ae30244 100644 --- a/src/server/api/endpoints/users.ts +++ b/src/server/api/endpoints/users.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import define from '../define.js'; -import { Users } from '@/models/index.js'; -import { generateMutedUserQueryForUsers } from '../common/generate-muted-user-query.js'; -import { generateBlockedUserQuery } from '../common/generate-block-query.js'; +import define from '../define'; +import { Users } from '@/models/index'; +import { generateMutedUserQueryForUsers } from '../common/generate-muted-user-query'; +import { generateBlockedUserQuery } from '../common/generate-block-query'; export const meta = { tags: ['users'], diff --git a/src/server/api/endpoints/users/clips.ts b/src/server/api/endpoints/users/clips.ts index 8e53843bb3..8feca9422a 100644 --- a/src/server/api/endpoints/users/clips.ts +++ b/src/server/api/endpoints/users/clips.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { Clips } from '@/models/index.js'; -import { makePaginationQuery } from '../../common/make-pagination-query.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { Clips } from '@/models/index'; +import { makePaginationQuery } from '../../common/make-pagination-query'; export const meta = { tags: ['users', 'clips'], diff --git a/src/server/api/endpoints/users/followers.ts b/src/server/api/endpoints/users/followers.ts index 896c3ca1cd..e54b6078ee 100644 --- a/src/server/api/endpoints/users/followers.ts +++ b/src/server/api/endpoints/users/followers.ts @@ -1,10 +1,10 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { ApiError } from '../../error.js'; -import { Users, Followings } from '@/models/index.js'; -import { makePaginationQuery } from '../../common/make-pagination-query.js'; -import { toPunyNullable } from '@/misc/convert-host.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { ApiError } from '../../error'; +import { Users, Followings } from '@/models/index'; +import { makePaginationQuery } from '../../common/make-pagination-query'; +import { toPunyNullable } from '@/misc/convert-host'; export const meta = { tags: ['users'], diff --git a/src/server/api/endpoints/users/following.ts b/src/server/api/endpoints/users/following.ts index ab60cc02fb..f2ef7f47e1 100644 --- a/src/server/api/endpoints/users/following.ts +++ b/src/server/api/endpoints/users/following.ts @@ -1,10 +1,10 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { ApiError } from '../../error.js'; -import { Users, Followings } from '@/models/index.js'; -import { makePaginationQuery } from '../../common/make-pagination-query.js'; -import { toPunyNullable } from '@/misc/convert-host.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { ApiError } from '../../error'; +import { Users, Followings } from '@/models/index'; +import { makePaginationQuery } from '../../common/make-pagination-query'; +import { toPunyNullable } from '@/misc/convert-host'; export const meta = { tags: ['users'], diff --git a/src/server/api/endpoints/users/gallery/posts.ts b/src/server/api/endpoints/users/gallery/posts.ts index 7c5a7d1cf3..845de1089c 100644 --- a/src/server/api/endpoints/users/gallery/posts.ts +++ b/src/server/api/endpoints/users/gallery/posts.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../../define.js'; -import { GalleryPosts } from '@/models/index.js'; -import { makePaginationQuery } from '../../../common/make-pagination-query.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../../define'; +import { GalleryPosts } from '@/models/index'; +import { makePaginationQuery } from '../../../common/make-pagination-query'; export const meta = { tags: ['users', 'gallery'], diff --git a/src/server/api/endpoints/users/get-frequently-replied-users.ts b/src/server/api/endpoints/users/get-frequently-replied-users.ts index 4207aa004c..921d30c82e 100644 --- a/src/server/api/endpoints/users/get-frequently-replied-users.ts +++ b/src/server/api/endpoints/users/get-frequently-replied-users.ts @@ -1,11 +1,11 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { maximum } from '../../../../prelude/array.js'; -import { ApiError } from '../../error.js'; -import { getUser } from '../../common/getters.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { maximum } from '../../../../prelude/array'; +import { ApiError } from '../../error'; +import { getUser } from '../../common/getters'; import { Not, In, IsNull } from 'typeorm'; -import { Notes, Users } from '@/models/index.js'; +import { Notes, Users } from '@/models/index'; export const meta = { tags: ['users'], diff --git a/src/server/api/endpoints/users/groups/create.ts b/src/server/api/endpoints/users/groups/create.ts index 7c3d5d258d..dc1ee3879e 100644 --- a/src/server/api/endpoints/users/groups/create.ts +++ b/src/server/api/endpoints/users/groups/create.ts @@ -1,9 +1,9 @@ import $ from 'cafy'; -import define from '../../../define.js'; -import { UserGroups, UserGroupJoinings } from '@/models/index.js'; -import { genId } from '@/misc/gen-id.js'; -import { UserGroup } from '@/models/entities/user-group.js'; -import { UserGroupJoining } from '@/models/entities/user-group-joining.js'; +import define from '../../../define'; +import { UserGroups, UserGroupJoinings } from '@/models/index'; +import { genId } from '@/misc/gen-id'; +import { UserGroup } from '@/models/entities/user-group'; +import { UserGroupJoining } from '@/models/entities/user-group-joining'; export const meta = { tags: ['groups'], diff --git a/src/server/api/endpoints/users/groups/delete.ts b/src/server/api/endpoints/users/groups/delete.ts index 71d6c615a7..7da1b4a273 100644 --- a/src/server/api/endpoints/users/groups/delete.ts +++ b/src/server/api/endpoints/users/groups/delete.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../../define.js'; -import { ApiError } from '../../../error.js'; -import { UserGroups } from '@/models/index.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../../define'; +import { ApiError } from '../../../error'; +import { UserGroups } from '@/models/index'; export const meta = { tags: ['groups'], diff --git a/src/server/api/endpoints/users/groups/invitations/accept.ts b/src/server/api/endpoints/users/groups/invitations/accept.ts index 6eab46337d..09e6ae2647 100644 --- a/src/server/api/endpoints/users/groups/invitations/accept.ts +++ b/src/server/api/endpoints/users/groups/invitations/accept.ts @@ -1,10 +1,10 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../../../define.js'; -import { ApiError } from '../../../../error.js'; -import { UserGroupJoinings, UserGroupInvitations } from '@/models/index.js'; -import { genId } from '@/misc/gen-id.js'; -import { UserGroupJoining } from '@/models/entities/user-group-joining.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../../../define'; +import { ApiError } from '../../../../error'; +import { UserGroupJoinings, UserGroupInvitations } from '@/models/index'; +import { genId } from '@/misc/gen-id'; +import { UserGroupJoining } from '@/models/entities/user-group-joining'; export const meta = { tags: ['groups', 'users'], diff --git a/src/server/api/endpoints/users/groups/invitations/reject.ts b/src/server/api/endpoints/users/groups/invitations/reject.ts index ff0ff58f3c..741fcefb35 100644 --- a/src/server/api/endpoints/users/groups/invitations/reject.ts +++ b/src/server/api/endpoints/users/groups/invitations/reject.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../../../define.js'; -import { ApiError } from '../../../../error.js'; -import { UserGroupInvitations } from '@/models/index.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../../../define'; +import { ApiError } from '../../../../error'; +import { UserGroupInvitations } from '@/models/index'; export const meta = { tags: ['groups', 'users'], diff --git a/src/server/api/endpoints/users/groups/invite.ts b/src/server/api/endpoints/users/groups/invite.ts index 2a4af72662..f1ee8bf8b7 100644 --- a/src/server/api/endpoints/users/groups/invite.ts +++ b/src/server/api/endpoints/users/groups/invite.ts @@ -1,12 +1,12 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../../define.js'; -import { ApiError } from '../../../error.js'; -import { getUser } from '../../../common/getters.js'; -import { UserGroups, UserGroupJoinings, UserGroupInvitations } from '@/models/index.js'; -import { genId } from '@/misc/gen-id.js'; -import { UserGroupInvitation } from '@/models/entities/user-group-invitation.js'; -import { createNotification } from '@/services/create-notification.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../../define'; +import { ApiError } from '../../../error'; +import { getUser } from '../../../common/getters'; +import { UserGroups, UserGroupJoinings, UserGroupInvitations } from '@/models/index'; +import { genId } from '@/misc/gen-id'; +import { UserGroupInvitation } from '@/models/entities/user-group-invitation'; +import { createNotification } from '@/services/create-notification'; export const meta = { tags: ['groups', 'users'], diff --git a/src/server/api/endpoints/users/groups/joined.ts b/src/server/api/endpoints/users/groups/joined.ts index 4066c6ddc3..d5e8fe4032 100644 --- a/src/server/api/endpoints/users/groups/joined.ts +++ b/src/server/api/endpoints/users/groups/joined.ts @@ -1,5 +1,5 @@ -import define from '../../../define.js'; -import { UserGroups, UserGroupJoinings } from '@/models/index.js'; +import define from '../../../define'; +import { UserGroups, UserGroupJoinings } from '@/models/index'; import { Not, In } from 'typeorm'; export const meta = { diff --git a/src/server/api/endpoints/users/groups/owned.ts b/src/server/api/endpoints/users/groups/owned.ts index 0111ff09d1..17de370dbc 100644 --- a/src/server/api/endpoints/users/groups/owned.ts +++ b/src/server/api/endpoints/users/groups/owned.ts @@ -1,5 +1,5 @@ -import define from '../../../define.js'; -import { UserGroups } from '@/models/index.js'; +import define from '../../../define'; +import { UserGroups } from '@/models/index'; export const meta = { tags: ['groups', 'account'], diff --git a/src/server/api/endpoints/users/groups/pull.ts b/src/server/api/endpoints/users/groups/pull.ts index 4e080074b4..ce4d2e2881 100644 --- a/src/server/api/endpoints/users/groups/pull.ts +++ b/src/server/api/endpoints/users/groups/pull.ts @@ -1,9 +1,9 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../../define.js'; -import { ApiError } from '../../../error.js'; -import { getUser } from '../../../common/getters.js'; -import { UserGroups, UserGroupJoinings } from '@/models/index.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../../define'; +import { ApiError } from '../../../error'; +import { getUser } from '../../../common/getters'; +import { UserGroups, UserGroupJoinings } from '@/models/index'; export const meta = { tags: ['groups', 'users'], diff --git a/src/server/api/endpoints/users/groups/show.ts b/src/server/api/endpoints/users/groups/show.ts index 666c159c6d..3c030bf3a5 100644 --- a/src/server/api/endpoints/users/groups/show.ts +++ b/src/server/api/endpoints/users/groups/show.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../../define.js'; -import { ApiError } from '../../../error.js'; -import { UserGroups, UserGroupJoinings } from '@/models/index.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../../define'; +import { ApiError } from '../../../error'; +import { UserGroups, UserGroupJoinings } from '@/models/index'; export const meta = { tags: ['groups', 'account'], diff --git a/src/server/api/endpoints/users/groups/transfer.ts b/src/server/api/endpoints/users/groups/transfer.ts index a216e80025..17c42e1127 100644 --- a/src/server/api/endpoints/users/groups/transfer.ts +++ b/src/server/api/endpoints/users/groups/transfer.ts @@ -1,9 +1,9 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../../define.js'; -import { ApiError } from '../../../error.js'; -import { getUser } from '../../../common/getters.js'; -import { UserGroups, UserGroupJoinings } from '@/models/index.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../../define'; +import { ApiError } from '../../../error'; +import { getUser } from '../../../common/getters'; +import { UserGroups, UserGroupJoinings } from '@/models/index'; export const meta = { tags: ['groups', 'users'], diff --git a/src/server/api/endpoints/users/groups/update.ts b/src/server/api/endpoints/users/groups/update.ts index c6c1b14818..127bbc47a1 100644 --- a/src/server/api/endpoints/users/groups/update.ts +++ b/src/server/api/endpoints/users/groups/update.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../../define.js'; -import { ApiError } from '../../../error.js'; -import { UserGroups } from '@/models/index.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../../define'; +import { ApiError } from '../../../error'; +import { UserGroups } from '@/models/index'; export const meta = { tags: ['groups'], diff --git a/src/server/api/endpoints/users/lists/create.ts b/src/server/api/endpoints/users/lists/create.ts index 89af90ea52..e0bfe611fc 100644 --- a/src/server/api/endpoints/users/lists/create.ts +++ b/src/server/api/endpoints/users/lists/create.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import define from '../../../define.js'; -import { UserLists } from '@/models/index.js'; -import { genId } from '@/misc/gen-id.js'; -import { UserList } from '@/models/entities/user-list.js'; +import define from '../../../define'; +import { UserLists } from '@/models/index'; +import { genId } from '@/misc/gen-id'; +import { UserList } from '@/models/entities/user-list'; export const meta = { tags: ['lists'], diff --git a/src/server/api/endpoints/users/lists/delete.ts b/src/server/api/endpoints/users/lists/delete.ts index d33222242e..5fe3bfb03d 100644 --- a/src/server/api/endpoints/users/lists/delete.ts +++ b/src/server/api/endpoints/users/lists/delete.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../../define.js'; -import { ApiError } from '../../../error.js'; -import { UserLists } from '@/models/index.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../../define'; +import { ApiError } from '../../../error'; +import { UserLists } from '@/models/index'; export const meta = { tags: ['lists'], diff --git a/src/server/api/endpoints/users/lists/list.ts b/src/server/api/endpoints/users/lists/list.ts index f186408981..cf0c92bb84 100644 --- a/src/server/api/endpoints/users/lists/list.ts +++ b/src/server/api/endpoints/users/lists/list.ts @@ -1,5 +1,5 @@ -import define from '../../../define.js'; -import { UserLists } from '@/models/index.js'; +import define from '../../../define'; +import { UserLists } from '@/models/index'; export const meta = { tags: ['lists', 'account'], diff --git a/src/server/api/endpoints/users/lists/pull.ts b/src/server/api/endpoints/users/lists/pull.ts index db15d67d98..d4357fc5e7 100644 --- a/src/server/api/endpoints/users/lists/pull.ts +++ b/src/server/api/endpoints/users/lists/pull.ts @@ -1,10 +1,10 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import { publishUserListStream } from '@/services/stream.js'; -import define from '../../../define.js'; -import { ApiError } from '../../../error.js'; -import { getUser } from '../../../common/getters.js'; -import { UserLists, UserListJoinings, Users } from '@/models/index.js'; +import { ID } from '@/misc/cafy-id'; +import { publishUserListStream } from '@/services/stream'; +import define from '../../../define'; +import { ApiError } from '../../../error'; +import { getUser } from '../../../common/getters'; +import { UserLists, UserListJoinings, Users } from '@/models/index'; export const meta = { tags: ['lists', 'users'], diff --git a/src/server/api/endpoints/users/lists/push.ts b/src/server/api/endpoints/users/lists/push.ts index 266e813b16..8e21059d3d 100644 --- a/src/server/api/endpoints/users/lists/push.ts +++ b/src/server/api/endpoints/users/lists/push.ts @@ -1,10 +1,10 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../../define.js'; -import { ApiError } from '../../../error.js'; -import { getUser } from '../../../common/getters.js'; -import { pushUserToUserList } from '@/services/user-list/push.js'; -import { UserLists, UserListJoinings, Blockings } from '@/models/index.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../../define'; +import { ApiError } from '../../../error'; +import { getUser } from '../../../common/getters'; +import { pushUserToUserList } from '@/services/user-list/push'; +import { UserLists, UserListJoinings, Blockings } from '@/models/index'; export const meta = { tags: ['lists', 'users'], diff --git a/src/server/api/endpoints/users/lists/show.ts b/src/server/api/endpoints/users/lists/show.ts index c3a49b7472..f9a35cdab3 100644 --- a/src/server/api/endpoints/users/lists/show.ts +++ b/src/server/api/endpoints/users/lists/show.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../../define.js'; -import { ApiError } from '../../../error.js'; -import { UserLists } from '@/models/index.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../../define'; +import { ApiError } from '../../../error'; +import { UserLists } from '@/models/index'; export const meta = { tags: ['lists', 'account'], diff --git a/src/server/api/endpoints/users/lists/update.ts b/src/server/api/endpoints/users/lists/update.ts index c883ed420f..1185af5043 100644 --- a/src/server/api/endpoints/users/lists/update.ts +++ b/src/server/api/endpoints/users/lists/update.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../../define.js'; -import { ApiError } from '../../../error.js'; -import { UserLists } from '@/models/index.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../../define'; +import { ApiError } from '../../../error'; +import { UserLists } from '@/models/index'; export const meta = { tags: ['lists'], diff --git a/src/server/api/endpoints/users/notes.ts b/src/server/api/endpoints/users/notes.ts index ae6d75e641..0afbad9d04 100644 --- a/src/server/api/endpoints/users/notes.ts +++ b/src/server/api/endpoints/users/notes.ts @@ -1,14 +1,14 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { ApiError } from '../../error.js'; -import { getUser } from '../../common/getters.js'; -import { makePaginationQuery } from '../../common/make-pagination-query.js'; -import { generateVisibilityQuery } from '../../common/generate-visibility-query.js'; -import { Notes } from '@/models/index.js'; -import { generateMutedUserQuery } from '../../common/generate-muted-user-query.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { ApiError } from '../../error'; +import { getUser } from '../../common/getters'; +import { makePaginationQuery } from '../../common/make-pagination-query'; +import { generateVisibilityQuery } from '../../common/generate-visibility-query'; +import { Notes } from '@/models/index'; +import { generateMutedUserQuery } from '../../common/generate-muted-user-query'; import { Brackets } from 'typeorm'; -import { generateBlockedUserQuery } from '../../common/generate-block-query.js'; +import { generateBlockedUserQuery } from '../../common/generate-block-query'; export const meta = { tags: ['users', 'notes'], diff --git a/src/server/api/endpoints/users/pages.ts b/src/server/api/endpoints/users/pages.ts index b27b21bac5..24e9e207fd 100644 --- a/src/server/api/endpoints/users/pages.ts +++ b/src/server/api/endpoints/users/pages.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { Pages } from '@/models/index.js'; -import { makePaginationQuery } from '../../common/make-pagination-query.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { Pages } from '@/models/index'; +import { makePaginationQuery } from '../../common/make-pagination-query'; export const meta = { tags: ['users', 'pages'], diff --git a/src/server/api/endpoints/users/recommendation.ts b/src/server/api/endpoints/users/recommendation.ts index 0c86c13366..dde6bb1037 100644 --- a/src/server/api/endpoints/users/recommendation.ts +++ b/src/server/api/endpoints/users/recommendation.ts @@ -1,9 +1,9 @@ import * as ms from 'ms'; import $ from 'cafy'; -import define from '../../define.js'; -import { Users, Followings } from '@/models/index.js'; -import { generateMutedUserQueryForUsers } from '../../common/generate-muted-user-query.js'; -import { generateBlockedUserQuery, generateBlockQueryForUsers } from '../../common/generate-block-query.js'; +import define from '../../define'; +import { Users, Followings } from '@/models/index'; +import { generateMutedUserQueryForUsers } from '../../common/generate-muted-user-query'; +import { generateBlockedUserQuery, generateBlockQueryForUsers } from '../../common/generate-block-query'; export const meta = { tags: ['users'], diff --git a/src/server/api/endpoints/users/relation.ts b/src/server/api/endpoints/users/relation.ts index 5998f2dbc2..32d76a5322 100644 --- a/src/server/api/endpoints/users/relation.ts +++ b/src/server/api/endpoints/users/relation.ts @@ -1,7 +1,7 @@ import $ from 'cafy'; -import define from '../../define.js'; -import { ID } from '@/misc/cafy-id.js'; -import { Users } from '@/models/index.js'; +import define from '../../define'; +import { ID } from '@/misc/cafy-id'; +import { Users } from '@/models/index'; export const meta = { tags: ['users'], diff --git a/src/server/api/endpoints/users/report-abuse.ts b/src/server/api/endpoints/users/report-abuse.ts index 37de2d533c..2c8672cd47 100644 --- a/src/server/api/endpoints/users/report-abuse.ts +++ b/src/server/api/endpoints/users/report-abuse.ts @@ -1,11 +1,11 @@ import $ from 'cafy'; -import { ID } from '@/misc/cafy-id.js'; -import define from '../../define.js'; -import { publishAdminStream } from '@/services/stream.js'; -import { ApiError } from '../../error.js'; -import { getUser } from '../../common/getters.js'; -import { AbuseUserReports, Users } from '@/models/index.js'; -import { genId } from '@/misc/gen-id.js'; +import { ID } from '@/misc/cafy-id'; +import define from '../../define'; +import { publishAdminStream } from '@/services/stream'; +import { ApiError } from '../../error'; +import { getUser } from '../../common/getters'; +import { AbuseUserReports, Users } from '@/models/index'; +import { genId } from '@/misc/gen-id'; export const meta = { tags: ['users'], diff --git a/src/server/api/endpoints/users/search-by-username-and-host.ts b/src/server/api/endpoints/users/search-by-username-and-host.ts index 690c346e28..b9fbf48fb2 100644 --- a/src/server/api/endpoints/users/search-by-username-and-host.ts +++ b/src/server/api/endpoints/users/search-by-username-and-host.ts @@ -1,6 +1,6 @@ import $ from 'cafy'; -import define from '../../define.js'; -import { Users } from '@/models/index.js'; +import define from '../../define'; +import { Users } from '@/models/index'; export const meta = { tags: ['users'], diff --git a/src/server/api/endpoints/users/search.ts b/src/server/api/endpoints/users/search.ts index 46e179b6dc..8011d90b3d 100644 --- a/src/server/api/endpoints/users/search.ts +++ b/src/server/api/endpoints/users/search.ts @@ -1,7 +1,7 @@ import $ from 'cafy'; -import define from '../../define.js'; -import { UserProfiles, Users } from '@/models/index.js'; -import { User } from '@/models/entities/user.js'; +import define from '../../define'; +import { UserProfiles, Users } from '@/models/index'; +import { User } from '@/models/entities/user'; export const meta = { tags: ['users'], diff --git a/src/server/api/endpoints/users/show.ts b/src/server/api/endpoints/users/show.ts index bd0d65f760..f056983636 100644 --- a/src/server/api/endpoints/users/show.ts +++ b/src/server/api/endpoints/users/show.ts @@ -1,12 +1,12 @@ import $ from 'cafy'; -import { resolveUser } from '@/remote/resolve-user.js'; -import define from '../../define.js'; -import { apiLogger } from '../../logger.js'; -import { ApiError } from '../../error.js'; -import { ID } from '@/misc/cafy-id.js'; -import { Users } from '@/models/index.js'; +import { resolveUser } from '@/remote/resolve-user'; +import define from '../../define'; +import { apiLogger } from '../../logger'; +import { ApiError } from '../../error'; +import { ID } from '@/misc/cafy-id'; +import { Users } from '@/models/index'; import { In } from 'typeorm'; -import { User } from '@/models/entities/user.js'; +import { User } from '@/models/entities/user'; export const meta = { tags: ['users'], diff --git a/src/server/api/endpoints/users/stats.ts b/src/server/api/endpoints/users/stats.ts index 7cf08f71c9..ef8afd5625 100644 --- a/src/server/api/endpoints/users/stats.ts +++ b/src/server/api/endpoints/users/stats.ts @@ -1,8 +1,8 @@ import $ from 'cafy'; -import define from '../../define.js'; -import { ApiError } from '../../error.js'; -import { ID } from '@/misc/cafy-id.js'; -import { DriveFiles, Followings, NoteFavorites, NoteReactions, Notes, PageLikes, PollVotes, ReversiGames, Users } from '@/models/index.js'; +import define from '../../define'; +import { ApiError } from '../../error'; +import { ID } from '@/misc/cafy-id'; +import { DriveFiles, Followings, NoteFavorites, NoteReactions, Notes, PageLikes, PollVotes, ReversiGames, Users } from '@/models/index'; export const meta = { tags: ['users'], diff --git a/src/server/api/index.ts b/src/server/api/index.ts index b967f70b3a..55083261ee 100644 --- a/src/server/api/index.ts +++ b/src/server/api/index.ts @@ -8,14 +8,14 @@ import * as multer from '@koa/multer'; import * as bodyParser from 'koa-bodyparser'; import * as cors from '@koa/cors'; -import endpoints from './endpoints.js'; -import handler from './api-handler.js'; -import signup from './private/signup.js'; -import signin from './private/signin.js'; -import discord from './service/discord.js'; -import github from './service/github.js'; -import twitter from './service/twitter.js'; -import { Instances, AccessTokens, Users } from '@/models/index.js'; +import endpoints from './endpoints'; +import handler from './api-handler'; +import signup from './private/signup'; +import signin from './private/signin'; +import discord from './service/discord'; +import github from './service/github'; +import twitter from './service/twitter'; +import { Instances, AccessTokens, Users } from '@/models/index'; // Init app const app = new Koa(); diff --git a/src/server/api/limiter.ts b/src/server/api/limiter.ts index f624bd1166..e677aad0b6 100644 --- a/src/server/api/limiter.ts +++ b/src/server/api/limiter.ts @@ -1,9 +1,9 @@ import * as Limiter from 'ratelimiter'; -import { redisClient } from '../../db/redis.js'; -import { IEndpoint } from './endpoints.js'; -import { getAcct } from '@/misc/acct.js'; -import { User } from '@/models/entities/user.js'; -import Logger from '@/services/logger.js'; +import { redisClient } from '../../db/redis'; +import { IEndpoint } from './endpoints'; +import { getAcct } from '@/misc/acct'; +import { User } from '@/models/entities/user'; +import Logger from '@/services/logger'; const logger = new Logger('limiter'); diff --git a/src/server/api/logger.ts b/src/server/api/logger.ts index ec22d6c3e2..750defe547 100644 --- a/src/server/api/logger.ts +++ b/src/server/api/logger.ts @@ -1,3 +1,3 @@ -import Logger from '@/services/logger.js'; +import Logger from '@/services/logger'; export const apiLogger = new Logger('api'); diff --git a/src/server/api/openapi/description.ts b/src/server/api/openapi/description.ts index b9e544b04c..e51b312259 100644 --- a/src/server/api/openapi/description.ts +++ b/src/server/api/openapi/description.ts @@ -1,6 +1,6 @@ -import endpoints from '../endpoints.js'; -import * as locale from '../../../../locales/index.js'; -import { kinds as kindsList } from '@/misc/api-permissions.js'; +import endpoints from '../endpoints'; +import * as locale from '../../../../locales/index'; +import { kinds as kindsList } from '@/misc/api-permissions'; export interface IKindInfo { endpoints: string[]; diff --git a/src/server/api/openapi/gen-spec.ts b/src/server/api/openapi/gen-spec.ts index de87288b42..9db47c6dfc 100644 --- a/src/server/api/openapi/gen-spec.ts +++ b/src/server/api/openapi/gen-spec.ts @@ -1,9 +1,9 @@ -import endpoints from '../endpoints.js'; +import endpoints from '../endpoints'; import { Context } from 'cafy'; -import config from '@/config/index.js'; -import { errors as basicErrors } from './errors.js'; -import { schemas, convertSchemaToOpenApiSchema } from './schemas.js'; -import { getDescription } from './description.js'; +import config from '@/config/index'; +import { errors as basicErrors } from './errors'; +import { schemas, convertSchemaToOpenApiSchema } from './schemas'; +import { getDescription } from './description'; export function genOpenapiSpec(lang = 'ja-JP') { const spec = { diff --git a/src/server/api/openapi/schemas.ts b/src/server/api/openapi/schemas.ts index e8bbfe5277..5402dc6f48 100644 --- a/src/server/api/openapi/schemas.ts +++ b/src/server/api/openapi/schemas.ts @@ -1,26 +1,26 @@ -import { packedUserSchema } from '@/models/repositories/user.js'; -import { Schema } from '@/misc/schema.js'; -import { packedNoteSchema } from '@/models/repositories/note.js'; -import { packedUserListSchema } from '@/models/repositories/user-list.js'; -import { packedAppSchema } from '@/models/repositories/app.js'; -import { packedMessagingMessageSchema } from '@/models/repositories/messaging-message.js'; -import { packedNotificationSchema } from '@/models/repositories/notification.js'; -import { packedDriveFileSchema } from '@/models/repositories/drive-file.js'; -import { packedDriveFolderSchema } from '@/models/repositories/drive-folder.js'; -import { packedFollowingSchema } from '@/models/repositories/following.js'; -import { packedMutingSchema } from '@/models/repositories/muting.js'; -import { packedBlockingSchema } from '@/models/repositories/blocking.js'; -import { packedNoteReactionSchema } from '@/models/repositories/note-reaction.js'; -import { packedHashtagSchema } from '@/models/repositories/hashtag.js'; -import { packedPageSchema } from '@/models/repositories/page.js'; -import { packedUserGroupSchema } from '@/models/repositories/user-group.js'; -import { packedNoteFavoriteSchema } from '@/models/repositories/note-favorite.js'; -import { packedChannelSchema } from '@/models/repositories/channel.js'; -import { packedAntennaSchema } from '@/models/repositories/antenna.js'; -import { packedClipSchema } from '@/models/repositories/clip.js'; -import { packedFederationInstanceSchema } from '@/models/repositories/federation-instance.js'; -import { packedQueueCountSchema } from '@/models/repositories/queue.js'; -import { packedGalleryPostSchema } from '@/models/repositories/gallery-post.js'; +import { packedUserSchema } from '@/models/repositories/user'; +import { Schema } from '@/misc/schema'; +import { packedNoteSchema } from '@/models/repositories/note'; +import { packedUserListSchema } from '@/models/repositories/user-list'; +import { packedAppSchema } from '@/models/repositories/app'; +import { packedMessagingMessageSchema } from '@/models/repositories/messaging-message'; +import { packedNotificationSchema } from '@/models/repositories/notification'; +import { packedDriveFileSchema } from '@/models/repositories/drive-file'; +import { packedDriveFolderSchema } from '@/models/repositories/drive-folder'; +import { packedFollowingSchema } from '@/models/repositories/following'; +import { packedMutingSchema } from '@/models/repositories/muting'; +import { packedBlockingSchema } from '@/models/repositories/blocking'; +import { packedNoteReactionSchema } from '@/models/repositories/note-reaction'; +import { packedHashtagSchema } from '@/models/repositories/hashtag'; +import { packedPageSchema } from '@/models/repositories/page'; +import { packedUserGroupSchema } from '@/models/repositories/user-group'; +import { packedNoteFavoriteSchema } from '@/models/repositories/note-favorite'; +import { packedChannelSchema } from '@/models/repositories/channel'; +import { packedAntennaSchema } from '@/models/repositories/antenna'; +import { packedClipSchema } from '@/models/repositories/clip'; +import { packedFederationInstanceSchema } from '@/models/repositories/federation-instance'; +import { packedQueueCountSchema } from '@/models/repositories/queue'; +import { packedGalleryPostSchema } from '@/models/repositories/gallery-post'; export function convertSchemaToOpenApiSchema(schema: Schema) { const res: any = schema; diff --git a/src/server/api/private/signin.ts b/src/server/api/private/signin.ts index 1eda141919..fff1037ff9 100644 --- a/src/server/api/private/signin.ts +++ b/src/server/api/private/signin.ts @@ -1,12 +1,12 @@ import * as Koa from 'koa'; import * as bcrypt from 'bcryptjs'; import * as speakeasy from 'speakeasy'; -import signin from '../common/signin.js'; -import config from '@/config/index.js'; -import { Users, Signins, UserProfiles, UserSecurityKeys, AttestationChallenges } from '@/models/index.js'; -import { ILocalUser } from '@/models/entities/user.js'; -import { genId } from '@/misc/gen-id.js'; -import { verifyLogin, hash } from '../2fa.js'; +import signin from '../common/signin'; +import config from '@/config/index'; +import { Users, Signins, UserProfiles, UserSecurityKeys, AttestationChallenges } from '@/models/index'; +import { ILocalUser } from '@/models/entities/user'; +import { genId } from '@/misc/gen-id'; +import { verifyLogin, hash } from '../2fa'; import { randomBytes } from 'crypto'; export default async (ctx: Koa.Context) => { diff --git a/src/server/api/private/signup.ts b/src/server/api/private/signup.ts index e554b49a63..ef61767f65 100644 --- a/src/server/api/private/signup.ts +++ b/src/server/api/private/signup.ts @@ -1,8 +1,8 @@ import * as Koa from 'koa'; -import { fetchMeta } from '@/misc/fetch-meta.js'; -import { verifyHcaptcha, verifyRecaptcha } from '@/misc/captcha.js'; -import { Users, RegistrationTickets } from '@/models/index.js'; -import { signup } from '../common/signup.js'; +import { fetchMeta } from '@/misc/fetch-meta'; +import { verifyHcaptcha, verifyRecaptcha } from '@/misc/captcha'; +import { Users, RegistrationTickets } from '@/models/index'; +import { signup } from '../common/signup'; export default async (ctx: Koa.Context) => { const body = ctx.request.body; diff --git a/src/server/api/service/discord.ts b/src/server/api/service/discord.ts index 986a4d184c..dd52a23376 100644 --- a/src/server/api/service/discord.ts +++ b/src/server/api/service/discord.ts @@ -1,15 +1,15 @@ import * as Koa from 'koa'; import * as Router from '@koa/router'; -import { getJson } from '@/misc/fetch.js'; +import { getJson } from '@/misc/fetch'; import { OAuth2 } from 'oauth'; -import config from '@/config/index.js'; -import { publishMainStream } from '@/services/stream.js'; -import { redisClient } from '../../../db/redis.js'; +import config from '@/config/index'; +import { publishMainStream } from '@/services/stream'; +import { redisClient } from '../../../db/redis'; import { v4 as uuid } from 'uuid'; -import signin from '../common/signin.js'; -import { fetchMeta } from '@/misc/fetch-meta.js'; -import { Users, UserProfiles } from '@/models/index.js'; -import { ILocalUser } from '@/models/entities/user.js'; +import signin from '../common/signin'; +import { fetchMeta } from '@/misc/fetch-meta'; +import { Users, UserProfiles } from '@/models/index'; +import { ILocalUser } from '@/models/entities/user'; function getUserToken(ctx: Koa.Context) { return ((ctx.headers['cookie'] || '').match(/igi=(\w+)/) || [null, null])[1]; diff --git a/src/server/api/service/github.ts b/src/server/api/service/github.ts index 841b8e5d12..0616f3f773 100644 --- a/src/server/api/service/github.ts +++ b/src/server/api/service/github.ts @@ -1,15 +1,15 @@ import * as Koa from 'koa'; import * as Router from '@koa/router'; -import { getJson } from '@/misc/fetch.js'; +import { getJson } from '@/misc/fetch'; import { OAuth2 } from 'oauth'; -import config from '@/config/index.js'; -import { publishMainStream } from '@/services/stream.js'; -import { redisClient } from '../../../db/redis.js'; +import config from '@/config/index'; +import { publishMainStream } from '@/services/stream'; +import { redisClient } from '../../../db/redis'; import { v4 as uuid } from 'uuid'; -import signin from '../common/signin.js'; -import { fetchMeta } from '@/misc/fetch-meta.js'; -import { Users, UserProfiles } from '@/models/index.js'; -import { ILocalUser } from '@/models/entities/user.js'; +import signin from '../common/signin'; +import { fetchMeta } from '@/misc/fetch-meta'; +import { Users, UserProfiles } from '@/models/index'; +import { ILocalUser } from '@/models/entities/user'; function getUserToken(ctx: Koa.Context) { return ((ctx.headers['cookie'] || '').match(/igi=(\w+)/) || [null, null])[1]; diff --git a/src/server/api/service/twitter.ts b/src/server/api/service/twitter.ts index 5b08e0533a..8a6a58aeee 100644 --- a/src/server/api/service/twitter.ts +++ b/src/server/api/service/twitter.ts @@ -2,13 +2,13 @@ import * as Koa from 'koa'; import * as Router from '@koa/router'; import { v4 as uuid } from 'uuid'; import autwh from 'autwh'; -import { redisClient } from '../../../db/redis.js'; -import { publishMainStream } from '@/services/stream.js'; -import config from '@/config/index.js'; -import signin from '../common/signin.js'; -import { fetchMeta } from '@/misc/fetch-meta.js'; -import { Users, UserProfiles } from '@/models/index.js'; -import { ILocalUser } from '@/models/entities/user.js'; +import { redisClient } from '../../../db/redis'; +import { publishMainStream } from '@/services/stream'; +import config from '@/config/index'; +import signin from '../common/signin'; +import { fetchMeta } from '@/misc/fetch-meta'; +import { Users, UserProfiles } from '@/models/index'; +import { ILocalUser } from '@/models/entities/user'; function getUserToken(ctx: Koa.Context) { return ((ctx.headers['cookie'] || '').match(/igi=(\w+)/) || [null, null])[1]; diff --git a/src/server/api/stream/channels/admin.ts b/src/server/api/stream/channels/admin.ts index e68490d05c..1ff932d1dd 100644 --- a/src/server/api/stream/channels/admin.ts +++ b/src/server/api/stream/channels/admin.ts @@ -1,5 +1,5 @@ import autobind from 'autobind-decorator'; -import Channel from '../channel.js'; +import Channel from '../channel'; export default class extends Channel { public readonly chName = 'admin'; diff --git a/src/server/api/stream/channels/antenna.ts b/src/server/api/stream/channels/antenna.ts index 6c672ffd65..bf9c53c453 100644 --- a/src/server/api/stream/channels/antenna.ts +++ b/src/server/api/stream/channels/antenna.ts @@ -1,8 +1,8 @@ import autobind from 'autobind-decorator'; -import Channel from '../channel.js'; -import { Notes } from '@/models/index.js'; -import { isMutedUserRelated } from '@/misc/is-muted-user-related.js'; -import { isBlockerUserRelated } from '@/misc/is-blocker-user-related.js'; +import Channel from '../channel'; +import { Notes } from '@/models/index'; +import { isMutedUserRelated } from '@/misc/is-muted-user-related'; +import { isBlockerUserRelated } from '@/misc/is-blocker-user-related'; export default class extends Channel { public readonly chName = 'antenna'; diff --git a/src/server/api/stream/channels/channel.ts b/src/server/api/stream/channels/channel.ts index 8665c8253d..e6a9a6c696 100644 --- a/src/server/api/stream/channels/channel.ts +++ b/src/server/api/stream/channels/channel.ts @@ -1,10 +1,10 @@ import autobind from 'autobind-decorator'; -import Channel from '../channel.js'; -import { Notes, Users } from '@/models/index.js'; -import { isMutedUserRelated } from '@/misc/is-muted-user-related.js'; -import { isBlockerUserRelated } from '@/misc/is-blocker-user-related.js'; -import { PackedNote } from '@/models/repositories/note.js'; -import { User } from '@/models/entities/user.js'; +import Channel from '../channel'; +import { Notes, Users } from '@/models/index'; +import { isMutedUserRelated } from '@/misc/is-muted-user-related'; +import { isBlockerUserRelated } from '@/misc/is-blocker-user-related'; +import { PackedNote } from '@/models/repositories/note'; +import { User } from '@/models/entities/user'; export default class extends Channel { public readonly chName = 'channel'; diff --git a/src/server/api/stream/channels/drive.ts b/src/server/api/stream/channels/drive.ts index 66f2647942..4112dd9b04 100644 --- a/src/server/api/stream/channels/drive.ts +++ b/src/server/api/stream/channels/drive.ts @@ -1,5 +1,5 @@ import autobind from 'autobind-decorator'; -import Channel from '../channel.js'; +import Channel from '../channel'; export default class extends Channel { public readonly chName = 'drive'; diff --git a/src/server/api/stream/channels/games/reversi-game.ts b/src/server/api/stream/channels/games/reversi-game.ts index a13d79d3c3..bfdbf1d266 100644 --- a/src/server/api/stream/channels/games/reversi-game.ts +++ b/src/server/api/stream/channels/games/reversi-game.ts @@ -1,12 +1,12 @@ import autobind from 'autobind-decorator'; import * as CRC32 from 'crc-32'; -import { publishReversiGameStream } from '@/services/stream.js'; -import Reversi from '../../../../../games/reversi/core.js'; -import * as maps from '../../../../../games/reversi/maps.js'; -import Channel from '../../channel.js'; -import { ReversiGame } from '@/models/entities/games/reversi/game.js'; -import { ReversiGames, Users } from '@/models/index.js'; -import { User } from '@/models/entities/user.js'; +import { publishReversiGameStream } from '@/services/stream'; +import Reversi from '../../../../../games/reversi/core'; +import * as maps from '../../../../../games/reversi/maps'; +import Channel from '../../channel'; +import { ReversiGame } from '@/models/entities/games/reversi/game'; +import { ReversiGames, Users } from '@/models/index'; +import { User } from '@/models/entities/user'; export default class extends Channel { public readonly chName = 'gamesReversiGame'; diff --git a/src/server/api/stream/channels/games/reversi.ts b/src/server/api/stream/channels/games/reversi.ts index f8fa7b94e1..3b89aac35c 100644 --- a/src/server/api/stream/channels/games/reversi.ts +++ b/src/server/api/stream/channels/games/reversi.ts @@ -1,7 +1,7 @@ import autobind from 'autobind-decorator'; -import { publishMainStream } from '@/services/stream.js'; -import Channel from '../../channel.js'; -import { ReversiMatchings } from '@/models/index.js'; +import { publishMainStream } from '@/services/stream'; +import Channel from '../../channel'; +import { ReversiMatchings } from '@/models/index'; export default class extends Channel { public readonly chName = 'gamesReversi'; diff --git a/src/server/api/stream/channels/global-timeline.ts b/src/server/api/stream/channels/global-timeline.ts index 1e1e8b5c96..2cb138966f 100644 --- a/src/server/api/stream/channels/global-timeline.ts +++ b/src/server/api/stream/channels/global-timeline.ts @@ -1,11 +1,11 @@ import autobind from 'autobind-decorator'; -import { isMutedUserRelated } from '@/misc/is-muted-user-related.js'; -import Channel from '../channel.js'; -import { fetchMeta } from '@/misc/fetch-meta.js'; -import { Notes } from '@/models/index.js'; -import { PackedNote } from '@/models/repositories/note.js'; -import { checkWordMute } from '@/misc/check-word-mute.js'; -import { isBlockerUserRelated } from '@/misc/is-blocker-user-related.js'; +import { isMutedUserRelated } from '@/misc/is-muted-user-related'; +import Channel from '../channel'; +import { fetchMeta } from '@/misc/fetch-meta'; +import { Notes } from '@/models/index'; +import { PackedNote } from '@/models/repositories/note'; +import { checkWordMute } from '@/misc/check-word-mute'; +import { isBlockerUserRelated } from '@/misc/is-blocker-user-related'; export default class extends Channel { public readonly chName = 'globalTimeline'; diff --git a/src/server/api/stream/channels/hashtag.ts b/src/server/api/stream/channels/hashtag.ts index 8a5b7a267d..997ab75f6d 100644 --- a/src/server/api/stream/channels/hashtag.ts +++ b/src/server/api/stream/channels/hashtag.ts @@ -1,10 +1,10 @@ import autobind from 'autobind-decorator'; -import { isMutedUserRelated } from '@/misc/is-muted-user-related.js'; -import Channel from '../channel.js'; -import { Notes } from '@/models/index.js'; -import { PackedNote } from '@/models/repositories/note.js'; -import { normalizeForSearch } from '@/misc/normalize-for-search.js'; -import { isBlockerUserRelated } from '@/misc/is-blocker-user-related.js'; +import { isMutedUserRelated } from '@/misc/is-muted-user-related'; +import Channel from '../channel'; +import { Notes } from '@/models/index'; +import { PackedNote } from '@/models/repositories/note'; +import { normalizeForSearch } from '@/misc/normalize-for-search'; +import { isBlockerUserRelated } from '@/misc/is-blocker-user-related'; export default class extends Channel { public readonly chName = 'hashtag'; diff --git a/src/server/api/stream/channels/home-timeline.ts b/src/server/api/stream/channels/home-timeline.ts index e19cd077c3..c7a9728741 100644 --- a/src/server/api/stream/channels/home-timeline.ts +++ b/src/server/api/stream/channels/home-timeline.ts @@ -1,10 +1,10 @@ import autobind from 'autobind-decorator'; -import { isMutedUserRelated } from '@/misc/is-muted-user-related.js'; -import Channel from '../channel.js'; -import { Notes } from '@/models/index.js'; -import { PackedNote } from '@/models/repositories/note.js'; -import { checkWordMute } from '@/misc/check-word-mute.js'; -import { isBlockerUserRelated } from '@/misc/is-blocker-user-related.js'; +import { isMutedUserRelated } from '@/misc/is-muted-user-related'; +import Channel from '../channel'; +import { Notes } from '@/models/index'; +import { PackedNote } from '@/models/repositories/note'; +import { checkWordMute } from '@/misc/check-word-mute'; +import { isBlockerUserRelated } from '@/misc/is-blocker-user-related'; export default class extends Channel { public readonly chName = 'homeTimeline'; diff --git a/src/server/api/stream/channels/hybrid-timeline.ts b/src/server/api/stream/channels/hybrid-timeline.ts index 4d48075af6..5c454764ec 100644 --- a/src/server/api/stream/channels/hybrid-timeline.ts +++ b/src/server/api/stream/channels/hybrid-timeline.ts @@ -1,12 +1,12 @@ import autobind from 'autobind-decorator'; -import { isMutedUserRelated } from '@/misc/is-muted-user-related.js'; -import Channel from '../channel.js'; -import { fetchMeta } from '@/misc/fetch-meta.js'; -import { Notes } from '@/models/index.js'; -import { PackedNote } from '@/models/repositories/note.js'; -import { PackedUser } from '@/models/repositories/user.js'; -import { checkWordMute } from '@/misc/check-word-mute.js'; -import { isBlockerUserRelated } from '@/misc/is-blocker-user-related.js'; +import { isMutedUserRelated } from '@/misc/is-muted-user-related'; +import Channel from '../channel'; +import { fetchMeta } from '@/misc/fetch-meta'; +import { Notes } from '@/models/index'; +import { PackedNote } from '@/models/repositories/note'; +import { PackedUser } from '@/models/repositories/user'; +import { checkWordMute } from '@/misc/check-word-mute'; +import { isBlockerUserRelated } from '@/misc/is-blocker-user-related'; export default class extends Channel { public readonly chName = 'hybridTimeline'; diff --git a/src/server/api/stream/channels/index.ts b/src/server/api/stream/channels/index.ts index 39f4d235f1..1841573043 100644 --- a/src/server/api/stream/channels/index.ts +++ b/src/server/api/stream/channels/index.ts @@ -1,20 +1,20 @@ -import main from './main.js'; -import homeTimeline from './home-timeline.js'; -import localTimeline from './local-timeline.js'; -import hybridTimeline from './hybrid-timeline.js'; -import globalTimeline from './global-timeline.js'; -import serverStats from './server-stats.js'; -import queueStats from './queue-stats.js'; -import userList from './user-list.js'; -import antenna from './antenna.js'; -import messaging from './messaging.js'; -import messagingIndex from './messaging-index.js'; -import drive from './drive.js'; -import hashtag from './hashtag.js'; -import channel from './channel.js'; -import admin from './admin.js'; -import gamesReversi from './games/reversi.js'; -import gamesReversiGame from './games/reversi-game.js'; +import main from './main'; +import homeTimeline from './home-timeline'; +import localTimeline from './local-timeline'; +import hybridTimeline from './hybrid-timeline'; +import globalTimeline from './global-timeline'; +import serverStats from './server-stats'; +import queueStats from './queue-stats'; +import userList from './user-list'; +import antenna from './antenna'; +import messaging from './messaging'; +import messagingIndex from './messaging-index'; +import drive from './drive'; +import hashtag from './hashtag'; +import channel from './channel'; +import admin from './admin'; +import gamesReversi from './games/reversi'; +import gamesReversiGame from './games/reversi-game'; export default { main, diff --git a/src/server/api/stream/channels/local-timeline.ts b/src/server/api/stream/channels/local-timeline.ts index c01ca5347b..4bf0d02ed3 100644 --- a/src/server/api/stream/channels/local-timeline.ts +++ b/src/server/api/stream/channels/local-timeline.ts @@ -1,12 +1,12 @@ import autobind from 'autobind-decorator'; -import { isMutedUserRelated } from '@/misc/is-muted-user-related.js'; -import Channel from '../channel.js'; -import { fetchMeta } from '@/misc/fetch-meta.js'; -import { Notes } from '@/models/index.js'; -import { PackedNote } from '@/models/repositories/note.js'; -import { PackedUser } from '@/models/repositories/user.js'; -import { checkWordMute } from '@/misc/check-word-mute.js'; -import { isBlockerUserRelated } from '@/misc/is-blocker-user-related.js'; +import { isMutedUserRelated } from '@/misc/is-muted-user-related'; +import Channel from '../channel'; +import { fetchMeta } from '@/misc/fetch-meta'; +import { Notes } from '@/models/index'; +import { PackedNote } from '@/models/repositories/note'; +import { PackedUser } from '@/models/repositories/user'; +import { checkWordMute } from '@/misc/check-word-mute'; +import { isBlockerUserRelated } from '@/misc/is-blocker-user-related'; export default class extends Channel { public readonly chName = 'localTimeline'; diff --git a/src/server/api/stream/channels/main.ts b/src/server/api/stream/channels/main.ts index 103c61a0fb..b99cb931da 100644 --- a/src/server/api/stream/channels/main.ts +++ b/src/server/api/stream/channels/main.ts @@ -1,6 +1,6 @@ import autobind from 'autobind-decorator'; -import Channel from '../channel.js'; -import { Notes } from '@/models/index.js'; +import Channel from '../channel'; +import { Notes } from '@/models/index'; export default class extends Channel { public readonly chName = 'main'; diff --git a/src/server/api/stream/channels/messaging-index.ts b/src/server/api/stream/channels/messaging-index.ts index 24f8aad400..0c495398ab 100644 --- a/src/server/api/stream/channels/messaging-index.ts +++ b/src/server/api/stream/channels/messaging-index.ts @@ -1,5 +1,5 @@ import autobind from 'autobind-decorator'; -import Channel from '../channel.js'; +import Channel from '../channel'; export default class extends Channel { public readonly chName = 'messagingIndex'; diff --git a/src/server/api/stream/channels/messaging.ts b/src/server/api/stream/channels/messaging.ts index c16507a5f3..015b0a7650 100644 --- a/src/server/api/stream/channels/messaging.ts +++ b/src/server/api/stream/channels/messaging.ts @@ -1,8 +1,8 @@ import autobind from 'autobind-decorator'; -import { readUserMessagingMessage, readGroupMessagingMessage, deliverReadActivity } from '../../common/read-messaging-message.js'; -import Channel from '../channel.js'; -import { UserGroupJoinings, Users, MessagingMessages } from '@/models/index.js'; -import { User, ILocalUser, IRemoteUser } from '@/models/entities/user.js'; +import { readUserMessagingMessage, readGroupMessagingMessage, deliverReadActivity } from '../../common/read-messaging-message'; +import Channel from '../channel'; +import { UserGroupJoinings, Users, MessagingMessages } from '@/models/index'; +import { User, ILocalUser, IRemoteUser } from '@/models/entities/user'; export default class extends Channel { public readonly chName = 'messaging'; diff --git a/src/server/api/stream/channels/queue-stats.ts b/src/server/api/stream/channels/queue-stats.ts index f05e619b96..0bda0cfcb9 100644 --- a/src/server/api/stream/channels/queue-stats.ts +++ b/src/server/api/stream/channels/queue-stats.ts @@ -1,6 +1,6 @@ import autobind from 'autobind-decorator'; import Xev from 'xev'; -import Channel from '../channel.js'; +import Channel from '../channel'; const ev = new Xev(); diff --git a/src/server/api/stream/channels/server-stats.ts b/src/server/api/stream/channels/server-stats.ts index 76eb5b0f26..d245a7f70c 100644 --- a/src/server/api/stream/channels/server-stats.ts +++ b/src/server/api/stream/channels/server-stats.ts @@ -1,6 +1,6 @@ import autobind from 'autobind-decorator'; import Xev from 'xev'; -import Channel from '../channel.js'; +import Channel from '../channel'; const ev = new Xev(); diff --git a/src/server/api/stream/channels/user-list.ts b/src/server/api/stream/channels/user-list.ts index ca8e46d507..0ca83cd658 100644 --- a/src/server/api/stream/channels/user-list.ts +++ b/src/server/api/stream/channels/user-list.ts @@ -1,10 +1,10 @@ import autobind from 'autobind-decorator'; -import Channel from '../channel.js'; -import { Notes, UserListJoinings, UserLists } from '@/models/index.js'; -import { isMutedUserRelated } from '@/misc/is-muted-user-related.js'; -import { User } from '@/models/entities/user.js'; -import { PackedNote } from '@/models/repositories/note.js'; -import { isBlockerUserRelated } from '@/misc/is-blocker-user-related.js'; +import Channel from '../channel'; +import { Notes, UserListJoinings, UserLists } from '@/models/index'; +import { isMutedUserRelated } from '@/misc/is-muted-user-related'; +import { User } from '@/models/entities/user'; +import { PackedNote } from '@/models/repositories/note'; +import { isBlockerUserRelated } from '@/misc/is-blocker-user-related'; export default class extends Channel { public readonly chName = 'userList'; diff --git a/src/server/api/stream/index.ts b/src/server/api/stream/index.ts index 1947be0a75..469f28f11c 100644 --- a/src/server/api/stream/index.ts +++ b/src/server/api/stream/index.ts @@ -1,20 +1,20 @@ import autobind from 'autobind-decorator'; import * as websocket from 'websocket'; -import { readNotification } from '../common/read-notification.js'; -import call from '../call.js'; -import readNote from '@/services/note/read.js'; -import Channel from './channel.js'; -import channels from './channels/index.js'; +import { readNotification } from '../common/read-notification'; +import call from '../call'; +import readNote from '@/services/note/read'; +import Channel from './channel'; +import channels from './channels/index'; import { EventEmitter } from 'events'; -import { User } from '@/models/entities/user.js'; -import { Channel as ChannelModel } from '@/models/entities/channel.js'; -import { Users, Followings, Mutings, UserProfiles, ChannelFollowings, Blockings } from '@/models/index.js'; -import { ApiError } from '../error.js'; -import { AccessToken } from '@/models/entities/access-token.js'; -import { UserProfile } from '@/models/entities/user-profile.js'; -import { publishChannelStream, publishGroupMessagingStream, publishMessagingStream } from '@/services/stream.js'; -import { UserGroup } from '@/models/entities/user-group.js'; -import { PackedNote } from '@/models/repositories/note.js'; +import { User } from '@/models/entities/user'; +import { Channel as ChannelModel } from '@/models/entities/channel'; +import { Users, Followings, Mutings, UserProfiles, ChannelFollowings, Blockings } from '@/models/index'; +import { ApiError } from '../error'; +import { AccessToken } from '@/models/entities/access-token'; +import { UserProfile } from '@/models/entities/user-profile'; +import { publishChannelStream, publishGroupMessagingStream, publishMessagingStream } from '@/services/stream'; +import { UserGroup } from '@/models/entities/user-group'; +import { PackedNote } from '@/models/repositories/note'; /** * Main stream connection diff --git a/src/server/api/streaming.ts b/src/server/api/streaming.ts index 115692bed0..8808bc9860 100644 --- a/src/server/api/streaming.ts +++ b/src/server/api/streaming.ts @@ -1,12 +1,12 @@ import * as http from 'http'; import * as websocket from 'websocket'; -import MainStreamConnection from './stream/index.js'; +import MainStreamConnection from './stream/index'; import { ParsedUrlQuery } from 'querystring'; -import authenticate from './authenticate.js'; +import authenticate from './authenticate'; import { EventEmitter } from 'events'; -import { subsdcriber as redisClient } from '../../db/redis.js'; -import { Users } from '@/models/index.js'; +import { subsdcriber as redisClient } from '../../db/redis'; +import { Users } from '@/models/index'; module.exports = (server: http.Server) => { // Init websocket server diff --git a/src/server/file/index.ts b/src/server/file/index.ts index c58c3cbf25..9b5d8f7267 100644 --- a/src/server/file/index.ts +++ b/src/server/file/index.ts @@ -8,7 +8,7 @@ import { dirname } from 'path'; import * as Koa from 'koa'; import * as cors from '@koa/cors'; import * as Router from '@koa/router'; -import sendDriveFile from './send-drive-file.js'; +import sendDriveFile from './send-drive-file'; //const _filename = fileURLToPath(import.meta.url); const _filename = __filename; diff --git a/src/server/file/send-drive-file.ts b/src/server/file/send-drive-file.ts index f4f4bdb3c7..c455de6447 100644 --- a/src/server/file/send-drive-file.ts +++ b/src/server/file/send-drive-file.ts @@ -5,14 +5,14 @@ import * as Koa from 'koa'; import * as send from 'koa-send'; import * as rename from 'rename'; import * as tmp from 'tmp'; -import { serverLogger } from '../index.js'; -import { contentDisposition } from '@/misc/content-disposition.js'; -import { DriveFiles } from '@/models/index.js'; -import { InternalStorage } from '@/services/drive/internal-storage.js'; -import { downloadUrl } from '@/misc/download-url.js'; -import { detectType } from '@/misc/get-file-info.js'; -import { convertToJpeg, convertToPngOrJpeg } from '@/services/drive/image-processor.js'; -import { GenerateVideoThumbnail } from '@/services/drive/generate-video-thumbnail.js'; +import { serverLogger } from '../index'; +import { contentDisposition } from '@/misc/content-disposition'; +import { DriveFiles } from '@/models/index'; +import { InternalStorage } from '@/services/drive/internal-storage'; +import { downloadUrl } from '@/misc/download-url'; +import { detectType } from '@/misc/get-file-info'; +import { convertToJpeg, convertToPngOrJpeg } from '@/services/drive/image-processor'; +import { GenerateVideoThumbnail } from '@/services/drive/generate-video-thumbnail'; //const _filename = fileURLToPath(import.meta.url); const _filename = __filename; diff --git a/src/server/index.ts b/src/server/index.ts index bf83b7dd42..a9904accb4 100644 --- a/src/server/index.ts +++ b/src/server/index.ts @@ -13,19 +13,19 @@ import * as koaLogger from 'koa-logger'; import * as requestStats from 'request-stats'; import * as slow from 'koa-slow'; -import activityPub from './activitypub.js'; -import nodeinfo from './nodeinfo.js'; -import wellKnown from './well-known.js'; -import config from '@/config/index.js'; -import apiServer from './api/index.js'; -import { sum } from '../prelude/array.js'; -import Logger from '@/services/logger.js'; -import { program } from '../argv.js'; -import { UserProfiles, Users } from '@/models/index.js'; -import { networkChart } from '@/services/chart/index.js'; -import { genAvatar } from '@/misc/gen-avatar.js'; -import { createTemp } from '@/misc/create-temp.js'; -import { publishMainStream } from '@/services/stream.js'; +import activityPub from './activitypub'; +import nodeinfo from './nodeinfo'; +import wellKnown from './well-known'; +import config from '@/config/index'; +import apiServer from './api/index'; +import { sum } from '../prelude/array'; +import Logger from '@/services/logger'; +import { program } from '../argv'; +import { UserProfiles, Users } from '@/models/index'; +import { networkChart } from '@/services/chart/index'; +import { genAvatar } from '@/misc/gen-avatar'; +import { createTemp } from '@/misc/create-temp'; +import { publishMainStream } from '@/services/stream'; export const serverLogger = new Logger('server', 'gray', false); diff --git a/src/server/nodeinfo.ts b/src/server/nodeinfo.ts index 3600bd2acd..dec2615086 100644 --- a/src/server/nodeinfo.ts +++ b/src/server/nodeinfo.ts @@ -1,9 +1,9 @@ import * as Router from '@koa/router'; -import config from '@/config/index.js'; -import { fetchMeta } from '@/misc/fetch-meta.js'; -import { Users } from '@/models/index.js'; -// import User from '../models/user.js'; -// import Note from '../models/note.js'; +import config from '@/config/index'; +import { fetchMeta } from '@/misc/fetch-meta'; +import { Users } from '@/models/index'; +// import User from '../models/user'; +// import Note from '../models/note'; const router = new Router(); diff --git a/src/server/proxy/index.ts b/src/server/proxy/index.ts index 210c2fcf12..9ef198d31b 100644 --- a/src/server/proxy/index.ts +++ b/src/server/proxy/index.ts @@ -5,7 +5,7 @@ import * as Koa from 'koa'; import * as cors from '@koa/cors'; import * as Router from '@koa/router'; -import { proxyMedia } from './proxy-media.js'; +import { proxyMedia } from './proxy-media'; // Init app const app = new Koa(); diff --git a/src/server/proxy/proxy-media.ts b/src/server/proxy/proxy-media.ts index 3200266bed..fb38a5c07b 100644 --- a/src/server/proxy/proxy-media.ts +++ b/src/server/proxy/proxy-media.ts @@ -1,10 +1,10 @@ import * as fs from 'fs'; import * as Koa from 'koa'; -import { serverLogger } from '../index.js'; -import { IImage, convertToPng, convertToJpeg } from '@/services/drive/image-processor.js'; -import { createTemp } from '@/misc/create-temp.js'; -import { downloadUrl } from '@/misc/download-url.js'; -import { detectType } from '@/misc/get-file-info.js'; +import { serverLogger } from '../index'; +import { IImage, convertToPng, convertToJpeg } from '@/services/drive/image-processor'; +import { createTemp } from '@/misc/create-temp'; +import { downloadUrl } from '@/misc/download-url'; +import { detectType } from '@/misc/get-file-info'; export async function proxyMedia(ctx: Koa.Context) { const url = 'url' in ctx.query ? ctx.query.url : 'https://' + ctx.params.url; diff --git a/src/server/web/feed.ts b/src/server/web/feed.ts index 57b1401e35..4b6de517b7 100644 --- a/src/server/web/feed.ts +++ b/src/server/web/feed.ts @@ -1,7 +1,7 @@ import { Feed } from 'feed'; -import config from '@/config/index.js'; -import { User } from '@/models/entities/user.js'; -import { Notes, DriveFiles, UserProfiles } from '@/models/index.js'; +import config from '@/config/index'; +import { User } from '@/models/entities/user'; +import { Notes, DriveFiles, UserProfiles } from '@/models/index'; import { In } from 'typeorm'; export default async function(user: User) { diff --git a/src/server/web/index.ts b/src/server/web/index.ts index 68cfc5d0f0..eae00588c6 100644 --- a/src/server/web/index.ts +++ b/src/server/web/index.ts @@ -15,16 +15,16 @@ import * as views from 'koa-views'; import * as glob from 'glob'; import * as MarkdownIt from 'markdown-it'; -import packFeed from './feed.js'; -import { fetchMeta } from '@/misc/fetch-meta.js'; -import { genOpenapiSpec } from '../api/openapi/gen-spec.js'; -import config from '@/config/index.js'; -import { Users, Notes, Emojis, UserProfiles, Pages, Channels, Clips, GalleryPosts } from '@/models/index.js'; -import { parseAcct } from '@/misc/acct.js'; -import { getNoteSummary } from '@/misc/get-note-summary.js'; +import packFeed from './feed'; +import { fetchMeta } from '@/misc/fetch-meta'; +import { genOpenapiSpec } from '../api/openapi/gen-spec'; +import config from '@/config/index'; +import { Users, Notes, Emojis, UserProfiles, Pages, Channels, Clips, GalleryPosts } from '@/models/index'; +import { parseAcct } from '@/misc/acct'; +import { getNoteSummary } from '@/misc/get-note-summary'; import { getConnection } from 'typeorm'; -import { redisClient } from '../../db/redis.js'; -import locales from '../../../locales/index.js'; +import { redisClient } from '../../db/redis'; +import locales from '../../../locales/index'; //const _filename = fileURLToPath(import.meta.url); const _filename = __filename; diff --git a/src/server/web/manifest.ts b/src/server/web/manifest.ts index a35b2a5696..918fe27c03 100644 --- a/src/server/web/manifest.ts +++ b/src/server/web/manifest.ts @@ -1,6 +1,6 @@ import * as Koa from 'koa'; import * as manifest from './manifest.json'; -import { fetchMeta } from '@/misc/fetch-meta.js'; +import { fetchMeta } from '@/misc/fetch-meta'; module.exports = async (ctx: Koa.Context) => { const json = JSON.parse(JSON.stringify(manifest)); diff --git a/src/server/web/url-preview.ts b/src/server/web/url-preview.ts index af9e2c77f5..619335634c 100644 --- a/src/server/web/url-preview.ts +++ b/src/server/web/url-preview.ts @@ -1,10 +1,10 @@ import * as Koa from 'koa'; import summaly from 'summaly'; -import { fetchMeta } from '@/misc/fetch-meta.js'; -import Logger from '@/services/logger.js'; -import config from '@/config/index.js'; -import { query } from '../../prelude/url.js'; -import { getJson } from '@/misc/fetch.js'; +import { fetchMeta } from '@/misc/fetch-meta'; +import Logger from '@/services/logger'; +import config from '@/config/index'; +import { query } from '../../prelude/url'; +import { getJson } from '@/misc/fetch'; const logger = new Logger('url-preview'); diff --git a/src/server/well-known.ts b/src/server/well-known.ts index d5fd44069d..11ad22c580 100644 --- a/src/server/well-known.ts +++ b/src/server/well-known.ts @@ -1,11 +1,11 @@ import * as Router from '@koa/router'; -import config from '@/config/index.js'; -import { parseAcct, Acct } from '@/misc/acct.js'; -import { links } from './nodeinfo.js'; -import { escapeAttribute, escapeValue } from '../prelude/xml.js'; -import { Users } from '@/models/index.js'; -import { User } from '@/models/entities/user.js'; +import config from '@/config/index'; +import { parseAcct, Acct } from '@/misc/acct'; +import { links } from './nodeinfo'; +import { escapeAttribute, escapeValue } from '../prelude/xml'; +import { Users } from '@/models/index'; +import { User } from '@/models/entities/user'; // Init router const router = new Router(); diff --git a/src/services/add-note-to-antenna.ts b/src/services/add-note-to-antenna.ts index f285b7a605..3aedbd2c32 100644 --- a/src/services/add-note-to-antenna.ts +++ b/src/services/add-note-to-antenna.ts @@ -1,10 +1,10 @@ -import { Antenna } from '@/models/entities/antenna.js'; -import { Note } from '@/models/entities/note.js'; -import { AntennaNotes, Mutings, Notes } from '@/models/index.js'; -import { genId } from '@/misc/gen-id.js'; -import { isMutedUserRelated } from '@/misc/is-muted-user-related.js'; -import { publishAntennaStream, publishMainStream } from '@/services/stream.js'; -import { User } from '@/models/entities/user.js'; +import { Antenna } from '@/models/entities/antenna'; +import { Note } from '@/models/entities/note'; +import { AntennaNotes, Mutings, Notes } from '@/models/index'; +import { genId } from '@/misc/gen-id'; +import { isMutedUserRelated } from '@/misc/is-muted-user-related'; +import { publishAntennaStream, publishMainStream } from '@/services/stream'; +import { User } from '@/models/entities/user'; export async function addNoteToAntenna(antenna: Antenna, note: Note, noteUser: { id: User['id']; }) { // 通知しない設定になっているか、自分自身の投稿なら既読にする diff --git a/src/services/blocking/create.ts b/src/services/blocking/create.ts index 415223f089..76c4bda9dc 100644 --- a/src/services/blocking/create.ts +++ b/src/services/blocking/create.ts @@ -1,14 +1,14 @@ -import { publishMainStream, publishUserEvent } from '@/services/stream.js'; -import { renderActivity } from '@/remote/activitypub/renderer/index.js'; -import renderFollow from '@/remote/activitypub/renderer/follow.js'; -import renderUndo from '@/remote/activitypub/renderer/undo.js'; -import renderBlock from '@/remote/activitypub/renderer/block.js'; -import { deliver } from '@/queue/index.js'; -import renderReject from '@/remote/activitypub/renderer/reject.js'; -import { User } from '@/models/entities/user.js'; -import { Blockings, Users, FollowRequests, Followings, UserListJoinings, UserLists } from '@/models/index.js'; -import { perUserFollowingChart } from '@/services/chart/index.js'; -import { genId } from '@/misc/gen-id.js'; +import { publishMainStream, publishUserEvent } from '@/services/stream'; +import { renderActivity } from '@/remote/activitypub/renderer/index'; +import renderFollow from '@/remote/activitypub/renderer/follow'; +import renderUndo from '@/remote/activitypub/renderer/undo'; +import renderBlock from '@/remote/activitypub/renderer/block'; +import { deliver } from '@/queue/index'; +import renderReject from '@/remote/activitypub/renderer/reject'; +import { User } from '@/models/entities/user'; +import { Blockings, Users, FollowRequests, Followings, UserListJoinings, UserLists } from '@/models/index'; +import { perUserFollowingChart } from '@/services/chart/index'; +import { genId } from '@/misc/gen-id'; export default async function(blocker: User, blockee: User) { await Promise.all([ diff --git a/src/services/blocking/delete.ts b/src/services/blocking/delete.ts index 240c0b15d1..de7efb1558 100644 --- a/src/services/blocking/delete.ts +++ b/src/services/blocking/delete.ts @@ -1,10 +1,10 @@ -import { renderActivity } from '@/remote/activitypub/renderer/index.js'; -import renderBlock from '@/remote/activitypub/renderer/block.js'; -import renderUndo from '@/remote/activitypub/renderer/undo.js'; -import { deliver } from '@/queue/index.js'; -import Logger from '../logger.js'; -import { User } from '@/models/entities/user.js'; -import { Blockings, Users } from '@/models/index.js'; +import { renderActivity } from '@/remote/activitypub/renderer/index'; +import renderBlock from '@/remote/activitypub/renderer/block'; +import renderUndo from '@/remote/activitypub/renderer/undo'; +import { deliver } from '@/queue/index'; +import Logger from '../logger'; +import { User } from '@/models/entities/user'; +import { Blockings, Users } from '@/models/index'; const logger = new Logger('blocking/delete'); diff --git a/src/services/chart/charts/classes/active-users.ts b/src/services/chart/charts/classes/active-users.ts index 959eb0f8e1..f80d8a3322 100644 --- a/src/services/chart/charts/classes/active-users.ts +++ b/src/services/chart/charts/classes/active-users.ts @@ -1,9 +1,9 @@ import autobind from 'autobind-decorator'; -import Chart, { Obj, DeepPartial } from '../../core.js'; -import { User } from '@/models/entities/user.js'; -import { SchemaType } from '@/misc/schema.js'; -import { Users } from '@/models/index.js'; -import { name, schema } from '../schemas/active-users.js'; +import Chart, { Obj, DeepPartial } from '../../core'; +import { User } from '@/models/entities/user'; +import { SchemaType } from '@/misc/schema'; +import { Users } from '@/models/index'; +import { name, schema } from '../schemas/active-users'; type ActiveUsersLog = SchemaType; diff --git a/src/services/chart/charts/classes/drive.ts b/src/services/chart/charts/classes/drive.ts index 9bd64074ed..93eabf3096 100644 --- a/src/services/chart/charts/classes/drive.ts +++ b/src/services/chart/charts/classes/drive.ts @@ -1,10 +1,10 @@ import autobind from 'autobind-decorator'; -import Chart, { Obj, DeepPartial } from '../../core.js'; -import { SchemaType } from '@/misc/schema.js'; -import { DriveFiles } from '@/models/index.js'; +import Chart, { Obj, DeepPartial } from '../../core'; +import { SchemaType } from '@/misc/schema'; +import { DriveFiles } from '@/models/index'; import { Not, IsNull } from 'typeorm'; -import { DriveFile } from '@/models/entities/drive-file.js'; -import { name, schema } from '../schemas/drive.js'; +import { DriveFile } from '@/models/entities/drive-file'; +import { name, schema } from '../schemas/drive'; type DriveLog = SchemaType; diff --git a/src/services/chart/charts/classes/federation.ts b/src/services/chart/charts/classes/federation.ts index 39feed7b14..5f918b294f 100644 --- a/src/services/chart/charts/classes/federation.ts +++ b/src/services/chart/charts/classes/federation.ts @@ -1,8 +1,8 @@ import autobind from 'autobind-decorator'; -import Chart, { Obj, DeepPartial } from '../../core.js'; -import { SchemaType } from '@/misc/schema.js'; -import { Instances } from '@/models/index.js'; -import { name, schema } from '../schemas/federation.js'; +import Chart, { Obj, DeepPartial } from '../../core'; +import { SchemaType } from '@/misc/schema'; +import { Instances } from '@/models/index'; +import { name, schema } from '../schemas/federation'; type FederationLog = SchemaType; diff --git a/src/services/chart/charts/classes/hashtag.ts b/src/services/chart/charts/classes/hashtag.ts index 13f4598499..f7f5e17dec 100644 --- a/src/services/chart/charts/classes/hashtag.ts +++ b/src/services/chart/charts/classes/hashtag.ts @@ -1,9 +1,9 @@ import autobind from 'autobind-decorator'; -import Chart, { Obj, DeepPartial } from '../../core.js'; -import { User } from '@/models/entities/user.js'; -import { SchemaType } from '@/misc/schema.js'; -import { Users } from '@/models/index.js'; -import { name, schema } from '../schemas/hashtag.js'; +import Chart, { Obj, DeepPartial } from '../../core'; +import { User } from '@/models/entities/user'; +import { SchemaType } from '@/misc/schema'; +import { Users } from '@/models/index'; +import { name, schema } from '../schemas/hashtag'; type HashtagLog = SchemaType; diff --git a/src/services/chart/charts/classes/instance.ts b/src/services/chart/charts/classes/instance.ts index 429d4067bd..1032de7bc0 100644 --- a/src/services/chart/charts/classes/instance.ts +++ b/src/services/chart/charts/classes/instance.ts @@ -1,11 +1,11 @@ import autobind from 'autobind-decorator'; -import Chart, { Obj, DeepPartial } from '../../core.js'; -import { SchemaType } from '@/misc/schema.js'; -import { DriveFiles, Followings, Users, Notes } from '@/models/index.js'; -import { DriveFile } from '@/models/entities/drive-file.js'; -import { name, schema } from '../schemas/instance.js'; -import { Note } from '@/models/entities/note.js'; -import { toPuny } from '@/misc/convert-host.js'; +import Chart, { Obj, DeepPartial } from '../../core'; +import { SchemaType } from '@/misc/schema'; +import { DriveFiles, Followings, Users, Notes } from '@/models/index'; +import { DriveFile } from '@/models/entities/drive-file'; +import { name, schema } from '../schemas/instance'; +import { Note } from '@/models/entities/note'; +import { toPuny } from '@/misc/convert-host'; type InstanceLog = SchemaType; diff --git a/src/services/chart/charts/classes/network.ts b/src/services/chart/charts/classes/network.ts index 1e39115b02..2ce75e0b34 100644 --- a/src/services/chart/charts/classes/network.ts +++ b/src/services/chart/charts/classes/network.ts @@ -1,7 +1,7 @@ import autobind from 'autobind-decorator'; -import Chart, { DeepPartial } from '../../core.js'; -import { SchemaType } from '@/misc/schema.js'; -import { name, schema } from '../schemas/network.js'; +import Chart, { DeepPartial } from '../../core'; +import { SchemaType } from '@/misc/schema'; +import { name, schema } from '../schemas/network'; type NetworkLog = SchemaType; diff --git a/src/services/chart/charts/classes/notes.ts b/src/services/chart/charts/classes/notes.ts index 7cc3c7de83..0675d346d1 100644 --- a/src/services/chart/charts/classes/notes.ts +++ b/src/services/chart/charts/classes/notes.ts @@ -1,10 +1,10 @@ import autobind from 'autobind-decorator'; -import Chart, { Obj, DeepPartial } from '../../core.js'; -import { SchemaType } from '@/misc/schema.js'; -import { Notes } from '@/models/index.js'; +import Chart, { Obj, DeepPartial } from '../../core'; +import { SchemaType } from '@/misc/schema'; +import { Notes } from '@/models/index'; import { Not, IsNull } from 'typeorm'; -import { Note } from '@/models/entities/note.js'; -import { name, schema } from '../schemas/notes.js'; +import { Note } from '@/models/entities/note'; +import { name, schema } from '../schemas/notes'; type NotesLog = SchemaType; diff --git a/src/services/chart/charts/classes/per-user-drive.ts b/src/services/chart/charts/classes/per-user-drive.ts index 04b29c0abe..f28987191b 100644 --- a/src/services/chart/charts/classes/per-user-drive.ts +++ b/src/services/chart/charts/classes/per-user-drive.ts @@ -1,9 +1,9 @@ import autobind from 'autobind-decorator'; -import Chart, { Obj, DeepPartial } from '../../core.js'; -import { SchemaType } from '@/misc/schema.js'; -import { DriveFiles } from '@/models/index.js'; -import { DriveFile } from '@/models/entities/drive-file.js'; -import { name, schema } from '../schemas/per-user-drive.js'; +import Chart, { Obj, DeepPartial } from '../../core'; +import { SchemaType } from '@/misc/schema'; +import { DriveFiles } from '@/models/index'; +import { DriveFile } from '@/models/entities/drive-file'; +import { name, schema } from '../schemas/per-user-drive'; type PerUserDriveLog = SchemaType; diff --git a/src/services/chart/charts/classes/per-user-following.ts b/src/services/chart/charts/classes/per-user-following.ts index 43ca9d3b6c..08a9ad1d2b 100644 --- a/src/services/chart/charts/classes/per-user-following.ts +++ b/src/services/chart/charts/classes/per-user-following.ts @@ -1,10 +1,10 @@ import autobind from 'autobind-decorator'; -import Chart, { Obj, DeepPartial } from '../../core.js'; -import { SchemaType } from '@/misc/schema.js'; -import { Followings, Users } from '@/models/index.js'; +import Chart, { Obj, DeepPartial } from '../../core'; +import { SchemaType } from '@/misc/schema'; +import { Followings, Users } from '@/models/index'; import { Not, IsNull } from 'typeorm'; -import { User } from '@/models/entities/user.js'; -import { name, schema } from '../schemas/per-user-following.js'; +import { User } from '@/models/entities/user'; +import { name, schema } from '../schemas/per-user-following'; type PerUserFollowingLog = SchemaType; diff --git a/src/services/chart/charts/classes/per-user-notes.ts b/src/services/chart/charts/classes/per-user-notes.ts index 3da16f8139..0e808766f5 100644 --- a/src/services/chart/charts/classes/per-user-notes.ts +++ b/src/services/chart/charts/classes/per-user-notes.ts @@ -1,10 +1,10 @@ import autobind from 'autobind-decorator'; -import Chart, { Obj, DeepPartial } from '../../core.js'; -import { User } from '@/models/entities/user.js'; -import { SchemaType } from '@/misc/schema.js'; -import { Notes } from '@/models/index.js'; -import { Note } from '@/models/entities/note.js'; -import { name, schema } from '../schemas/per-user-notes.js'; +import Chart, { Obj, DeepPartial } from '../../core'; +import { User } from '@/models/entities/user'; +import { SchemaType } from '@/misc/schema'; +import { Notes } from '@/models/index'; +import { Note } from '@/models/entities/note'; +import { name, schema } from '../schemas/per-user-notes'; type PerUserNotesLog = SchemaType; diff --git a/src/services/chart/charts/classes/per-user-reactions.ts b/src/services/chart/charts/classes/per-user-reactions.ts index d4665c0677..e71bcb71c4 100644 --- a/src/services/chart/charts/classes/per-user-reactions.ts +++ b/src/services/chart/charts/classes/per-user-reactions.ts @@ -1,10 +1,10 @@ import autobind from 'autobind-decorator'; -import Chart, { DeepPartial } from '../../core.js'; -import { User } from '@/models/entities/user.js'; -import { Note } from '@/models/entities/note.js'; -import { SchemaType } from '@/misc/schema.js'; -import { Users } from '@/models/index.js'; -import { name, schema } from '../schemas/per-user-reactions.js'; +import Chart, { DeepPartial } from '../../core'; +import { User } from '@/models/entities/user'; +import { Note } from '@/models/entities/note'; +import { SchemaType } from '@/misc/schema'; +import { Users } from '@/models/index'; +import { name, schema } from '../schemas/per-user-reactions'; type PerUserReactionsLog = SchemaType; diff --git a/src/services/chart/charts/classes/test-grouped.ts b/src/services/chart/charts/classes/test-grouped.ts index a667aaff15..84e6d5e33f 100644 --- a/src/services/chart/charts/classes/test-grouped.ts +++ b/src/services/chart/charts/classes/test-grouped.ts @@ -1,7 +1,7 @@ import autobind from 'autobind-decorator'; -import Chart, { Obj, DeepPartial } from '../../core.js'; -import { SchemaType } from '@/misc/schema.js'; -import { name, schema } from '../schemas/test-grouped.js'; +import Chart, { Obj, DeepPartial } from '../../core'; +import { SchemaType } from '@/misc/schema'; +import { name, schema } from '../schemas/test-grouped'; type TestGroupedLog = SchemaType; diff --git a/src/services/chart/charts/classes/test-unique.ts b/src/services/chart/charts/classes/test-unique.ts index c0ca5f625c..559fda13c9 100644 --- a/src/services/chart/charts/classes/test-unique.ts +++ b/src/services/chart/charts/classes/test-unique.ts @@ -1,7 +1,7 @@ import autobind from 'autobind-decorator'; -import Chart, { DeepPartial } from '../../core.js'; -import { SchemaType } from '@/misc/schema.js'; -import { name, schema } from '../schemas/test-unique.js'; +import Chart, { DeepPartial } from '../../core'; +import { SchemaType } from '@/misc/schema'; +import { name, schema } from '../schemas/test-unique'; type TestUniqueLog = SchemaType; diff --git a/src/services/chart/charts/classes/test.ts b/src/services/chart/charts/classes/test.ts index 829867f5ed..a91d5e1895 100644 --- a/src/services/chart/charts/classes/test.ts +++ b/src/services/chart/charts/classes/test.ts @@ -1,7 +1,7 @@ import autobind from 'autobind-decorator'; -import Chart, { Obj, DeepPartial } from '../../core.js'; -import { SchemaType } from '@/misc/schema.js'; -import { name, schema } from '../schemas/test.js'; +import Chart, { Obj, DeepPartial } from '../../core'; +import { SchemaType } from '@/misc/schema'; +import { name, schema } from '../schemas/test'; type TestLog = SchemaType; diff --git a/src/services/chart/charts/classes/users.ts b/src/services/chart/charts/classes/users.ts index be279cb8c1..89b480ef77 100644 --- a/src/services/chart/charts/classes/users.ts +++ b/src/services/chart/charts/classes/users.ts @@ -1,10 +1,10 @@ import autobind from 'autobind-decorator'; -import Chart, { Obj, DeepPartial } from '../../core.js'; -import { SchemaType } from '@/misc/schema.js'; -import { Users } from '@/models/index.js'; +import Chart, { Obj, DeepPartial } from '../../core'; +import { SchemaType } from '@/misc/schema'; +import { Users } from '@/models/index'; import { Not, IsNull } from 'typeorm'; -import { User } from '@/models/entities/user.js'; -import { name, schema } from '../schemas/users.js'; +import { User } from '@/models/entities/user'; +import { name, schema } from '../schemas/users'; type UsersLog = SchemaType; diff --git a/src/services/chart/core.ts b/src/services/chart/core.ts index 109d75933b..3c0526d2e5 100644 --- a/src/services/chart/core.ts +++ b/src/services/chart/core.ts @@ -6,11 +6,11 @@ import * as nestedProperty from 'nested-property'; import autobind from 'autobind-decorator'; -import Logger from '../logger.js'; -import { Schema } from '@/misc/schema.js'; +import Logger from '../logger'; +import { Schema } from '@/misc/schema'; import { EntitySchema, getRepository, Repository, LessThan, Between } from 'typeorm'; -import { dateUTC, isTimeSame, isTimeBefore, subtractTime, addTime } from '../../prelude/time.js'; -import { getChartInsertLock } from '@/misc/app-lock.js'; +import { dateUTC, isTimeSame, isTimeBefore, subtractTime, addTime } from '../../prelude/time'; +import { getChartInsertLock } from '@/misc/app-lock'; const logger = new Logger('chart', 'white', process.env.NODE_ENV !== 'test'); diff --git a/src/services/chart/entities.ts b/src/services/chart/entities.ts index 357a4a5b58..23a97607eb 100644 --- a/src/services/chart/entities.ts +++ b/src/services/chart/entities.ts @@ -1,6 +1,6 @@ import { fileURLToPath } from 'url'; import { dirname } from 'path'; -import Chart from './core.js'; +import Chart from './core'; //const _filename = fileURLToPath(import.meta.url); const _filename = __filename; diff --git a/src/services/chart/index.ts b/src/services/chart/index.ts index b070ed8637..61eb431ea3 100644 --- a/src/services/chart/index.ts +++ b/src/services/chart/index.ts @@ -1,16 +1,16 @@ -import FederationChart from './charts/classes/federation.js'; -import NotesChart from './charts/classes/notes.js'; -import UsersChart from './charts/classes/users.js'; -import NetworkChart from './charts/classes/network.js'; -import ActiveUsersChart from './charts/classes/active-users.js'; -import InstanceChart from './charts/classes/instance.js'; -import PerUserNotesChart from './charts/classes/per-user-notes.js'; -import DriveChart from './charts/classes/drive.js'; -import PerUserReactionsChart from './charts/classes/per-user-reactions.js'; -import HashtagChart from './charts/classes/hashtag.js'; -import PerUserFollowingChart from './charts/classes/per-user-following.js'; -import PerUserDriveChart from './charts/classes/per-user-drive.js'; -import { beforeShutdown } from '@/misc/before-shutdown.js'; +import FederationChart from './charts/classes/federation'; +import NotesChart from './charts/classes/notes'; +import UsersChart from './charts/classes/users'; +import NetworkChart from './charts/classes/network'; +import ActiveUsersChart from './charts/classes/active-users'; +import InstanceChart from './charts/classes/instance'; +import PerUserNotesChart from './charts/classes/per-user-notes'; +import DriveChart from './charts/classes/drive'; +import PerUserReactionsChart from './charts/classes/per-user-reactions'; +import HashtagChart from './charts/classes/hashtag'; +import PerUserFollowingChart from './charts/classes/per-user-following'; +import PerUserDriveChart from './charts/classes/per-user-drive'; +import { beforeShutdown } from '@/misc/before-shutdown'; export const federationChart = new FederationChart(); export const notesChart = new NotesChart(); diff --git a/src/services/create-notification.ts b/src/services/create-notification.ts index d0ee0e0481..5398d486c0 100644 --- a/src/services/create-notification.ts +++ b/src/services/create-notification.ts @@ -1,10 +1,10 @@ -import { publishMainStream } from '@/services/stream.js'; -import pushSw from './push-notification.js'; -import { Notifications, Mutings, UserProfiles, Users } from '@/models/index.js'; -import { genId } from '@/misc/gen-id.js'; -import { User } from '@/models/entities/user.js'; -import { Notification } from '@/models/entities/notification.js'; -import { sendEmailNotification } from './send-email-notification.js'; +import { publishMainStream } from '@/services/stream'; +import pushSw from './push-notification'; +import { Notifications, Mutings, UserProfiles, Users } from '@/models/index'; +import { genId } from '@/misc/gen-id'; +import { User } from '@/models/entities/user'; +import { Notification } from '@/models/entities/notification'; +import { sendEmailNotification } from './send-email-notification'; export async function createNotification( notifieeId: User['id'], diff --git a/src/services/create-system-user.ts b/src/services/create-system-user.ts index de03dd4890..71be8d4abf 100644 --- a/src/services/create-system-user.ts +++ b/src/services/create-system-user.ts @@ -1,13 +1,13 @@ import * as bcrypt from 'bcryptjs'; import { v4 as uuid } from 'uuid'; -import generateNativeUserToken from '../server/api/common/generate-native-user-token.js'; -import { genRsaKeyPair } from '@/misc/gen-key-pair.js'; -import { User } from '@/models/entities/user.js'; -import { UserProfile } from '@/models/entities/user-profile.js'; +import generateNativeUserToken from '../server/api/common/generate-native-user-token'; +import { genRsaKeyPair } from '@/misc/gen-key-pair'; +import { User } from '@/models/entities/user'; +import { UserProfile } from '@/models/entities/user-profile'; import { getConnection } from 'typeorm'; -import { genId } from '@/misc/gen-id.js'; -import { UserKeypair } from '@/models/entities/user-keypair.js'; -import { UsedUsername } from '@/models/entities/used-username.js'; +import { genId } from '@/misc/gen-id'; +import { UserKeypair } from '@/models/entities/user-keypair'; +import { UsedUsername } from '@/models/entities/used-username'; export async function createSystemUser(username: string) { const password = uuid(); diff --git a/src/services/drive/add-file.ts b/src/services/drive/add-file.ts index e1092d068d..6c5fefd4ad 100644 --- a/src/services/drive/add-file.ts +++ b/src/services/drive/add-file.ts @@ -2,23 +2,23 @@ import * as fs from 'fs'; import { v4 as uuid } from 'uuid'; -import { publishMainStream, publishDriveStream } from '@/services/stream.js'; -import { deleteFile } from './delete-file.js'; -import { fetchMeta } from '@/misc/fetch-meta.js'; -import { GenerateVideoThumbnail } from './generate-video-thumbnail.js'; -import { driveLogger } from './logger.js'; -import { IImage, convertSharpToJpeg, convertSharpToWebp, convertSharpToPng, convertSharpToPngOrJpeg } from './image-processor.js'; -import { contentDisposition } from '@/misc/content-disposition.js'; -import { getFileInfo } from '@/misc/get-file-info.js'; -import { DriveFiles, DriveFolders, Users, Instances, UserProfiles } from '@/models/index.js'; -import { InternalStorage } from './internal-storage.js'; -import { DriveFile } from '@/models/entities/drive-file.js'; -import { IRemoteUser, User } from '@/models/entities/user.js'; -import { driveChart, perUserDriveChart, instanceChart } from '@/services/chart/index.js'; -import { genId } from '@/misc/gen-id.js'; -import { isDuplicateKeyValueError } from '@/misc/is-duplicate-key-value-error.js'; +import { publishMainStream, publishDriveStream } from '@/services/stream'; +import { deleteFile } from './delete-file'; +import { fetchMeta } from '@/misc/fetch-meta'; +import { GenerateVideoThumbnail } from './generate-video-thumbnail'; +import { driveLogger } from './logger'; +import { IImage, convertSharpToJpeg, convertSharpToWebp, convertSharpToPng, convertSharpToPngOrJpeg } from './image-processor'; +import { contentDisposition } from '@/misc/content-disposition'; +import { getFileInfo } from '@/misc/get-file-info'; +import { DriveFiles, DriveFolders, Users, Instances, UserProfiles } from '@/models/index'; +import { InternalStorage } from './internal-storage'; +import { DriveFile } from '@/models/entities/drive-file'; +import { IRemoteUser, User } from '@/models/entities/user'; +import { driveChart, perUserDriveChart, instanceChart } from '@/services/chart/index'; +import { genId } from '@/misc/gen-id'; +import { isDuplicateKeyValueError } from '@/misc/is-duplicate-key-value-error'; import * as S3 from 'aws-sdk/clients/s3'; -import { getS3 } from './s3.js'; +import { getS3 } from './s3'; import * as sharp from 'sharp'; const logger = driveLogger.createSubLogger('register', 'yellow'); diff --git a/src/services/drive/delete-file.ts b/src/services/drive/delete-file.ts index 9deb1768b6..2eab17ac1c 100644 --- a/src/services/drive/delete-file.ts +++ b/src/services/drive/delete-file.ts @@ -1,19 +1,19 @@ -import { DriveFile } from '@/models/entities/drive-file.js'; -import { InternalStorage } from './internal-storage.js'; -import { DriveFiles, Instances, Notes, Users } from '@/models/index.js'; -import { driveChart, perUserDriveChart, instanceChart } from '@/services/chart/index.js'; -import { createDeleteObjectStorageFileJob } from '@/queue/index.js'; -import { fetchMeta } from '@/misc/fetch-meta.js'; -import { getS3 } from './s3.js'; +import { DriveFile } from '@/models/entities/drive-file'; +import { InternalStorage } from './internal-storage'; +import { DriveFiles, Instances, Notes, Users } from '@/models/index'; +import { driveChart, perUserDriveChart, instanceChart } from '@/services/chart/index'; +import { createDeleteObjectStorageFileJob } from '@/queue/index'; +import { fetchMeta } from '@/misc/fetch-meta'; +import { getS3 } from './s3'; import { v4 as uuid } from 'uuid'; -import { Note } from '@/models/entities/note.js'; -import { renderActivity } from '@/remote/activitypub/renderer/index.js'; -import renderDelete from '@/remote/activitypub/renderer/delete.js'; -import renderTombstone from '@/remote/activitypub/renderer/tombstone.js'; -import config from '@/config/index.js'; -import { deliverToFollowers } from '@/remote/activitypub/deliver-manager.js'; +import { Note } from '@/models/entities/note'; +import { renderActivity } from '@/remote/activitypub/renderer/index'; +import renderDelete from '@/remote/activitypub/renderer/delete'; +import renderTombstone from '@/remote/activitypub/renderer/tombstone'; +import config from '@/config/index'; +import { deliverToFollowers } from '@/remote/activitypub/deliver-manager'; import { Brackets } from 'typeorm'; -import { deliverToRelays } from '../relay.js'; +import { deliverToRelays } from '../relay'; export async function deleteFile(file: DriveFile, isExpired = false) { if (file.storedInternal) { diff --git a/src/services/drive/generate-video-thumbnail.ts b/src/services/drive/generate-video-thumbnail.ts index e5cb243d4d..f0adc7c338 100644 --- a/src/services/drive/generate-video-thumbnail.ts +++ b/src/services/drive/generate-video-thumbnail.ts @@ -1,6 +1,6 @@ import * as fs from 'fs'; import * as tmp from 'tmp'; -import { IImage, convertToJpeg } from './image-processor.js'; +import { IImage, convertToJpeg } from './image-processor'; import * as FFmpeg from 'fluent-ffmpeg'; export async function GenerateVideoThumbnail(path: string): Promise { diff --git a/src/services/drive/internal-storage.ts b/src/services/drive/internal-storage.ts index e857f942cc..deaf3dc831 100644 --- a/src/services/drive/internal-storage.ts +++ b/src/services/drive/internal-storage.ts @@ -2,7 +2,7 @@ import * as fs from 'fs'; import * as Path from 'path'; import { fileURLToPath } from 'url'; import { dirname } from 'path'; -import config from '@/config/index.js'; +import config from '@/config/index'; //const _filename = fileURLToPath(import.meta.url); const _filename = __filename; diff --git a/src/services/drive/logger.ts b/src/services/drive/logger.ts index 917a8317e2..655d074d6e 100644 --- a/src/services/drive/logger.ts +++ b/src/services/drive/logger.ts @@ -1,3 +1,3 @@ -import Logger from '../logger.js'; +import Logger from '../logger'; export const driveLogger = new Logger('drive', 'blue'); diff --git a/src/services/drive/s3.ts b/src/services/drive/s3.ts index 89fad70dc5..f473c4a203 100644 --- a/src/services/drive/s3.ts +++ b/src/services/drive/s3.ts @@ -1,7 +1,7 @@ import { URL } from 'url'; import * as S3 from 'aws-sdk/clients/s3'; -import { Meta } from '@/models/entities/meta.js'; -import { getAgentByUrl } from '@/misc/fetch.js'; +import { Meta } from '@/models/entities/meta'; +import { getAgentByUrl } from '@/misc/fetch'; export function getS3(meta: Meta) { const u = meta.objectStorageEndpoint != null diff --git a/src/services/drive/upload-from-url.ts b/src/services/drive/upload-from-url.ts index 21b294142b..29788c4af4 100644 --- a/src/services/drive/upload-from-url.ts +++ b/src/services/drive/upload-from-url.ts @@ -1,12 +1,12 @@ import { URL } from 'url'; -import create from './add-file.js'; -import { User } from '@/models/entities/user.js'; -import { driveLogger } from './logger.js'; -import { createTemp } from '@/misc/create-temp.js'; -import { downloadUrl } from '@/misc/download-url.js'; -import { DriveFolder } from '@/models/entities/drive-folder.js'; -import { DriveFile } from '@/models/entities/drive-file.js'; -import { DriveFiles } from '@/models/index.js'; +import create from './add-file'; +import { User } from '@/models/entities/user'; +import { driveLogger } from './logger'; +import { createTemp } from '@/misc/create-temp'; +import { downloadUrl } from '@/misc/download-url'; +import { DriveFolder } from '@/models/entities/drive-folder'; +import { DriveFile } from '@/models/entities/drive-file'; +import { DriveFiles } from '@/models/index'; const logger = driveLogger.createSubLogger('downloader'); diff --git a/src/services/fetch-instance-metadata.ts b/src/services/fetch-instance-metadata.ts index d21064868c..2c401508a9 100644 --- a/src/services/fetch-instance-metadata.ts +++ b/src/services/fetch-instance-metadata.ts @@ -1,10 +1,10 @@ import { DOMWindow, JSDOM } from 'jsdom'; import fetch from 'node-fetch'; -import { getJson, getHtml, getAgentByUrl } from '@/misc/fetch.js'; -import { Instance } from '@/models/entities/instance.js'; -import { Instances } from '@/models/index.js'; -import { getFetchInstanceMetadataLock } from '@/misc/app-lock.js'; -import Logger from './logger.js'; +import { getJson, getHtml, getAgentByUrl } from '@/misc/fetch'; +import { Instance } from '@/models/entities/instance'; +import { Instances } from '@/models/index'; +import { getFetchInstanceMetadataLock } from '@/misc/app-lock'; +import Logger from './logger'; import { URL } from 'url'; const logger = new Logger('metadata', 'cyan'); diff --git a/src/services/following/create.ts b/src/services/following/create.ts index 194b95dea0..4d0754b504 100644 --- a/src/services/following/create.ts +++ b/src/services/following/create.ts @@ -1,19 +1,19 @@ -import { publishMainStream, publishUserEvent } from '@/services/stream.js'; -import { renderActivity } from '@/remote/activitypub/renderer/index.js'; -import renderFollow from '@/remote/activitypub/renderer/follow.js'; -import renderAccept from '@/remote/activitypub/renderer/accept.js'; -import renderReject from '@/remote/activitypub/renderer/reject.js'; -import { deliver } from '@/queue/index.js'; -import createFollowRequest from './requests/create.js'; -import { registerOrFetchInstanceDoc } from '../register-or-fetch-instance-doc.js'; -import Logger from '../logger.js'; -import { IdentifiableError } from '@/misc/identifiable-error.js'; -import { User } from '@/models/entities/user.js'; -import { Followings, Users, FollowRequests, Blockings, Instances, UserProfiles } from '@/models/index.js'; -import { instanceChart, perUserFollowingChart } from '@/services/chart/index.js'; -import { genId } from '@/misc/gen-id.js'; -import { createNotification } from '../create-notification.js'; -import { isDuplicateKeyValueError } from '@/misc/is-duplicate-key-value-error.js'; +import { publishMainStream, publishUserEvent } from '@/services/stream'; +import { renderActivity } from '@/remote/activitypub/renderer/index'; +import renderFollow from '@/remote/activitypub/renderer/follow'; +import renderAccept from '@/remote/activitypub/renderer/accept'; +import renderReject from '@/remote/activitypub/renderer/reject'; +import { deliver } from '@/queue/index'; +import createFollowRequest from './requests/create'; +import { registerOrFetchInstanceDoc } from '../register-or-fetch-instance-doc'; +import Logger from '../logger'; +import { IdentifiableError } from '@/misc/identifiable-error'; +import { User } from '@/models/entities/user'; +import { Followings, Users, FollowRequests, Blockings, Instances, UserProfiles } from '@/models/index'; +import { instanceChart, perUserFollowingChart } from '@/services/chart/index'; +import { genId } from '@/misc/gen-id'; +import { createNotification } from '../create-notification'; +import { isDuplicateKeyValueError } from '@/misc/is-duplicate-key-value-error'; const logger = new Logger('following/create'); diff --git a/src/services/following/delete.ts b/src/services/following/delete.ts index 3ea226744c..29e3372b6a 100644 --- a/src/services/following/delete.ts +++ b/src/services/following/delete.ts @@ -1,13 +1,13 @@ -import { publishMainStream, publishUserEvent } from '@/services/stream.js'; -import { renderActivity } from '@/remote/activitypub/renderer/index.js'; -import renderFollow from '@/remote/activitypub/renderer/follow.js'; -import renderUndo from '@/remote/activitypub/renderer/undo.js'; -import { deliver } from '@/queue/index.js'; -import Logger from '../logger.js'; -import { registerOrFetchInstanceDoc } from '../register-or-fetch-instance-doc.js'; -import { User } from '@/models/entities/user.js'; -import { Followings, Users, Instances } from '@/models/index.js'; -import { instanceChart, perUserFollowingChart } from '@/services/chart/index.js'; +import { publishMainStream, publishUserEvent } from '@/services/stream'; +import { renderActivity } from '@/remote/activitypub/renderer/index'; +import renderFollow from '@/remote/activitypub/renderer/follow'; +import renderUndo from '@/remote/activitypub/renderer/undo'; +import { deliver } from '@/queue/index'; +import Logger from '../logger'; +import { registerOrFetchInstanceDoc } from '../register-or-fetch-instance-doc'; +import { User } from '@/models/entities/user'; +import { Followings, Users, Instances } from '@/models/index'; +import { instanceChart, perUserFollowingChart } from '@/services/chart/index'; const logger = new Logger('following/delete'); diff --git a/src/services/following/requests/accept-all.ts b/src/services/following/requests/accept-all.ts index 8025a134f3..23b4fd0a46 100644 --- a/src/services/following/requests/accept-all.ts +++ b/src/services/following/requests/accept-all.ts @@ -1,6 +1,6 @@ -import accept from './accept.js'; -import { User } from '@/models/entities/user.js'; -import { FollowRequests, Users } from '@/models/index.js'; +import accept from './accept'; +import { User } from '@/models/entities/user'; +import { FollowRequests, Users } from '@/models/index'; /** * 指定したユーザー宛てのフォローリクエストをすべて承認 diff --git a/src/services/following/requests/accept.ts b/src/services/following/requests/accept.ts index ff4d0ff998..316a6f1c12 100644 --- a/src/services/following/requests/accept.ts +++ b/src/services/following/requests/accept.ts @@ -1,12 +1,12 @@ -import { renderActivity } from '@/remote/activitypub/renderer/index.js'; -import renderFollow from '@/remote/activitypub/renderer/follow.js'; -import renderAccept from '@/remote/activitypub/renderer/accept.js'; -import { deliver } from '@/queue/index.js'; -import { publishMainStream } from '@/services/stream.js'; -import { insertFollowingDoc } from '../create.js'; -import { User, ILocalUser } from '@/models/entities/user.js'; -import { FollowRequests, Users } from '@/models/index.js'; -import { IdentifiableError } from '@/misc/identifiable-error.js'; +import { renderActivity } from '@/remote/activitypub/renderer/index'; +import renderFollow from '@/remote/activitypub/renderer/follow'; +import renderAccept from '@/remote/activitypub/renderer/accept'; +import { deliver } from '@/queue/index'; +import { publishMainStream } from '@/services/stream'; +import { insertFollowingDoc } from '../create'; +import { User, ILocalUser } from '@/models/entities/user'; +import { FollowRequests, Users } from '@/models/index'; +import { IdentifiableError } from '@/misc/identifiable-error'; export default async function(followee: { id: User['id']; host: User['host']; uri: User['host']; inbox: User['inbox']; sharedInbox: User['sharedInbox']; }, follower: User) { const request = await FollowRequests.findOne({ diff --git a/src/services/following/requests/cancel.ts b/src/services/following/requests/cancel.ts index 3f60fefd10..8895849857 100644 --- a/src/services/following/requests/cancel.ts +++ b/src/services/following/requests/cancel.ts @@ -1,11 +1,11 @@ -import { renderActivity } from '@/remote/activitypub/renderer/index.js'; -import renderFollow from '@/remote/activitypub/renderer/follow.js'; -import renderUndo from '@/remote/activitypub/renderer/undo.js'; -import { deliver } from '@/queue/index.js'; -import { publishMainStream } from '@/services/stream.js'; -import { IdentifiableError } from '@/misc/identifiable-error.js'; -import { User, ILocalUser } from '@/models/entities/user.js'; -import { Users, FollowRequests } from '@/models/index.js'; +import { renderActivity } from '@/remote/activitypub/renderer/index'; +import renderFollow from '@/remote/activitypub/renderer/follow'; +import renderUndo from '@/remote/activitypub/renderer/undo'; +import { deliver } from '@/queue/index'; +import { publishMainStream } from '@/services/stream'; +import { IdentifiableError } from '@/misc/identifiable-error'; +import { User, ILocalUser } from '@/models/entities/user'; +import { Users, FollowRequests } from '@/models/index'; export default async function(followee: { id: User['id']; host: User['host']; uri: User['host']; inbox: User['inbox'] }, follower: { id: User['id']; host: User['host']; uri: User['host'] }) { if (Users.isRemoteUser(followee)) { diff --git a/src/services/following/requests/create.ts b/src/services/following/requests/create.ts index 8f26a66119..507cb2b7d1 100644 --- a/src/services/following/requests/create.ts +++ b/src/services/following/requests/create.ts @@ -1,11 +1,11 @@ -import { publishMainStream } from '@/services/stream.js'; -import { renderActivity } from '@/remote/activitypub/renderer/index.js'; -import renderFollow from '@/remote/activitypub/renderer/follow.js'; -import { deliver } from '@/queue/index.js'; -import { User } from '@/models/entities/user.js'; -import { Blockings, FollowRequests, Users } from '@/models/index.js'; -import { genId } from '@/misc/gen-id.js'; -import { createNotification } from '../../create-notification.js'; +import { publishMainStream } from '@/services/stream'; +import { renderActivity } from '@/remote/activitypub/renderer/index'; +import renderFollow from '@/remote/activitypub/renderer/follow'; +import { deliver } from '@/queue/index'; +import { User } from '@/models/entities/user'; +import { Blockings, FollowRequests, Users } from '@/models/index'; +import { genId } from '@/misc/gen-id'; +import { createNotification } from '../../create-notification'; export default async function(follower: { id: User['id']; host: User['host']; uri: User['host']; inbox: User['inbox']; sharedInbox: User['sharedInbox']; }, followee: { id: User['id']; host: User['host']; uri: User['host']; inbox: User['inbox']; sharedInbox: User['sharedInbox']; }, requestId?: string) { if (follower.id === followee.id) return; diff --git a/src/services/following/requests/reject.ts b/src/services/following/requests/reject.ts index e180f1dc4a..41cebd9e41 100644 --- a/src/services/following/requests/reject.ts +++ b/src/services/following/requests/reject.ts @@ -1,11 +1,11 @@ -import { renderActivity } from '@/remote/activitypub/renderer/index.js'; -import renderFollow from '@/remote/activitypub/renderer/follow.js'; -import renderReject from '@/remote/activitypub/renderer/reject.js'; -import { deliver } from '@/queue/index.js'; -import { publishMainStream, publishUserEvent } from '@/services/stream.js'; -import { User, ILocalUser } from '@/models/entities/user.js'; -import { Users, FollowRequests, Followings } from '@/models/index.js'; -import { decrementFollowing } from '../delete.js'; +import { renderActivity } from '@/remote/activitypub/renderer/index'; +import renderFollow from '@/remote/activitypub/renderer/follow'; +import renderReject from '@/remote/activitypub/renderer/reject'; +import { deliver } from '@/queue/index'; +import { publishMainStream, publishUserEvent } from '@/services/stream'; +import { User, ILocalUser } from '@/models/entities/user'; +import { Users, FollowRequests, Followings } from '@/models/index'; +import { decrementFollowing } from '../delete'; export default async function(followee: { id: User['id']; host: User['host']; uri: User['host'] }, follower: User) { if (Users.isRemoteUser(follower) && Users.isLocalUser(followee)) { diff --git a/src/services/i/pin.ts b/src/services/i/pin.ts index da95b60707..b31beb6e1a 100644 --- a/src/services/i/pin.ts +++ b/src/services/i/pin.ts @@ -1,15 +1,15 @@ -import config from '@/config/index.js'; -import renderAdd from '@/remote/activitypub/renderer/add.js'; -import renderRemove from '@/remote/activitypub/renderer/remove.js'; -import { renderActivity } from '@/remote/activitypub/renderer/index.js'; -import { IdentifiableError } from '@/misc/identifiable-error.js'; -import { User } from '@/models/entities/user.js'; -import { Note } from '@/models/entities/note.js'; -import { Notes, UserNotePinings, Users } from '@/models/index.js'; -import { UserNotePining } from '@/models/entities/user-note-pining.js'; -import { genId } from '@/misc/gen-id.js'; -import { deliverToFollowers } from '@/remote/activitypub/deliver-manager.js'; -import { deliverToRelays } from '../relay.js'; +import config from '@/config/index'; +import renderAdd from '@/remote/activitypub/renderer/add'; +import renderRemove from '@/remote/activitypub/renderer/remove'; +import { renderActivity } from '@/remote/activitypub/renderer/index'; +import { IdentifiableError } from '@/misc/identifiable-error'; +import { User } from '@/models/entities/user'; +import { Note } from '@/models/entities/note'; +import { Notes, UserNotePinings, Users } from '@/models/index'; +import { UserNotePining } from '@/models/entities/user-note-pining'; +import { genId } from '@/misc/gen-id'; +import { deliverToFollowers } from '@/remote/activitypub/deliver-manager'; +import { deliverToRelays } from '../relay'; /** * 指定した投稿をピン留めします diff --git a/src/services/i/update.ts b/src/services/i/update.ts index 1fbaf40df1..f700d9b48b 100644 --- a/src/services/i/update.ts +++ b/src/services/i/update.ts @@ -1,10 +1,10 @@ -import renderUpdate from '@/remote/activitypub/renderer/update.js'; -import { renderActivity } from '@/remote/activitypub/renderer/index.js'; -import { Users } from '@/models/index.js'; -import { User } from '@/models/entities/user.js'; -import { renderPerson } from '@/remote/activitypub/renderer/person.js'; -import { deliverToFollowers } from '@/remote/activitypub/deliver-manager.js'; -import { deliverToRelays } from '../relay.js'; +import renderUpdate from '@/remote/activitypub/renderer/update'; +import { renderActivity } from '@/remote/activitypub/renderer/index'; +import { Users } from '@/models/index'; +import { User } from '@/models/entities/user'; +import { renderPerson } from '@/remote/activitypub/renderer/person'; +import { deliverToFollowers } from '@/remote/activitypub/deliver-manager'; +import { deliverToRelays } from '../relay'; export async function publishToFollowers(userId: User['id']) { const user = await Users.findOne(userId); diff --git a/src/services/insert-moderation-log.ts b/src/services/insert-moderation-log.ts index 1d8fe9a9d7..00397652ee 100644 --- a/src/services/insert-moderation-log.ts +++ b/src/services/insert-moderation-log.ts @@ -1,6 +1,6 @@ -import { ModerationLogs } from '@/models/index.js'; -import { genId } from '@/misc/gen-id.js'; -import { User } from '@/models/entities/user.js'; +import { ModerationLogs } from '@/models/index'; +import { genId } from '@/misc/gen-id'; +import { User } from '@/models/entities/user'; export async function insertModerationLog(moderator: { id: User['id'] }, type: string, info?: Record) { await ModerationLogs.insert({ diff --git a/src/services/instance-actor.ts b/src/services/instance-actor.ts index 6a592363ed..b3625226c3 100644 --- a/src/services/instance-actor.ts +++ b/src/services/instance-actor.ts @@ -1,7 +1,7 @@ -import { createSystemUser } from './create-system-user.js'; -import { ILocalUser } from '@/models/entities/user.js'; -import { Users } from '@/models/index.js'; -import { Cache } from '@/misc/cache.js'; +import { createSystemUser } from './create-system-user'; +import { ILocalUser } from '@/models/entities/user'; +import { Users } from '@/models/index'; +import { Cache } from '@/misc/cache'; const ACTOR_USERNAME = 'instance.actor' as const; diff --git a/src/services/logger.ts b/src/services/logger.ts index ac74c13af9..032e43c9ca 100644 --- a/src/services/logger.ts +++ b/src/services/logger.ts @@ -2,11 +2,11 @@ import * as cluster from 'cluster'; import * as os from 'os'; import * as chalk from 'chalk'; import * as dateformat from 'dateformat'; -import { program } from '../argv.js'; +import { program } from '../argv'; import { getRepository } from 'typeorm'; -import { Log } from '@/models/entities/log.js'; -import { genId } from '@/misc/gen-id.js'; -import config from '@/config/index.js'; +import { Log } from '@/models/entities/log'; +import { genId } from '@/misc/gen-id'; +import config from '@/config/index'; import SyslogPro from 'syslog-pro'; diff --git a/src/services/messages/create.ts b/src/services/messages/create.ts index c6430f07be..948b6726b9 100644 --- a/src/services/messages/create.ts +++ b/src/services/messages/create.ts @@ -1,17 +1,17 @@ -import { User } from '@/models/entities/user.js'; -import { UserGroup } from '@/models/entities/user-group.js'; -import { DriveFile } from '@/models/entities/drive-file.js'; -import { MessagingMessages, UserGroupJoinings, Mutings, Users } from '@/models/index.js'; -import { genId } from '@/misc/gen-id.js'; -import { MessagingMessage } from '@/models/entities/messaging-message.js'; -import { publishMessagingStream, publishMessagingIndexStream, publishMainStream, publishGroupMessagingStream } from '@/services/stream.js'; -import pushNotification from '../push-notification.js'; +import { User } from '@/models/entities/user'; +import { UserGroup } from '@/models/entities/user-group'; +import { DriveFile } from '@/models/entities/drive-file'; +import { MessagingMessages, UserGroupJoinings, Mutings, Users } from '@/models/index'; +import { genId } from '@/misc/gen-id'; +import { MessagingMessage } from '@/models/entities/messaging-message'; +import { publishMessagingStream, publishMessagingIndexStream, publishMainStream, publishGroupMessagingStream } from '@/services/stream'; +import pushNotification from '../push-notification'; import { Not } from 'typeorm'; -import { Note } from '@/models/entities/note.js'; -import renderNote from '@/remote/activitypub/renderer/note.js'; -import renderCreate from '@/remote/activitypub/renderer/create.js'; -import { renderActivity } from '@/remote/activitypub/renderer/index.js'; -import { deliver } from '@/queue/index.js'; +import { Note } from '@/models/entities/note'; +import renderNote from '@/remote/activitypub/renderer/note'; +import renderCreate from '@/remote/activitypub/renderer/create'; +import { renderActivity } from '@/remote/activitypub/renderer/index'; +import { deliver } from '@/queue/index'; export async function createMessage(user: { id: User['id']; host: User['host']; }, recipientUser: User | undefined, recipientGroup: UserGroup | undefined, text: string | undefined, file: DriveFile | null, uri?: string) { const message = { diff --git a/src/services/messages/delete.ts b/src/services/messages/delete.ts index 82eb6cb21c..5c299c9a50 100644 --- a/src/services/messages/delete.ts +++ b/src/services/messages/delete.ts @@ -1,11 +1,11 @@ -import config from '@/config/index.js'; -import { MessagingMessages, Users } from '@/models/index.js'; -import { MessagingMessage } from '@/models/entities/messaging-message.js'; -import { publishGroupMessagingStream, publishMessagingStream } from '@/services/stream.js'; -import { renderActivity } from '@/remote/activitypub/renderer/index.js'; -import renderDelete from '@/remote/activitypub/renderer/delete.js'; -import renderTombstone from '@/remote/activitypub/renderer/tombstone.js'; -import { deliver } from '@/queue/index.js'; +import config from '@/config/index'; +import { MessagingMessages, Users } from '@/models/index'; +import { MessagingMessage } from '@/models/entities/messaging-message'; +import { publishGroupMessagingStream, publishMessagingStream } from '@/services/stream'; +import { renderActivity } from '@/remote/activitypub/renderer/index'; +import renderDelete from '@/remote/activitypub/renderer/delete'; +import renderTombstone from '@/remote/activitypub/renderer/tombstone'; +import { deliver } from '@/queue/index'; export async function deleteMessage(message: MessagingMessage) { await MessagingMessages.delete(message.id); diff --git a/src/services/note/create.ts b/src/services/note/create.ts index d89663c784..56cdec4a51 100644 --- a/src/services/note/create.ts +++ b/src/services/note/create.ts @@ -1,39 +1,39 @@ import * as mfm from 'mfm-js'; -import es from '../../db/elasticsearch.js'; -import { publishMainStream, publishNotesStream } from '@/services/stream.js'; -import DeliverManager from '@/remote/activitypub/deliver-manager.js'; -import renderNote from '@/remote/activitypub/renderer/note.js'; -import renderCreate from '@/remote/activitypub/renderer/create.js'; -import renderAnnounce from '@/remote/activitypub/renderer/announce.js'; -import { renderActivity } from '@/remote/activitypub/renderer/index.js'; -import { resolveUser } from '@/remote/resolve-user.js'; -import config from '@/config/index.js'; -import { updateHashtags } from '../update-hashtag.js'; -import { concat } from '../../prelude/array.js'; -import insertNoteUnread from './unread.js'; -import { registerOrFetchInstanceDoc } from '../register-or-fetch-instance-doc.js'; -import { extractMentions } from '@/misc/extract-mentions.js'; -import { extractCustomEmojisFromMfm } from '@/misc/extract-custom-emojis-from-mfm.js'; -import { extractHashtags } from '@/misc/extract-hashtags.js'; -import { Note, IMentionedRemoteUsers } from '@/models/entities/note.js'; -import { Mutings, Users, NoteWatchings, Notes, Instances, UserProfiles, Antennas, Followings, MutedNotes, Channels, ChannelFollowings, Blockings } from '@/models/index.js'; -import { DriveFile } from '@/models/entities/drive-file.js'; -import { App } from '@/models/entities/app.js'; +import es from '../../db/elasticsearch'; +import { publishMainStream, publishNotesStream } from '@/services/stream'; +import DeliverManager from '@/remote/activitypub/deliver-manager'; +import renderNote from '@/remote/activitypub/renderer/note'; +import renderCreate from '@/remote/activitypub/renderer/create'; +import renderAnnounce from '@/remote/activitypub/renderer/announce'; +import { renderActivity } from '@/remote/activitypub/renderer/index'; +import { resolveUser } from '@/remote/resolve-user'; +import config from '@/config/index'; +import { updateHashtags } from '../update-hashtag'; +import { concat } from '../../prelude/array'; +import insertNoteUnread from './unread'; +import { registerOrFetchInstanceDoc } from '../register-or-fetch-instance-doc'; +import { extractMentions } from '@/misc/extract-mentions'; +import { extractCustomEmojisFromMfm } from '@/misc/extract-custom-emojis-from-mfm'; +import { extractHashtags } from '@/misc/extract-hashtags'; +import { Note, IMentionedRemoteUsers } from '@/models/entities/note'; +import { Mutings, Users, NoteWatchings, Notes, Instances, UserProfiles, Antennas, Followings, MutedNotes, Channels, ChannelFollowings, Blockings } from '@/models/index'; +import { DriveFile } from '@/models/entities/drive-file'; +import { App } from '@/models/entities/app'; import { Not, getConnection, In } from 'typeorm'; -import { User, ILocalUser, IRemoteUser } from '@/models/entities/user.js'; -import { genId } from '@/misc/gen-id.js'; -import { notesChart, perUserNotesChart, activeUsersChart, instanceChart } from '@/services/chart/index.js'; -import { Poll, IPoll } from '@/models/entities/poll.js'; -import { createNotification } from '../create-notification.js'; -import { isDuplicateKeyValueError } from '@/misc/is-duplicate-key-value-error.js'; -import { checkHitAntenna } from '@/misc/check-hit-antenna.js'; -import { checkWordMute } from '@/misc/check-word-mute.js'; -import { addNoteToAntenna } from '../add-note-to-antenna.js'; -import { countSameRenotes } from '@/misc/count-same-renotes.js'; -import { deliverToRelays } from '../relay.js'; -import { Channel } from '@/models/entities/channel.js'; -import { normalizeForSearch } from '@/misc/normalize-for-search.js'; -import { getAntennas } from '@/misc/antenna-cache.js'; +import { User, ILocalUser, IRemoteUser } from '@/models/entities/user'; +import { genId } from '@/misc/gen-id'; +import { notesChart, perUserNotesChart, activeUsersChart, instanceChart } from '@/services/chart/index'; +import { Poll, IPoll } from '@/models/entities/poll'; +import { createNotification } from '../create-notification'; +import { isDuplicateKeyValueError } from '@/misc/is-duplicate-key-value-error'; +import { checkHitAntenna } from '@/misc/check-hit-antenna'; +import { checkWordMute } from '@/misc/check-word-mute'; +import { addNoteToAntenna } from '../add-note-to-antenna'; +import { countSameRenotes } from '@/misc/count-same-renotes'; +import { deliverToRelays } from '../relay'; +import { Channel } from '@/models/entities/channel'; +import { normalizeForSearch } from '@/misc/normalize-for-search'; +import { getAntennas } from '@/misc/antenna-cache'; type NotificationType = 'reply' | 'renote' | 'quote' | 'mention'; diff --git a/src/services/note/delete.ts b/src/services/note/delete.ts index 353cd88034..a14d84e7b2 100644 --- a/src/services/note/delete.ts +++ b/src/services/note/delete.ts @@ -1,18 +1,18 @@ -import { publishNoteStream } from '@/services/stream.js'; -import renderDelete from '@/remote/activitypub/renderer/delete.js'; -import renderAnnounce from '@/remote/activitypub/renderer/announce.js'; -import renderUndo from '@/remote/activitypub/renderer/undo.js'; -import { renderActivity } from '@/remote/activitypub/renderer/index.js'; -import renderTombstone from '@/remote/activitypub/renderer/tombstone.js'; -import config from '@/config/index.js'; -import { registerOrFetchInstanceDoc } from '../register-or-fetch-instance-doc.js'; -import { User, ILocalUser, IRemoteUser } from '@/models/entities/user.js'; -import { Note, IMentionedRemoteUsers } from '@/models/entities/note.js'; -import { Notes, Users, Instances } from '@/models/index.js'; -import { notesChart, perUserNotesChart, instanceChart } from '@/services/chart/index.js'; -import { deliverToFollowers, deliverToUser } from '@/remote/activitypub/deliver-manager.js'; -import { countSameRenotes } from '@/misc/count-same-renotes.js'; -import { deliverToRelays } from '../relay.js'; +import { publishNoteStream } from '@/services/stream'; +import renderDelete from '@/remote/activitypub/renderer/delete'; +import renderAnnounce from '@/remote/activitypub/renderer/announce'; +import renderUndo from '@/remote/activitypub/renderer/undo'; +import { renderActivity } from '@/remote/activitypub/renderer/index'; +import renderTombstone from '@/remote/activitypub/renderer/tombstone'; +import config from '@/config/index'; +import { registerOrFetchInstanceDoc } from '../register-or-fetch-instance-doc'; +import { User, ILocalUser, IRemoteUser } from '@/models/entities/user'; +import { Note, IMentionedRemoteUsers } from '@/models/entities/note'; +import { Notes, Users, Instances } from '@/models/index'; +import { notesChart, perUserNotesChart, instanceChart } from '@/services/chart/index'; +import { deliverToFollowers, deliverToUser } from '@/remote/activitypub/deliver-manager'; +import { countSameRenotes } from '@/misc/count-same-renotes'; +import { deliverToRelays } from '../relay'; import { Brackets, In } from 'typeorm'; /** diff --git a/src/services/note/polls/update.ts b/src/services/note/polls/update.ts index 88baf16b64..a22ce8e373 100644 --- a/src/services/note/polls/update.ts +++ b/src/services/note/polls/update.ts @@ -1,10 +1,10 @@ -import renderUpdate from '@/remote/activitypub/renderer/update.js'; -import { renderActivity } from '@/remote/activitypub/renderer/index.js'; -import renderNote from '@/remote/activitypub/renderer/note.js'; -import { Users, Notes } from '@/models/index.js'; -import { Note } from '@/models/entities/note.js'; -import { deliverToFollowers } from '@/remote/activitypub/deliver-manager.js'; -import { deliverToRelays } from '../../relay.js'; +import renderUpdate from '@/remote/activitypub/renderer/update'; +import { renderActivity } from '@/remote/activitypub/renderer/index'; +import renderNote from '@/remote/activitypub/renderer/note'; +import { Users, Notes } from '@/models/index'; +import { Note } from '@/models/entities/note'; +import { deliverToFollowers } from '@/remote/activitypub/deliver-manager'; +import { deliverToRelays } from '../../relay'; export async function deliverQuestionUpdate(noteId: Note['id']) { const note = await Notes.findOne(noteId); diff --git a/src/services/note/polls/vote.ts b/src/services/note/polls/vote.ts index 36e06cb6a2..886a09dde9 100644 --- a/src/services/note/polls/vote.ts +++ b/src/services/note/polls/vote.ts @@ -1,10 +1,10 @@ -import { publishNoteStream } from '@/services/stream.js'; -import { User } from '@/models/entities/user.js'; -import { Note } from '@/models/entities/note.js'; -import { PollVotes, NoteWatchings, Polls, Blockings } from '@/models/index.js'; +import { publishNoteStream } from '@/services/stream'; +import { User } from '@/models/entities/user'; +import { Note } from '@/models/entities/note'; +import { PollVotes, NoteWatchings, Polls, Blockings } from '@/models/index'; import { Not } from 'typeorm'; -import { genId } from '@/misc/gen-id.js'; -import { createNotification } from '../../create-notification.js'; +import { genId } from '@/misc/gen-id'; +import { createNotification } from '../../create-notification'; export default async function(user: User, note: Note, choice: number) { const poll = await Polls.findOne(note.id); diff --git a/src/services/note/reaction/create.ts b/src/services/note/reaction/create.ts index f2dd273c42..308bd4dff7 100644 --- a/src/services/note/reaction/create.ts +++ b/src/services/note/reaction/create.ts @@ -1,19 +1,19 @@ -import { publishNoteStream } from '@/services/stream.js'; -import { renderLike } from '@/remote/activitypub/renderer/like.js'; -import DeliverManager from '@/remote/activitypub/deliver-manager.js'; -import { renderActivity } from '@/remote/activitypub/renderer/index.js'; -import { toDbReaction, decodeReaction } from '@/misc/reaction-lib.js'; -import { User, IRemoteUser } from '@/models/entities/user.js'; -import { Note } from '@/models/entities/note.js'; -import { NoteReactions, Users, NoteWatchings, Notes, Emojis, Blockings } from '@/models/index.js'; +import { publishNoteStream } from '@/services/stream'; +import { renderLike } from '@/remote/activitypub/renderer/like'; +import DeliverManager from '@/remote/activitypub/deliver-manager'; +import { renderActivity } from '@/remote/activitypub/renderer/index'; +import { toDbReaction, decodeReaction } from '@/misc/reaction-lib'; +import { User, IRemoteUser } from '@/models/entities/user'; +import { Note } from '@/models/entities/note'; +import { NoteReactions, Users, NoteWatchings, Notes, Emojis, Blockings } from '@/models/index'; import { Not } from 'typeorm'; -import { perUserReactionsChart } from '@/services/chart/index.js'; -import { genId } from '@/misc/gen-id.js'; -import { createNotification } from '../../create-notification.js'; -import deleteReaction from './delete.js'; -import { isDuplicateKeyValueError } from '@/misc/is-duplicate-key-value-error.js'; -import { NoteReaction } from '@/models/entities/note-reaction.js'; -import { IdentifiableError } from '@/misc/identifiable-error.js'; +import { perUserReactionsChart } from '@/services/chart/index'; +import { genId } from '@/misc/gen-id'; +import { createNotification } from '../../create-notification'; +import deleteReaction from './delete'; +import { isDuplicateKeyValueError } from '@/misc/is-duplicate-key-value-error'; +import { NoteReaction } from '@/models/entities/note-reaction'; +import { IdentifiableError } from '@/misc/identifiable-error'; export default async (user: { id: User['id']; host: User['host']; }, note: Note, reaction?: string) => { // Check blocking diff --git a/src/services/note/reaction/delete.ts b/src/services/note/reaction/delete.ts index 86e7b640ee..062dbad6f1 100644 --- a/src/services/note/reaction/delete.ts +++ b/src/services/note/reaction/delete.ts @@ -1,13 +1,13 @@ -import { publishNoteStream } from '@/services/stream.js'; -import { renderLike } from '@/remote/activitypub/renderer/like.js'; -import renderUndo from '@/remote/activitypub/renderer/undo.js'; -import { renderActivity } from '@/remote/activitypub/renderer/index.js'; -import DeliverManager from '@/remote/activitypub/deliver-manager.js'; -import { IdentifiableError } from '@/misc/identifiable-error.js'; -import { User, IRemoteUser } from '@/models/entities/user.js'; -import { Note } from '@/models/entities/note.js'; -import { NoteReactions, Users, Notes } from '@/models/index.js'; -import { decodeReaction } from '@/misc/reaction-lib.js'; +import { publishNoteStream } from '@/services/stream'; +import { renderLike } from '@/remote/activitypub/renderer/like'; +import renderUndo from '@/remote/activitypub/renderer/undo'; +import { renderActivity } from '@/remote/activitypub/renderer/index'; +import DeliverManager from '@/remote/activitypub/deliver-manager'; +import { IdentifiableError } from '@/misc/identifiable-error'; +import { User, IRemoteUser } from '@/models/entities/user'; +import { Note } from '@/models/entities/note'; +import { NoteReactions, Users, Notes } from '@/models/index'; +import { decodeReaction } from '@/misc/reaction-lib'; export default async (user: { id: User['id']; host: User['host']; }, note: Note) => { // if already unreacted diff --git a/src/services/note/read.ts b/src/services/note/read.ts index ac450af78b..2e221d553a 100644 --- a/src/services/note/read.ts +++ b/src/services/note/read.ts @@ -1,13 +1,13 @@ -import { publishMainStream } from '@/services/stream.js'; -import { Note } from '@/models/entities/note.js'; -import { User } from '@/models/entities/user.js'; -import { NoteUnreads, AntennaNotes, Users, Followings, ChannelFollowings } from '@/models/index.js'; +import { publishMainStream } from '@/services/stream'; +import { Note } from '@/models/entities/note'; +import { User } from '@/models/entities/user'; +import { NoteUnreads, AntennaNotes, Users, Followings, ChannelFollowings } from '@/models/index'; import { Not, IsNull, In } from 'typeorm'; -import { Channel } from '@/models/entities/channel.js'; -import { checkHitAntenna } from '@/misc/check-hit-antenna.js'; -import { getAntennas } from '@/misc/antenna-cache.js'; -import { PackedNote } from '@/models/repositories/note.js'; -import { readNotificationByQuery } from '@/server/api/common/read-notification.js'; +import { Channel } from '@/models/entities/channel'; +import { checkHitAntenna } from '@/misc/check-hit-antenna'; +import { getAntennas } from '@/misc/antenna-cache'; +import { PackedNote } from '@/models/repositories/note'; +import { readNotificationByQuery } from '@/server/api/common/read-notification'; /** * Mark notes as read diff --git a/src/services/note/unread.ts b/src/services/note/unread.ts index b68ff7974f..4a9df6083c 100644 --- a/src/services/note/unread.ts +++ b/src/services/note/unread.ts @@ -1,8 +1,8 @@ -import { Note } from '@/models/entities/note.js'; -import { publishMainStream } from '@/services/stream.js'; -import { User } from '@/models/entities/user.js'; -import { Mutings, NoteUnreads } from '@/models/index.js'; -import { genId } from '@/misc/gen-id.js'; +import { Note } from '@/models/entities/note'; +import { publishMainStream } from '@/services/stream'; +import { User } from '@/models/entities/user'; +import { Mutings, NoteUnreads } from '@/models/index'; +import { genId } from '@/misc/gen-id'; export default async function(userId: User['id'], note: Note, params: { // NOTE: isSpecifiedがtrueならisMentionedは必ずfalse diff --git a/src/services/note/unwatch.ts b/src/services/note/unwatch.ts index 32da2cf148..8ea02fe33c 100644 --- a/src/services/note/unwatch.ts +++ b/src/services/note/unwatch.ts @@ -1,6 +1,6 @@ -import { User } from '@/models/entities/user.js'; -import { NoteWatchings } from '@/models/index.js'; -import { Note } from '@/models/entities/note.js'; +import { User } from '@/models/entities/user'; +import { NoteWatchings } from '@/models/index'; +import { Note } from '@/models/entities/note'; export default async (me: User['id'], note: Note) => { await NoteWatchings.delete({ diff --git a/src/services/note/watch.ts b/src/services/note/watch.ts index 12d97c8458..e457191d99 100644 --- a/src/services/note/watch.ts +++ b/src/services/note/watch.ts @@ -1,8 +1,8 @@ -import { User } from '@/models/entities/user.js'; -import { Note } from '@/models/entities/note.js'; -import { NoteWatchings } from '@/models/index.js'; -import { genId } from '@/misc/gen-id.js'; -import { NoteWatching } from '@/models/entities/note-watching.js'; +import { User } from '@/models/entities/user'; +import { Note } from '@/models/entities/note'; +import { NoteWatchings } from '@/models/index'; +import { genId } from '@/misc/gen-id'; +import { NoteWatching } from '@/models/entities/note-watching'; export default async (me: User['id'], note: Note) => { // 自分の投稿はwatchできない diff --git a/src/services/push-notification.ts b/src/services/push-notification.ts index bedfa0533d..5bd7499692 100644 --- a/src/services/push-notification.ts +++ b/src/services/push-notification.ts @@ -1,9 +1,9 @@ import * as push from 'web-push'; -import config from '@/config/index.js'; -import { SwSubscriptions } from '@/models/index.js'; -import { fetchMeta } from '@/misc/fetch-meta.js'; -import { PackedNotification } from '../models/repositories/notification.js'; -import { PackedMessagingMessage } from '../models/repositories/messaging-message.js'; +import config from '@/config/index'; +import { SwSubscriptions } from '@/models/index'; +import { fetchMeta } from '@/misc/fetch-meta'; +import { PackedNotification } from '../models/repositories/notification'; +import { PackedMessagingMessage } from '../models/repositories/messaging-message'; type notificationType = 'notification' | 'unreadMessagingMessage'; type notificationBody = PackedNotification | PackedMessagingMessage; diff --git a/src/services/register-or-fetch-instance-doc.ts b/src/services/register-or-fetch-instance-doc.ts index 0bbc9ab275..a548ab0497 100644 --- a/src/services/register-or-fetch-instance-doc.ts +++ b/src/services/register-or-fetch-instance-doc.ts @@ -1,9 +1,9 @@ -import { Instance } from '@/models/entities/instance.js'; -import { Instances } from '@/models/index.js'; -import { federationChart } from '@/services/chart/index.js'; -import { genId } from '@/misc/gen-id.js'; -import { toPuny } from '@/misc/convert-host.js'; -import { Cache } from '@/misc/cache.js'; +import { Instance } from '@/models/entities/instance'; +import { Instances } from '@/models/index'; +import { federationChart } from '@/services/chart/index'; +import { genId } from '@/misc/gen-id'; +import { toPuny } from '@/misc/convert-host'; +import { Cache } from '@/misc/cache'; const cache = new Cache(1000 * 60 * 60); diff --git a/src/services/relay.ts b/src/services/relay.ts index 8e0fa12fb3..04775524fa 100644 --- a/src/services/relay.ts +++ b/src/services/relay.ts @@ -1,11 +1,11 @@ -import { createSystemUser } from './create-system-user.js'; -import { renderFollowRelay } from '@/remote/activitypub/renderer/follow-relay.js'; -import { renderActivity, attachLdSignature } from '@/remote/activitypub/renderer/index.js'; -import renderUndo from '@/remote/activitypub/renderer/undo.js'; -import { deliver } from '@/queue/index.js'; -import { ILocalUser, User } from '@/models/entities/user.js'; -import { Users, Relays } from '@/models/index.js'; -import { genId } from '@/misc/gen-id.js'; +import { createSystemUser } from './create-system-user'; +import { renderFollowRelay } from '@/remote/activitypub/renderer/follow-relay'; +import { renderActivity, attachLdSignature } from '@/remote/activitypub/renderer/index'; +import renderUndo from '@/remote/activitypub/renderer/undo'; +import { deliver } from '@/queue/index'; +import { ILocalUser, User } from '@/models/entities/user'; +import { Users, Relays } from '@/models/index'; +import { genId } from '@/misc/gen-id'; const ACTOR_USERNAME = 'relay.actor' as const; diff --git a/src/services/send-email-notification.ts b/src/services/send-email-notification.ts index 18f5b76074..519d56a06b 100644 --- a/src/services/send-email-notification.ts +++ b/src/services/send-email-notification.ts @@ -1,9 +1,9 @@ -import { UserProfiles } from '@/models/index.js'; -import { User } from '@/models/entities/user.js'; -import { sendEmail } from './send-email.js'; -import * as locales from '../../locales/index.js'; -import { I18n } from '@/misc/i18n.js'; -import { getAcct } from '@/misc/acct.js'; +import { UserProfiles } from '@/models/index'; +import { User } from '@/models/entities/user'; +import { sendEmail } from './send-email'; +import * as locales from '../../locales/index'; +import { I18n } from '@/misc/i18n'; +import { getAcct } from '@/misc/acct'; // TODO: locale ファイルをクライアント用とサーバー用で分けたい diff --git a/src/services/send-email.ts b/src/services/send-email.ts index 135fb3d329..d24168ec46 100644 --- a/src/services/send-email.ts +++ b/src/services/send-email.ts @@ -1,7 +1,7 @@ import * as nodemailer from 'nodemailer'; -import { fetchMeta } from '@/misc/fetch-meta.js'; -import Logger from './logger.js'; -import config from '@/config/index.js'; +import { fetchMeta } from '@/misc/fetch-meta'; +import Logger from './logger'; +import config from '@/config/index'; export const logger = new Logger('email'); diff --git a/src/services/stream.ts b/src/services/stream.ts index e334944533..4db1a77395 100644 --- a/src/services/stream.ts +++ b/src/services/stream.ts @@ -1,12 +1,12 @@ -import { redisClient } from '../db/redis.js'; -import { User } from '@/models/entities/user.js'; -import { Note } from '@/models/entities/note.js'; -import { UserList } from '@/models/entities/user-list.js'; -import { ReversiGame } from '@/models/entities/games/reversi/game.js'; -import { UserGroup } from '@/models/entities/user-group.js'; -import config from '@/config/index.js'; -import { Antenna } from '@/models/entities/antenna.js'; -import { Channel } from '@/models/entities/channel.js'; +import { redisClient } from '../db/redis'; +import { User } from '@/models/entities/user'; +import { Note } from '@/models/entities/note'; +import { UserList } from '@/models/entities/user-list'; +import { ReversiGame } from '@/models/entities/games/reversi/game'; +import { UserGroup } from '@/models/entities/user-group'; +import config from '@/config/index'; +import { Antenna } from '@/models/entities/antenna'; +import { Channel } from '@/models/entities/channel'; class Publisher { private publish = (channel: string, type: string | null, value?: any): void => { diff --git a/src/services/suspend-user.ts b/src/services/suspend-user.ts index 5ec639b1b8..55be63172f 100644 --- a/src/services/suspend-user.ts +++ b/src/services/suspend-user.ts @@ -1,9 +1,9 @@ -import renderDelete from '@/remote/activitypub/renderer/delete.js'; -import { renderActivity } from '@/remote/activitypub/renderer/index.js'; -import { deliver } from '@/queue/index.js'; -import config from '@/config/index.js'; -import { User } from '@/models/entities/user.js'; -import { Users, Followings } from '@/models/index.js'; +import renderDelete from '@/remote/activitypub/renderer/delete'; +import { renderActivity } from '@/remote/activitypub/renderer/index'; +import { deliver } from '@/queue/index'; +import config from '@/config/index'; +import { User } from '@/models/entities/user'; +import { Users, Followings } from '@/models/index'; import { Not, IsNull } from 'typeorm'; export async function doPostSuspend(user: { id: User['id']; host: User['host'] }) { diff --git a/src/services/unsuspend-user.ts b/src/services/unsuspend-user.ts index 3728e05392..bfffa036e5 100644 --- a/src/services/unsuspend-user.ts +++ b/src/services/unsuspend-user.ts @@ -1,10 +1,10 @@ -import renderDelete from '@/remote/activitypub/renderer/delete.js'; -import renderUndo from '@/remote/activitypub/renderer/undo.js'; -import { renderActivity } from '@/remote/activitypub/renderer/index.js'; -import { deliver } from '@/queue/index.js'; -import config from '@/config/index.js'; -import { User } from '@/models/entities/user.js'; -import { Users, Followings } from '@/models/index.js'; +import renderDelete from '@/remote/activitypub/renderer/delete'; +import renderUndo from '@/remote/activitypub/renderer/undo'; +import { renderActivity } from '@/remote/activitypub/renderer/index'; +import { deliver } from '@/queue/index'; +import config from '@/config/index'; +import { User } from '@/models/entities/user'; +import { Users, Followings } from '@/models/index'; import { Not, IsNull } from 'typeorm'; export async function doPostUnsuspend(user: User) { diff --git a/src/services/update-hashtag.ts b/src/services/update-hashtag.ts index b6fb38bc5a..e8504f6ff0 100644 --- a/src/services/update-hashtag.ts +++ b/src/services/update-hashtag.ts @@ -1,9 +1,9 @@ -import { User } from '@/models/entities/user.js'; -import { Hashtags, Users } from '@/models/index.js'; -import { hashtagChart } from '@/services/chart/index.js'; -import { genId } from '@/misc/gen-id.js'; -import { Hashtag } from '@/models/entities/hashtag.js'; -import { normalizeForSearch } from '@/misc/normalize-for-search.js'; +import { User } from '@/models/entities/user'; +import { Hashtags, Users } from '@/models/index'; +import { hashtagChart } from '@/services/chart/index'; +import { genId } from '@/misc/gen-id'; +import { Hashtag } from '@/models/entities/hashtag'; +import { normalizeForSearch } from '@/misc/normalize-for-search'; export async function updateHashtags(user: { id: User['id']; host: User['host']; }, tags: string[]) { for (const tag of tags) { diff --git a/src/services/user-list/push.ts b/src/services/user-list/push.ts index 01e9243c12..29d561b519 100644 --- a/src/services/user-list/push.ts +++ b/src/services/user-list/push.ts @@ -1,11 +1,11 @@ -import { publishUserListStream } from '@/services/stream.js'; -import { User } from '@/models/entities/user.js'; -import { UserList } from '@/models/entities/user-list.js'; -import { UserListJoinings, Users } from '@/models/index.js'; -import { UserListJoining } from '@/models/entities/user-list-joining.js'; -import { genId } from '@/misc/gen-id.js'; -import { fetchProxyAccount } from '@/misc/fetch-proxy-account.js'; -import createFollowing from '../following/create.js'; +import { publishUserListStream } from '@/services/stream'; +import { User } from '@/models/entities/user'; +import { UserList } from '@/models/entities/user-list'; +import { UserListJoinings, Users } from '@/models/index'; +import { UserListJoining } from '@/models/entities/user-list-joining'; +import { genId } from '@/misc/gen-id'; +import { fetchProxyAccount } from '@/misc/fetch-proxy-account'; +import createFollowing from '../following/create'; export async function pushUserToUserList(target: User, list: UserList) { await UserListJoinings.insert({ diff --git a/src/tools/accept-migration.ts b/src/tools/accept-migration.ts index adbfcdadf7..2e54fc129f 100644 --- a/src/tools/accept-migration.ts +++ b/src/tools/accept-migration.ts @@ -1,7 +1,7 @@ // ex) node built/tools/accept-migration Yo 1000000000001 import { createConnection } from 'typeorm'; -import config from '@/config/index.js'; +import config from '@/config/index'; createConnection({ type: 'postgres', diff --git a/src/tools/add-emoji.ts b/src/tools/add-emoji.ts index 054286c647..9ffe7dfa81 100644 --- a/src/tools/add-emoji.ts +++ b/src/tools/add-emoji.ts @@ -1,5 +1,5 @@ -import { Emojis } from '@/models/index.js'; -import { genId } from '@/misc/gen-id.js'; +import { Emojis } from '@/models/index'; +import { genId } from '@/misc/gen-id'; async function main(name: string, url: string, alias?: string): Promise { const aliases = alias != null ? [ alias ] : []; diff --git a/src/tools/demote-admin.ts b/src/tools/demote-admin.ts index 37bd5007a8..d7c6d1cec2 100644 --- a/src/tools/demote-admin.ts +++ b/src/tools/demote-admin.ts @@ -1,6 +1,6 @@ -import { initDb } from '../db/postgre.js'; +import { initDb } from '../db/postgre'; import { getRepository } from 'typeorm'; -import { User } from '@/models/entities/user.js'; +import { User } from '@/models/entities/user'; async function main(username: string) { if (!username) throw `username required`; diff --git a/src/tools/mark-admin.ts b/src/tools/mark-admin.ts index 4c583926eb..62ed0f09ee 100644 --- a/src/tools/mark-admin.ts +++ b/src/tools/mark-admin.ts @@ -1,6 +1,6 @@ -import { initDb } from '../db/postgre.js'; +import { initDb } from '../db/postgre'; import { getRepository } from 'typeorm'; -import { User } from '@/models/entities/user.js'; +import { User } from '@/models/entities/user'; async function main(username: string) { if (!username) throw `username required`; diff --git a/src/tools/refresh-question.ts b/src/tools/refresh-question.ts index 3e850ba83c..98a3c2865f 100644 --- a/src/tools/refresh-question.ts +++ b/src/tools/refresh-question.ts @@ -1,4 +1,4 @@ -import { updateQuestion } from '@/remote/activitypub/models/question.js'; +import { updateQuestion } from '@/remote/activitypub/models/question'; async function main(uri: string): Promise { return await updateQuestion(uri); diff --git a/src/tools/resync-remote-user.ts b/src/tools/resync-remote-user.ts index 3c02fb94c7..bc43e250cb 100644 --- a/src/tools/resync-remote-user.ts +++ b/src/tools/resync-remote-user.ts @@ -1,5 +1,5 @@ -import { initDb } from '@/db/postgre.js'; -import { parseAcct } from '@/misc/acct.js'; +import { initDb } from '@/db/postgre'; +import { parseAcct } from '@/misc/acct'; async function main(acct: string): Promise { await initDb(); diff --git a/src/tools/show-signin-history.ts b/src/tools/show-signin-history.ts index 6fdff3902e..ad92316314 100644 --- a/src/tools/show-signin-history.ts +++ b/src/tools/show-signin-history.ts @@ -1,4 +1,4 @@ -import { Users, Signins } from '@/models/index.js'; +import { Users, Signins } from '@/models/index'; // node built/tools/show-signin-history username // => {Success} {Date} {IPAddrsss}