diff options
Diffstat (limited to 'shared')
-rw-r--r-- | shared/extra-utils/server/config-command.ts | 12 | ||||
-rw-r--r-- | shared/extra-utils/server/plugins-command.ts | 5 | ||||
-rw-r--r-- | shared/extra-utils/users/blocklist-command.ts | 25 | ||||
-rw-r--r-- | shared/models/moderation/block-status.model.ts | 15 | ||||
-rw-r--r-- | shared/models/moderation/index.ts | 1 | ||||
-rw-r--r-- | shared/models/plugins/client/plugin-selector-id.type.ts | 11 | ||||
-rw-r--r-- | shared/models/plugins/server/api/install-plugin.model.ts | 1 | ||||
-rw-r--r-- | shared/models/server/custom-config.model.ts | 14 | ||||
-rw-r--r-- | shared/models/server/server-config.model.ts | 6 |
9 files changed, 86 insertions, 4 deletions
diff --git a/shared/extra-utils/server/config-command.ts b/shared/extra-utils/server/config-command.ts index 7a768b4df..a061ca89e 100644 --- a/shared/extra-utils/server/config-command.ts +++ b/shared/extra-utils/server/config-command.ts | |||
@@ -194,6 +194,18 @@ export class ConfigCommand extends AbstractCommand { | |||
194 | whitelisted: true | 194 | whitelisted: true |
195 | } | 195 | } |
196 | }, | 196 | }, |
197 | client: { | ||
198 | videos: { | ||
199 | miniature: { | ||
200 | preferAuthorDisplayName: false | ||
201 | } | ||
202 | }, | ||
203 | menu: { | ||
204 | login: { | ||
205 | redirectOnSingleExternalAuth: false | ||
206 | } | ||
207 | } | ||
208 | }, | ||
197 | cache: { | 209 | cache: { |
198 | previews: { | 210 | previews: { |
199 | size: 2 | 211 | size: 2 |
diff --git a/shared/extra-utils/server/plugins-command.ts b/shared/extra-utils/server/plugins-command.ts index b944475a2..9bf24afff 100644 --- a/shared/extra-utils/server/plugins-command.ts +++ b/shared/extra-utils/server/plugins-command.ts | |||
@@ -158,15 +158,16 @@ export class PluginsCommand extends AbstractCommand { | |||
158 | install (options: OverrideCommandOptions & { | 158 | install (options: OverrideCommandOptions & { |
159 | path?: string | 159 | path?: string |
160 | npmName?: string | 160 | npmName?: string |
161 | pluginVersion?: string | ||
161 | }) { | 162 | }) { |
162 | const { npmName, path } = options | 163 | const { npmName, path, pluginVersion } = options |
163 | const apiPath = '/api/v1/plugins/install' | 164 | const apiPath = '/api/v1/plugins/install' |
164 | 165 | ||
165 | return this.postBodyRequest({ | 166 | return this.postBodyRequest({ |
166 | ...options, | 167 | ...options, |
167 | 168 | ||
168 | path: apiPath, | 169 | path: apiPath, |
169 | fields: { npmName, path }, | 170 | fields: { npmName, path, pluginVersion }, |
170 | implicitToken: true, | 171 | implicitToken: true, |
171 | defaultExpectedStatus: HttpStatusCode.OK_200 | 172 | defaultExpectedStatus: HttpStatusCode.OK_200 |
172 | }) | 173 | }) |
diff --git a/shared/extra-utils/users/blocklist-command.ts b/shared/extra-utils/users/blocklist-command.ts index 14491a1ae..2e7ed074d 100644 --- a/shared/extra-utils/users/blocklist-command.ts +++ b/shared/extra-utils/users/blocklist-command.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import { AccountBlock, HttpStatusCode, ResultList, ServerBlock } from '@shared/models' | 3 | import { AccountBlock, BlockStatus, HttpStatusCode, ResultList, ServerBlock } from '@shared/models' |
4 | import { AbstractCommand, OverrideCommandOptions } from '../shared' | 4 | import { AbstractCommand, OverrideCommandOptions } from '../shared' |
5 | 5 | ||
6 | type ListBlocklistOptions = OverrideCommandOptions & { | 6 | type ListBlocklistOptions = OverrideCommandOptions & { |
@@ -37,6 +37,29 @@ export class BlocklistCommand extends AbstractCommand { | |||
37 | 37 | ||
38 | // --------------------------------------------------------------------------- | 38 | // --------------------------------------------------------------------------- |
39 | 39 | ||
40 | getStatus (options: OverrideCommandOptions & { | ||
41 | accounts?: string[] | ||
42 | hosts?: string[] | ||
43 | }) { | ||
44 | const { accounts, hosts } = options | ||
45 | |||
46 | const path = '/api/v1/blocklist/status' | ||
47 | |||
48 | return this.getRequestBody<BlockStatus>({ | ||
49 | ...options, | ||
50 | |||
51 | path, | ||
52 | query: { | ||
53 | accounts, | ||
54 | hosts | ||
55 | }, | ||
56 | implicitToken: false, | ||
57 | defaultExpectedStatus: HttpStatusCode.OK_200 | ||
58 | }) | ||
59 | } | ||
60 | |||
61 | // --------------------------------------------------------------------------- | ||
62 | |||
40 | addToMyBlocklist (options: OverrideCommandOptions & { | 63 | addToMyBlocklist (options: OverrideCommandOptions & { |
41 | account?: string | 64 | account?: string |
42 | server?: string | 65 | server?: string |
diff --git a/shared/models/moderation/block-status.model.ts b/shared/models/moderation/block-status.model.ts new file mode 100644 index 000000000..597312757 --- /dev/null +++ b/shared/models/moderation/block-status.model.ts | |||
@@ -0,0 +1,15 @@ | |||
1 | export interface BlockStatus { | ||
2 | accounts: { | ||
3 | [ handle: string ]: { | ||
4 | blockedByServer: boolean | ||
5 | blockedByUser?: boolean | ||
6 | } | ||
7 | } | ||
8 | |||
9 | hosts: { | ||
10 | [ host: string ]: { | ||
11 | blockedByServer: boolean | ||
12 | blockedByUser?: boolean | ||
13 | } | ||
14 | } | ||
15 | } | ||
diff --git a/shared/models/moderation/index.ts b/shared/models/moderation/index.ts index 8b6042e97..f8e6d351c 100644 --- a/shared/models/moderation/index.ts +++ b/shared/models/moderation/index.ts | |||
@@ -1,3 +1,4 @@ | |||
1 | export * from './abuse' | 1 | export * from './abuse' |
2 | export * from './block-status.model' | ||
2 | export * from './account-block.model' | 3 | export * from './account-block.model' |
3 | export * from './server-block.model' | 4 | export * from './server-block.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/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/server/custom-config.model.ts b/shared/models/server/custom-config.model.ts index 3ed932494..52d3d9588 100644 --- a/shared/models/server/custom-config.model.ts +++ b/shared/models/server/custom-config.model.ts | |||
@@ -52,6 +52,20 @@ export interface CustomConfig { | |||
52 | } | 52 | } |
53 | } | 53 | } |
54 | 54 | ||
55 | client: { | ||
56 | videos: { | ||
57 | miniature: { | ||
58 | preferAuthorDisplayName: boolean | ||
59 | } | ||
60 | } | ||
61 | |||
62 | menu: { | ||
63 | login: { | ||
64 | redirectOnSingleExternalAuth: boolean | ||
65 | } | ||
66 | } | ||
67 | } | ||
68 | |||
55 | cache: { | 69 | cache: { |
56 | previews: { | 70 | previews: { |
57 | size: number | 71 | size: number |
diff --git a/shared/models/server/server-config.model.ts b/shared/models/server/server-config.model.ts index e75eefd47..9f17276e0 100644 --- a/shared/models/server/server-config.model.ts +++ b/shared/models/server/server-config.model.ts | |||
@@ -39,6 +39,12 @@ export interface ServerConfig { | |||
39 | preferAuthorDisplayName: boolean | 39 | preferAuthorDisplayName: boolean |
40 | } | 40 | } |
41 | } | 41 | } |
42 | |||
43 | menu: { | ||
44 | login: { | ||
45 | redirectOnSingleExternalAuth: boolean | ||
46 | } | ||
47 | } | ||
42 | } | 48 | } |
43 | 49 | ||
44 | webadmin: { | 50 | webadmin: { |