import { values } from 'lodash'
import { extname } from 'path'
-import * as Sequelize from 'sequelize'
import {
AllowNull,
BelongsTo,
MActorWithInboxes
} from '../../typings/models'
import * as Bluebird from 'bluebird'
-import { Op } from 'sequelize'
+import { Op, Transaction } from 'sequelize'
enum ScopeNames {
FULL = 'FULL'
return ActorModel.scope(ScopeNames.FULL).findByPk(id)
}
- static loadFromAccountByVideoId (videoId: number, transaction: Sequelize.Transaction): Bluebird<MActor> {
+ static loadFromAccountByVideoId (videoId: number, transaction: Transaction): Bluebird<MActor> {
const query = {
include: [
{
.then(a => !!a)
}
- static listByFollowersUrls (followersUrls: string[], transaction?: Sequelize.Transaction): Bluebird<MActorFull[]> {
+ static listByFollowersUrls (followersUrls: string[], transaction?: Transaction): Bluebird<MActorFull[]> {
const query = {
where: {
followersUrl: {
- [ Sequelize.Op.in ]: followersUrls
+ [ Op.in ]: followersUrls
}
},
transaction
return ActorModel.scope(ScopeNames.FULL).findAll(query)
}
- static loadLocalByName (preferredUsername: string, transaction?: Sequelize.Transaction): Bluebird<MActorFull> {
+ static loadLocalByName (preferredUsername: string, transaction?: Transaction): Bluebird<MActorFull> {
const query = {
where: {
preferredUsername,
return ActorModel.scope(ScopeNames.FULL).findOne(query)
}
- static loadByUrl (url: string, transaction?: Sequelize.Transaction): Bluebird<MActorAccountChannelId> {
+ static loadByUrl (url: string, transaction?: Transaction): Bluebird<MActorAccountChannelId> {
const query = {
where: {
url
return ActorModel.unscoped().findOne(query)
}
- static loadByUrlAndPopulateAccountAndChannel (url: string, transaction?: Sequelize.Transaction): Bluebird<MActorFull> {
+ static loadByUrlAndPopulateAccountAndChannel (url: string, transaction?: Transaction): Bluebird<MActorFull> {
const query = {
where: {
url
return activityPubContextify(json)
}
- getFollowerSharedInboxUrls (t: Sequelize.Transaction) {
+ getFollowerSharedInboxUrls (t: Transaction) {
const query = {
attributes: [ 'sharedInboxUrl' ],
include: [