]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/friends.ts
Update systemd service template
[github/Chocobozzz/PeerTube.git] / server / lib / friends.ts
index e097f925488c8c108f19b24c69a7a8da1fdb7014..522cb82b341bae0055ae17deca15aa6b31f594a1 100644 (file)
@@ -28,10 +28,18 @@ import {
   RequestVideoEventScheduler,
   RequestVideoEventSchedulerOptions
 } from './request'
-import { PodInstance, VideoInstance } from '../models'
+import {
+  PodInstance,
+  VideoInstance
+} from '../models'
+import {
+  RequestEndpoint,
+  RequestVideoEventType,
+  RequestVideoQaduType
+} from '../../shared'
 
-type QaduParam = { videoId: string, type: string }
-type EventParam = { videoId: string, type: string }
+type QaduParam = { videoId: string, type: RequestVideoQaduType }
+type EventParam = { videoId: string, type: RequestVideoEventType }
 
 const ENDPOINT_ACTIONS = REQUEST_ENDPOINT_ACTIONS[REQUEST_ENDPOINTS.VIDEOS]
 
@@ -95,7 +103,11 @@ function quickAndDirtyUpdateVideoToFriends (qaduParam: QaduParam, transaction?:
   return createVideoQaduRequest(options, callback)
 }
 
-function quickAndDirtyUpdatesVideoToFriends (qadusParams: QaduParam[], transaction: Sequelize.Transaction, finalCallback: (err: Error) => void) {
+function quickAndDirtyUpdatesVideoToFriends (
+  qadusParams: QaduParam[],
+  transaction: Sequelize.Transaction,
+  finalCallback: (err: Error) => void
+) {
   const tasks = []
 
   qadusParams.forEach(function (qaduParams) {
@@ -391,7 +403,7 @@ function makeRequestsToWinningPods (cert: string, podsList: PodInstance[], callb
 // Wrapper that populate "toIds" argument with all our friends if it is not specified
 type CreateRequestOptions = {
   type: string
-  endpoint: string
+  endpoint: RequestEndpoint
   data: Object
   toIds?: number[]
   transaction: Sequelize.Transaction