diff options
author | Chocobozzz <me@florianbigard.com> | 2023-07-31 14:34:36 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2023-08-11 15:02:33 +0200 |
commit | 3a4992633ee62d5edfbb484d9c6bcb3cf158489d (patch) | |
tree | e4510b39bdac9c318fdb4b47018d08f15368b8f0 /client/src/app/+admin | |
parent | 04d1da5621d25d59bd5fa1543b725c497bf5d9a8 (diff) | |
download | PeerTube-3a4992633ee62d5edfbb484d9c6bcb3cf158489d.tar.gz PeerTube-3a4992633ee62d5edfbb484d9c6bcb3cf158489d.tar.zst PeerTube-3a4992633ee62d5edfbb484d9c6bcb3cf158489d.zip |
Migrate server to ESM
Sorry for the very big commit that may lead to git log issues and merge
conflicts, but it's a major step forward:
* Server can be faster at startup because imports() are async and we can
easily lazy import big modules
* Angular doesn't seem to support ES import (with .js extension), so we
had to correctly organize peertube into a monorepo:
* Use yarn workspace feature
* Use typescript reference projects for dependencies
* Shared projects have been moved into "packages", each one is now a
node module (with a dedicated package.json/tsconfig.json)
* server/tools have been moved into apps/ and is now a dedicated app
bundled and published on NPM so users don't have to build peertube
cli tools manually
* server/tests have been moved into packages/ so we don't compile
them every time we want to run the server
* Use isolatedModule option:
* Had to move from const enum to const
(https://www.typescriptlang.org/docs/handbook/enums.html#objects-vs-enums)
* Had to explictely specify "type" imports when used in decorators
* Prefer tsx (that uses esbuild under the hood) instead of ts-node to
load typescript files (tests with mocha or scripts):
* To reduce test complexity as esbuild doesn't support decorator
metadata, we only test server files that do not import server
models
* We still build tests files into js files for a faster CI
* Remove unmaintained peertube CLI import script
* Removed some barrels to speed up execution (less imports)
Diffstat (limited to 'client/src/app/+admin')
50 files changed, 75 insertions, 77 deletions
diff --git a/client/src/app/+admin/admin.component.ts b/client/src/app/+admin/admin.component.ts index 49092ea2a..c0d7db99e 100644 --- a/client/src/app/+admin/admin.component.ts +++ b/client/src/app/+admin/admin.component.ts | |||
@@ -2,7 +2,7 @@ import { Component, OnInit } from '@angular/core' | |||
2 | import { AuthService, ScreenService, ServerService } from '@app/core' | 2 | import { AuthService, ScreenService, ServerService } from '@app/core' |
3 | import { ListOverflowItem } from '@app/shared/shared-main' | 3 | import { ListOverflowItem } from '@app/shared/shared-main' |
4 | import { TopMenuDropdownParam } from '@app/shared/shared-main/misc/top-menu-dropdown.component' | 4 | import { TopMenuDropdownParam } from '@app/shared/shared-main/misc/top-menu-dropdown.component' |
5 | import { UserRight } from '@shared/models' | 5 | import { UserRight } from '@peertube/peertube-models' |
6 | 6 | ||
7 | @Component({ | 7 | @Component({ |
8 | templateUrl: './admin.component.html', | 8 | templateUrl: './admin.component.html', |
diff --git a/client/src/app/+admin/config/config.routes.ts b/client/src/app/+admin/config/config.routes.ts index 6d255ac46..96a4f3771 100644 --- a/client/src/app/+admin/config/config.routes.ts +++ b/client/src/app/+admin/config/config.routes.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { Routes } from '@angular/router' | 1 | import { Routes } from '@angular/router' |
2 | import { EditCustomConfigComponent } from '@app/+admin/config/edit-custom-config' | 2 | import { EditCustomConfigComponent } from '@app/+admin/config/edit-custom-config' |
3 | import { UserRightGuard } from '@app/core' | 3 | import { UserRightGuard } from '@app/core' |
4 | import { UserRight } from '@shared/models' | 4 | import { UserRight } from '@peertube/peertube-models' |
5 | 5 | ||
6 | export const ConfigRoutes: Routes = [ | 6 | export const ConfigRoutes: Routes = [ |
7 | { | 7 | { |
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.ts b/client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.ts index 2122e67b2..953c7d540 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.ts +++ b/client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.ts | |||
@@ -3,7 +3,7 @@ import { SelectOptionsItem } from 'src/types/select-options-item.model' | |||
3 | import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core' | 3 | import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core' |
4 | import { FormGroup } from '@angular/forms' | 4 | import { FormGroup } from '@angular/forms' |
5 | import { MenuService, ThemeService } from '@app/core' | 5 | import { MenuService, ThemeService } from '@app/core' |
6 | import { HTMLServerConfig } from '@shared/models' | 6 | import { HTMLServerConfig } from '@peertube/peertube-models' |
7 | import { ConfigService } from '../shared/config.service' | 7 | import { ConfigService } from '../shared/config.service' |
8 | 8 | ||
9 | @Component({ | 9 | @Component({ |
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts index c3b85b196..54c076b74 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts +++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts | |||
@@ -27,7 +27,7 @@ import { | |||
27 | import { USER_VIDEO_QUOTA_DAILY_VALIDATOR, USER_VIDEO_QUOTA_VALIDATOR } from '@app/shared/form-validators/user-validators' | 27 | import { USER_VIDEO_QUOTA_DAILY_VALIDATOR, USER_VIDEO_QUOTA_VALIDATOR } from '@app/shared/form-validators/user-validators' |
28 | import { FormReactive, FormReactiveService } from '@app/shared/shared-forms' | 28 | import { FormReactive, FormReactiveService } from '@app/shared/shared-forms' |
29 | import { CustomPageService } from '@app/shared/shared-main/custom-page' | 29 | import { CustomPageService } from '@app/shared/shared-main/custom-page' |
30 | import { CustomConfig, CustomPage, HTMLServerConfig } from '@shared/models' | 30 | import { CustomConfig, CustomPage, HTMLServerConfig } from '@peertube/peertube-models' |
31 | import { EditConfigurationService } from './edit-configuration.service' | 31 | import { EditConfigurationService } from './edit-configuration.service' |
32 | 32 | ||
33 | type ComponentCustomConfig = CustomConfig & { | 33 | type ComponentCustomConfig = CustomConfig & { |
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-live-configuration.component.ts b/client/src/app/+admin/config/edit-custom-config/edit-live-configuration.component.ts index 1d1fecf90..59629aa20 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-live-configuration.component.ts +++ b/client/src/app/+admin/config/edit-custom-config/edit-live-configuration.component.ts | |||
@@ -2,7 +2,7 @@ | |||
2 | import { SelectOptionsItem } from 'src/types/select-options-item.model' | 2 | import { SelectOptionsItem } from 'src/types/select-options-item.model' |
3 | import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core' | 3 | import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core' |
4 | import { FormGroup } from '@angular/forms' | 4 | import { FormGroup } from '@angular/forms' |
5 | import { HTMLServerConfig } from '@shared/models' | 5 | import { HTMLServerConfig } from '@peertube/peertube-models' |
6 | import { ConfigService } from '../shared/config.service' | 6 | import { ConfigService } from '../shared/config.service' |
7 | import { EditConfigurationService, ResolutionOption } from './edit-configuration.service' | 7 | import { EditConfigurationService, ResolutionOption } from './edit-configuration.service' |
8 | 8 | ||
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-vod-transcoding.component.ts b/client/src/app/+admin/config/edit-custom-config/edit-vod-transcoding.component.ts index 6496e8753..a2cd04396 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-vod-transcoding.component.ts +++ b/client/src/app/+admin/config/edit-custom-config/edit-vod-transcoding.component.ts | |||
@@ -2,7 +2,7 @@ | |||
2 | import { SelectOptionsItem } from 'src/types/select-options-item.model' | 2 | import { SelectOptionsItem } from 'src/types/select-options-item.model' |
3 | import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core' | 3 | import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core' |
4 | import { FormGroup } from '@angular/forms' | 4 | import { FormGroup } from '@angular/forms' |
5 | import { HTMLServerConfig } from '@shared/models' | 5 | import { HTMLServerConfig } from '@peertube/peertube-models' |
6 | import { ConfigService } from '../shared/config.service' | 6 | import { ConfigService } from '../shared/config.service' |
7 | import { EditConfigurationService, ResolutionOption } from './edit-configuration.service' | 7 | import { EditConfigurationService, ResolutionOption } from './edit-configuration.service' |
8 | 8 | ||
diff --git a/client/src/app/+admin/config/shared/config.service.ts b/client/src/app/+admin/config/shared/config.service.ts index 80f495b41..3c3894945 100644 --- a/client/src/app/+admin/config/shared/config.service.ts +++ b/client/src/app/+admin/config/shared/config.service.ts | |||
@@ -2,7 +2,7 @@ import { catchError } from 'rxjs/operators' | |||
2 | import { HttpClient } from '@angular/common/http' | 2 | import { HttpClient } from '@angular/common/http' |
3 | import { Injectable } from '@angular/core' | 3 | import { Injectable } from '@angular/core' |
4 | import { RestExtractor } from '@app/core' | 4 | import { RestExtractor } from '@app/core' |
5 | import { CustomConfig } from '@shared/models' | 5 | import { CustomConfig } from '@peertube/peertube-models' |
6 | import { SelectOptionsItem } from '../../../../types/select-options-item.model' | 6 | import { SelectOptionsItem } from '../../../../types/select-options-item.model' |
7 | import { environment } from '../../../../environments/environment' | 7 | import { environment } from '../../../../environments/environment' |
8 | 8 | ||
diff --git a/client/src/app/+admin/follows/followers-list/followers-list.component.ts b/client/src/app/+admin/follows/followers-list/followers-list.component.ts index 618892242..656a7bf87 100644 --- a/client/src/app/+admin/follows/followers-list/followers-list.component.ts +++ b/client/src/app/+admin/follows/followers-list/followers-list.component.ts | |||
@@ -5,7 +5,7 @@ import { formatICU } from '@app/helpers' | |||
5 | import { AdvancedInputFilter } from '@app/shared/shared-forms' | 5 | import { AdvancedInputFilter } from '@app/shared/shared-forms' |
6 | import { InstanceFollowService } from '@app/shared/shared-instance' | 6 | import { InstanceFollowService } from '@app/shared/shared-instance' |
7 | import { DropdownAction } from '@app/shared/shared-main' | 7 | import { DropdownAction } from '@app/shared/shared-main' |
8 | import { ActorFollow } from '@shared/models' | 8 | import { ActorFollow } from '@peertube/peertube-models' |
9 | 9 | ||
10 | @Component({ | 10 | @Component({ |
11 | selector: 'my-followers-list', | 11 | selector: 'my-followers-list', |
diff --git a/client/src/app/+admin/follows/following-list/following-list.component.ts b/client/src/app/+admin/follows/following-list/following-list.component.ts index 6c8723c16..da6647f6b 100644 --- a/client/src/app/+admin/follows/following-list/following-list.component.ts +++ b/client/src/app/+admin/follows/following-list/following-list.component.ts | |||
@@ -3,7 +3,7 @@ import { Component, OnInit, ViewChild } from '@angular/core' | |||
3 | import { ConfirmService, Notifier, RestPagination, RestTable } from '@app/core' | 3 | import { ConfirmService, Notifier, RestPagination, RestTable } from '@app/core' |
4 | import { AdvancedInputFilter } from '@app/shared/shared-forms' | 4 | import { AdvancedInputFilter } from '@app/shared/shared-forms' |
5 | import { InstanceFollowService } from '@app/shared/shared-instance' | 5 | import { InstanceFollowService } from '@app/shared/shared-instance' |
6 | import { ActorFollow } from '@shared/models' | 6 | import { ActorFollow } from '@peertube/peertube-models' |
7 | import { FollowModalComponent } from './follow-modal.component' | 7 | import { FollowModalComponent } from './follow-modal.component' |
8 | import { DropdownAction } from '@app/shared/shared-main' | 8 | import { DropdownAction } from '@app/shared/shared-main' |
9 | import { formatICU } from '@app/helpers' | 9 | import { formatICU } from '@app/helpers' |
diff --git a/client/src/app/+admin/follows/follows.routes.ts b/client/src/app/+admin/follows/follows.routes.ts index 718493dc7..e187f83ea 100644 --- a/client/src/app/+admin/follows/follows.routes.ts +++ b/client/src/app/+admin/follows/follows.routes.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { Routes } from '@angular/router' | 1 | import { Routes } from '@angular/router' |
2 | import { VideoRedundanciesListComponent } from '@app/+admin/follows/video-redundancies-list' | 2 | import { VideoRedundanciesListComponent } from '@app/+admin/follows/video-redundancies-list' |
3 | import { UserRightGuard } from '@app/core' | 3 | import { UserRightGuard } from '@app/core' |
4 | import { UserRight } from '@shared/models' | 4 | import { UserRight } from '@peertube/peertube-models' |
5 | import { FollowersListComponent } from './followers-list' | 5 | import { FollowersListComponent } from './followers-list' |
6 | import { FollowingListComponent } from './following-list/following-list.component' | 6 | import { FollowingListComponent } from './following-list/following-list.component' |
7 | 7 | ||
diff --git a/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.ts b/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.ts index efcefd509..09fc038ce 100644 --- a/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.ts +++ b/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.ts | |||
@@ -3,9 +3,8 @@ import { SortMeta } from 'primeng/api' | |||
3 | import { Component, OnInit } from '@angular/core' | 3 | import { Component, OnInit } from '@angular/core' |
4 | import { ConfirmService, Notifier, RestPagination, RestTable, ServerService } from '@app/core' | 4 | import { ConfirmService, Notifier, RestPagination, RestTable, ServerService } from '@app/core' |
5 | import { BytesPipe, RedundancyService } from '@app/shared/shared-main' | 5 | import { BytesPipe, RedundancyService } from '@app/shared/shared-main' |
6 | import { VideoRedundanciesTarget, VideoRedundancy, VideosRedundancyStats } from '@peertube/peertube-models' | ||
6 | import { peertubeLocalStorage } from '@root-helpers/peertube-web-storage' | 7 | import { peertubeLocalStorage } from '@root-helpers/peertube-web-storage' |
7 | import { VideoRedundanciesTarget, VideoRedundancy } from '@shared/models' | ||
8 | import { VideosRedundancyStats } from '@shared/models/server' | ||
9 | 8 | ||
10 | @Component({ | 9 | @Component({ |
11 | selector: 'my-video-redundancies-list', | 10 | selector: 'my-video-redundancies-list', |
diff --git a/client/src/app/+admin/follows/video-redundancies-list/video-redundancy-information.component.ts b/client/src/app/+admin/follows/video-redundancies-list/video-redundancy-information.component.ts index 6f3090c08..779d19059 100644 --- a/client/src/app/+admin/follows/video-redundancies-list/video-redundancy-information.component.ts +++ b/client/src/app/+admin/follows/video-redundancies-list/video-redundancy-information.component.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { Component, Input } from '@angular/core' | 1 | import { Component, Input } from '@angular/core' |
2 | import { FileRedundancyInformation, StreamingPlaylistRedundancyInformation } from '@shared/models' | 2 | import { FileRedundancyInformation, StreamingPlaylistRedundancyInformation } from '@peertube/peertube-models' |
3 | 3 | ||
4 | @Component({ | 4 | @Component({ |
5 | selector: 'my-video-redundancy-information', | 5 | selector: 'my-video-redundancy-information', |
diff --git a/client/src/app/+admin/moderation/moderation.routes.ts b/client/src/app/+admin/moderation/moderation.routes.ts index 378d2bed7..f0494de7b 100644 --- a/client/src/app/+admin/moderation/moderation.routes.ts +++ b/client/src/app/+admin/moderation/moderation.routes.ts | |||
@@ -3,7 +3,7 @@ import { AbuseListComponent } from '@app/+admin/moderation/abuse-list' | |||
3 | import { InstanceAccountBlocklistComponent, InstanceServerBlocklistComponent } from '@app/+admin/moderation/instance-blocklist' | 3 | import { InstanceAccountBlocklistComponent, InstanceServerBlocklistComponent } from '@app/+admin/moderation/instance-blocklist' |
4 | import { VideoBlockListComponent } from '@app/+admin/moderation/video-block-list' | 4 | import { VideoBlockListComponent } from '@app/+admin/moderation/video-block-list' |
5 | import { UserRightGuard } from '@app/core' | 5 | import { UserRightGuard } from '@app/core' |
6 | import { UserRight } from '@shared/models' | 6 | import { UserRight } from '@peertube/peertube-models' |
7 | import { RegistrationListComponent } from './registration-list' | 7 | import { RegistrationListComponent } from './registration-list' |
8 | 8 | ||
9 | export const ModerationRoutes: Routes = [ | 9 | export const ModerationRoutes: Routes = [ |
diff --git a/client/src/app/+admin/moderation/registration-list/admin-registration.service.ts b/client/src/app/+admin/moderation/registration-list/admin-registration.service.ts index a9f13cf2f..f8ab04c71 100644 --- a/client/src/app/+admin/moderation/registration-list/admin-registration.service.ts +++ b/client/src/app/+admin/moderation/registration-list/admin-registration.service.ts | |||
@@ -4,8 +4,8 @@ import { catchError, concatMap, toArray } from 'rxjs/operators' | |||
4 | import { HttpClient, HttpParams } from '@angular/common/http' | 4 | import { HttpClient, HttpParams } from '@angular/common/http' |
5 | import { Injectable } from '@angular/core' | 5 | import { Injectable } from '@angular/core' |
6 | import { RestExtractor, RestPagination, RestService } from '@app/core' | 6 | import { RestExtractor, RestPagination, RestService } from '@app/core' |
7 | import { arrayify } from '@shared/core-utils' | 7 | import { arrayify } from '@peertube/peertube-core-utils' |
8 | import { ResultList, UserRegistration, UserRegistrationUpdateState } from '@shared/models' | 8 | import { ResultList, UserRegistration, UserRegistrationUpdateState } from '@peertube/peertube-models' |
9 | import { environment } from '../../../../environments/environment' | 9 | import { environment } from '../../../../environments/environment' |
10 | 10 | ||
11 | @Injectable() | 11 | @Injectable() |
diff --git a/client/src/app/+admin/moderation/registration-list/process-registration-modal.component.ts b/client/src/app/+admin/moderation/registration-list/process-registration-modal.component.ts index 8f013cbd5..f8e346f50 100644 --- a/client/src/app/+admin/moderation/registration-list/process-registration-modal.component.ts +++ b/client/src/app/+admin/moderation/registration-list/process-registration-modal.component.ts | |||
@@ -3,7 +3,7 @@ import { Notifier, ServerService } from '@app/core' | |||
3 | import { FormReactive, FormReactiveService } from '@app/shared/shared-forms' | 3 | import { FormReactive, FormReactiveService } from '@app/shared/shared-forms' |
4 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' | 4 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' |
5 | import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref' | 5 | import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref' |
6 | import { UserRegistration } from '@shared/models' | 6 | import { UserRegistration } from '@peertube/peertube-models' |
7 | import { AdminRegistrationService } from './admin-registration.service' | 7 | import { AdminRegistrationService } from './admin-registration.service' |
8 | import { REGISTRATION_MODERATION_RESPONSE_VALIDATOR } from './process-registration-validators' | 8 | import { REGISTRATION_MODERATION_RESPONSE_VALIDATOR } from './process-registration-validators' |
9 | 9 | ||
diff --git a/client/src/app/+admin/moderation/registration-list/registration-list.component.ts b/client/src/app/+admin/moderation/registration-list/registration-list.component.ts index 35d9d13d7..1dc5e9077 100644 --- a/client/src/app/+admin/moderation/registration-list/registration-list.component.ts +++ b/client/src/app/+admin/moderation/registration-list/registration-list.component.ts | |||
@@ -5,7 +5,7 @@ import { ConfirmService, MarkdownService, Notifier, RestPagination, RestTable, S | |||
5 | import { formatICU } from '@app/helpers' | 5 | import { formatICU } from '@app/helpers' |
6 | import { AdvancedInputFilter } from '@app/shared/shared-forms' | 6 | import { AdvancedInputFilter } from '@app/shared/shared-forms' |
7 | import { DropdownAction } from '@app/shared/shared-main' | 7 | import { DropdownAction } from '@app/shared/shared-main' |
8 | import { UserRegistration, UserRegistrationState } from '@shared/models' | 8 | import { UserRegistration, UserRegistrationState } from '@peertube/peertube-models' |
9 | import { AdminRegistrationService } from './admin-registration.service' | 9 | import { AdminRegistrationService } from './admin-registration.service' |
10 | import { ProcessRegistrationModalComponent } from './process-registration-modal.component' | 10 | import { ProcessRegistrationModalComponent } from './process-registration-modal.component' |
11 | 11 | ||
diff --git a/client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts b/client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts index f365a2500..3c6bda16c 100644 --- a/client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts +++ b/client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts | |||
@@ -7,9 +7,9 @@ import { ConfirmService, MarkdownService, Notifier, RestPagination, RestTable, S | |||
7 | import { AdvancedInputFilter } from '@app/shared/shared-forms' | 7 | import { AdvancedInputFilter } from '@app/shared/shared-forms' |
8 | import { DropdownAction, VideoService } from '@app/shared/shared-main' | 8 | import { DropdownAction, VideoService } from '@app/shared/shared-main' |
9 | import { VideoBlockService } from '@app/shared/shared-moderation' | 9 | import { VideoBlockService } from '@app/shared/shared-moderation' |
10 | import { buildVideoEmbedLink, decorateVideoLink } from '@peertube/peertube-core-utils' | ||
11 | import { VideoBlacklist, VideoBlacklistType, VideoBlacklistType_Type } from '@peertube/peertube-models' | ||
10 | import { buildVideoOrPlaylistEmbed } from '@root-helpers/video' | 12 | import { buildVideoOrPlaylistEmbed } from '@root-helpers/video' |
11 | import { buildVideoEmbedLink, decorateVideoLink } from '@shared/core-utils' | ||
12 | import { VideoBlacklist, VideoBlacklistType } from '@shared/models' | ||
13 | 13 | ||
14 | @Component({ | 14 | @Component({ |
15 | selector: 'my-video-block-list', | 15 | selector: 'my-video-block-list', |
@@ -21,7 +21,7 @@ export class VideoBlockListComponent extends RestTable implements OnInit { | |||
21 | totalRecords = 0 | 21 | totalRecords = 0 |
22 | sort: SortMeta = { field: 'createdAt', order: -1 } | 22 | sort: SortMeta = { field: 'createdAt', order: -1 } |
23 | pagination: RestPagination = { count: this.rowsPerPage, start: 0 } | 23 | pagination: RestPagination = { count: this.rowsPerPage, start: 0 } |
24 | blocklistTypeFilter: VideoBlacklistType = undefined | 24 | blocklistTypeFilter: VideoBlacklistType_Type |
25 | 25 | ||
26 | videoBlocklistActions: DropdownAction<VideoBlacklist>[][] = [] | 26 | videoBlocklistActions: DropdownAction<VideoBlacklist>[][] = [] |
27 | 27 | ||
diff --git a/client/src/app/+admin/overview/comments/video-comment-list.component.ts b/client/src/app/+admin/overview/comments/video-comment-list.component.ts index b77072665..254e76a60 100644 --- a/client/src/app/+admin/overview/comments/video-comment-list.component.ts +++ b/client/src/app/+admin/overview/comments/video-comment-list.component.ts | |||
@@ -6,7 +6,7 @@ import { AdvancedInputFilter } from '@app/shared/shared-forms' | |||
6 | import { DropdownAction } from '@app/shared/shared-main' | 6 | import { DropdownAction } from '@app/shared/shared-main' |
7 | import { BulkService } from '@app/shared/shared-moderation' | 7 | import { BulkService } from '@app/shared/shared-moderation' |
8 | import { VideoCommentAdmin, VideoCommentService } from '@app/shared/shared-video-comment' | 8 | import { VideoCommentAdmin, VideoCommentService } from '@app/shared/shared-video-comment' |
9 | import { FeedFormat, UserRight } from '@shared/models' | 9 | import { FeedFormat, UserRight } from '@peertube/peertube-models' |
10 | import { formatICU } from '@app/helpers' | 10 | import { formatICU } from '@app/helpers' |
11 | 11 | ||
12 | @Component({ | 12 | @Component({ |
diff --git a/client/src/app/+admin/overview/comments/video-comment.routes.ts b/client/src/app/+admin/overview/comments/video-comment.routes.ts index f0bd440ad..f67027430 100644 --- a/client/src/app/+admin/overview/comments/video-comment.routes.ts +++ b/client/src/app/+admin/overview/comments/video-comment.routes.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { Routes } from '@angular/router' | 1 | import { Routes } from '@angular/router' |
2 | import { UserRightGuard } from '@app/core' | 2 | import { UserRightGuard } from '@app/core' |
3 | import { UserRight } from '@shared/models' | 3 | import { UserRight } from '@peertube/peertube-models' |
4 | import { VideoCommentListComponent } from './video-comment-list.component' | 4 | import { VideoCommentListComponent } from './video-comment-list.component' |
5 | 5 | ||
6 | export const commentRoutes: Routes = [ | 6 | export const commentRoutes: Routes = [ |
diff --git a/client/src/app/+admin/overview/users/user-edit/user-create.component.ts b/client/src/app/+admin/overview/users/user-edit/user-create.component.ts index 0627aa887..77acb9988 100644 --- a/client/src/app/+admin/overview/users/user-edit/user-create.component.ts +++ b/client/src/app/+admin/overview/users/user-edit/user-create.component.ts | |||
@@ -14,7 +14,7 @@ import { | |||
14 | } from '@app/shared/form-validators/user-validators' | 14 | } from '@app/shared/form-validators/user-validators' |
15 | import { FormReactiveService } from '@app/shared/shared-forms' | 15 | import { FormReactiveService } from '@app/shared/shared-forms' |
16 | import { UserAdminService } from '@app/shared/shared-users' | 16 | import { UserAdminService } from '@app/shared/shared-users' |
17 | import { UserCreate, UserRole } from '@shared/models' | 17 | import { UserCreate, UserRole } from '@peertube/peertube-models' |
18 | import { UserEdit } from './user-edit' | 18 | import { UserEdit } from './user-edit' |
19 | 19 | ||
20 | @Component({ | 20 | @Component({ |
diff --git a/client/src/app/+admin/overview/users/user-edit/user-edit.ts b/client/src/app/+admin/overview/users/user-edit/user-edit.ts index 9547da2d1..d61b7b068 100644 --- a/client/src/app/+admin/overview/users/user-edit/user-edit.ts +++ b/client/src/app/+admin/overview/users/user-edit/user-edit.ts | |||
@@ -2,9 +2,8 @@ import { Directive, OnInit } from '@angular/core' | |||
2 | import { ConfigService } from '@app/+admin/config/shared/config.service' | 2 | import { ConfigService } from '@app/+admin/config/shared/config.service' |
3 | import { AuthService, ScreenService, ServerService, User } from '@app/core' | 3 | import { AuthService, ScreenService, ServerService, User } from '@app/core' |
4 | import { FormReactive } from '@app/shared/shared-forms' | 4 | import { FormReactive } from '@app/shared/shared-forms' |
5 | import { peertubeTranslate } from '@shared/core-utils' | 5 | import { peertubeTranslate, USER_ROLE_LABELS } from '@peertube/peertube-core-utils' |
6 | import { USER_ROLE_LABELS } from '@shared/core-utils/users' | 6 | import { HTMLServerConfig, UserAdminFlag, UserRole } from '@peertube/peertube-models' |
7 | import { HTMLServerConfig, UserAdminFlag, UserRole } from '@shared/models' | ||
8 | import { SelectOptionsItem } from '../../../../../types/select-options-item.model' | 7 | import { SelectOptionsItem } from '../../../../../types/select-options-item.model' |
9 | 8 | ||
10 | @Directive() | 9 | @Directive() |
diff --git a/client/src/app/+admin/overview/users/user-edit/user-password.component.ts b/client/src/app/+admin/overview/users/user-edit/user-password.component.ts index ec93619f5..af39c82af 100644 --- a/client/src/app/+admin/overview/users/user-edit/user-password.component.ts +++ b/client/src/app/+admin/overview/users/user-edit/user-password.component.ts | |||
@@ -3,7 +3,7 @@ import { Notifier } from '@app/core' | |||
3 | import { USER_PASSWORD_VALIDATOR } from '@app/shared/form-validators/user-validators' | 3 | import { USER_PASSWORD_VALIDATOR } from '@app/shared/form-validators/user-validators' |
4 | import { FormReactive, FormReactiveService } from '@app/shared/shared-forms' | 4 | import { FormReactive, FormReactiveService } from '@app/shared/shared-forms' |
5 | import { UserAdminService } from '@app/shared/shared-users' | 5 | import { UserAdminService } from '@app/shared/shared-users' |
6 | import { UserUpdate } from '@shared/models' | 6 | import { UserUpdate } from '@peertube/peertube-models' |
7 | 7 | ||
8 | @Component({ | 8 | @Component({ |
9 | selector: 'my-user-password', | 9 | selector: 'my-user-password', |
diff --git a/client/src/app/+admin/overview/users/user-edit/user-update.component.ts b/client/src/app/+admin/overview/users/user-edit/user-update.component.ts index 25d02f000..b55a519f3 100644 --- a/client/src/app/+admin/overview/users/user-edit/user-update.component.ts +++ b/client/src/app/+admin/overview/users/user-edit/user-update.component.ts | |||
@@ -11,7 +11,7 @@ import { | |||
11 | } from '@app/shared/form-validators/user-validators' | 11 | } from '@app/shared/form-validators/user-validators' |
12 | import { FormReactiveService } from '@app/shared/shared-forms' | 12 | import { FormReactiveService } from '@app/shared/shared-forms' |
13 | import { TwoFactorService, UserAdminService } from '@app/shared/shared-users' | 13 | import { TwoFactorService, UserAdminService } from '@app/shared/shared-users' |
14 | import { User as UserType, UserAdminFlag, UserRole, UserUpdate } from '@shared/models' | 14 | import { User as UserType, UserAdminFlag, UserRole, UserUpdate } from '@peertube/peertube-models' |
15 | import { UserEdit } from './user-edit' | 15 | import { UserEdit } from './user-edit' |
16 | 16 | ||
17 | @Component({ | 17 | @Component({ |
diff --git a/client/src/app/+admin/overview/users/user-list/user-list.component.ts b/client/src/app/+admin/overview/users/user-list/user-list.component.ts index 5d5abf6f4..a5a1552da 100644 --- a/client/src/app/+admin/overview/users/user-list/user-list.component.ts +++ b/client/src/app/+admin/overview/users/user-list/user-list.component.ts | |||
@@ -7,8 +7,8 @@ import { AdvancedInputFilter } from '@app/shared/shared-forms' | |||
7 | import { Actor, DropdownAction } from '@app/shared/shared-main' | 7 | import { Actor, DropdownAction } from '@app/shared/shared-main' |
8 | import { AccountMutedStatus, BlocklistService, UserBanModalComponent, UserModerationDisplayType } from '@app/shared/shared-moderation' | 8 | import { AccountMutedStatus, BlocklistService, UserBanModalComponent, UserModerationDisplayType } from '@app/shared/shared-moderation' |
9 | import { UserAdminService } from '@app/shared/shared-users' | 9 | import { UserAdminService } from '@app/shared/shared-users' |
10 | import { User, UserRole, UserRoleType } from '@peertube/peertube-models' | ||
10 | import { logger } from '@root-helpers/logger' | 11 | import { logger } from '@root-helpers/logger' |
11 | import { User, UserRole } from '@shared/models' | ||
12 | 12 | ||
13 | type UserForList = User & { | 13 | type UserForList = User & { |
14 | rawVideoQuota: number | 14 | rawVideoQuota: number |
@@ -166,7 +166,7 @@ export class UserListComponent extends RestTable <User> implements OnInit { | |||
166 | return 'UserListComponent' | 166 | return 'UserListComponent' |
167 | } | 167 | } |
168 | 168 | ||
169 | getRoleClass (role: UserRole) { | 169 | getRoleClass (role: UserRoleType) { |
170 | switch (role) { | 170 | switch (role) { |
171 | case UserRole.ADMINISTRATOR: | 171 | case UserRole.ADMINISTRATOR: |
172 | return 'badge-purple' | 172 | return 'badge-purple' |
diff --git a/client/src/app/+admin/overview/users/users.routes.ts b/client/src/app/+admin/overview/users/users.routes.ts index c9724e5fb..d66b8c762 100644 --- a/client/src/app/+admin/overview/users/users.routes.ts +++ b/client/src/app/+admin/overview/users/users.routes.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { Routes } from '@angular/router' | 1 | import { Routes } from '@angular/router' |
2 | import { UserRightGuard } from '@app/core' | 2 | import { UserRightGuard } from '@app/core' |
3 | import { UserRight } from '@shared/models' | 3 | import { UserRight } from '@peertube/peertube-models' |
4 | import { UserCreateComponent, UserUpdateComponent } from './user-edit' | 4 | import { UserCreateComponent, UserUpdateComponent } from './user-edit' |
5 | import { UserListComponent } from './user-list' | 5 | import { UserListComponent } from './user-list' |
6 | 6 | ||
diff --git a/client/src/app/+admin/overview/videos/video-admin.service.ts b/client/src/app/+admin/overview/videos/video-admin.service.ts index 722495706..9b33ed8e5 100644 --- a/client/src/app/+admin/overview/videos/video-admin.service.ts +++ b/client/src/app/+admin/overview/videos/video-admin.service.ts | |||
@@ -5,8 +5,8 @@ import { Injectable } from '@angular/core' | |||
5 | import { RestExtractor, RestPagination, RestService } from '@app/core' | 5 | import { RestExtractor, RestPagination, RestService } from '@app/core' |
6 | import { AdvancedInputFilter } from '@app/shared/shared-forms' | 6 | import { AdvancedInputFilter } from '@app/shared/shared-forms' |
7 | import { CommonVideoParams, Video, VideoService } from '@app/shared/shared-main' | 7 | import { CommonVideoParams, Video, VideoService } from '@app/shared/shared-main' |
8 | import { ResultList, VideoInclude, VideoPrivacy } from '@shared/models' | 8 | import { ResultList, VideoInclude, VideoPrivacy } from '@peertube/peertube-models' |
9 | import { getAllPrivacies } from '@shared/core-utils' | 9 | import { getAllPrivacies } from '@peertube/peertube-core-utils' |
10 | 10 | ||
11 | @Injectable() | 11 | @Injectable() |
12 | export class VideoAdminService { | 12 | export class VideoAdminService { |
diff --git a/client/src/app/+admin/overview/videos/video-list.component.ts b/client/src/app/+admin/overview/videos/video-list.component.ts index 2792a2d8a..2e12a2b31 100644 --- a/client/src/app/+admin/overview/videos/video-list.component.ts +++ b/client/src/app/+admin/overview/videos/video-list.component.ts | |||
@@ -8,8 +8,8 @@ import { AdvancedInputFilter } from '@app/shared/shared-forms' | |||
8 | import { DropdownAction, Video, VideoService } from '@app/shared/shared-main' | 8 | import { DropdownAction, Video, VideoService } from '@app/shared/shared-main' |
9 | import { VideoBlockComponent, VideoBlockService } from '@app/shared/shared-moderation' | 9 | import { VideoBlockComponent, VideoBlockService } from '@app/shared/shared-moderation' |
10 | import { VideoActionsDisplayType } from '@app/shared/shared-video-miniature' | 10 | import { VideoActionsDisplayType } from '@app/shared/shared-video-miniature' |
11 | import { getAllFiles } from '@shared/core-utils' | 11 | import { getAllFiles } from '@peertube/peertube-core-utils' |
12 | import { UserRight, VideoFile, VideoPrivacy, VideoState, VideoStreamingPlaylistType } from '@shared/models' | 12 | import { UserRight, VideoFile, VideoPrivacy, VideoState, VideoStreamingPlaylistType } from '@peertube/peertube-models' |
13 | import { VideoAdminService } from './video-admin.service' | 13 | import { VideoAdminService } from './video-admin.service' |
14 | 14 | ||
15 | @Component({ | 15 | @Component({ |
diff --git a/client/src/app/+admin/overview/videos/video.routes.ts b/client/src/app/+admin/overview/videos/video.routes.ts index 01cb5b497..dfffd2696 100644 --- a/client/src/app/+admin/overview/videos/video.routes.ts +++ b/client/src/app/+admin/overview/videos/video.routes.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { Routes } from '@angular/router' | 1 | import { Routes } from '@angular/router' |
2 | import { UserRightGuard } from '@app/core' | 2 | import { UserRightGuard } from '@app/core' |
3 | import { UserRight } from '@shared/models' | 3 | import { UserRight } from '@peertube/peertube-models' |
4 | import { VideoListComponent } from './video-list.component' | 4 | import { VideoListComponent } from './video-list.component' |
5 | 5 | ||
6 | export const videosRoutes: Routes = [ | 6 | export const videosRoutes: Routes = [ |
diff --git a/client/src/app/+admin/plugins/plugin-list-installed/plugin-list-installed.component.ts b/client/src/app/+admin/plugins/plugin-list-installed/plugin-list-installed.component.ts index 3fa1c56dc..1b78a00cd 100644 --- a/client/src/app/+admin/plugins/plugin-list-installed/plugin-list-installed.component.ts +++ b/client/src/app/+admin/plugins/plugin-list-installed/plugin-list-installed.component.ts | |||
@@ -4,8 +4,8 @@ import { ActivatedRoute, Router } from '@angular/router' | |||
4 | import { PluginApiService } from '@app/+admin/plugins/shared/plugin-api.service' | 4 | import { PluginApiService } from '@app/+admin/plugins/shared/plugin-api.service' |
5 | import { ComponentPagination, ConfirmService, hasMoreItems, Notifier } from '@app/core' | 5 | import { ComponentPagination, ConfirmService, hasMoreItems, Notifier } from '@app/core' |
6 | import { PluginService } from '@app/core/plugins/plugin.service' | 6 | import { PluginService } from '@app/core/plugins/plugin.service' |
7 | import { compareSemVer } from '@shared/core-utils' | 7 | import { compareSemVer } from '@peertube/peertube-core-utils' |
8 | import { PeerTubePlugin, PluginType } from '@shared/models' | 8 | import { PeerTubePlugin, PluginType, PluginType_Type } from '@peertube/peertube-models' |
9 | 9 | ||
10 | @Component({ | 10 | @Component({ |
11 | selector: 'my-plugin-list-installed', | 11 | selector: 'my-plugin-list-installed', |
@@ -13,7 +13,7 @@ import { PeerTubePlugin, PluginType } from '@shared/models' | |||
13 | styleUrls: [ './plugin-list-installed.component.scss' ] | 13 | styleUrls: [ './plugin-list-installed.component.scss' ] |
14 | }) | 14 | }) |
15 | export class PluginListInstalledComponent implements OnInit { | 15 | export class PluginListInstalledComponent implements OnInit { |
16 | pluginType: PluginType | 16 | pluginType: PluginType_Type |
17 | 17 | ||
18 | pagination: ComponentPagination = { | 18 | pagination: ComponentPagination = { |
19 | currentPage: 1, | 19 | currentPage: 1, |
@@ -48,7 +48,7 @@ export class PluginListInstalledComponent implements OnInit { | |||
48 | this.route.queryParams.subscribe(query => { | 48 | this.route.queryParams.subscribe(query => { |
49 | if (!query['pluginType']) return | 49 | if (!query['pluginType']) return |
50 | 50 | ||
51 | this.pluginType = parseInt(query['pluginType'], 10) | 51 | this.pluginType = parseInt(query['pluginType'], 10) as PluginType_Type |
52 | 52 | ||
53 | this.reloadPlugins() | 53 | this.reloadPlugins() |
54 | }) | 54 | }) |
diff --git a/client/src/app/+admin/plugins/plugin-search/plugin-search.component.ts b/client/src/app/+admin/plugins/plugin-search/plugin-search.component.ts index c03e37aa5..5539d1c13 100644 --- a/client/src/app/+admin/plugins/plugin-search/plugin-search.component.ts +++ b/client/src/app/+admin/plugins/plugin-search/plugin-search.component.ts | |||
@@ -4,8 +4,8 @@ import { Component, OnInit } from '@angular/core' | |||
4 | import { ActivatedRoute, Router } from '@angular/router' | 4 | import { ActivatedRoute, Router } from '@angular/router' |
5 | import { PluginApiService } from '@app/+admin/plugins/shared/plugin-api.service' | 5 | import { PluginApiService } from '@app/+admin/plugins/shared/plugin-api.service' |
6 | import { ComponentPagination, ConfirmService, hasMoreItems, Notifier, PluginService } from '@app/core' | 6 | import { ComponentPagination, ConfirmService, hasMoreItems, Notifier, PluginService } from '@app/core' |
7 | import { PeerTubePluginIndex, PluginType, PluginType_Type } from '@peertube/peertube-models' | ||
7 | import { logger } from '@root-helpers/logger' | 8 | import { logger } from '@root-helpers/logger' |
8 | import { PeerTubePluginIndex, PluginType } from '@shared/models' | ||
9 | 9 | ||
10 | @Component({ | 10 | @Component({ |
11 | selector: 'my-plugin-search', | 11 | selector: 'my-plugin-search', |
@@ -13,7 +13,7 @@ import { PeerTubePluginIndex, PluginType } from '@shared/models' | |||
13 | styleUrls: [ './plugin-search.component.scss' ] | 13 | styleUrls: [ './plugin-search.component.scss' ] |
14 | }) | 14 | }) |
15 | export class PluginSearchComponent implements OnInit { | 15 | export class PluginSearchComponent implements OnInit { |
16 | pluginType: PluginType | 16 | pluginType: PluginType_Type |
17 | 17 | ||
18 | pagination: ComponentPagination = { | 18 | pagination: ComponentPagination = { |
19 | currentPage: 1, | 19 | currentPage: 1, |
@@ -53,7 +53,7 @@ export class PluginSearchComponent implements OnInit { | |||
53 | this.route.queryParams.subscribe(query => { | 53 | this.route.queryParams.subscribe(query => { |
54 | if (!query['pluginType']) return | 54 | if (!query['pluginType']) return |
55 | 55 | ||
56 | this.pluginType = parseInt(query['pluginType'], 10) | 56 | this.pluginType = parseInt(query['pluginType'], 10) as PluginType_Type |
57 | this.search = query['search'] || '' | 57 | this.search = query['search'] || '' |
58 | 58 | ||
59 | this.reloadPlugins() | 59 | this.reloadPlugins() |
diff --git a/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.ts b/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.ts index b1a41567e..9eee1a901 100644 --- a/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.ts +++ b/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.ts | |||
@@ -5,7 +5,7 @@ import { ActivatedRoute } from '@angular/router' | |||
5 | import { HooksService, Notifier, PluginService } from '@app/core' | 5 | import { HooksService, Notifier, PluginService } from '@app/core' |
6 | import { BuildFormArgument } from '@app/shared/form-validators' | 6 | import { BuildFormArgument } from '@app/shared/form-validators' |
7 | import { FormReactive, FormReactiveService } from '@app/shared/shared-forms' | 7 | import { FormReactive, FormReactiveService } from '@app/shared/shared-forms' |
8 | import { PeerTubePlugin, RegisterServerSettingOptions } from '@shared/models' | 8 | import { PeerTubePlugin, RegisterServerSettingOptions } from '@peertube/peertube-models' |
9 | import { PluginApiService } from '../shared/plugin-api.service' | 9 | import { PluginApiService } from '../shared/plugin-api.service' |
10 | 10 | ||
11 | @Component({ | 11 | @Component({ |
diff --git a/client/src/app/+admin/plugins/plugins.routes.ts b/client/src/app/+admin/plugins/plugins.routes.ts index f735a490b..40660f1f4 100644 --- a/client/src/app/+admin/plugins/plugins.routes.ts +++ b/client/src/app/+admin/plugins/plugins.routes.ts | |||
@@ -3,7 +3,7 @@ import { PluginListInstalledComponent } from '@app/+admin/plugins/plugin-list-in | |||
3 | import { PluginSearchComponent } from '@app/+admin/plugins/plugin-search/plugin-search.component' | 3 | import { PluginSearchComponent } from '@app/+admin/plugins/plugin-search/plugin-search.component' |
4 | import { PluginShowInstalledComponent } from '@app/+admin/plugins/plugin-show-installed/plugin-show-installed.component' | 4 | import { PluginShowInstalledComponent } from '@app/+admin/plugins/plugin-show-installed/plugin-show-installed.component' |
5 | import { UserRightGuard } from '@app/core' | 5 | import { UserRightGuard } from '@app/core' |
6 | import { UserRight } from '@shared/models' | 6 | import { UserRight } from '@peertube/peertube-models' |
7 | 7 | ||
8 | export const PluginsRoutes: Routes = [ | 8 | export const PluginsRoutes: Routes = [ |
9 | { | 9 | { |
diff --git a/client/src/app/+admin/plugins/shared/plugin-api.service.ts b/client/src/app/+admin/plugins/shared/plugin-api.service.ts index fbfdaea18..e1bd2f125 100644 --- a/client/src/app/+admin/plugins/shared/plugin-api.service.ts +++ b/client/src/app/+admin/plugins/shared/plugin-api.service.ts | |||
@@ -9,9 +9,10 @@ import { | |||
9 | PeerTubePlugin, | 9 | PeerTubePlugin, |
10 | PeerTubePluginIndex, | 10 | PeerTubePluginIndex, |
11 | PluginType, | 11 | PluginType, |
12 | PluginType_Type, | ||
12 | RegisteredServerSettings, | 13 | RegisteredServerSettings, |
13 | ResultList | 14 | ResultList |
14 | } from '@shared/models' | 15 | } from '@peertube/peertube-models' |
15 | import { environment } from '../../../../environments/environment' | 16 | import { environment } from '../../../../environments/environment' |
16 | 17 | ||
17 | @Injectable() | 18 | @Injectable() |
@@ -25,7 +26,7 @@ export class PluginApiService { | |||
25 | private pluginService: PluginService | 26 | private pluginService: PluginService |
26 | ) { } | 27 | ) { } |
27 | 28 | ||
28 | getPluginTypeLabel (type: PluginType) { | 29 | getPluginTypeLabel (type: PluginType_Type) { |
29 | if (type === PluginType.PLUGIN) { | 30 | if (type === PluginType.PLUGIN) { |
30 | return $localize`plugin` | 31 | return $localize`plugin` |
31 | } | 32 | } |
@@ -34,7 +35,7 @@ export class PluginApiService { | |||
34 | } | 35 | } |
35 | 36 | ||
36 | getPlugins ( | 37 | getPlugins ( |
37 | pluginType: PluginType, | 38 | pluginType: PluginType_Type, |
38 | componentPagination: ComponentPagination, | 39 | componentPagination: ComponentPagination, |
39 | sort: string | 40 | sort: string |
40 | ) { | 41 | ) { |
@@ -49,7 +50,7 @@ export class PluginApiService { | |||
49 | } | 50 | } |
50 | 51 | ||
51 | searchAvailablePlugins ( | 52 | searchAvailablePlugins ( |
52 | pluginType: PluginType, | 53 | pluginType: PluginType_Type, |
53 | componentPagination: ComponentPagination, | 54 | componentPagination: ComponentPagination, |
54 | sort: string, | 55 | sort: string, |
55 | search?: string | 56 | search?: string |
@@ -73,7 +74,7 @@ export class PluginApiService { | |||
73 | .pipe(catchError(res => this.restExtractor.handleError(res))) | 74 | .pipe(catchError(res => this.restExtractor.handleError(res))) |
74 | } | 75 | } |
75 | 76 | ||
76 | getPluginRegisteredSettings (pluginName: string, pluginType: PluginType) { | 77 | getPluginRegisteredSettings (pluginName: string, pluginType: PluginType_Type) { |
77 | const npmName = this.pluginService.nameToNpmName(pluginName, pluginType) | 78 | const npmName = this.pluginService.nameToNpmName(pluginName, pluginType) |
78 | const path = PluginApiService.BASE_PLUGIN_URL + '/' + npmName + '/registered-settings' | 79 | const path = PluginApiService.BASE_PLUGIN_URL + '/' + npmName + '/registered-settings' |
79 | 80 | ||
@@ -83,7 +84,7 @@ export class PluginApiService { | |||
83 | ) | 84 | ) |
84 | } | 85 | } |
85 | 86 | ||
86 | updatePluginSettings (pluginName: string, pluginType: PluginType, settings: any) { | 87 | updatePluginSettings (pluginName: string, pluginType: PluginType_Type, settings: any) { |
87 | const npmName = this.pluginService.nameToNpmName(pluginName, pluginType) | 88 | const npmName = this.pluginService.nameToNpmName(pluginName, pluginType) |
88 | const path = PluginApiService.BASE_PLUGIN_URL + '/' + npmName + '/settings' | 89 | const path = PluginApiService.BASE_PLUGIN_URL + '/' + npmName + '/settings' |
89 | 90 | ||
@@ -91,7 +92,7 @@ export class PluginApiService { | |||
91 | .pipe(catchError(res => this.restExtractor.handleError(res))) | 92 | .pipe(catchError(res => this.restExtractor.handleError(res))) |
92 | } | 93 | } |
93 | 94 | ||
94 | uninstall (pluginName: string, pluginType: PluginType) { | 95 | uninstall (pluginName: string, pluginType: PluginType_Type) { |
95 | const body: ManagePlugin = { | 96 | const body: ManagePlugin = { |
96 | npmName: this.pluginService.nameToNpmName(pluginName, pluginType) | 97 | npmName: this.pluginService.nameToNpmName(pluginName, pluginType) |
97 | } | 98 | } |
@@ -100,7 +101,7 @@ export class PluginApiService { | |||
100 | .pipe(catchError(res => this.restExtractor.handleError(res))) | 101 | .pipe(catchError(res => this.restExtractor.handleError(res))) |
101 | } | 102 | } |
102 | 103 | ||
103 | update (pluginName: string, pluginType: PluginType) { | 104 | update (pluginName: string, pluginType: PluginType_Type) { |
104 | const body: ManagePlugin = { | 105 | const body: ManagePlugin = { |
105 | npmName: this.pluginService.nameToNpmName(pluginName, pluginType) | 106 | npmName: this.pluginService.nameToNpmName(pluginName, pluginType) |
106 | } | 107 | } |
@@ -118,7 +119,7 @@ export class PluginApiService { | |||
118 | .pipe(catchError(res => this.restExtractor.handleError(res))) | 119 | .pipe(catchError(res => this.restExtractor.handleError(res))) |
119 | } | 120 | } |
120 | 121 | ||
121 | getPluginOrThemeHref (type: PluginType, name: string) { | 122 | getPluginOrThemeHref (type: PluginType_Type, name: string) { |
122 | const typeString = type === PluginType.PLUGIN | 123 | const typeString = type === PluginType.PLUGIN |
123 | ? 'plugin' | 124 | ? 'plugin' |
124 | : 'theme' | 125 | : 'theme' |
diff --git a/client/src/app/+admin/plugins/shared/plugin-card.component.ts b/client/src/app/+admin/plugins/shared/plugin-card.component.ts index 462a6c213..ae91f6887 100644 --- a/client/src/app/+admin/plugins/shared/plugin-card.component.ts +++ b/client/src/app/+admin/plugins/shared/plugin-card.component.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { Component, Input } from '@angular/core' | 1 | import { Component, Input } from '@angular/core' |
2 | import { PeerTubePlugin, PeerTubePluginIndex, PluginType } from '@shared/models' | 2 | import { PeerTubePlugin, PeerTubePluginIndex, PluginType_Type } from '@peertube/peertube-models' |
3 | import { PluginApiService } from './plugin-api.service' | 3 | import { PluginApiService } from './plugin-api.service' |
4 | 4 | ||
5 | @Component({ | 5 | @Component({ |
@@ -11,7 +11,7 @@ import { PluginApiService } from './plugin-api.service' | |||
11 | export class PluginCardComponent { | 11 | export class PluginCardComponent { |
12 | @Input() plugin: PeerTubePluginIndex | PeerTubePlugin | 12 | @Input() plugin: PeerTubePluginIndex | PeerTubePlugin |
13 | @Input() version: string | 13 | @Input() version: string |
14 | @Input() pluginType: PluginType | 14 | @Input() pluginType: PluginType_Type |
15 | 15 | ||
16 | constructor ( | 16 | constructor ( |
17 | private pluginApiService: PluginApiService | 17 | private pluginApiService: PluginApiService |
diff --git a/client/src/app/+admin/plugins/shared/plugin-navigation.component.ts b/client/src/app/+admin/plugins/shared/plugin-navigation.component.ts index 1c963f521..c829bc975 100644 --- a/client/src/app/+admin/plugins/shared/plugin-navigation.component.ts +++ b/client/src/app/+admin/plugins/shared/plugin-navigation.component.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { Component, Input } from '@angular/core' | 1 | import { Component, Input } from '@angular/core' |
2 | import { PluginType } from '@shared/models/plugins' | 2 | import { PluginType_Type } from '@peertube/peertube-models' |
3 | 3 | ||
4 | @Component({ | 4 | @Component({ |
5 | selector: 'my-plugin-navigation', | 5 | selector: 'my-plugin-navigation', |
@@ -7,5 +7,5 @@ import { PluginType } from '@shared/models/plugins' | |||
7 | styleUrls: [ './plugin-navigation.component.scss' ] | 7 | styleUrls: [ './plugin-navigation.component.scss' ] |
8 | }) | 8 | }) |
9 | export class PluginNavigationComponent { | 9 | export class PluginNavigationComponent { |
10 | @Input() pluginType: PluginType | 10 | @Input() pluginType: PluginType_Type |
11 | } | 11 | } |
diff --git a/client/src/app/+admin/shared/user-email-info.component.ts b/client/src/app/+admin/shared/user-email-info.component.ts index e33948b60..0af905c84 100644 --- a/client/src/app/+admin/shared/user-email-info.component.ts +++ b/client/src/app/+admin/shared/user-email-info.component.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { Component, Input } from '@angular/core' | 1 | import { Component, Input } from '@angular/core' |
2 | import { User, UserRegistration } from '@shared/models/users' | 2 | import { User, UserRegistration } from '@peertube/peertube-models' |
3 | 3 | ||
4 | @Component({ | 4 | @Component({ |
5 | selector: 'my-user-email-info', | 5 | selector: 'my-user-email-info', |
diff --git a/client/src/app/+admin/shared/user-real-quota-info.component.ts b/client/src/app/+admin/shared/user-real-quota-info.component.ts index 0a342c799..dd78fa9f0 100644 --- a/client/src/app/+admin/shared/user-real-quota-info.component.ts +++ b/client/src/app/+admin/shared/user-real-quota-info.component.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { Component, Input, OnInit } from '@angular/core' | 1 | import { Component, Input, OnInit } from '@angular/core' |
2 | import { ServerService } from '@app/core' | 2 | import { ServerService } from '@app/core' |
3 | import { HTMLServerConfig, VideoResolution } from '@shared/models/index' | 3 | import { HTMLServerConfig, VideoResolution } from '@peertube/peertube-models' |
4 | 4 | ||
5 | @Component({ | 5 | @Component({ |
6 | selector: 'my-user-real-quota-info', | 6 | selector: 'my-user-real-quota-info', |
diff --git a/client/src/app/+admin/system/debug/debug.component.ts b/client/src/app/+admin/system/debug/debug.component.ts index 1f4e71e8a..5c86803ef 100644 --- a/client/src/app/+admin/system/debug/debug.component.ts +++ b/client/src/app/+admin/system/debug/debug.component.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { Component, OnInit } from '@angular/core' | 1 | import { Component, OnInit } from '@angular/core' |
2 | import { Notifier } from '@app/core' | 2 | import { Notifier } from '@app/core' |
3 | import { Debug } from '@shared/models' | 3 | import { Debug } from '@peertube/peertube-models' |
4 | import { DebugService } from './debug.service' | 4 | import { DebugService } from './debug.service' |
5 | 5 | ||
6 | @Component({ | 6 | @Component({ |
diff --git a/client/src/app/+admin/system/debug/debug.service.ts b/client/src/app/+admin/system/debug/debug.service.ts index ab1d0a7fa..24d3b2ab8 100644 --- a/client/src/app/+admin/system/debug/debug.service.ts +++ b/client/src/app/+admin/system/debug/debug.service.ts | |||
@@ -3,7 +3,7 @@ import { catchError } from 'rxjs/operators' | |||
3 | import { HttpClient } from '@angular/common/http' | 3 | import { HttpClient } from '@angular/common/http' |
4 | import { Injectable } from '@angular/core' | 4 | import { Injectable } from '@angular/core' |
5 | import { RestExtractor } from '@app/core' | 5 | import { RestExtractor } from '@app/core' |
6 | import { Debug } from '@shared/models' | 6 | import { Debug } from '@peertube/peertube-models' |
7 | import { environment } from '../../../../environments/environment' | 7 | import { environment } from '../../../../environments/environment' |
8 | 8 | ||
9 | @Injectable() | 9 | @Injectable() |
diff --git a/client/src/app/+admin/system/jobs/job.service.ts b/client/src/app/+admin/system/jobs/job.service.ts index 031e2bad8..eae1dea7d 100644 --- a/client/src/app/+admin/system/jobs/job.service.ts +++ b/client/src/app/+admin/system/jobs/job.service.ts | |||
@@ -4,7 +4,7 @@ import { catchError, map } from 'rxjs/operators' | |||
4 | import { HttpClient, HttpParams } from '@angular/common/http' | 4 | import { HttpClient, HttpParams } from '@angular/common/http' |
5 | import { Injectable } from '@angular/core' | 5 | import { Injectable } from '@angular/core' |
6 | import { RestExtractor, RestPagination, RestService } from '@app/core' | 6 | import { RestExtractor, RestPagination, RestService } from '@app/core' |
7 | import { Job, ResultList } from '@shared/models' | 7 | import { Job, ResultList } from '@peertube/peertube-models' |
8 | import { environment } from '../../../../environments/environment' | 8 | import { environment } from '../../../../environments/environment' |
9 | import { JobStateClient } from '../../../../types/job-state-client.type' | 9 | import { JobStateClient } from '../../../../types/job-state-client.type' |
10 | import { JobTypeClient } from '../../../../types/job-type-client.type' | 10 | import { JobTypeClient } from '../../../../types/job-type-client.type' |
diff --git a/client/src/app/+admin/system/jobs/jobs.component.ts b/client/src/app/+admin/system/jobs/jobs.component.ts index 6e10c81ff..4e6b4bf7b 100644 --- a/client/src/app/+admin/system/jobs/jobs.component.ts +++ b/client/src/app/+admin/system/jobs/jobs.component.ts | |||
@@ -1,9 +1,9 @@ | |||
1 | import { SortMeta } from 'primeng/api' | 1 | import { SortMeta } from 'primeng/api' |
2 | import { Component, OnInit } from '@angular/core' | 2 | import { Component, OnInit } from '@angular/core' |
3 | import { Notifier, RestPagination, RestTable } from '@app/core' | 3 | import { Notifier, RestPagination, RestTable } from '@app/core' |
4 | import { escapeHTML } from '@peertube/peertube-core-utils' | ||
5 | import { Job, JobState, JobType } from '@peertube/peertube-models' | ||
4 | import { peertubeLocalStorage } from '@root-helpers/peertube-web-storage' | 6 | import { peertubeLocalStorage } from '@root-helpers/peertube-web-storage' |
5 | import { escapeHTML } from '@shared/core-utils/renderer' | ||
6 | import { Job, JobState, JobType } from '@shared/models' | ||
7 | import { JobStateClient } from '../../../../types/job-state-client.type' | 7 | import { JobStateClient } from '../../../../types/job-state-client.type' |
8 | import { JobTypeClient } from '../../../../types/job-type-client.type' | 8 | import { JobTypeClient } from '../../../../types/job-type-client.type' |
9 | import { JobService } from './job.service' | 9 | import { JobService } from './job.service' |
diff --git a/client/src/app/+admin/system/logs/log-row.model.ts b/client/src/app/+admin/system/logs/log-row.model.ts index e83c7b064..15799e8b0 100644 --- a/client/src/app/+admin/system/logs/log-row.model.ts +++ b/client/src/app/+admin/system/logs/log-row.model.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import omit from 'lodash-es/omit' | 1 | import omit from 'lodash-es/omit' |
2 | import { logger } from '@root-helpers/logger' | 2 | import { logger } from '@root-helpers/logger' |
3 | import { ServerLogLevel } from '@shared/models' | 3 | import { ServerLogLevel } from '@peertube/peertube-models' |
4 | 4 | ||
5 | export class LogRow { | 5 | export class LogRow { |
6 | date: Date | 6 | date: Date |
diff --git a/client/src/app/+admin/system/logs/logs.component.ts b/client/src/app/+admin/system/logs/logs.component.ts index 939e710d7..22375fcd9 100644 --- a/client/src/app/+admin/system/logs/logs.component.ts +++ b/client/src/app/+admin/system/logs/logs.component.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { Component, ElementRef, OnInit, ViewChild } from '@angular/core' | 1 | import { Component, ElementRef, OnInit, ViewChild } from '@angular/core' |
2 | import { LocalStorageService, Notifier } from '@app/core' | 2 | import { LocalStorageService, Notifier } from '@app/core' |
3 | import { ServerLogLevel } from '@shared/models' | 3 | import { ServerLogLevel } from '@peertube/peertube-models' |
4 | import { LogRow } from './log-row.model' | 4 | import { LogRow } from './log-row.model' |
5 | import { LogsService } from './logs.service' | 5 | import { LogsService } from './logs.service' |
6 | 6 | ||
diff --git a/client/src/app/+admin/system/logs/logs.service.ts b/client/src/app/+admin/system/logs/logs.service.ts index 933a074a8..9e774d7fd 100644 --- a/client/src/app/+admin/system/logs/logs.service.ts +++ b/client/src/app/+admin/system/logs/logs.service.ts | |||
@@ -3,7 +3,7 @@ import { catchError, map } from 'rxjs/operators' | |||
3 | import { HttpClient, HttpParams } from '@angular/common/http' | 3 | import { HttpClient, HttpParams } from '@angular/common/http' |
4 | import { Injectable } from '@angular/core' | 4 | import { Injectable } from '@angular/core' |
5 | import { RestExtractor, RestService } from '@app/core' | 5 | import { RestExtractor, RestService } from '@app/core' |
6 | import { ServerLogLevel } from '@shared/models' | 6 | import { ServerLogLevel } from '@peertube/peertube-models' |
7 | import { environment } from '../../../../environments/environment' | 7 | import { environment } from '../../../../environments/environment' |
8 | import { LogRow } from './log-row.model' | 8 | import { LogRow } from './log-row.model' |
9 | 9 | ||
diff --git a/client/src/app/+admin/system/runners/runner-job-list/runner-job-list.component.ts b/client/src/app/+admin/system/runners/runner-job-list/runner-job-list.component.ts index 2670eac86..e75446d8c 100644 --- a/client/src/app/+admin/system/runners/runner-job-list/runner-job-list.component.ts +++ b/client/src/app/+admin/system/runners/runner-job-list/runner-job-list.component.ts | |||
@@ -3,7 +3,7 @@ import { Component, OnInit } from '@angular/core' | |||
3 | import { ConfirmService, Notifier, RestPagination, RestTable } from '@app/core' | 3 | import { ConfirmService, Notifier, RestPagination, RestTable } from '@app/core' |
4 | import { formatICU } from '@app/helpers' | 4 | import { formatICU } from '@app/helpers' |
5 | import { DropdownAction } from '@app/shared/shared-main' | 5 | import { DropdownAction } from '@app/shared/shared-main' |
6 | import { RunnerJob, RunnerJobState } from '@shared/models' | 6 | import { RunnerJob, RunnerJobState } from '@peertube/peertube-models' |
7 | import { RunnerJobFormatted, RunnerService } from '../runner.service' | 7 | import { RunnerJobFormatted, RunnerService } from '../runner.service' |
8 | import { AdvancedInputFilter } from '@app/shared/shared-forms' | 8 | import { AdvancedInputFilter } from '@app/shared/shared-forms' |
9 | 9 | ||
diff --git a/client/src/app/+admin/system/runners/runner-list/runner-list.component.ts b/client/src/app/+admin/system/runners/runner-list/runner-list.component.ts index 7566f967e..0964471f9 100644 --- a/client/src/app/+admin/system/runners/runner-list/runner-list.component.ts +++ b/client/src/app/+admin/system/runners/runner-list/runner-list.component.ts | |||
@@ -2,7 +2,7 @@ import { SortMeta } from 'primeng/api' | |||
2 | import { Component, OnInit } from '@angular/core' | 2 | import { Component, OnInit } from '@angular/core' |
3 | import { ConfirmService, Notifier, RestPagination, RestTable } from '@app/core' | 3 | import { ConfirmService, Notifier, RestPagination, RestTable } from '@app/core' |
4 | import { DropdownAction } from '@app/shared/shared-main' | 4 | import { DropdownAction } from '@app/shared/shared-main' |
5 | import { Runner } from '@shared/models' | 5 | import { Runner } from '@peertube/peertube-models' |
6 | import { RunnerService } from '../runner.service' | 6 | import { RunnerService } from '../runner.service' |
7 | 7 | ||
8 | @Component({ | 8 | @Component({ |
diff --git a/client/src/app/+admin/system/runners/runner-registration-token-list/runner-registration-token-list.component.ts b/client/src/app/+admin/system/runners/runner-registration-token-list/runner-registration-token-list.component.ts index 77908a2e1..c8a597b18 100644 --- a/client/src/app/+admin/system/runners/runner-registration-token-list/runner-registration-token-list.component.ts +++ b/client/src/app/+admin/system/runners/runner-registration-token-list/runner-registration-token-list.component.ts | |||
@@ -2,7 +2,7 @@ import { SortMeta } from 'primeng/api' | |||
2 | import { Component, OnInit } from '@angular/core' | 2 | import { Component, OnInit } from '@angular/core' |
3 | import { ConfirmService, Notifier, RestPagination, RestTable } from '@app/core' | 3 | import { ConfirmService, Notifier, RestPagination, RestTable } from '@app/core' |
4 | import { DropdownAction } from '@app/shared/shared-main' | 4 | import { DropdownAction } from '@app/shared/shared-main' |
5 | import { RunnerRegistrationToken } from '@shared/models' | 5 | import { RunnerRegistrationToken } from '@peertube/peertube-models' |
6 | import { RunnerService } from '../runner.service' | 6 | import { RunnerService } from '../runner.service' |
7 | 7 | ||
8 | @Component({ | 8 | @Component({ |
diff --git a/client/src/app/+admin/system/runners/runner.service.ts b/client/src/app/+admin/system/runners/runner.service.ts index 3ab36c4ff..94bdaad78 100644 --- a/client/src/app/+admin/system/runners/runner.service.ts +++ b/client/src/app/+admin/system/runners/runner.service.ts | |||
@@ -4,9 +4,8 @@ import { catchError, concatMap, forkJoin, from, map, toArray } from 'rxjs' | |||
4 | import { HttpClient, HttpParams } from '@angular/common/http' | 4 | import { HttpClient, HttpParams } from '@angular/common/http' |
5 | import { Injectable } from '@angular/core' | 5 | import { Injectable } from '@angular/core' |
6 | import { RestExtractor, RestPagination, RestService, ServerService } from '@app/core' | 6 | import { RestExtractor, RestPagination, RestService, ServerService } from '@app/core' |
7 | import { arrayify, peertubeTranslate } from '@shared/core-utils' | 7 | import { arrayify, peertubeTranslate } from '@peertube/peertube-core-utils' |
8 | import { ResultList } from '@shared/models/common' | 8 | import { ResultList, Runner, RunnerJob, RunnerJobAdmin, RunnerJobState, RunnerRegistrationToken } from '@peertube/peertube-models' |
9 | import { Runner, RunnerJob, RunnerJobAdmin, RunnerJobState, RunnerRegistrationToken } from '@shared/models/runners' | ||
10 | import { environment } from '../../../../environments/environment' | 9 | import { environment } from '../../../../environments/environment' |
11 | 10 | ||
12 | export type RunnerJobFormatted = RunnerJob & { | 11 | export type RunnerJobFormatted = RunnerJob & { |
diff --git a/client/src/app/+admin/system/runners/runners.routes.ts b/client/src/app/+admin/system/runners/runners.routes.ts index fabe687d6..004c3bedd 100644 --- a/client/src/app/+admin/system/runners/runners.routes.ts +++ b/client/src/app/+admin/system/runners/runners.routes.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { Routes } from '@angular/router' | 1 | import { Routes } from '@angular/router' |
2 | import { UserRightGuard } from '@app/core' | 2 | import { UserRightGuard } from '@app/core' |
3 | import { UserRight } from '@shared/models' | 3 | import { UserRight } from '@peertube/peertube-models' |
4 | import { RunnerJobListComponent } from './runner-job-list' | 4 | import { RunnerJobListComponent } from './runner-job-list' |
5 | import { RunnerListComponent } from './runner-list' | 5 | import { RunnerListComponent } from './runner-list' |
6 | import { RunnerRegistrationTokenListComponent } from './runner-registration-token-list' | 6 | import { RunnerRegistrationTokenListComponent } from './runner-registration-token-list' |
diff --git a/client/src/app/+admin/system/system.routes.ts b/client/src/app/+admin/system/system.routes.ts index 87e4b25b3..169d52952 100644 --- a/client/src/app/+admin/system/system.routes.ts +++ b/client/src/app/+admin/system/system.routes.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { Routes } from '@angular/router' | 1 | import { Routes } from '@angular/router' |
2 | import { UserRightGuard } from '@app/core' | 2 | import { UserRightGuard } from '@app/core' |
3 | import { UserRight } from '@shared/models' | 3 | import { UserRight } from '@peertube/peertube-models' |
4 | import { DebugComponent } from './debug' | 4 | import { DebugComponent } from './debug' |
5 | import { JobsComponent } from './jobs/jobs.component' | 5 | import { JobsComponent } from './jobs/jobs.component' |
6 | import { LogsComponent } from './logs' | 6 | import { LogsComponent } from './logs' |