]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Move utils to /shared
authorbuoyantair <buoyantair@gmail.com>
Mon, 29 Oct 2018 16:48:31 +0000 (22:18 +0530)
committerbuoyantair <buoyantair@gmail.com>
Mon, 29 Oct 2018 16:48:31 +0000 (22:18 +0530)
Move utils used by /server/tools/* & /server/tests/**/* into
/shared folder.

Issue: #1336

104 files changed:
server/tests/activitypub.ts
server/tests/api/check-params/accounts.ts
server/tests/api/check-params/blocklist.ts
server/tests/api/check-params/config.ts
server/tests/api/check-params/follows.ts
server/tests/api/check-params/jobs.ts
server/tests/api/check-params/redundancy.ts
server/tests/api/check-params/search.ts
server/tests/api/check-params/services.ts
server/tests/api/check-params/user-subscriptions.ts
server/tests/api/check-params/users.ts
server/tests/api/check-params/video-abuses.ts
server/tests/api/check-params/video-blacklist.ts
server/tests/api/check-params/video-captions.ts
server/tests/api/check-params/video-channels.ts
server/tests/api/check-params/video-comments.ts
server/tests/api/check-params/video-imports.ts
server/tests/api/check-params/videos-filter.ts
server/tests/api/check-params/videos-history.ts
server/tests/api/check-params/videos.ts
server/tests/api/redundancy/redundancy.ts
server/tests/api/search/search-activitypub-video-channels.ts
server/tests/api/search/search-activitypub-videos.ts
server/tests/api/search/search-videos.ts
server/tests/api/server/config.ts
server/tests/api/server/email.ts
server/tests/api/server/follows.ts
server/tests/api/server/handle-down.ts
server/tests/api/server/jobs.ts
server/tests/api/server/redundancy.ts
server/tests/api/server/reverse-proxy.ts
server/tests/api/server/stats.ts
server/tests/api/server/tracker.ts
server/tests/api/users/blocklist.ts
server/tests/api/users/user-subscriptions.ts
server/tests/api/users/users-multiple-servers.ts
server/tests/api/users/users-verification.ts
server/tests/api/users/users.ts
server/tests/api/videos/multiple-servers.ts
server/tests/api/videos/services.ts
server/tests/api/videos/single-server.ts
server/tests/api/videos/video-abuse.ts
server/tests/api/videos/video-blacklist-management.ts
server/tests/api/videos/video-blacklist.ts
server/tests/api/videos/video-captions.ts
server/tests/api/videos/video-change-ownership.ts
server/tests/api/videos/video-channels.ts
server/tests/api/videos/video-comments.ts
server/tests/api/videos/video-description.ts
server/tests/api/videos/video-imports.ts
server/tests/api/videos/video-nsfw.ts
server/tests/api/videos/video-privacy.ts
server/tests/api/videos/video-schedule-update.ts
server/tests/api/videos/video-transcoder.ts
server/tests/api/videos/videos-filter.ts
server/tests/api/videos/videos-history.ts
server/tests/api/videos/videos-overview.ts
server/tests/cli/create-import-video-file-job.ts
server/tests/cli/create-transcoding-job.ts
server/tests/cli/optimize-old-videos.ts
server/tests/cli/peertube.ts
server/tests/cli/reset-password.ts
server/tests/cli/update-host.ts
server/tests/client.ts
server/tests/feeds/feeds.ts
server/tests/misc-endpoints.ts
server/tests/real-world/populate-database.ts
server/tests/real-world/real-world.ts
server/tools/peertube-get-access-token.ts
server/tools/peertube-import-videos.ts
server/tools/peertube-upload.ts
shared/utils/cli/cli.ts [moved from server/tests/utils/cli/cli.ts with 100% similarity]
shared/utils/feeds/feeds.ts [moved from server/tests/utils/feeds/feeds.ts with 100% similarity]
shared/utils/index.ts [moved from server/tests/utils/index.ts with 100% similarity]
shared/utils/miscs/email.ts [moved from server/tests/utils/miscs/email.ts with 100% similarity]
shared/utils/miscs/miscs.ts [moved from server/tests/utils/miscs/miscs.ts with 100% similarity]
shared/utils/overviews/overviews.ts [moved from server/tests/utils/overviews/overviews.ts with 100% similarity]
shared/utils/requests/check-api-params.ts [moved from server/tests/utils/requests/check-api-params.ts with 100% similarity]
shared/utils/requests/requests.ts [moved from server/tests/utils/requests/requests.ts with 100% similarity]
shared/utils/search/video-channels.ts [moved from server/tests/utils/search/video-channels.ts with 100% similarity]
shared/utils/search/videos.ts [moved from server/tests/utils/search/videos.ts with 100% similarity]
shared/utils/server/activitypub.ts [moved from server/tests/utils/server/activitypub.ts with 100% similarity]
shared/utils/server/clients.ts [moved from server/tests/utils/server/clients.ts with 100% similarity]
shared/utils/server/config.ts [moved from server/tests/utils/server/config.ts with 100% similarity]
shared/utils/server/follows.ts [moved from server/tests/utils/server/follows.ts with 100% similarity]
shared/utils/server/jobs.ts [moved from server/tests/utils/server/jobs.ts with 100% similarity]
shared/utils/server/redundancy.ts [moved from server/tests/utils/server/redundancy.ts with 100% similarity]
shared/utils/server/servers.ts [moved from server/tests/utils/server/servers.ts with 100% similarity]
shared/utils/server/stats.ts [moved from server/tests/utils/server/stats.ts with 100% similarity]
shared/utils/users/accounts.ts [moved from server/tests/utils/users/accounts.ts with 100% similarity]
shared/utils/users/blocklist.ts [moved from server/tests/utils/users/blocklist.ts with 100% similarity]
shared/utils/users/login.ts [moved from server/tests/utils/users/login.ts with 100% similarity]
shared/utils/users/user-subscriptions.ts [moved from server/tests/utils/users/user-subscriptions.ts with 100% similarity]
shared/utils/users/users.ts [moved from server/tests/utils/users/users.ts with 98% similarity]
shared/utils/videos/services.ts [moved from server/tests/utils/videos/services.ts with 100% similarity]
shared/utils/videos/video-abuses.ts [moved from server/tests/utils/videos/video-abuses.ts with 100% similarity]
shared/utils/videos/video-blacklist.ts [moved from server/tests/utils/videos/video-blacklist.ts with 100% similarity]
shared/utils/videos/video-captions.ts [moved from server/tests/utils/videos/video-captions.ts with 100% similarity]
shared/utils/videos/video-change-ownership.ts [moved from server/tests/utils/videos/video-change-ownership.ts with 100% similarity]
shared/utils/videos/video-channels.ts [moved from server/tests/utils/videos/video-channels.ts with 100% similarity]
shared/utils/videos/video-comments.ts [moved from server/tests/utils/videos/video-comments.ts with 100% similarity]
shared/utils/videos/video-history.ts [moved from server/tests/utils/videos/video-history.ts with 100% similarity]
shared/utils/videos/video-imports.ts [moved from server/tests/utils/videos/video-imports.ts with 100% similarity]
shared/utils/videos/videos.ts [moved from server/tests/utils/videos/videos.ts with 100% similarity]

index 53a04d3638d8ede6de29e13da4965386eda1af70..0905c5dec9cd9d5a1939903b79a185e1c9df4082 100644 (file)
@@ -2,7 +2,14 @@
 
 import * as chai from 'chai'
 import 'mocha'
-import { flushTests, killallServers, makeActivityPubGetRequest, runServer, ServerInfo, setAccessTokensToServers } from './utils'
+import {
+  flushTests,
+  killallServers,
+  makeActivityPubGetRequest,
+  runServer,
+  ServerInfo,
+  setAccessTokensToServers
+} from '../../shared/utils'
 
 const expect = chai.expect
 
