aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared
diff options
context:
space:
mode:
Diffstat (limited to 'shared')
-rw-r--r--shared/extra-utils/server/servers.ts1
-rw-r--r--shared/extra-utils/videos/videos.ts6
-rw-r--r--shared/models/common/index.ts1
-rw-r--r--shared/models/common/result-list.model.ts (renamed from shared/models/result-list.model.ts)0
-rw-r--r--shared/models/index.ts14
-rw-r--r--shared/models/moderation/abuse/abuse-create.model.ts2
-rw-r--r--shared/models/tokens/index.ts1
-rw-r--r--shared/models/tokens/oauth-client-local.model.ts (renamed from shared/models/oauth-client-local.model.ts)0
-rw-r--r--shared/models/videos/index.ts1
-rw-r--r--shared/models/videos/playlist/index.ts1
-rw-r--r--shared/models/videos/playlist/video-playlist-create-result.model.ts5
-rw-r--r--shared/models/videos/playlist/video-playlist.model.ts2
-rw-r--r--shared/models/videos/video-create-result.model.ts5
-rw-r--r--shared/models/videos/video.model.ts2
14 files changed, 30 insertions, 11 deletions
diff --git a/shared/extra-utils/server/servers.ts b/shared/extra-utils/server/servers.ts
index d04757470..28e431e94 100644
--- a/shared/extra-utils/server/servers.ts
+++ b/shared/extra-utils/server/servers.ts
@@ -43,6 +43,7 @@ interface ServerInfo {
43 video?: { 43 video?: {
44 id: number 44 id: number
45 uuid: string 45 uuid: string
46 shortUUID: string
46 name?: string 47 name?: string
47 url?: string 48 url?: string
48 49
diff --git a/shared/extra-utils/videos/videos.ts b/shared/extra-utils/videos/videos.ts
index a3a276188..469ea4d63 100644
--- a/shared/extra-utils/videos/videos.ts
+++ b/shared/extra-utils/videos/videos.ts
@@ -6,9 +6,9 @@ import got, { Response as GotResponse } from 'got/dist/source'
6import * as parseTorrent from 'parse-torrent' 6import * as parseTorrent from 'parse-torrent'
7import { join } from 'path' 7import { join } from 'path'
8import * as request from 'supertest' 8import * as request from 'supertest'
9import { v4 as uuidv4 } from 'uuid'
10import validator from 'validator' 9import validator from 'validator'
11import { getLowercaseExtension } from '@server/helpers/core-utils' 10import { getLowercaseExtension } from '@server/helpers/core-utils'
11import { buildUUID } from '@server/helpers/uuid'
12import { HttpStatusCode } from '@shared/core-utils' 12import { HttpStatusCode } from '@shared/core-utils'
13import { VideosCommonQuery } from '@shared/models' 13import { VideosCommonQuery } from '@shared/models'
14import { loadLanguages, VIDEO_CATEGORIES, VIDEO_LANGUAGES, VIDEO_LICENCES, VIDEO_PRIVACIES } from '../../../server/initializers/constants' 14import { loadLanguages, VIDEO_CATEGORIES, VIDEO_LANGUAGES, VIDEO_LICENCES, VIDEO_PRIVACIES } from '../../../server/initializers/constants'
@@ -806,7 +806,7 @@ async function uploadVideoAndGetId (options: {
806 806
807 const res = await uploadVideo(options.server.url, options.token || options.server.accessToken, videoAttrs) 807 const res = await uploadVideo(options.server.url, options.token || options.server.accessToken, videoAttrs)
808 808
809 return { id: res.body.video.id, uuid: res.body.video.uuid } 809 return res.body.video as { id: number, uuid: string, shortUUID: string }
810} 810}
811 811
812async function getLocalIdByUUID (url: string, uuid: string) { 812async function getLocalIdByUUID (url: string, uuid: string) {
@@ -827,7 +827,7 @@ async function uploadRandomVideoOnServers (servers: ServerInfo[], serverNumber:
827 827
828async function uploadRandomVideo (server: ServerInfo, wait = true, additionalParams: any = {}) { 828async function uploadRandomVideo (server: ServerInfo, wait = true, additionalParams: any = {}) {
829 const prefixName = additionalParams.prefixName || '' 829 const prefixName = additionalParams.prefixName || ''
830 const name = prefixName + uuidv4() 830 const name = prefixName + buildUUID()
831 831
832 const data = Object.assign({ name }, additionalParams) 832 const data = Object.assign({ name }, additionalParams)
833 const res = await uploadVideo(server.url, server.accessToken, data) 833 const res = await uploadVideo(server.url, server.accessToken, data)
diff --git a/shared/models/common/index.ts b/shared/models/common/index.ts
new file mode 100644
index 000000000..4db85eff2
--- /dev/null
+++ b/shared/models/common/index.ts
@@ -0,0 +1 @@
export * from './result-list.model'
diff --git a/shared/models/result-list.model.ts b/shared/models/common/result-list.model.ts
index fcafcfb2f..fcafcfb2f 100644
--- a/shared/models/result-list.model.ts
+++ b/shared/models/common/result-list.model.ts
diff --git a/shared/models/index.ts b/shared/models/index.ts
index 4db1f234e..5c2bc480e 100644
--- a/shared/models/index.ts
+++ b/shared/models/index.ts
@@ -1,16 +1,16 @@
1export * from './activitypub' 1export * from './activitypub'
2export * from './actors' 2export * from './actors'
3export * from './moderation'
4export * from './custom-markup'
5export * from './bulk' 3export * from './bulk'
6export * from './redundancy' 4export * from './common'
7export * from './users' 5export * from './custom-markup'
8export * from './videos'
9export * from './feeds' 6export * from './feeds'
10export * from './joinpeertube' 7export * from './joinpeertube'
8export * from './moderation'
11export * from './overviews' 9export * from './overviews'
12export * from './plugins' 10export * from './plugins'
11export * from './redundancy'
13export * from './search' 12export * from './search'
14export * from './server' 13export * from './server'
15export * from './oauth-client-local.model' 14export * from './tokens'
16export * from './result-list.model' 15export * from './users'
16export * from './videos'
diff --git a/shared/models/moderation/abuse/abuse-create.model.ts b/shared/models/moderation/abuse/abuse-create.model.ts
index 0e7e9587f..7d35555c3 100644
--- a/shared/models/moderation/abuse/abuse-create.model.ts
+++ b/shared/models/moderation/abuse/abuse-create.model.ts
@@ -10,7 +10,7 @@ export interface AbuseCreate {
10 } 10 }
11 11
12 video?: { 12 video?: {
13 id: number 13 id: number | string
14 startAt?: number 14 startAt?: number
15 endAt?: number 15 endAt?: number
16 } 16 }
diff --git a/shared/models/tokens/index.ts b/shared/models/tokens/index.ts
new file mode 100644
index 000000000..fe130f153
--- /dev/null
+++ b/shared/models/tokens/index.ts
@@ -0,0 +1 @@
export * from './oauth-client-local.model'
diff --git a/shared/models/oauth-client-local.model.ts b/shared/models/tokens/oauth-client-local.model.ts
index 0c6ce6c5d..0c6ce6c5d 100644
--- a/shared/models/oauth-client-local.model.ts
+++ b/shared/models/tokens/oauth-client-local.model.ts
diff --git a/shared/models/videos/index.ts b/shared/models/videos/index.ts
index 64f2c9df6..faa9b9868 100644
--- a/shared/models/videos/index.ts
+++ b/shared/models/videos/index.ts
@@ -35,3 +35,4 @@ export * from './video-transcoding-fps.model'
35 35
36export * from './video-update.model' 36export * from './video-update.model'
37export * from './video.model' 37export * from './video.model'
38export * from './video-create-result.model'
diff --git a/shared/models/videos/playlist/index.ts b/shared/models/videos/playlist/index.ts
index 99f7e9bab..f11a4bd28 100644
--- a/shared/models/videos/playlist/index.ts
+++ b/shared/models/videos/playlist/index.ts
@@ -1,4 +1,5 @@
1export * from './video-exist-in-playlist.model' 1export * from './video-exist-in-playlist.model'
2export * from './video-playlist-create-result.model'
2export * from './video-playlist-create.model' 3export * from './video-playlist-create.model'
3export * from './video-playlist-element-create.model' 4export * from './video-playlist-element-create.model'
4export * from './video-playlist-element-update.model' 5export * from './video-playlist-element-update.model'
diff --git a/shared/models/videos/playlist/video-playlist-create-result.model.ts b/shared/models/videos/playlist/video-playlist-create-result.model.ts
new file mode 100644
index 000000000..cd9b170ae
--- /dev/null
+++ b/shared/models/videos/playlist/video-playlist-create-result.model.ts
@@ -0,0 +1,5 @@
1export interface VideoPlaylistCreateResult {
2 id: number
3 uuid: string
4 shortUUID: string
5}
diff --git a/shared/models/videos/playlist/video-playlist.model.ts b/shared/models/videos/playlist/video-playlist.model.ts
index ab4171ad1..b8a9955d9 100644
--- a/shared/models/videos/playlist/video-playlist.model.ts
+++ b/shared/models/videos/playlist/video-playlist.model.ts
@@ -6,6 +6,8 @@ import { VideoPlaylistType } from './video-playlist-type.model'
6export interface VideoPlaylist { 6export interface VideoPlaylist {
7 id: number 7 id: number
8 uuid: string 8 uuid: string
9 shortUUID: string
10
9 isLocal: boolean 11 isLocal: boolean
10 12
11 url: string 13 url: string
diff --git a/shared/models/videos/video-create-result.model.ts b/shared/models/videos/video-create-result.model.ts
new file mode 100644
index 000000000..a9f8e25a0
--- /dev/null
+++ b/shared/models/videos/video-create-result.model.ts
@@ -0,0 +1,5 @@
1export interface VideoCreateResult {
2 id: number
3 uuid: string
4 shortUUID: string
5}
diff --git a/shared/models/videos/video.model.ts b/shared/models/videos/video.model.ts
index caefeff82..0e3e89f43 100644
--- a/shared/models/videos/video.model.ts
+++ b/shared/models/videos/video.model.ts
@@ -10,6 +10,8 @@ import { VideoStreamingPlaylist } from './video-streaming-playlist.model'
10export interface Video { 10export interface Video {
11 id: number 11 id: number
12 uuid: string 12 uuid: string
13 shortUUID: string
14
13 createdAt: Date | string 15 createdAt: Date | string
14 updatedAt: Date | string 16 updatedAt: Date | string
15 publishedAt: Date | string 17 publishedAt: Date | string