aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-07-31 14:34:36 +0200
committerChocobozzz <me@florianbigard.com>2023-08-11 15:02:33 +0200
commit3a4992633ee62d5edfbb484d9c6bcb3cf158489d (patch)
treee4510b39bdac9c318fdb4b47018d08f15368b8f0 /client/src/app/+admin
parent04d1da5621d25d59bd5fa1543b725c497bf5d9a8 (diff)
downloadPeerTube-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')
-rw-r--r--client/src/app/+admin/admin.component.ts2
-rw-r--r--client/src/app/+admin/config/config.routes.ts2
-rw-r--r--client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.ts2
-rw-r--r--client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts2
-rw-r--r--client/src/app/+admin/config/edit-custom-config/edit-live-configuration.component.ts2
-rw-r--r--client/src/app/+admin/config/edit-custom-config/edit-vod-transcoding.component.ts2
-rw-r--r--client/src/app/+admin/config/shared/config.service.ts2
-rw-r--r--client/src/app/+admin/follows/followers-list/followers-list.component.ts2
-rw-r--r--client/src/app/+admin/follows/following-list/following-list.component.ts2
-rw-r--r--client/src/app/+admin/follows/follows.routes.ts2
-rw-r--r--client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.ts3
-rw-r--r--client/src/app/+admin/follows/video-redundancies-list/video-redundancy-information.component.ts2
-rw-r--r--client/src/app/+admin/moderation/moderation.routes.ts2
-rw-r--r--client/src/app/+admin/moderation/registration-list/admin-registration.service.ts4
-rw-r--r--client/src/app/+admin/moderation/registration-list/process-registration-modal.component.ts2
-rw-r--r--client/src/app/+admin/moderation/registration-list/registration-list.component.ts2
-rw-r--r--client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts6
-rw-r--r--client/src/app/+admin/overview/comments/video-comment-list.component.ts2
-rw-r--r--client/src/app/+admin/overview/comments/video-comment.routes.ts2
-rw-r--r--client/src/app/+admin/overview/users/user-edit/user-create.component.ts2
-rw-r--r--client/src/app/+admin/overview/users/user-edit/user-edit.ts5
-rw-r--r--client/src/app/+admin/overview/users/user-edit/user-password.component.ts2
-rw-r--r--client/src/app/+admin/overview/users/user-edit/user-update.component.ts2
-rw-r--r--client/src/app/+admin/overview/users/user-list/user-list.component.ts4
-rw-r--r--client/src/app/+admin/overview/users/users.routes.ts2
-rw-r--r--client/src/app/+admin/overview/videos/video-admin.service.ts4
-rw-r--r--client/src/app/+admin/overview/videos/video-list.component.ts4
-rw-r--r--client/src/app/+admin/overview/videos/video.routes.ts2
-rw-r--r--client/src/app/+admin/plugins/plugin-list-installed/plugin-list-installed.component.ts8
-rw-r--r--client/src/app/+admin/plugins/plugin-search/plugin-search.component.ts6
-rw-r--r--client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.ts2
-rw-r--r--client/src/app/+admin/plugins/plugins.routes.ts2
-rw-r--r--client/src/app/+admin/plugins/shared/plugin-api.service.ts19
-rw-r--r--client/src/app/+admin/plugins/shared/plugin-card.component.ts4
-rw-r--r--client/src/app/+admin/plugins/shared/plugin-navigation.component.ts4
-rw-r--r--client/src/app/+admin/shared/user-email-info.component.ts2
-rw-r--r--client/src/app/+admin/shared/user-real-quota-info.component.ts2
-rw-r--r--client/src/app/+admin/system/debug/debug.component.ts2
-rw-r--r--client/src/app/+admin/system/debug/debug.service.ts2
-rw-r--r--client/src/app/+admin/system/jobs/job.service.ts2
-rw-r--r--client/src/app/+admin/system/jobs/jobs.component.ts4
-rw-r--r--client/src/app/+admin/system/logs/log-row.model.ts2
-rw-r--r--client/src/app/+admin/system/logs/logs.component.ts2
-rw-r--r--client/src/app/+admin/system/logs/logs.service.ts2
-rw-r--r--client/src/app/+admin/system/runners/runner-job-list/runner-job-list.component.ts2
-rw-r--r--client/src/app/+admin/system/runners/runner-list/runner-list.component.ts2
-rw-r--r--client/src/app/+admin/system/runners/runner-registration-token-list/runner-registration-token-list.component.ts2
-rw-r--r--client/src/app/+admin/system/runners/runner.service.ts5
-rw-r--r--client/src/app/+admin/system/runners/runners.routes.ts2
-rw-r--r--client/src/app/+admin/system/system.routes.ts2
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'
2import { AuthService, ScreenService, ServerService } from '@app/core' 2import { AuthService, ScreenService, ServerService } from '@app/core'
3import { ListOverflowItem } from '@app/shared/shared-main' 3import { ListOverflowItem } from '@app/shared/shared-main'
4import { TopMenuDropdownParam } from '@app/shared/shared-main/misc/top-menu-dropdown.component' 4import { TopMenuDropdownParam } from '@app/shared/shared-main/misc/top-menu-dropdown.component'
5import { UserRight } from '@shared/models' 5import { 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 @@
1import { Routes } from '@angular/router' 1import { Routes } from '@angular/router'
2import { EditCustomConfigComponent } from '@app/+admin/config/edit-custom-config' 2import { EditCustomConfigComponent } from '@app/+admin/config/edit-custom-config'
3import { UserRightGuard } from '@app/core' 3import { UserRightGuard } from '@app/core'
4import { UserRight } from '@shared/models' 4import { UserRight } from '@peertube/peertube-models'
5 5
6export const ConfigRoutes: Routes = [ 6export 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'
3import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core' 3import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core'
4import { FormGroup } from '@angular/forms' 4import { FormGroup } from '@angular/forms'
5import { MenuService, ThemeService } from '@app/core' 5import { MenuService, ThemeService } from '@app/core'
6import { HTMLServerConfig } from '@shared/models' 6import { HTMLServerConfig } from '@peertube/peertube-models'
7import { ConfigService } from '../shared/config.service' 7import { 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 {
27import { USER_VIDEO_QUOTA_DAILY_VALIDATOR, USER_VIDEO_QUOTA_VALIDATOR } from '@app/shared/form-validators/user-validators' 27import { USER_VIDEO_QUOTA_DAILY_VALIDATOR, USER_VIDEO_QUOTA_VALIDATOR } from '@app/shared/form-validators/user-validators'
28import { FormReactive, FormReactiveService } from '@app/shared/shared-forms' 28import { FormReactive, FormReactiveService } from '@app/shared/shared-forms'
29import { CustomPageService } from '@app/shared/shared-main/custom-page' 29import { CustomPageService } from '@app/shared/shared-main/custom-page'
30import { CustomConfig, CustomPage, HTMLServerConfig } from '@shared/models' 30import { CustomConfig, CustomPage, HTMLServerConfig } from '@peertube/peertube-models'
31import { EditConfigurationService } from './edit-configuration.service' 31import { EditConfigurationService } from './edit-configuration.service'
32 32
33type ComponentCustomConfig = CustomConfig & { 33type 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 @@
2import { SelectOptionsItem } from 'src/types/select-options-item.model' 2import { SelectOptionsItem } from 'src/types/select-options-item.model'
3import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core' 3import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core'
4import { FormGroup } from '@angular/forms' 4import { FormGroup } from '@angular/forms'
5import { HTMLServerConfig } from '@shared/models' 5import { HTMLServerConfig } from '@peertube/peertube-models'
6import { ConfigService } from '../shared/config.service' 6import { ConfigService } from '../shared/config.service'
7import { EditConfigurationService, ResolutionOption } from './edit-configuration.service' 7import { 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 @@
2import { SelectOptionsItem } from 'src/types/select-options-item.model' 2import { SelectOptionsItem } from 'src/types/select-options-item.model'
3import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core' 3import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core'
4import { FormGroup } from '@angular/forms' 4import { FormGroup } from '@angular/forms'
5import { HTMLServerConfig } from '@shared/models' 5import { HTMLServerConfig } from '@peertube/peertube-models'
6import { ConfigService } from '../shared/config.service' 6import { ConfigService } from '../shared/config.service'
7import { EditConfigurationService, ResolutionOption } from './edit-configuration.service' 7import { 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'
2import { HttpClient } from '@angular/common/http' 2import { HttpClient } from '@angular/common/http'
3import { Injectable } from '@angular/core' 3import { Injectable } from '@angular/core'
4import { RestExtractor } from '@app/core' 4import { RestExtractor } from '@app/core'
5import { CustomConfig } from '@shared/models' 5import { CustomConfig } from '@peertube/peertube-models'
6import { SelectOptionsItem } from '../../../../types/select-options-item.model' 6import { SelectOptionsItem } from '../../../../types/select-options-item.model'
7import { environment } from '../../../../environments/environment' 7import { 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'
5import { AdvancedInputFilter } from '@app/shared/shared-forms' 5import { AdvancedInputFilter } from '@app/shared/shared-forms'
6import { InstanceFollowService } from '@app/shared/shared-instance' 6import { InstanceFollowService } from '@app/shared/shared-instance'
7import { DropdownAction } from '@app/shared/shared-main' 7import { DropdownAction } from '@app/shared/shared-main'
8import { ActorFollow } from '@shared/models' 8import { 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'
3import { ConfirmService, Notifier, RestPagination, RestTable } from '@app/core' 3import { ConfirmService, Notifier, RestPagination, RestTable } from '@app/core'
4import { AdvancedInputFilter } from '@app/shared/shared-forms' 4import { AdvancedInputFilter } from '@app/shared/shared-forms'
5import { InstanceFollowService } from '@app/shared/shared-instance' 5import { InstanceFollowService } from '@app/shared/shared-instance'
6import { ActorFollow } from '@shared/models' 6import { ActorFollow } from '@peertube/peertube-models'
7import { FollowModalComponent } from './follow-modal.component' 7import { FollowModalComponent } from './follow-modal.component'
8import { DropdownAction } from '@app/shared/shared-main' 8import { DropdownAction } from '@app/shared/shared-main'
9import { formatICU } from '@app/helpers' 9import { 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 @@
1import { Routes } from '@angular/router' 1import { Routes } from '@angular/router'
2import { VideoRedundanciesListComponent } from '@app/+admin/follows/video-redundancies-list' 2import { VideoRedundanciesListComponent } from '@app/+admin/follows/video-redundancies-list'
3import { UserRightGuard } from '@app/core' 3import { UserRightGuard } from '@app/core'
4import { UserRight } from '@shared/models' 4import { UserRight } from '@peertube/peertube-models'
5import { FollowersListComponent } from './followers-list' 5import { FollowersListComponent } from './followers-list'
6import { FollowingListComponent } from './following-list/following-list.component' 6import { 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'
3import { Component, OnInit } from '@angular/core' 3import { Component, OnInit } from '@angular/core'
4import { ConfirmService, Notifier, RestPagination, RestTable, ServerService } from '@app/core' 4import { ConfirmService, Notifier, RestPagination, RestTable, ServerService } from '@app/core'
5import { BytesPipe, RedundancyService } from '@app/shared/shared-main' 5import { BytesPipe, RedundancyService } from '@app/shared/shared-main'
6import { VideoRedundanciesTarget, VideoRedundancy, VideosRedundancyStats } from '@peertube/peertube-models'
6import { peertubeLocalStorage } from '@root-helpers/peertube-web-storage' 7import { peertubeLocalStorage } from '@root-helpers/peertube-web-storage'
7import { VideoRedundanciesTarget, VideoRedundancy } from '@shared/models'
8import { 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 @@
1import { Component, Input } from '@angular/core' 1import { Component, Input } from '@angular/core'
2import { FileRedundancyInformation, StreamingPlaylistRedundancyInformation } from '@shared/models' 2import { 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'
3import { InstanceAccountBlocklistComponent, InstanceServerBlocklistComponent } from '@app/+admin/moderation/instance-blocklist' 3import { InstanceAccountBlocklistComponent, InstanceServerBlocklistComponent } from '@app/+admin/moderation/instance-blocklist'
4import { VideoBlockListComponent } from '@app/+admin/moderation/video-block-list' 4import { VideoBlockListComponent } from '@app/+admin/moderation/video-block-list'
5import { UserRightGuard } from '@app/core' 5import { UserRightGuard } from '@app/core'
6import { UserRight } from '@shared/models' 6import { UserRight } from '@peertube/peertube-models'
7import { RegistrationListComponent } from './registration-list' 7import { RegistrationListComponent } from './registration-list'
8 8
9export const ModerationRoutes: Routes = [ 9export 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'
4import { HttpClient, HttpParams } from '@angular/common/http' 4import { HttpClient, HttpParams } from '@angular/common/http'
5import { Injectable } from '@angular/core' 5import { Injectable } from '@angular/core'
6import { RestExtractor, RestPagination, RestService } from '@app/core' 6import { RestExtractor, RestPagination, RestService } from '@app/core'
7import { arrayify } from '@shared/core-utils' 7import { arrayify } from '@peertube/peertube-core-utils'
8import { ResultList, UserRegistration, UserRegistrationUpdateState } from '@shared/models' 8import { ResultList, UserRegistration, UserRegistrationUpdateState } from '@peertube/peertube-models'
9import { environment } from '../../../../environments/environment' 9import { 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'
3import { FormReactive, FormReactiveService } from '@app/shared/shared-forms' 3import { FormReactive, FormReactiveService } from '@app/shared/shared-forms'
4import { NgbModal } from '@ng-bootstrap/ng-bootstrap' 4import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
5import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref' 5import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref'
6import { UserRegistration } from '@shared/models' 6import { UserRegistration } from '@peertube/peertube-models'
7import { AdminRegistrationService } from './admin-registration.service' 7import { AdminRegistrationService } from './admin-registration.service'
8import { REGISTRATION_MODERATION_RESPONSE_VALIDATOR } from './process-registration-validators' 8import { 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
5import { formatICU } from '@app/helpers' 5import { formatICU } from '@app/helpers'
6import { AdvancedInputFilter } from '@app/shared/shared-forms' 6import { AdvancedInputFilter } from '@app/shared/shared-forms'
7import { DropdownAction } from '@app/shared/shared-main' 7import { DropdownAction } from '@app/shared/shared-main'
8import { UserRegistration, UserRegistrationState } from '@shared/models' 8import { UserRegistration, UserRegistrationState } from '@peertube/peertube-models'
9import { AdminRegistrationService } from './admin-registration.service' 9import { AdminRegistrationService } from './admin-registration.service'
10import { ProcessRegistrationModalComponent } from './process-registration-modal.component' 10import { 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
7import { AdvancedInputFilter } from '@app/shared/shared-forms' 7import { AdvancedInputFilter } from '@app/shared/shared-forms'
8import { DropdownAction, VideoService } from '@app/shared/shared-main' 8import { DropdownAction, VideoService } from '@app/shared/shared-main'
9import { VideoBlockService } from '@app/shared/shared-moderation' 9import { VideoBlockService } from '@app/shared/shared-moderation'
10import { buildVideoEmbedLink, decorateVideoLink } from '@peertube/peertube-core-utils'
11import { VideoBlacklist, VideoBlacklistType, VideoBlacklistType_Type } from '@peertube/peertube-models'
10import { buildVideoOrPlaylistEmbed } from '@root-helpers/video' 12import { buildVideoOrPlaylistEmbed } from '@root-helpers/video'
11import { buildVideoEmbedLink, decorateVideoLink } from '@shared/core-utils'
12import { 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'
6import { DropdownAction } from '@app/shared/shared-main' 6import { DropdownAction } from '@app/shared/shared-main'
7import { BulkService } from '@app/shared/shared-moderation' 7import { BulkService } from '@app/shared/shared-moderation'
8import { VideoCommentAdmin, VideoCommentService } from '@app/shared/shared-video-comment' 8import { VideoCommentAdmin, VideoCommentService } from '@app/shared/shared-video-comment'
9import { FeedFormat, UserRight } from '@shared/models' 9import { FeedFormat, UserRight } from '@peertube/peertube-models'
10import { formatICU } from '@app/helpers' 10import { 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 @@
1import { Routes } from '@angular/router' 1import { Routes } from '@angular/router'
2import { UserRightGuard } from '@app/core' 2import { UserRightGuard } from '@app/core'
3import { UserRight } from '@shared/models' 3import { UserRight } from '@peertube/peertube-models'
4import { VideoCommentListComponent } from './video-comment-list.component' 4import { VideoCommentListComponent } from './video-comment-list.component'
5 5
6export const commentRoutes: Routes = [ 6export 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'
15import { FormReactiveService } from '@app/shared/shared-forms' 15import { FormReactiveService } from '@app/shared/shared-forms'
16import { UserAdminService } from '@app/shared/shared-users' 16import { UserAdminService } from '@app/shared/shared-users'
17import { UserCreate, UserRole } from '@shared/models' 17import { UserCreate, UserRole } from '@peertube/peertube-models'
18import { UserEdit } from './user-edit' 18import { 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'
2import { ConfigService } from '@app/+admin/config/shared/config.service' 2import { ConfigService } from '@app/+admin/config/shared/config.service'
3import { AuthService, ScreenService, ServerService, User } from '@app/core' 3import { AuthService, ScreenService, ServerService, User } from '@app/core'
4import { FormReactive } from '@app/shared/shared-forms' 4import { FormReactive } from '@app/shared/shared-forms'
5import { peertubeTranslate } from '@shared/core-utils' 5import { peertubeTranslate, USER_ROLE_LABELS } from '@peertube/peertube-core-utils'
6import { USER_ROLE_LABELS } from '@shared/core-utils/users' 6import { HTMLServerConfig, UserAdminFlag, UserRole } from '@peertube/peertube-models'
7import { HTMLServerConfig, UserAdminFlag, UserRole } from '@shared/models'
8import { SelectOptionsItem } from '../../../../../types/select-options-item.model' 7import { 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'
3import { USER_PASSWORD_VALIDATOR } from '@app/shared/form-validators/user-validators' 3import { USER_PASSWORD_VALIDATOR } from '@app/shared/form-validators/user-validators'
4import { FormReactive, FormReactiveService } from '@app/shared/shared-forms' 4import { FormReactive, FormReactiveService } from '@app/shared/shared-forms'
5import { UserAdminService } from '@app/shared/shared-users' 5import { UserAdminService } from '@app/shared/shared-users'
6import { UserUpdate } from '@shared/models' 6import { 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'
12import { FormReactiveService } from '@app/shared/shared-forms' 12import { FormReactiveService } from '@app/shared/shared-forms'
13import { TwoFactorService, UserAdminService } from '@app/shared/shared-users' 13import { TwoFactorService, UserAdminService } from '@app/shared/shared-users'
14import { User as UserType, UserAdminFlag, UserRole, UserUpdate } from '@shared/models' 14import { User as UserType, UserAdminFlag, UserRole, UserUpdate } from '@peertube/peertube-models'
15import { UserEdit } from './user-edit' 15import { 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'
7import { Actor, DropdownAction } from '@app/shared/shared-main' 7import { Actor, DropdownAction } from '@app/shared/shared-main'
8import { AccountMutedStatus, BlocklistService, UserBanModalComponent, UserModerationDisplayType } from '@app/shared/shared-moderation' 8import { AccountMutedStatus, BlocklistService, UserBanModalComponent, UserModerationDisplayType } from '@app/shared/shared-moderation'
9import { UserAdminService } from '@app/shared/shared-users' 9import { UserAdminService } from '@app/shared/shared-users'
10import { User, UserRole, UserRoleType } from '@peertube/peertube-models'
10import { logger } from '@root-helpers/logger' 11import { logger } from '@root-helpers/logger'
11import { User, UserRole } from '@shared/models'
12 12
13type UserForList = User & { 13type 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 @@
1import { Routes } from '@angular/router' 1import { Routes } from '@angular/router'
2import { UserRightGuard } from '@app/core' 2import { UserRightGuard } from '@app/core'
3import { UserRight } from '@shared/models' 3import { UserRight } from '@peertube/peertube-models'
4import { UserCreateComponent, UserUpdateComponent } from './user-edit' 4import { UserCreateComponent, UserUpdateComponent } from './user-edit'
5import { UserListComponent } from './user-list' 5import { 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'
5import { RestExtractor, RestPagination, RestService } from '@app/core' 5import { RestExtractor, RestPagination, RestService } from '@app/core'
6import { AdvancedInputFilter } from '@app/shared/shared-forms' 6import { AdvancedInputFilter } from '@app/shared/shared-forms'
7import { CommonVideoParams, Video, VideoService } from '@app/shared/shared-main' 7import { CommonVideoParams, Video, VideoService } from '@app/shared/shared-main'
8import { ResultList, VideoInclude, VideoPrivacy } from '@shared/models' 8import { ResultList, VideoInclude, VideoPrivacy } from '@peertube/peertube-models'
9import { getAllPrivacies } from '@shared/core-utils' 9import { getAllPrivacies } from '@peertube/peertube-core-utils'
10 10
11@Injectable() 11@Injectable()
12export class VideoAdminService { 12export 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'
8import { DropdownAction, Video, VideoService } from '@app/shared/shared-main' 8import { DropdownAction, Video, VideoService } from '@app/shared/shared-main'
9import { VideoBlockComponent, VideoBlockService } from '@app/shared/shared-moderation' 9import { VideoBlockComponent, VideoBlockService } from '@app/shared/shared-moderation'
10import { VideoActionsDisplayType } from '@app/shared/shared-video-miniature' 10import { VideoActionsDisplayType } from '@app/shared/shared-video-miniature'
11import { getAllFiles } from '@shared/core-utils' 11import { getAllFiles } from '@peertube/peertube-core-utils'
12import { UserRight, VideoFile, VideoPrivacy, VideoState, VideoStreamingPlaylistType } from '@shared/models' 12import { UserRight, VideoFile, VideoPrivacy, VideoState, VideoStreamingPlaylistType } from '@peertube/peertube-models'
13import { VideoAdminService } from './video-admin.service' 13import { 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 @@
1import { Routes } from '@angular/router' 1import { Routes } from '@angular/router'
2import { UserRightGuard } from '@app/core' 2import { UserRightGuard } from '@app/core'
3import { UserRight } from '@shared/models' 3import { UserRight } from '@peertube/peertube-models'
4import { VideoListComponent } from './video-list.component' 4import { VideoListComponent } from './video-list.component'
5 5
6export const videosRoutes: Routes = [ 6export 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'
4import { PluginApiService } from '@app/+admin/plugins/shared/plugin-api.service' 4import { PluginApiService } from '@app/+admin/plugins/shared/plugin-api.service'
5import { ComponentPagination, ConfirmService, hasMoreItems, Notifier } from '@app/core' 5import { ComponentPagination, ConfirmService, hasMoreItems, Notifier } from '@app/core'
6import { PluginService } from '@app/core/plugins/plugin.service' 6import { PluginService } from '@app/core/plugins/plugin.service'
7import { compareSemVer } from '@shared/core-utils' 7import { compareSemVer } from '@peertube/peertube-core-utils'
8import { PeerTubePlugin, PluginType } from '@shared/models' 8import { 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})
15export class PluginListInstalledComponent implements OnInit { 15export 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'
4import { ActivatedRoute, Router } from '@angular/router' 4import { ActivatedRoute, Router } from '@angular/router'
5import { PluginApiService } from '@app/+admin/plugins/shared/plugin-api.service' 5import { PluginApiService } from '@app/+admin/plugins/shared/plugin-api.service'
6import { ComponentPagination, ConfirmService, hasMoreItems, Notifier, PluginService } from '@app/core' 6import { ComponentPagination, ConfirmService, hasMoreItems, Notifier, PluginService } from '@app/core'
7import { PeerTubePluginIndex, PluginType, PluginType_Type } from '@peertube/peertube-models'
7import { logger } from '@root-helpers/logger' 8import { logger } from '@root-helpers/logger'
8import { 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})
15export class PluginSearchComponent implements OnInit { 15export 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'
5import { HooksService, Notifier, PluginService } from '@app/core' 5import { HooksService, Notifier, PluginService } from '@app/core'
6import { BuildFormArgument } from '@app/shared/form-validators' 6import { BuildFormArgument } from '@app/shared/form-validators'
7import { FormReactive, FormReactiveService } from '@app/shared/shared-forms' 7import { FormReactive, FormReactiveService } from '@app/shared/shared-forms'
8import { PeerTubePlugin, RegisterServerSettingOptions } from '@shared/models' 8import { PeerTubePlugin, RegisterServerSettingOptions } from '@peertube/peertube-models'
9import { PluginApiService } from '../shared/plugin-api.service' 9import { 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
3import { PluginSearchComponent } from '@app/+admin/plugins/plugin-search/plugin-search.component' 3import { PluginSearchComponent } from '@app/+admin/plugins/plugin-search/plugin-search.component'
4import { PluginShowInstalledComponent } from '@app/+admin/plugins/plugin-show-installed/plugin-show-installed.component' 4import { PluginShowInstalledComponent } from '@app/+admin/plugins/plugin-show-installed/plugin-show-installed.component'
5import { UserRightGuard } from '@app/core' 5import { UserRightGuard } from '@app/core'
6import { UserRight } from '@shared/models' 6import { UserRight } from '@peertube/peertube-models'
7 7
8export const PluginsRoutes: Routes = [ 8export 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'
15import { environment } from '../../../../environments/environment' 16import { 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 @@
1import { Component, Input } from '@angular/core' 1import { Component, Input } from '@angular/core'
2import { PeerTubePlugin, PeerTubePluginIndex, PluginType } from '@shared/models' 2import { PeerTubePlugin, PeerTubePluginIndex, PluginType_Type } from '@peertube/peertube-models'
3import { PluginApiService } from './plugin-api.service' 3import { PluginApiService } from './plugin-api.service'
4 4
5@Component({ 5@Component({
@@ -11,7 +11,7 @@ import { PluginApiService } from './plugin-api.service'
11export class PluginCardComponent { 11export 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 @@
1import { Component, Input } from '@angular/core' 1import { Component, Input } from '@angular/core'
2import { PluginType } from '@shared/models/plugins' 2import { 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})
9export class PluginNavigationComponent { 9export 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 @@
1import { Component, Input } from '@angular/core' 1import { Component, Input } from '@angular/core'
2import { User, UserRegistration } from '@shared/models/users' 2import { 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 @@
1import { Component, Input, OnInit } from '@angular/core' 1import { Component, Input, OnInit } from '@angular/core'
2import { ServerService } from '@app/core' 2import { ServerService } from '@app/core'
3import { HTMLServerConfig, VideoResolution } from '@shared/models/index' 3import { 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 @@
1import { Component, OnInit } from '@angular/core' 1import { Component, OnInit } from '@angular/core'
2import { Notifier } from '@app/core' 2import { Notifier } from '@app/core'
3import { Debug } from '@shared/models' 3import { Debug } from '@peertube/peertube-models'
4import { DebugService } from './debug.service' 4import { 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'
3import { HttpClient } from '@angular/common/http' 3import { HttpClient } from '@angular/common/http'
4import { Injectable } from '@angular/core' 4import { Injectable } from '@angular/core'
5import { RestExtractor } from '@app/core' 5import { RestExtractor } from '@app/core'
6import { Debug } from '@shared/models' 6import { Debug } from '@peertube/peertube-models'
7import { environment } from '../../../../environments/environment' 7import { 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'
4import { HttpClient, HttpParams } from '@angular/common/http' 4import { HttpClient, HttpParams } from '@angular/common/http'
5import { Injectable } from '@angular/core' 5import { Injectable } from '@angular/core'
6import { RestExtractor, RestPagination, RestService } from '@app/core' 6import { RestExtractor, RestPagination, RestService } from '@app/core'
7import { Job, ResultList } from '@shared/models' 7import { Job, ResultList } from '@peertube/peertube-models'
8import { environment } from '../../../../environments/environment' 8import { environment } from '../../../../environments/environment'
9import { JobStateClient } from '../../../../types/job-state-client.type' 9import { JobStateClient } from '../../../../types/job-state-client.type'
10import { JobTypeClient } from '../../../../types/job-type-client.type' 10import { 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 @@
1import { SortMeta } from 'primeng/api' 1import { SortMeta } from 'primeng/api'
2import { Component, OnInit } from '@angular/core' 2import { Component, OnInit } from '@angular/core'
3import { Notifier, RestPagination, RestTable } from '@app/core' 3import { Notifier, RestPagination, RestTable } from '@app/core'
4import { escapeHTML } from '@peertube/peertube-core-utils'
5import { Job, JobState, JobType } from '@peertube/peertube-models'
4import { peertubeLocalStorage } from '@root-helpers/peertube-web-storage' 6import { peertubeLocalStorage } from '@root-helpers/peertube-web-storage'
5import { escapeHTML } from '@shared/core-utils/renderer'
6import { Job, JobState, JobType } from '@shared/models'
7import { JobStateClient } from '../../../../types/job-state-client.type' 7import { JobStateClient } from '../../../../types/job-state-client.type'
8import { JobTypeClient } from '../../../../types/job-type-client.type' 8import { JobTypeClient } from '../../../../types/job-type-client.type'
9import { JobService } from './job.service' 9import { 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 @@
1import omit from 'lodash-es/omit' 1import omit from 'lodash-es/omit'
2import { logger } from '@root-helpers/logger' 2import { logger } from '@root-helpers/logger'
3import { ServerLogLevel } from '@shared/models' 3import { ServerLogLevel } from '@peertube/peertube-models'
4 4
5export class LogRow { 5export 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 @@
1import { Component, ElementRef, OnInit, ViewChild } from '@angular/core' 1import { Component, ElementRef, OnInit, ViewChild } from '@angular/core'
2import { LocalStorageService, Notifier } from '@app/core' 2import { LocalStorageService, Notifier } from '@app/core'
3import { ServerLogLevel } from '@shared/models' 3import { ServerLogLevel } from '@peertube/peertube-models'
4import { LogRow } from './log-row.model' 4import { LogRow } from './log-row.model'
5import { LogsService } from './logs.service' 5import { 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'
3import { HttpClient, HttpParams } from '@angular/common/http' 3import { HttpClient, HttpParams } from '@angular/common/http'
4import { Injectable } from '@angular/core' 4import { Injectable } from '@angular/core'
5import { RestExtractor, RestService } from '@app/core' 5import { RestExtractor, RestService } from '@app/core'
6import { ServerLogLevel } from '@shared/models' 6import { ServerLogLevel } from '@peertube/peertube-models'
7import { environment } from '../../../../environments/environment' 7import { environment } from '../../../../environments/environment'
8import { LogRow } from './log-row.model' 8import { 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'
3import { ConfirmService, Notifier, RestPagination, RestTable } from '@app/core' 3import { ConfirmService, Notifier, RestPagination, RestTable } from '@app/core'
4import { formatICU } from '@app/helpers' 4import { formatICU } from '@app/helpers'
5import { DropdownAction } from '@app/shared/shared-main' 5import { DropdownAction } from '@app/shared/shared-main'
6import { RunnerJob, RunnerJobState } from '@shared/models' 6import { RunnerJob, RunnerJobState } from '@peertube/peertube-models'
7import { RunnerJobFormatted, RunnerService } from '../runner.service' 7import { RunnerJobFormatted, RunnerService } from '../runner.service'
8import { AdvancedInputFilter } from '@app/shared/shared-forms' 8import { 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'
2import { Component, OnInit } from '@angular/core' 2import { Component, OnInit } from '@angular/core'
3import { ConfirmService, Notifier, RestPagination, RestTable } from '@app/core' 3import { ConfirmService, Notifier, RestPagination, RestTable } from '@app/core'
4import { DropdownAction } from '@app/shared/shared-main' 4import { DropdownAction } from '@app/shared/shared-main'
5import { Runner } from '@shared/models' 5import { Runner } from '@peertube/peertube-models'
6import { RunnerService } from '../runner.service' 6import { 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'
2import { Component, OnInit } from '@angular/core' 2import { Component, OnInit } from '@angular/core'
3import { ConfirmService, Notifier, RestPagination, RestTable } from '@app/core' 3import { ConfirmService, Notifier, RestPagination, RestTable } from '@app/core'
4import { DropdownAction } from '@app/shared/shared-main' 4import { DropdownAction } from '@app/shared/shared-main'
5import { RunnerRegistrationToken } from '@shared/models' 5import { RunnerRegistrationToken } from '@peertube/peertube-models'
6import { RunnerService } from '../runner.service' 6import { 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'
4import { HttpClient, HttpParams } from '@angular/common/http' 4import { HttpClient, HttpParams } from '@angular/common/http'
5import { Injectable } from '@angular/core' 5import { Injectable } from '@angular/core'
6import { RestExtractor, RestPagination, RestService, ServerService } from '@app/core' 6import { RestExtractor, RestPagination, RestService, ServerService } from '@app/core'
7import { arrayify, peertubeTranslate } from '@shared/core-utils' 7import { arrayify, peertubeTranslate } from '@peertube/peertube-core-utils'
8import { ResultList } from '@shared/models/common' 8import { ResultList, Runner, RunnerJob, RunnerJobAdmin, RunnerJobState, RunnerRegistrationToken } from '@peertube/peertube-models'
9import { Runner, RunnerJob, RunnerJobAdmin, RunnerJobState, RunnerRegistrationToken } from '@shared/models/runners'
10import { environment } from '../../../../environments/environment' 9import { environment } from '../../../../environments/environment'
11 10
12export type RunnerJobFormatted = RunnerJob & { 11export 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 @@
1import { Routes } from '@angular/router' 1import { Routes } from '@angular/router'
2import { UserRightGuard } from '@app/core' 2import { UserRightGuard } from '@app/core'
3import { UserRight } from '@shared/models' 3import { UserRight } from '@peertube/peertube-models'
4import { RunnerJobListComponent } from './runner-job-list' 4import { RunnerJobListComponent } from './runner-job-list'
5import { RunnerListComponent } from './runner-list' 5import { RunnerListComponent } from './runner-list'
6import { RunnerRegistrationTokenListComponent } from './runner-registration-token-list' 6import { 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 @@
1import { Routes } from '@angular/router' 1import { Routes } from '@angular/router'
2import { UserRightGuard } from '@app/core' 2import { UserRightGuard } from '@app/core'
3import { UserRight } from '@shared/models' 3import { UserRight } from '@peertube/peertube-models'
4import { DebugComponent } from './debug' 4import { DebugComponent } from './debug'
5import { JobsComponent } from './jobs/jobs.component' 5import { JobsComponent } from './jobs/jobs.component'
6import { LogsComponent } from './logs' 6import { LogsComponent } from './logs'