index 9e0b1e35c609df0d00c4b565e5a5247e2681d3a4..567fd072ca8c011bf1eb33dd9934c43d0dbda5f4 100644 (file)
@@ -2,9 +2,13 @@
 
 import 'mocha'
 
-import { flushTests, killallServers, runServer, ServerInfo } from '../../utils'
-import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '../../utils/requests/check-api-params'
-import { getAccount } from '../../utils/users/accounts'
+import { flushTests, killallServers, runServer, ServerInfo } from '../../../../shared/utils'
+import {
+  checkBadCountPagination,
+  checkBadSortPagination,
+  checkBadStartPagination
+} from '../../../../shared/utils/requests/check-api-params'
+import { getAccount } from '../../../../shared/utils/users/accounts'
 
 describe('Test users API validators', function () {
   const path = '/api/v1/accounts/'
index c745ac975f04d4d1bc2bf2aded538d4e55ad10e6..c20453c160e0a1cb9046f13704fdc3ab2887edd5 100644 (file)
@@ -13,8 +13,12 @@ import {
   makePostBodyRequest,
   ServerInfo,
   setAccessTokensToServers, userLogin
-} from '../../utils'
-import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '../../utils/requests/check-api-params'
+} from '../../../../shared/utils'
+import {
+  checkBadCountPagination,
+  checkBadSortPagination,
+  checkBadStartPagination
+} from '../../../../shared/utils/requests/check-api-params'
 
 describe('Test blocklist API validators', function () {
   let servers: ServerInfo[]
index d807f910bde37a639f77832a984d155be4c01ee9..ffae380c103b3fcf3322f16928bdbddee613292d 100644 (file)
@@ -7,7 +7,7 @@ import { CustomConfig } from '../../../../shared/models/server/custom-config.mod
 import {
   createUser, flushTests, killallServers, makeDeleteRequest, makeGetRequest, makePutBodyRequest, runServer, ServerInfo,
   setAccessTokensToServers, userLogin, immutableAssign
-} from '../../utils'
+} from '../../../../shared/utils'
 
 describe('Test config API validators', function () {
   const path = '/api/v1/config/custom'
index cdc95c81a6fc848de1b2b2b049efded4ad572ade..2ad1575a3b07c98d567221bddcbb95cf1e4ef2d1 100644 (file)
@@ -5,8 +5,12 @@ import 'mocha'
 import {
   createUser, flushTests, killallServers, makeDeleteRequest, makePostBodyRequest, runServer, ServerInfo, setAccessTokensToServers,
   userLogin
-} from '../../utils'
-import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '../../utils/requests/check-api-params'
+} from '../../../../shared/utils'
+import {
+  checkBadCountPagination,
+  checkBadSortPagination,
+  checkBadStartPagination
+} from '../../../../shared/utils/requests/check-api-params'
 
 describe('Test server follows API validators', function () {
   let server: ServerInfo
index ce3ac880920f1dea9b40cf20b6980e2d4ad9dd53..89760ff98b097891117ef4eef653d358b28f3ba7 100644 (file)
@@ -2,9 +2,21 @@
 
 import 'mocha'
 
-import { createUser, flushTests, killallServers, runServer, ServerInfo, setAccessTokensToServers, userLogin } from '../../utils'
-import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '../../utils/requests/check-api-params'
-import { makeGetRequest } from '../../utils/requests/requests'
+import {
+  createUser,
+  flushTests,
+  killallServers,
+  runServer,
+  ServerInfo,
+  setAccessTokensToServers,
+  userLogin
+} from '../../../../shared/utils'
+import {
+  checkBadCountPagination,
+  checkBadSortPagination,
+  checkBadStartPagination
+} from '../../../../shared/utils/requests/check-api-params'
+import { makeGetRequest } from '../../../../shared/utils/requests/requests'
 
 describe('Test jobs API validators', function () {
   const path = '/api/v1/jobs/failed'
index aa588e3dda7ebdc437c04bd296532b870965da7a..ff4726ceb55475709d790bb1bcd1fb3ad07a3943 100644 (file)
@@ -12,7 +12,7 @@ import {
   ServerInfo,
   setAccessTokensToServers,
   userLogin
-} from '../../utils'
+} from '../../../../shared/utils'
 
 describe('Test server redundancy API validators', function () {
   let servers: ServerInfo[]
index eabf602acffb601200708631e16341d6b1ac36f1..aa81965f33362e32d29890e8c0b2c226185fec4e 100644 (file)
@@ -2,8 +2,12 @@
 
 import 'mocha'
 
-import { flushTests, immutableAssign, killallServers, makeGetRequest, runServer, ServerInfo } from '../../utils'
-import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '../../utils/requests/check-api-params'
+import { flushTests, immutableAssign, killallServers, makeGetRequest, runServer, ServerInfo } from '../../../../shared/utils'
+import {
+  checkBadCountPagination,
+  checkBadSortPagination,
+  checkBadStartPagination
+} from '../../../../shared/utils/requests/check-api-params'
 
 describe('Test videos API validator', function () {
   let server: ServerInfo
index fcde7e17965563514a47e2b77eba27fdf8328bb7..28591af9ddb36a849928484a6ddf7c7cc169e64b 100644 (file)
@@ -2,7 +2,15 @@
 
 import 'mocha'
 
-import { flushTests, killallServers, makeGetRequest, runServer, ServerInfo, setAccessTokensToServers, uploadVideo } from '../../utils'
+import {
+  flushTests,
+  killallServers,
+  makeGetRequest,
+  runServer,
+  ServerInfo,
+  setAccessTokensToServers,
+  uploadVideo
+} from '../../../../shared/utils'
 
 describe('Test services API validators', function () {
   let server: ServerInfo
index 9fba99ac8f92d7e2283396c39e776f9bef989432..2cf5a2415094682595246fc47d051f418e0d8e1f 100644 (file)
@@ -13,8 +13,12 @@ import {
   ServerInfo,
   setAccessTokensToServers,
   userLogin
-} from '../../utils'
-import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '../../utils/requests/check-api-params'
+} from '../../../../shared/utils'
+import {
+  checkBadCountPagination,
+  checkBadSortPagination,
+  checkBadStartPagination
+} from '../../../../shared/utils/requests/check-api-params'
 
 describe('Test user subscriptions API validators', function () {
   const path = '/api/v1/users/me/subscriptions'
index ec46609a4c2f5f0ff0e84373cb8a6dc4463625b3..f4c177621009faac908c690f455bfb6e4a5d4eb0 100644 (file)
@@ -9,11 +9,15 @@ import {
   createUser, flushTests, getMyUserInformation, getMyUserVideoRating, getUsersList, immutableAssign, killallServers, makeGetRequest,
   makePostBodyRequest, makeUploadRequest, makePutBodyRequest, registerUser, removeUser, runServer, ServerInfo, setAccessTokensToServers,
   updateUser, uploadVideo, userLogin, deleteMe, unblockUser, blockUser
-} from '../../utils'
-import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '../../utils/requests/check-api-params'
-import { getMagnetURI, getMyVideoImports, getYoutubeVideoUrl, importVideo } from '../../utils/videos/video-imports'
+} from '../../../../shared/utils'
+import {
+  checkBadCountPagination,
+  checkBadSortPagination,
+  checkBadStartPagination
+} from '../../../../shared/utils/requests/check-api-params'
+import { getMagnetURI, getMyVideoImports, getYoutubeVideoUrl, importVideo } from '../../../../shared/utils/videos/video-imports'
 import { VideoPrivacy } from '../../../../shared/models/videos'
-import { waitJobs } from '../../utils/server/jobs'
+import { waitJobs } from '../../../../shared/utils/server/jobs'
 import { expect } from 'chai'
 
 describe('Test users API validators', function () {
index d2bed6a2a2e59cf60145f60517b76b99f751fde4..a79ab4201419fc0b6a4bb83e543158783a514da1 100644 (file)
@@ -15,8 +15,12 @@ import {
   updateVideoAbuse,
   uploadVideo,
   userLogin
-} from '../../utils'
-import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '../../utils/requests/check-api-params'
+} from '../../../../shared/utils'
+import {
+  checkBadCountPagination,
+  checkBadSortPagination,
+  checkBadStartPagination
+} from '../../../../shared/utils/requests/check-api-params'
 import { VideoAbuseState } from '../../../../shared/models/videos'
 
 describe('Test video abuses API validators', function () {
index 47321623676379633cc747a16424e4f3bcd667de..8e1206db3e26e610d8703a13d07247baee2db739 100644 (file)
@@ -15,8 +15,12 @@ import {
   setAccessTokensToServers,
   uploadVideo,
   userLogin
-} from '../../utils'
-import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '../../utils/requests/check-api-params'
+} from '../../../../shared/utils'
+import {
+  checkBadCountPagination,
+  checkBadSortPagination,
+  checkBadStartPagination
+} from '../../../../shared/utils/requests/check-api-params'
 import { VideoDetails } from '../../../../shared/models/videos'
 import { expect } from 'chai'
 
index 8d46971a16c37bf3977cef6acc1ab41f1d5483fa..e4d36fd4fe7e84c20cc87cbc454167c7ab323075 100644 (file)
@@ -13,9 +13,9 @@ import {
   setAccessTokensToServers,
   uploadVideo,
   userLogin
-} from '../../utils'
+} from '../../../../shared/utils'
 import { join } from 'path'
-import { createVideoCaption } from '../../utils/videos/video-captions'
+import { createVideoCaption } from '../../../../shared/utils/videos/video-captions'
 
 describe('Test video captions API validator', function () {
   const path = '/api/v1/videos/'
index e5696224dacdcfccfe7f099e29cce2f938145d8c..14e4deaf7680b1fa7068bcd62b73db2bf1f97b15 100644 (file)
@@ -20,8 +20,12 @@ import {
   ServerInfo,
   setAccessTokensToServers,
   userLogin
-} from '../../utils'
-import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '../../utils/requests/check-api-params'
+} from '../../../../shared/utils'
+import {
+  checkBadCountPagination,
+  checkBadSortPagination,
+  checkBadStartPagination
+} from '../../../../shared/utils/requests/check-api-params'
 import { User } from '../../../../shared/models/users'
 import { join } from 'path'
 
index 5241832fead9f4920007cd0d2e62a44dafaf98a4..5981780ede0409bc8cf74c357ddb15263e0519a2 100644 (file)
@@ -6,9 +6,13 @@ import {
   createUser,
   flushTests, killallServers, makeDeleteRequest, makeGetRequest, makePostBodyRequest, runServer, ServerInfo, setAccessTokensToServers,
   uploadVideo, userLogin
-} from '../../utils'
-import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '../../utils/requests/check-api-params'
-import { addVideoCommentThread } from '../../utils/videos/video-comments'
+} from '../../../../shared/utils'
+import {
+  checkBadCountPagination,
+  checkBadSortPagination,
+  checkBadStartPagination
+} from '../../../../shared/utils/requests/check-api-params'
+import { addVideoCommentThread } from '../../../../shared/utils/videos/video-comments'
 
 const expect = chai.expect
 
index b51f3d2cd6a8d3b45b98402671154599637fb3d3..7bf187007c90243b0e516a27f61a9586a6e9d29e 100644 (file)
@@ -18,9 +18,13 @@ import {
   setAccessTokensToServers,
   updateCustomSubConfig,
   userLogin
-} from '../../utils'
-import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '../../utils/requests/check-api-params'
-import { getMagnetURI, getYoutubeVideoUrl } from '../../utils/videos/video-imports'
+} from '../../../../shared/utils'
+import {
+  checkBadCountPagination,
+  checkBadSortPagination,
+  checkBadStartPagination
+} from '../../../../shared/utils/requests/check-api-params'
+import { getMagnetURI, getYoutubeVideoUrl } from '../../../../shared/utils/videos/video-imports'
 
 describe('Test video imports API validator', function () {
   const path = '/api/v1/videos/imports'
index 784cd8ba10e15a7a29f41b8896a7a101b65c7f0d..e998c8a3dafcbb445f0eb2c1abfe1f26c9120353 100644 (file)
@@ -11,7 +11,7 @@ import {
   ServerInfo,
   setAccessTokensToServers,
   userLogin
-} from '../../utils'
+} from '../../../../shared/utils'
 import { UserRole } from '../../../../shared/models/users'
 
 const expect = chai.expect
index 808c3b616fce92d04cfea6629f25367c217bc054..09c6f7861d9572b91e7da4a499e79709891f2114 100644 (file)
@@ -11,7 +11,7 @@ import {
   ServerInfo,
   setAccessTokensToServers,
   uploadVideo
-} from '../../utils'
+} from '../../../../shared/utils'
 
 const expect = chai.expect
 
index 699f135c79410c1c010be94c0f4aaed83da0375b..d94eccf8e89b5a9dbbb1608bb16ffacc9860f292 100644 (file)
@@ -8,9 +8,13 @@ import { VideoPrivacy } from '../../../../shared/models/videos/video-privacy.enu
 import {
   createUser, flushTests, getMyUserInformation, getVideo, getVideosList, immutableAssign, killallServers, makeDeleteRequest,
   makeGetRequest, makeUploadRequest, makePutBodyRequest, removeVideo, runServer, ServerInfo, setAccessTokensToServers, userLogin
-} from '../../utils'
-import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '../../utils/requests/check-api-params'
-import { getAccountsList } from '../../utils/users/accounts'
+} from '../../../../shared/utils'
+import {
+  checkBadCountPagination,
+  checkBadSortPagination,
+  checkBadStartPagination
+} from '../../../../shared/utils/requests/check-api-params'
+import { getAccountsList } from '../../../../shared/utils/users/accounts'
 
 const expect = chai.expect
 
index 1960854b654136e5d5b40818c7aa5490a40f95a7..0af52023c891e981b6acb6e5257b2355f9faf774 100644 (file)
@@ -18,15 +18,15 @@ import {
   wait,
   waitUntilLog,
   checkVideoFilesWereRemoved, removeVideo
-} from '../../utils'
-import { waitJobs } from '../../utils/server/jobs'
+} from '../../../../shared/utils'
+import { waitJobs } from '../../../../shared/utils/server/jobs'
 import * as magnetUtil from 'magnet-uri'
-import { updateRedundancy } from '../../utils/server/redundancy'
+import { updateRedundancy } from '../../../../shared/utils/server/redundancy'
 import { ActorFollow } from '../../../../shared/models/actors'
 import { readdir } from 'fs-extra'
 import { join } from 'path'
 import { VideoRedundancyStrategy } from '../../../../shared/models/redundancy'
-import { getStats } from '../../utils/server/stats'
+import { getStats } from '../../../../shared/utils/server/stats'
 import { ServerStats } from '../../../../shared/models/server/server-stats.model'
 
 const expect = chai.expect
index a287c5bdf64354e9fb940fdf1de7db62345ab093..a411e973bdc1bca4058860a1796e100895ac9466 100644 (file)
@@ -17,10 +17,10 @@ import {
   uploadVideo,
   userLogin,
   wait
-} from '../../utils'
-import { waitJobs } from '../../utils/server/jobs'
+} from '../../../../shared/utils'
+import { waitJobs } from '../../../../shared/utils/server/jobs'
 import { VideoChannel } from '../../../../shared/models/videos'
-import { searchVideoChannel } from '../../utils/search/video-channels'
+import { searchVideoChannel } from '../../../../shared/utils/search/video-channels'
 
 const expect = chai.expect
 
index 28f4fac50d2c680c346182e03d212f9a16cbf6b1..f881917e75403f49db9b538e49be43824b4cdb4d 100644 (file)
@@ -16,8 +16,8 @@ import {
   uploadVideo,
   wait,
   searchVideo
-} from '../../utils'
-import { waitJobs } from '../../utils/server/jobs'
+} from '../../../../shared/utils'
+import { waitJobs } from '../../../../shared/utils/server/jobs'
 import { Video, VideoPrivacy } from '../../../../shared/models/videos'
 
 const expect = chai.expect
index f1392ffea7a7b25b3fb316d17fe44298aef35bf5..50da837da8c974325c4186d67479bdca8050b799 100644 (file)
@@ -13,7 +13,7 @@ import {
   uploadVideo,
   wait,
   immutableAssign
-} from '../../utils'
+} from '../../../../shared/utils'
 
 const expect = chai.expect
 
index facd1688d33998090ca71b8a19dec141c7052c68..c5c360a176448897cc0b6056cb08667ccd277464 100644 (file)
@@ -4,8 +4,11 @@ import 'mocha'
 import * as chai from 'chai'
 import { About } from '../../../../shared/models/server/about.model'
 import { CustomConfig } from '../../../../shared/models/server/custom-config.model'
-import { deleteCustomConfig, getAbout, killallServers, reRunServer } from '../../utils'
 import {
+  deleteCustomConfig,
+  getAbout,
+  killallServers,
+  reRunServer,
   flushTests,
   getConfig,
   getCustomConfig,
@@ -13,7 +16,7 @@ import {
   runServer,
   setAccessTokensToServers,
   updateCustomConfig
-} from '../../utils/index'
+} from '../../../../shared/utils'
 
 const expect = chai.expect
 
index 713a27143123a6e621ec2b704c40835196540e18..13df772c686c55a01bca983ef6af65d8e3571ddc 100644 (file)
@@ -14,11 +14,14 @@ import {
   unblockUser,
   uploadVideo,
   userLogin,
-  verifyEmail
-} from '../../utils'
-import { flushTests, killallServers, ServerInfo, setAccessTokensToServers } from '../../utils/index'
-import { mockSmtpServer } from '../../utils/miscs/email'
-import { waitJobs } from '../../utils/server/jobs'
+  verifyEmail,
+  flushTests,
+  killallServers,
+  ServerInfo,
+  setAccessTokensToServers
+} from '../../../../shared/utils'
+import { mockSmtpServer } from '../../../../shared/utils/miscs/email'
+import { waitJobs } from '../../../../shared/utils/server/jobs'
 
 const expect = chai.expect
 
index e80e93e7f5b33e8a5ced35831f1d977334b0bc42..b0fc5d2939e7d7773db31799d5fd7b87ab80e1bf 100644 (file)
@@ -4,7 +4,7 @@ import * as chai from 'chai'
 import 'mocha'
 import { Video, VideoPrivacy } from '../../../../shared/models/videos'
 import { VideoComment, VideoCommentThreadTree } from '../../../../shared/models/videos/video-comment.model'
-import { completeVideoCheck } from '../../utils'
+import { completeVideoCheck } from '../../../../shared/utils'
 import {
   flushAndRunMultipleServers,
   getVideosList,
@@ -12,21 +12,26 @@ import {
   ServerInfo,
   setAccessTokensToServers,
   uploadVideo
-} from '../../utils/index'
-import { dateIsValid } from '../../utils/miscs/miscs'
-import { follow, getFollowersListPaginationAndSort, getFollowingListPaginationAndSort, unfollow } from '../../utils/server/follows'
-import { expectAccountFollows } from '../../utils/users/accounts'
-import { userLogin } from '../../utils/users/login'
-import { createUser } from '../../utils/users/users'
+} from '../../../../shared/utils/index'
+import { dateIsValid } from '../../../../shared/utils/miscs/miscs'
+import {
+  follow,
+  getFollowersListPaginationAndSort,
+  getFollowingListPaginationAndSort,
+  unfollow
+} from '../../../../shared/utils/server/follows'
+import { expectAccountFollows } from '../../../../shared/utils/users/accounts'
+import { userLogin } from '../../../../shared/utils/users/login'
+import { createUser } from '../../../../shared/utils/users/users'
 import {
   addVideoCommentReply,
   addVideoCommentThread,
   getVideoCommentThreads,
   getVideoThreadComments
-} from '../../utils/videos/video-comments'
-import { rateVideo } from '../../utils/videos/videos'
-import { waitJobs } from '../../utils/server/jobs'
-import { createVideoCaption, listVideoCaptions, testCaptionFile } from '../../utils/videos/video-captions'
+} from '../../../../shared/utils/videos/video-comments'
+import { rateVideo } from '../../../../shared/utils/videos/videos'
+import { waitJobs } from '../../../../shared/utils/server/jobs'
+import { createVideoCaption, listVideoCaptions, testCaptionFile } from '../../../../shared/utils/videos/video-captions'
 import { VideoCaption } from '../../../../shared/models/videos/caption/video-caption.model'
 
 const expect = chai.expect
index ed15c8090659ec0cc095e781bcefdfd17556b229..e6e0d6c7a6b9b23a49009299fc12b70620d07c59 100644 (file)
@@ -5,8 +5,13 @@ import 'mocha'
 import { JobState, Video } from '../../../../shared/models'
 import { VideoPrivacy } from '../../../../shared/models/videos'
 import { VideoCommentThreadTree } from '../../../../shared/models/videos/video-comment.model'
-import { completeVideoCheck, getVideo, immutableAssign, reRunServer, unfollow, viewVideo } from '../../utils'
 import {
+  completeVideoCheck,
+  getVideo,
+  immutableAssign,
+  reRunServer,
+  unfollow,
+  viewVideo,
   flushAndRunMultipleServers,
   getVideosList,
   killallServers,
@@ -14,15 +19,15 @@ import {
   setAccessTokensToServers,
   uploadVideo,
   wait
-} from '../../utils/index'
-import { follow, getFollowersListPaginationAndSort } from '../../utils/server/follows'
-import { getJobsListPaginationAndSort, waitJobs } from '../../utils/server/jobs'
+} from '../../../../shared/utils'
+import { follow, getFollowersListPaginationAndSort } from '../../../../shared/utils/server/follows'
+import { getJobsListPaginationAndSort, waitJobs } from '../../../../shared/utils/server/jobs'
 import {
   addVideoCommentReply,
   addVideoCommentThread,
   getVideoCommentThreads,
   getVideoThreadComments
-} from '../../utils/videos/video-comments'
+} from '../../../../shared/utils/videos/video-comments'
 
 const expect = chai.expect
 
index cd59d9a1bc913cce365f3e327ace640d0854d55d..52948b1d64164dfef47f84c2e5204bc35276724f 100644 (file)
@@ -2,12 +2,12 @@
 
 import * as chai from 'chai'
 import 'mocha'
-import { killallServers, ServerInfo, setAccessTokensToServers } from '../../utils/index'
-import { doubleFollow } from '../../utils/server/follows'
-import { getJobsList, getJobsListPaginationAndSort, waitJobs } from '../../utils/server/jobs'
-import { flushAndRunMultipleServers } from '../../utils/server/servers'
-import { uploadVideo } from '../../utils/videos/videos'
-import { dateIsValid } from '../../utils/miscs/miscs'
+import { killallServers, ServerInfo, setAccessTokensToServers } from '../../../../shared/utils/index'
+import { doubleFollow } from '../../../../shared/utils/server/follows'
+import { getJobsList, getJobsListPaginationAndSort, waitJobs } from '../../../../shared/utils/server/jobs'
+import { flushAndRunMultipleServers } from '../../../../shared/utils/server/servers'
+import { uploadVideo } from '../../../../shared/utils/videos/videos'
+import { dateIsValid } from '../../../../shared/utils/miscs/miscs'
 
 const expect = chai.expect
 
index f50d6e3cfee46aaf73e237b6abe40ee2841c000f..8053d049120f7b373a537839eae6de76b2cc6f37 100644 (file)
@@ -18,15 +18,15 @@ import {
   wait,
   waitUntilLog,
   checkVideoFilesWereRemoved, removeVideo
-} from '../../utils'
-import { waitJobs } from '../../utils/server/jobs'
+} from '../../../../shared/utils'
+import { waitJobs } from '../../../../shared/utils/server/jobs'
 import * as magnetUtil from 'magnet-uri'
-import { updateRedundancy } from '../../utils/server/redundancy'
+import { updateRedundancy } from '../../../../shared/utils/server/redundancy'
 import { ActorFollow } from '../../../../shared/models/actors'
 import { readdir } from 'fs-extra'
 import { join } from 'path'
 import { VideoRedundancyStrategy } from '../../../../shared/models/redundancy'
-import { getStats } from '../../utils/server/stats'
+import { getStats } from '../../../../shared/utils/server/stats'
 import { ServerStats } from '../../../../shared/models/server/server-stats.model'
 
 const expect = chai.expect
index e2c2a293e97e1c323dbef21a376cb6d25cdd6a18..d4c08c3467c82115a64f787ae72fe856a9f6998b 100644 (file)
@@ -15,7 +15,7 @@ import {
   userLogin,
   viewVideo,
   wait
-} from '../../utils'
+} from '../../../../shared/utils'
 const expect = chai.expect
 
 import {
@@ -23,7 +23,7 @@ import {
   flushTests,
   runServer,
   registerUser, getCustomConfig, setAccessTokensToServers, updateCustomConfig
-} from '../../utils/index'
+} from '../../../../shared/utils/index'
 
 describe('Test application behind a reverse proxy', function () {
   let server = null
index cb229e876f8fd8d1c5170e4cfc5543ee0d59b34c..517b4e54298c2e06317442118ed2eadf8992cf95 100644 (file)
@@ -13,11 +13,11 @@ import {
   uploadVideo,
   viewVideo,
   wait
-} from '../../utils'
-import { flushTests, setAccessTokensToServers } from '../../utils/index'
-import { getStats } from '../../utils/server/stats'
-import { addVideoCommentThread } from '../../utils/videos/video-comments'
-import { waitJobs } from '../../utils/server/jobs'
+} from '../../../../shared/utils'
+import { flushTests, setAccessTokensToServers } from '../../../../shared/utils/index'
+import { getStats } from '../../../../shared/utils/server/stats'
+import { addVideoCommentThread } from '../../../../shared/utils/videos/video-comments'
+import { waitJobs } from '../../../../shared/utils/server/jobs'
 
 const expect = chai.expect
 
index 856f2f4d10676ffcfa61ce62717735ee01cb6f37..25ca00029bc9fc8d94731b27be1b9daf257f2257 100644 (file)
@@ -2,8 +2,8 @@
 
 import * as magnetUtil from 'magnet-uri'
 import 'mocha'
-import { getVideo, killallServers, runServer, ServerInfo, uploadVideo } from '../../utils'
-import { flushTests, setAccessTokensToServers } from '../../utils/index'
+import { getVideo, killallServers, runServer, ServerInfo, uploadVideo } from '../../../../shared/utils'
+import { flushTests, setAccessTokensToServers } from '../../../../shared/utils/index'
 import { VideoDetails } from '../../../../shared/models/videos'
 import * as WebTorrent from 'webtorrent'
 
index eed4b9f3efb94f6c52585cc2fbdaf07881ac524f..4bca27a94985d446e04aa5646e500907290733a2 100644 (file)
@@ -12,16 +12,16 @@ import {
   ServerInfo,
   uploadVideo,
   userLogin
-} from '../../utils/index'
-import { setAccessTokensToServers } from '../../utils/users/login'
-import { getVideosListWithToken, getVideosList } from '../../utils/videos/videos'
+} from '../../../../shared/utils/index'
+import { setAccessTokensToServers } from '../../../../shared/utils/users/login'
+import { getVideosListWithToken, getVideosList } from '../../../../shared/utils/videos/videos'
 import {
   addVideoCommentReply,
   addVideoCommentThread,
   getVideoCommentThreads,
   getVideoThreadComments
-} from '../../utils/videos/video-comments'
-import { waitJobs } from '../../utils/server/jobs'
+} from '../../../../shared/utils/videos/video-comments'
+import { waitJobs } from '../../../../shared/utils/server/jobs'
 import { VideoComment, VideoCommentThreadTree } from '../../../../shared/models/videos/video-comment.model'
 import {
   addAccountToAccountBlocklist,
@@ -36,7 +36,7 @@ import {
   removeAccountFromServerBlocklist,
   removeServerFromAccountBlocklist,
   removeServerFromServerBlocklist
-} from '../../utils/users/blocklist'
+} from '../../../../shared/utils/users/blocklist'
 
 const expect = chai.expect
 
index 65b80540c858210367c2e93386a3ea18c6a67bd8..88a7187d64a0c4443c758e66805a41a032b75f3f 100644 (file)
@@ -2,18 +2,27 @@
 
 import * as chai from 'chai'
 import 'mocha'
-import { createUser, doubleFollow, flushAndRunMultipleServers, follow, getVideosList, unfollow, updateVideo, userLogin } from '../../utils'
-import { killallServers, ServerInfo, uploadVideo } from '../../utils/index'
-import { setAccessTokensToServers } from '../../utils/users/login'
+import {
+  createUser,
+  doubleFollow,
+  flushAndRunMultipleServers,
+  follow,
+  getVideosList,
+  unfollow,
+  updateVideo,
+  userLogin
+} from '../../../../shared/utils'
+import { killallServers, ServerInfo, uploadVideo } from '../../../../shared/utils/index'
+import { setAccessTokensToServers } from '../../../../shared/utils/users/login'
 import { Video, VideoChannel } from '../../../../shared/models/videos'
-import { waitJobs } from '../../utils/server/jobs'
+import { waitJobs } from '../../../../shared/utils/server/jobs'
 import {
   addUserSubscription,
   listUserSubscriptions,
   listUserSubscriptionVideos,
   removeUserSubscription,
   getUserSubscription, areSubscriptionsExist
-} from '../../utils/users/user-subscriptions'
+} from '../../../../shared/utils/users/user-subscriptions'
 
 const expect = chai.expect
 
