diff options
author | Chocobozzz <me@florianbigard.com> | 2019-12-06 15:59:12 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-12-06 15:59:12 +0100 |
commit | 6f3fe96f4003fd9ad198cdf0ee5a47b32e9e6568 (patch) | |
tree | a3f1f541abec41abee96df9960cbe2b2a6c3ba86 /shared | |
parent | 349be1eaa9a61b2e2acaa24db58acb95774c0d20 (diff) | |
download | PeerTube-6f3fe96f4003fd9ad198cdf0ee5a47b32e9e6568.tar.gz PeerTube-6f3fe96f4003fd9ad198cdf0ee5a47b32e9e6568.tar.zst PeerTube-6f3fe96f4003fd9ad198cdf0ee5a47b32e9e6568.zip |
Add action hooks to user routes
Diffstat (limited to 'shared')
-rw-r--r-- | shared/extra-utils/users/users.ts | 3 | ||||
-rw-r--r-- | shared/models/plugins/server-hook.model.ts | 18 |
2 files changed, 19 insertions, 2 deletions
diff --git a/shared/extra-utils/users/users.ts b/shared/extra-utils/users/users.ts index 9959fd074..2fe0e55c2 100644 --- a/shared/extra-utils/users/users.ts +++ b/shared/extra-utils/users/users.ts | |||
@@ -8,7 +8,8 @@ import { userLogin } from './login' | |||
8 | import { UserUpdateMe } from '../../models/users' | 8 | import { UserUpdateMe } from '../../models/users' |
9 | import { omit } from 'lodash' | 9 | import { omit } from 'lodash' |
10 | 10 | ||
11 | type CreateUserArgs = { url: string, | 11 | type CreateUserArgs = { |
12 | url: string, | ||
12 | accessToken: string, | 13 | accessToken: string, |
13 | username: string, | 14 | username: string, |
14 | password: string, | 15 | password: string, |
diff --git a/shared/models/plugins/server-hook.model.ts b/shared/models/plugins/server-hook.model.ts index 41ee28097..80ecd9e24 100644 --- a/shared/models/plugins/server-hook.model.ts +++ b/shared/models/plugins/server-hook.model.ts | |||
@@ -55,7 +55,23 @@ export const serverActionHookObject = { | |||
55 | // Fired when a reply to a thread is created | 55 | // Fired when a reply to a thread is created |
56 | 'action:api.video-comment-reply.created': true, | 56 | 'action:api.video-comment-reply.created': true, |
57 | // Fired when a comment (thread or reply) is deleted | 57 | // Fired when a comment (thread or reply) is deleted |
58 | 'action:api.video-comment.deleted': true | 58 | 'action:api.video-comment.deleted': true, |
59 | |||
60 | // Fired when a user is blocked (banned) | ||
61 | 'action:api.user.blocked': true, | ||
62 | // Fired when a user is unblocked (unbanned) | ||
63 | 'action:api.user.unblocked': true, | ||
64 | // Fired when a user registered on the instance | ||
65 | 'action:api.user.registered': true, | ||
66 | // Fired when an admin/moderator created a user | ||
67 | 'action:api.user.created': true, | ||
68 | // Fired when a user is removed by an admin/moderator | ||
69 | 'action:api.user.deleted': true, | ||
70 | // Fired when a user is updated by an admin/moderator | ||
71 | 'action:api.user.updated': true, | ||
72 | |||
73 | // Fired when a user got a new oauth2 token | ||
74 | 'action:api.user.oauth2-got-token': true | ||
59 | } | 75 | } |
60 | 76 | ||
61 | export type ServerActionHookName = keyof typeof serverActionHookObject | 77 | export type ServerActionHookName = keyof typeof serverActionHookObject |