aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/custom-validators/plugins.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-07-15 15:41:56 +0200
committerChocobozzz <chocobozzz@cpy.re>2019-07-24 10:58:16 +0200
commit503c6f440abc8f5924c38c4bd63591cb6cefacec (patch)
treef369e338d3f6c4c0af574b234b8c53d368350fa5 /server/helpers/custom-validators/plugins.ts
parent30ff39e7f07898ebb716c938123825c678b4e5af (diff)
downloadPeerTube-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.ts7
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'
4import { CONSTRAINTS_FIELDS } from '../../initializers/constants' 4import { CONSTRAINTS_FIELDS } from '../../initializers/constants'
5import { PluginPackageJson } from '../../../shared/models/plugins/plugin-package-json.model' 5import { PluginPackageJson } from '../../../shared/models/plugins/plugin-package-json.model'
6import { isUrlValid } from './activitypub/misc' 6import { isUrlValid } from './activitypub/misc'
7import { isThemeRegistered } from '../../lib/plugins/theme-utils'
8 7
9const PLUGINS_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.PLUGINS 8const 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
69function isThemeValid (name: string) { 68function isThemeNameValid (name: string) {
70 return isPluginNameValid(name) && isThemeRegistered(name) 69 return isPluginNameValid(name)
71} 70}
72 71
73function isPackageJSONValid (packageJSON: PluginPackageJson, pluginType: PluginType) { 72function isPackageJSONValid (packageJSON: PluginPackageJson, pluginType: PluginType) {
@@ -91,7 +90,7 @@ function isLibraryCodeValid (library: any) {
91export { 90export {
92 isPluginTypeValid, 91 isPluginTypeValid,
93 isPackageJSONValid, 92 isPackageJSONValid,
94 isThemeValid, 93 isThemeNameValid,
95 isPluginHomepage, 94 isPluginHomepage,
96 isPluginVersionValid, 95 isPluginVersionValid,
97 isPluginNameValid, 96 isPluginNameValid,