index d8699db17b274986d2137cb3c4bbc6fbb7952ba7..006d6cdf0e17da82d395e476bac0bb935620bd15 100644 (file)
@@ -13,13 +13,13 @@ import {
   removeUser,
   updateMyUser,
   userLogin
-} from '../../utils'
-import { getMyUserInformation, killallServers, ServerInfo, testImage, updateMyAvatar, uploadVideo } from '../../utils/index'
-import { checkActorFilesWereRemoved, getAccount, getAccountsList } from '../../utils/users/accounts'
-import { setAccessTokensToServers } from '../../utils/users/login'
+} from '../../../../shared/utils'
+import { getMyUserInformation, killallServers, ServerInfo, testImage, updateMyAvatar, uploadVideo } from '../../../../shared/utils/index'
+import { checkActorFilesWereRemoved, getAccount, getAccountsList } from '../../../../shared/utils/users/accounts'
+import { setAccessTokensToServers } from '../../../../shared/utils/users/login'
 import { User } from '../../../../shared/models/users'
 import { VideoChannel } from '../../../../shared/models/videos'
-import { waitJobs } from '../../utils/server/jobs'
+import { waitJobs } from '../../../../shared/utils/server/jobs'
 
 const expect = chai.expect
 
index fa5f5e3717394dc39d85c11a32b2d8c71b06297b..b1733e45e95bc09d413d9001470b6594385e09a2 100644 (file)
@@ -5,10 +5,10 @@ import 'mocha'
 import {
   registerUser, flushTests, getUserInformation, getMyUserInformation, killallServers,
   userLogin, login, runServer, ServerInfo, verifyEmail, updateCustomSubConfig
-} from '../../utils'
-import { setAccessTokensToServers } from '../../utils/users/login'
-import { mockSmtpServer } from '../../utils/miscs/email'
-import { waitJobs } from '../../utils/server/jobs'
+} from '../../../../shared/utils'
+import { setAccessTokensToServers } from '../../../../shared/utils/users/login'
+import { mockSmtpServer } from '../../../../shared/utils/miscs/email'
+import { waitJobs } from '../../../../shared/utils/server/jobs'
 
 const expect = chai.expect
 
