2 import { ActorModel } from '../models/activitypub/actor'
3 import { MActorAccountChannelId, MActorFull } from '../types/models'
5 type ActorFetchByUrlType = 'all' | 'association-ids'
7 function fetchActorByUrl (url: string, fetchType: ActorFetchByUrlType): Promise<MActorFull | MActorAccountChannelId> {
8 if (fetchType === 'all') return ActorModel.loadByUrlAndPopulateAccountAndChannel(url)
10 if (fetchType === 'association-ids') return ActorModel.loadByUrl(url)