diff options
Diffstat (limited to 'shared/models/plugins')
-rw-r--r-- | shared/models/plugins/client-hook.model.ts | 21 | ||||
-rw-r--r-- | shared/models/plugins/index.ts | 2 | ||||
-rw-r--r-- | shared/models/plugins/plugin-element-placeholder.type.ts | 1 | ||||
-rw-r--r-- | shared/models/plugins/register-client-form-field.model.ts | 14 | ||||
-rw-r--r-- | shared/models/plugins/register-client-settings-script.model.ts | 8 | ||||
-rw-r--r-- | shared/models/plugins/register-server-setting.model.ts | 2 | ||||
-rw-r--r-- | shared/models/plugins/server-hook.model.ts | 20 |
7 files changed, 61 insertions, 7 deletions
diff --git a/shared/models/plugins/client-hook.model.ts b/shared/models/plugins/client-hook.model.ts index 7b7144676..f8ca32771 100644 --- a/shared/models/plugins/client-hook.model.ts +++ b/shared/models/plugins/client-hook.model.ts | |||
@@ -85,8 +85,27 @@ export const clientActionHookObject = { | |||
85 | // Fired when the registration page is being initialized | 85 | // Fired when the registration page is being initialized |
86 | 'action:signup.register.init': true, | 86 | 'action:signup.register.init': true, |
87 | 87 | ||
88 | // Fired when the video upload page is being initalized | ||
89 | 'action:video-upload.init': true, | ||
90 | // Fired when the video import by URL page is being initalized | ||
91 | 'action:video-url-import.init': true, | ||
92 | // Fired when the video import by torrent/magnet URI page is being initalized | ||
93 | 'action:video-torrent-import.init': true, | ||
94 | // Fired when the "Go Live" page is being initalized | ||
95 | 'action:go-live.init': true, | ||
96 | |||
97 | // Fired when the user explicitely logged in/logged out | ||
98 | 'action:auth-user.logged-in': true, | ||
99 | 'action:auth-user.logged-out': true, | ||
100 | // Fired when the application loaded user information (using tokens from the local storage or after a successful login) | ||
101 | 'action:auth-user.information-loaded': true, | ||
102 | |||
103 | // Fired when the modal to download a video/caption is shown | ||
104 | 'action:modal.video-download.shown': true, | ||
105 | |||
88 | // ####### Embed hooks ####### | 106 | // ####### Embed hooks ####### |
89 | // In embed scope, peertube helpers are not available | 107 | // /!\ In embed scope, peertube helpers are not available |
108 | // ########################### | ||
90 | 109 | ||
91 | // Fired when the embed loaded the player | 110 | // Fired when the embed loaded the player |
92 | 'action:embed.player.loaded': true | 111 | 'action:embed.player.loaded': true |
diff --git a/shared/models/plugins/index.ts b/shared/models/plugins/index.ts index 96621460a..03b27f907 100644 --- a/shared/models/plugins/index.ts +++ b/shared/models/plugins/index.ts | |||
@@ -7,6 +7,7 @@ export * from './peertube-plugin-index.model' | |||
7 | export * from './peertube-plugin-latest-version.model' | 7 | export * from './peertube-plugin-latest-version.model' |
8 | export * from './peertube-plugin.model' | 8 | export * from './peertube-plugin.model' |
9 | export * from './plugin-client-scope.type' | 9 | export * from './plugin-client-scope.type' |
10 | export * from './plugin-element-placeholder.type' | ||
10 | export * from './plugin-package-json.model' | 11 | export * from './plugin-package-json.model' |
11 | export * from './plugin-playlist-privacy-manager.model' | 12 | export * from './plugin-playlist-privacy-manager.model' |
12 | export * from './plugin-settings-manager.model' | 13 | export * from './plugin-settings-manager.model' |
@@ -20,6 +21,7 @@ export * from './plugin-video-privacy-manager.model' | |||
20 | export * from './plugin.type' | 21 | export * from './plugin.type' |
21 | export * from './public-server.setting' | 22 | export * from './public-server.setting' |
22 | export * from './register-client-hook.model' | 23 | export * from './register-client-hook.model' |
24 | export * from './register-client-settings-script.model' | ||
23 | export * from './register-client-form-field.model' | 25 | export * from './register-client-form-field.model' |
24 | export * from './register-server-hook.model' | 26 | export * from './register-server-hook.model' |
25 | export * from './register-server-setting.model' | 27 | export * from './register-server-setting.model' |
diff --git a/shared/models/plugins/plugin-element-placeholder.type.ts b/shared/models/plugins/plugin-element-placeholder.type.ts new file mode 100644 index 000000000..129099c62 --- /dev/null +++ b/shared/models/plugins/plugin-element-placeholder.type.ts | |||
@@ -0,0 +1 @@ | |||
export type PluginElementPlaceholder = 'player-next' | |||
diff --git a/shared/models/plugins/register-client-form-field.model.ts b/shared/models/plugins/register-client-form-field.model.ts index 641d7490c..cdcdaa181 100644 --- a/shared/models/plugins/register-client-form-field.model.ts +++ b/shared/models/plugins/register-client-form-field.model.ts | |||
@@ -1,7 +1,13 @@ | |||
1 | export interface RegisterClientFormFieldOptions { | 1 | export type RegisterClientFormFieldOptions = { |
2 | name: string | 2 | name?: string |
3 | label: string | 3 | label?: string |
4 | type: 'input' | 'input-checkbox' | 'input-password' | 'input-textarea' | 'markdown-text' | 'markdown-enhanced' | 4 | type: 'input' | 'input-checkbox' | 'input-password' | 'input-textarea' | 'markdown-text' | 'markdown-enhanced' | 'select' | 'html' |
5 | |||
6 | // For select type | ||
7 | options?: { value: string, label: string }[] | ||
8 | |||
9 | // For html type | ||
10 | html?: string | ||
5 | 11 | ||
6 | descriptionHTML?: string | 12 | descriptionHTML?: string |
7 | 13 | ||
diff --git a/shared/models/plugins/register-client-settings-script.model.ts b/shared/models/plugins/register-client-settings-script.model.ts new file mode 100644 index 000000000..ac16af366 --- /dev/null +++ b/shared/models/plugins/register-client-settings-script.model.ts | |||
@@ -0,0 +1,8 @@ | |||
1 | import { RegisterServerSettingOptions } from "./register-server-setting.model" | ||
2 | |||
3 | export interface RegisterClientSettingsScript { | ||
4 | isSettingHidden (options: { | ||
5 | setting: RegisterServerSettingOptions | ||
6 | formValues: { [name: string]: any } | ||
7 | }): boolean | ||
8 | } | ||
diff --git a/shared/models/plugins/register-server-setting.model.ts b/shared/models/plugins/register-server-setting.model.ts index 6872dc53e..9f45c3c37 100644 --- a/shared/models/plugins/register-server-setting.model.ts +++ b/shared/models/plugins/register-server-setting.model.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { RegisterClientFormFieldOptions } from './register-client-form-field.model' | 1 | import { RegisterClientFormFieldOptions } from './register-client-form-field.model' |
2 | 2 | ||
3 | export interface RegisterServerSettingOptions extends RegisterClientFormFieldOptions { | 3 | export type RegisterServerSettingOptions = RegisterClientFormFieldOptions & { |
4 | // If the setting is not private, anyone can view its value (client code included) | 4 | // If the setting is not private, anyone can view its value (client code included) |
5 | // If the setting is private, only server-side hooks can access it | 5 | // If the setting is private, only server-side hooks can access it |
6 | // Mainly used by the PeerTube client to get admin config | 6 | // Mainly used by the PeerTube client to get admin config |
diff --git a/shared/models/plugins/server-hook.model.ts b/shared/models/plugins/server-hook.model.ts index 082b4b591..88277af5a 100644 --- a/shared/models/plugins/server-hook.model.ts +++ b/shared/models/plugins/server-hook.model.ts | |||
@@ -18,6 +18,16 @@ export const serverFilterHookObject = { | |||
18 | 'filter:api.user.me.videos.list.params': true, | 18 | 'filter:api.user.me.videos.list.params': true, |
19 | 'filter:api.user.me.videos.list.result': true, | 19 | 'filter:api.user.me.videos.list.result': true, |
20 | 20 | ||
21 | // Filter params/results to search videos/channels in the DB or on the remote index | ||
22 | 'filter:api.search.videos.local.list.params': true, | ||
23 | 'filter:api.search.videos.local.list.result': true, | ||
24 | 'filter:api.search.videos.index.list.params': true, | ||
25 | 'filter:api.search.videos.index.list.result': true, | ||
26 | 'filter:api.search.video-channels.local.list.params': true, | ||
27 | 'filter:api.search.video-channels.local.list.result': true, | ||
28 | 'filter:api.search.video-channels.index.list.params': true, | ||
29 | 'filter:api.search.video-channels.index.list.result': true, | ||
30 | |||
21 | // Filter the result of the get function | 31 | // Filter the result of the get function |
22 | // Used to get detailed video information (video watch page for example) | 32 | // Used to get detailed video information (video watch page for example) |
23 | 'filter:api.video.get.result': true, | 33 | 'filter:api.video.get.result': true, |
@@ -50,7 +60,15 @@ export const serverFilterHookObject = { | |||
50 | 'filter:video.auto-blacklist.result': true, | 60 | 'filter:video.auto-blacklist.result': true, |
51 | 61 | ||
52 | // Filter result used to check if a user can register on the instance | 62 | // Filter result used to check if a user can register on the instance |
53 | 'filter:api.user.signup.allowed.result': true | 63 | 'filter:api.user.signup.allowed.result': true, |
64 | |||
65 | // Filter result used to check if video/torrent download is allowed | ||
66 | 'filter:api.download.video.allowed.result': true, | ||
67 | 'filter:api.download.torrent.allowed.result': true, | ||
68 | |||
69 | // Filter result to check if the embed is allowed for a particular request | ||
70 | 'filter:html.embed.video.allowed.result': true, | ||
71 | 'filter:html.embed.video-playlist.allowed.result': true | ||
54 | } | 72 | } |
55 | 73 | ||
56 | export type ServerFilterHookName = keyof typeof serverFilterHookObject | 74 | export type ServerFilterHookName = keyof typeof serverFilterHookObject |