index 513bca8a06e58f95c658a8eb84689979671e9568..7dffbb0b1751056af2dc791aa419455ea3cb5fa0 100644 (file)
@@ -32,10 +32,10 @@ import {
   updateUser,
   uploadVideo,
   userLogin
-} from '../../utils/index'
-import { follow } from '../../utils/server/follows'
-import { setAccessTokensToServers } from '../../utils/users/login'
-import { getMyVideos } from '../../utils/videos/videos'
+} from '../../../../shared/utils/index'
+import { follow } from '../../../../shared/utils/server/follows'
+import { setAccessTokensToServers } from '../../../../shared/utils/users/login'
+import { getMyVideos } from '../../../../shared/utils/videos/videos'
 
 const expect = chai.expect
 
index b9ace2885874f14e1d3d87c32ee59027fe0a157f..aa38b6b3398407da9617f23f904637ede64e4f11 100644 (file)
@@ -31,15 +31,15 @@ import {
   viewVideo,
   wait,
   webtorrentAdd
-} from '../../utils'
+} from '../../../../shared/utils'
 import {
   addVideoCommentReply,
   addVideoCommentThread,
   deleteVideoComment,
   getVideoCommentThreads,
   getVideoThreadComments
-} from '../../utils/videos/video-comments'
-import { waitJobs } from '../../utils/server/jobs'
+} from '../../../../shared/utils/videos/video-comments'
+import { waitJobs } from '../../../../shared/utils/server/jobs'
 
 const expect = chai.expect
 
