refactor: remove default export for Resolver

This commit is contained in:
Johann150 2022-12-11 15:33:03 +01:00
parent ae59ce51b0
commit 3ef1a4b0f9
Signed by untrusted user: Johann150
GPG key ID: 9EE6577A2A06F8F1
24 changed files with 24 additions and 24 deletions

View file

@ -9,7 +9,7 @@ import { apRequestChart, federationChart, instanceChart } from '@/services/chart
import { toPuny, extractDbHost } from '@/misc/convert-host.js';
import { getApId } from '@/remote/activitypub/type.js';
import { fetchInstanceMetadata } from '@/services/fetch-instance-metadata.js';
import Resolver from '@/remote/activitypub/resolver.js';
import { Resolver } from '@/remote/activitypub/resolver.js';
import { LdSignature } from '@/remote/activitypub/misc/ld-signature.js';
import { getAuthUser } from '@/remote/activitypub/misc/auth-user.js';
import { StatusError } from '@/misc/fetch.js';

View file

@ -2,7 +2,7 @@ import promiseLimit from 'promise-limit';
import { CacheableRemoteUser, CacheableUser } from '@/models/entities/user.js';
import { unique, concat } from '@/prelude/array.js';
import { resolvePerson } from './models/person.js';
import Resolver from './resolver.js';
import { Resolver } from './resolver.js';
import { ApObject, getApIds } from './type.js';
type Visibility = 'public' | 'home' | 'followers' | 'specified';

View file

@ -1,6 +1,6 @@
import { CacheableRemoteUser } from '@/models/entities/user.js';
import { apLogger } from '@/remote/activitypub/logger.js';
import Resolver from '@/remote/activitypub/resolver.js';
import { Resolver } from '@/remote/activitypub/resolver.js';
import { IAccept, isFollow, getApType } from '@/remote/activitypub/type.js';
import acceptFollow from './follow.js';

View file

