diff options
Diffstat (limited to 'shared/models/plugins')
10 files changed, 49 insertions, 8 deletions
diff --git a/shared/models/plugins/client/index.ts b/shared/models/plugins/client/index.ts index c500185c9..f3e3fcbcf 100644 --- a/shared/models/plugins/client/index.ts +++ b/shared/models/plugins/client/index.ts | |||
@@ -4,4 +4,5 @@ export * from './plugin-element-placeholder.type' | |||
4 | export * from './plugin-selector-id.type' | 4 | export * from './plugin-selector-id.type' |
5 | export * from './register-client-form-field.model' | 5 | export * from './register-client-form-field.model' |
6 | export * from './register-client-hook.model' | 6 | export * from './register-client-hook.model' |
7 | export * from './register-client-route.model' | ||
7 | export * from './register-client-settings-script.model' | 8 | export * from './register-client-settings-script.model' |
diff --git a/shared/models/plugins/client/plugin-selector-id.type.ts b/shared/models/plugins/client/plugin-selector-id.type.ts index b74dffbef..8d23314b5 100644 --- a/shared/models/plugins/client/plugin-selector-id.type.ts +++ b/shared/models/plugins/client/plugin-selector-id.type.ts | |||
@@ -1 +1,10 @@ | |||
1 | export type PluginSelectorId = 'login-form' | 1 | export type PluginSelectorId = |
2 | 'login-form' | | ||
3 | 'menu-user-dropdown-language-item' | | ||
4 | 'about-instance-features' | | ||
5 | 'about-instance-statistics' | | ||
6 | 'about-instance-moderation' | | ||
7 | 'about-menu-instance' | | ||
8 | 'about-menu-peertube' | | ||
9 | 'about-menu-network' | | ||
10 | 'about-instance-other-information' | ||
diff --git a/shared/models/plugins/client/register-client-form-field.model.ts b/shared/models/plugins/client/register-client-form-field.model.ts index 2df071337..153c4a6ea 100644 --- a/shared/models/plugins/client/register-client-form-field.model.ts +++ b/shared/models/plugins/client/register-client-form-field.model.ts | |||
@@ -16,8 +16,15 @@ export type RegisterClientFormFieldOptions = { | |||
16 | 16 | ||
17 | // Not supported by plugin setting registration, use registerSettingsScript instead | 17 | // Not supported by plugin setting registration, use registerSettingsScript instead |
18 | hidden?: (options: any) => boolean | 18 | hidden?: (options: any) => boolean |
19 | |||
20 | // Return undefined | null if there is no error or return a string with the detailed error | ||
21 | // Not supported by plugin setting registration | ||
22 | error?: (options: any) => Promise<{ error: boolean, text?: string }> | ||
19 | } | 23 | } |
20 | 24 | ||
21 | export interface RegisterClientVideoFieldOptions { | 25 | export interface RegisterClientVideoFieldOptions { |
22 | type: 'update' | 'upload' | 'import-url' | 'import-torrent' | 'go-live' | 26 | type: 'update' | 'upload' | 'import-url' | 'import-torrent' | 'go-live' |
27 | |||
28 | // Default to 'plugin-settings' | ||
29 | tab?: 'main' | 'plugin-settings' | ||
23 | } | 30 | } |
diff --git a/shared/models/plugins/client/register-client-route.model.ts b/shared/models/plugins/client/register-client-route.model.ts new file mode 100644 index 000000000..271b67834 --- /dev/null +++ b/shared/models/plugins/client/register-client-route.model.ts | |||
@@ -0,0 +1,7 @@ | |||
1 | export interface RegisterClientRouteOptions { | ||
2 | route: string | ||
3 | |||
4 | onMount (options: { | ||
5 | rootEl: HTMLElement | ||
6 | }): void | ||
7 | } | ||
diff --git a/shared/models/plugins/client/register-client-settings-script.model.ts b/shared/models/plugins/client/register-client-settings-script.model.ts index 481ceef96..117ca4739 100644 --- a/shared/models/plugins/client/register-client-settings-script.model.ts +++ b/shared/models/plugins/client/register-client-settings-script.model.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { RegisterServerSettingOptions } from '../server' | 1 | import { RegisterServerSettingOptions } from '../server' |
2 | 2 | ||
3 | export interface RegisterClientSettingsScript { | 3 | export interface RegisterClientSettingsScriptOptions { |
4 | isSettingHidden (options: { | 4 | isSettingHidden (options: { |
5 | setting: RegisterServerSettingOptions | 5 | setting: RegisterServerSettingOptions |
6 | formValues: { [name: string]: any } | 6 | formValues: { [name: string]: any } |
diff --git a/shared/models/plugins/plugin-index/peertube-plugin-index.model.ts b/shared/models/plugins/plugin-index/peertube-plugin-index.model.ts index e91c8b4dc..36dfef943 100644 --- a/shared/models/plugins/plugin-index/peertube-plugin-index.model.ts +++ b/shared/models/plugins/plugin-index/peertube-plugin-index.model.ts | |||
@@ -9,6 +9,8 @@ export interface PeerTubePluginIndex { | |||
9 | 9 | ||
10 | latestVersion: string | 10 | latestVersion: string |
11 | 11 | ||
12 | official: boolean | ||
13 | |||
12 | name?: string | 14 | name?: string |
13 | installed?: boolean | 15 | installed?: boolean |
14 | } | 16 | } |
diff --git a/shared/models/plugins/plugin-package-json.model.ts b/shared/models/plugins/plugin-package-json.model.ts index b2f92af80..7ce968ff2 100644 --- a/shared/models/plugins/plugin-package-json.model.ts +++ b/shared/models/plugins/plugin-package-json.model.ts | |||
@@ -1,15 +1,15 @@ | |||
1 | import { PluginClientScope } from './client/plugin-client-scope.type' | 1 | import { PluginClientScope } from './client/plugin-client-scope.type' |
2 | 2 | ||
3 | export type PluginTranslationPaths = { | 3 | export type PluginTranslationPathsJSON = { |
4 | [ locale: string ]: string | 4 | [ locale: string ]: string |
5 | } | 5 | } |
6 | 6 | ||
7 | export type ClientScript = { | 7 | export type ClientScriptJSON = { |
8 | script: string | 8 | script: string |
9 | scopes: PluginClientScope[] | 9 | scopes: PluginClientScope[] |
10 | } | 10 | } |
11 | 11 | ||
12 | export type PluginPackageJson = { | 12 | export type PluginPackageJSON = { |
13 | name: string | 13 | name: string |
14 | version: string | 14 | version: string |
15 | description: string | 15 | description: string |
@@ -23,7 +23,7 @@ export type PluginPackageJson = { | |||
23 | staticDirs: { [ name: string ]: string } | 23 | staticDirs: { [ name: string ]: string } |
24 | css: string[] | 24 | css: string[] |
25 | 25 | ||
26 | clientScripts: ClientScript[] | 26 | clientScripts: ClientScriptJSON[] |
27 | 27 | ||
28 | translations: PluginTranslationPaths | 28 | translations: PluginTranslationPathsJSON |
29 | } | 29 | } |
diff --git a/shared/models/plugins/plugin.type.ts b/shared/models/plugins/plugin.type.ts index b6766821a..016219ceb 100644 --- a/shared/models/plugins/plugin.type.ts +++ b/shared/models/plugins/plugin.type.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | export enum PluginType { | 1 | export const enum PluginType { |
2 | PLUGIN = 1, | 2 | PLUGIN = 1, |
3 | THEME = 2 | 3 | THEME = 2 |
4 | } | 4 | } |
diff --git a/shared/models/plugins/server/api/install-plugin.model.ts b/shared/models/plugins/server/api/install-plugin.model.ts index 5a268ebe1..a1d009a00 100644 --- a/shared/models/plugins/server/api/install-plugin.model.ts +++ b/shared/models/plugins/server/api/install-plugin.model.ts | |||
@@ -1,4 +1,5 @@ | |||
1 | export interface InstallOrUpdatePlugin { | 1 | export interface InstallOrUpdatePlugin { |
2 | npmName?: string | 2 | npmName?: string |
3 | pluginVersion?: string | ||
3 | path?: string | 4 | path?: string |
4 | } | 5 | } |
diff --git a/shared/models/plugins/server/server-hook.model.ts b/shared/models/plugins/server/server-hook.model.ts index 3ab910197..bd2b27da5 100644 --- a/shared/models/plugins/server/server-hook.model.ts +++ b/shared/models/plugins/server/server-hook.model.ts | |||
@@ -53,6 +53,12 @@ export const serverFilterHookObject = { | |||
53 | 'filter:api.video-thread.create.accept.result': true, | 53 | 'filter:api.video-thread.create.accept.result': true, |
54 | 'filter:api.video-comment-reply.create.accept.result': true, | 54 | 'filter:api.video-comment-reply.create.accept.result': true, |
55 | 55 | ||
56 | // Filter attributes when creating video object | ||
57 | 'filter:api.video.upload.video-attribute.result': true, | ||
58 | 'filter:api.video.import-url.video-attribute.result': true, | ||
59 | 'filter:api.video.import-torrent.video-attribute.result': true, | ||
60 | 'filter:api.video.live.video-attribute.result': true, | ||
61 | |||
56 | // Filter params/result used to list threads of a specific video | 62 | // Filter params/result used to list threads of a specific video |
57 | // (used by the video watch page) | 63 | // (used by the video watch page) |
58 | 'filter:api.video-threads.list.params': true, | 64 | 'filter:api.video-threads.list.params': true, |
@@ -63,6 +69,9 @@ export const serverFilterHookObject = { | |||
63 | 'filter:api.video-thread-comments.list.params': true, | 69 | 'filter:api.video-thread-comments.list.params': true, |
64 | 'filter:api.video-thread-comments.list.result': true, | 70 | 'filter:api.video-thread-comments.list.result': true, |
65 | 71 | ||
72 | // Filter get stats result | ||
73 | 'filter:api.server.stats.get.result': true, | ||
74 | |||
66 | // Filter result used to check if we need to auto blacklist a video | 75 | // Filter result used to check if we need to auto blacklist a video |
67 | // (fired when a local or remote video is created or updated) | 76 | // (fired when a local or remote video is created or updated) |
68 | 'filter:video.auto-blacklist.result': true, | 77 | 'filter:video.auto-blacklist.result': true, |
@@ -106,6 +115,11 @@ export const serverActionHookObject = { | |||
106 | // Fired when a comment (thread or reply) is deleted | 115 | // Fired when a comment (thread or reply) is deleted |
107 | 'action:api.video-comment.deleted': true, | 116 | 'action:api.video-comment.deleted': true, |
108 | 117 | ||
118 | // Fired when a caption is created | ||
119 | 'action:api.video-caption.created': true, | ||
120 | // Fired when a caption is deleted | ||
121 | 'action:api.video-caption.deleted': true, | ||
122 | |||
109 | // Fired when a user is blocked (banned) | 123 | // Fired when a user is blocked (banned) |
110 | 'action:api.user.blocked': true, | 124 | 'action:api.user.blocked': true, |
111 | // Fired when a user is unblocked (unbanned) | 125 | // Fired when a user is unblocked (unbanned) |