index 2f14242920dd96cb500b0809b9e195446964b670..2da86964ff6273a859444096b556ba9a87197663 100644 (file)
@@ -2,8 +2,16 @@
 
 import * as chai from 'chai'
 import 'mocha'
-import { flushTests, getOEmbed, getVideosList, killallServers, ServerInfo, setAccessTokensToServers, uploadVideo } from '../../utils/index'
-import { runServer } from '../../utils/server/servers'
+import {
+  flushTests,
+  getOEmbed,
+  getVideosList,
+  killallServers,
+  ServerInfo,
+  setAccessTokensToServers,
+  uploadVideo
+} from '../../../../shared/utils/index'
+import { runServer } from '../../../../shared/utils/server/servers'
 
 const expect = chai.expect
 
index 089c3df25990b07f2a831f896b2fb816b1489dff..069dec67c8680b3bf33085492d5fad6438a9c407 100644 (file)
@@ -28,7 +28,7 @@ import {
   uploadVideo,
   viewVideo,
   wait
-} from '../../utils'
+} from '../../../../shared/utils'
 
 const expect = chai.expect
 
index a17f3c8de953dae10b2ab20a2a2455d2c12a1c24..3a7b623daa2ba3d46ede1aa5ef8ad308cace0e80 100644 (file)
@@ -14,9 +14,9 @@ import {
   setAccessTokensToServers,
   updateVideoAbuse,
   uploadVideo
-} from '../../utils/index'
-import { doubleFollow } from '../../utils/server/follows'
-import { waitJobs } from '../../utils/server/jobs'
+} from '../../../../shared/utils/index'
+import { doubleFollow } from '../../../../shared/utils/server/follows'
+import { waitJobs } from '../../../../shared/utils/server/jobs'
 
 const expect = chai.expect
 
