From: buoyantair Date: Tue, 20 Nov 2018 06:58:13 +0000 (+0530) Subject: Merge branch 'develop' of https://github.com/Chocobozzz/PeerTube into move-utils... X-Git-Tag: v1.2.0-rc.1~88^2~1 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=bc22d60899e14631cba0fb6450f4e85fc9528293;p=github%2FChocobozzz%2FPeerTube.git Merge branch 'develop' of https://github.com/Chocobozzz/PeerTube into move-utils-to-shared --- bc22d60899e14631cba0fb6450f4e85fc9528293 diff --cc server/tests/api/activitypub/security.ts index 69b7c0148,7349749f1..b71a61c8c --- a/server/tests/api/activitypub/security.ts +++ b/server/tests/api/activitypub/security.ts @@@ -2,16 -2,7 +2,12 @@@ import 'mocha' -import { flushAndRunMultipleServers, flushTests, killallServers, ServerInfo } from '../../utils' +import { + flushAndRunMultipleServers, + flushTests, + killallServers, + ServerInfo +} from '../../../../shared/utils' - import { - makePOSTAPRequest, - makeFollowRequest, - } from '../../utils/requests/activitypub' import { HTTP_SIGNATURE } from '../../../initializers' import { buildDigest, buildGlobalHeaders } from '../../../lib/job-queue/handlers/utils/activitypub-http-utils' import * as chai from 'chai' diff --cc server/tests/api/videos/video-channels.ts index 5bffffc66,41429a3d8..63514d69c --- a/server/tests/api/videos/video-channels.ts +++ b/server/tests/api/videos/video-channels.ts @@@ -7,11 -7,13 +7,13 @@@ import createUser, doubleFollow, flushAndRunMultipleServers, - getVideoChannelVideos, serverLogin, testImage, + getVideoChannelVideos, + testImage, updateVideo, updateVideoChannelAvatar, - uploadVideo, wait, userLogin + uploadVideo, + userLogin -} from '../../utils' +} from '../../../../shared/utils' import { addVideoChannel, deleteVideoChannel, diff --cc server/tests/api/videos/video-schedule-update.ts index ecfc5e034,b226a9d50..632c4244c --- a/server/tests/api/videos/video-schedule-update.ts +++ b/server/tests/api/videos/video-schedule-update.ts @@@ -15,9 -15,8 +15,8 @@@ import updateVideo, uploadVideo, wait -} from '../../utils' -import { waitJobs } from '../../utils/server/jobs' +} from '../../../../shared/utils' - import { join } from 'path' +import { waitJobs } from '../../../../shared/utils/server/jobs' const expect = chai.expect diff --cc server/tests/api/videos/video-transcoder.ts index f9458f0ec,23920d452..68cf00194 --- a/server/tests/api/videos/video-transcoder.ts +++ b/server/tests/api/videos/video-transcoder.ts @@@ -18,12 -18,10 +18,11 @@@ import ServerInfo, setAccessTokensToServers, uploadVideo, - webtorrentAdd, - generateHighBitrateVideo + webtorrentAdd -} 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' const expect = chai.expect diff --cc shared/utils/search/videos.ts index 115b3ff9a,8c0037ccc..ba4627017 --- a/shared/utils/search/videos.ts +++ b/shared/utils/search/videos.ts @@@ -1,8 -1,8 +1,8 @@@ /* tslint:disable:no-unused-expression */ import * as request from 'supertest' -import { VideosSearchQuery } from '../../../../shared/models/search' +import { VideosSearchQuery } from '../../models/search' - import { immutableAssign } from '..' + import { immutableAssign } from '../miscs/miscs' function searchVideo (url: string, search: string) { const path = '/api/v1/search/videos' diff --cc shared/utils/server/config.ts index 15a94432b,aa3100d34..5b888b061 --- a/shared/utils/server/config.ts +++ b/shared/utils/server/config.ts @@@ -1,5 -1,5 +1,5 @@@ - import { makeDeleteRequest, makeGetRequest, makePutBodyRequest } from '../' + import { makeDeleteRequest, makeGetRequest, makePutBodyRequest } from '../requests/requests' -import { CustomConfig } from '../../../../shared/models/server/custom-config.model' +import { CustomConfig } from '../../models/server/custom-config.model' function getConfig (url: string) { const path = '/api/v1/config' diff --cc shared/utils/server/jobs.ts index 3eec1d7d7,26180ec72..7c7e89824 --- a/shared/utils/server/jobs.ts +++ b/shared/utils/server/jobs.ts @@@ -1,6 -1,7 +1,7 @@@ import * as request from 'supertest' -import { Job, JobState } from '../../../../shared/models' -import { ServerInfo } from './servers' +import { Job, JobState } from '../../models' - import { ServerInfo, wait } from '../index' + import { wait } from '../miscs/miscs' ++import { ServerInfo } from './servers' function getJobsList (url: string, accessToken: string, state: JobState) { const path = '/api/v1/jobs/' + state diff --cc shared/utils/users/accounts.ts index 5601f2a77,257fa5b27..388eb6973 --- a/shared/utils/users/accounts.ts +++ b/shared/utils/users/accounts.ts @@@ -3,8 -3,8 +3,8 @@@ import { expect } from 'chai' import { existsSync, readdir } from 'fs-extra' import { join } from 'path' -import { Account } from '../../../../shared/models/actors' +import { Account } from '../../models/actors' - import { root } from '../index' + import { root } from '../miscs/miscs' import { makeGetRequest } from '../requests/requests' function getAccountsList (url: string, sort = '-createdAt', statusCodeExpected = 200) { diff --cc shared/utils/users/users.ts index 1b385aaf7,2c21a9ecf..d5d62a507 --- a/shared/utils/users/users.ts +++ b/shared/utils/users/users.ts @@@ -1,8 -1,8 +1,8 @@@ import * as request from 'supertest' - import { makePostBodyRequest, makePutBodyRequest, updateAvatarRequest } from '../' + import { makePostBodyRequest, makePutBodyRequest, updateAvatarRequest } from '../requests/requests' -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, diff --cc shared/utils/videos/video-abuses.ts index 8be891a9b,4ad82ad8c..7f011ec0f --- a/shared/utils/videos/video-abuses.ts +++ b/shared/utils/videos/video-abuses.ts @@@ -1,6 -1,6 +1,6 @@@ import * as request from 'supertest' -import { VideoAbuseUpdate } from '../../../../shared/models/videos/abuse/video-abuse-update.model' +import { VideoAbuseUpdate } from '../../models/videos/abuse/video-abuse-update.model' - import { makeDeleteRequest, makePutBodyRequest } from '..' + import { makeDeleteRequest, makePutBodyRequest } from '../requests/requests' function reportVideoAbuse (url: string, token: string, videoId: number | string, reason: string, specialStatus = 200) { const path = '/api/v1/videos/' + videoId + '/abuse' diff --cc shared/utils/videos/video-channels.ts index 3d37f0e4c,70e8d1a6b..3935c261e --- a/shared/utils/videos/video-channels.ts +++ b/shared/utils/videos/video-channels.ts @@@ -1,6 -1,6 +1,6 @@@ import * as request from 'supertest' -import { VideoChannelCreate, VideoChannelUpdate } from '../../../../shared/models/videos' +import { VideoChannelCreate, VideoChannelUpdate } from '../../models/videos' - import { updateAvatarRequest } from '../index' + import { updateAvatarRequest } from '../requests/requests' function getVideoChannelsList (url: string, start: number, count: number, sort?: string) { const path = '/api/v1/video-channels' diff --cc shared/utils/videos/video-imports.ts index bf5062cd1,eb985a5b1..3fa49b432 --- a/shared/utils/videos/video-imports.ts +++ b/shared/utils/videos/video-imports.ts @@@ -1,5 -1,5 +1,6 @@@ -import { VideoImportCreate } from '../../../../shared/models/videos' ++ +import { VideoImportCreate } from '../../models/videos' - import { makeGetRequest, makeUploadRequest } from '..' + import { makeGetRequest, makeUploadRequest } from '../requests/requests' function getYoutubeVideoUrl () { return 'https://youtu.be/msX3jv1XdvM' diff --cc shared/utils/videos/videos.ts index b3206e566,d6c3e5dac..1ab3e7c4b --- a/shared/utils/videos/videos.ts +++ b/shared/utils/videos/videos.ts @@@ -16,9 -16,9 +16,10 @@@ import ServerInfo, testImage } from '../' -import { VideoDetails, VideoPrivacy } from '../../../../shared/models/videos' -import { VIDEO_CATEGORIES, VIDEO_LANGUAGES, VIDEO_LICENCES, VIDEO_PRIVACIES } from '../../../initializers/constants' ++ +import { VideoDetails, VideoPrivacy } from '../../models/videos' - import { VIDEO_CATEGORIES, VIDEO_LANGUAGES, VIDEO_LICENCES, VIDEO_PRIVACIES } from '../../../server/initializers' - import { dateIsValid, webtorrentAdd } from '../index' ++import { VIDEO_CATEGORIES, VIDEO_LANGUAGES, VIDEO_LICENCES, VIDEO_PRIVACIES } from '../../../server/initializers/constants' + import { dateIsValid, webtorrentAdd } from '../miscs/miscs' type VideoAttributes = { name?: string