aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared
diff options
context:
space:
mode:
Diffstat (limited to 'shared')
-rw-r--r--shared/models/plugins/client-hook.model.ts11
-rw-r--r--shared/models/plugins/index.ts1
-rw-r--r--shared/models/plugins/plugin-client-scope.type.ts2
-rw-r--r--shared/models/plugins/register-client-form-field.model.ts14
-rw-r--r--shared/models/plugins/register-server-setting.model.ts9
-rw-r--r--shared/models/videos/video-update.model.ts2
-rw-r--r--shared/models/videos/video.model.ts2
7 files changed, 32 insertions, 9 deletions
diff --git a/shared/models/plugins/client-hook.model.ts b/shared/models/plugins/client-hook.model.ts
index b53b8de99..7b7144676 100644
--- a/shared/models/plugins/client-hook.model.ts
+++ b/shared/models/plugins/client-hook.model.ts
@@ -70,6 +70,9 @@ export const clientActionHookObject = {
70 // Fired when a user click on 'View x replies' and they're loaded 70 // Fired when a user click on 'View x replies' and they're loaded
71 'action:video-watch.video-thread-replies.loaded': true, 71 'action:video-watch.video-thread-replies.loaded': true,
72 72
73 // Fired when the video edit page (upload, URL/torrent import, update) is being initialized
74 'action:video-edit.init': true,
75
73 // Fired when the login page is being initialized 76 // Fired when the login page is being initialized
74 'action:login.init': true, 77 'action:login.init': true,
75 78
@@ -80,7 +83,13 @@ export const clientActionHookObject = {
80 'action:router.navigation-end': true, 83 'action:router.navigation-end': true,
81 84
82 // Fired when the registration page is being initialized 85 // Fired when the registration page is being initialized
83 'action:signup.register.init': true 86 'action:signup.register.init': true,
87
88 // ####### Embed hooks #######
89 // In embed scope, peertube helpers are not available
90
91 // Fired when the embed loaded the player
92 'action:embed.player.loaded': true
84} 93}
85 94
86export type ClientActionHookName = keyof typeof clientActionHookObject 95export type ClientActionHookName = keyof typeof clientActionHookObject
diff --git a/shared/models/plugins/index.ts b/shared/models/plugins/index.ts
index 209fca791..83ed6f583 100644
--- a/shared/models/plugins/index.ts
+++ b/shared/models/plugins/index.ts
@@ -19,6 +19,7 @@ export * from './plugin-video-privacy-manager.model'
19export * from './plugin.type' 19export * from './plugin.type'
20export * from './public-server.setting' 20export * from './public-server.setting'
21export * from './register-client-hook.model' 21export * from './register-client-hook.model'
22export * from './register-client-form-field.model'
22export * from './register-server-hook.model' 23export * from './register-server-hook.model'
23export * from './register-server-setting.model' 24export * from './register-server-setting.model'
24export * from './server-hook.model' 25export * from './server-hook.model'
diff --git a/shared/models/plugins/plugin-client-scope.type.ts b/shared/models/plugins/plugin-client-scope.type.ts
index d112434e8..e188ce100 100644
--- a/shared/models/plugins/plugin-client-scope.type.ts
+++ b/shared/models/plugins/plugin-client-scope.type.ts
@@ -1 +1 @@
export type PluginClientScope = 'common' | 'video-watch' | 'search' | 'signup' | 'login' export type PluginClientScope = 'common' | 'video-watch' | 'search' | 'signup' | 'login' | 'embed' | 'video-edit'
diff --git a/shared/models/plugins/register-client-form-field.model.ts b/shared/models/plugins/register-client-form-field.model.ts
new file mode 100644
index 000000000..ec333e8d6
--- /dev/null
+++ b/shared/models/plugins/register-client-form-field.model.ts
@@ -0,0 +1,14 @@
1export interface RegisterClientFormFieldOptions {
2 name: string
3 label: string
4 type: 'input' | 'input-checkbox' | 'input-textarea' | 'markdown-text' | 'markdown-enhanced'
5
6 descriptionHTML?: string
7
8 // Default setting value
9 default?: string | boolean
10}
11
12export interface RegisterClientVideoFieldOptions {
13 type: 'import-url' | 'import-torrent' | 'update' | 'upload'
14}
diff --git a/shared/models/plugins/register-server-setting.model.ts b/shared/models/plugins/register-server-setting.model.ts
index 920c3480f..6872dc53e 100644
--- a/shared/models/plugins/register-server-setting.model.ts
+++ b/shared/models/plugins/register-server-setting.model.ts
@@ -1,15 +1,10 @@
1export interface RegisterServerSettingOptions { 1import { RegisterClientFormFieldOptions } from './register-client-form-field.model'
2 name: string
3 label: string
4 type: 'input' | 'input-checkbox' | 'input-textarea' | 'markdown-text' | 'markdown-enhanced'
5 2
3export interface RegisterServerSettingOptions extends RegisterClientFormFieldOptions {
6 // 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)
7 // 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
8 // Mainly used by the PeerTube client to get admin config 6 // Mainly used by the PeerTube client to get admin config
9 private: boolean 7 private: boolean
10
11 // Default setting value
12 default?: string | boolean
13} 8}
14 9
15export interface RegisteredServerSettings { 10export interface RegisteredServerSettings {
diff --git a/shared/models/videos/video-update.model.ts b/shared/models/videos/video-update.model.ts
index 4ef904156..86653b959 100644
--- a/shared/models/videos/video-update.model.ts
+++ b/shared/models/videos/video-update.model.ts
@@ -19,4 +19,6 @@ export interface VideoUpdate {
19 previewfile?: Blob 19 previewfile?: Blob
20 scheduleUpdate?: VideoScheduleUpdate 20 scheduleUpdate?: VideoScheduleUpdate
21 originallyPublishedAt?: Date | string 21 originallyPublishedAt?: Date | string
22
23 pluginData?: any
22} 24}
diff --git a/shared/models/videos/video.model.ts b/shared/models/videos/video.model.ts
index 557e66e09..158ee8f05 100644
--- a/shared/models/videos/video.model.ts
+++ b/shared/models/videos/video.model.ts
@@ -53,6 +53,8 @@ export interface Video {
53 userHistory?: { 53 userHistory?: {
54 currentTime: number 54 currentTime: number
55 } 55 }
56
57 pluginData?: any
56} 58}
57 59
58export interface VideoDetails extends Video { 60export interface VideoDetails extends Video {