fix lints "import/order" and "import/no-duplicate"
Some checks failed
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/test Pipeline failed

Also simplified some import paths by replacing relative with absolute paths.
This commit is contained in:
Johann150 2022-08-03 13:18:33 +02:00
parent bc1c66e16e
commit 37e47a257e
Signed by: Johann150
GPG key ID: 9EE6577A2A06F8F1
417 changed files with 710 additions and 716 deletions

View file

@ -11,8 +11,8 @@ import Logger from '@/services/logger.js';
import loadConfig from '@/config/load.js';
import { Config } from '@/config/types.js';
import { showMachineInfo } from '@/misc/show-machine-info.js';
import { envOption } from '../env.js';
import { db, initDb } from '../db/postgre.js';
import { envOption } from '@/env.js';
import { db, initDb } from '@/db/postgre.js';
const _filename = fileURLToPath(import.meta.url);
const _dirname = dirname(_filename);

View file

@ -1,5 +1,5 @@
import cluster from 'node:cluster';
import { initDb } from '../db/postgre.js';
import { initDb } from '@/db/postgre.js';
/**
* Init worker process

View file

@ -1,8 +1,9 @@
// TODO: 消したい
const interval = 30 * 60 * 1000;
import { AttestationChallenges } from '@/models/index.js';
import { LessThan } from 'typeorm';
import { AttestationChallenges } from '@/models/index.js';
const interval = 30 * 60 * 1000;
/**
* Clean up database occasionally

View file

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

View file

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

View file

@ -1,7 +1,7 @@
import fetch from 'node-fetch';
import { URLSearchParams } from 'node:url';
import { getAgentByUrl } from './fetch.js';
import fetch from 'node-fetch';
import config from '@/config/index.js';
import { getAgentByUrl } from './fetch.js';
export async function verifyRecaptcha(secret: string, response: string) {
const result = await getCaptchaResponse('https://www.recaptcha.net/recaptcha/api/siteverify', secret, response).catch(e => {

View file

@ -2,8 +2,8 @@ import { Antenna } from '@/models/entities/antenna.js';
import { Note } from '@/models/entities/note.js';
import { User } from '@/models/entities/user.js';
import { UserListJoinings, UserGroupJoinings, Blockings } from '@/models/index.js';
import { getFullApAccount } from './convert-host.js';
import * as Acct from '@/misc/acct.js';
import { getFullApAccount } from './convert-host.js';
import { Packed } from './schema.js';
import { Cache } from './cache.js';

View file

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

View file

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

View file

@ -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.js';
export async function fetchProxyAccount(): Promise<ILocalUser | null> {
const meta = await fetchMeta();

View file

@ -1,12 +1,12 @@
import { In, IsNull } from 'typeorm';
import config from '@/config/index.js';
import { Emojis } from '@/models/index.js';
import { Emoji } from '@/models/entities/emoji.js';
import { Note } from '@/models/entities/note.js';
import { query } from '@/prelude/url.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';
const cache = new Cache<Emoji | null>(1000 * 60 * 60 * 12);

View file

@ -1,9 +1,9 @@
/* eslint-disable key-spacing */
import { emojiRegex } from './emoji-regex.js';
import { fetchMeta } from './fetch-meta.js';
import { IsNull } from 'typeorm';
import { Emojis } from '@/models/index.js';
import { toPunyNullable } from './convert-host.js';
import { IsNull } from 'typeorm';
import { emojiRegex } from './emoji-regex.js';
import { fetchMeta } from './fetch-meta.js';
const legacies: Record<string, string> = {
'like': '👍',

View file

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

View file

@ -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.js';
@Entity()
export class AbuseUserReport {

View file

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

View file

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

View file

@ -1,7 +1,7 @@
import { Entity, Index, JoinColumn, Column, ManyToOne, PrimaryColumn } from 'typeorm';
import { id } from '../id.js';
import { Note } from './note.js';
import { Antenna } from './antenna.js';
import { id } from '../id.js';
@Entity()
@Index(['noteId', 'antennaId'], { unique: true })

View file

@ -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.js';
import { UserList } from './user-list.js';
import { UserGroupJoining } from './user-group-joining.js';

View file

@ -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.js';
@Entity()
export class App {

View file

@ -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.js';
@Entity()
export class AttestationChallenge {

View file

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

View file

@ -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.js';
@Entity()
@Index(['blockerId', 'blockeeId'], { unique: true })

View file

@ -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.js';
import { Channel } from './channel.js';
@Entity()

View file

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

View file

@ -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.js';
import { DriveFile } from './drive-file.js';
@Entity()

View file

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

View file

@ -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.js';
@Entity()
export class Clip {

View file

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

View file

@ -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.js';
@Entity()
export class DriveFolder {

View file

@ -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.js';
@Entity()
@Index(['followerId', 'followeeId'], { unique: true })

View file

@ -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.js';
@Entity()
@Index(['followerId', 'followeeId'], { unique: true })

View file

@ -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.js';
import { GalleryPost } from './gallery-post.js';
@Entity()

View file

@ -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.js';
import { DriveFile } from './drive-file.js';
@Entity()

View file

@ -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.js';
@Entity()
export class Hashtag {

View file

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

View file

@ -1,6 +1,6 @@
import { Entity, Column, PrimaryColumn, ManyToOne, JoinColumn } from 'typeorm';
import { User } from './user.js';
import { id } from '../id.js';
import { User } from './user.js';
import { Clip } from './clip.js';
@Entity()

View file

@ -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.js';
@Entity()
export class ModerationLog {

View file

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

View file

@ -1,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.js';
@Entity()
@Index(['muterId', 'muteeId'], { unique: true })

View file

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

View file

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

View file

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

View file

@ -1,7 +1,7 @@
import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm';
import { id } from '../id.js';
import { User } from './user.js';
import { Note } from './note.js';
import { id } from '../id.js';
import { Channel } from './channel.js';
@Entity()

View file

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

View file

@ -1,8 +1,8 @@
import { Entity, Index, JoinColumn, Column, PrimaryColumn, ManyToOne } from 'typeorm';
import { noteVisibilities } from '@/types.js';
import { id } from '../id.js';
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';
@Entity()

View file

@ -1,11 +1,11 @@
import { Entity, Index, JoinColumn, ManyToOne, Column, PrimaryColumn } from 'typeorm';
import { User } from './user.js';
import { notificationTypes } from '@/types.js';
import { id } from '../id.js';
import { User } from './user.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';
@Entity()
export class Notification {

View file

@ -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.js';
import { Page } from './page.js';
@Entity()

View file

@ -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.js';
import { DriveFile } from './drive-file.js';
@Entity()

View file

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

View file

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

View file

@ -1,7 +1,7 @@
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 { id } from '../id.js';
@Entity()
export class PromoNote {

View file

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

View file

@ -1,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.js';
// TODO: 同じdomain、同じscope、同じkeyのレコードは二つ以上存在しないように制約付けたい
@Entity()

View file

@ -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.js';
@Entity()
export class Signin {

View file

@ -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.js';
@Entity()
export class SwSubscription {

View file

@ -1,7 +1,7 @@
import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm';
import { id } from '../id.js';
import { User } from './user.js';
import { UserGroup } from './user-group.js';
import { id } from '../id.js';
@Entity()
@Index(['userId', 'userGroupId'], { unique: true })

View file

@ -1,7 +1,7 @@
import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm';
import { id } from '../id.js';
import { User } from './user.js';
import { UserGroup } from './user-group.js';
import { id } from '../id.js';
@Entity()
@Index(['userId', 'userGroupId'], { unique: true })

View file

@ -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.js';
@Entity()
export class UserGroup {

View file

@ -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.js';
@Entity()
export class UserKeypair {

View file

@ -1,7 +1,7 @@
import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm';
import { id } from '../id.js';
import { User } from './user.js';
import { UserList } from './user-list.js';
import { id } from '../id.js';
@Entity()
@Index(['userId', 'userListId'], { unique: true })

View file

@ -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.js';
@Entity()
export class UserList {

View file

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

View file

@ -1,8 +1,8 @@
import { Entity, Column, Index, OneToOne, JoinColumn, PrimaryColumn } from 'typeorm';
import { ffVisibility, notificationTypes } from '@/types.js';
import { id } from '../id.js';
import { User } from './user.js';
import { Page } from './page.js';
import { ffVisibility, notificationTypes } from '@/types.js';
// TODO: このテーブルで管理している情報すべてレジストリで管理するようにしても良いかも
// ただ、「emailVerified が true なユーザーを find する」のようなクエリは書けなくなるからウーン

View file

@ -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.js';
@Entity()
export class UserPublickey {

View file

@ -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.js';
@Entity()
export class UserSecurityKey {

View file

@ -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.js';
export const webhookEventTypes = ['mention', 'unfollow', 'follow', 'followed', 'note', 'reply', 'renote', 'reaction'] as const;

View file

@ -1,7 +1,7 @@
import { db } from '@/db/postgre.js';
import { Users } from '../index.js';
import { AbuseUserReport } from '@/models/entities/abuse-user-report.js';
import { awaitAll } from '@/prelude/await-all.js';
import { Users } from '../index.js';
export const AbuseUserReportRepository = db.getRepository(AbuseUserReport).extend({
async pack(

View file

@ -1,7 +1,7 @@
import { db } from '@/db/postgre.js';
import { Packed } from '@/misc/schema.js';
import { App } from '@/models/entities/app.js';
import { AccessTokens } from '../index.js';
import { Packed } from '@/misc/schema.js';
import { User } from '../entities/user.js';
export const AppRepository = db.getRepository(App).extend({

View file

@ -1,8 +1,8 @@
import { db } from '@/db/postgre.js';
import { Apps } from '../index.js';
import { AuthSession } from '@/models/entities/auth-session.js';
import { awaitAll } from '@/prelude/await-all.js';
import { User } from '@/models/entities/user.js';
import { awaitAll } from '@/prelude/await-all.js';
import { Apps } from '../index.js';
export const AuthSessionRepository = db.getRepository(AuthSession).extend({
async pack(

View file

@ -1,9 +1,9 @@
import { db } from '@/db/postgre.js';
import { Users } from '../index.js';
import { Blocking } from '@/models/entities/blocking.js';
import { awaitAll } from '@/prelude/await-all.js';
import { Packed } from '@/misc/schema.js';
import { Blocking } from '@/models/entities/blocking.js';
import { User } from '@/models/entities/user.js';
import { awaitAll } from '@/prelude/await-all.js';
import { Users } from '../index.js';
export const BlockingRepository = db.getRepository(Blocking).extend({
async pack(

View file

@ -1,8 +1,8 @@
import { db } from '@/db/postgre.js';
import { Channel } from '@/models/entities/channel.js';
import { Packed } from '@/misc/schema.js';
import { DriveFiles, ChannelFollowings, NoteUnreads } from '../index.js';
import { Channel } from '@/models/entities/channel.js';
import { User } from '@/models/entities/user.js';
import { DriveFiles, ChannelFollowings, NoteUnreads } from '../index.js';
export const ChannelRepository = db.getRepository(Channel).extend({
async pack(

View file

@ -1,8 +1,8 @@
import { db } from '@/db/postgre.js';
import { Clip } from '@/models/entities/clip.js';
import { Packed } from '@/misc/schema.js';
import { Users } from '../index.js';
import { Clip } from '@/models/entities/clip.js';
import { awaitAll } from '@/prelude/await-all.js';
import { Users } from '../index.js';
export const ClipRepository = db.getRepository(Clip).extend({
async pack(

View file

@ -1,8 +1,8 @@
import { db } from '@/db/postgre.js';
import { DriveFolders, DriveFiles } from '../index.js';
import { Packed } from '@/misc/schema.js';
import { DriveFolder } from '@/models/entities/drive-folder.js';
import { awaitAll } from '@/prelude/await-all.js';
import { Packed } from '@/misc/schema.js';
import { DriveFolders, DriveFiles } from '../index.js';
export const DriveFolderRepository = db.getRepository(DriveFolder).extend({
async pack(

View file

@ -1,7 +1,7 @@
import { db } from '@/db/postgre.js';
import { FollowRequest } from '@/models/entities/follow-request.js';
import { Users } from '../index.js';
import { User } from '@/models/entities/user.js';
import { Users } from '../index.js';
export const FollowRequestRepository = db.getRepository(FollowRequest).extend({
async pack(

View file

@ -1,9 +1,9 @@
import { db } from '@/db/postgre.js';
import { Users } from '../index.js';
import { Following } from '@/models/entities/following.js';
import { awaitAll } from '@/prelude/await-all.js';
import { Packed } from '@/misc/schema.js';
import { Following } from '@/models/entities/following.js';
import { User } from '@/models/entities/user.js';
import { awaitAll } from '@/prelude/await-all.js';
import { Users } from '../index.js';
type LocalFollowerFollowing = Following & {
followerHost: null;

View file

@ -1,9 +1,9 @@
import { db } from '@/db/postgre.js';
import { GalleryPost } from '@/models/entities/gallery-post.js';
import { Packed } from '@/misc/schema.js';
import { Users, DriveFiles, GalleryLikes } from '../index.js';
import { awaitAll } from '@/prelude/await-all.js';
import { GalleryPost } from '@/models/entities/gallery-post.js';
import { User } from '@/models/entities/user.js';
import { awaitAll } from '@/prelude/await-all.js';
import { Users, DriveFiles, GalleryLikes } from '../index.js';
export const GalleryPostRepository = db.getRepository(GalleryPost).extend({
async pack(

View file

@ -1,8 +1,8 @@
import { db } from '@/db/postgre.js';
import { MessagingMessage } from '@/models/entities/messaging-message.js';
import { Users, DriveFiles, UserGroups } from '../index.js';
import { Packed } from '@/misc/schema.js';
import { MessagingMessage } from '@/models/entities/messaging-message.js';
import { User } from '@/models/entities/user.js';
import { Users, DriveFiles, UserGroups } from '../index.js';
export const MessagingMessageRepository = db.getRepository(MessagingMessage).extend({
async pack(

View file

@ -1,7 +1,7 @@
import { db } from '@/db/postgre.js';
import { Users } from '../index.js';
import { ModerationLog } from '@/models/entities/moderation-log.js';
import { awaitAll } from '@/prelude/await-all.js';
import { Users } from '../index.js';
export const ModerationLogRepository = db.getRepository(ModerationLog).extend({
async pack(

View file

@ -1,9 +1,9 @@
import { db } from '@/db/postgre.js';
import { Users } from '../index.js';
import { Muting } from '@/models/entities/muting.js';
import { awaitAll } from '@/prelude/await-all.js';
import { Packed } from '@/misc/schema.js';
import { Muting } from '@/models/entities/muting.js';
import { User } from '@/models/entities/user.js';
import { awaitAll } from '@/prelude/await-all.js';
import { Users } from '../index.js';
export const MutingRepository = db.getRepository(Muting).extend({
async pack(

View file

@ -1,7 +1,7 @@
import { db } from '@/db/postgre.js';
import { NoteFavorite } from '@/models/entities/note-favorite.js';
import { Notes } from '../index.js';
import { User } from '@/models/entities/user.js';
import { Notes } from '../index.js';
export const NoteFavoriteRepository = db.getRepository(NoteFavorite).extend({
async pack(

View file

@ -1,9 +1,9 @@
import { db } from '@/db/postgre.js';
import { NoteReaction } from '@/models/entities/note-reaction.js';
import { Notes, Users } from '../index.js';
import { Packed } from '@/misc/schema.js';
import { convertLegacyReaction } from '@/misc/reaction-lib.js';
import { Packed } from '@/misc/schema.js';
import { NoteReaction } from '@/models/entities/note-reaction.js';
import { User } from '@/models/entities/user.js';
import { Notes, Users } from '../index.js';
export const NoteReactionRepository = db.getRepository(NoteReaction).extend({
async pack(

View file

@ -1,16 +1,16 @@
import { In } from 'typeorm';
import * as mfm from 'mfm-js';
import { Note } from '@/models/entities/note.js';
import { User } from '@/models/entities/user.js';
import { Users, PollVotes, DriveFiles, NoteReactions, Followings, Polls, Channels } from '../index.js';
import { Packed } 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 '@/models/entities/note-reaction.js';
import { aggregateNoteEmojis, populateEmojis, prefetchEmojis } from '@/misc/populate-emojis.js';
import { db } from '@/db/postgre.js';
import { IdentifiableError } from '@/misc/identifiable-error.js';
import { nyaize } from '@/misc/nyaize.js';
import { aggregateNoteEmojis, populateEmojis, prefetchEmojis } from '@/misc/populate-emojis.js';
import { convertLegacyReaction, convertLegacyReactions, decodeReaction } from '@/misc/reaction-lib.js';
import { Packed } from '@/misc/schema.js';
import { Note } from '@/models/entities/note.js';
import { NoteReaction } from '@/models/entities/note-reaction.js';
import { User } from '@/models/entities/user.js';
import { awaitAll } from '@/prelude/await-all.js';
import { Users, PollVotes, DriveFiles, NoteReactions, Followings, Polls, Channels } from '../index.js';
async function populatePoll(note: Note, meId: User['id'] | null) {
const poll = await Polls.findOneByOrFail({ noteId: note.id });

View file

@ -1,13 +1,13 @@
import { In } from 'typeorm';
import { Users, Notes, UserGroupInvitations, AccessTokens, NoteReactions } from '../index.js';
import { Notification } from '@/models/entities/notification.js';
import { awaitAll } from '@/prelude/await-all.js';
import { db } from '@/db/postgre.js';
import { aggregateNoteEmojis, prefetchEmojis } from '@/misc/populate-emojis.js';
import { Packed } from '@/misc/schema.js';
import { Note } from '@/models/entities/note.js';
import { NoteReaction } from '@/models/entities/note-reaction.js';
import { Notification } from '@/models/entities/notification.js';
import { User } from '@/models/entities/user.js';
import { aggregateNoteEmojis, prefetchEmojis } from '@/misc/populate-emojis.js';
import { db } from '@/db/postgre.js';
import { awaitAll } from '@/prelude/await-all.js';
import { Users, Notes, UserGroupInvitations, AccessTokens, NoteReactions } from '../index.js';
export const NotificationRepository = db.getRepository(Notification).extend({
async pack(

View file

@ -1,7 +1,7 @@
import { db } from '@/db/postgre.js';
import { PageLike } from '@/models/entities/page-like.js';
import { Pages } from '../index.js';
import { User } from '@/models/entities/user.js';
import { Pages } from '../index.js';
export const PageLikeRepository = db.getRepository(PageLike).extend({
async pack(

View file

@ -1,7 +1,7 @@
import { db } from '@/db/postgre.js';
import { Packed } from '@/misc/schema.js';
import { UserGroup } from '@/models/entities/user-group.js';
import { UserGroupJoinings } from '../index.js';
import { Packed } from '@/misc/schema.js';
export const UserGroupRepository = db.getRepository(UserGroup).extend({
async pack(

View file

@ -1,7 +1,7 @@
import { db } from '@/db/postgre.js';
import { Packed } from '@/misc/schema.js';
import { UserList } from '@/models/entities/user-list.js';
import { UserListJoinings } from '../index.js';
import { Packed } from '@/misc/schema.js';
export const UserListRepository = db.getRepository(UserList).extend({
async pack(

View file

@ -2,6 +2,9 @@ import httpSignature from '@peertube/http-signature';
import { v4 as uuid } from 'uuid';
import config from '@/config/index.js';
import { DriveFile } from '@/models/entities/drive-file.js';
import { Webhook, webhookEventTypes } from '@/models/entities/webhook.js';
import { IActivity } from '@/remote/activitypub/type.js';
import { envOption } from '../env.js';
import processDeliver from './processors/deliver.js';
@ -12,12 +15,9 @@ import processSystemQueue from './processors/system/index.js';
import processWebhookDeliver from './processors/webhook-deliver.js';
import { endedPollNotification } from './processors/ended-poll-notification.js';
import { queueLogger } from './logger.js';
import { DriveFile } from '@/models/entities/drive-file.js';
import { getJobInfo } from './get-job-info.js';
import { systemQueue, dbQueue, deliverQueue, inboxQueue, objectStorageQueue, endedPollNotificationQueue, webhookDeliverQueue } from './queues.js';
import { ThinUser } from './types.js';
import { IActivity } from '@/remote/activitypub/type.js';
import { Webhook, webhookEventTypes } from '@/models/entities/webhook.js';
function renderError(e: Error): any {
return {

View file

@ -1,10 +1,10 @@
import Bull from 'bull';
import { queueLogger } from '../../logger.js';
import { DriveFiles, Notes, UserProfiles, Users } from '@/models/index.js';
import { DbUserDeleteJobData } from '@/queue/types.js';
import { Note } from '@/models/entities/note.js';
import { DriveFile } from '@/models/entities/drive-file.js';
import { MoreThan } from 'typeorm';
import { DriveFiles, Notes, UserProfiles, Users } from '@/models/index.js';
import { DriveFile } from '@/models/entities/drive-file.js';
import { Note } from '@/models/entities/note.js';
import { queueLogger } from '@/queue/logger.js';
import { DbUserDeleteJobData } from '@/queue/types.js';
import { deleteFileSync } from '@/services/drive/delete-file.js';
import { sendEmail } from '@/services/send-email.js';

View file

@ -1,10 +1,9 @@
import Bull from 'bull';
import { queueLogger } from '../../logger.js';
import { deleteFileSync } from '@/services/drive/delete-file.js';
import { Users, DriveFiles } from '@/models/index.js';
import { MoreThan } from 'typeorm';
import { Users, DriveFiles } from '@/models/index.js';
import { deleteFileSync } from '@/services/drive/delete-file.js';
import { DbUserJobData } from '@/queue/types.js';
import { queueLogger } from '../../logger.js';
const logger = queueLogger.createSubLogger('delete-drive-files');

View file

@ -1,14 +1,14 @@
import Bull from 'bull';
import * as fs from 'node:fs';
import { queueLogger } from '../../logger.js';
import { addFile } from '@/services/drive/add-file.js';
import Bull from 'bull';
import { format as dateFormat } from 'date-fns';
import { MoreThan } from 'typeorm';
import { getFullApAccount } from '@/misc/convert-host.js';
import { createTemp } from '@/misc/create-temp.js';
import { Users, Blockings } from '@/models/index.js';
import { MoreThan } from 'typeorm';
import { DbUserJobData } from '@/queue/types.js';
import { addFile } from '@/services/drive/add-file.js';
import { queueLogger } from '../../logger.js';
const logger = queueLogger.createSubLogger('export-blocking');

View file

@ -1,17 +1,16 @@
import Bull from 'bull';
import * as fs from 'node:fs';
import mime from 'mime-types';
import archiver from 'archiver';
import { queueLogger } from '../../logger.js';
import { addFile } from '@/services/drive/add-file.js';
import Bull from 'bull';
import { format as dateFormat } from 'date-fns';
import { Users, Emojis } from '@/models/index.js';
import { } from '@/queue/types.js';
import mime from 'mime-types';
import { IsNull } from 'typeorm';
import config from '@/config/index.js';
import { createTemp, createTempDir } from '@/misc/create-temp.js';
import { downloadUrl } from '@/misc/download-url.js';
import config from '@/config/index.js';
import { IsNull } from 'typeorm';
import { Users, Emojis } from '@/models/index.js';
import { } from '@/queue/types.js';
import { addFile } from '@/services/drive/add-file.js';
import { queueLogger } from '../../logger.js';
const logger = queueLogger.createSubLogger('export-custom-emojis');

View file

@ -1,15 +1,15 @@
import Bull from 'bull';
import * as fs from 'node:fs';
import { queueLogger } from '../../logger.js';
import { addFile } from '@/services/drive/add-file.js';
import Bull from 'bull';
import { format as dateFormat } from 'date-fns';
import { In, MoreThan, Not } from 'typeorm';
import { getFullApAccount } from '@/misc/convert-host.js';
import { createTemp } from '@/misc/create-temp.js';
import { Users, Followings, Mutings } from '@/models/index.js';
import { In, MoreThan, Not } from 'typeorm';
import { DbUserJobData } from '@/queue/types.js';
import { Following } from '@/models/entities/following.js';
import { Users, Followings, Mutings } from '@/models/index.js';
import { DbUserJobData } from '@/queue/types.js';
import { addFile } from '@/services/drive/add-file.js';
import { queueLogger } from '../../logger.js';
const logger = queueLogger.createSubLogger('export-following');

View file

@ -1,14 +1,14 @@
import Bull from 'bull';
import * as fs from 'node:fs';
import { queueLogger } from '../../logger.js';
import { addFile } from '@/services/drive/add-file.js';
import Bull from 'bull';
import { format as dateFormat } from 'date-fns';
import { IsNull, MoreThan } from 'typeorm';
import { getFullApAccount } from '@/misc/convert-host.js';
import { createTemp } from '@/misc/create-temp.js';
import { Users, Mutings } from '@/models/index.js';
import { IsNull, MoreThan } from 'typeorm';
import { DbUserJobData } from '@/queue/types.js';
import { addFile } from '@/services/drive/add-file.js';
import { queueLogger } from '../../logger.js';
const logger = queueLogger.createSubLogger('export-mute');

View file

@ -1,15 +1,15 @@
import Bull from 'bull';
import * as fs from 'node:fs';
import { queueLogger } from '../../logger.js';
import { addFile } from '@/services/drive/add-file.js';
import Bull from 'bull';
import { format as dateFormat } from 'date-fns';
import { Users, Notes, Polls } from '@/models/index.js';
import { MoreThan } from 'typeorm';
import { createTemp } from '@/misc/create-temp.js';
import { Note } from '@/models/entities/note.js';
import { Poll } from '@/models/entities/poll.js';
import { Users, Notes, Polls } from '@/models/index.js';
import { DbUserJobData } from '@/queue/types.js';
import { createTemp } from '@/misc/create-temp.js';
import { addFile } from '@/services/drive/add-file.js';
import { queueLogger } from '../../logger.js';
const logger = queueLogger.createSubLogger('export-notes');

View file

@ -1,14 +1,14 @@
import Bull from 'bull';
import * as fs from 'node:fs';
import { queueLogger } from '../../logger.js';
import { addFile } from '@/services/drive/add-file.js';
import Bull from 'bull';
import { format as dateFormat } from 'date-fns';
import { In } from 'typeorm';
import { getFullApAccount } from '@/misc/convert-host.js';
import { createTemp } from '@/misc/create-temp.js';
import { Users, UserLists, UserListJoinings } from '@/models/index.js';
import { In } from 'typeorm';
import { DbUserJobData } from '@/queue/types.js';
import { addFile } from '@/services/drive/add-file.js';
import { queueLogger } from '../../logger.js';
const logger = queueLogger.createSubLogger('export-user-lists');

View file

@ -1,14 +1,14 @@
import Bull from 'bull';
import { IsNull } from 'typeorm';
import { queueLogger } from '../../logger.js';
import * as Acct from '@/misc/acct.js';
import { resolveUser } from '@/remote/resolve-user.js';
import { downloadTextFile } from '@/misc/download-text-file.js';
import { isSelfHost, toPuny } from '@/misc/convert-host.js';
import { downloadTextFile } from '@/misc/download-text-file.js';
import { Users, DriveFiles } from '@/models/index.js';
import { DbUserImportJobData } from '@/queue/types.js';
import { resolveUser } from '@/remote/resolve-user.js';
import block from '@/services/blocking/create.js';
import { IsNull } from 'typeorm';
import { queueLogger } from '../../logger.js';
const logger = queueLogger.createSubLogger('import-blocking');

View file

@ -1,15 +1,15 @@
import Bull from 'bull';
import * as fs from 'node:fs';
import Bull from 'bull';
import unzipper from 'unzipper';
import { queueLogger } from '../../logger.js';
import { db } from '@/db/postgre.js';
import { createTempDir } from '@/misc/create-temp.js';
import { downloadUrl } from '@/misc/download-url.js';
import { genId } from '@/misc/gen-id.js';
import { DriveFiles, Emojis } from '@/models/index.js';
import { DbUserImportJobData } from '@/queue/types.js';
import { addFile } from '@/services/drive/add-file.js';
import { genId } from '@/misc/gen-id.js';
import { db } from '@/db/postgre.js';
import { queueLogger } from '../../logger.js';
const logger = queueLogger.createSubLogger('import-custom-emojis');

View file

@ -1,14 +1,14 @@
import Bull from 'bull';
import { IsNull } from 'typeorm';
import { queueLogger } from '../../logger.js';
import follow from '@/services/following/create.js';
import * as Acct from '@/misc/acct.js';
import { resolveUser } from '@/remote/resolve-user.js';
import { downloadTextFile } from '@/misc/download-text-file.js';
import { isSelfHost, toPuny } from '@/misc/convert-host.js';
import { downloadTextFile } from '@/misc/download-text-file.js';
import { Users, DriveFiles } from '@/models/index.js';
import { DbUserImportJobData } from '@/queue/types.js';
import { IsNull } from 'typeorm';
import { resolveUser } from '@/remote/resolve-user.js';
import follow from '@/services/following/create.js';
import { queueLogger } from '../../logger.js';
const logger = queueLogger.createSubLogger('import-following');

View file

@ -1,16 +1,16 @@
import Bull from 'bull';
import { queueLogger } from '../../logger.js';
import * as Acct from '@/misc/acct.js';
import { resolveUser } from '@/remote/resolve-user.js';
import { downloadTextFile } from '@/misc/download-text-file.js';
import { isSelfHost, toPuny } from '@/misc/convert-host.js';
import { Users, DriveFiles, Mutings } from '@/models/index.js';
import { DbUserImportJobData } from '@/queue/types.js';
import { User } from '@/models/entities/user.js';
import { genId } from '@/misc/gen-id.js';
import { IsNull } from 'typeorm';
import * as Acct from '@/misc/acct.js';
import { isSelfHost, toPuny } from '@/misc/convert-host.js';
import { downloadTextFile } from '@/misc/download-text-file.js';
import { genId } from '@/misc/gen-id.js';
import { Users, DriveFiles, Mutings } from '@/models/index.js';
import { User } from '@/models/entities/user.js';
import { DbUserImportJobData } from '@/queue/types.js';
import { resolveUser } from '@/remote/resolve-user.js';
import { queueLogger } from '../../logger.js';
const logger = queueLogger.createSubLogger('import-muting');
export async function importMuting(job: Bull.Job<DbUserImportJobData>, done: any): Promise<void> {

View file

@ -1,15 +1,15 @@
import Bull from 'bull';
import { IsNull } from 'typeorm';
import { queueLogger } from '../../logger.js';
import * as Acct from '@/misc/acct.js';
import { isSelfHost, toPuny } from '@/misc/convert-host.js';
import { downloadTextFile } from '@/misc/download-text-file.js';
import { genId } from '@/misc/gen-id.js';
import { DriveFiles, Users, UserLists, UserListJoinings } from '@/models/index.js';
import { DbUserImportJobData } from '@/queue/types.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 { IsNull } from 'typeorm';
import { queueLogger } from '../../logger.js';
const logger = queueLogger.createSubLogger('import-user-lists');

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