index 7bf39dc9962fbb838ad23cee8c4290d63485b832..06d80a27078d1a878638b7d9ebb1c6a34f965391 100644 (file)
@@ -16,9 +16,9 @@ import {
   setAccessTokensToServers,
   updateVideoBlacklist,
   uploadVideo
-} from '../../utils/index'
-import { doubleFollow } from '../../utils/server/follows'
-import { waitJobs } from '../../utils/server/jobs'
+} from '../../../../shared/utils/index'
+import { doubleFollow } from '../../../../shared/utils/server/follows'
+import { waitJobs } from '../../../../shared/utils/server/jobs'
 import { VideoAbuse } from '../../../../shared/models/videos'
 
 const expect = chai.expect
index de4c68f1dd10a4c218d3dc171272854a06b0db81..1cce82d2a8449181365db10a405a2b6ee65d1990 100644 (file)
@@ -11,9 +11,9 @@ import {
   ServerInfo,
   setAccessTokensToServers,
   uploadVideo
-} from '../../utils/index'
-import { doubleFollow } from '../../utils/server/follows'
-import { waitJobs } from '../../utils/server/jobs'
+} from '../../../../shared/utils/index'
+import { doubleFollow } from '../../../../shared/utils/server/follows'
+import { waitJobs } from '../../../../shared/utils/server/jobs'
 
 const expect = chai.expect
 
index 6e441410d3fb1e9e4143b829e6b5639796a1c24c..57bee713f9c1ce182e02b1ce728c03803189c749 100644 (file)
@@ -2,10 +2,17 @@
 
 import * as chai from 'chai'
 import 'mocha'
-import { checkVideoFilesWereRemoved, doubleFollow, flushAndRunMultipleServers, removeVideo, uploadVideo, wait } from '../../utils'
-import { flushTests, killallServers, ServerInfo, setAccessTokensToServers } from '../../utils/index'
-import { waitJobs } from '../../utils/server/jobs'
-import { createVideoCaption, deleteVideoCaption, listVideoCaptions, testCaptionFile } from '../../utils/videos/video-captions'
+import {
+  checkVideoFilesWereRemoved,
+  doubleFollow,
+  flushAndRunMultipleServers,
+  removeVideo,
+  uploadVideo,
+  wait
+} from '../../../../shared/utils'
+import { flushTests, killallServers, ServerInfo, setAccessTokensToServers } from '../../../../shared/utils/index'
+import { waitJobs } from '../../../../shared/utils/server/jobs'
+import { createVideoCaption, deleteVideoCaption, listVideoCaptions, testCaptionFile } from '../../../../shared/utils/videos/video-captions'
 import { VideoCaption } from '../../../../shared/models/videos/caption/video-caption.model'
 
 const expect = chai.expect
index 1578a471d8ddb51aa0f98c4ef13da5d659ced9f4..25675a9663aa31b68d7695626055e0d2573cfac6 100644 (file)
@@ -18,8 +18,8 @@ import {
   uploadVideo,
   userLogin,
   getVideo
-} from '../../utils'
-import { waitJobs } from '../../utils/server/jobs'
+} from '../../../../shared/utils'
+import { waitJobs } from '../../../../shared/utils/server/jobs'
 import { User } from '../../../../shared/models/users'
 import { VideoDetails } from '../../../../shared/models/videos'
 
index 8138c65d60528015c2b274641232f9e958ed71ab..5bffffc660806cbdbf410912b7f3c8535bd62a09 100644 (file)
@@ -11,7 +11,7 @@ import {
   updateVideo,
   updateVideoChannelAvatar,
   uploadVideo, wait, userLogin
-} from '../../utils'
+} from '../../../../shared/utils'
 import {
   addVideoChannel,
   deleteVideoChannel,
@@ -24,8 +24,8 @@ import {
   ServerInfo,
   setAccessTokensToServers,
   updateVideoChannel
-} from '../../utils/index'
-import { waitJobs } from '../../utils/server/jobs'
+} from '../../../../shared/utils/index'
+import { waitJobs } from '../../../../shared/utils/server/jobs'
 
 const expect = chai.expect
 
index d6e07c5b3945dbba0d31dc603a709202fef87e40..ce1b17e35f881dfb4cc569d36cea642d68ed47dc 100644 (file)
@@ -3,7 +3,7 @@
 import * as chai from 'chai'
 import 'mocha'
 import { VideoComment, VideoCommentThreadTree } from '../../../../shared/models/videos/video-comment.model'
