mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-02-25 18:55:32 -06:00
Add server hooks
This commit is contained in:
5
shared/models/plugins/hook-type.enum.ts
Normal file
5
shared/models/plugins/hook-type.enum.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export enum HookType {
|
||||
STATIC = 1,
|
||||
ACTION = 2,
|
||||
FILTER = 3
|
||||
}
|
||||
34
shared/models/plugins/server-hook.model.ts
Normal file
34
shared/models/plugins/server-hook.model.ts
Normal file
@@ -0,0 +1,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-thread-comments.list.params' |
|
||||
'filter:api.video-thread-comments.list.result' |
|
||||
|
||||
'filter:api.video-threads.list.params' |
|
||||
'filter:api.video-threads.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 (hookName: ServerHookName, params?: any)
|
||||
}
|
||||
Reference in New Issue
Block a user