diff options
author | Chocobozzz <me@florianbigard.com> | 2019-07-15 15:41:56 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2019-07-24 10:58:16 +0200 |
commit | 503c6f440abc8f5924c38c4bd63591cb6cefacec (patch) | |
tree | f369e338d3f6c4c0af574b234b8c53d368350fa5 /server/helpers/custom-validators/plugins.ts | |
parent | 30ff39e7f07898ebb716c938123825c678b4e5af (diff) | |
download | PeerTube-503c6f440abc8f5924c38c4bd63591cb6cefacec.tar.gz PeerTube-503c6f440abc8f5924c38c4bd63591cb6cefacec.tar.zst PeerTube-503c6f440abc8f5924c38c4bd63591cb6cefacec.zip |
Add peertube plugin index website models
Diffstat (limited to 'server/helpers/custom-validators/plugins.ts')
-rw-r--r-- | server/helpers/custom-validators/plugins.ts | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/server/helpers/custom-validators/plugins.ts b/server/helpers/custom-validators/plugins.ts index 064af9ead..e0a6f98a7 100644 --- a/server/helpers/custom-validators/plugins.ts +++ b/server/helpers/custom-validators/plugins.ts | |||
@@ -4,7 +4,6 @@ import { PluginType } from '../../../shared/models/plugins/plugin.type' | |||
4 | import { CONSTRAINTS_FIELDS } from '../../initializers/constants' | 4 | import { CONSTRAINTS_FIELDS } from '../../initializers/constants' |
5 | import { PluginPackageJson } from '../../../shared/models/plugins/plugin-package-json.model' | 5 | import { PluginPackageJson } from '../../../shared/models/plugins/plugin-package-json.model' |
6 | import { isUrlValid } from './activitypub/misc' | 6 | import { isUrlValid } from './activitypub/misc' |
7 | import { isThemeRegistered } from '../../lib/plugins/theme-utils' | ||
8 | 7 | ||
9 | const PLUGINS_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.PLUGINS | 8 | const PLUGINS_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.PLUGINS |
10 | 9 | ||
@@ -66,8 +65,8 @@ function isCSSPathsValid (css: any[]) { | |||
66 | return isArray(css) && css.every(c => isSafePath(c)) | 65 | return isArray(css) && css.every(c => isSafePath(c)) |
67 | } | 66 | } |
68 | 67 | ||
69 | function isThemeValid (name: string) { | 68 | function isThemeNameValid (name: string) { |
70 | return isPluginNameValid(name) && isThemeRegistered(name) | 69 | return isPluginNameValid(name) |
71 | } | 70 | } |
72 | 71 | ||
73 | function isPackageJSONValid (packageJSON: PluginPackageJson, pluginType: PluginType) { | 72 | function isPackageJSONValid (packageJSON: PluginPackageJson, pluginType: PluginType) { |
@@ -91,7 +90,7 @@ function isLibraryCodeValid (library: any) { | |||
91 | export { | 90 | export { |
92 | isPluginTypeValid, | 91 | isPluginTypeValid, |
93 | isPackageJSONValid, | 92 | isPackageJSONValid, |
94 | isThemeValid, | 93 | isThemeNameValid, |
95 | isPluginHomepage, | 94 | isPluginHomepage, |
96 | isPluginVersionValid, | 95 | isPluginVersionValid, |
97 | isPluginNameValid, | 96 | isPluginNameValid, |