ActivityPub-federated video streaming platform using P2P directly in your web browser
shared/ typescript types dir server-commands
Chocobozzzbf54587a3e2a
diff --git a/scripts/benchmark.ts b/scripts/benchmark.tsindex 788318313f..011519fe38 100644--- a/scripts/benchmark.ts+++ b/scripts/benchmark.ts@@ -3,7 +3,7 @@ registerTSPaths()import autocannon, { printResult } from 'autocannon'import { writeJson } from 'fs-extra'-import { createSingleServer, killallServers, PeerTubeServer, setAccessTokensToServers } from '@shared/extra-utils'+import { createSingleServer, killallServers, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands'import { Video, VideoPrivacy } from '@shared/models'let server: PeerTubeServerdiff --git a/scripts/generate-code-contributors.ts b/scripts/generate-code-contributors.tsindex 70b33c0d31..449407c440 100755--- a/scripts/generate-code-contributors.ts+++ b/scripts/generate-code-contributors.ts@@ -1,7 +1,7 @@import { registerTSPaths } from '../server/helpers/register-ts-paths'registerTSPaths()-import { CLICommand } from '@shared/extra-utils'+import { CLICommand } from '@shared/server-commands'run().then(() => process.exit(0))diff --git a/server/tests/api/activitypub/cleaner.ts b/server/tests/api/activitypub/cleaner.tsindex 51cf6e599e..c3368c7ebf 100644--- a/server/tests/api/activitypub/cleaner.ts+++ b/server/tests/api/activitypub/cleaner.ts@@ -10,7 +10,7 @@ import {setAccessTokensToServers,wait,waitJobs-} from '@shared/extra-utils'+} from '@shared/server-commands'const expect = chai.expectdiff --git a/server/tests/api/activitypub/client.ts b/server/tests/api/activitypub/client.tsindex c3e4b7f74a..e69ab3cb93 100644--- a/server/tests/api/activitypub/client.ts+++ b/server/tests/api/activitypub/client.ts@@ -10,7 +10,7 @@ import {PeerTubeServer,setAccessTokensToServers,setDefaultVideoChannel-} from '@shared/extra-utils'+} from '@shared/server-commands'import { HttpStatusCode, VideoPlaylistPrivacy } from '@shared/models'const expect = chai.expectdiff --git a/server/tests/api/activitypub/fetch.ts b/server/tests/api/activitypub/fetch.tsindex 422a75d6e1..93bf01842d 100644--- a/server/tests/api/activitypub/fetch.ts+++ b/server/tests/api/activitypub/fetch.ts@@ -2,7 +2,7 @@import 'mocha'import * as chai from 'chai'-import { cleanupTests, createMultipleServers, doubleFollow, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils'+import { cleanupTests, createMultipleServers, doubleFollow, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/server-commands'const expect = chai.expectdiff --git a/server/tests/api/activitypub/helpers.ts b/server/tests/api/activitypub/helpers.tsindex 57b1cab23c..5aa94af5d9 100644--- a/server/tests/api/activitypub/helpers.ts+++ b/server/tests/api/activitypub/helpers.ts@@ -3,7 +3,7 @@import 'mocha'import { expect } from 'chai'import { cloneDeep } from 'lodash'-import { buildAbsoluteFixturePath, buildRequestStub } from '@shared/extra-utils'+import { buildAbsoluteFixturePath, buildRequestStub } from '@shared/server-commands'import { buildSignedActivity } from '../../../helpers/activitypub'import { isHTTPSignatureVerified, isJsonLDSignatureVerified, parseHTTPSignature } from '../../../helpers/peertube-crypto'diff --git a/server/tests/api/activitypub/refresher.ts b/server/tests/api/activitypub/refresher.tsindex 81fee00447..669a86fca5 100644--- a/server/tests/api/activitypub/refresher.ts+++ b/server/tests/api/activitypub/refresher.ts@@ -11,7 +11,7 @@ import {setDefaultVideoChannel,wait,waitJobs-} from '@shared/extra-utils'+} from '@shared/server-commands'import { HttpStatusCode, VideoPlaylistPrivacy } from '@shared/models'describe('Test AP refresher', function () {diff --git a/server/tests/api/activitypub/security.ts b/server/tests/api/activitypub/security.tsindex 2700cff138..3b871ae12d 100644--- a/server/tests/api/activitypub/security.ts+++ b/server/tests/api/activitypub/security.ts@@ -6,7 +6,7 @@ import { activityPubContextify, buildSignedActivity } from '@server/helpers/actiimport { buildDigest } from '@server/helpers/peertube-crypto'import { HTTP_SIGNATURE } from '@server/initializers/constants'import { buildGlobalHeaders } from '@server/lib/job-queue/handlers/utils/activitypub-http-utils'-import { buildAbsoluteFixturePath, cleanupTests, createMultipleServers, killallServers, PeerTubeServer, wait } from '@shared/extra-utils'+import { buildAbsoluteFixturePath, cleanupTests, createMultipleServers, killallServers, PeerTubeServer, wait } from '@shared/server-commands'import { makeFollowRequest, makePOSTAPRequest } from '@server/tests/shared'import { HttpStatusCode } from '@shared/models'diff --git a/server/tests/api/check-params/abuses.ts b/server/tests/api/check-params/abuses.tsindex fb9a5fd8b0..58167cbab9 100644--- a/server/tests/api/check-params/abuses.ts+++ b/server/tests/api/check-params/abuses.ts@@ -14,7 +14,7 @@ import {PeerTubeServer,setAccessTokensToServers,waitJobs-} from '@shared/extra-utils'+} from '@shared/server-commands'import { AbuseCreate, AbuseState, HttpStatusCode } from '@shared/models'describe('Test abuses API validators', function () {diff --git a/server/tests/api/check-params/accounts.ts b/server/tests/api/check-params/accounts.tsindex 141d869b76..fc8e63ed4f 100644--- a/server/tests/api/check-params/accounts.ts+++ b/server/tests/api/check-params/accounts.ts@@ -8,7 +8,7 @@ import {cleanupTests,createSingleServer,PeerTubeServer-} from '@shared/extra-utils'+} from '@shared/server-commands'import { HttpStatusCode } from '@shared/models'describe('Test accounts API validators', function () {diff --git a/server/tests/api/check-params/blocklist.ts b/server/tests/api/check-params/blocklist.tsindex f72a892e2d..2dc3a166de 100644--- a/server/tests/api/check-params/blocklist.ts+++ b/server/tests/api/check-params/blocklist.ts@@ -13,7 +13,7 @@ import {makePostBodyRequest,PeerTubeServer,setAccessTokensToServers-} from '@shared/extra-utils'+} from '@shared/server-commands'import { HttpStatusCode } from '@shared/models'describe('Test blocklist API validators', function () {diff --git a/server/tests/api/check-params/bulk.ts b/server/tests/api/check-params/bulk.tsindex bc9d7784d7..9bd0016cff 100644--- a/server/tests/api/check-params/bulk.ts+++ b/server/tests/api/check-params/bulk.ts@@ -1,7 +1,7 @@/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */import 'mocha'-import { cleanupTests, createSingleServer, makePostBodyRequest, PeerTubeServer, setAccessTokensToServers } from '@shared/extra-utils'+import { cleanupTests, createSingleServer, makePostBodyRequest, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands'import { HttpStatusCode } from '@shared/models'describe('Test bulk API validators', function () {diff --git a/server/tests/api/check-params/config.ts b/server/tests/api/check-params/config.tsindex a6e87730a5..3cccb612a0 100644--- a/server/tests/api/check-params/config.ts+++ b/server/tests/api/check-params/config.ts@@ -10,7 +10,7 @@ import {makePutBodyRequest,PeerTubeServer,setAccessTokensToServers-} from '@shared/extra-utils'+} from '@shared/server-commands'import { CustomConfig, HttpStatusCode } from '@shared/models'describe('Test config API validators', function () {diff --git a/server/tests/api/check-params/contact-form.ts b/server/tests/api/check-params/contact-form.tsindex 9f86fecc65..a2e51e14d3 100644--- a/server/tests/api/check-params/contact-form.ts+++ b/server/tests/api/check-params/contact-form.ts@@ -1,9 +1,15 @@/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */import 'mocha'-import { cleanupTests, createSingleServer, killallServers, MockSmtpServer, PeerTubeServer } from '@shared/extra-utils'-import { ContactFormCommand } from '@shared/extra-utils/server'import { HttpStatusCode } from '@shared/models'+import {+ cleanupTests,+ ContactFormCommand,+ createSingleServer,+ killallServers,+ MockSmtpServer,+ PeerTubeServer+} from '@shared/server-commands'describe('Test contact form API validators', function () {let server: PeerTubeServerdiff --git a/server/tests/api/check-params/custom-pages.ts b/server/tests/api/check-params/custom-pages.tsindex 9fbbea3150..a102ee437f 100644--- a/server/tests/api/check-params/custom-pages.ts+++ b/server/tests/api/check-params/custom-pages.ts@@ -8,7 +8,7 @@ import {makePutBodyRequest,PeerTubeServer,setAccessTokensToServers-} from '@shared/extra-utils'+} from '@shared/server-commands'import { HttpStatusCode } from '@shared/models'describe('Test custom pages validators', function () {diff --git a/server/tests/api/check-params/debug.ts b/server/tests/api/check-params/debug.tsindex a55786359e..cfa44decab 100644--- a/server/tests/api/check-params/debug.ts+++ b/server/tests/api/check-params/debug.ts@@ -1,7 +1,7 @@/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */import 'mocha'-import { cleanupTests, createSingleServer, makeGetRequest, PeerTubeServer, setAccessTokensToServers } from '@shared/extra-utils'+import { cleanupTests, createSingleServer, makeGetRequest, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands'import { HttpStatusCode } from '@shared/models'describe('Test debug API validators', function () {diff --git a/server/tests/api/check-params/follows.ts b/server/tests/api/check-params/follows.tsindex 2bc9f6b968..6121d22022 100644--- a/server/tests/api/check-params/follows.ts+++ b/server/tests/api/check-params/follows.ts@@ -12,7 +12,7 @@ import {makePostBodyRequest,PeerTubeServer,setAccessTokensToServers-} from '@shared/extra-utils'+} from '@shared/server-commands'import { HttpStatusCode } from '@shared/models'describe('Test server follows API validators', function () {diff --git a/server/tests/api/check-params/jobs.ts b/server/tests/api/check-params/jobs.tsindex 23d95d8e4c..b7c603755f 100644--- a/server/tests/api/check-params/jobs.ts+++ b/server/tests/api/check-params/jobs.ts@@ -10,7 +10,7 @@ import {makeGetRequest,PeerTubeServer,setAccessTokensToServers-} from '@shared/extra-utils'+} from '@shared/server-commands'import { HttpStatusCode } from '@shared/models'describe('Test jobs API validators', function () {diff --git a/server/tests/api/check-params/live.ts b/server/tests/api/check-params/live.tsindex 8e1d655d49..8b79d97e09 100644--- a/server/tests/api/check-params/live.ts+++ b/server/tests/api/check-params/live.ts@@ -13,7 +13,7 @@ import {sendRTMPStream,setAccessTokensToServers,stopFfmpeg-} from '@shared/extra-utils'+} from '@shared/server-commands'import { HttpStatusCode, VideoCreateResult, VideoPrivacy } from '@shared/models'describe('Test video lives API validator', function () {diff --git a/server/tests/api/check-params/logs.ts b/server/tests/api/check-params/logs.tsindex 05372257a7..970671c15e 100644--- a/server/tests/api/check-params/logs.ts+++ b/server/tests/api/check-params/logs.ts@@ -1,7 +1,7 @@/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */import 'mocha'-import { cleanupTests, createSingleServer, makeGetRequest, PeerTubeServer, setAccessTokensToServers } from '@shared/extra-utils'+import { cleanupTests, createSingleServer, makeGetRequest, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands'import { HttpStatusCode } from '@shared/models'describe('Test logs API validators', function () {diff --git a/server/tests/api/check-params/my-user.ts b/server/tests/api/check-params/my-user.tsindex d35284d600..c8ac71476e 100644--- a/server/tests/api/check-params/my-user.ts+++ b/server/tests/api/check-params/my-user.ts@@ -15,7 +15,7 @@ import {PeerTubeServer,setAccessTokensToServers,UsersCommand-} from '@shared/extra-utils'+} from '@shared/server-commands'import { HttpStatusCode, UserRole, VideoCreateResult } from '@shared/models'describe('Test my user API validators', function () {diff --git a/server/tests/api/check-params/plugins.ts b/server/tests/api/check-params/plugins.tsindex 2c436376c9..79e4875901 100644--- a/server/tests/api/check-params/plugins.ts+++ b/server/tests/api/check-params/plugins.ts@@ -12,7 +12,7 @@ import {makePutBodyRequest,PeerTubeServer,setAccessTokensToServers-} from '@shared/extra-utils'+} from '@shared/server-commands'import { HttpStatusCode, PeerTubePlugin, PluginType } from '@shared/models'describe('Test server plugins API validators', function () {diff --git a/server/tests/api/check-params/redundancy.ts b/server/tests/api/check-params/redundancy.tsindex d9f9055496..f3bfcb16ca 100644--- a/server/tests/api/check-params/redundancy.ts+++ b/server/tests/api/check-params/redundancy.ts@@ -15,7 +15,7 @@ import {PeerTubeServer,setAccessTokensToServers,waitJobs-} from '@shared/extra-utils'+} from '@shared/server-commands'import { HttpStatusCode, VideoCreateResult } from '@shared/models'describe('Test server redundancy API validators', function () {diff --git a/server/tests/api/check-params/search.ts b/server/tests/api/check-params/search.tsindex cc15d25930..edeeed571e 100644--- a/server/tests/api/check-params/search.ts+++ b/server/tests/api/check-params/search.ts@@ -10,7 +10,7 @@ import {makeGetRequest,PeerTubeServer,setAccessTokensToServers-} from '@shared/extra-utils'+} from '@shared/server-commands'import { HttpStatusCode } from '@shared/models'function updateSearchIndex (server: PeerTubeServer, enabled: boolean, disableLocalSearch = false) {diff --git a/server/tests/api/check-params/services.ts b/server/tests/api/check-params/services.tsindex 8d795fabc2..e63f098847 100644--- a/server/tests/api/check-params/services.ts+++ b/server/tests/api/check-params/services.ts@@ -8,7 +8,7 @@ import {PeerTubeServer,setAccessTokensToServers,setDefaultVideoChannel-} from '@shared/extra-utils'+} from '@shared/server-commands'import { HttpStatusCode, VideoPlaylistPrivacy } from '@shared/models'describe('Test services API validators', function () {diff --git a/server/tests/api/check-params/transcoding.ts b/server/tests/api/check-params/transcoding.tsindex 6b6f73d46d..11ade9071c 100644--- a/server/tests/api/check-params/transcoding.ts+++ b/server/tests/api/check-params/transcoding.ts@@ -1,7 +1,7 @@/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */import 'mocha'-import { cleanupTests, createMultipleServers, doubleFollow, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils'+import { cleanupTests, createMultipleServers, doubleFollow, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/server-commands'import { HttpStatusCode, UserRole } from '@shared/models'describe('Test transcoding API validators', function () {diff --git a/server/tests/api/check-params/upload-quota.ts b/server/tests/api/check-params/upload-quota.tsindex 322e93d0d5..02898bb877 100644--- a/server/tests/api/check-params/upload-quota.ts+++ b/server/tests/api/check-params/upload-quota.ts@@ -12,7 +12,7 @@ import {setDefaultVideoChannel,VideosCommand,waitJobs-} from '@shared/extra-utils'+} from '@shared/server-commands'import { HttpStatusCode, VideoImportState, VideoPrivacy } from '@shared/models'describe('Test upload quota', function () {diff --git a/server/tests/api/check-params/user-notifications.ts b/server/tests/api/check-params/user-notifications.tsindex 17edf5aa17..912d4a992e 100644--- a/server/tests/api/check-params/user-notifications.ts+++ b/server/tests/api/check-params/user-notifications.ts@@ -14,7 +14,7 @@ import {PeerTubeServer,setAccessTokensToServers,wait-} from '@shared/extra-utils'+} from '@shared/server-commands'import { HttpStatusCode, UserNotificationSetting, UserNotificationSettingValue } from '@shared/models'describe('Test user notifications API validators', function () {diff --git a/server/tests/api/check-params/user-subscriptions.ts b/server/tests/api/check-params/user-subscriptions.tsindex 624069c80b..95226dff58 100644--- a/server/tests/api/check-params/user-subscriptions.ts+++ b/server/tests/api/check-params/user-subscriptions.ts@@ -13,7 +13,7 @@ import {PeerTubeServer,setAccessTokensToServers,waitJobs-} from '@shared/extra-utils'+} from '@shared/server-commands'import { HttpStatusCode } from '@shared/models'describe('Test user subscriptions API validators', function () {diff --git a/server/tests/api/check-params/users-admin.ts b/server/tests/api/check-params/users-admin.tsindex f71414a6b6..c98b5e1893 100644--- a/server/tests/api/check-params/users-admin.ts+++ b/server/tests/api/check-params/users-admin.ts@@ -15,7 +15,7 @@ import {MockSmtpServer,PeerTubeServer,setAccessTokensToServers-} from '@shared/extra-utils'+} from '@shared/server-commands'import { HttpStatusCode, UserAdminFlag, UserRole } from '@shared/models'describe('Test users admin API validators', function () {diff --git a/server/tests/api/check-params/users.ts b/server/tests/api/check-params/users.tsindex 5f9cbc5eb3..254177afd3 100644--- a/server/tests/api/check-params/users.ts+++ b/server/tests/api/check-params/users.ts@@ -9,7 +9,7 @@ import {MockSmtpServer,PeerTubeServer,setAccessTokensToServers-} from '@shared/extra-utils'+} from '@shared/server-commands'import { HttpStatusCode, UserRole } from '@shared/models'describe('Test users API validators', function () {diff --git a/server/tests/api/check-params/video-blacklist.ts b/server/tests/api/check-params/video-blacklist.tsindex 1f926d2275..7eb3c1cae5 100644--- a/server/tests/api/check-params/video-blacklist.ts+++ b/server/tests/api/check-params/video-blacklist.ts@@ -15,7 +15,7 @@ import {PeerTubeServer,setAccessTokensToServers,waitJobs-} from '@shared/extra-utils'+} from '@shared/server-commands'import { HttpStatusCode, VideoBlacklistType } from '@shared/models'describe('Test video blacklist API validators', function () {diff --git a/server/tests/api/check-params/video-captions.ts b/server/tests/api/check-params/video-captions.tsindex 90f4293145..34c1a9673d 100644--- a/server/tests/api/check-params/video-captions.ts+++ b/server/tests/api/check-params/video-captions.ts@@ -10,7 +10,7 @@ import {makeUploadRequest,PeerTubeServer,setAccessTokensToServers-} from '@shared/extra-utils'+} from '@shared/server-commands'import { HttpStatusCode, VideoCreateResult } from '@shared/models'describe('Test video captions API validator', function () {diff --git a/server/tests/api/check-params/video-channels.ts b/server/tests/api/check-params/video-channels.tsindex e86c315fa5..747a5d3ec1 100644--- a/server/tests/api/check-params/video-channels.ts+++ b/server/tests/api/check-params/video-channels.ts@@ -17,7 +17,7 @@ import {makeUploadRequest,PeerTubeServer,setAccessTokensToServers-} from '@shared/extra-utils'+} from '@shared/server-commands'import { HttpStatusCode, VideoChannelUpdate } from '@shared/models'const expect = chai.expectdiff --git a/server/tests/api/check-params/video-comments.ts b/server/tests/api/check-params/video-comments.tsindex 2d9ee1e0d2..05cf61cba2 100644--- a/server/tests/api/check-params/video-comments.ts+++ b/server/tests/api/check-params/video-comments.ts@@ -13,7 +13,7 @@ import {makePostBodyRequest,PeerTubeServer,setAccessTokensToServers-} from '@shared/extra-utils'+} from '@shared/server-commands'import { HttpStatusCode, VideoCreateResult } from '@shared/models'const expect = chai.expectdiff --git a/server/tests/api/check-params/video-files.ts b/server/tests/api/check-params/video-files.tsindex 3ccdf5f49d..90ab4460c5 100644--- a/server/tests/api/check-params/video-files.ts+++ b/server/tests/api/check-params/video-files.ts@@ -1,7 +1,7 @@/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */import 'mocha'-import { cleanupTests, createMultipleServers, doubleFollow, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils'+import { cleanupTests, createMultipleServers, doubleFollow, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/server-commands'import { HttpStatusCode, UserRole } from '@shared/models'describe('Test videos files', function () {diff --git a/server/tests/api/check-params/video-imports.ts b/server/tests/api/check-params/video-imports.tsindex d6d745488c..7cefb2a540 100644--- a/server/tests/api/check-params/video-imports.ts+++ b/server/tests/api/check-params/video-imports.ts@@ -15,7 +15,7 @@ import {makeUploadRequest,PeerTubeServer,setAccessTokensToServers-} from '@shared/extra-utils'+} from '@shared/server-commands'import { HttpStatusCode, VideoPrivacy } from '@shared/models'describe('Test video imports API validator', function () {diff --git a/server/tests/api/check-params/video-playlists.ts b/server/tests/api/check-params/video-playlists.tsindex e4d541b480..ac3c13f78c 100644--- a/server/tests/api/check-params/video-playlists.ts+++ b/server/tests/api/check-params/video-playlists.ts@@ -12,7 +12,7 @@ import {PlaylistsCommand,setAccessTokensToServers,setDefaultVideoChannel-} from '@shared/extra-utils'+} from '@shared/server-commands'import {HttpStatusCode,VideoPlaylistCreate,diff --git a/server/tests/api/check-params/videos-common-filters.ts b/server/tests/api/check-params/videos-common-filters.tsindex f2b5bee8e1..6b3ec917ec 100644--- a/server/tests/api/check-params/videos-common-filters.ts+++ b/server/tests/api/check-params/videos-common-filters.ts@@ -8,7 +8,7 @@ import {PeerTubeServer,setAccessTokensToServers,setDefaultVideoChannel-} from '@shared/extra-utils'+} from '@shared/server-commands'import { HttpStatusCode, UserRole, VideoInclude, VideoPrivacy } from '@shared/models'describe('Test video filters validators', function () {diff --git a/server/tests/api/check-params/videos-history.ts b/server/tests/api/check-params/videos-history.tsindex c3c309ed28..e4b4c4b2ad 100644--- a/server/tests/api/check-params/videos-history.ts+++ b/server/tests/api/check-params/videos-history.ts@@ -11,7 +11,7 @@ import {makePutBodyRequest,PeerTubeServer,setAccessTokensToServers-} from '@shared/extra-utils'+} from '@shared/server-commands'import { HttpStatusCode } from '@shared/models'describe('Test videos history API validator', function () {diff --git a/server/tests/api/check-params/videos-overviews.ts b/server/tests/api/check-params/videos-overviews.tsindex c2139d74b3..1da15dc437 100644--- a/server/tests/api/check-params/videos-overviews.ts+++ b/server/tests/api/check-params/videos-overviews.ts@@ -1,7 +1,7 @@/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */import 'mocha'-import { cleanupTests, createSingleServer, PeerTubeServer } from '@shared/extra-utils'+import { cleanupTests, createSingleServer, PeerTubeServer } from '@shared/server-commands'describe('Test videos overview', function () {let server: PeerTubeServerdiff --git a/server/tests/api/check-params/videos.ts b/server/tests/api/check-params/videos.tsindex d02b6e156d..3b2607eed2 100644--- a/server/tests/api/check-params/videos.ts+++ b/server/tests/api/check-params/videos.ts@@ -19,7 +19,7 @@ import {PeerTubeServer,root,setAccessTokensToServers-} from '@shared/extra-utils'+} from '@shared/server-commands'import { HttpStatusCode, PeerTubeProblemDocument, VideoCreateResult, VideoPrivacy } from '@shared/models'const expect = chai.expectdiff --git a/server/tests/api/live/live-constraints.ts b/server/tests/api/live/live-constraints.tsindex 6a6a11796f..89880c46be 100644--- a/server/tests/api/live/live-constraints.ts+++ b/server/tests/api/live/live-constraints.ts@@ -14,7 +14,7 @@ import {setDefaultVideoChannel,wait,waitJobs-} from '../../../../shared/extra-utils'+} from '../../../../shared/server-commands'const expect = chai.expectdiff --git a/server/tests/api/live/live-permanent.ts b/server/tests/api/live/live-permanent.tsindex c5f942901d..12a4d64d80 100644--- a/server/tests/api/live/live-permanent.ts+++ b/server/tests/api/live/live-permanent.ts@@ -14,7 +14,7 @@ import {stopFfmpeg,wait,waitJobs-} from '../../../../shared/extra-utils'+} from '../../../../shared/server-commands'const expect = chai.expectdiff --git a/server/tests/api/live/live-rtmps.ts b/server/tests/api/live/live-rtmps.tsindex 378e6df3cc..31e8f906eb 100644--- a/server/tests/api/live/live-rtmps.ts+++ b/server/tests/api/live/live-rtmps.ts@@ -14,7 +14,7 @@ import {stopFfmpeg,testFfmpegStreamError,waitUntilLivePublishedOnAllServers-} from '../../../../shared/extra-utils'+} from '../../../../shared/server-commands'const expect = chai.expectdiff --git a/server/tests/api/live/live-save-replay.ts b/server/tests/api/live/live-save-replay.tsindex 6c4ea90ca8..9fb6b4e544 100644--- a/server/tests/api/live/live-save-replay.ts+++ b/server/tests/api/live/live-save-replay.ts@@ -18,7 +18,7 @@ import {waitJobs,waitUntilLivePublishedOnAllServers,waitUntilLiveSavedOnAllServers-} from '@shared/extra-utils'+} from '@shared/server-commands'import { HttpStatusCode, LiveVideoCreate, VideoPrivacy, VideoState } from '@shared/models'const expect = chai.expectdiff --git a/server/tests/api/live/live-socket-messages.ts b/server/tests/api/live/live-socket-messages.tsindex 33ee2c0514..42cf9c5f67 100644--- a/server/tests/api/live/live-socket-messages.ts+++ b/server/tests/api/live/live-socket-messages.ts@@ -14,7 +14,7 @@ import {wait,waitJobs,waitUntilLivePublishedOnAllServers-} from '../../../../shared/extra-utils'+} from '../../../../shared/server-commands'const expect = chai.expectdiff --git a/server/tests/api/live/live-views.ts b/server/tests/api/live/live-views.tsindex 9186af8e74..5de4436bec 100644--- a/server/tests/api/live/live-views.ts+++ b/server/tests/api/live/live-views.ts@@ -15,7 +15,7 @@ import {wait,waitJobs,waitUntilLivePublishedOnAllServers-} from '../../../../shared/extra-utils'+} from '../../../../shared/server-commands'const expect = chai.expectdiff --git a/server/tests/api/live/live.ts b/server/tests/api/live/live.tsindex b96c03cf85..3869fd6c7d 100644--- a/server/tests/api/live/live.ts+++ b/server/tests/api/live/live.ts@@ -24,7 +24,7 @@ import {wait,waitJobs,waitUntilLivePublishedOnAllServers-} from '@shared/extra-utils'+} from '@shared/server-commands'import {HttpStatusCode,LiveVideo,diff --git a/server/tests/api/moderation/abuses.ts b/server/tests/api/moderation/abuses.tsindex c258414ce3..9eb84fdecf 100644--- a/server/tests/api/moderation/abuses.ts+++ b/server/tests/api/moderation/abuses.ts@@ -10,7 +10,7 @@ import {PeerTubeServer,setAccessTokensToServers,waitJobs-} from '@shared/extra-utils'+} from '@shared/server-commands'import { AbuseMessage, AbusePredefinedReasonsString, AbuseState, AdminAbuse, UserAbuse } from '@shared/models'const expect = chai.expectdiff --git a/server/tests/api/moderation/blocklist-notification.ts b/server/tests/api/moderation/blocklist-notification.tsindex 75b15c2987..d1e2ea56e8 100644--- a/server/tests/api/moderation/blocklist-notification.ts+++ b/server/tests/api/moderation/blocklist-notification.ts@@ -2,7 +2,7 @@import 'mocha'import * as chai from 'chai'-import { cleanupTests, createMultipleServers, doubleFollow, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils'+import { cleanupTests, createMultipleServers, doubleFollow, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/server-commands'import { UserNotificationType } from '@shared/models'const expect = chai.expectdiff --git a/server/tests/api/moderation/blocklist.ts b/server/tests/api/moderation/blocklist.tsindex b3fd8ecac8..b45460bb4f 100644--- a/server/tests/api/moderation/blocklist.ts+++ b/server/tests/api/moderation/blocklist.ts@@ -11,7 +11,7 @@ import {PeerTubeServer,setAccessTokensToServers,waitJobs-} from '@shared/extra-utils'+} from '@shared/server-commands'import { UserNotificationType } from '@shared/models'const expect = chai.expectdiff --git a/server/tests/api/moderation/video-blacklist.ts b/server/tests/api/moderation/video-blacklist.tsindex d5838191ad..4e2887fa0c 100644--- a/server/tests/api/moderation/video-blacklist.ts+++ b/server/tests/api/moderation/video-blacklist.ts@@ -13,7 +13,7 @@ import {PeerTubeServer,setAccessTokensToServers,waitJobs-} from '@shared/extra-utils'+} from '@shared/server-commands'import { UserAdminFlag, UserRole, VideoBlacklist, VideoBlacklistType } from '@shared/models'const expect = chai.expectdiff --git a/server/tests/api/notifications/admin-notifications.ts b/server/tests/api/notifications/admin-notifications.tsindex c00d4e2575..18962a71e7 100644--- a/server/tests/api/notifications/admin-notifications.ts+++ b/server/tests/api/notifications/admin-notifications.ts@@ -12,7 +12,7 @@ import {PeerTubeServer,prepareNotificationsTest,wait-} from '@shared/extra-utils'+} from '@shared/server-commands'import { PluginType, UserNotification, UserNotificationType } from '@shared/models'describe('Test admin notifications', function () {diff --git a/server/tests/api/notifications/comments-notifications.ts b/server/tests/api/notifications/comments-notifications.tsindex 7cbb213979..919be4bcaa 100644--- a/server/tests/api/notifications/comments-notifications.ts+++ b/server/tests/api/notifications/comments-notifications.ts@@ -11,7 +11,7 @@ import {PeerTubeServer,prepareNotificationsTest,waitJobs-} from '@shared/extra-utils'+} from '@shared/server-commands'import { UserNotification } from '@shared/models'const expect = chai.expectdiff --git a/server/tests/api/notifications/moderation-notifications.ts b/server/tests/api/notifications/moderation-notifications.tsindex 6d8e5359bd..4da9d26840 100644--- a/server/tests/api/notifications/moderation-notifications.ts+++ b/server/tests/api/notifications/moderation-notifications.ts@@ -23,7 +23,7 @@ import {prepareNotificationsTest,wait,waitJobs-} from '@shared/extra-utils'+} from '@shared/server-commands'import { AbuseState, CustomConfig, UserNotification, UserRole, VideoPrivacy } from '@shared/models'describe('Test moderation notifications', function () {diff --git a/server/tests/api/notifications/notifications-api.ts b/server/tests/api/notifications/notifications-api.tsindex a529a9bf7b..aeb73350bd 100644--- a/server/tests/api/notifications/notifications-api.ts+++ b/server/tests/api/notifications/notifications-api.ts@@ -11,7 +11,7 @@ import {PeerTubeServer,prepareNotificationsTest,waitJobs-} from '@shared/extra-utils'+} from '@shared/server-commands'import { UserNotification, UserNotificationSettingValue } from '@shared/models'const expect = chai.expectdiff --git a/server/tests/api/notifications/user-notifications.ts b/server/tests/api/notifications/user-notifications.tsindex 6db0347cc1..a2fcdf2ef5 100644--- a/server/tests/api/notifications/user-notifications.ts+++ b/server/tests/api/notifications/user-notifications.ts@@ -17,7 +17,7 @@ import {uploadRandomVideoOnServers,wait,waitJobs-} from '@shared/extra-utils'+} from '@shared/server-commands'import { UserNotification, UserNotificationType, VideoPrivacy } from '@shared/models'const expect = chai.expectdiff --git a/server/tests/api/object-storage/live.ts b/server/tests/api/object-storage/live.tsindex 3726a717bd..2c341c139d 100644--- a/server/tests/api/object-storage/live.ts+++ b/server/tests/api/object-storage/live.ts@@ -18,7 +18,7 @@ import {waitJobs,waitUntilLivePublishedOnAllServers,waitUntilLiveSavedOnAllServers-} from '@shared/extra-utils'+} from '@shared/server-commands'import { HttpStatusCode, LiveVideoCreate, VideoFile, VideoPrivacy } from '@shared/models'const expect = chai.expectdiff --git a/server/tests/api/object-storage/video-imports.ts b/server/tests/api/object-storage/video-imports.tsindex 363fe3b5be..adca16e8f9 100644--- a/server/tests/api/object-storage/video-imports.ts+++ b/server/tests/api/object-storage/video-imports.ts@@ -14,7 +14,7 @@ import {setAccessTokensToServers,setDefaultVideoChannel,waitJobs-} from '@shared/extra-utils'+} from '@shared/server-commands'import { HttpStatusCode, VideoPrivacy } from '@shared/models'const expect = chai.expectdiff --git a/server/tests/api/object-storage/videos.ts b/server/tests/api/object-storage/videos.tsindex 35a5f19eda..bf469015f8 100644--- a/server/tests/api/object-storage/videos.ts+++ b/server/tests/api/object-storage/videos.ts@@ -20,7 +20,7 @@ import {setAccessTokensToServers,waitJobs,webtorrentAdd-} from '@shared/extra-utils'+} from '@shared/server-commands'import { HttpStatusCode, VideoDetails } from '@shared/models'const expect = chai.expectdiff --git a/server/tests/api/redundancy/manage-redundancy.ts b/server/tests/api/redundancy/manage-redundancy.tsindex 5fd464dedb..cbf3106bd4 100644--- a/server/tests/api/redundancy/manage-redundancy.ts+++ b/server/tests/api/redundancy/manage-redundancy.ts@@ -10,7 +10,7 @@ import {RedundancyCommand,setAccessTokensToServers,waitJobs-} from '@shared/extra-utils'+} from '@shared/server-commands'import { VideoPrivacy, VideoRedundanciesTarget } from '@shared/models'const expect = chai.expectdiff --git a/server/tests/api/redundancy/redundancy-constraints.ts b/server/tests/api/redundancy/redundancy-constraints.tsindex 933a2c7760..1a8d8183b6 100644--- a/server/tests/api/redundancy/redundancy-constraints.ts+++ b/server/tests/api/redundancy/redundancy-constraints.ts@@ -2,7 +2,7 @@import 'mocha'import { expect } from 'chai'-import { cleanupTests, createSingleServer, killallServers, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils'+import { cleanupTests, createSingleServer, killallServers, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/server-commands'import { VideoPrivacy } from '@shared/models'describe('Test redundancy constraints', function () {diff --git a/server/tests/api/redundancy/redundancy.ts b/server/tests/api/redundancy/redundancy.tsindex b5929129a9..556cfbc31f 100644--- a/server/tests/api/redundancy/redundancy.ts+++ b/server/tests/api/redundancy/redundancy.ts@@ -19,7 +19,7 @@ import {setAccessTokensToServers,wait,waitJobs-} from '@shared/extra-utils'+} from '@shared/server-commands'import {HttpStatusCode,VideoDetails,diff --git a/server/tests/api/search/search-activitypub-video-channels.ts b/server/tests/api/search/search-activitypub-video-channels.tsindex efcdb33dcf..1f29f840a5 100644--- a/server/tests/api/search/search-activitypub-video-channels.ts+++ b/server/tests/api/search/search-activitypub-video-channels.ts@@ -10,7 +10,7 @@ import {setAccessTokensToServers,wait,waitJobs-} from '@shared/extra-utils'+} from '@shared/server-commands'import { VideoChannel } from '@shared/models'const expect = chai.expectdiff --git a/server/tests/api/search/search-activitypub-video-playlists.ts b/server/tests/api/search/search-activitypub-video-playlists.tsindex 34b3182681..550af8ed20 100644--- a/server/tests/api/search/search-activitypub-video-playlists.ts+++ b/server/tests/api/search/search-activitypub-video-playlists.ts@@ -11,7 +11,7 @@ import {setDefaultVideoChannel,wait,waitJobs-} from '@shared/extra-utils'+} from '@shared/server-commands'import { VideoPlaylistPrivacy } from '@shared/models'const expect = chai.expectdiff --git a/server/tests/api/search/search-activitypub-videos.ts b/server/tests/api/search/search-activitypub-videos.tsindex a2e6e70fea..5aa3738c9a 100644--- a/server/tests/api/search/search-activitypub-videos.ts+++ b/server/tests/api/search/search-activitypub-videos.ts@@ -10,7 +10,7 @@ import {setAccessTokensToServers,wait,waitJobs-} from '@shared/extra-utils'+} from '@shared/server-commands'import { VideoPrivacy } from '@shared/models'const expect = chai.expectdiff --git a/server/tests/api/search/search-channels.ts b/server/tests/api/search/search-channels.tsindex 67612537c9..8a92def61d 100644--- a/server/tests/api/search/search-channels.ts+++ b/server/tests/api/search/search-channels.ts@@ -9,7 +9,7 @@ import {PeerTubeServer,SearchCommand,setAccessTokensToServers-} from '@shared/extra-utils'+} from '@shared/server-commands'import { VideoChannel } from '@shared/models'const expect = chai.expectdiff --git a/server/tests/api/search/search-index.ts b/server/tests/api/search/search-index.tsindex 1845c2069d..f84d033454 100644--- a/server/tests/api/search/search-index.ts+++ b/server/tests/api/search/search-index.ts@@ -2,7 +2,7 @@import 'mocha'import * as chai from 'chai'-import { cleanupTests, createSingleServer, PeerTubeServer, SearchCommand, setAccessTokensToServers } from '@shared/extra-utils'+import { cleanupTests, createSingleServer, PeerTubeServer, SearchCommand, setAccessTokensToServers } from '@shared/server-commands'import {BooleanBothQuery,VideoChannelsSearchQuery,diff --git a/server/tests/api/search/search-playlists.ts b/server/tests/api/search/search-playlists.tsindex 15aac029a3..1e9c8d4bb1 100644--- a/server/tests/api/search/search-playlists.ts+++ b/server/tests/api/search/search-playlists.ts@@ -10,7 +10,7 @@ import {SearchCommand,setAccessTokensToServers,setDefaultVideoChannel-} from '@shared/extra-utils'+} from '@shared/server-commands'import { VideoPlaylistPrivacy } from '@shared/models'const expect = chai.expectdiff --git a/server/tests/api/search/search-videos.ts b/server/tests/api/search/search-videos.tsindex ad2a2fddce..bf2375ffa4 100644--- a/server/tests/api/search/search-videos.ts+++ b/server/tests/api/search/search-videos.ts@@ -12,7 +12,7 @@ import {setDefaultVideoChannel,stopFfmpeg,wait-} from '@shared/extra-utils'+} from '@shared/server-commands'import { VideoPrivacy } from '@shared/models'const expect = chai.expectdiff --git a/server/tests/api/server/auto-follows.ts b/server/tests/api/server/auto-follows.tsindex 90a668edb0..74bb96040e 100644--- a/server/tests/api/server/auto-follows.ts+++ b/server/tests/api/server/auto-follows.ts@@ -10,7 +10,7 @@ import {setAccessTokensToServers,wait,waitJobs-} from '@shared/extra-utils'+} from '@shared/server-commands'const expect = chai.expectdiff --git a/server/tests/api/server/bulk.ts b/server/tests/api/server/bulk.tsindex 16cbcd5c38..1b81a69545 100644--- a/server/tests/api/server/bulk.ts+++ b/server/tests/api/server/bulk.ts@@ -10,7 +10,7 @@ import {PeerTubeServer,setAccessTokensToServers,waitJobs-} from '@shared/extra-utils'+} from '@shared/server-commands'const expect = chai.expectdiff --git a/server/tests/api/server/config-defaults.ts b/server/tests/api/server/config-defaults.tsindex 117fc20d7a..4ceda7de3c 100644--- a/server/tests/api/server/config-defaults.ts+++ b/server/tests/api/server/config-defaults.ts@@ -9,7 +9,7 @@ import {PeerTubeServer,setAccessTokensToServers,setDefaultVideoChannel-} from '@shared/extra-utils'+} from '@shared/server-commands'import { VideoDetails, VideoPrivacy } from '@shared/models'const expect = chai.expectdiff --git a/server/tests/api/server/config.ts b/server/tests/api/server/config.tsindex 96ec17b0fc..2e6617a154 100644--- a/server/tests/api/server/config.ts+++ b/server/tests/api/server/config.ts@@ -10,7 +10,7 @@ import {parallelTests,PeerTubeServer,setAccessTokensToServers-} from '@shared/extra-utils'+} from '@shared/server-commands'import { CustomConfig, HttpStatusCode } from '@shared/models'const expect = chai.expectdiff --git a/server/tests/api/server/contact-form.ts b/server/tests/api/server/contact-form.tsindex c555661adc..1092514531 100644--- a/server/tests/api/server/contact-form.ts+++ b/server/tests/api/server/contact-form.ts@@ -11,7 +11,7 @@ import {setAccessTokensToServers,wait,waitJobs-} from '@shared/extra-utils'+} from '@shared/server-commands'import { HttpStatusCode } from '@shared/models'const expect = chai.expectdiff --git a/server/tests/api/server/email.ts b/server/tests/api/server/email.tsindex cd8d703411..6fa6053cb3 100644--- a/server/tests/api/server/email.ts+++ b/server/tests/api/server/email.ts@@ -2,7 +2,7 @@import 'mocha'import * as chai from 'chai'-import { cleanupTests, createSingleServer, MockSmtpServer, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils'+import { cleanupTests, createSingleServer, MockSmtpServer, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/server-commands'import { HttpStatusCode } from '@shared/models'const expect = chai.expectdiff --git a/server/tests/api/server/follow-constraints.ts b/server/tests/api/server/follow-constraints.tsindex 471f5d8d08..0f3c138ad4 100644--- a/server/tests/api/server/follow-constraints.ts+++ b/server/tests/api/server/follow-constraints.ts@@ -2,7 +2,7 @@import 'mocha'import * as chai from 'chai'-import { cleanupTests, createMultipleServers, doubleFollow, PeerTubeServer, setAccessTokensToServers } from '@shared/extra-utils'+import { cleanupTests, createMultipleServers, doubleFollow, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands'import { HttpStatusCode, PeerTubeProblemDocument, ServerErrorCode } from '@shared/models'const expect = chai.expectdiff --git a/server/tests/api/server/follows-moderation.ts b/server/tests/api/server/follows-moderation.tsindex 921f510435..120bd7f885 100644--- a/server/tests/api/server/follows-moderation.ts+++ b/server/tests/api/server/follows-moderation.ts@@ -9,7 +9,7 @@ import {PeerTubeServer,setAccessTokensToServers,waitJobs-} from '@shared/extra-utils'+} from '@shared/server-commands'const expect = chai.expectdiff --git a/server/tests/api/server/follows.ts b/server/tests/api/server/follows.tsindex c132d99eab..e128c36a5b 100644--- a/server/tests/api/server/follows.ts+++ b/server/tests/api/server/follows.ts@@ -12,7 +12,7 @@ import {setAccessTokensToServers,testCaptionFile,waitJobs-} from '@shared/extra-utils'+} from '@shared/server-commands'import { VideoCreateResult, VideoPrivacy } from '@shared/models'import { completeVideoCheck } from '@server/tests/shared/video'diff --git a/server/tests/api/server/handle-down.ts b/server/tests/api/server/handle-down.tsindex 2d059c0ed8..b134e074be 100644--- a/server/tests/api/server/handle-down.ts+++ b/server/tests/api/server/handle-down.ts@@ -11,7 +11,7 @@ import {setAccessTokensToServers,wait,waitJobs-} from '@shared/extra-utils'+} from '@shared/server-commands'import { HttpStatusCode, JobState, VideoCreateResult, VideoPrivacy } from '@shared/models'import { completeVideoCheck } from '@server/tests/shared/video'diff --git a/server/tests/api/server/homepage.ts b/server/tests/api/server/homepage.tsindex cb3ba56778..552ee98cf6 100644--- a/server/tests/api/server/homepage.ts+++ b/server/tests/api/server/homepage.ts@@ -10,7 +10,7 @@ import {killallServers,PeerTubeServer,setAccessTokensToServers-} from '../../../../shared/extra-utils/index'+} from '../../../../shared/server-commands/index'const expect = chai.expectdiff --git a/server/tests/api/server/jobs.ts b/server/tests/api/server/jobs.tsindex 5d946f5e81..5b38f67415 100644--- a/server/tests/api/server/jobs.ts+++ b/server/tests/api/server/jobs.ts@@ -10,7 +10,7 @@ import {PeerTubeServer,setAccessTokensToServers,waitJobs-} from '@shared/extra-utils'+} from '@shared/server-commands'const expect = chai.expectdiff --git a/server/tests/api/server/logs.ts b/server/tests/api/server/logs.tsindex 4fa13886e9..697f103379 100644--- a/server/tests/api/server/logs.ts+++ b/server/tests/api/server/logs.ts@@ -10,7 +10,7 @@ import {PeerTubeServer,setAccessTokensToServers,waitJobs-} from '@shared/extra-utils'+} from '@shared/server-commands'const expect = chai.expectdiff --git a/server/tests/api/server/no-client.ts b/server/tests/api/server/no-client.tsindex 1e0c95a3b1..9139077884 100644--- a/server/tests/api/server/no-client.ts+++ b/server/tests/api/server/no-client.ts@@ -1,6 +1,6 @@import 'mocha'import request from 'supertest'-import { cleanupTests, createSingleServer, PeerTubeServer } from '@shared/extra-utils'+import { cleanupTests, createSingleServer, PeerTubeServer } from '@shared/server-commands'import { HttpStatusCode } from '@shared/models'describe('Start and stop server without web client routes', function () {diff --git a/server/tests/api/server/plugins.ts b/server/tests/api/server/plugins.tsindex 5f9f4ffddf..fbcd891019 100644--- a/server/tests/api/server/plugins.ts+++ b/server/tests/api/server/plugins.ts@@ -11,7 +11,7 @@ import {setAccessTokensToServers,testHelloWorldRegisteredSettings,wait-} from '@shared/extra-utils'+} from '@shared/server-commands'import { HttpStatusCode, PluginType } from '@shared/models'const expect = chai.expectdiff --git a/server/tests/api/server/proxy.ts b/server/tests/api/server/proxy.tsindex 29f3e10d89..626a0d8603 100644--- a/server/tests/api/server/proxy.ts+++ b/server/tests/api/server/proxy.ts@@ -11,8 +11,8 @@ import {setAccessTokensToServers,setDefaultVideoChannel,waitJobs-} from '@shared/extra-utils'-import { MockProxy } from '@shared/extra-utils/mock-servers/mock-proxy'+} from '@shared/server-commands'+import { MockProxy } from '@shared/server-commands/mock-servers/mock-proxy'import { HttpStatusCode, VideoPrivacy } from '@shared/models'const expect = chai.expectdiff --git a/server/tests/api/server/reverse-proxy.ts b/server/tests/api/server/reverse-proxy.tsindex 484f88d674..fc9b88a6a8 100644--- a/server/tests/api/server/reverse-proxy.ts+++ b/server/tests/api/server/reverse-proxy.ts@@ -1,7 +1,7 @@/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */import { expect } from 'chai'-import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers, wait } from '@shared/extra-utils'+import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers, wait } from '@shared/server-commands'import { HttpStatusCode } from '@shared/models'describe('Test application behind a reverse proxy', function () {diff --git a/server/tests/api/server/services.ts b/server/tests/api/server/services.tsindex 823630ae43..5fd2abda41 100644--- a/server/tests/api/server/services.ts+++ b/server/tests/api/server/services.ts@@ -2,7 +2,7 @@import 'mocha'import * as chai from 'chai'-import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers, setDefaultVideoChannel } from '@shared/extra-utils'+import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers, setDefaultVideoChannel } from '@shared/server-commands'import { Video, VideoPlaylistPrivacy } from '@shared/models'const expect = chai.expectdiff --git a/server/tests/api/server/slow-follows.ts b/server/tests/api/server/slow-follows.tsindex 2bef0c9f27..5f24c351be 100644--- a/server/tests/api/server/slow-follows.ts+++ b/server/tests/api/server/slow-follows.ts@@ -2,7 +2,7 @@import 'mocha'import * as chai from 'chai'-import { cleanupTests, createMultipleServers, doubleFollow, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils'+import { cleanupTests, createMultipleServers, doubleFollow, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/server-commands'import { Job } from '@shared/models'const expect = chai.expectdiff --git a/server/tests/api/server/stats.ts b/server/tests/api/server/stats.tsindex efc80463cc..65ef4607bd 100644--- a/server/tests/api/server/stats.ts+++ b/server/tests/api/server/stats.ts@@ -10,7 +10,7 @@ import {setAccessTokensToServers,wait,waitJobs-} from '@shared/extra-utils'+} from '@shared/server-commands'import { ActivityType, VideoPlaylistPrivacy } from '@shared/models'const expect = chai.expectdiff --git a/server/tests/api/server/tracker.ts b/server/tests/api/server/tracker.tsindex 30a9618b30..712bb485f1 100644--- a/server/tests/api/server/tracker.ts+++ b/server/tests/api/server/tracker.ts@@ -3,7 +3,7 @@import 'mocha'import magnetUtil from 'magnet-uri'import WebTorrent from 'webtorrent'-import { cleanupTests, createSingleServer, killallServers, PeerTubeServer, setAccessTokensToServers } from '@shared/extra-utils'+import { cleanupTests, createSingleServer, killallServers, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands'describe('Test tracker', function () {let server: PeerTubeServerdiff --git a/server/tests/api/users/user-subscriptions.ts b/server/tests/api/users/user-subscriptions.tsindex d1d1922385..190a19c386 100644--- a/server/tests/api/users/user-subscriptions.ts+++ b/server/tests/api/users/user-subscriptions.ts@@ -10,7 +10,7 @@ import {setAccessTokensToServers,SubscriptionsCommand,waitJobs-} from '@shared/extra-utils'+} from '@shared/server-commands'const expect = chai.expectdiff --git a/server/tests/api/users/users-multiple-servers.ts b/server/tests/api/users/users-multiple-servers.tsindex d0ca82b078..e6699a059a 100644--- a/server/tests/api/users/users-multiple-servers.ts+++ b/server/tests/api/users/users-multiple-servers.ts@@ -14,7 +14,7 @@ import {setAccessTokensToServers,testImage,waitJobs-} from '@shared/extra-utils'+} from '@shared/server-commands'import { MyUser } from '@shared/models'const expect = chai.expectdiff --git a/server/tests/api/users/users-verification.ts b/server/tests/api/users/users-verification.tsindex f54463359d..9b23ba7972 100644--- a/server/tests/api/users/users-verification.ts+++ b/server/tests/api/users/users-verification.ts@@ -2,7 +2,7 @@import 'mocha'import * as chai from 'chai'-import { cleanupTests, createSingleServer, MockSmtpServer, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils'+import { cleanupTests, createSingleServer, MockSmtpServer, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/server-commands'import { HttpStatusCode } from '@shared/models'const expect = chai.expectdiff --git a/server/tests/api/users/users.ts b/server/tests/api/users/users.tsindex f00cbab5a7..fc44a6acd3 100644--- a/server/tests/api/users/users.ts+++ b/server/tests/api/users/users.ts@@ -11,7 +11,7 @@ import {setAccessTokensToServers,testImage,waitJobs-} from '@shared/extra-utils'+} from '@shared/server-commands'import { AbuseState, HttpStatusCode, OAuth2ErrorCode, UserAdminFlag, UserRole, Video, VideoPlaylistType } from '@shared/models'const expect = chai.expectdiff --git a/server/tests/api/videos/audio-only.ts b/server/tests/api/videos/audio-only.tsindex f4b635bd5c..4b27f2fbe2 100644--- a/server/tests/api/videos/audio-only.ts+++ b/server/tests/api/videos/audio-only.ts@@ -3,7 +3,7 @@import 'mocha'import * as chai from 'chai'import { getAudioStream, getVideoStreamSize } from '@server/helpers/ffprobe-utils'-import { cleanupTests, createMultipleServers, doubleFollow, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils'+import { cleanupTests, createMultipleServers, doubleFollow, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/server-commands'const expect = chai.expectdiff --git a/server/tests/api/videos/multiple-servers.ts b/server/tests/api/videos/multiple-servers.tsindex 9e7b39cfa4..cb83fa0f07 100644--- a/server/tests/api/videos/multiple-servers.ts+++ b/server/tests/api/videos/multiple-servers.ts@@ -18,7 +18,7 @@ import {wait,waitJobs,webtorrentAdd-} from '@shared/extra-utils'+} from '@shared/server-commands'import { HttpStatusCode, VideoCommentThreadTree, VideoPrivacy } from '@shared/models'import { completeVideoCheck } from '@server/tests/shared/video'diff --git a/server/tests/api/videos/resumable-upload.ts b/server/tests/api/videos/resumable-upload.tsindex 1ba7cdbcc4..0842817dc7 100644--- a/server/tests/api/videos/resumable-upload.ts+++ b/server/tests/api/videos/resumable-upload.ts@@ -11,7 +11,7 @@ import {PeerTubeServer,setAccessTokensToServers,setDefaultVideoChannel-} from '@shared/extra-utils'+} from '@shared/server-commands'import { HttpStatusCode, VideoPrivacy } from '@shared/models'const expect = chai.expectdiff --git a/server/tests/api/videos/single-server.ts b/server/tests/api/videos/single-server.tsindex 100067f181..e5e12dd191 100644--- a/server/tests/api/videos/single-server.ts+++ b/server/tests/api/videos/single-server.ts@@ -10,7 +10,7 @@ import {setAccessTokensToServers,testImage,wait-} from '@shared/extra-utils'+} from '@shared/server-commands'import { Video, VideoPrivacy } from '@shared/models'import { completeVideoCheck } from '@server/tests/shared/video'diff --git a/server/tests/api/videos/video-captions.ts b/server/tests/api/videos/video-captions.tsindex 3bb0d131cb..9f00312aa3 100644--- a/server/tests/api/videos/video-captions.ts+++ b/server/tests/api/videos/video-captions.ts@@ -12,7 +12,7 @@ import {testCaptionFile,wait,waitJobs-} from '@shared/extra-utils'+} from '@shared/server-commands'const expect = chai.expectdiff --git a/server/tests/api/videos/video-change-ownership.ts b/server/tests/api/videos/video-change-ownership.tsindex d6665fe4e8..6c229c6cfa 100644--- a/server/tests/api/videos/video-change-ownership.ts+++ b/server/tests/api/videos/video-change-ownership.ts@@ -12,7 +12,7 @@ import {setAccessTokensToServers,setDefaultVideoChannel,waitJobs-} from '@shared/extra-utils'+} from '@shared/server-commands'import { HttpStatusCode, VideoPrivacy } from '@shared/models'const expect = chai.expectdiff --git a/server/tests/api/videos/video-channels.ts b/server/tests/api/videos/video-channels.tsindex 6ab5faa077..2ac577a599 100644--- a/server/tests/api/videos/video-channels.ts+++ b/server/tests/api/videos/video-channels.ts@@ -15,7 +15,7 @@ import {testImage,wait,waitJobs-} from '@shared/extra-utils'+} from '@shared/server-commands'import { User, VideoChannel } from '@shared/models'const expect = chai.expectdiff --git a/server/tests/api/videos/video-comments.ts b/server/tests/api/videos/video-comments.tsindex 61ee545409..bb4f92a9bd 100644--- a/server/tests/api/videos/video-comments.ts+++ b/server/tests/api/videos/video-comments.ts@@ -10,7 +10,7 @@ import {PeerTubeServer,setAccessTokensToServers,testImage-} from '@shared/extra-utils'+} from '@shared/server-commands'const expect = chai.expectdiff --git a/server/tests/api/videos/video-create-transcoding.ts b/server/tests/api/videos/video-create-transcoding.tsindex c4627e0c12..e81f547145 100644--- a/server/tests/api/videos/video-create-transcoding.ts+++ b/server/tests/api/videos/video-create-transcoding.ts@@ -14,7 +14,7 @@ import {PeerTubeServer,setAccessTokensToServers,waitJobs-} from '@shared/extra-utils'+} from '@shared/server-commands'import { HttpStatusCode, VideoDetails } from '@shared/models'const expect = chai.expectdiff --git a/server/tests/api/videos/video-description.ts b/server/tests/api/videos/video-description.tsindex d22b4ed962..23c55f7280 100644--- a/server/tests/api/videos/video-description.ts+++ b/server/tests/api/videos/video-description.ts@@ -2,7 +2,7 @@import 'mocha'import * as chai from 'chai'-import { cleanupTests, createMultipleServers, doubleFollow, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils'+import { cleanupTests, createMultipleServers, doubleFollow, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/server-commands'const expect = chai.expectdiff --git a/server/tests/api/videos/video-files.ts b/server/tests/api/videos/video-files.tsindex fcb2ca2e4d..0b51217401 100644--- a/server/tests/api/videos/video-files.ts+++ b/server/tests/api/videos/video-files.ts@@ -2,7 +2,7 @@import 'mocha'import { expect } from 'chai'-import { cleanupTests, createMultipleServers, doubleFollow, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils'+import { cleanupTests, createMultipleServers, doubleFollow, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/server-commands'describe('Test videos files', function () {let servers: PeerTubeServer[]diff --git a/server/tests/api/videos/video-hls.ts b/server/tests/api/videos/video-hls.tsindex a18c3d6720..d050a7a7e2 100644--- a/server/tests/api/videos/video-hls.ts+++ b/server/tests/api/videos/video-hls.ts@@ -21,7 +21,7 @@ import {setAccessTokensToServers,waitJobs,webtorrentAdd-} from '@shared/extra-utils'+} from '@shared/server-commands'import { HttpStatusCode, VideoStreamingPlaylistType } from '@shared/models'import { DEFAULT_AUDIO_RESOLUTION } from '../../../initializers/constants'diff --git a/server/tests/api/videos/video-imports.ts b/server/tests/api/videos/video-imports.tsindex b6168b54e2..2518743f7d 100644--- a/server/tests/api/videos/video-imports.ts+++ b/server/tests/api/videos/video-imports.ts@@ -17,7 +17,7 @@ import {testCaptionFile,testImage,waitJobs-} from '@shared/extra-utils'+} from '@shared/server-commands'import { VideoPrivacy, VideoResolution } from '@shared/models'async function checkVideosServer1 (server: PeerTubeServer, idHttp: string, idMagnet: string, idTorrent: string) {diff --git a/server/tests/api/videos/video-nsfw.ts b/server/tests/api/videos/video-nsfw.tsindex b5d183d627..99ea67a0fe 100644--- a/server/tests/api/videos/video-nsfw.ts+++ b/server/tests/api/videos/video-nsfw.ts@@ -2,7 +2,7 @@import 'mocha'import * as chai from 'chai'-import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers } from '@shared/extra-utils'+import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands'import { BooleanBothQuery, CustomConfig, ResultList, Video, VideosOverview } from '@shared/models'const expect = chai.expectdiff --git a/server/tests/api/videos/video-playlist-thumbnails.ts b/server/tests/api/videos/video-playlist-thumbnails.tsindex f0b2ca169f..e6b6c34eb4 100644--- a/server/tests/api/videos/video-playlist-thumbnails.ts+++ b/server/tests/api/videos/video-playlist-thumbnails.ts@@ -11,7 +11,7 @@ import {setDefaultVideoChannel,testImage,waitJobs-} from '../../../../shared/extra-utils'+} from '../../../../shared/server-commands'import { VideoPlaylistPrivacy } from '../../../../shared/models/videos/playlist/video-playlist-privacy.model'const expect = chai.expectdiff --git a/server/tests/api/videos/video-playlists.ts b/server/tests/api/videos/video-playlists.tsindex f42aee2ffb..6279f5cd05 100644--- a/server/tests/api/videos/video-playlists.ts+++ b/server/tests/api/videos/video-playlists.ts@@ -14,7 +14,7 @@ import {testImage,wait,waitJobs-} from '@shared/extra-utils'+} from '@shared/server-commands'import {HttpStatusCode,VideoPlaylist,diff --git a/server/tests/api/videos/video-privacy.ts b/server/tests/api/videos/video-privacy.tsindex 08b624ff34..13eb941eae 100644--- a/server/tests/api/videos/video-privacy.ts+++ b/server/tests/api/videos/video-privacy.ts@@ -10,7 +10,7 @@ import {setAccessTokensToServers,wait,waitJobs-} from '@shared/extra-utils'+} from '@shared/server-commands'import { HttpStatusCode, VideoCreateResult, VideoPrivacy } from '@shared/models'const expect = chai.expectdiff --git a/server/tests/api/videos/video-schedule-update.ts b/server/tests/api/videos/video-schedule-update.tsindex 3f77387842..9408574ad5 100644--- a/server/tests/api/videos/video-schedule-update.ts+++ b/server/tests/api/videos/video-schedule-update.ts@@ -10,7 +10,7 @@ import {setAccessTokensToServers,wait,waitJobs-} from '@shared/extra-utils'+} from '@shared/server-commands'import { VideoPrivacy } from '@shared/models'const expect = chai.expectdiff --git a/server/tests/api/videos/video-transcoder.ts b/server/tests/api/videos/video-transcoder.tsindex 7ed55b8e8d..f4b0bc53a8 100644--- a/server/tests/api/videos/video-transcoder.ts+++ b/server/tests/api/videos/video-transcoder.ts@@ -16,7 +16,7 @@ import {setAccessTokensToServers,waitJobs,webtorrentAdd-} from '@shared/extra-utils'+} from '@shared/server-commands'import { HttpStatusCode, VideoState } from '@shared/models'import {canDoQuickTranscode,diff --git a/server/tests/api/videos/videos-common-filters.ts b/server/tests/api/videos/videos-common-filters.tsindex ca5f421736..0254662c54 100644--- a/server/tests/api/videos/videos-common-filters.ts+++ b/server/tests/api/videos/videos-common-filters.ts@@ -12,7 +12,7 @@ import {setAccessTokensToServers,setDefaultVideoChannel,waitJobs-} from '@shared/extra-utils'+} from '@shared/server-commands'import { HttpStatusCode, UserRole, Video, VideoDetails, VideoInclude, VideoPrivacy } from '@shared/models'describe('Test videos filter', function () {diff --git a/server/tests/api/videos/videos-history.ts b/server/tests/api/videos/videos-history.tsindex e4bc0bb3a3..813fc4f45d 100644--- a/server/tests/api/videos/videos-history.ts+++ b/server/tests/api/videos/videos-history.ts@@ -10,7 +10,7 @@ import {PeerTubeServer,setAccessTokensToServers,wait-} from '@shared/extra-utils'+} from '@shared/server-commands'import { HttpStatusCode, Video } from '@shared/models'const expect = chai.expectdiff --git a/server/tests/api/videos/videos-overview.ts b/server/tests/api/videos/videos-overview.tsindex 70aa665499..08a4efb634 100644--- a/server/tests/api/videos/videos-overview.ts+++ b/server/tests/api/videos/videos-overview.ts@@ -2,7 +2,7 @@import 'mocha'import * as chai from 'chai'-import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers, wait } from '@shared/extra-utils'+import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers, wait } from '@shared/server-commands'import { VideosOverview } from '@shared/models'const expect = chai.expectdiff --git a/server/tests/api/videos/videos-views-cleaner.ts b/server/tests/api/videos/videos-views-cleaner.tsindex 82268b1bed..7f7597af4c 100644--- a/server/tests/api/videos/videos-views-cleaner.ts+++ b/server/tests/api/videos/videos-views-cleaner.ts@@ -11,7 +11,7 @@ import {setAccessTokensToServers,wait,waitJobs-} from '../../../../shared/extra-utils'+} from '../../../../shared/server-commands'const expect = chai.expectdiff --git a/server/tests/cli/create-import-video-file-job.ts b/server/tests/cli/create-import-video-file-job.tsindex c06b9550cb..5973272e5d 100644--- a/server/tests/cli/create-import-video-file-job.ts+++ b/server/tests/cli/create-import-video-file-job.ts@@ -13,7 +13,7 @@ import {PeerTubeServer,setAccessTokensToServers,waitJobs-} from '@shared/extra-utils'+} from '@shared/server-commands'import { HttpStatusCode, VideoDetails, VideoFile, VideoInclude } from '@shared/models'const expect = chai.expectdiff --git a/server/tests/cli/create-move-video-storage-job.ts b/server/tests/cli/create-move-video-storage-job.tsindex b598c83592..8b66f24bfe 100644--- a/server/tests/cli/create-move-video-storage-job.ts+++ b/server/tests/cli/create-move-video-storage-job.ts@@ -13,7 +13,7 @@ import {PeerTubeServer,setAccessTokensToServers,waitJobs-} from '@shared/extra-utils'+} from '@shared/server-commands'import { HttpStatusCode, VideoDetails } from '@shared/models'async function checkFiles (origin: PeerTubeServer, video: VideoDetails, inObjectStorage: boolean) {diff --git a/server/tests/cli/create-transcoding-job.ts b/server/tests/cli/create-transcoding-job.tsindex fb9c2584fb..ea34286627 100644--- a/server/tests/cli/create-transcoding-job.ts+++ b/server/tests/cli/create-transcoding-job.ts@@ -14,7 +14,7 @@ import {PeerTubeServer,setAccessTokensToServers,waitJobs-} from '../../../shared/extra-utils'+} from '../../../shared/server-commands'const expect = chai.expectdiff --git a/server/tests/cli/peertube.ts b/server/tests/cli/peertube.tsindex 3ac440f841..72213473b5 100644--- a/server/tests/cli/peertube.ts+++ b/server/tests/cli/peertube.ts@@ -14,7 +14,7 @@ import {setAccessTokensToServers,testHelloWorldRegisteredSettings,waitJobs-} from '../../../shared/extra-utils'+} from '../../../shared/server-commands'describe('Test CLI wrapper', function () {let server: PeerTubeServerdiff --git a/server/tests/cli/plugins.ts b/server/tests/cli/plugins.tsindex 07c78cc89e..d9cf9465c3 100644--- a/server/tests/cli/plugins.ts+++ b/server/tests/cli/plugins.ts@@ -9,7 +9,7 @@ import {PeerTubeServer,PluginsCommand,setAccessTokensToServers-} from '../../../shared/extra-utils'+} from '../../../shared/server-commands'describe('Test plugin scripts', function () {let server: PeerTubeServerdiff --git a/server/tests/cli/print-transcode-command.ts b/server/tests/cli/print-transcode-command.tsindex 0b86292516..36c43c6df3 100644--- a/server/tests/cli/print-transcode-command.ts+++ b/server/tests/cli/print-transcode-command.ts@@ -2,7 +2,7 @@import 'mocha'import * as chai from 'chai'-import { buildAbsoluteFixturePath, CLICommand } from '@shared/extra-utils'+import { buildAbsoluteFixturePath, CLICommand } from '@shared/server-commands'import { VideoResolution } from '../../../shared/models/videos'const expect = chai.expectdiff --git a/server/tests/cli/prune-storage.ts b/server/tests/cli/prune-storage.tsindex 4b4f755271..e0bc6a5897 100644--- a/server/tests/cli/prune-storage.ts+++ b/server/tests/cli/prune-storage.ts@@ -17,7 +17,7 @@ import {setDefaultVideoChannel,wait,waitJobs-} from '@shared/extra-utils'+} from '@shared/server-commands'import { HttpStatusCode, VideoPlaylistPrivacy } from '@shared/models'const expect = chai.expectdiff --git a/server/tests/cli/regenerate-thumbnails.ts b/server/tests/cli/regenerate-thumbnails.tsindex 780c9b4bd8..98d15272aa 100644--- a/server/tests/cli/regenerate-thumbnails.ts+++ b/server/tests/cli/regenerate-thumbnails.ts@@ -11,7 +11,7 @@ import {PeerTubeServer,setAccessTokensToServers,waitJobs-} from '../../../shared/extra-utils'+} from '../../../shared/server-commands'async function testThumbnail (server: PeerTubeServer, videoId: number | string) {const video = await server.videos.get({ id: videoId })diff --git a/server/tests/cli/reset-password.ts b/server/tests/cli/reset-password.tsindex 4a02db35d5..34dedb1136 100644--- a/server/tests/cli/reset-password.ts+++ b/server/tests/cli/reset-password.ts@@ -1,5 +1,5 @@import 'mocha'-import { cleanupTests, CLICommand, createSingleServer, PeerTubeServer, setAccessTokensToServers } from '../../../shared/extra-utils'+import { cleanupTests, CLICommand, createSingleServer, PeerTubeServer, setAccessTokensToServers } from '../../../shared/server-commands'describe('Test reset password scripts', function () {let server: PeerTubeServerdiff --git a/server/tests/cli/update-host.ts b/server/tests/cli/update-host.tsindex 43fbaec305..da89ff153f 100644--- a/server/tests/cli/update-host.ts+++ b/server/tests/cli/update-host.ts@@ -11,7 +11,7 @@ import {PeerTubeServer,setAccessTokensToServers,waitJobs-} from '@shared/extra-utils'+} from '@shared/server-commands'describe('Test update host scripts', function () {let server: PeerTubeServerdiff --git a/server/tests/client.ts b/server/tests/client.tsindex a91bec9068..fe048d7ff4 100644--- a/server/tests/client.ts+++ b/server/tests/client.ts@@ -14,7 +14,7 @@ import {setAccessTokensToServers,setDefaultVideoChannel,waitJobs-} from '../../shared/extra-utils'+} from '../../shared/server-commands'const expect = chai.expectdiff --git a/server/tests/external-plugins/auth-ldap.ts b/server/tests/external-plugins/auth-ldap.tsindex acec69df59..326453a5f2 100644--- a/server/tests/external-plugins/auth-ldap.ts+++ b/server/tests/external-plugins/auth-ldap.ts@@ -2,7 +2,7 @@import 'mocha'import { expect } from 'chai'-import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers } from '@shared/extra-utils'+import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands'import { HttpStatusCode } from '@shared/models'describe('Official plugin auth-ldap', function () {diff --git a/server/tests/external-plugins/auto-block-videos.ts b/server/tests/external-plugins/auto-block-videos.tsindex 0eb4bda9ad..2f75ad25b5 100644--- a/server/tests/external-plugins/auto-block-videos.ts+++ b/server/tests/external-plugins/auto-block-videos.ts@@ -11,7 +11,7 @@ import {PeerTubeServer,setAccessTokensToServers,wait-} from '@shared/extra-utils'+} from '@shared/server-commands'import { Video } from '@shared/models'async function check (server: PeerTubeServer, videoUUID: string, exists = true) {diff --git a/server/tests/external-plugins/auto-mute.ts b/server/tests/external-plugins/auto-mute.tsindex 271779dd4c..bfa67e7ad1 100644--- a/server/tests/external-plugins/auto-mute.ts+++ b/server/tests/external-plugins/auto-mute.ts@@ -12,7 +12,7 @@ import {PeerTubeServer,setAccessTokensToServers,wait-} from '@shared/extra-utils'+} from '@shared/server-commands'import { HttpStatusCode } from '@shared/models'describe('Official plugin auto-mute', function () {diff --git a/server/tests/feeds/feeds.ts b/server/tests/feeds/feeds.tsindex a1c976fd30..bf030162e3 100644--- a/server/tests/feeds/feeds.ts+++ b/server/tests/feeds/feeds.ts@@ -12,7 +12,7 @@ import {PeerTubeServer,setAccessTokensToServers,waitJobs-} from '@shared/extra-utils'+} from '@shared/server-commands'import { HttpStatusCode, VideoPrivacy } from '@shared/models'chai.use(require('chai-xml'))diff --git a/server/tests/helpers/image.ts b/server/tests/helpers/image.tsindex 9fe9aa4cba..330139ee4e 100644--- a/server/tests/helpers/image.ts+++ b/server/tests/helpers/image.ts@@ -5,7 +5,7 @@ import { expect } from 'chai'import { readFile, remove } from 'fs-extra'import { join } from 'path'import { processImage } from '../../../server/helpers/image-utils'-import { buildAbsoluteFixturePath, root } from '../../../shared/extra-utils'+import { buildAbsoluteFixturePath, root } from '../../../shared/server-commands'async function checkBuffers (path1: string, path2: string, equals: boolean) {const [ buf1, buf2 ] = await Promise.all([diff --git a/server/tests/helpers/request.ts b/server/tests/helpers/request.tsindex 6edbf2a760..db0cca3905 100644--- a/server/tests/helpers/request.ts+++ b/server/tests/helpers/request.ts@@ -4,8 +4,8 @@ import 'mocha'import { expect } from 'chai'import { pathExists, remove } from 'fs-extra'import { join } from 'path'-import { Mock429 } from '@shared/extra-utils/mock-servers/mock-429'-import { FIXTURE_URLS, root, wait } from '../../../shared/extra-utils'+import { Mock429 } from '@shared/server-commands/mock-servers/mock-429'+import { FIXTURE_URLS, root, wait } from '../../../shared/server-commands'import { doRequest, doRequestAndSaveToFile } from '../../helpers/requests'describe('Request helpers', function () {diff --git a/server/tests/misc-endpoints.ts b/server/tests/misc-endpoints.tsindex 4968eef089..876546d897 100644--- a/server/tests/misc-endpoints.ts+++ b/server/tests/misc-endpoints.ts@@ -2,7 +2,7 @@import 'mocha'import * as chai from 'chai'-import { cleanupTests, createSingleServer, makeGetRequest, PeerTubeServer, setAccessTokensToServers } from '@shared/extra-utils'+import { cleanupTests, createSingleServer, makeGetRequest, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands'import { HttpStatusCode, VideoPrivacy } from '@shared/models'const expect = chai.expectdiff --git a/server/tests/plugins/action-hooks.ts b/server/tests/plugins/action-hooks.tsindex 4c1bc7d063..686926c170 100644--- a/server/tests/plugins/action-hooks.ts+++ b/server/tests/plugins/action-hooks.ts@@ -9,7 +9,7 @@ import {PluginsCommand,setAccessTokensToServers,setDefaultVideoChannel-} from '@shared/extra-utils'+} from '@shared/server-commands'import { ServerHookName, VideoPlaylistPrivacy, VideoPrivacy } from '@shared/models'describe('Test plugin action hooks', function () {diff --git a/server/tests/plugins/external-auth.ts b/server/tests/plugins/external-auth.tsindex 25b25bfee9..a4a3764f55 100644--- a/server/tests/plugins/external-auth.ts+++ b/server/tests/plugins/external-auth.ts@@ -10,7 +10,7 @@ import {PluginsCommand,setAccessTokensToServers,wait-} from '@shared/extra-utils'+} from '@shared/server-commands'import { HttpStatusCode, UserRole } from '@shared/models'async function loginExternal (options: {diff --git a/server/tests/plugins/filter-hooks.ts b/server/tests/plugins/filter-hooks.tsindex ff2afc56bd..a84edfac68 100644--- a/server/tests/plugins/filter-hooks.ts+++ b/server/tests/plugins/filter-hooks.ts@@ -13,7 +13,7 @@ import {setAccessTokensToServers,setDefaultVideoChannel,waitJobs-} from '@shared/extra-utils'+} from '@shared/server-commands'import { HttpStatusCode, VideoDetails, VideoImportState, VideoPlaylist, VideoPlaylistPrivacy, VideoPrivacy } from '@shared/models'const expect = chai.expectdiff --git a/server/tests/plugins/html-injection.ts b/server/tests/plugins/html-injection.tsindex 95c0cd687b..9e10d33020 100644--- a/server/tests/plugins/html-injection.ts+++ b/server/tests/plugins/html-injection.ts@@ -9,7 +9,7 @@ import {PeerTubeServer,PluginsCommand,setAccessTokensToServers-} from '../../../shared/extra-utils'+} from '../../../shared/server-commands'const expect = chai.expectdiff --git a/server/tests/plugins/id-and-pass-auth.ts b/server/tests/plugins/id-and-pass-auth.tsindex fde0166f9a..ea3b0f6ab2 100644--- a/server/tests/plugins/id-and-pass-auth.ts+++ b/server/tests/plugins/id-and-pass-auth.ts@@ -2,7 +2,7 @@import 'mocha'import { expect } from 'chai'-import { cleanupTests, createSingleServer, PeerTubeServer, PluginsCommand, setAccessTokensToServers, wait } from '@shared/extra-utils'+import { cleanupTests, createSingleServer, PeerTubeServer, PluginsCommand, setAccessTokensToServers, wait } from '@shared/server-commands'import { HttpStatusCode, UserRole } from '@shared/models'describe('Test id and pass auth plugins', function () {diff --git a/server/tests/plugins/plugin-helpers.ts b/server/tests/plugins/plugin-helpers.tsindex da84658bbd..4ab4acd584 100644--- a/server/tests/plugins/plugin-helpers.ts+++ b/server/tests/plugins/plugin-helpers.ts@@ -15,7 +15,7 @@ import {PluginsCommand,setAccessTokensToServers,waitJobs-} from '@shared/extra-utils'+} from '@shared/server-commands'import { HttpStatusCode, ThumbnailType } from '@shared/models'function postCommand (server: PeerTubeServer, command: string, bodyArg?: object) {diff --git a/server/tests/plugins/plugin-router.ts b/server/tests/plugins/plugin-router.tsindex b1ac9e2fe7..58629adc7d 100644--- a/server/tests/plugins/plugin-router.ts+++ b/server/tests/plugins/plugin-router.ts@@ -10,7 +10,7 @@ import {PeerTubeServer,PluginsCommand,setAccessTokensToServers-} from '@shared/extra-utils'+} from '@shared/server-commands'import { HttpStatusCode } from '@shared/models'describe('Test plugin helpers', function () {diff --git a/server/tests/plugins/plugin-storage.ts b/server/tests/plugins/plugin-storage.tsindex c0596819eb..0bfc4fe28f 100644--- a/server/tests/plugins/plugin-storage.ts+++ b/server/tests/plugins/plugin-storage.ts@@ -11,7 +11,7 @@ import {PeerTubeServer,PluginsCommand,setAccessTokensToServers-} from '@shared/extra-utils'+} from '@shared/server-commands'import { HttpStatusCode } from '@shared/models'describe('Test plugin storage', function () {diff --git a/server/tests/plugins/plugin-transcoding.ts b/server/tests/plugins/plugin-transcoding.tsindex 93637e3cea..5ab6864729 100644--- a/server/tests/plugins/plugin-transcoding.ts+++ b/server/tests/plugins/plugin-transcoding.ts@@ -12,7 +12,7 @@ import {setDefaultVideoChannel,testFfmpegStreamError,waitJobs-} from '@shared/extra-utils'+} from '@shared/server-commands'import { VideoPrivacy } from '@shared/models'async function createLiveWrapper (server: PeerTubeServer) {diff --git a/server/tests/plugins/plugin-unloading.ts b/server/tests/plugins/plugin-unloading.tsindex 6bf2fda9b3..a94b836950 100644--- a/server/tests/plugins/plugin-unloading.ts+++ b/server/tests/plugins/plugin-unloading.ts@@ -9,7 +9,7 @@ import {PeerTubeServer,PluginsCommand,setAccessTokensToServers-} from '@shared/extra-utils'+} from '@shared/server-commands'import { HttpStatusCode } from '@shared/models'describe('Test plugins module unloading', function () {diff --git a/server/tests/plugins/translations.ts b/server/tests/plugins/translations.tsindex 8b25c6b758..0b6e5793dd 100644--- a/server/tests/plugins/translations.ts+++ b/server/tests/plugins/translations.ts@@ -2,7 +2,7 @@import 'mocha'import * as chai from 'chai'-import { cleanupTests, createSingleServer, PeerTubeServer, PluginsCommand, setAccessTokensToServers } from '@shared/extra-utils'+import { cleanupTests, createSingleServer, PeerTubeServer, PluginsCommand, setAccessTokensToServers } from '@shared/server-commands'const expect = chai.expectdiff --git a/server/tests/plugins/video-constants.ts b/server/tests/plugins/video-constants.tsindex 19cba6c2c8..6dce6922f7 100644--- a/server/tests/plugins/video-constants.ts+++ b/server/tests/plugins/video-constants.ts@@ -9,7 +9,7 @@ import {PeerTubeServer,PluginsCommand,setAccessTokensToServers-} from '@shared/extra-utils'+} from '@shared/server-commands'import { HttpStatusCode, VideoPlaylistPrivacy } from '@shared/models'const expect = chai.expectdiff --git a/server/tests/shared/video.ts b/server/tests/shared/video.tsindex 95b30b27c3..cf923d4cd4 100644--- a/server/tests/shared/video.ts+++ b/server/tests/shared/video.ts@@ -1,5 +1,5 @@/* eslint-disable @typescript-eslint/no-unused-expressions */-import { dateIsValid, makeRawRequest, PeerTubeServer, testImage, webtorrentAdd } from '@shared/extra-utils'+import { dateIsValid, makeRawRequest, PeerTubeServer, testImage, webtorrentAdd } from '@shared/server-commands'import { expect } from 'chai'import { loadLanguages, VIDEO_CATEGORIES, VIDEO_LANGUAGES, VIDEO_LICENCES, VIDEO_PRIVACIES } from '@server/initializers/constants'import { getLowercaseExtension, uuidRegex } from '@shared/core-utils'diff --git a/server/tools/cli.ts b/server/tools/cli.tsindex 7c763734f6..00adcedeb9 100644--- a/server/tools/cli.ts+++ b/server/tools/cli.ts@@ -2,7 +2,7 @@ import { Command } from 'commander'import { Netrc } from 'netrc-parser'import { join } from 'path'import { createLogger, format, transports } from 'winston'-import { PeerTubeServer } from '@shared/extra-utils'+import { PeerTubeServer } from '@shared/server-commands'import { UserRole } from '@shared/models'import { VideoPrivacy } from '../../shared/models/videos'import { getAppNumber, isTestInstance } from '../helpers/core-utils'diff --git a/server/tools/peertube-import-videos.ts b/server/tools/peertube-import-videos.tsindex 223bf7f1b9..8314551f64 100644--- a/server/tools/peertube-import-videos.ts+++ b/server/tools/peertube-import-videos.ts@@ -15,7 +15,7 @@ import {getLogger,getServerCredentials} from './cli'-import { wait } from '@shared/extra-utils'+import { wait } from '@shared/server-commands'import { YoutubeDLCLI, YoutubeDLInfo, YoutubeDLInfoBuilder } from '@server/helpers/youtube-dl'import prompt = require('prompt')diff --git a/shared/extra-utils/index.ts b/shared/extra-utils/index.tsindex 4b3636d068..5710c5ab50 100644--- a/shared/extra-utils/index.ts+++ b/shared/extra-utils/index.ts@@ -1,15 +1 @@-export * from './bulk'-export * from './cli'-export * from './custom-pages'-export * from './feeds'-export * from './logs'-export * from './miscs'-export * from './mock-servers'-export * from './moderation'-export * from './overviews'-export * from './requests'-export * from './search'-export * from './server'-export * from './socket'-export * from './users'-export * from './videos'+export * from './ffprobe'diff --git a/shared/extra-utils/bulk/bulk-command.ts b/shared/server-commands/bulk/bulk-command.tssimilarity index 100%rename from shared/extra-utils/bulk/bulk-command.tsrename to shared/server-commands/bulk/bulk-command.tsdiff --git a/shared/extra-utils/bulk/index.ts b/shared/server-commands/bulk/index.tssimilarity index 100%rename from shared/extra-utils/bulk/index.tsrename to shared/server-commands/bulk/index.tsdiff --git a/shared/extra-utils/cli/cli-command.ts b/shared/server-commands/cli/cli-command.tssimilarity index 100%rename from shared/extra-utils/cli/cli-command.tsrename to shared/server-commands/cli/cli-command.tsdiff --git a/shared/extra-utils/cli/index.ts b/shared/server-commands/cli/index.tssimilarity index 100%rename from shared/extra-utils/cli/index.tsrename to shared/server-commands/cli/index.tsdiff --git a/shared/extra-utils/custom-pages/custom-pages-command.ts b/shared/server-commands/custom-pages/custom-pages-command.tssimilarity index 100%rename from shared/extra-utils/custom-pages/custom-pages-command.tsrename to shared/server-commands/custom-pages/custom-pages-command.tsdiff --git a/shared/extra-utils/custom-pages/index.ts b/shared/server-commands/custom-pages/index.tssimilarity index 100%rename from shared/extra-utils/custom-pages/index.tsrename to shared/server-commands/custom-pages/index.tsdiff --git a/shared/extra-utils/feeds/feeds-command.ts b/shared/server-commands/feeds/feeds-command.tssimilarity index 100%rename from shared/extra-utils/feeds/feeds-command.tsrename to shared/server-commands/feeds/feeds-command.tsdiff --git a/shared/extra-utils/feeds/index.ts b/shared/server-commands/feeds/index.tssimilarity index 100%rename from shared/extra-utils/feeds/index.tsrename to shared/server-commands/feeds/index.tsdiff --git a/shared/server-commands/index.ts b/shared/server-commands/index.tsnew file mode 100644index 0000000000..4b3636d068--- /dev/null+++ b/shared/server-commands/index.ts@@ -0,0 +1,15 @@+export * from './bulk'+export * from './cli'+export * from './custom-pages'+export * from './feeds'+export * from './logs'+export * from './miscs'+export * from './mock-servers'+export * from './moderation'+export * from './overviews'+export * from './requests'+export * from './search'+export * from './server'+export * from './socket'+export * from './users'+export * from './videos'diff --git a/shared/extra-utils/logs/index.ts b/shared/server-commands/logs/index.tssimilarity index 100%rename from shared/extra-utils/logs/index.tsrename to shared/server-commands/logs/index.tsdiff --git a/shared/extra-utils/logs/logs-command.ts b/shared/server-commands/logs/logs-command.tssimilarity index 100%rename from shared/extra-utils/logs/logs-command.tsrename to shared/server-commands/logs/logs-command.tsdiff --git a/shared/extra-utils/miscs/checks.ts b/shared/server-commands/miscs/checks.tssimilarity index 100%rename from shared/extra-utils/miscs/checks.tsrename to shared/server-commands/miscs/checks.tsdiff --git a/shared/extra-utils/miscs/generate.ts b/shared/server-commands/miscs/generate.tssimilarity index 100%rename from shared/extra-utils/miscs/generate.tsrename to shared/server-commands/miscs/generate.tsdiff --git a/shared/extra-utils/miscs/index.ts b/shared/server-commands/miscs/index.tssimilarity index 100%rename from shared/extra-utils/miscs/index.tsrename to shared/server-commands/miscs/index.tsdiff --git a/shared/extra-utils/miscs/sql-command.ts b/shared/server-commands/miscs/sql-command.tssimilarity index 100%rename from shared/extra-utils/miscs/sql-command.tsrename to shared/server-commands/miscs/sql-command.tsdiff --git a/shared/extra-utils/miscs/tests.ts b/shared/server-commands/miscs/tests.tssimilarity index 100%rename from shared/extra-utils/miscs/tests.tsrename to shared/server-commands/miscs/tests.tsdiff --git a/shared/extra-utils/miscs/webtorrent.ts b/shared/server-commands/miscs/webtorrent.tssimilarity index 100%rename from shared/extra-utils/miscs/webtorrent.tsrename to shared/server-commands/miscs/webtorrent.tsdiff --git a/shared/extra-utils/mock-servers/index.ts b/shared/server-commands/mock-servers/index.tssimilarity index 100%rename from shared/extra-utils/mock-servers/index.tsrename to shared/server-commands/mock-servers/index.tsdiff --git a/shared/extra-utils/mock-servers/mock-429.ts b/shared/server-commands/mock-servers/mock-429.tssimilarity index 100%rename from shared/extra-utils/mock-servers/mock-429.tsrename to shared/server-commands/mock-servers/mock-429.tsdiff --git a/shared/extra-utils/mock-servers/mock-email.ts b/shared/server-commands/mock-servers/mock-email.tssimilarity index 100%rename from shared/extra-utils/mock-servers/mock-email.tsrename to shared/server-commands/mock-servers/mock-email.tsdiff --git a/shared/extra-utils/mock-servers/mock-instances-index.ts b/shared/server-commands/mock-servers/mock-instances-index.tssimilarity index 100%rename from shared/extra-utils/mock-servers/mock-instances-index.tsrename to shared/server-commands/mock-servers/mock-instances-index.tsdiff --git a/shared/extra-utils/mock-servers/mock-joinpeertube-versions.ts b/shared/server-commands/mock-servers/mock-joinpeertube-versions.tssimilarity index 100%rename from shared/extra-utils/mock-servers/mock-joinpeertube-versions.tsrename to shared/server-commands/mock-servers/mock-joinpeertube-versions.tsdiff --git a/shared/extra-utils/mock-servers/mock-object-storage.ts b/shared/server-commands/mock-servers/mock-object-storage.tssimilarity index 100%rename from shared/extra-utils/mock-servers/mock-object-storage.tsrename to shared/server-commands/mock-servers/mock-object-storage.tsdiff --git a/shared/extra-utils/mock-servers/mock-plugin-blocklist.ts b/shared/server-commands/mock-servers/mock-plugin-blocklist.tssimilarity index 100%rename from shared/extra-utils/mock-servers/mock-plugin-blocklist.tsrename to shared/server-commands/mock-servers/mock-plugin-blocklist.tsdiff --git a/shared/extra-utils/mock-servers/mock-proxy.ts b/shared/server-commands/mock-servers/mock-proxy.tssimilarity index 100%rename from shared/extra-utils/mock-servers/mock-proxy.tsrename to shared/server-commands/mock-servers/mock-proxy.tsdiff --git a/shared/extra-utils/mock-servers/utils.ts b/shared/server-commands/mock-servers/utils.tssimilarity index 100%rename from shared/extra-utils/mock-servers/utils.tsrename to shared/server-commands/mock-servers/utils.tsdiff --git a/shared/extra-utils/moderation/abuses-command.ts b/shared/server-commands/moderation/abuses-command.tssimilarity index 100%rename from shared/extra-utils/moderation/abuses-command.tsrename to shared/server-commands/moderation/abuses-command.tsdiff --git a/shared/extra-utils/moderation/index.ts b/shared/server-commands/moderation/index.tssimilarity index 100%rename from shared/extra-utils/moderation/index.tsrename to shared/server-commands/moderation/index.tsdiff --git a/shared/extra-utils/overviews/index.ts b/shared/server-commands/overviews/index.tssimilarity index 100%rename from shared/extra-utils/overviews/index.tsrename to shared/server-commands/overviews/index.tsdiff --git a/shared/extra-utils/overviews/overviews-command.ts b/shared/server-commands/overviews/overviews-command.tssimilarity index 100%rename from shared/extra-utils/overviews/overviews-command.tsrename to shared/server-commands/overviews/overviews-command.tsdiff --git a/shared/extra-utils/requests/check-api-params.ts b/shared/server-commands/requests/check-api-params.tssimilarity index 100%rename from shared/extra-utils/requests/check-api-params.tsrename to shared/server-commands/requests/check-api-params.tsdiff --git a/shared/extra-utils/requests/index.ts b/shared/server-commands/requests/index.tssimilarity index 100%rename from shared/extra-utils/requests/index.tsrename to shared/server-commands/requests/index.tsdiff --git a/shared/extra-utils/requests/requests.ts b/shared/server-commands/requests/requests.tssimilarity index 100%rename from shared/extra-utils/requests/requests.tsrename to shared/server-commands/requests/requests.tsdiff --git a/shared/extra-utils/search/index.ts b/shared/server-commands/search/index.tssimilarity index 100%rename from shared/extra-utils/search/index.tsrename to shared/server-commands/search/index.tsdiff --git a/shared/extra-utils/search/search-command.ts b/shared/server-commands/search/search-command.tssimilarity index 100%rename from shared/extra-utils/search/search-command.tsrename to shared/server-commands/search/search-command.tsdiff --git a/shared/extra-utils/server/config-command.ts b/shared/server-commands/server/config-command.tssimilarity index 100%rename from shared/extra-utils/server/config-command.tsrename to shared/server-commands/server/config-command.tsdiff --git a/shared/extra-utils/server/contact-form-command.ts b/shared/server-commands/server/contact-form-command.tssimilarity index 100%rename from shared/extra-utils/server/contact-form-command.tsrename to shared/server-commands/server/contact-form-command.tsdiff --git a/shared/extra-utils/server/debug-command.ts b/shared/server-commands/server/debug-command.tssimilarity index 100%rename from shared/extra-utils/server/debug-command.tsrename to shared/server-commands/server/debug-command.tsdiff --git a/shared/extra-utils/server/directories.ts b/shared/server-commands/server/directories.tssimilarity index 100%rename from shared/extra-utils/server/directories.tsrename to shared/server-commands/server/directories.tsdiff --git a/shared/extra-utils/server/follows-command.ts b/shared/server-commands/server/follows-command.tssimilarity index 100%rename from shared/extra-utils/server/follows-command.tsrename to shared/server-commands/server/follows-command.tsdiff --git a/shared/extra-utils/server/follows.ts b/shared/server-commands/server/follows.tssimilarity index 100%rename from shared/extra-utils/server/follows.tsrename to shared/server-commands/server/follows.tsdiff --git a/shared/extra-utils/server/index.ts b/shared/server-commands/server/index.tssimilarity index 100%rename from shared/extra-utils/server/index.tsrename to shared/server-commands/server/index.tsdiff --git a/shared/extra-utils/server/jobs-command.ts b/shared/server-commands/server/jobs-command.tssimilarity index 100%rename from shared/extra-utils/server/jobs-command.tsrename to shared/server-commands/server/jobs-command.tsdiff --git a/shared/extra-utils/server/jobs.ts b/shared/server-commands/server/jobs.tssimilarity index 100%rename from shared/extra-utils/server/jobs.tsrename to shared/server-commands/server/jobs.tsdiff --git a/shared/extra-utils/server/object-storage-command.ts b/shared/server-commands/server/object-storage-command.tssimilarity index 100%rename from shared/extra-utils/server/object-storage-command.tsrename to shared/server-commands/server/object-storage-command.tsdiff --git a/shared/extra-utils/server/plugins-command.ts b/shared/server-commands/server/plugins-command.tssimilarity index 100%rename from shared/extra-utils/server/plugins-command.tsrename to shared/server-commands/server/plugins-command.tsdiff --git a/shared/extra-utils/server/plugins.ts b/shared/server-commands/server/plugins.tssimilarity index 92%rename from shared/extra-utils/server/plugins.tsrename to shared/server-commands/server/plugins.tsindex 0f5fabd5ab..c6316898df 100644--- a/shared/extra-utils/server/plugins.ts+++ b/shared/server-commands/server/plugins.ts@@ -1,7 +1,7 @@/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */import { expect } from 'chai'-import { PeerTubeServer } from '../server/server'+import { PeerTubeServer } from './server'async function testHelloWorldRegisteredSettings (server: PeerTubeServer) {const body = await server.plugins.getRegisteredSettings({ npmName: 'peertube-plugin-hello-world' })diff --git a/shared/extra-utils/server/redundancy-command.ts b/shared/server-commands/server/redundancy-command.tssimilarity index 100%rename from shared/extra-utils/server/redundancy-command.tsrename to shared/server-commands/server/redundancy-command.tsdiff --git a/shared/extra-utils/server/server.ts b/shared/server-commands/server/server.tssimilarity index 100%rename from shared/extra-utils/server/server.tsrename to shared/server-commands/server/server.tsdiff --git a/shared/extra-utils/server/servers-command.ts b/shared/server-commands/server/servers-command.tssimilarity index 100%rename from shared/extra-utils/server/servers-command.tsrename to shared/server-commands/server/servers-command.tsdiff --git a/shared/extra-utils/server/servers.ts b/shared/server-commands/server/servers.tssimilarity index 100%rename from shared/extra-utils/server/servers.tsrename to shared/server-commands/server/servers.tsdiff --git a/shared/extra-utils/server/stats-command.ts b/shared/server-commands/server/stats-command.tssimilarity index 100%rename from shared/extra-utils/server/stats-command.tsrename to shared/server-commands/server/stats-command.tsdiff --git a/shared/extra-utils/server/tracker.ts b/shared/server-commands/server/tracker.tssimilarity index 100%rename from shared/extra-utils/server/tracker.tsrename to shared/server-commands/server/tracker.tsdiff --git a/shared/extra-utils/shared/abstract-command.ts b/shared/server-commands/shared/abstract-command.tssimilarity index 100%rename from shared/extra-utils/shared/abstract-command.tsrename to shared/server-commands/shared/abstract-command.tsdiff --git a/shared/extra-utils/shared/index.ts b/shared/server-commands/shared/index.tssimilarity index 100%rename from shared/extra-utils/shared/index.tsrename to shared/server-commands/shared/index.tsdiff --git a/shared/extra-utils/socket/index.ts b/shared/server-commands/socket/index.tssimilarity index 100%rename from shared/extra-utils/socket/index.tsrename to shared/server-commands/socket/index.tsdiff --git a/shared/extra-utils/socket/socket-io-command.ts b/shared/server-commands/socket/socket-io-command.tssimilarity index 100%rename from shared/extra-utils/socket/socket-io-command.tsrename to shared/server-commands/socket/socket-io-command.tsdiff --git a/shared/extra-utils/users/accounts-command.ts b/shared/server-commands/users/accounts-command.tssimilarity index 100%rename from shared/extra-utils/users/accounts-command.tsrename to shared/server-commands/users/accounts-command.tsdiff --git a/shared/extra-utils/users/actors.ts b/shared/server-commands/users/actors.tssimilarity index 100%rename from shared/extra-utils/users/actors.tsrename to shared/server-commands/users/actors.tsdiff --git a/shared/extra-utils/users/blocklist-command.ts b/shared/server-commands/users/blocklist-command.tssimilarity index 100%rename from shared/extra-utils/users/blocklist-command.tsrename to shared/server-commands/users/blocklist-command.tsdiff --git a/shared/extra-utils/users/index.ts b/shared/server-commands/users/index.tssimilarity index 100%rename from shared/extra-utils/users/index.tsrename to shared/server-commands/users/index.tsdiff --git a/shared/extra-utils/users/login-command.ts b/shared/server-commands/users/login-command.tssimilarity index 100%rename from shared/extra-utils/users/login-command.tsrename to shared/server-commands/users/login-command.tsdiff --git a/shared/extra-utils/users/login.ts b/shared/server-commands/users/login.tssimilarity index 100%rename from shared/extra-utils/users/login.tsrename to shared/server-commands/users/login.tsdiff --git a/shared/extra-utils/users/notifications-command.ts b/shared/server-commands/users/notifications-command.tssimilarity index 100%rename from shared/extra-utils/users/notifications-command.tsrename to shared/server-commands/users/notifications-command.tsdiff --git a/shared/extra-utils/users/notifications.ts b/shared/server-commands/users/notifications.tssimilarity index 100%rename from shared/extra-utils/users/notifications.tsrename to shared/server-commands/users/notifications.tsdiff --git a/shared/extra-utils/users/subscriptions-command.ts b/shared/server-commands/users/subscriptions-command.tssimilarity index 100%rename from shared/extra-utils/users/subscriptions-command.tsrename to shared/server-commands/users/subscriptions-command.tsdiff --git a/shared/extra-utils/users/users-command.ts b/shared/server-commands/users/users-command.tssimilarity index 100%rename from shared/extra-utils/users/users-command.tsrename to shared/server-commands/users/users-command.tsdiff --git a/shared/extra-utils/videos/blacklist-command.ts b/shared/server-commands/videos/blacklist-command.tssimilarity index 100%rename from shared/extra-utils/videos/blacklist-command.tsrename to shared/server-commands/videos/blacklist-command.tsdiff --git a/shared/extra-utils/videos/captions-command.ts b/shared/server-commands/videos/captions-command.tssimilarity index 100%rename from shared/extra-utils/videos/captions-command.tsrename to shared/server-commands/videos/captions-command.tsdiff --git a/shared/extra-utils/videos/captions.ts b/shared/server-commands/videos/captions.tssimilarity index 100%rename from shared/extra-utils/videos/captions.tsrename to shared/server-commands/videos/captions.tsdiff --git a/shared/extra-utils/videos/change-ownership-command.ts b/shared/server-commands/videos/change-ownership-command.tssimilarity index 100%rename from shared/extra-utils/videos/change-ownership-command.tsrename to shared/server-commands/videos/change-ownership-command.tsdiff --git a/shared/extra-utils/videos/channels-command.ts b/shared/server-commands/videos/channels-command.tssimilarity index 100%rename from shared/extra-utils/videos/channels-command.tsrename to shared/server-commands/videos/channels-command.tsdiff --git a/shared/extra-utils/videos/channels.ts b/shared/server-commands/videos/channels.tssimilarity index 100%rename from shared/extra-utils/videos/channels.tsrename to shared/server-commands/videos/channels.tsdiff --git a/shared/extra-utils/videos/comments-command.ts b/shared/server-commands/videos/comments-command.tssimilarity index 100%rename from shared/extra-utils/videos/comments-command.tsrename to shared/server-commands/videos/comments-command.tsdiff --git a/shared/extra-utils/videos/history-command.ts b/shared/server-commands/videos/history-command.tssimilarity index 100%rename from shared/extra-utils/videos/history-command.tsrename to shared/server-commands/videos/history-command.tsdiff --git a/shared/extra-utils/videos/imports-command.ts b/shared/server-commands/videos/imports-command.tssimilarity index 100%rename from shared/extra-utils/videos/imports-command.tsrename to shared/server-commands/videos/imports-command.tsdiff --git a/shared/extra-utils/videos/index.ts b/shared/server-commands/videos/index.tssimilarity index 100%rename from shared/extra-utils/videos/index.tsrename to shared/server-commands/videos/index.tsdiff --git a/shared/extra-utils/videos/live-command.ts b/shared/server-commands/videos/live-command.tssimilarity index 100%rename from shared/extra-utils/videos/live-command.tsrename to shared/server-commands/videos/live-command.tsdiff --git a/shared/extra-utils/videos/live.ts b/shared/server-commands/videos/live.tssimilarity index 100%rename from shared/extra-utils/videos/live.tsrename to shared/server-commands/videos/live.tsdiff --git a/shared/extra-utils/videos/playlists-command.ts b/shared/server-commands/videos/playlists-command.tssimilarity index 100%rename from shared/extra-utils/videos/playlists-command.tsrename to shared/server-commands/videos/playlists-command.tsdiff --git a/shared/extra-utils/videos/playlists.ts b/shared/server-commands/videos/playlists.tssimilarity index 100%rename from shared/extra-utils/videos/playlists.tsrename to shared/server-commands/videos/playlists.tsdiff --git a/shared/extra-utils/videos/services-command.ts b/shared/server-commands/videos/services-command.tssimilarity index 100%rename from shared/extra-utils/videos/services-command.tsrename to shared/server-commands/videos/services-command.tsdiff --git a/shared/extra-utils/videos/streaming-playlists-command.ts b/shared/server-commands/videos/streaming-playlists-command.tssimilarity index 100%rename from shared/extra-utils/videos/streaming-playlists-command.tsrename to shared/server-commands/videos/streaming-playlists-command.tsdiff --git a/shared/extra-utils/videos/streaming-playlists.ts b/shared/server-commands/videos/streaming-playlists.tssimilarity index 100%rename from shared/extra-utils/videos/streaming-playlists.tsrename to shared/server-commands/videos/streaming-playlists.tsdiff --git a/shared/extra-utils/videos/videos-command.ts b/shared/server-commands/videos/videos-command.tssimilarity index 100%rename from shared/extra-utils/videos/videos-command.tsrename to shared/server-commands/videos/videos-command.tsdiff --git a/shared/extra-utils/videos/videos.ts b/shared/server-commands/videos/videos.tssimilarity index 100%rename from shared/extra-utils/videos/videos.tsrename to shared/server-commands/videos/videos.tsdiff --git a/shared/tsconfig.types.json b/shared/tsconfig.types.jsonindex b01d12e539..73c1cae6ce 100644--- a/shared/tsconfig.types.json+++ b/shared/tsconfig.types.json@@ -5,5 +5,8 @@"stripInternal": true,"removeComments": false,"emitDeclarationOnly": true- }+ },+ "exclude": [+ "server-commands/"+ ]}diff --git a/shared/typescript-utils/index.ts b/shared/typescript-utils/index.tsnew file mode 100644index 0000000000..c9f6f047dc--- /dev/null+++ b/shared/typescript-utils/index.ts@@ -0,0 +1 @@+export * from './types'diff --git a/shared/typescript-utils/types.ts b/shared/typescript-utils/types.tsnew file mode 100644index 0000000000..bd2a97b98b--- /dev/null+++ b/shared/typescript-utils/types.ts@@ -0,0 +1,45 @@+/* eslint-disable @typescript-eslint/array-type */++export type FunctionPropertyNames<T> = {+ [K in keyof T]: T[K] extends Function ? K : never+}[keyof T]++export type FunctionProperties<T> = Pick<T, FunctionPropertyNames<T>>++export type AttributesOnly<T> = {+ [K in keyof T]: T[K] extends Function ? never : T[K]+}++export type PickWith<T, KT extends keyof T, V> = {+ [P in KT]: T[P] extends V ? V : never+}++export type PickWithOpt<T, KT extends keyof T, V> = {+ [P in KT]?: T[P] extends V ? V : never+}++// https://github.com/krzkaczor/ts-essentials Rocks!+export type DeepPartial<T> = {+ [P in keyof T]?: T[P] extends Array<infer U>+ ? Array<DeepPartial<U>>+ : T[P] extends ReadonlyArray<infer U>+ ? ReadonlyArray<DeepPartial<U>>+ : DeepPartial<T[P]>+}++type Primitive = string | Function | number | boolean | Symbol | undefined | null+export type DeepOmitHelper<T, K extends keyof T> = {+ [P in K]: // extra level of indirection needed to trigger homomorhic behavior+ T[P] extends infer TP // distribute over unions+ ? TP extends Primitive+ ? TP // leave primitives and functions alone+ : TP extends any[]+ ? DeepOmitArray<TP, K> // Array special handling+ : DeepOmit<TP, K>+ : never+}+export type DeepOmit<T, K> = T extends Primitive ? T : DeepOmitHelper<T, Exclude<keyof T, K>>++export type DeepOmitArray<T extends any[], K> = {+ [P in keyof T]: DeepOmit<T[P], K>+}