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