diff options
Diffstat (limited to 'shared/models/plugins/server-hook.model.ts')
-rw-r--r-- | shared/models/plugins/server-hook.model.ts | 51 |
1 files changed, 29 insertions, 22 deletions
diff --git a/shared/models/plugins/server-hook.model.ts b/shared/models/plugins/server-hook.model.ts index 6729e2dab..f53e0ce59 100644 --- a/shared/models/plugins/server-hook.model.ts +++ b/shared/models/plugins/server-hook.model.ts | |||
@@ -1,33 +1,40 @@ | |||
1 | export type ServerFilterHookName = | 1 | export const serverFilterHookObject = { |
2 | 'filter:api.videos.list.params' | | 2 | 'filter:api.videos.list.params': true, |
3 | 'filter:api.videos.list.result' | | 3 | 'filter:api.videos.list.result': true, |
4 | 'filter:api.video.get.result' | | 4 | 'filter:api.video.get.result': true, |
5 | 5 | ||
6 | 'filter:api.video.upload.accept.result' | | 6 | 'filter:api.video.upload.accept.result': true, |
7 | 'filter:api.video-thread.create.accept.result' | | 7 | 'filter:api.video-thread.create.accept.result': true, |
8 | 'filter:api.video-comment-reply.create.accept.result' | | 8 | 'filter:api.video-comment-reply.create.accept.result': true, |
9 | 9 | ||
10 | 'filter:api.video-threads.list.params' | | 10 | 'filter:api.video-threads.list.params': true, |
11 | 'filter:api.video-threads.list.result' | | 11 | 'filter:api.video-threads.list.result': true, |
12 | 12 | ||
13 | 'filter:api.video-thread-comments.list.params' | | 13 | 'filter:api.video-thread-comments.list.params': true, |
14 | 'filter:api.video-thread-comments.list.result' | | 14 | 'filter:api.video-thread-comments.list.result': true, |
15 | 15 | ||
16 | 'filter:video.auto-blacklist.result' | 16 | 'filter:video.auto-blacklist.result': true |
17 | } | ||
18 | |||
19 | export type ServerFilterHookName = keyof typeof serverFilterHookObject | ||
17 | 20 | ||
18 | export type ServerActionHookName = | 21 | export const serverActionHookObject = { |
19 | 'action:application.listening' | | 22 | 'action:application.listening': true, |
20 | 23 | ||
21 | 'action:api.video.updated' | | 24 | 'action:api.video.updated': true, |
22 | 'action:api.video.deleted' | | 25 | 'action:api.video.deleted': true, |
23 | 'action:api.video.uploaded' | | 26 | 'action:api.video.uploaded': true, |
24 | 'action:api.video.viewed' | | 27 | 'action:api.video.viewed': true, |
28 | |||
29 | 'action:api.video-thread.created': true, | ||
30 | 'action:api.video-comment-reply.created': true, | ||
31 | 'action:api.video-comment.deleted': true | ||
32 | } | ||
25 | 33 | ||
26 | 'action:api.video-thread.created' | | 34 | export type ServerActionHookName = keyof typeof serverActionHookObject |
27 | 'action:api.video-comment-reply.created' | | ||
28 | 'action:api.video-comment.deleted' | ||
29 | 35 | ||
30 | export type ServerHookName = ServerFilterHookName | ServerActionHookName | 36 | export const serverHookObject = Object.assign({}, serverFilterHookObject, serverActionHookObject) |
37 | export type ServerHookName = keyof typeof serverHookObject | ||
31 | 38 | ||
32 | export interface ServerHook { | 39 | export interface ServerHook { |
33 | runHook <T> (hookName: ServerHookName, result?: T, params?: any): Promise<T> | 40 | runHook <T> (hookName: ServerHookName, result?: T, params?: any): Promise<T> |