@ -2,7 +2,7 @@ import { CacheableRemoteUser } from '@/models/entities/user.js';
import { addPinned } from '@/services/i/pin.js';
import { resolveNote } from '@/remote/activitypub/models/note.js';
import { IAdd } from '@/remote/activitypub/type.js';
import Resolver from '@/remote/activitypub/resolver.js';
import { Resolver } from '@/remote/activitypub/resolver.js';
export default async (actor: CacheableRemoteUser, activity: IAdd, resolver: Resolver): Promise<void> => {
if ('actor' in activity && actor.uri !== activity.actor) {

View file

@ -1,6 +1,6 @@
import { CacheableRemoteUser } from '@/models/entities/user.js';
import { apLogger } from '@/remote/activitypub/logger.js';
import Resolver from '@/remote/activitypub/resolver.js';
import { Resolver } from '@/remote/activitypub/resolver.js';
import { IAnnounce, getApId } from '@/remote/activitypub/type.js';
import announceNote from './note.js';

View file

@ -7,7 +7,7 @@ import { Notes } from '@/models/index.js';
import { parseAudience } from '@/remote/activitypub/audience.js';
import { apLogger } from '@/remote/activitypub/logger.js';
import { fetchNote, resolveNote } from '@/remote/activitypub/models/note.js';
import Resolver from '@/remote/activitypub/resolver.js';
import { Resolver } from '@/remote/activitypub/resolver.js';
import { IAnnounce, getApId } from '@/remote/activitypub/type.js';
import { shouldBlockInstance } from '@/misc/should-block-instance.js';

View file

@ -1,6 +1,6 @@
import { CacheableRemoteUser } from '@/models/entities/user.js';
import { toArray, concat, unique } from '@/prelude/array.js';
import Resolver from '../../resolver.js';
import { Resolver } from '@/remote/activitypub/resolver.js';
import { ICreate, getApId, isPost, getApType } from '../../type.js';
import { apLogger } from '../../logger.js';
import createNote from './note.js';

View file

@ -2,7 +2,7 @@ import { CacheableRemoteUser } from '@/models/entities/user.js';
import { getApLock } from '@/misc/app-lock.js';
import { extractDbHost } from '@/misc/convert-host.js';
import { StatusError } from '@/misc/fetch.js';
import Resolver from '@/remote/activitypub/resolver.js';
import { Resolver } from '@/remote/activitypub/resolver.js';
import { createNote, fetchNote } from '@/remote/activitypub/models/note.js';
import { getApId, IObject, ICreate } from '@/remote/activitypub/type.js';

View file

@ -1,7 +1,7 @@
import { CacheableRemoteUser } from '@/models/entities/user.js';
import { toArray } from '@/prelude/array.js';
import { Resolver } from '@/remote/activitypub/resolver.js';
import { apLogger } from '../logger.js';
import Resolver from '../resolver.js';
import { IObject, isCreate, isDelete, isUpdate, isRead, isFollow, isAccept, isReject, isAdd, isRemove, isAnnounce, isLike, isUndo, isBlock, isCollectionOrOrderedCollection, isCollection, isFlag } from '../type.js';
import create from './create/index.js';
import performDeleteActivity from './delete/index.js';

View file

@ -1,7 +1,7 @@
import { CacheableRemoteUser } from '@/models/entities/user.js';
import { Resolver } from '@/remote/activitypub/resolver.js';
import { apLogger } from '../../logger.js';
import { IReject, isFollow, getApType } from '../../type.js';
import Resolver from '../../resolver.js';
import rejectFollow from './follow.js';
export default async (actor: CacheableRemoteUser, activity: IReject, resolver: Resolver): Promise<string> => {

View file

@ -1,8 +1,8 @@
import { CacheableRemoteUser } from '@/models/entities/user.js';
import { removePinned } from '@/services/i/pin.js';
import { Resolver } from '@/remote/activitypub/resolver.js';
import { IRemove } from '../../type.js';
import { resolveNote } from '../../models/note.js';
import Resolver from '@/remote/activitypub/resolver.js';
export default async (actor: CacheableRemoteUser, activity: IRemove, resolver: Resolver): Promise<void> => {
if ('actor' in activity && actor.uri !== activity.actor) {

View file

@ -1,6 +1,6 @@
import { CacheableRemoteUser } from '@/models/entities/user.js';
import { apLogger } from '@/remote/activitypub/logger.js';
import Resolver from '@/remote/activitypub/resolver.js';
import { Resolver } from '@/remote/activitypub/resolver.js';
import { IUndo, isFollow, isBlock, isLike, isAnnounce, getApType, isAccept } from '@/remote/activitypub/type.js';
import unfollow from './follow.js';
import unblock from './block.js';

View file

@ -2,7 +2,7 @@ import { CacheableRemoteUser } from '@/models/entities/user.js';
import { getApType, IUpdate, isActor } from '@/remote/activitypub/type.js';
import { apLogger } from '@/remote/activitypub/logger.js';
import { updateQuestion } from '@/remote/activitypub/models/question.js';
import Resolver from '@/remote/activitypub/resolver.js';
import { Resolver } from '@/remote/activitypub/resolver.js';
import { updatePerson } from '@/remote/activitypub/models/person.js';
/**

View file

@ -5,7 +5,7 @@ import { DriveFile } from '@/models/entities/drive-file.js';
import { DriveFiles } from '@/models/index.js';
import { truncate } from '@/misc/truncate.js';
import { DB_MAX_IMAGE_COMMENT_LENGTH } from '@/misc/hard-limits.js';
import Resolver from '../resolver.js';
import { Resolver } from '@/remote/activitypub/resolver.js';
import { apLogger } from '../logger.js';
/**

View file

@ -1,8 +1,8 @@
import promiseLimit from 'promise-limit';
import { toArray, unique } from '@/prelude/array.js';
import { CacheableUser } from '@/models/entities/user.js';
import { Resolver } from '@/remote/activitypub/resolver.js';
import { IObject, isMention, IApMention } from '../type.js';
import Resolver from '../resolver.js';
import { resolvePerson } from './person.js';
export async function extractApMentions(tags: IObject | IObject[] | null | undefined, resolver: Resolver) {

View file

@ -17,10 +17,10 @@ import { createMessage } from '@/services/messages/create.js';
import { StatusError } from '@/misc/fetch.js';
import { fromHtml } from '@/mfm/from-html.js';
import { shouldBlockInstance } from '@/misc/should-block-instance.js';
import { Resolver } from '@/remote/activitypub/resolver.js';
import { parseAudience } from '../audience.js';
import { IObject, getOneApId, getApId, getOneApHrefNullable, validPost, IPost, isEmoji, getApType } from '../type.js';
import { DbResolver } from '../db-resolver.js';
import Resolver from '../resolver.js';
import { apLogger } from '../logger.js';
import { resolvePerson } from './person.js';
import { resolveImage } from './image.js';

View file

@ -24,9 +24,9 @@ import { uriPersonCache } from '@/services/user-cache.js';
import { publishInternalEvent } from '@/services/stream.js';
import { db } from '@/db/postgre.js';
import { fromHtml } from '@/mfm/from-html.js';
import { Resolver } from '@/remote/activitypub/resolver.js';
import { apLogger } from '../logger.js';
import { isCollectionOrOrderedCollection, isCollection, IActor, getApId, getOneApHrefNullable, IObject, isPropertyValue, getApType, isActor } from '../type.js';
import Resolver from '../resolver.js';
import { extractApHashtags } from './tag.js';
import { resolveNote, extractEmojis } from './note.js';
import { resolveImage } from './image.js';

View file

@ -1,7 +1,7 @@
import config from '@/config/index.js';
import { Notes, Polls } from '@/models/index.js';
import { IPoll } from '@/models/entities/poll.js';
import Resolver from '../resolver.js';
import { Resolver } from '@/remote/activitypub/resolver.js';
import { IObject, IQuestion, isQuestion } from '../type.js';
import { apLogger } from '../logger.js';

View file

@ -1,9 +1,9 @@
import { DAY } from '@/const.js';
import { CacheableRemoteUser } from '@/models/entities/user.js';
import { Resolver } from '@/remote/activitypub/resolver.js';
import { IObject } from './type.js';
import { performActivity } from './kernel/index.js';
import { updatePerson } from './models/person.js';
import Resolver from './resolver.js';
export default async (actor: CacheableRemoteUser, activity: IObject, resolver: Resolver): Promise<void> => {
await performActivity(actor, activity, resolver);

View file

@ -21,7 +21,7 @@ import { parseUri } from './db-resolver.js';
*
* As opposed to the DbResolver which will try to resolve an ActivityPub URI into a database object.
*/
export default class Resolver {
export class Resolver {
private history: Set<string>;
private user?: ILocalUser;
private recursionLimit?: number;

View file

@ -9,7 +9,7 @@ import { Users } from '@/models/index.js';
import webFinger from './webfinger.js';
import { createPerson, updatePerson } from './activitypub/models/person.js';
import { remoteLogger } from './logger.js';
import Resolver from './activitypub/resolver.js';
import { Resolver } from '@/remote/activitypub/resolver.js';
const logger = remoteLogger.createSubLogger('resolve-user');

View file

@ -1,4 +1,4 @@
import Resolver from '@/remote/activitypub/resolver.js';
import { Resolver } from '@/remote/activitypub/resolver.js';
import { HOUR } from '@/const.js';
import define from '../../define.js';

View file

@ -1,7 +1,7 @@
import { createPerson } from '@/remote/activitypub/models/person.js';
import { createNote } from '@/remote/activitypub/models/note.js';
import { DbResolver } from '@/remote/activitypub/db-resolver.js';
import Resolver from '@/remote/activitypub/resolver.js';
import { Resolver } from '@/remote/activitypub/resolver.js';
import { extractDbHost } from '@/misc/convert-host.js';
import { Users, Notes } from '@/models/index.js';
import { Note } from '@/models/entities/note.js';

View file

@ -1,4 +1,4 @@
import Resolver from '@/remote/activitypub/resolver.js';
import { Resolver } from '@/remote/activitypub/resolver.js';
import { updatePerson } from '@/remote/activitypub/models/person.js';
import define from '../../define.js';
import { getRemoteUser } from '../../common/getters.js';