-import { testImage } from '../../utils'
+import { testImage } from '../../../../shared/utils'
 import {
   dateIsValid,
   flushTests,
@@ -13,14 +13,14 @@ import {
   setAccessTokensToServers,
   updateMyAvatar,
   uploadVideo
-} from '../../utils/index'
+} from '../../../../shared/utils/index'
 import {
   addVideoCommentReply,
   addVideoCommentThread,
   deleteVideoComment,
   getVideoCommentThreads,
   getVideoThreadComments
-} from '../../utils/videos/video-comments'
+} from '../../../../shared/utils/videos/video-comments'
 
 const expect = chai.expect
 
index dd5cd78c0556def192d31b327e501f82c006246c..cbda0b9a6cfc72c9c1be1fd55699143681926828 100644 (file)
@@ -12,9 +12,9 @@ import {
   setAccessTokensToServers,
   updateVideo,
   uploadVideo
-} from '../../utils/index'
-import { doubleFollow } from '../../utils/server/follows'
-import { waitJobs } from '../../utils/server/jobs'
+} from '../../../../shared/utils/index'
+import { doubleFollow } from '../../../../shared/utils/server/follows'
+import { waitJobs } from '../../../../shared/utils/server/jobs'
 
 const expect = chai.expect
 
index aaee79a4abab1351ab9fa950d29dafc652644e32..cd4988553db79e2294410c40b33a24aea7d3f49b 100644 (file)
@@ -14,9 +14,9 @@ import {
   killallServers,
   ServerInfo,
   setAccessTokensToServers
-} from '../../utils'
-import { waitJobs } from '../../utils/server/jobs'
-import { getMagnetURI, getYoutubeVideoUrl, importVideo, getMyVideoImports } from '../../utils/videos/video-imports'
+} from '../../../../shared/utils'
+import { waitJobs } from '../../../../shared/utils/server/jobs'
+import { getMagnetURI, getYoutubeVideoUrl, importVideo, getMyVideoImports } from '../../../../shared/utils/videos/video-imports'
 
 const expect = chai.expect
 
index eab7a6991e5a6c145687d4b9a0bc14793bf8d552..df1ee2eb97d513deb72faf3a55b2b3f8f3bd471d 100644 (file)
@@ -2,10 +2,17 @@
 
 import * as chai from 'chai'
 import 'mocha'
-import { flushTests, getVideosList, killallServers, ServerInfo, setAccessTokensToServers, uploadVideo } from '../../utils/index'
-import { userLogin } from '../../utils/users/login'
-import { createUser } from '../../utils/users/users'
-import { getMyVideos } from '../../utils/videos/videos'
+import {
+  flushTests,
+  getVideosList,
+  killallServers,
+  ServerInfo,
+  setAccessTokensToServers,
+  uploadVideo
+} from '../../../../shared/utils/index'
+import { userLogin } from '../../../../shared/utils/users/login'
+import { createUser } from '../../../../shared/utils/users/users'
+import { getMyVideos } from '../../../../shared/utils/videos/videos'
 import {
   getAccountVideos,
   getConfig,
@@ -18,7 +25,7 @@ import {
   searchVideoWithToken,
   updateCustomConfig,
   updateMyUser
-} from '../../utils'
+} from '../../../../shared/utils'
 import { ServerConfig } from '../../../../shared/models'
 import { CustomConfig } from '../../../../shared/models/server/custom-config.model'
 import { User } from '../../../../shared/models/users'
index 9fefca7e3d919e90e280a3592a0aa164dc477643..0b4e66369f66b18fd10b81243c93eb9865109952 100644 (file)
@@ -10,12 +10,12 @@ import {
   ServerInfo,
   setAccessTokensToServers,
   uploadVideo
-} from '../../utils/index'
-import { doubleFollow } from '../../utils/server/follows'
-import { userLogin } from '../../utils/users/login'
-import { createUser } from '../../utils/users/users'
-import { getMyVideos, getVideo, getVideoWithToken, updateVideo } from '../../utils/videos/videos'
-import { waitJobs } from '../../utils/server/jobs'
+} from '../../../../shared/utils/index'
+import { doubleFollow } from '../../../../shared/utils/server/follows'
+import { userLogin } from '../../../../shared/utils/users/login'
+import { createUser } from '../../../../shared/utils/users/users'
+import { getMyVideos, getVideo, getVideoWithToken, updateVideo } from '../../../../shared/utils/videos/videos'
+import { waitJobs } from '../../../../shared/utils/server/jobs'
 
 const expect = chai.expect
 
index a260fa4dacb0a0af661c5edcc76db034ca5fd964..ecfc5e034cfa53d55ef1357c907a08ce28a8c1f8 100644 (file)
@@ -15,9 +15,9 @@ import {
   updateVideo,
   uploadVideo,
   wait
-} from '../../utils'
+} from '../../../../shared/utils'
 import { join } from 'path'
-import { waitJobs } from '../../utils/server/jobs'
+import { waitJobs } from '../../../../shared/utils/server/jobs'
 
 const expect = chai.expect
 
index 85795d2edac11472165527223ddb85ff6a55cda0..f9458f0ece5d8694d3cf8a8a6c949b7ec5191346 100644 (file)
@@ -20,9 +20,9 @@ import {
   uploadVideo,
   webtorrentAdd,
   generateHighBitrateVideo
-} from '../../utils'
+} from '../../../../shared/utils'
 import { join } from 'path'
-import { waitJobs } from '../../utils/server/jobs'
+import { waitJobs } from '../../../../shared/utils/server/jobs'
 import { pathExists } from 'fs-extra'
 import { VIDEO_TRANSCODING_FPS } from '../../../../server/initializers/constants'
 
index a7588129fe2c9830f2acabb89aeba832a0eeec15..59e37ad86b647afbe1ee1d30f8fa1960a81f8bee 100644 (file)
@@ -13,7 +13,7 @@ import {
   setAccessTokensToServers,
   uploadVideo,
   userLogin
-} from '../../utils'
+} from '../../../../shared/utils'
 import { Video, VideoPrivacy } from '../../../../shared/models/videos'
 import { UserRole } from '../../../../shared/models/users'
 
index 6d289b288c82f655df1f34dd51a1cea1e05c984e..40ae94f797f198e1bdc9e79c833c82d252dd84a6 100644 (file)
@@ -11,9 +11,9 @@ import {
   ServerInfo,
   setAccessTokensToServers,
   uploadVideo
-} from '../../utils'
+} from '../../../../shared/utils'
 import { Video, VideoDetails } from '../../../../shared/models/videos'
-import { userWatchVideo } from '../../utils/videos/video-history'
+import { userWatchVideo } from '../../../../shared/utils/videos/video-history'
 
 const expect = chai.expect
 
index 7d1f29c92ee8a6933840b0223b0f9bd1e39a7fc2..7221bcae653c678bd3103adb4055a252a1c1c180 100644 (file)
@@ -2,8 +2,8 @@
 
 import * as chai from 'chai'
 import 'mocha'
-import { flushTests, killallServers, runServer, ServerInfo, setAccessTokensToServers, uploadVideo } from '../../utils'
-import { getVideosOverview } from '../../utils/overviews/overviews'
+import { flushTests, killallServers, runServer, ServerInfo, setAccessTokensToServers, uploadVideo } from '../../../../shared/utils'
+import { getVideosOverview } from '../../../../shared/utils/overviews/overviews'
 import { VideosOverview } from '../../../../shared/models/overviews'
 
 const expect = chai.expect
index 13bcfd209836f636e831fe487c0d74ddcafec67f..4acda47b1c2f89dc16d6dc7d53f3ddc43ffc593b 100644 (file)
@@ -15,8 +15,8 @@ import {
   ServerInfo,
   setAccessTokensToServers,
   uploadVideo
-} from '../utils'
-import { waitJobs } from '../utils/server/jobs'
+} from '../../../shared/utils'
+import { waitJobs } from '../../../shared/utils/server/jobs'
 
 const expect = chai.expect
 
