aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/models/plugins/server-hook.model.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-07-24 10:21:22 +0200
committerChocobozzz <chocobozzz@cpy.re>2019-07-24 10:58:16 +0200
commit5f189c9c85449951254646ddf6cd6c84bc4c06ff (patch)
tree15a1abee0594be92cc08c86edc544da132ba27d8 /shared/models/plugins/server-hook.model.ts
parent51326912d61b05a33dd9cf3ca9befa6e2715b346 (diff)
downloadPeerTube-5f189c9c85449951254646ddf6cd6c84bc4c06ff.tar.gz
PeerTube-5f189c9c85449951254646ddf6cd6c84bc4c06ff.tar.zst
PeerTube-5f189c9c85449951254646ddf6cd6c84bc4c06ff.zip
Add hooks documentation
Diffstat (limited to 'shared/models/plugins/server-hook.model.ts')
-rw-r--r--shared/models/plugins/server-hook.model.ts22
1 files changed, 22 insertions, 0 deletions
diff --git a/shared/models/plugins/server-hook.model.ts b/shared/models/plugins/server-hook.model.ts
index fc4c51160..32c7f4688 100644
--- a/shared/models/plugins/server-hook.model.ts
+++ b/shared/models/plugins/server-hook.model.ts
@@ -1,35 +1,57 @@
1// {hookType}:{api?}.{location}.{subLocation?}.{actionType}.{target} 1// {hookType}:{api?}.{location}.{subLocation?}.{actionType}.{target}
2 2
3export const serverFilterHookObject = { 3export const serverFilterHookObject = {
4 // Filter params/result used to list videos for the REST API
5 // (used by the trending page, recently-added page, local page etc)
4 'filter:api.videos.list.params': true, 6 'filter:api.videos.list.params': true,
5 'filter:api.videos.list.result': true, 7 'filter:api.videos.list.result': true,
8 // Filter the result of the get function
9 // Used to get detailed video information (video watch page for example)
6 'filter:api.video.get.result': true, 10 'filter:api.video.get.result': true,
7 11
12 // Filter the result of the accept upload function
13 // If this function returns false then the upload is aborted with an error
8 'filter:api.video.upload.accept.result': true, 14 'filter:api.video.upload.accept.result': true,
15 // Filter the result of the accept comment (thread or reply) functions
16 // If the functions return false then the user cannot post its comment
9 'filter:api.video-thread.create.accept.result': true, 17 'filter:api.video-thread.create.accept.result': true,
10 'filter:api.video-comment-reply.create.accept.result': true, 18 'filter:api.video-comment-reply.create.accept.result': true,
11 19
20 // Filter params/result used to list threads of a specific video
21 // (used by the video watch page)
12 'filter:api.video-threads.list.params': true, 22 'filter:api.video-threads.list.params': true,
13 'filter:api.video-threads.list.result': true, 23 'filter:api.video-threads.list.result': true,
14 24
25 // Filter params/result used to list replies of a specific thread
26 // (used by the video watch page when we click on the "View replies" button)
15 'filter:api.video-thread-comments.list.params': true, 27 'filter:api.video-thread-comments.list.params': true,
16 'filter:api.video-thread-comments.list.result': true, 28 'filter:api.video-thread-comments.list.result': true,
17 29
30 // Filter result used to check if we need to auto blacklist a video
31 // (fired when a local or remote video is created or updated)
18 'filter:video.auto-blacklist.result': true 32 'filter:video.auto-blacklist.result': true
19} 33}
20 34
21export type ServerFilterHookName = keyof typeof serverFilterHookObject 35export type ServerFilterHookName = keyof typeof serverFilterHookObject
22 36
23export const serverActionHookObject = { 37export const serverActionHookObject = {
38 // Fired when the application has been loaded and is listening HTTP requests
24 'action:application.listening': true, 39 'action:application.listening': true,
25 40
41 // Fired when a local video is updated
26 'action:api.video.updated': true, 42 'action:api.video.updated': true,
43 // Fired when a local video is deleted
27 'action:api.video.deleted': true, 44 'action:api.video.deleted': true,
45 // Fired when a local video is uploaded
28 'action:api.video.uploaded': true, 46 'action:api.video.uploaded': true,
47 // Fired when a local video is viewed
29 'action:api.video.viewed': true, 48 'action:api.video.viewed': true,
30 49
50 // Fired when a thread is created
31 'action:api.video-thread.created': true, 51 'action:api.video-thread.created': true,
52 // Fired when a reply to a thread is created
32 'action:api.video-comment-reply.created': true, 53 'action:api.video-comment-reply.created': true,
54 // Fired when a comment (thread or reply) is deleted
33 'action:api.video-comment.deleted': true 55 'action:api.video-comment.deleted': true
34} 56}
35 57