Put activity pub sends inside transactions
[oweals/peertube.git] / server / models / video / video-share-interface.ts
1 import * as Bluebird from 'bluebird'
2 import * as Sequelize from 'sequelize'
3 import { Transaction } from 'sequelize'
4 import { AccountInstance } from '../account/account-interface'
5 import { VideoInstance } from './video-interface'
6
7 export namespace VideoShareMethods {
8   export type LoadAccountsByShare = (videoId: number, t: Transaction) => Bluebird<AccountInstance[]>
9   export type Load = (accountId: number, videoId: number, t: Transaction) => Bluebird<VideoShareInstance>
10 }
11
12 export interface VideoShareClass {
13   loadAccountsByShare: VideoShareMethods.LoadAccountsByShare
14   load: VideoShareMethods.Load
15 }
16
17 export interface VideoShareAttributes {
18   accountId: number
19   videoId: number
20 }
21
22 export interface VideoShareInstance extends VideoShareClass, VideoShareAttributes, Sequelize.Instance<VideoShareAttributes> {
23   id: number
24   createdAt: Date
25   updatedAt: Date
26
27   Account?: AccountInstance
28   Video?: VideoInstance
29 }
30
31 export interface VideoShareModel extends VideoShareClass, Sequelize.Model<VideoShareInstance, VideoShareAttributes> {}