aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-06-18 10:45:25 +0200
committerChocobozzz <me@florianbigard.com>2020-06-18 10:46:27 +0200
commit26d6bf6533023326fa017812cf31bbe20c752d36 (patch)
tree9c4e3ecdc344420190f17d429bdf05d78fae7a8c /server/helpers
parentd6d951ddc0c492f3261065b5dcb4df0534d252fc (diff)
downloadPeerTube-26d6bf6533023326fa017812cf31bbe20c752d36.tar.gz
PeerTube-26d6bf6533023326fa017812cf31bbe20c752d36.tar.zst
PeerTube-26d6bf6533023326fa017812cf31bbe20c752d36.zip
Split types and typings
Diffstat (limited to 'server/helpers')
-rw-r--r--server/helpers/activitypub.ts2
-rw-r--r--server/helpers/actor.ts2
-rw-r--r--server/helpers/captions-utils.ts2
-rw-r--r--server/helpers/custom-validators/video-ownership.ts4
-rw-r--r--server/helpers/middlewares/accounts.ts2
-rw-r--r--server/helpers/middlewares/video-captions.ts2
-rw-r--r--server/helpers/middlewares/video-channels.ts2
-rw-r--r--server/helpers/middlewares/video-playlists.ts2
-rw-r--r--server/helpers/middlewares/videos.ts2
-rw-r--r--server/helpers/peertube-crypto.ts2
-rw-r--r--server/helpers/video.ts2
-rw-r--r--server/helpers/webfinger.ts2
-rw-r--r--server/helpers/webtorrent.ts6
13 files changed, 16 insertions, 16 deletions
diff --git a/server/helpers/activitypub.ts b/server/helpers/activitypub.ts
index ce48fc543..d28453d79 100644
--- a/server/helpers/activitypub.ts
+++ b/server/helpers/activitypub.ts
@@ -6,7 +6,7 @@ import { ACTIVITY_PUB, REMOTE_SCHEME } from '../initializers/constants'
6import { signJsonLDObject } from './peertube-crypto' 6import { signJsonLDObject } from './peertube-crypto'
7import { pageToStartAndCount } from './core-utils' 7import { pageToStartAndCount } from './core-utils'
8import { URL } from 'url' 8import { URL } from 'url'
9import { MActor, MVideoAccountLight } from '../typings/models' 9import { MActor, MVideoAccountLight } from '../types/models'
10import { ContextType } from '@shared/models/activitypub/context' 10import { ContextType } from '@shared/models/activitypub/context'
11 11
12function getContextData (type: ContextType) { 12function getContextData (type: ContextType) {
diff --git a/server/helpers/actor.ts b/server/helpers/actor.ts
index 117548a60..015b4a39f 100644
--- a/server/helpers/actor.ts
+++ b/server/helpers/actor.ts
@@ -1,6 +1,6 @@
1import { ActorModel } from '../models/activitypub/actor' 1import { ActorModel } from '../models/activitypub/actor'
2import * as Bluebird from 'bluebird' 2import * as Bluebird from 'bluebird'
3import { MActorFull, MActorAccountChannelId } from '../typings/models' 3import { MActorFull, MActorAccountChannelId } from '../types/models'
4 4
5type ActorFetchByUrlType = 'all' | 'association-ids' 5type ActorFetchByUrlType = 'all' | 'association-ids'
6 6
diff --git a/server/helpers/captions-utils.ts b/server/helpers/captions-utils.ts
index 73b6d166d..0dad23759 100644
--- a/server/helpers/captions-utils.ts
+++ b/server/helpers/captions-utils.ts
@@ -2,7 +2,7 @@ import { join } from 'path'
2import { CONFIG } from '../initializers/config' 2import { CONFIG } from '../initializers/config'
3import * as srt2vtt from 'srt-to-vtt' 3import * as srt2vtt from 'srt-to-vtt'
4import { createReadStream, createWriteStream, move, remove } from 'fs-extra' 4import { createReadStream, createWriteStream, move, remove } from 'fs-extra'
5import { MVideoCaptionFormattable } from '@server/typings/models' 5import { MVideoCaptionFormattable } from '@server/types/models'
6 6
7async function moveAndProcessCaptionFile (physicalFile: { filename: string, path: string }, videoCaption: MVideoCaptionFormattable) { 7async function moveAndProcessCaptionFile (physicalFile: { filename: string, path: string }, videoCaption: MVideoCaptionFormattable) {
8 const videoCaptionsDir = CONFIG.STORAGE.CAPTIONS_DIR 8 const videoCaptionsDir = CONFIG.STORAGE.CAPTIONS_DIR
diff --git a/server/helpers/custom-validators/video-ownership.ts b/server/helpers/custom-validators/video-ownership.ts
index 2d1849332..ed5f8cc2f 100644
--- a/server/helpers/custom-validators/video-ownership.ts
+++ b/server/helpers/custom-validators/video-ownership.ts
@@ -1,7 +1,7 @@
1import { Response } from 'express' 1import { Response } from 'express'
2import { VideoChangeOwnershipModel } from '../../models/video/video-change-ownership' 2import { VideoChangeOwnershipModel } from '../../models/video/video-change-ownership'
3import { MVideoChangeOwnershipFull } from '@server/typings/models/video/video-change-ownership' 3import { MVideoChangeOwnershipFull } from '@server/types/models/video/video-change-ownership'
4import { MUserId } from '@server/typings/models' 4import { MUserId } from '@server/types/models'
5 5
6export async function doesChangeVideoOwnershipExist (idArg: number | string, res: Response) { 6export async function doesChangeVideoOwnershipExist (idArg: number | string, res: Response) {
7 const id = parseInt(idArg + '', 10) 7 const id = parseInt(idArg + '', 10)
diff --git a/server/helpers/middlewares/accounts.ts b/server/helpers/middlewares/accounts.ts
index f5aa0bada..bddea7eaa 100644
--- a/server/helpers/middlewares/accounts.ts
+++ b/server/helpers/middlewares/accounts.ts
@@ -1,7 +1,7 @@
1import { Response } from 'express' 1import { Response } from 'express'
2import { AccountModel } from '../../models/account/account' 2import { AccountModel } from '../../models/account/account'
3import * as Bluebird from 'bluebird' 3import * as Bluebird from 'bluebird'
4import { MAccountDefault } from '../../typings/models' 4import { MAccountDefault } from '../../types/models'
5 5
6function doesAccountIdExist (id: number, res: Response, sendNotFound = true) { 6function doesAccountIdExist (id: number, res: Response, sendNotFound = true) {
7 const promise = AccountModel.load(id) 7 const promise = AccountModel.load(id)
diff --git a/server/helpers/middlewares/video-captions.ts b/server/helpers/middlewares/video-captions.ts
index 1b2513b60..f5ce29807 100644
--- a/server/helpers/middlewares/video-captions.ts
+++ b/server/helpers/middlewares/video-captions.ts
@@ -1,6 +1,6 @@
1import { Response } from 'express' 1import { Response } from 'express'
2import { VideoCaptionModel } from '../../models/video/video-caption' 2import { VideoCaptionModel } from '../../models/video/video-caption'
3import { MVideoId } from '@server/typings/models' 3import { MVideoId } from '@server/types/models'
4 4
5async function doesVideoCaptionExist (video: MVideoId, language: string, res: Response) { 5async function doesVideoCaptionExist (video: MVideoId, language: string, res: Response) {
6 const videoCaption = await VideoCaptionModel.loadByVideoIdAndLanguage(video.id, language) 6 const videoCaption = await VideoCaptionModel.loadByVideoIdAndLanguage(video.id, language)
diff --git a/server/helpers/middlewares/video-channels.ts b/server/helpers/middlewares/video-channels.ts
index 1595ecd94..6eecb8ee5 100644
--- a/server/helpers/middlewares/video-channels.ts
+++ b/server/helpers/middlewares/video-channels.ts
@@ -1,6 +1,6 @@
1import * as express from 'express' 1import * as express from 'express'
2import { VideoChannelModel } from '../../models/video/video-channel' 2import { VideoChannelModel } from '../../models/video/video-channel'
3import { MChannelAccountDefault } from '@server/typings/models' 3import { MChannelAccountDefault } from '@server/types/models'
4 4
5async function doesLocalVideoChannelNameExist (name: string, res: express.Response) { 5async function doesLocalVideoChannelNameExist (name: string, res: express.Response) {
6 const videoChannel = await VideoChannelModel.loadLocalByNameAndPopulateAccount(name) 6 const videoChannel = await VideoChannelModel.loadLocalByNameAndPopulateAccount(name)
diff --git a/server/helpers/middlewares/video-playlists.ts b/server/helpers/middlewares/video-playlists.ts
index 8e7484483..344104f7c 100644
--- a/server/helpers/middlewares/video-playlists.ts
+++ b/server/helpers/middlewares/video-playlists.ts
@@ -1,6 +1,6 @@
1import * as express from 'express' 1import * as express from 'express'
2import { VideoPlaylistModel } from '../../models/video/video-playlist' 2import { VideoPlaylistModel } from '../../models/video/video-playlist'
3import { MVideoPlaylist } from '../../typings/models/video/video-playlist' 3import { MVideoPlaylist } from '../../types/models/video/video-playlist'
4 4
5export type VideoPlaylistFetchType = 'summary' | 'all' 5export type VideoPlaylistFetchType = 'summary' | 'all'
6async function doesVideoPlaylistExist (id: number | string, res: express.Response, fetchType: VideoPlaylistFetchType = 'summary') { 6async function doesVideoPlaylistExist (id: number | string, res: express.Response, fetchType: VideoPlaylistFetchType = 'summary') {
diff --git a/server/helpers/middlewares/videos.ts b/server/helpers/middlewares/videos.ts
index a0bbcdb21..77a48a467 100644
--- a/server/helpers/middlewares/videos.ts
+++ b/server/helpers/middlewares/videos.ts
@@ -11,7 +11,7 @@ import {
11 MVideoImmutable, 11 MVideoImmutable,
12 MVideoThumbnail, 12 MVideoThumbnail,
13 MVideoWithRights 13 MVideoWithRights
14} from '@server/typings/models' 14} from '@server/types/models'
15import { VideoFileModel } from '@server/models/video/video-file' 15import { VideoFileModel } from '@server/models/video/video-file'
16 16
17async function doesVideoExist (id: number | string, res: Response, fetchType: VideoFetchType = 'all') { 17async function doesVideoExist (id: number | string, res: Response, fetchType: VideoFetchType = 'all') {
diff --git a/server/helpers/peertube-crypto.ts b/server/helpers/peertube-crypto.ts
index 394e97fd5..1655cd7b5 100644
--- a/server/helpers/peertube-crypto.ts
+++ b/server/helpers/peertube-crypto.ts
@@ -6,7 +6,7 @@ import { logger } from './logger'
6import { cloneDeep } from 'lodash' 6import { cloneDeep } from 'lodash'
7import { createSign, createVerify } from 'crypto' 7import { createSign, createVerify } from 'crypto'
8import * as bcrypt from 'bcrypt' 8import * as bcrypt from 'bcrypt'
9import { MActor } from '../typings/models' 9import { MActor } from '../types/models'
10 10
11const bcryptComparePromise = promisify2<any, string, boolean>(bcrypt.compare) 11const bcryptComparePromise = promisify2<any, string, boolean>(bcrypt.compare)
12const bcryptGenSaltPromise = promisify1<number, string>(bcrypt.genSalt) 12const bcryptGenSaltPromise = promisify1<number, string>(bcrypt.genSalt)
diff --git a/server/helpers/video.ts b/server/helpers/video.ts
index 4bcc6d0b9..89c85accb 100644
--- a/server/helpers/video.ts
+++ b/server/helpers/video.ts
@@ -11,7 +11,7 @@ import {
11 MVideoImmutable, 11 MVideoImmutable,
12 MVideoThumbnail, 12 MVideoThumbnail,
13 MVideoWithRights 13 MVideoWithRights
14} from '@server/typings/models' 14} from '@server/types/models'
15import { Response } from 'express' 15import { Response } from 'express'
16import { DEFAULT_AUDIO_RESOLUTION } from '@server/initializers/constants' 16import { DEFAULT_AUDIO_RESOLUTION } from '@server/initializers/constants'
17import { JobQueue } from '@server/lib/job-queue' 17import { JobQueue } from '@server/lib/job-queue'
diff --git a/server/helpers/webfinger.ts b/server/helpers/webfinger.ts
index 5443a266b..da7e88077 100644
--- a/server/helpers/webfinger.ts
+++ b/server/helpers/webfinger.ts
@@ -4,7 +4,7 @@ import { ActorModel } from '../models/activitypub/actor'
4import { isTestInstance } from './core-utils' 4import { isTestInstance } from './core-utils'
5import { isActivityPubUrlValid } from './custom-validators/activitypub/misc' 5import { isActivityPubUrlValid } from './custom-validators/activitypub/misc'
6import { WEBSERVER } from '../initializers/constants' 6import { WEBSERVER } from '../initializers/constants'
7import { MActorFull } from '../typings/models' 7import { MActorFull } from '../types/models'
8 8
9const webfinger = new WebFinger({ 9const webfinger = new WebFinger({
10 webfist_fallback: false, 10 webfist_fallback: false,
diff --git a/server/helpers/webtorrent.ts b/server/helpers/webtorrent.ts
index 7cd76d708..089954e32 100644
--- a/server/helpers/webtorrent.ts
+++ b/server/helpers/webtorrent.ts
@@ -6,9 +6,9 @@ import { CONFIG } from '../initializers/config'
6import { dirname, join } from 'path' 6import { dirname, join } from 'path'
7import * as createTorrent from 'create-torrent' 7import * as createTorrent from 'create-torrent'
8import { promisify2 } from './core-utils' 8import { promisify2 } from './core-utils'
9import { MVideo } from '@server/typings/models/video/video' 9import { MVideo } from '@server/types/models/video/video'
10import { MVideoFile, MVideoFileRedundanciesOpt } from '@server/typings/models/video/video-file' 10import { MVideoFile, MVideoFileRedundanciesOpt } from '@server/types/models/video/video-file'
11import { isStreamingPlaylist, MStreamingPlaylistVideo } from '@server/typings/models/video/video-streaming-playlist' 11import { isStreamingPlaylist, MStreamingPlaylistVideo } from '@server/types/models/video/video-streaming-playlist'
12import { WEBSERVER } from '@server/initializers/constants' 12import { WEBSERVER } from '@server/initializers/constants'
13import * as parseTorrent from 'parse-torrent' 13import * as parseTorrent from 'parse-torrent'
14import * as magnetUtil from 'magnet-uri' 14import * as magnetUtil from 'magnet-uri'