diff options
Diffstat (limited to 'shared')
66 files changed, 221 insertions, 69 deletions
diff --git a/shared/core-utils/miscs/miscs.ts b/shared/core-utils/miscs/miscs.ts index 71703faac..4780ca922 100644 --- a/shared/core-utils/miscs/miscs.ts +++ b/shared/core-utils/miscs/miscs.ts | |||
@@ -28,9 +28,24 @@ function isCatchable (value: any) { | |||
28 | return value && typeof value.catch === 'function' | 28 | return value && typeof value.catch === 'function' |
29 | } | 29 | } |
30 | 30 | ||
31 | function sortObjectComparator (key: string, order: 'asc' | 'desc') { | ||
32 | return (a: any, b: any) => { | ||
33 | if (a[key] < b[key]) { | ||
34 | return order === 'asc' ? -1 : 1 | ||
35 | } | ||
36 | |||
37 | if (a[key] > b[key]) { | ||
38 | return order === 'asc' ? 1 : -1 | ||
39 | } | ||
40 | |||
41 | return 0 | ||
42 | } | ||
43 | } | ||
44 | |||
31 | export { | 45 | export { |
32 | randomInt, | 46 | randomInt, |
33 | compareSemVer, | 47 | compareSemVer, |
34 | isPromise, | 48 | isPromise, |
35 | isCatchable | 49 | isCatchable, |
50 | sortObjectComparator | ||
36 | } | 51 | } |
diff --git a/shared/core-utils/miscs/types.ts b/shared/core-utils/miscs/types.ts index bb64dc830..bd2a97b98 100644 --- a/shared/core-utils/miscs/types.ts +++ b/shared/core-utils/miscs/types.ts | |||
@@ -6,6 +6,10 @@ export type FunctionPropertyNames<T> = { | |||
6 | 6 | ||
7 | export type FunctionProperties<T> = Pick<T, FunctionPropertyNames<T>> | 7 | export type FunctionProperties<T> = Pick<T, FunctionPropertyNames<T>> |
8 | 8 | ||
9 | export type AttributesOnly<T> = { | ||
10 | [K in keyof T]: T[K] extends Function ? never : T[K] | ||
11 | } | ||
12 | |||
9 | export type PickWith<T, KT extends keyof T, V> = { | 13 | export type PickWith<T, KT extends keyof T, V> = { |
10 | [P in KT]: T[P] extends V ? V : never | 14 | [P in KT]: T[P] extends V ? V : never |
11 | } | 15 | } |
diff --git a/shared/core-utils/renderer/html.ts b/shared/core-utils/renderer/html.ts index de4ad47ac..bbf8b3fbd 100644 --- a/shared/core-utils/renderer/html.ts +++ b/shared/core-utils/renderer/html.ts | |||
@@ -1,25 +1,45 @@ | |||
1 | export const SANITIZE_OPTIONS = { | 1 | export function getSanitizeOptions () { |
2 | allowedTags: [ 'a', 'p', 'span', 'br', 'strong', 'em', 'ul', 'ol', 'li' ], | 2 | return { |
3 | allowedSchemes: [ 'http', 'https' ], | 3 | allowedTags: [ 'a', 'p', 'span', 'br', 'strong', 'em', 'ul', 'ol', 'li' ], |
4 | allowedAttributes: { | 4 | allowedSchemes: [ 'http', 'https' ], |
5 | a: [ 'href', 'class', 'target', 'rel' ] | 5 | allowedAttributes: { |
6 | }, | 6 | 'a': [ 'href', 'class', 'target', 'rel' ], |
7 | transformTags: { | 7 | '*': [ 'data-*' ] |
8 | a: (tagName: string, attribs: any) => { | 8 | }, |
9 | let rel = 'noopener noreferrer' | 9 | transformTags: { |
10 | if (attribs.rel === 'me') rel += ' me' | 10 | a: (tagName: string, attribs: any) => { |
11 | let rel = 'noopener noreferrer' | ||
12 | if (attribs.rel === 'me') rel += ' me' | ||
11 | 13 | ||
12 | return { | 14 | return { |
13 | tagName, | 15 | tagName, |
14 | attribs: Object.assign(attribs, { | 16 | attribs: Object.assign(attribs, { |
15 | target: '_blank', | 17 | target: '_blank', |
16 | rel | 18 | rel |
17 | }) | 19 | }) |
20 | } | ||
18 | } | 21 | } |
19 | } | 22 | } |
20 | } | 23 | } |
21 | } | 24 | } |
22 | 25 | ||
26 | export function getCustomMarkupSanitizeOptions (additionalAllowedTags: string[] = []) { | ||
27 | const base = getSanitizeOptions() | ||
28 | |||
29 | return { | ||
30 | allowedTags: [ | ||
31 | ...base.allowedTags, | ||
32 | ...additionalAllowedTags, | ||
33 | 'div', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' | ||
34 | ], | ||
35 | allowedSchemes: base.allowedSchemes, | ||
36 | allowedAttributes: { | ||
37 | ...base.allowedAttributes, | ||
38 | '*': [ 'data-*', 'style' ] | ||
39 | } | ||
40 | } | ||
41 | } | ||
42 | |||
23 | // Thanks: https://stackoverflow.com/a/12034334 | 43 | // Thanks: https://stackoverflow.com/a/12034334 |
24 | export function escapeHTML (stringParam: string) { | 44 | export function escapeHTML (stringParam: string) { |
25 | if (!stringParam) return '' | 45 | if (!stringParam) return '' |
diff --git a/shared/extra-utils/custom-pages/custom-pages.ts b/shared/extra-utils/custom-pages/custom-pages.ts new file mode 100644 index 000000000..bf2d16c70 --- /dev/null +++ b/shared/extra-utils/custom-pages/custom-pages.ts | |||
@@ -0,0 +1,31 @@ | |||
1 | import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' | ||
2 | import { makeGetRequest, makePutBodyRequest } from '../requests/requests' | ||
3 | |||
4 | function getInstanceHomepage (url: string, statusCodeExpected = HttpStatusCode.OK_200) { | ||
5 | const path = '/api/v1/custom-pages/homepage/instance' | ||
6 | |||
7 | return makeGetRequest({ | ||
8 | url, | ||
9 | path, | ||
10 | statusCodeExpected | ||
11 | }) | ||
12 | } | ||
13 | |||
14 | function updateInstanceHomepage (url: string, token: string, content: string) { | ||
15 | const path = '/api/v1/custom-pages/homepage/instance' | ||
16 | |||
17 | return makePutBodyRequest({ | ||
18 | url, | ||
19 | path, | ||
20 | token, | ||
21 | fields: { content }, | ||
22 | statusCodeExpected: HttpStatusCode.NO_CONTENT_204 | ||
23 | }) | ||
24 | } | ||
25 | |||
26 | // --------------------------------------------------------------------------- | ||
27 | |||
28 | export { | ||
29 | getInstanceHomepage, | ||
30 | updateInstanceHomepage | ||
31 | } | ||
diff --git a/shared/extra-utils/index.ts b/shared/extra-utils/index.ts index 898a92d43..3bc09ead5 100644 --- a/shared/extra-utils/index.ts +++ b/shared/extra-utils/index.ts | |||
@@ -1,15 +1,26 @@ | |||
1 | export * from './bulk/bulk' | 1 | export * from './bulk/bulk' |
2 | |||
2 | export * from './cli/cli' | 3 | export * from './cli/cli' |
4 | |||
5 | export * from './custom-pages/custom-pages' | ||
6 | |||
3 | export * from './feeds/feeds' | 7 | export * from './feeds/feeds' |
8 | |||
4 | export * from './mock-servers/mock-instances-index' | 9 | export * from './mock-servers/mock-instances-index' |
5 | export * from './miscs/miscs' | 10 | |
11 | export * from './miscs/email' | ||
6 | export * from './miscs/sql' | 12 | export * from './miscs/sql' |
13 | export * from './miscs/miscs' | ||
7 | export * from './miscs/stubs' | 14 | export * from './miscs/stubs' |
15 | |||
8 | export * from './moderation/abuses' | 16 | export * from './moderation/abuses' |
9 | export * from './plugins/mock-blocklist' | 17 | export * from './plugins/mock-blocklist' |
18 | |||
10 | export * from './requests/check-api-params' | 19 | export * from './requests/check-api-params' |
11 | export * from './requests/requests' | 20 | export * from './requests/requests' |
21 | |||
12 | export * from './search/videos' | 22 | export * from './search/videos' |
23 | |||
13 | export * from './server/activitypub' | 24 | export * from './server/activitypub' |
14 | export * from './server/clients' | 25 | export * from './server/clients' |
15 | export * from './server/config' | 26 | export * from './server/config' |
@@ -18,9 +29,14 @@ export * from './server/follows' | |||
18 | export * from './server/jobs' | 29 | export * from './server/jobs' |
19 | export * from './server/plugins' | 30 | export * from './server/plugins' |
20 | export * from './server/servers' | 31 | export * from './server/servers' |
32 | |||
21 | export * from './users/accounts' | 33 | export * from './users/accounts' |
34 | export * from './users/blocklist' | ||
22 | export * from './users/login' | 35 | export * from './users/login' |
36 | export * from './users/user-notifications' | ||
37 | export * from './users/user-subscriptions' | ||
23 | export * from './users/users' | 38 | export * from './users/users' |
39 | |||
24 | export * from './videos/live' | 40 | export * from './videos/live' |
25 | export * from './videos/services' | 41 | export * from './videos/services' |
26 | export * from './videos/video-blacklist' | 42 | export * from './videos/video-blacklist' |
diff --git a/shared/extra-utils/requests/requests.ts b/shared/extra-utils/requests/requests.ts index 8b5cddf4a..38e24d897 100644 --- a/shared/extra-utils/requests/requests.ts +++ b/shared/extra-utils/requests/requests.ts | |||
@@ -26,6 +26,7 @@ function makeGetRequest (options: { | |||
26 | contentType?: string | 26 | contentType?: string |
27 | range?: string | 27 | range?: string |
28 | redirects?: number | 28 | redirects?: number |
29 | accept?: string | ||
29 | }) { | 30 | }) { |
30 | if (!options.statusCodeExpected) options.statusCodeExpected = HttpStatusCode.BAD_REQUEST_400 | 31 | if (!options.statusCodeExpected) options.statusCodeExpected = HttpStatusCode.BAD_REQUEST_400 |
31 | if (options.contentType === undefined) options.contentType = 'application/json' | 32 | if (options.contentType === undefined) options.contentType = 'application/json' |
@@ -36,6 +37,7 @@ function makeGetRequest (options: { | |||
36 | if (options.token) req.set('Authorization', 'Bearer ' + options.token) | 37 | if (options.token) req.set('Authorization', 'Bearer ' + options.token) |
37 | if (options.query) req.query(options.query) | 38 | if (options.query) req.query(options.query) |
38 | if (options.range) req.set('Range', options.range) | 39 | if (options.range) req.set('Range', options.range) |
40 | if (options.accept) req.set('Accept', options.accept) | ||
39 | if (options.redirects) req.redirects(options.redirects) | 41 | if (options.redirects) req.redirects(options.redirects) |
40 | 42 | ||
41 | return req.expect(options.statusCodeExpected) | 43 | return req.expect(options.statusCodeExpected) |
diff --git a/shared/extra-utils/server/config.ts b/shared/extra-utils/server/config.ts index b70110852..9fcfb31fd 100644 --- a/shared/extra-utils/server/config.ts +++ b/shared/extra-utils/server/config.ts | |||
@@ -98,7 +98,8 @@ function updateCustomSubConfig (url: string, token: string, newConfig: DeepParti | |||
98 | signup: { | 98 | signup: { |
99 | enabled: false, | 99 | enabled: false, |
100 | limit: 5, | 100 | limit: 5, |
101 | requiresEmailVerification: false | 101 | requiresEmailVerification: false, |
102 | minimumAge: 16 | ||
102 | }, | 103 | }, |
103 | admin: { | 104 | admin: { |
104 | email: 'superadmin1@example.com' | 105 | email: 'superadmin1@example.com' |
diff --git a/shared/extra-utils/server/plugins.ts b/shared/extra-utils/server/plugins.ts index 864954ee7..d53e5b382 100644 --- a/shared/extra-utils/server/plugins.ts +++ b/shared/extra-utils/server/plugins.ts | |||
@@ -4,12 +4,12 @@ import { expect } from 'chai' | |||
4 | import { readJSON, writeJSON } from 'fs-extra' | 4 | import { readJSON, writeJSON } from 'fs-extra' |
5 | import { join } from 'path' | 5 | import { join } from 'path' |
6 | import { RegisteredServerSettings } from '@shared/models' | 6 | import { RegisteredServerSettings } from '@shared/models' |
7 | import { PeertubePluginIndexList } from '../../models/plugins/peertube-plugin-index-list.model' | 7 | import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' |
8 | import { PeertubePluginIndexList } from '../../models/plugins/plugin-index/peertube-plugin-index-list.model' | ||
8 | import { PluginType } from '../../models/plugins/plugin.type' | 9 | import { PluginType } from '../../models/plugins/plugin.type' |
9 | import { buildServerDirectory, root } from '../miscs/miscs' | 10 | import { buildServerDirectory, root } from '../miscs/miscs' |
10 | import { makeGetRequest, makePostBodyRequest, makePutBodyRequest } from '../requests/requests' | 11 | import { makeGetRequest, makePostBodyRequest, makePutBodyRequest } from '../requests/requests' |
11 | import { ServerInfo } from './servers' | 12 | import { ServerInfo } from './servers' |
12 | import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' | ||
13 | 13 | ||
14 | function listPlugins (parameters: { | 14 | function listPlugins (parameters: { |
15 | url: string | 15 | url: string |
diff --git a/shared/extra-utils/server/servers.ts b/shared/extra-utils/server/servers.ts index 479f08e12..d04757470 100644 --- a/shared/extra-utils/server/servers.ts +++ b/shared/extra-utils/server/servers.ts | |||
@@ -45,9 +45,12 @@ interface ServerInfo { | |||
45 | uuid: string | 45 | uuid: string |
46 | name?: string | 46 | name?: string |
47 | url?: string | 47 | url?: string |
48 | |||
48 | account?: { | 49 | account?: { |
49 | name: string | 50 | name: string |
50 | } | 51 | } |
52 | |||
53 | embedPath?: string | ||
51 | } | 54 | } |
52 | 55 | ||
53 | remoteVideo?: { | 56 | remoteVideo?: { |
diff --git a/shared/extra-utils/users/user-notifications.ts b/shared/extra-utils/users/user-notifications.ts index 249e82925..844f4442d 100644 --- a/shared/extra-utils/users/user-notifications.ts +++ b/shared/extra-utils/users/user-notifications.ts | |||
@@ -431,7 +431,7 @@ async function checkNewCommentOnMyVideo (base: CheckerBaseParams, uuid: string, | |||
431 | } | 431 | } |
432 | } | 432 | } |
433 | 433 | ||
434 | const commentUrl = `http://localhost:${base.server.port}/videos/watch/${uuid};threadId=${threadId}` | 434 | const commentUrl = `http://localhost:${base.server.port}/w/${uuid};threadId=${threadId}` |
435 | 435 | ||
436 | function emailNotificationFinder (email: object) { | 436 | function emailNotificationFinder (email: object) { |
437 | return email['text'].indexOf(commentUrl) !== -1 | 437 | return email['text'].indexOf(commentUrl) !== -1 |
diff --git a/shared/models/actors/custom-page.model.ts b/shared/models/actors/custom-page.model.ts new file mode 100644 index 000000000..1e33584c1 --- /dev/null +++ b/shared/models/actors/custom-page.model.ts | |||
@@ -0,0 +1,3 @@ | |||
1 | export interface CustomPage { | ||
2 | content: string | ||
3 | } | ||
diff --git a/shared/models/actors/index.ts b/shared/models/actors/index.ts index 156f83248..e03f168cd 100644 --- a/shared/models/actors/index.ts +++ b/shared/models/actors/index.ts | |||
@@ -2,4 +2,5 @@ export * from './account.model' | |||
2 | export * from './actor-image.model' | 2 | export * from './actor-image.model' |
3 | export * from './actor-image.type' | 3 | export * from './actor-image.type' |
4 | export * from './actor.model' | 4 | export * from './actor.model' |
5 | export * from './custom-page.model' | ||
5 | export * from './follow.model' | 6 | export * from './follow.model' |
diff --git a/shared/models/custom-markup/custom-markup-data.model.ts b/shared/models/custom-markup/custom-markup-data.model.ts new file mode 100644 index 000000000..24ac3706c --- /dev/null +++ b/shared/models/custom-markup/custom-markup-data.model.ts | |||
@@ -0,0 +1,35 @@ | |||
1 | export type EmbedMarkupData = { | ||
2 | // Video or playlist uuid | ||
3 | uuid: string | ||
4 | } | ||
5 | |||
6 | export type VideoMiniatureMarkupData = { | ||
7 | // Video uuid | ||
8 | uuid: string | ||
9 | } | ||
10 | |||
11 | export type PlaylistMiniatureMarkupData = { | ||
12 | // Playlist uuid | ||
13 | uuid: string | ||
14 | } | ||
15 | |||
16 | export type ChannelMiniatureMarkupData = { | ||
17 | // Channel name (username) | ||
18 | name: string | ||
19 | } | ||
20 | |||
21 | export type VideosListMarkupData = { | ||
22 | title: string | ||
23 | description: string | ||
24 | sort: string | ||
25 | categoryOneOf: string // coma separated values | ||
26 | languageOneOf: string // coma separated values | ||
27 | count: string | ||
28 | } | ||
29 | |||
30 | export type ButtonMarkupData = { | ||
31 | theme: 'primary' | 'secondary' | ||
32 | href: string | ||
33 | label: string | ||
34 | blankTarget?: string | ||
35 | } | ||
diff --git a/shared/models/custom-markup/index.ts b/shared/models/custom-markup/index.ts new file mode 100644 index 000000000..2898dfa90 --- /dev/null +++ b/shared/models/custom-markup/index.ts | |||
@@ -0,0 +1 @@ | |||
export * from './custom-markup-data.model' | |||
diff --git a/shared/models/index.ts b/shared/models/index.ts index dff5fdf0e..4db1f234e 100644 --- a/shared/models/index.ts +++ b/shared/models/index.ts | |||
@@ -1,6 +1,7 @@ | |||
1 | export * from './activitypub' | 1 | export * from './activitypub' |
2 | export * from './actors' | 2 | export * from './actors' |
3 | export * from './moderation' | 3 | export * from './moderation' |
4 | export * from './custom-markup' | ||
4 | export * from './bulk' | 5 | export * from './bulk' |
5 | export * from './redundancy' | 6 | export * from './redundancy' |
6 | export * from './users' | 7 | export * from './users' |
diff --git a/shared/models/nodeinfo/index.ts b/shared/models/nodeinfo/index.ts new file mode 100644 index 000000000..faa64302a --- /dev/null +++ b/shared/models/nodeinfo/index.ts | |||
@@ -0,0 +1 @@ | |||
export * from './nodeinfo.model' | |||
diff --git a/shared/models/nodeinfo/index.d.ts b/shared/models/nodeinfo/nodeinfo.model.ts index 336cb66d2..336cb66d2 100644 --- a/shared/models/nodeinfo/index.d.ts +++ b/shared/models/nodeinfo/nodeinfo.model.ts | |||
diff --git a/shared/models/overviews/index.ts b/shared/models/overviews/index.ts index 376609efa..468507c6b 100644 --- a/shared/models/overviews/index.ts +++ b/shared/models/overviews/index.ts | |||
@@ -1 +1 @@ | |||
export * from './videos-overview' | export * from './videos-overview.model' | ||
diff --git a/shared/models/overviews/videos-overview.ts b/shared/models/overviews/videos-overview.model.ts index 0f3cb4a52..0f3cb4a52 100644 --- a/shared/models/overviews/videos-overview.ts +++ b/shared/models/overviews/videos-overview.model.ts | |||
diff --git a/shared/models/plugins/client-hook.model.ts b/shared/models/plugins/client/client-hook.model.ts index 620651051..620651051 100644 --- a/shared/models/plugins/client-hook.model.ts +++ b/shared/models/plugins/client/client-hook.model.ts | |||
diff --git a/shared/models/plugins/client/index.ts b/shared/models/plugins/client/index.ts new file mode 100644 index 000000000..6dfc6351f --- /dev/null +++ b/shared/models/plugins/client/index.ts | |||
@@ -0,0 +1,6 @@ | |||
1 | export * from './client-hook.model' | ||
2 | export * from './plugin-client-scope.type' | ||
3 | export * from './plugin-element-placeholder.type' | ||
4 | export * from './register-client-form-field.model' | ||
5 | export * from './register-client-hook.model' | ||
6 | export * from './register-client-settings-script.model' | ||
diff --git a/shared/models/plugins/plugin-client-scope.type.ts b/shared/models/plugins/client/plugin-client-scope.type.ts index 8cc234ff2..8cc234ff2 100644 --- a/shared/models/plugins/plugin-client-scope.type.ts +++ b/shared/models/plugins/client/plugin-client-scope.type.ts | |||
diff --git a/shared/models/plugins/plugin-element-placeholder.type.ts b/shared/models/plugins/client/plugin-element-placeholder.type.ts index 129099c62..129099c62 100644 --- a/shared/models/plugins/plugin-element-placeholder.type.ts +++ b/shared/models/plugins/client/plugin-element-placeholder.type.ts | |||
diff --git a/shared/models/plugins/register-client-form-field.model.ts b/shared/models/plugins/client/register-client-form-field.model.ts index 2df071337..2df071337 100644 --- a/shared/models/plugins/register-client-form-field.model.ts +++ b/shared/models/plugins/client/register-client-form-field.model.ts | |||
diff --git a/shared/models/plugins/register-client-hook.model.ts b/shared/models/plugins/client/register-client-hook.model.ts index 81047b21d..81047b21d 100644 --- a/shared/models/plugins/register-client-hook.model.ts +++ b/shared/models/plugins/client/register-client-hook.model.ts | |||
diff --git a/shared/models/plugins/register-client-settings-script.model.ts b/shared/models/plugins/client/register-client-settings-script.model.ts index ac16af366..481ceef96 100644 --- a/shared/models/plugins/register-client-settings-script.model.ts +++ b/shared/models/plugins/client/register-client-settings-script.model.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { RegisterServerSettingOptions } from "./register-server-setting.model" | 1 | import { RegisterServerSettingOptions } from '../server' |
2 | 2 | ||
3 | export interface RegisterClientSettingsScript { | 3 | export interface RegisterClientSettingsScript { |
4 | isSettingHidden (options: { | 4 | isSettingHidden (options: { |
diff --git a/shared/models/plugins/index.ts b/shared/models/plugins/index.ts index 03b27f907..cbbe4916e 100644 --- a/shared/models/plugins/index.ts +++ b/shared/models/plugins/index.ts | |||
@@ -1,28 +1,6 @@ | |||
1 | export * from './client-hook.model' | 1 | export * from './client' |
2 | export * from './plugin-index' | ||
3 | export * from './server' | ||
2 | export * from './hook-type.enum' | 4 | export * from './hook-type.enum' |
3 | export * from './install-plugin.model' | ||
4 | export * from './manage-plugin.model' | ||
5 | export * from './peertube-plugin-index-list.model' | ||
6 | export * from './peertube-plugin-index.model' | ||
7 | export * from './peertube-plugin-latest-version.model' | ||
8 | export * from './peertube-plugin.model' | ||
9 | export * from './plugin-client-scope.type' | ||
10 | export * from './plugin-element-placeholder.type' | ||
11 | export * from './plugin-package-json.model' | 5 | export * from './plugin-package-json.model' |
12 | export * from './plugin-playlist-privacy-manager.model' | ||
13 | export * from './plugin-settings-manager.model' | ||
14 | export * from './plugin-storage-manager.model' | ||
15 | export * from './plugin-transcoding-manager.model' | ||
16 | export * from './plugin-translation.model' | ||
17 | export * from './plugin-video-category-manager.model' | ||
18 | export * from './plugin-video-language-manager.model' | ||
19 | export * from './plugin-video-licence-manager.model' | ||
20 | export * from './plugin-video-privacy-manager.model' | ||
21 | export * from './plugin.type' | 6 | export * from './plugin.type' |
22 | export * from './public-server.setting' | ||
23 | export * from './register-client-hook.model' | ||
24 | export * from './register-client-settings-script.model' | ||
25 | export * from './register-client-form-field.model' | ||
26 | export * from './register-server-hook.model' | ||
27 | export * from './register-server-setting.model' | ||
28 | export * from './server-hook.model' | ||
diff --git a/shared/models/plugins/plugin-index/index.ts b/shared/models/plugins/plugin-index/index.ts new file mode 100644 index 000000000..913846638 --- /dev/null +++ b/shared/models/plugins/plugin-index/index.ts | |||
@@ -0,0 +1,3 @@ | |||
1 | export * from './peertube-plugin-index-list.model' | ||
2 | export * from './peertube-plugin-index.model' | ||
3 | export * from './peertube-plugin-latest-version.model' | ||
diff --git a/shared/models/plugins/peertube-plugin-index-list.model.ts b/shared/models/plugins/plugin-index/peertube-plugin-index-list.model.ts index 817bac31e..ecb46482e 100644 --- a/shared/models/plugins/peertube-plugin-index-list.model.ts +++ b/shared/models/plugins/plugin-index/peertube-plugin-index-list.model.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { PluginType } from './plugin.type' | 1 | import { PluginType } from '../plugin.type' |
2 | 2 | ||
3 | export interface PeertubePluginIndexList { | 3 | export interface PeertubePluginIndexList { |
4 | start: number | 4 | start: number |
diff --git a/shared/models/plugins/peertube-plugin-index.model.ts b/shared/models/plugins/plugin-index/peertube-plugin-index.model.ts index e91c8b4dc..e91c8b4dc 100644 --- a/shared/models/plugins/peertube-plugin-index.model.ts +++ b/shared/models/plugins/plugin-index/peertube-plugin-index.model.ts | |||
diff --git a/shared/models/plugins/peertube-plugin-latest-version.model.ts b/shared/models/plugins/plugin-index/peertube-plugin-latest-version.model.ts index 811a64429..811a64429 100644 --- a/shared/models/plugins/peertube-plugin-latest-version.model.ts +++ b/shared/models/plugins/plugin-index/peertube-plugin-latest-version.model.ts | |||
diff --git a/shared/models/plugins/plugin-package-json.model.ts b/shared/models/plugins/plugin-package-json.model.ts index c26e9ae5b..b2f92af80 100644 --- a/shared/models/plugins/plugin-package-json.model.ts +++ b/shared/models/plugins/plugin-package-json.model.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { PluginClientScope } from './plugin-client-scope.type' | 1 | import { PluginClientScope } from './client/plugin-client-scope.type' |
2 | 2 | ||
3 | export type PluginTranslationPaths = { | 3 | export type PluginTranslationPaths = { |
4 | [ locale: string ]: string | 4 | [ locale: string ]: string |
diff --git a/shared/models/plugins/server/api/index.ts b/shared/models/plugins/server/api/index.ts new file mode 100644 index 000000000..eb59a03f0 --- /dev/null +++ b/shared/models/plugins/server/api/index.ts | |||
@@ -0,0 +1,3 @@ | |||
1 | export * from './install-plugin.model' | ||
2 | export * from './manage-plugin.model' | ||
3 | export * from './peertube-plugin.model' | ||
diff --git a/shared/models/plugins/install-plugin.model.ts b/shared/models/plugins/server/api/install-plugin.model.ts index 5a268ebe1..5a268ebe1 100644 --- a/shared/models/plugins/install-plugin.model.ts +++ b/shared/models/plugins/server/api/install-plugin.model.ts | |||
diff --git a/shared/models/plugins/manage-plugin.model.ts b/shared/models/plugins/server/api/manage-plugin.model.ts index 612b3056c..612b3056c 100644 --- a/shared/models/plugins/manage-plugin.model.ts +++ b/shared/models/plugins/server/api/manage-plugin.model.ts | |||
diff --git a/shared/models/plugins/peertube-plugin.model.ts b/shared/models/plugins/server/api/peertube-plugin.model.ts index 2b0bb8cfa..54c383f57 100644 --- a/shared/models/plugins/peertube-plugin.model.ts +++ b/shared/models/plugins/server/api/peertube-plugin.model.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { PluginType } from './plugin.type' | 1 | import { PluginType } from '../../plugin.type' |
2 | 2 | ||
3 | export interface PeerTubePlugin { | 3 | export interface PeerTubePlugin { |
4 | name: string | 4 | name: string |
diff --git a/shared/models/plugins/server/index.ts b/shared/models/plugins/server/index.ts new file mode 100644 index 000000000..d3ff49d3b --- /dev/null +++ b/shared/models/plugins/server/index.ts | |||
@@ -0,0 +1,6 @@ | |||
1 | export * from './api' | ||
2 | export * from './managers' | ||
3 | export * from './settings' | ||
4 | export * from './plugin-translation.model' | ||
5 | export * from './register-server-hook.model' | ||
6 | export * from './server-hook.model' | ||
diff --git a/shared/models/plugins/server/managers/index.ts b/shared/models/plugins/server/managers/index.ts new file mode 100644 index 000000000..49365a854 --- /dev/null +++ b/shared/models/plugins/server/managers/index.ts | |||
@@ -0,0 +1,9 @@ | |||
1 | |||
2 | export * from './plugin-playlist-privacy-manager.model' | ||
3 | export * from './plugin-settings-manager.model' | ||
4 | export * from './plugin-storage-manager.model' | ||
5 | export * from './plugin-transcoding-manager.model' | ||
6 | export * from './plugin-video-category-manager.model' | ||
7 | export * from './plugin-video-language-manager.model' | ||
8 | export * from './plugin-video-licence-manager.model' | ||
9 | export * from './plugin-video-privacy-manager.model' | ||
diff --git a/shared/models/plugins/plugin-playlist-privacy-manager.model.ts b/shared/models/plugins/server/managers/plugin-playlist-privacy-manager.model.ts index d1823ef4e..4703c0a8b 100644 --- a/shared/models/plugins/plugin-playlist-privacy-manager.model.ts +++ b/shared/models/plugins/server/managers/plugin-playlist-privacy-manager.model.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { VideoPlaylistPrivacy } from '../videos/playlist/video-playlist-privacy.model' | 1 | import { VideoPlaylistPrivacy } from '../../../videos/playlist/video-playlist-privacy.model' |
2 | 2 | ||
3 | export interface PluginPlaylistPrivacyManager { | 3 | export interface PluginPlaylistPrivacyManager { |
4 | // PUBLIC = 1, | 4 | // PUBLIC = 1, |
diff --git a/shared/models/plugins/plugin-settings-manager.model.ts b/shared/models/plugins/server/managers/plugin-settings-manager.model.ts index 3c28c0565..3c28c0565 100644 --- a/shared/models/plugins/plugin-settings-manager.model.ts +++ b/shared/models/plugins/server/managers/plugin-settings-manager.model.ts | |||
diff --git a/shared/models/plugins/plugin-storage-manager.model.ts b/shared/models/plugins/server/managers/plugin-storage-manager.model.ts index 51567044a..51567044a 100644 --- a/shared/models/plugins/plugin-storage-manager.model.ts +++ b/shared/models/plugins/server/managers/plugin-storage-manager.model.ts | |||
diff --git a/shared/models/plugins/plugin-transcoding-manager.model.ts b/shared/models/plugins/server/managers/plugin-transcoding-manager.model.ts index 8babccd4e..a0422a460 100644 --- a/shared/models/plugins/plugin-transcoding-manager.model.ts +++ b/shared/models/plugins/server/managers/plugin-transcoding-manager.model.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { EncoderOptionsBuilder } from '../videos/video-transcoding.model' | 1 | import { EncoderOptionsBuilder } from '../../../videos/video-transcoding.model' |
2 | 2 | ||
3 | export interface PluginTranscodingManager { | 3 | export interface PluginTranscodingManager { |
4 | addLiveProfile (encoder: string, profile: string, builder: EncoderOptionsBuilder): boolean | 4 | addLiveProfile (encoder: string, profile: string, builder: EncoderOptionsBuilder): boolean |
diff --git a/shared/models/plugins/plugin-video-category-manager.model.ts b/shared/models/plugins/server/managers/plugin-video-category-manager.model.ts index 201bfa979..201bfa979 100644 --- a/shared/models/plugins/plugin-video-category-manager.model.ts +++ b/shared/models/plugins/server/managers/plugin-video-category-manager.model.ts | |||
diff --git a/shared/models/plugins/plugin-video-language-manager.model.ts b/shared/models/plugins/server/managers/plugin-video-language-manager.model.ts index 3fd577a79..3fd577a79 100644 --- a/shared/models/plugins/plugin-video-language-manager.model.ts +++ b/shared/models/plugins/server/managers/plugin-video-language-manager.model.ts | |||
diff --git a/shared/models/plugins/plugin-video-licence-manager.model.ts b/shared/models/plugins/server/managers/plugin-video-licence-manager.model.ts index 82a634d3a..82a634d3a 100644 --- a/shared/models/plugins/plugin-video-licence-manager.model.ts +++ b/shared/models/plugins/server/managers/plugin-video-licence-manager.model.ts | |||
diff --git a/shared/models/plugins/plugin-video-privacy-manager.model.ts b/shared/models/plugins/server/managers/plugin-video-privacy-manager.model.ts index 3ada99608..7717115e3 100644 --- a/shared/models/plugins/plugin-video-privacy-manager.model.ts +++ b/shared/models/plugins/server/managers/plugin-video-privacy-manager.model.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { VideoPrivacy } from '../videos/video-privacy.enum' | 1 | import { VideoPrivacy } from '../../../videos/video-privacy.enum' |
2 | 2 | ||
3 | export interface PluginVideoPrivacyManager { | 3 | export interface PluginVideoPrivacyManager { |
4 | // PUBLIC = 1 | 4 | // PUBLIC = 1 |
diff --git a/shared/models/plugins/plugin-translation.model.ts b/shared/models/plugins/server/plugin-translation.model.ts index a2dd8e560..a2dd8e560 100644 --- a/shared/models/plugins/plugin-translation.model.ts +++ b/shared/models/plugins/server/plugin-translation.model.ts | |||
diff --git a/shared/models/plugins/register-server-hook.model.ts b/shared/models/plugins/server/register-server-hook.model.ts index 746fdc329..746fdc329 100644 --- a/shared/models/plugins/register-server-hook.model.ts +++ b/shared/models/plugins/server/register-server-hook.model.ts | |||
diff --git a/shared/models/plugins/server-hook.model.ts b/shared/models/plugins/server/server-hook.model.ts index 88277af5a..88277af5a 100644 --- a/shared/models/plugins/server-hook.model.ts +++ b/shared/models/plugins/server/server-hook.model.ts | |||
diff --git a/shared/models/plugins/server/settings/index.ts b/shared/models/plugins/server/settings/index.ts new file mode 100644 index 000000000..b456de019 --- /dev/null +++ b/shared/models/plugins/server/settings/index.ts | |||
@@ -0,0 +1,2 @@ | |||
1 | export * from './public-server.setting' | ||
2 | export * from './register-server-setting.model' | ||
diff --git a/shared/models/plugins/public-server.setting.ts b/shared/models/plugins/server/settings/public-server.setting.ts index 9802c4d7d..9802c4d7d 100644 --- a/shared/models/plugins/public-server.setting.ts +++ b/shared/models/plugins/server/settings/public-server.setting.ts | |||
diff --git a/shared/models/plugins/register-server-setting.model.ts b/shared/models/plugins/server/settings/register-server-setting.model.ts index 9f45c3c37..d9a798cac 100644 --- a/shared/models/plugins/register-server-setting.model.ts +++ b/shared/models/plugins/server/settings/register-server-setting.model.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { RegisterClientFormFieldOptions } from './register-client-form-field.model' | 1 | import { RegisterClientFormFieldOptions } from '../../client' |
2 | 2 | ||
3 | export type RegisterServerSettingOptions = 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) |
diff --git a/shared/models/redundancy/index.ts b/shared/models/redundancy/index.ts index 649cc489f..641a5d625 100644 --- a/shared/models/redundancy/index.ts +++ b/shared/models/redundancy/index.ts | |||
@@ -1,3 +1,4 @@ | |||
1 | export * from './videos-redundancy-strategy.model' | ||
2 | export * from './video-redundancies-filters.model' | 1 | export * from './video-redundancies-filters.model' |
2 | export * from './video-redundancy-config-filter.type' | ||
3 | export * from './video-redundancy.model' | 3 | export * from './video-redundancy.model' |
4 | export * from './videos-redundancy-strategy.model' | ||
diff --git a/shared/models/server/custom-config.model.ts b/shared/models/server/custom-config.model.ts index 0bccd63e3..75d04423a 100644 --- a/shared/models/server/custom-config.model.ts +++ b/shared/models/server/custom-config.model.ts | |||
@@ -69,6 +69,7 @@ export interface CustomConfig { | |||
69 | enabled: boolean | 69 | enabled: boolean |
70 | limit: number | 70 | limit: number |
71 | requiresEmailVerification: boolean | 71 | requiresEmailVerification: boolean |
72 | minimumAge: number | ||
72 | } | 73 | } |
73 | 74 | ||
74 | admin: { | 75 | admin: { |
diff --git a/shared/models/server/server-config.model.ts b/shared/models/server/server-config.model.ts index 85d84af44..585e99aca 100644 --- a/shared/models/server/server-config.model.ts +++ b/shared/models/server/server-config.model.ts | |||
@@ -84,6 +84,7 @@ export interface ServerConfig { | |||
84 | allowed: boolean | 84 | allowed: boolean |
85 | allowedForCurrentIP: boolean | 85 | allowedForCurrentIP: boolean |
86 | requiresEmailVerification: boolean | 86 | requiresEmailVerification: boolean |
87 | minimumAge: number | ||
87 | } | 88 | } |
88 | 89 | ||
89 | transcoding: { | 90 | transcoding: { |
@@ -214,4 +215,10 @@ export interface ServerConfig { | |||
214 | level: BroadcastMessageLevel | 215 | level: BroadcastMessageLevel |
215 | dismissable: boolean | 216 | dismissable: boolean |
216 | } | 217 | } |
218 | |||
219 | homepage: { | ||
220 | enabled: boolean | ||
221 | } | ||
217 | } | 222 | } |
223 | |||
224 | export type HTMLServerConfig = Omit<ServerConfig, 'signup'> | ||
diff --git a/shared/models/server/server-error-code.enum.ts b/shared/models/server/server-error-code.enum.ts index c02b0e6c7..d17d958be 100644 --- a/shared/models/server/server-error-code.enum.ts +++ b/shared/models/server/server-error-code.enum.ts | |||
@@ -2,4 +2,5 @@ export const enum ServerErrorCode { | |||
2 | DOES_NOT_RESPECT_FOLLOW_CONSTRAINTS = 1, | 2 | DOES_NOT_RESPECT_FOLLOW_CONSTRAINTS = 1, |
3 | MAX_INSTANCE_LIVES_LIMIT_REACHED = 2, | 3 | MAX_INSTANCE_LIVES_LIMIT_REACHED = 2, |
4 | MAX_USER_LIVES_LIMIT_REACHED = 3, | 4 | MAX_USER_LIVES_LIMIT_REACHED = 3, |
5 | INCORRECT_FILES_IN_TORRENT = 4 | ||
5 | } | 6 | } |
diff --git a/shared/models/users/user-right.enum.ts b/shared/models/users/user-right.enum.ts index bbedc9f00..950b22bad 100644 --- a/shared/models/users/user-right.enum.ts +++ b/shared/models/users/user-right.enum.ts | |||
@@ -16,6 +16,7 @@ export const enum UserRight { | |||
16 | MANAGE_JOBS, | 16 | MANAGE_JOBS, |
17 | 17 | ||
18 | MANAGE_CONFIGURATION, | 18 | MANAGE_CONFIGURATION, |
19 | MANAGE_INSTANCE_CUSTOM_PAGE, | ||
19 | 20 | ||
20 | MANAGE_ACCOUNTS_BLOCKLIST, | 21 | MANAGE_ACCOUNTS_BLOCKLIST, |
21 | MANAGE_SERVERS_BLOCKLIST, | 22 | MANAGE_SERVERS_BLOCKLIST, |
diff --git a/shared/models/videos/change-ownership/index.ts b/shared/models/videos/change-ownership/index.ts new file mode 100644 index 000000000..a942fb2cd --- /dev/null +++ b/shared/models/videos/change-ownership/index.ts | |||
@@ -0,0 +1,3 @@ | |||
1 | export * from './video-change-ownership-accept.model' | ||
2 | export * from './video-change-ownership-create.model' | ||
3 | export * from './video-change-ownership.model' | ||
diff --git a/shared/models/videos/video-change-ownership-accept.model.ts b/shared/models/videos/change-ownership/video-change-ownership-accept.model.ts index f27247633..f27247633 100644 --- a/shared/models/videos/video-change-ownership-accept.model.ts +++ b/shared/models/videos/change-ownership/video-change-ownership-accept.model.ts | |||
diff --git a/shared/models/videos/video-change-ownership-create.model.ts b/shared/models/videos/change-ownership/video-change-ownership-create.model.ts index 40fcca285..40fcca285 100644 --- a/shared/models/videos/video-change-ownership-create.model.ts +++ b/shared/models/videos/change-ownership/video-change-ownership-create.model.ts | |||
diff --git a/shared/models/videos/video-change-ownership.model.ts b/shared/models/videos/change-ownership/video-change-ownership.model.ts index 669c7f3e7..3d31cad0a 100644 --- a/shared/models/videos/video-change-ownership.model.ts +++ b/shared/models/videos/change-ownership/video-change-ownership.model.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { Account } from '../actors' | 1 | import { Account } from '../../actors' |
2 | import { Video } from './video.model' | 2 | import { Video } from '../video.model' |
3 | 3 | ||
4 | export interface VideoChangeOwnership { | 4 | export interface VideoChangeOwnership { |
5 | id: number | 5 | id: number |
diff --git a/shared/models/videos/comment/index.ts b/shared/models/videos/comment/index.ts new file mode 100644 index 000000000..7b9261a36 --- /dev/null +++ b/shared/models/videos/comment/index.ts | |||
@@ -0,0 +1 @@ | |||
export * from './video-comment.model' | |||
diff --git a/shared/models/videos/video-comment.model.ts b/shared/models/videos/comment/video-comment.model.ts index 9730a3f76..79c0e4c0a 100644 --- a/shared/models/videos/video-comment.model.ts +++ b/shared/models/videos/comment/video-comment.model.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { Account } from '../actors' | 1 | import { Account } from '../../actors' |
2 | 2 | ||
3 | export interface VideoComment { | 3 | export interface VideoComment { |
4 | id: number | 4 | id: number |
diff --git a/shared/models/videos/index.ts b/shared/models/videos/index.ts index fac3e0b2f..64f2c9df6 100644 --- a/shared/models/videos/index.ts +++ b/shared/models/videos/index.ts | |||
@@ -1,6 +1,8 @@ | |||
1 | export * from './blacklist' | 1 | export * from './blacklist' |
2 | export * from './caption' | 2 | export * from './caption' |
3 | export * from './change-ownership' | ||
3 | export * from './channel' | 4 | export * from './channel' |
5 | export * from './comment' | ||
4 | export * from './live' | 6 | export * from './live' |
5 | export * from './import' | 7 | export * from './import' |
6 | export * from './playlist' | 8 | export * from './playlist' |
@@ -10,17 +12,11 @@ export * from './nsfw-policy.type' | |||
10 | 12 | ||
11 | export * from './thumbnail.type' | 13 | export * from './thumbnail.type' |
12 | 14 | ||
13 | export * from './video-change-ownership-accept.model' | ||
14 | export * from './video-change-ownership-create.model' | ||
15 | export * from './video-change-ownership.model' | ||
16 | |||
17 | export * from './video-comment.model' | ||
18 | export * from './video-constant.model' | 15 | export * from './video-constant.model' |
19 | export * from './video-create.model' | 16 | export * from './video-create.model' |
20 | export * from './video-file-metadata' | ||
21 | export * from './video-file.model' | ||
22 | 17 | ||
23 | export * from './live/live-video.model' | 18 | export * from './video-file-metadata.model' |
19 | export * from './video-file.model' | ||
24 | 20 | ||
25 | export * from './video-privacy.enum' | 21 | export * from './video-privacy.enum' |
26 | export * from './video-query.type' | 22 | export * from './video-query.type' |
diff --git a/shared/models/videos/video-file-metadata.ts b/shared/models/videos/video-file-metadata.model.ts index 8f527c0a7..8f527c0a7 100644 --- a/shared/models/videos/video-file-metadata.ts +++ b/shared/models/videos/video-file-metadata.model.ts | |||
diff --git a/shared/models/videos/video-file.model.ts b/shared/models/videos/video-file.model.ts index 1e830b19c..28fce0aaf 100644 --- a/shared/models/videos/video-file.model.ts +++ b/shared/models/videos/video-file.model.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { VideoConstant } from './video-constant.model' | 1 | import { VideoConstant } from './video-constant.model' |
2 | import { VideoFileMetadata } from './video-file-metadata' | 2 | import { VideoFileMetadata } from './video-file-metadata.model' |
3 | import { VideoResolution } from './video-resolution.enum' | 3 | import { VideoResolution } from './video-resolution.enum' |
4 | 4 | ||
5 | export interface VideoFile { | 5 | export interface VideoFile { |