index c2e3840c59b360e6d6bb28cb7e2efba9a6509bf4..50be5fa19f09b989f4b36206811bed2c889191f9 100644 (file)
@@ -15,8 +15,8 @@ import {
   ServerInfo,
   setAccessTokensToServers,
   uploadVideo, wait
-} from '../utils'
-import { waitJobs } from '../utils/server/jobs'
+} from '../../../shared/utils'
+import { waitJobs } from '../../../shared/utils/server/jobs'
 
 const expect = chai.expect
 
index 66dd39cce7ffa4d4a8d3342b148b82207bb3328a..6f6bc25a635393cfd87a2c78bdb470234ff45640 100644 (file)
@@ -15,8 +15,8 @@ import {
   ServerInfo,
   setAccessTokensToServers,
   uploadVideo, viewVideo, wait
-} from '../utils'
-import { waitJobs } from '../utils/server/jobs'
+} from '../../../shared/utils'
+import { waitJobs } from '../../../shared/utils/server/jobs'
 import { getVideoFileBitrate, getVideoFileFPS, getVideoFileResolution } from '../../helpers/ffmpeg-utils'
 import { VIDEO_TRANSCODING_FPS } from '../../initializers'
 import { join } from 'path'
index 65cb05a1a76927c56ffa75d8f0442b6e1731cec1..e5038838efcd7fc9a711aa3700a6379bf1ec45e6 100644 (file)
@@ -11,7 +11,7 @@ import {
   runServer,
   ServerInfo,
   setAccessTokensToServers
-} from '../utils'
+} from '../../../shared/utils'
 
 describe('Test CLI wrapper', function () {
   let server: ServerInfo
index bf937d1c0c022ed054a911cbe83dc97a30f6a310..1b65f7e39b133181422d9b7f3a0786bbe0d6cb6e 100644 (file)
@@ -10,7 +10,7 @@ import {
   runServer,
   ServerInfo,
   setAccessTokensToServers
-} from '../utils'
+} from '../../../shared/utils'
 
 describe('Test reset password scripts', function () {
   let server: ServerInfo
index b89e72ab76c68d51c60625da6c488ed73a0db7e7..811ea6a9f44f71871cb17fbeb466f535e593144b 100644 (file)
@@ -3,8 +3,8 @@
 import 'mocha'
 import * as chai from 'chai'
 import { VideoDetails } from '../../../shared/models/videos'
-import { waitJobs } from '../utils/server/jobs'
-import { addVideoCommentThread } from '../utils/videos/video-comments'
+import { waitJobs } from '../../../shared/utils/server/jobs'
+import { addVideoCommentThread } from '../../../shared/utils/videos/video-comments'
 import {
   addVideoChannel,
   createUser,
@@ -21,8 +21,8 @@ import {
   ServerInfo,
   setAccessTokensToServers,
   uploadVideo
-} from '../utils'
-import { getAccountsList } from '../utils/users/accounts'
+} from '../../../shared/utils'
+import { getAccountsList } from '../../../shared/utils/users/accounts'
 
 const expect = chai.expect
 
index b33a653b13e2079f0bc6ef3980085fcb8fd347a5..06b4a9c5a1c404599e3398b333e42d4125cf21a9 100644 (file)
@@ -15,7 +15,7 @@ import {
   updateCustomConfig,
   updateCustomSubConfig,
   uploadVideo
-} from './utils'
+} from '../../shared/utils'
 
 const expect = chai.expect
 
index 28fe3493b08be8b8b740f35904824867ec0fbcbb..a771474bc1487cc701226f53c4c245a7f61be1cf 100644 (file)
@@ -13,10 +13,10 @@ import {
   ServerInfo,
   setAccessTokensToServers,
   uploadVideo, userLogin
-} from '../utils'
+} from '../../../shared/utils'
 import * as libxmljs from 'libxmljs'
-import { addVideoCommentThread } from '../utils/videos/video-comments'
-import { waitJobs } from '../utils/server/jobs'
+import { addVideoCommentThread } from '../../../shared/utils/videos/video-comments'
+import { waitJobs } from '../../../shared/utils/server/jobs'
 import { User } from '../../../shared/models/users'
 
 chai.use(require('chai-xml'))
index 8fab20971594702235a82091de848a70a8c763ed..f948fdfd0477c4cf674e86d3bd2286a33a30e23f 100644 (file)
@@ -2,7 +2,7 @@
 
 import 'mocha'
 import * as chai from 'chai'
-import { flushTests, killallServers, makeGetRequest, runServer, ServerInfo } from './utils'
+import { flushTests, killallServers, makeGetRequest, runServer, ServerInfo } from '../../shared/utils'
 
 const expect = chai.expect
 
index a7fdbd1dc8fccaa8cd2255413c6ab4244ac461e1..01650349884efef0708472c60a0563974bd59c00 100644 (file)
@@ -10,7 +10,7 @@ import {
   ServerInfo,
   setAccessTokensToServers,
   uploadVideo
-} from '../utils'
+} from '../../../shared/utils'
 import * as Bluebird from 'bluebird'
 
 start()
index a96469b11181be6782ebdf872e370401b06a9f69..ac3baaf9a1a697067aa2394f8d5fa8577085f352 100644 (file)
@@ -16,8 +16,8 @@ import {
   updateVideo,
   uploadVideo, viewVideo,
   wait
-} from '../utils'
-import { getJobsListPaginationAndSort } from '../utils/server/jobs'
+} from '../../../shared/utils'
+import { getJobsListPaginationAndSort } from '../../../shared/utils/server/jobs'
 
 interface ServerInfo extends DefaultServerInfo {
   requestsNumber: number
index eb2571a03f6865744945b520d43eec09f1ba5c12..a68665f5bb7ff6bcfe6888a60201869a1495fc60 100644 (file)
@@ -6,7 +6,7 @@ import {
   Server,
   Client,
   User
-} from '../tests/utils/index'
+} from '../../shared/utils'
 
 program
   .option('-u, --url <url>', 'Server url')
index 21505b79db972a6d4cc1dcb2698003a67501b402..1fe0a93488a08c43c66571294283fa5e1de9a378 100644 (file)
@@ -6,7 +6,7 @@ import { join } from 'path'
 import { VideoPrivacy } from '../../shared/models/videos'
 import { doRequestAndSaveToFile } from '../helpers/requests'
 import { CONSTRAINTS_FIELDS } from '../initializers'
-import { getClient, getVideoCategories, login, searchVideoWithSort, uploadVideo } from '../tests/utils'
+import { getClient, getVideoCategories, login, searchVideoWithSort, uploadVideo } from '../../shared/utils/index'
 import { truncate } from 'lodash'
 import * as prompt from 'prompt'
 import { remove } from 'fs-extra'
index 6248fb47d648f6cc1519f9892080991582e8b363..cc7bd9b4c7453706d4beabc4fa9dd6ea5eba0b2f 100644 (file)
@@ -1,8 +1,8 @@
 import * as program from 'commander'
 import { access, constants } from 'fs-extra'
 import { isAbsolute } from 'path'
-import { getClient, login } from '../tests/utils'
-import { uploadVideo } from '../tests/utils/index'
+import { getClient, login } from '../../shared/utils'
+import { uploadVideo } from '../../shared/utils/'
 import { VideoPrivacy } from '../../shared/models/videos'
 import { netrc, getSettings } from './cli'
 
similarity index 98%
rename from server/tests/utils/users/users.ts
rename to shared/utils/users/users.ts
index d77233d6289cee5e3e8e23fb891339b59a8e87be..1b385aaf77e00e5ef3afa73c6cc94253566a5947 100644 (file)
@@ -1,8 +1,8 @@
 import * as request from 'supertest'
 import { makePostBodyRequest, makePutBodyRequest, updateAvatarRequest } from '../'
 
-import { UserRole } from '../../../../shared/index'
-import { NSFWPolicyType } from '../../../../shared/models/videos/nsfw-policy.type'
+import { UserRole } from '../../index'
+import { NSFWPolicyType } from '../../models/videos/nsfw-policy.type'
 
 function createUser (
   url: string,