aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/models/plugins/server-hook.model.ts
blob: 6729e2dabab4f581be6bb4b90366835e8ef634a9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
export type ServerFilterHookName =
  'filter:api.videos.list.params' |
  'filter:api.videos.list.result' |
  'filter:api.video.get.result' |

  'filter:api.video.upload.accept.result' |
  'filter:api.video-thread.create.accept.result' |
  'filter:api.video-comment-reply.create.accept.result' |

  'filter:api.video-threads.list.params' |
  'filter:api.video-threads.list.result' |

  'filter:api.video-thread-comments.list.params' |
  'filter:api.video-thread-comments.list.result' |

  'filter:video.auto-blacklist.result'

export type ServerActionHookName =
  'action:application.listening' |

  'action:api.video.updated' |
  'action:api.video.deleted' |
  'action:api.video.uploaded' |
  'action:api.video.viewed' |

  'action:api.video-thread.created' |
  'action:api.video-comment-reply.created' |
  'action:api.video-comment.deleted'

export type ServerHookName = ServerFilterHookName | ServerActionHookName

export interface ServerHook {
  runHook <T> (hookName: ServerHookName, result?: T, params?: any): Promise<T>
}