はじまりの大地
このコミットが含まれているのは:
@@ -0,0 +1,156 @@
|
||||
import { ActivityPubActor } from './activitypub-actor.js'
|
||||
import { ActivityPubSignature } from './activitypub-signature.js'
|
||||
import {
|
||||
ActivityFlagReasonObject,
|
||||
ActivityObject,
|
||||
APObjectId,
|
||||
CacheFileObject,
|
||||
PlaylistObject,
|
||||
VideoCommentObject,
|
||||
VideoObject,
|
||||
WatchActionObject
|
||||
} from './objects/index.js'
|
||||
|
||||
export type ActivityUpdateObject =
|
||||
Extract<ActivityObject, VideoObject | CacheFileObject | PlaylistObject | ActivityPubActor | string> | ActivityPubActor
|
||||
|
||||
// Cannot Extract from Activity because of circular reference
|
||||
export type ActivityUndoObject =
|
||||
ActivityFollow | ActivityLike | ActivityDislike | ActivityCreate<CacheFileObject | string> | ActivityAnnounce
|
||||
|
||||
export type ActivityCreateObject =
|
||||
Extract<ActivityObject, VideoObject | CacheFileObject | WatchActionObject | VideoCommentObject | PlaylistObject | string>
|
||||
|
||||
export type Activity =
|
||||
ActivityCreate<ActivityCreateObject> |
|
||||
ActivityUpdate<ActivityUpdateObject> |
|
||||
ActivityDelete |
|
||||
ActivityFollow |
|
||||
ActivityAccept |
|
||||
ActivityAnnounce |
|
||||
ActivityUndo<ActivityUndoObject> |
|
||||
ActivityLike |
|
||||
ActivityReject |
|
||||
ActivityView |
|
||||
ActivityDislike |
|
||||
ActivityFlag |
|
||||
ActivityApproveReply |
|
||||
ActivityRejectReply
|
||||
|
||||
export type ActivityType =
|
||||
'Create' |
|
||||
'Update' |
|
||||
'Delete' |
|
||||
'Follow' |
|
||||
'Accept' |
|
||||
'Announce' |
|
||||
'Undo' |
|
||||
'Like' |
|
||||
'Reject' |
|
||||
'View' |
|
||||
'Dislike' |
|
||||
'Flag' |
|
||||
'ApproveReply' |
|
||||
'RejectReply'
|
||||
|
||||
export interface ActivityAudience {
|
||||
to: string[]
|
||||
cc: string[]
|
||||
}
|
||||
|
||||
export interface BaseActivity {
|
||||
'@context'?: any[]
|
||||
id: string
|
||||
to?: string[]
|
||||
cc?: string[]
|
||||
actor: string | ActivityPubActor
|
||||
type: ActivityType
|
||||
signature?: ActivityPubSignature
|
||||
}
|
||||
|
||||
export interface ActivityCreate <T extends ActivityCreateObject> extends BaseActivity {
|
||||
type: 'Create'
|
||||
object: T
|
||||
}
|
||||
|
||||
export interface ActivityUpdate <T extends ActivityUpdateObject> extends BaseActivity {
|
||||
type: 'Update'
|
||||
object: T
|
||||
}
|
||||
|
||||
export interface ActivityDelete extends BaseActivity {
|
||||
type: 'Delete'
|
||||
object: APObjectId
|
||||
}
|
||||
|
||||
export interface ActivityFollow extends BaseActivity {
|
||||
type: 'Follow'
|
||||
object: string
|
||||
}
|
||||
|
||||
export interface ActivityAccept extends BaseActivity {
|
||||
type: 'Accept'
|
||||
object: ActivityFollow
|
||||
}
|
||||
|
||||
export interface ActivityApproveReply extends BaseActivity {
|
||||
type: 'ApproveReply'
|
||||
object: string
|
||||
inReplyTo: string
|
||||
}
|
||||
|
||||
export interface ActivityRejectReply extends BaseActivity {
|
||||
type: 'RejectReply'
|
||||
object: string
|
||||
inReplyTo: string
|
||||
}
|
||||
|
||||
export interface ActivityReject extends BaseActivity {
|
||||
type: 'Reject'
|
||||
object: ActivityFollow
|
||||
}
|
||||
|
||||
export interface ActivityAnnounce extends BaseActivity {
|
||||
type: 'Announce'
|
||||
object: APObjectId
|
||||
}
|
||||
|
||||
export interface ActivityUndo <T extends ActivityUndoObject> extends BaseActivity {
|
||||
type: 'Undo'
|
||||
object: T
|
||||
}
|
||||
|
||||
export interface ActivityLike extends BaseActivity {
|
||||
type: 'Like'
|
||||
object: APObjectId
|
||||
}
|
||||
|
||||
export interface ActivityView extends BaseActivity {
|
||||
type: 'View'
|
||||
actor: string
|
||||
object: APObjectId
|
||||
|
||||
// If sending a "viewer" event
|
||||
expires?: string
|
||||
result?: {
|
||||
type: 'InteractionCounter'
|
||||
interactionType: 'WatchAction'
|
||||
userInteractionCount: number
|
||||
}
|
||||
}
|
||||
|
||||
export interface ActivityDislike extends BaseActivity {
|
||||
id: string
|
||||
type: 'Dislike'
|
||||
actor: string
|
||||
object: APObjectId
|
||||
}
|
||||
|
||||
export interface ActivityFlag extends BaseActivity {
|
||||
type: 'Flag'
|
||||
content: string
|
||||
object: APObjectId | APObjectId[]
|
||||
tag?: ActivityFlagReasonObject[]
|
||||
startAt?: number
|
||||
endAt?: number
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
import { ActivityIconObject, ActivityPubAttributedTo } from './objects/common-objects.js'
|
||||
|
||||
export type ActivityPubActorType = 'Person' | 'Application' | 'Group' | 'Service' | 'Organization'
|
||||
|
||||
export interface ActivityPubActor {
|
||||
'@context': any[]
|
||||
type: ActivityPubActorType
|
||||
id: string
|
||||
following: string
|
||||
followers: string
|
||||
playlists?: string
|
||||
inbox: string
|
||||
outbox: string
|
||||
preferredUsername: string
|
||||
url: string
|
||||
name: string
|
||||
endpoints: {
|
||||
sharedInbox: string
|
||||
}
|
||||
summary: string
|
||||
attributedTo?: ActivityPubAttributedTo[]
|
||||
|
||||
support?: string
|
||||
publicKey: {
|
||||
id: string
|
||||
owner: string
|
||||
publicKeyPem: string
|
||||
}
|
||||
|
||||
// Lemmy attribute for groups
|
||||
postingRestrictedToMods?: boolean
|
||||
|
||||
image?: ActivityIconObject | ActivityIconObject[]
|
||||
icon?: ActivityIconObject | ActivityIconObject[]
|
||||
|
||||
published?: string
|
||||
|
||||
// For export
|
||||
likes?: string
|
||||
dislikes?: string
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import { Activity } from './activity.js'
|
||||
|
||||
export interface ActivityPubCollection {
|
||||
'@context': any[]
|
||||
type: 'Collection' | 'CollectionPage'
|
||||
totalItems: number
|
||||
partOf?: string
|
||||
items: Activity[]
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
export interface ActivityPubOrderedCollection<T> {
|
||||
id: string
|
||||
|
||||
'@context': any[]
|
||||
type: 'OrderedCollection' | 'OrderedCollectionPage'
|
||||
totalItems: number
|
||||
orderedItems: T[]
|
||||
|
||||
partOf?: string
|
||||
next?: string
|
||||
first?: string
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
import { Activity } from './activity.js'
|
||||
import { ActivityPubCollection } from './activitypub-collection.js'
|
||||
import { ActivityPubOrderedCollection } from './activitypub-ordered-collection.js'
|
||||
|
||||
export type RootActivity = Activity | ActivityPubCollection | ActivityPubOrderedCollection<Activity>
|
||||
@@ -0,0 +1,6 @@
|
||||
export interface ActivityPubSignature {
|
||||
type: string
|
||||
created: Date
|
||||
creator: string
|
||||
signatureValue: string
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
export type ContextType =
|
||||
'Video' |
|
||||
'Comment' |
|
||||
'Playlist' |
|
||||
'Follow' |
|
||||
'Reject' |
|
||||
'Accept' |
|
||||
'View' |
|
||||
'Announce' |
|
||||
'CacheFile' |
|
||||
'Delete' |
|
||||
'Rate' |
|
||||
'Flag' |
|
||||
'Actor' |
|
||||
'Collection' |
|
||||
'WatchAction' |
|
||||
'Chapters' |
|
||||
'ApproveReply' |
|
||||
'RejectReply'
|
||||
@@ -0,0 +1,9 @@
|
||||
export * from './objects/index.js'
|
||||
export * from './activity.js'
|
||||
export * from './activitypub-actor.js'
|
||||
export * from './activitypub-collection.js'
|
||||
export * from './activitypub-ordered-collection.js'
|
||||
export * from './activitypub-root.js'
|
||||
export * from './activitypub-signature.js'
|
||||
export * from './context.js'
|
||||
export * from './webfinger.js'
|
||||
@@ -0,0 +1,15 @@
|
||||
import { ActivityFlagReasonObject } from './common-objects.js'
|
||||
|
||||
export interface AbuseObject {
|
||||
type: 'Flag'
|
||||
|
||||
content: string
|
||||
mediaType: 'text/markdown'
|
||||
|
||||
object: string | string[]
|
||||
|
||||
tag?: ActivityFlagReasonObject[]
|
||||
|
||||
startAt?: number
|
||||
endAt?: number
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import { AbuseObject } from './abuse-object.js'
|
||||
import { CacheFileObject } from './cache-file-object.js'
|
||||
import { PlaylistObject } from './playlist-object.js'
|
||||
import { VideoCommentObject } from './video-comment-object.js'
|
||||
import { VideoObject } from './video-object.js'
|
||||
import { WatchActionObject } from './watch-action-object.js'
|
||||
|
||||
export type ActivityObject =
|
||||
VideoObject |
|
||||
AbuseObject |
|
||||
VideoCommentObject |
|
||||
CacheFileObject |
|
||||
PlaylistObject |
|
||||
WatchActionObject |
|
||||
string
|
||||
|
||||
export type APObjectId = string | { id: string }
|
||||
@@ -0,0 +1,9 @@
|
||||
import { ActivityVideoUrlObject, ActivityPlaylistUrlObject } from './common-objects.js'
|
||||
|
||||
export interface CacheFileObject {
|
||||
id: string
|
||||
type: 'CacheFile'
|
||||
object: string
|
||||
expires: string
|
||||
url: ActivityVideoUrlObject | ActivityPlaylistUrlObject
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
import { AbusePredefinedReasonsString } from '../../moderation/abuse/abuse-reason.model.js'
|
||||
|
||||
export interface ActivityIdentifierObject {
|
||||
identifier: string
|
||||
name: string
|
||||
url?: string
|
||||
}
|
||||
|
||||
export interface ActivityIconObject {
|
||||
type: 'Image'
|
||||
url: string
|
||||
mediaType: string
|
||||
width: number
|
||||
height: number | null
|
||||
}
|
||||
|
||||
export type ActivityVideoUrlObject = {
|
||||
type: 'Link'
|
||||
mediaType: 'video/mp4' | 'video/webm' | 'video/ogg' | 'audio/mp4'
|
||||
href: string
|
||||
height: number
|
||||
width: number | null
|
||||
size: number
|
||||
fps: number
|
||||
}
|
||||
|
||||
export type ActivityPlaylistSegmentHashesObject = {
|
||||
type: 'Link'
|
||||
name: 'sha256'
|
||||
mediaType: 'application/json'
|
||||
href: string
|
||||
}
|
||||
|
||||
export type ActivityVideoFileMetadataUrlObject = {
|
||||
type: 'Link'
|
||||
rel: [ 'metadata', any ]
|
||||
mediaType: 'application/json'
|
||||
height: number
|
||||
width: number | null
|
||||
href: string
|
||||
fps: number
|
||||
}
|
||||
|
||||
export type ActivityTrackerUrlObject = {
|
||||
type: 'Link'
|
||||
rel: [ 'tracker', 'websocket' | 'http' ]
|
||||
name: string
|
||||
href: string
|
||||
}
|
||||
|
||||
export type ActivityStreamingPlaylistInfohashesObject = {
|
||||
type: 'Infohash'
|
||||
name: string
|
||||
}
|
||||
|
||||
export type ActivityPlaylistUrlObject = {
|
||||
type: 'Link'
|
||||
mediaType: 'application/x-mpegURL'
|
||||
href: string
|
||||
tag?: ActivityTagObject[]
|
||||
}
|
||||
|
||||
export type ActivityBitTorrentUrlObject = {
|
||||
type: 'Link'
|
||||
mediaType: 'application/x-bittorrent' | 'application/x-bittorrent;x-scheme-handler/magnet'
|
||||
href: string
|
||||
height: number
|
||||
width: number | null
|
||||
fps: number | null
|
||||
}
|
||||
|
||||
export type ActivityMagnetUrlObject = {
|
||||
type: 'Link'
|
||||
mediaType: 'application/x-bittorrent;x-scheme-handler/magnet'
|
||||
href: string
|
||||
height: number
|
||||
width: number | null
|
||||
fps: number | null
|
||||
}
|
||||
|
||||
export type ActivityHtmlUrlObject = {
|
||||
type: 'Link'
|
||||
mediaType: 'text/html'
|
||||
href: string
|
||||
}
|
||||
|
||||
export interface ActivityHashTagObject {
|
||||
type: 'Hashtag'
|
||||
href?: string
|
||||
name: string
|
||||
}
|
||||
|
||||
export interface ActivityMentionObject {
|
||||
type: 'Mention'
|
||||
href?: string
|
||||
name: string
|
||||
}
|
||||
|
||||
export interface ActivityFlagReasonObject {
|
||||
type: 'Hashtag'
|
||||
name: AbusePredefinedReasonsString
|
||||
}
|
||||
|
||||
export type ActivityTagObject =
|
||||
ActivityPlaylistSegmentHashesObject
|
||||
| ActivityStreamingPlaylistInfohashesObject
|
||||
| ActivityVideoUrlObject
|
||||
| ActivityHashTagObject
|
||||
| ActivityMentionObject
|
||||
| ActivityBitTorrentUrlObject
|
||||
| ActivityMagnetUrlObject
|
||||
| ActivityVideoFileMetadataUrlObject
|
||||
|
||||
export type ActivityUrlObject =
|
||||
ActivityVideoUrlObject
|
||||
| ActivityPlaylistUrlObject
|
||||
| ActivityBitTorrentUrlObject
|
||||
| ActivityMagnetUrlObject
|
||||
| ActivityHtmlUrlObject
|
||||
| ActivityVideoFileMetadataUrlObject
|
||||
| ActivityTrackerUrlObject
|
||||
|
||||
export type ActivityPubAttributedTo = { type: 'Group' | 'Person', id: string } | string
|
||||
|
||||
export interface ActivityTombstoneObject {
|
||||
'@context'?: any
|
||||
id: string
|
||||
url?: string
|
||||
type: 'Tombstone'
|
||||
name?: string
|
||||
formerType?: string
|
||||
inReplyTo?: string
|
||||
published: string
|
||||
updated: string
|
||||
deleted: string
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
export * from './abuse-object.js'
|
||||
export * from './activitypub-object.js'
|
||||
export * from './cache-file-object.js'
|
||||
export * from './common-objects.js'
|
||||
export * from './playlist-element-object.js'
|
||||
export * from './playlist-object.js'
|
||||
export * from './video-caption-object.js'
|
||||
export * from './video-chapters-object.js'
|
||||
export * from './video-comment-object.js'
|
||||
export * from './video-object.js'
|
||||
export * from './watch-action-object.js'
|
||||
@@ -0,0 +1,10 @@
|
||||
export interface PlaylistElementObject {
|
||||
id: string
|
||||
type: 'PlaylistElement'
|
||||
|
||||
url: string
|
||||
position: number
|
||||
|
||||
startTimestamp?: number
|
||||
stopTimestamp?: number
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
import { ActivityIconObject, ActivityPubAttributedTo } from './common-objects.js'
|
||||
|
||||
export interface PlaylistObject {
|
||||
id: string
|
||||
type: 'Playlist'
|
||||
|
||||
name: string
|
||||
|
||||
content: string
|
||||
mediaType: 'text/markdown'
|
||||
|
||||
uuid: string
|
||||
|
||||
totalItems: number
|
||||
attributedTo: ActivityPubAttributedTo[]
|
||||
|
||||
icon?: ActivityIconObject
|
||||
|
||||
published: string
|
||||
updated: string
|
||||
|
||||
orderedItems?: string[]
|
||||
|
||||
partOf?: string
|
||||
next?: string
|
||||
first?: string
|
||||
|
||||
to?: string[]
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
import { ActivityIdentifierObject } from './common-objects.js'
|
||||
|
||||
export interface VideoCaptionObject extends ActivityIdentifierObject {
|
||||
automaticallyGenerated: boolean
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
export interface VideoChaptersObject {
|
||||
id: string
|
||||
hasPart: VideoChapterObject[]
|
||||
}
|
||||
|
||||
// Same as https://schema.org/hasPart
|
||||
export interface VideoChapterObject {
|
||||
name: string
|
||||
startOffset: number
|
||||
endOffset: number
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import { ActivityPubAttributedTo, ActivityTagObject } from './common-objects.js'
|
||||
|
||||
export interface VideoCommentObject {
|
||||
type: 'Note'
|
||||
id: string
|
||||
|
||||
content: string
|
||||
mediaType: 'text/markdown'
|
||||
|
||||
inReplyTo: string
|
||||
published: string
|
||||
updated: string
|
||||
url: string
|
||||
attributedTo: ActivityPubAttributedTo
|
||||
tag: ActivityTagObject[]
|
||||
|
||||
replyApproval: string | null
|
||||
|
||||
to?: string[]
|
||||
cc?: string[]
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
import { LiveVideoLatencyModeType, VideoCommentPolicyType, VideoStateType } from '../../videos/index.js'
|
||||
import {
|
||||
ActivityIconObject,
|
||||
ActivityIdentifierObject,
|
||||
ActivityPubAttributedTo,
|
||||
ActivityTagObject,
|
||||
ActivityUrlObject
|
||||
} from './common-objects.js'
|
||||
import { VideoCaptionObject } from './video-caption-object.js'
|
||||
import { VideoChapterObject } from './video-chapters-object.js'
|
||||
|
||||
export interface VideoObject {
|
||||
type: 'Video'
|
||||
id: string
|
||||
name: string
|
||||
duration: string
|
||||
uuid: string
|
||||
tag: ActivityTagObject[]
|
||||
category: ActivityIdentifierObject
|
||||
licence: ActivityIdentifierObject
|
||||
language: ActivityIdentifierObject
|
||||
subtitleLanguage: VideoCaptionObject[]
|
||||
|
||||
views: number
|
||||
|
||||
sensitive: boolean
|
||||
|
||||
isLiveBroadcast: boolean
|
||||
liveSaveReplay: boolean
|
||||
permanentLive: boolean
|
||||
latencyMode: LiveVideoLatencyModeType
|
||||
|
||||
commentsEnabled?: boolean
|
||||
commentsPolicy: VideoCommentPolicyType
|
||||
canReply: 'as:Public' | 'https://www.w3.org/ns/activitystreams#Public'
|
||||
|
||||
downloadEnabled: boolean
|
||||
waitTranscoding: boolean
|
||||
state: VideoStateType
|
||||
|
||||
published: string
|
||||
originallyPublishedAt: string
|
||||
updated: string
|
||||
uploadDate: string
|
||||
|
||||
mediaType: 'text/markdown'
|
||||
content: string
|
||||
|
||||
support: string
|
||||
|
||||
aspectRatio: number
|
||||
|
||||
icon: ActivityIconObject[]
|
||||
|
||||
url: ActivityUrlObject[]
|
||||
|
||||
likes: string
|
||||
dislikes: string
|
||||
shares: string
|
||||
comments: string
|
||||
hasParts: string | VideoChapterObject[]
|
||||
|
||||
attributedTo: ActivityPubAttributedTo[]
|
||||
|
||||
preview?: ActivityPubStoryboard[]
|
||||
|
||||
to?: string[]
|
||||
cc?: string[]
|
||||
|
||||
// For export
|
||||
attachment?: {
|
||||
type: 'Video'
|
||||
url: string
|
||||
mediaType: string
|
||||
height: number
|
||||
size: number
|
||||
fps: number
|
||||
}[]
|
||||
}
|
||||
|
||||
export interface ActivityPubStoryboard {
|
||||
type: 'Image'
|
||||
rel: [ 'storyboard' ]
|
||||
url: {
|
||||
href: string
|
||||
mediaType: string
|
||||
width: number
|
||||
height: number
|
||||
tileWidth: number
|
||||
tileHeight: number
|
||||
tileDuration: string
|
||||
}[]
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
export interface WatchActionObject {
|
||||
id: string
|
||||
type: 'WatchAction'
|
||||
|
||||
startTime: string
|
||||
endTime: string
|
||||
|
||||
location?: {
|
||||
addressCountry: string
|
||||
addressRegion: string
|
||||
}
|
||||
|
||||
uuid: string
|
||||
object: string
|
||||
actionStatus: 'CompletedActionStatus'
|
||||
|
||||
duration: string
|
||||
|
||||
watchSections: {
|
||||
startTimestamp: number
|
||||
endTimestamp: number
|
||||
}[]
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
export interface WebFingerData {
|
||||
subject: string
|
||||
aliases: string[]
|
||||
links: {
|
||||
rel: 'self'
|
||||
type: 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"'
|
||||
href: string
|
||||
}[]
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import { ActorImage } from './actor-image.model.js'
|
||||
import { Actor } from './actor.model.js'
|
||||
|
||||
export interface Account extends Actor {
|
||||
displayName: string
|
||||
description: string
|
||||
avatars: ActorImage[]
|
||||
|
||||
updatedAt: Date | string
|
||||
|
||||
userId?: number
|
||||
}
|
||||
|
||||
export interface AccountSummary {
|
||||
id: number
|
||||
name: string
|
||||
displayName: string
|
||||
url: string
|
||||
host: string
|
||||
|
||||
avatars: ActorImage[]
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
export interface ActorImage {
|
||||
width: number
|
||||
path: string
|
||||
|
||||
url?: string
|
||||
|
||||
createdAt: Date | string
|
||||
updatedAt: Date | string
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
export const ActorImageType = {
|
||||
AVATAR: 1,
|
||||
BANNER: 2
|
||||
} as const
|
||||
|
||||
export type ActorImageType_Type = typeof ActorImageType[keyof typeof ActorImageType]
|
||||
@@ -0,0 +1,13 @@
|
||||
import { ActorImage } from './actor-image.model.js'
|
||||
|
||||
export interface Actor {
|
||||
id: number
|
||||
url: string
|
||||
name: string
|
||||
host: string
|
||||
followingCount: number
|
||||
followersCount: number
|
||||
createdAt: Date | string
|
||||
|
||||
avatars: ActorImage[]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export interface CustomPage {
|
||||
content: string
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import { Actor } from './actor.model.js'
|
||||
|
||||
export type FollowState = 'pending' | 'accepted' | 'rejected'
|
||||
|
||||
export interface ActorFollow {
|
||||
id: number
|
||||
follower: Actor & { hostRedundancyAllowed: boolean }
|
||||
following: Actor & { hostRedundancyAllowed: boolean }
|
||||
score: number
|
||||
state: FollowState
|
||||
createdAt: Date
|
||||
updatedAt: Date
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
export * from './account.model.js'
|
||||
export * from './actor-image.model.js'
|
||||
export * from './actor-image.type.js'
|
||||
export * from './actor.model.js'
|
||||
export * from './custom-page.model.js'
|
||||
export * from './follow.model.js'
|
||||
@@ -0,0 +1,4 @@
|
||||
export interface BulkRemoveCommentsOfBody {
|
||||
accountName: string
|
||||
scope: 'my-videos' | 'instance'
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export * from './bulk-remove-comments-of-body.model.js'
|
||||
@@ -0,0 +1,6 @@
|
||||
export const FileStorage = {
|
||||
FILE_SYSTEM: 0,
|
||||
OBJECT_STORAGE: 1
|
||||
} as const
|
||||
|
||||
export type FileStorageType = typeof FileStorage[keyof typeof FileStorage]
|
||||
@@ -0,0 +1,3 @@
|
||||
export * from './file-storage.enum.js'
|
||||
export * from './result-list.model.js'
|
||||
export * from './simple-logger.model.js'
|
||||
@@ -0,0 +1,8 @@
|
||||
export interface ResultList<T> {
|
||||
total: number
|
||||
data: T[]
|
||||
}
|
||||
|
||||
export interface ThreadsResultList <T> extends ResultList <T> {
|
||||
totalNotDeletedComments: number
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
export type SimpleLogger = {
|
||||
info: (msg: string, obj?: object) => void
|
||||
debug: (msg: string, obj?: object) => void
|
||||
warn: (msg: string, obj?: object) => void
|
||||
error: (msg: string, obj?: object) => void
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
type StringBoolean = 'true' | 'false'
|
||||
|
||||
export type EmbedMarkupData = {
|
||||
// Video or playlist uuid
|
||||
uuid: string
|
||||
}
|
||||
|
||||
export type VideoMiniatureMarkupData = {
|
||||
// Video uuid
|
||||
uuid: string
|
||||
|
||||
onlyDisplayTitle?: StringBoolean
|
||||
}
|
||||
|
||||
export type PlaylistMiniatureMarkupData = {
|
||||
// Playlist uuid
|
||||
uuid: string
|
||||
}
|
||||
|
||||
export type ChannelMiniatureMarkupData = {
|
||||
// Channel name (username)
|
||||
name: string
|
||||
|
||||
displayLatestVideo?: StringBoolean
|
||||
displayDescription?: StringBoolean
|
||||
}
|
||||
|
||||
export type VideosListMarkupData = {
|
||||
onlyDisplayTitle?: StringBoolean
|
||||
maxRows?: string // number
|
||||
|
||||
sort?: string
|
||||
count?: string // number
|
||||
|
||||
categoryOneOf?: string // coma separated values, number[]
|
||||
languageOneOf?: string // coma separated values
|
||||
|
||||
channelHandle?: string
|
||||
accountHandle?: string
|
||||
|
||||
isLive?: string // number
|
||||
|
||||
onlyLocal?: StringBoolean
|
||||
}
|
||||
|
||||
export type ButtonMarkupData = {
|
||||
theme: 'primary' | 'secondary'
|
||||
href: string
|
||||
label: string
|
||||
blankTarget?: StringBoolean
|
||||
}
|
||||
|
||||
export type ContainerMarkupData = {
|
||||
width?: string
|
||||
title?: string
|
||||
description?: string
|
||||
layout?: 'row' | 'column'
|
||||
|
||||
justifyContent?: 'space-between' | 'normal' // default to 'space-between'
|
||||
}
|
||||
|
||||
export type InstanceBannerMarkupData = {
|
||||
revertHomePaddingTop?: StringBoolean // default to 'true'
|
||||
}
|
||||
|
||||
export type InstanceAvatarMarkupData = {
|
||||
size: string // size in pixels
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export * from './custom-markup-data.model.js'
|
||||
@@ -0,0 +1,7 @@
|
||||
export const FeedFormat = {
|
||||
RSS: 'xml',
|
||||
ATOM: 'atom',
|
||||
JSON: 'json'
|
||||
} as const
|
||||
|
||||
export type FeedFormatType = typeof FeedFormat[keyof typeof FeedFormat]
|
||||
@@ -0,0 +1 @@
|
||||
export * from './feed-format.enum.js'
|
||||
@@ -0,0 +1,23 @@
|
||||
/** HTTP request method to indicate the desired action to be performed for a given resource. */
|
||||
export const HttpMethod = {
|
||||
/** The CONNECT method establishes a tunnel to the server identified by the target resource. */
|
||||
CONNECT: 'CONNECT',
|
||||
/** The DELETE method deletes the specified resource. */
|
||||
DELETE: 'DELETE',
|
||||
/** The GET method requests a representation of the specified resource. Requests using GET should only retrieve data. */
|
||||
GET: 'GET',
|
||||
/** The HEAD method asks for a response identical to that of a GET request, but without the response body. */
|
||||
HEAD: 'HEAD',
|
||||
/** The OPTIONS method is used to describe the communication options for the target resource. */
|
||||
OPTIONS: 'OPTIONS',
|
||||
/** The PATCH method is used to apply partial modifications to a resource. */
|
||||
PATCH: 'PATCH',
|
||||
/** The POST method is used to submit an entity to the specified resource */
|
||||
POST: 'POST',
|
||||
/** The PUT method replaces all current representations of the target resource with the request payload. */
|
||||
PUT: 'PUT',
|
||||
/** The TRACE method performs a message loop-back test along the path to the target resource. */
|
||||
TRACE: 'TRACE'
|
||||
} as const
|
||||
|
||||
export type HttpMethodType = typeof HttpMethod[keyof typeof HttpMethod]
|
||||
@@ -0,0 +1,366 @@
|
||||
/**
|
||||
* Hypertext Transfer Protocol (HTTP) response status codes.
|
||||
* @see {@link https://en.wikipedia.org/wiki/List_of_HTTP_status_codes}
|
||||
*
|
||||
* WebDAV and other codes useless with regards to PeerTube are not listed.
|
||||
*/
|
||||
export const HttpStatusCode = {
|
||||
|
||||
/**
|
||||
* Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.2.1
|
||||
*
|
||||
* The server has received the request headers and the client should proceed to send the request body
|
||||
* (in the case of a request for which a body needs to be sent; for example, a POST request).
|
||||
* Sending a large request body to a server after a request has been rejected for inappropriate headers would be inefficient.
|
||||
* To have a server check the request's headers, a client must send Expect: 100-continue as a header in its initial request
|
||||
* and receive a 100 Continue status code in response before sending the body. The response 417 Expectation Failed indicates
|
||||
* the request should not be continued.
|
||||
*/
|
||||
CONTINUE_100: 100,
|
||||
|
||||
/**
|
||||
* Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.2.2
|
||||
*
|
||||
* This code is sent in response to an Upgrade request header by the client, and indicates the protocol the server is switching too.
|
||||
*/
|
||||
SWITCHING_PROTOCOLS_101: 101,
|
||||
|
||||
/**
|
||||
* Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.1
|
||||
*
|
||||
* Standard response for successful HTTP requests. The actual response will depend on the request method used:
|
||||
* GET: The resource has been fetched and is transmitted in the message body.
|
||||
* HEAD: The entity headers are in the message body.
|
||||
* POST: The resource describing the result of the action is transmitted in the message body.
|
||||
* TRACE: The message body contains the request message as received by the server
|
||||
*/
|
||||
OK_200: 200,
|
||||
|
||||
/**
|
||||
* Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.2
|
||||
*
|
||||
* The request has been fulfilled, resulting in the creation of a new resource, typically after a PUT.
|
||||
*/
|
||||
CREATED_201: 201,
|
||||
|
||||
/**
|
||||
* The request has been accepted for processing, but the processing has not been completed.
|
||||
* The request might or might not be eventually acted upon, and may be disallowed when processing occurs.
|
||||
*/
|
||||
ACCEPTED_202: 202,
|
||||
|
||||
/**
|
||||
* Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.5
|
||||
*
|
||||
* There is no content to send for this request, but the headers may be useful.
|
||||
* The user-agent may update its cached headers for this resource with the new ones.
|
||||
*/
|
||||
NO_CONTENT_204: 204,
|
||||
|
||||
/**
|
||||
* The server successfully processed the request, but is not returning any content.
|
||||
* Unlike a 204 response, this response requires that the requester reset the document view.
|
||||
*/
|
||||
RESET_CONTENT_205: 205,
|
||||
|
||||
/**
|
||||
* The server is delivering only part of the resource (byte serving) due to a range header sent by the client.
|
||||
* The range header is used by HTTP clients to enable resuming of interrupted downloads,
|
||||
* or split a download into multiple simultaneous streams.
|
||||
*/
|
||||
PARTIAL_CONTENT_206: 206,
|
||||
|
||||
/**
|
||||
* Indicates multiple options for the resource from which the client may choose (via agent-driven content negotiation).
|
||||
* For example, this code could be used to present multiple video format options,
|
||||
* to list files with different filename extensions, or to suggest word-sense disambiguation.
|
||||
*/
|
||||
MULTIPLE_CHOICES_300: 300,
|
||||
|
||||
/**
|
||||
* This and all future requests should be directed to the given URI.
|
||||
*/
|
||||
MOVED_PERMANENTLY_301: 301,
|
||||
|
||||
/**
|
||||
* This is an example of industry practice contradicting the standard.
|
||||
* The HTTP/1.0 specification (RFC 1945) required the client to perform a temporary redirect
|
||||
* (the original describing phrase was "Moved Temporarily"), but popular browsers implemented 302
|
||||
* with the functionality of a 303 See Other. Therefore, HTTP/1.1 added status codes 303 and 307
|
||||
* to distinguish between the two behaviours. However, some Web applications and frameworks
|
||||
* use the 302 status code as if it were the 303.
|
||||
*/
|
||||
FOUND_302: 302,
|
||||
|
||||
/**
|
||||
* SINCE HTTP/1.1
|
||||
* The response to the request can be found under another URI using a GET method.
|
||||
* When received in response to a POST (or PUT/DELETE), the client should presume that
|
||||
* the server has received the data and should issue a redirect with a separate GET message.
|
||||
*/
|
||||
SEE_OTHER_303: 303,
|
||||
|
||||
/**
|
||||
* Official Documentation @ https://tools.ietf.org/html/rfc7232#section-4.1
|
||||
*
|
||||
* Indicates that the resource has not been modified since the version specified by the request headers
|
||||
* `If-Modified-Since` or `If-None-Match`.
|
||||
* In such case, there is no need to retransmit the resource since the client still has a previously-downloaded copy.
|
||||
*/
|
||||
NOT_MODIFIED_304: 304,
|
||||
|
||||
/**
|
||||
* SINCE HTTP/1.1
|
||||
* In this case, the request should be repeated with another URI; however, future requests should still use the original URI.
|
||||
* In contrast to how 302 was historically implemented, the request method is not allowed to be changed when reissuing the
|
||||
* original request.
|
||||
* For example, a POST request should be repeated using another POST request.
|
||||
*/
|
||||
TEMPORARY_REDIRECT_307: 307,
|
||||
|
||||
/**
|
||||
* The request and all future requests should be repeated using another URI.
|
||||
* 307 and 308 parallel the behaviors of 302 and 301, but do not allow the HTTP method to change.
|
||||
* So, for example, submitting a form to a permanently redirected resource may continue smoothly.
|
||||
*/
|
||||
PERMANENT_REDIRECT_308: 308,
|
||||
|
||||
/**
|
||||
* The server cannot or will not process the request due to an apparent client error
|
||||
* (e.g., malformed request syntax, too large size, invalid request message framing, or deceptive request routing).
|
||||
*/
|
||||
BAD_REQUEST_400: 400,
|
||||
|
||||
/**
|
||||
* Official Documentation @ https://tools.ietf.org/html/rfc7235#section-3.1
|
||||
*
|
||||
* Similar to 403 Forbidden, but specifically for use when authentication is required and has failed or has not yet
|
||||
* been provided. The response must include a `WWW-Authenticate` header field containing a challenge applicable to the
|
||||
* requested resource. See Basic access authentication and Digest access authentication. 401 semantically means
|
||||
* "unauthenticated",i.e. the user does not have the necessary credentials.
|
||||
*/
|
||||
UNAUTHORIZED_401: 401,
|
||||
|
||||
/**
|
||||
* Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.2
|
||||
*
|
||||
* Reserved for future use. The original intention was that this code might be used as part of some form of digital
|
||||
* cash or micro payment scheme, but that has not happened, and this code is not usually used.
|
||||
* Google Developers API uses this status if a particular developer has exceeded the daily limit on requests.
|
||||
*/
|
||||
PAYMENT_REQUIRED_402: 402,
|
||||
|
||||
/**
|
||||
* Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.3
|
||||
*
|
||||
* The client does not have access rights to the content, i.e. they are unauthorized, so server is rejecting to
|
||||
* give proper response. Unlike 401, the client's identity is known to the server.
|
||||
*/
|
||||
FORBIDDEN_403: 403,
|
||||
|
||||
/**
|
||||
* Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.2
|
||||
*
|
||||
* The requested resource could not be found but may be available in the future.
|
||||
* Subsequent requests by the client are permissible.
|
||||
*/
|
||||
NOT_FOUND_404: 404,
|
||||
|
||||
/**
|
||||
* Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.5
|
||||
*
|
||||
* A request method is not supported for the requested resource;
|
||||
* for example, a GET request on a form that requires data to be presented via POST, or a PUT request on a read-only resource.
|
||||
*/
|
||||
METHOD_NOT_ALLOWED_405: 405,
|
||||
|
||||
/**
|
||||
* The requested resource is capable of generating only content not acceptable according to the Accept headers sent in the request.
|
||||
*/
|
||||
NOT_ACCEPTABLE_406: 406,
|
||||
|
||||
/**
|
||||
* Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.7
|
||||
*
|
||||
* This response is sent on an idle connection by some servers, even without any previous request by the client.
|
||||
* It means that the server would like to shut down this unused connection. This response is used much more since
|
||||
* some browsers, like Chrome, Firefox 27+, or IE9, use HTTP pre-connection mechanisms to speed up surfing. Also
|
||||
* note that some servers merely shut down the connection without sending this message.
|
||||
*
|
||||
* @
|
||||
*/
|
||||
REQUEST_TIMEOUT_408: 408,
|
||||
|
||||
/**
|
||||
* Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.8
|
||||
*
|
||||
* Indicates that the request could not be processed because of conflict in the request,
|
||||
* such as an edit conflict between multiple simultaneous updates.
|
||||
*
|
||||
* @see HttpStatusCode.UNPROCESSABLE_ENTITY_422 to denote a disabled feature
|
||||
*/
|
||||
CONFLICT_409: 409,
|
||||
|
||||
/**
|
||||
* Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.9
|
||||
*
|
||||
* Indicates that the resource requested is no longer available and will not be available again.
|
||||
* This should be used when a resource has been intentionally removed and the resource should be purged.
|
||||
* Upon receiving a 410 status code, the client should not request the resource in the future.
|
||||
* Clients such as search engines should remove the resource from their indices.
|
||||
* Most use cases do not require clients and search engines to purge the resource, and a "404 Not Found" may be used instead.
|
||||
*/
|
||||
GONE_410: 410,
|
||||
|
||||
/**
|
||||
* The request did not specify the length of its content, which is required by the requested resource.
|
||||
*/
|
||||
LENGTH_REQUIRED_411: 411,
|
||||
|
||||
/**
|
||||
* The server does not meet one of the preconditions that the requester put on the request.
|
||||
*/
|
||||
PRECONDITION_FAILED_412: 412,
|
||||
|
||||
/**
|
||||
* Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.11
|
||||
*
|
||||
* The request is larger than the server is willing or able to process ; the server might close the connection
|
||||
* or return an Retry-After header field.
|
||||
* Previously called "Request Entity Too Large".
|
||||
*/
|
||||
PAYLOAD_TOO_LARGE_413: 413,
|
||||
|
||||
/**
|
||||
* The URI provided was too long for the server to process. Often the result of too much data being encoded as a
|
||||
* query-string of a GET request, in which case it should be converted to a POST request.
|
||||
* Called "Request-URI Too Long" previously.
|
||||
*/
|
||||
URI_TOO_LONG_414: 414,
|
||||
|
||||
/**
|
||||
* Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.13
|
||||
*
|
||||
* The request entity has a media type which the server or resource does not support.
|
||||
* For example, the client uploads an image as image/svg+xml, but the server requires that images use a different format.
|
||||
*/
|
||||
UNSUPPORTED_MEDIA_TYPE_415: 415,
|
||||
|
||||
/**
|
||||
* The client has asked for a portion of the file (byte serving), but the server cannot supply that portion.
|
||||
* For example, if the client asked for a part of the file that lies beyond the end of the file.
|
||||
* Called "Requested Range Not Satisfiable" previously.
|
||||
*/
|
||||
RANGE_NOT_SATISFIABLE_416: 416,
|
||||
|
||||
/**
|
||||
* The server cannot meet the requirements of the `Expect` request-header field.
|
||||
*/
|
||||
EXPECTATION_FAILED_417: 417,
|
||||
|
||||
/**
|
||||
* Official Documentation @ https://tools.ietf.org/html/rfc2324
|
||||
*
|
||||
* This code was defined in 1998 as one of the traditional IETF April Fools' jokes, in RFC 2324, Hyper Text Coffee Pot Control Protocol,
|
||||
* and is not expected to be implemented by actual HTTP servers. The RFC specifies this code should be returned by
|
||||
* teapots requested to brew coffee. This HTTP status is used as an Easter egg in some websites, including PeerTube instances ;-).
|
||||
*/
|
||||
I_AM_A_TEAPOT_418: 418,
|
||||
|
||||
/**
|
||||
* Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.3
|
||||
*
|
||||
* The request was well-formed but was unable to be followed due to semantic errors.
|
||||
* The server understands the content type of the request entity (hence a 415 (Unsupported Media Type) status code is inappropriate),
|
||||
* and the syntax of the request entity is correct (thus a 400 (Bad Request) status code is inappropriate) but was unable to process
|
||||
* the contained instructions. For example, this error condition may occur if an JSON request body contains well-formed (i.e.,
|
||||
* syntactically correct), but semantically erroneous, JSON instructions.
|
||||
*
|
||||
* Can also be used to denote disabled features (akin to disabled syntax).
|
||||
*
|
||||
* @see HttpStatusCode.UNSUPPORTED_MEDIA_TYPE_415 if the `Content-Type` was not supported.
|
||||
* @see HttpStatusCode.BAD_REQUEST_400 if the request was not parsable (broken JSON, XML)
|
||||
*/
|
||||
UNPROCESSABLE_ENTITY_422: 422,
|
||||
|
||||
/**
|
||||
* Official Documentation @ https://tools.ietf.org/html/rfc4918#section-11.3
|
||||
*
|
||||
* The resource that is being accessed is locked. WebDAV-specific but used by some HTTP services.
|
||||
*
|
||||
* @deprecated use `If-Match` / `If-None-Match` instead
|
||||
* @see {@link https://evertpot.com/http/423-locked}
|
||||
*/
|
||||
LOCKED_423: 423,
|
||||
|
||||
/**
|
||||
* Official Documentation @ https://tools.ietf.org/html/rfc6585#section-4
|
||||
*
|
||||
* The user has sent too many requests in a given amount of time. Intended for use with rate-limiting schemes.
|
||||
*/
|
||||
TOO_MANY_REQUESTS_429: 429,
|
||||
|
||||
/**
|
||||
* Official Documentation @ https://tools.ietf.org/html/rfc6585#section-5
|
||||
*
|
||||
* The server is unwilling to process the request because either an individual header field,
|
||||
* or all the header fields collectively, are too large.
|
||||
*/
|
||||
REQUEST_HEADER_FIELDS_TOO_LARGE_431: 431,
|
||||
|
||||
/**
|
||||
* Official Documentation @ https://tools.ietf.org/html/rfc7725
|
||||
*
|
||||
* A server operator has received a legal demand to deny access to a resource or to a set of resources
|
||||
* that includes the requested resource. The code 451 was chosen as a reference to the novel Fahrenheit 451.
|
||||
*/
|
||||
UNAVAILABLE_FOR_LEGAL_REASONS_451: 451,
|
||||
|
||||
/**
|
||||
* A generic error message, given when an unexpected condition was encountered and no more specific message is suitable.
|
||||
*/
|
||||
INTERNAL_SERVER_ERROR_500: 500,
|
||||
|
||||
/**
|
||||
* Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.2
|
||||
*
|
||||
* The server either does not recognize the request method, or it lacks the ability to fulfill the request.
|
||||
* Usually this implies future availability (e.g., a new feature of a web-service API).
|
||||
*/
|
||||
NOT_IMPLEMENTED_501: 501,
|
||||
|
||||
/**
|
||||
* The server was acting as a gateway or proxy and received an invalid response from the upstream server.
|
||||
*/
|
||||
BAD_GATEWAY_502: 502,
|
||||
|
||||
/**
|
||||
* The server is currently unavailable (because it is overloaded or down for maintenance).
|
||||
* Generally, this is a temporary state.
|
||||
*/
|
||||
SERVICE_UNAVAILABLE_503: 503,
|
||||
|
||||
/**
|
||||
* The server was acting as a gateway or proxy and did not receive a timely response from the upstream server.
|
||||
*/
|
||||
GATEWAY_TIMEOUT_504: 504,
|
||||
|
||||
/**
|
||||
* The server does not support the HTTP protocol version used in the request
|
||||
*/
|
||||
HTTP_VERSION_NOT_SUPPORTED_505: 505,
|
||||
|
||||
/**
|
||||
* Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.6
|
||||
*
|
||||
* The 507 (Insufficient Storage) status code means the method could not be performed on the resource because the
|
||||
* server is unable to store the representation needed to successfully complete the request. This condition is
|
||||
* considered to be temporary. If the request which received this status code was the result of a user action,
|
||||
* the request MUST NOT be repeated until it is requested by a separate user action.
|
||||
*
|
||||
* @see HttpStatusCode.PAYLOAD_TOO_LARGE_413 for quota errors
|
||||
*/
|
||||
INSUFFICIENT_STORAGE_507: 507
|
||||
} as const
|
||||
|
||||
export type HttpStatusCodeType = typeof HttpStatusCode[keyof typeof HttpStatusCode]
|
||||
@@ -0,0 +1,2 @@
|
||||
export * from './http-status-codes.js'
|
||||
export * from './http-methods.js'
|
||||
@@ -0,0 +1,9 @@
|
||||
export * from './peertube-export-format/index.js'
|
||||
export * from './user-export-request-result.model.js'
|
||||
export * from './user-export-request.model.js'
|
||||
export * from './user-export-state.enum.js'
|
||||
export * from './user-export.model.js'
|
||||
export * from './user-import.model.js'
|
||||
export * from './user-import-state.enum.js'
|
||||
export * from './user-import-result.model.js'
|
||||
export * from './user-import-upload-result.model.js'
|
||||
@@ -0,0 +1,18 @@
|
||||
import { UserActorImageJSON } from './actor-export.model.js'
|
||||
|
||||
export interface AccountExportJSON {
|
||||
url: string
|
||||
|
||||
name: string
|
||||
displayName: string
|
||||
description: string
|
||||
|
||||
updatedAt: string
|
||||
createdAt: string
|
||||
|
||||
avatars: UserActorImageJSON[]
|
||||
|
||||
archiveFiles: {
|
||||
avatar: string | null
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
export interface UserActorImageJSON {
|
||||
width: number
|
||||
url: string
|
||||
createdAt: string
|
||||
updatedAt: string
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
export interface AutoTagPoliciesJSON {
|
||||
reviewComments: {
|
||||
name: string
|
||||
}[]
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
export interface BlocklistExportJSON {
|
||||
instances: {
|
||||
host: string
|
||||
}[]
|
||||
|
||||
actors: {
|
||||
handle: string
|
||||
}[]
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import { UserActorImageJSON } from './actor-export.model.js'
|
||||
|
||||
export interface ChannelExportJSON {
|
||||
channels: {
|
||||
url: string
|
||||
|
||||
name: string
|
||||
displayName: string
|
||||
description: string
|
||||
support: string
|
||||
|
||||
updatedAt: string
|
||||
createdAt: string
|
||||
|
||||
avatars: UserActorImageJSON[]
|
||||
banners: UserActorImageJSON[]
|
||||
|
||||
archiveFiles: {
|
||||
avatar: string | null
|
||||
banner: string | null
|
||||
}
|
||||
}[]
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
export interface CommentsExportJSON {
|
||||
comments: {
|
||||
url: string
|
||||
text: string
|
||||
createdAt: string
|
||||
videoUrl: string
|
||||
|
||||
inReplyToCommentUrl?: string
|
||||
|
||||
archiveFiles?: never
|
||||
}[]
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
export interface DislikesExportJSON {
|
||||
dislikes: {
|
||||
videoUrl: string
|
||||
createdAt: string
|
||||
|
||||
archiveFiles?: never
|
||||
}[]
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
export interface FollowersExportJSON {
|
||||
followers: {
|
||||
handle: string
|
||||
createdAt: string
|
||||
targetHandle: string
|
||||
|
||||
archiveFiles?: never
|
||||
}[]
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
export interface FollowingExportJSON {
|
||||
following: {
|
||||
handle: string
|
||||
targetHandle: string
|
||||
createdAt: string
|
||||
|
||||
archiveFiles?: never
|
||||
}[]
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
export * from './account-export.model.js'
|
||||
export * from './actor-export.model.js'
|
||||
export * from './auto-tag-policies-export.js'
|
||||
export * from './blocklist-export.model.js'
|
||||
export * from './channel-export.model.js'
|
||||
export * from './comments-export.model.js'
|
||||
export * from './dislikes-export.model.js'
|
||||
export * from './followers-export.model.js'
|
||||
export * from './following-export.model.js'
|
||||
export * from './likes-export.model.js'
|
||||
export * from './user-settings-export.model.js'
|
||||
export * from './user-video-history-export.js'
|
||||
export * from './video-export.model.js'
|
||||
export * from './video-playlists-export.model.js'
|
||||
export * from './watched-words-lists-export.js'
|
||||
@@ -0,0 +1,8 @@
|
||||
export interface LikesExportJSON {
|
||||
likes: {
|
||||
videoUrl: string
|
||||
createdAt: string
|
||||
|
||||
archiveFiles?: never
|
||||
}[]
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
import { UserNotificationSetting } from '../../users/user-notification-setting.model.js'
|
||||
import { NSFWPolicyType } from '../../videos/nsfw-policy.type.js'
|
||||
|
||||
export interface UserSettingsExportJSON {
|
||||
email: string
|
||||
|
||||
emailPublic: boolean
|
||||
nsfwPolicy: NSFWPolicyType
|
||||
|
||||
autoPlayVideo: boolean
|
||||
autoPlayNextVideo: boolean
|
||||
autoPlayNextVideoPlaylist: boolean
|
||||
|
||||
p2pEnabled: boolean
|
||||
|
||||
videosHistoryEnabled: boolean
|
||||
videoLanguages: string[]
|
||||
|
||||
theme: string
|
||||
|
||||
createdAt: Date
|
||||
|
||||
notificationSettings: UserNotificationSetting
|
||||
|
||||
archiveFiles?: never
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
export interface UserVideoHistoryExportJSON {
|
||||
watchedVideos: {
|
||||
videoUrl: string
|
||||
lastTimecode: number
|
||||
createdAt: string
|
||||
updatedAt: string
|
||||
|
||||
archiveFiles?: never
|
||||
}[]
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
import {
|
||||
LiveVideoLatencyModeType,
|
||||
VideoCommentPolicyType,
|
||||
VideoFileMetadata,
|
||||
VideoPrivacyType,
|
||||
VideoStateType,
|
||||
VideoStreamingPlaylistType_Type
|
||||
} from '../../videos/index.js'
|
||||
|
||||
export interface VideoExportJSON {
|
||||
videos: {
|
||||
uuid: string
|
||||
|
||||
createdAt: string
|
||||
updatedAt: string
|
||||
publishedAt: string
|
||||
originallyPublishedAt: string
|
||||
|
||||
name: string
|
||||
category: number
|
||||
licence: number
|
||||
language: string
|
||||
tags: string[]
|
||||
|
||||
privacy: VideoPrivacyType
|
||||
passwords: string[]
|
||||
|
||||
duration: number
|
||||
|
||||
description: string
|
||||
support: string
|
||||
|
||||
isLive: boolean
|
||||
live?: {
|
||||
saveReplay: boolean
|
||||
permanentLive: boolean
|
||||
latencyMode: LiveVideoLatencyModeType
|
||||
streamKey: string
|
||||
|
||||
replaySettings?: {
|
||||
privacy: VideoPrivacyType
|
||||
}
|
||||
}
|
||||
|
||||
url: string
|
||||
|
||||
thumbnailUrl: string
|
||||
previewUrl: string
|
||||
|
||||
views: number
|
||||
|
||||
likes: number
|
||||
dislikes: number
|
||||
|
||||
nsfw: boolean
|
||||
|
||||
// TODO: remove, deprecated in 6.2
|
||||
commentsEnabled?: boolean
|
||||
commentsPolicy: VideoCommentPolicyType
|
||||
|
||||
downloadEnabled: boolean
|
||||
|
||||
channel: {
|
||||
name: string
|
||||
}
|
||||
|
||||
waitTranscoding: boolean
|
||||
state: VideoStateType
|
||||
|
||||
captions: {
|
||||
createdAt: string
|
||||
updatedAt: string
|
||||
language: string
|
||||
filename: string
|
||||
fileUrl: string
|
||||
automaticallyGenerated: boolean
|
||||
}[]
|
||||
|
||||
chapters: {
|
||||
timecode: number
|
||||
title: string
|
||||
}[]
|
||||
|
||||
files: VideoFileExportJSON[]
|
||||
|
||||
streamingPlaylists: {
|
||||
type: VideoStreamingPlaylistType_Type
|
||||
playlistUrl: string
|
||||
segmentsSha256Url: string
|
||||
files: VideoFileExportJSON[]
|
||||
}[]
|
||||
|
||||
source?: {
|
||||
inputFilename: string
|
||||
|
||||
resolution: number
|
||||
size: number
|
||||
|
||||
width: number
|
||||
height: number
|
||||
|
||||
fps: number
|
||||
|
||||
metadata: VideoFileMetadata
|
||||
}
|
||||
|
||||
archiveFiles: {
|
||||
videoFile: string | null
|
||||
thumbnail: string | null
|
||||
captions: Record<string, string> // The key is the language code
|
||||
}
|
||||
}[]
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
export interface VideoFileExportJSON {
|
||||
resolution: number
|
||||
size: number // Bytes
|
||||
fps: number
|
||||
|
||||
torrentUrl: string
|
||||
fileUrl: string
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
import { VideoPlaylistPrivacyType } from '../../videos/playlist/video-playlist-privacy.model.js'
|
||||
import { VideoPlaylistType_Type } from '../../videos/playlist/video-playlist-type.model.js'
|
||||
|
||||
export interface VideoPlaylistsExportJSON {
|
||||
videoPlaylists: {
|
||||
displayName: string
|
||||
description: string
|
||||
privacy: VideoPlaylistPrivacyType
|
||||
url: string
|
||||
uuid: string
|
||||
|
||||
type: VideoPlaylistType_Type
|
||||
|
||||
channel: {
|
||||
name: string
|
||||
}
|
||||
|
||||
createdAt: string
|
||||
updatedAt: string
|
||||
|
||||
thumbnailUrl: string
|
||||
|
||||
elements: {
|
||||
videoUrl: string
|
||||
|
||||
startTimestamp?: number
|
||||
stopTimestamp?: number
|
||||
}[]
|
||||
|
||||
archiveFiles: {
|
||||
thumbnail: string | null
|
||||
}
|
||||
}[]
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
export interface WatchedWordsListsJSON {
|
||||
watchedWordLists: {
|
||||
createdAt: string
|
||||
updatedAt: string
|
||||
listName: string
|
||||
words: string[]
|
||||
|
||||
archiveFiles?: never
|
||||
}[]
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
export interface UserExportRequestResult {
|
||||
export: {
|
||||
id: number
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export interface UserExportRequest {
|
||||
withVideoFiles: boolean
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
export const UserExportState = {
|
||||
PENDING: 1,
|
||||
PROCESSING: 2,
|
||||
COMPLETED: 3,
|
||||
ERRORED: 4
|
||||
} as const
|
||||
|
||||
export type UserExportStateType = typeof UserExportState[keyof typeof UserExportState]
|
||||
@@ -0,0 +1,19 @@
|
||||
import { UserExportStateType } from './user-export-state.enum.js'
|
||||
|
||||
export interface UserExport {
|
||||
id: number
|
||||
|
||||
state: {
|
||||
id: UserExportStateType
|
||||
label: string
|
||||
}
|
||||
|
||||
// In bytes
|
||||
size: number
|
||||
|
||||
fileUrl: string
|
||||
privateDownloadUrl: string
|
||||
|
||||
createdAt: string | Date
|
||||
expiresOn: string | Date
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
type Summary = {
|
||||
success: number
|
||||
duplicates: number
|
||||
errors: number
|
||||
}
|
||||
|
||||
export interface UserImportResultSummary {
|
||||
stats: {
|
||||
blocklist: Summary
|
||||
channels: Summary
|
||||
likes: Summary
|
||||
dislikes: Summary
|
||||
following: Summary
|
||||
videoPlaylists: Summary
|
||||
videos: Summary
|
||||
|
||||
account: Summary
|
||||
userSettings: Summary
|
||||
|
||||
userVideoHistory: Summary
|
||||
|
||||
watchedWordsLists: Summary
|
||||
commentAutoTagPolicies: Summary
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
export const UserImportState = {
|
||||
PENDING: 1,
|
||||
PROCESSING: 2,
|
||||
COMPLETED: 3,
|
||||
ERRORED: 4
|
||||
} as const
|
||||
|
||||
export type UserImportStateType = typeof UserImportState[keyof typeof UserImportState]
|
||||
@@ -0,0 +1,5 @@
|
||||
export interface UserImportUploadResult {
|
||||
userImport: {
|
||||
id: number
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import { UserImportStateType } from './user-import-state.enum.js'
|
||||
|
||||
export interface UserImport {
|
||||
id: number
|
||||
state: {
|
||||
id: UserImportStateType
|
||||
label: string
|
||||
}
|
||||
createdAt: string
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
export * from './activitypub/index.js'
|
||||
export * from './actors/index.js'
|
||||
export * from './bulk/index.js'
|
||||
export * from './common/index.js'
|
||||
export * from './custom-markup/index.js'
|
||||
export * from './import-export/index.js'
|
||||
export * from './feeds/index.js'
|
||||
export * from './http/index.js'
|
||||
export * from './joinpeertube/index.js'
|
||||
export * from './metrics/index.js'
|
||||
export * from './moderation/index.js'
|
||||
export * from './nodeinfo/index.js'
|
||||
export * from './overviews/index.js'
|
||||
export * from './plugins/index.js'
|
||||
export * from './redundancy/index.js'
|
||||
export * from './runners/index.js'
|
||||
export * from './search/index.js'
|
||||
export * from './server/index.js'
|
||||
export * from './tokens/index.js'
|
||||
export * from './users/index.js'
|
||||
export * from './videos/index.js'
|
||||
@@ -0,0 +1 @@
|
||||
export * from './versions.model.js'
|
||||
@@ -0,0 +1,5 @@
|
||||
export interface JoinPeerTubeVersions {
|
||||
peertube: {
|
||||
latestVersion: string
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export * from './playback-metric-create.model.js'
|
||||
@@ -0,0 +1,22 @@
|
||||
import { VideoResolutionType } from '../videos/index.js'
|
||||
|
||||
export interface PlaybackMetricCreate {
|
||||
playerMode: 'p2p-media-loader' | 'webtorrent' | 'web-video' // FIXME: remove webtorrent player mode not used anymore in PeerTube v6
|
||||
|
||||
resolution?: VideoResolutionType
|
||||
fps?: number
|
||||
|
||||
p2pEnabled: boolean
|
||||
p2pPeers?: number
|
||||
|
||||
resolutionChanges: number
|
||||
|
||||
errors: number
|
||||
|
||||
downloadedBytesP2P: number
|
||||
downloadedBytesHTTP: number
|
||||
|
||||
uploadedBytesP2P: number
|
||||
|
||||
videoId: number | string
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import { AbusePredefinedReasonsString } from './abuse-reason.model.js'
|
||||
|
||||
export interface AbuseCreate {
|
||||
reason: string
|
||||
|
||||
predefinedReasons?: AbusePredefinedReasonsString[]
|
||||
|
||||
account?: {
|
||||
id: number
|
||||
}
|
||||
|
||||
video?: {
|
||||
id: number | string
|
||||
startAt?: number
|
||||
endAt?: number
|
||||
}
|
||||
|
||||
comment?: {
|
||||
id: number
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export type AbuseFilter = 'video' | 'comment' | 'account'
|
||||
@@ -0,0 +1,10 @@
|
||||
import { AccountSummary } from '../../actors/account.model.js'
|
||||
|
||||
export interface AbuseMessage {
|
||||
id: number
|
||||
message: string
|
||||
byModerator: boolean
|
||||
createdAt: Date | string
|
||||
|
||||
account: AccountSummary
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
export const AbusePredefinedReasons = {
|
||||
VIOLENT_OR_REPULSIVE: 1,
|
||||
HATEFUL_OR_ABUSIVE: 2,
|
||||
SPAM_OR_MISLEADING: 3,
|
||||
PRIVACY: 4,
|
||||
RIGHTS: 5,
|
||||
SERVER_RULES: 6,
|
||||
THUMBNAILS: 7,
|
||||
CAPTIONS: 8
|
||||
} as const
|
||||
|
||||
export type AbusePredefinedReasonsType = typeof AbusePredefinedReasons[keyof typeof AbusePredefinedReasons]
|
||||
|
||||
export type AbusePredefinedReasonsString =
|
||||
'violentOrRepulsive' |
|
||||
'hatefulOrAbusive' |
|
||||
'spamOrMisleading' |
|
||||
'privacy' |
|
||||
'rights' |
|
||||
'serverRules' |
|
||||
'thumbnails' |
|
||||
'captions'
|
||||
@@ -0,0 +1,7 @@
|
||||
export const AbuseState = {
|
||||
PENDING: 1,
|
||||
REJECTED: 2,
|
||||
ACCEPTED: 3
|
||||
} as const
|
||||
|
||||
export type AbuseStateType = typeof AbuseState[keyof typeof AbuseState]
|
||||
@@ -0,0 +1,7 @@
|
||||
import { AbuseStateType } from './abuse-state.model.js'
|
||||
|
||||
export interface AbuseUpdate {
|
||||
moderationComment?: string
|
||||
|
||||
state?: AbuseStateType
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export type AbuseVideoIs = 'deleted' | 'blacklisted'
|
||||
@@ -0,0 +1,70 @@
|
||||
import { Account } from '../../actors/account.model.js'
|
||||
import { AbuseStateType } from './abuse-state.model.js'
|
||||
import { AbusePredefinedReasonsString } from './abuse-reason.model.js'
|
||||
import { VideoConstant } from '../../videos/video-constant.model.js'
|
||||
import { VideoChannel } from '../../videos/channel/video-channel.model.js'
|
||||
|
||||
export interface AdminVideoAbuse {
|
||||
id: number
|
||||
name: string
|
||||
uuid: string
|
||||
nsfw: boolean
|
||||
|
||||
deleted: boolean
|
||||
blacklisted: boolean
|
||||
|
||||
startAt: number | null
|
||||
endAt: number | null
|
||||
|
||||
thumbnailPath?: string
|
||||
channel?: VideoChannel
|
||||
|
||||
countReports: number
|
||||
nthReport: number
|
||||
}
|
||||
|
||||
export interface AdminVideoCommentAbuse {
|
||||
id: number
|
||||
threadId: number
|
||||
|
||||
video: {
|
||||
id: number
|
||||
name: string
|
||||
uuid: string
|
||||
}
|
||||
|
||||
text: string
|
||||
|
||||
deleted: boolean
|
||||
}
|
||||
|
||||
export interface AdminAbuse {
|
||||
id: number
|
||||
|
||||
reason: string
|
||||
predefinedReasons?: AbusePredefinedReasonsString[]
|
||||
|
||||
reporterAccount: Account
|
||||
flaggedAccount: Account
|
||||
|
||||
state: VideoConstant<AbuseStateType>
|
||||
moderationComment?: string
|
||||
|
||||
video?: AdminVideoAbuse
|
||||
comment?: AdminVideoCommentAbuse
|
||||
|
||||
createdAt: Date
|
||||
updatedAt: Date
|
||||
|
||||
countReportsForReporter?: number
|
||||
countReportsForReportee?: number
|
||||
|
||||
countMessages: number
|
||||
}
|
||||
|
||||
export type UserVideoAbuse = Omit<AdminVideoAbuse, 'countReports' | 'nthReport'>
|
||||
|
||||
export type UserVideoCommentAbuse = AdminVideoCommentAbuse
|
||||
|
||||
export type UserAbuse = Omit<AdminAbuse, 'reporterAccount' | 'countReportsForReportee' | 'countReportsForReporter' | 'startAt' | 'endAt'
|
||||
| 'count' | 'nth' | 'moderationComment'>
|
||||
@@ -0,0 +1,8 @@
|
||||
export * from './abuse-create.model.js'
|
||||
export * from './abuse-filter.type.js'
|
||||
export * from './abuse-message.model.js'
|
||||
export * from './abuse-reason.model.js'
|
||||
export * from './abuse-state.model.js'
|
||||
export * from './abuse-update.model.js'
|
||||
export * from './abuse-video-is.type.js'
|
||||
export * from './abuse.model.js'
|
||||
@@ -0,0 +1,7 @@
|
||||
import { Account } from '../actors/index.js'
|
||||
|
||||
export interface AccountBlock {
|
||||
byAccount: Account
|
||||
blockedAccount: Account
|
||||
createdAt: Date | string
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
export type AutomaticTagAvailableType = 'core' | 'watched-words-list'
|
||||
|
||||
export interface AutomaticTagAvailable {
|
||||
available: {
|
||||
name: string
|
||||
type: AutomaticTagAvailableType
|
||||
}[]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
export const AutomaticTagPolicy = {
|
||||
NONE: 1,
|
||||
REVIEW_COMMENT: 2
|
||||
} as const
|
||||
|
||||
export type AutomaticTagPolicyType = typeof AutomaticTagPolicy[keyof typeof AutomaticTagPolicy]
|
||||
@@ -0,0 +1,15 @@
|
||||
export interface BlockStatus {
|
||||
accounts: {
|
||||
[ handle: string ]: {
|
||||
blockedByServer: boolean
|
||||
blockedByUser?: boolean
|
||||
}
|
||||
}
|
||||
|
||||
hosts: {
|
||||
[ host: string ]: {
|
||||
blockedByServer: boolean
|
||||
blockedByUser?: boolean
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export interface CommentAutomaticTagPoliciesUpdate {
|
||||
review: string[]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export interface CommentAutomaticTagPolicies {
|
||||
review: string[]
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
export * from './abuse/index.js'
|
||||
export * from './automatic-tag-available.model.js'
|
||||
export * from './account-block.model.js'
|
||||
export * from './comment-automatic-tag-policies-update.model.js'
|
||||
export * from './comment-automatic-tag-policies.model.js'
|
||||
export * from './automatic-tag-policy.enum.js'
|
||||
export * from './block-status.model.js'
|
||||
export * from './server-block.model.js'
|
||||
export * from './watched-words-list.model.js'
|
||||
@@ -0,0 +1,9 @@
|
||||
import { Account } from '../actors/index.js'
|
||||
|
||||
export interface ServerBlock {
|
||||
byAccount: Account
|
||||
blockedServer: {
|
||||
host: string
|
||||
}
|
||||
createdAt: Date | string
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
export interface WatchedWordsList {
|
||||
id: number
|
||||
|
||||
listName: string
|
||||
words: string[]
|
||||
|
||||
updatedAt: Date | string
|
||||
createdAt: Date | string
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export * from './nodeinfo.model.js'
|
||||
@@ -0,0 +1,117 @@
|
||||
/**
|
||||
* NodeInfo schema version 2.0.
|
||||
*/
|
||||
export interface HttpNodeinfoDiasporaSoftwareNsSchema20 {
|
||||
/**
|
||||
* The schema version, must be 2.0.
|
||||
*/
|
||||
version: '2.0'
|
||||
/**
|
||||
* Metadata about server software in use.
|
||||
*/
|
||||
software: {
|
||||
/**
|
||||
* The canonical name of this server software.
|
||||
*/
|
||||
name: string
|
||||
/**
|
||||
* The version of this server software.
|
||||
*/
|
||||
version: string
|
||||
}
|
||||
/**
|
||||
* The protocols supported on this server.
|
||||
*/
|
||||
protocols: (
|
||||
| 'activitypub'
|
||||
| 'buddycloud'
|
||||
| 'dfrn'
|
||||
| 'diaspora'
|
||||
| 'libertree'
|
||||
| 'ostatus'
|
||||
| 'pumpio'
|
||||
| 'tent'
|
||||
| 'xmpp'
|
||||
| 'zot')[]
|
||||
/**
|
||||
* The third party sites this server can connect to via their application API.
|
||||
*/
|
||||
services: {
|
||||
/**
|
||||
* The third party sites this server can retrieve messages from for combined display with regular traffic.
|
||||
*/
|
||||
inbound: ('atom1.0' | 'gnusocial' | 'imap' | 'pnut' | 'pop3' | 'pumpio' | 'rss2.0' | 'twitter')[]
|
||||
/**
|
||||
* The third party sites this server can publish messages to on the behalf of a user.
|
||||
*/
|
||||
outbound: (
|
||||
| 'atom1.0'
|
||||
| 'blogger'
|
||||
| 'buddycloud'
|
||||
| 'diaspora'
|
||||
| 'dreamwidth'
|
||||
| 'drupal'
|
||||
| 'facebook'
|
||||
| 'friendica'
|
||||
| 'gnusocial'
|
||||
| 'google'
|
||||
| 'insanejournal'
|
||||
| 'libertree'
|
||||
| 'linkedin'
|
||||
| 'livejournal'
|
||||
| 'mediagoblin'
|
||||
| 'myspace'
|
||||
| 'pinterest'
|
||||
| 'pnut'
|
||||
| 'posterous'
|
||||
| 'pumpio'
|
||||
| 'redmatrix'
|
||||
| 'rss2.0'
|
||||
| 'smtp'
|
||||
| 'tent'
|
||||
| 'tumblr'
|
||||
| 'twitter'
|
||||
| 'wordpress'
|
||||
| 'xmpp')[]
|
||||
}
|
||||
/**
|
||||
* Whether this server allows open self-registration.
|
||||
*/
|
||||
openRegistrations: boolean
|
||||
/**
|
||||
* Usage statistics for this server.
|
||||
*/
|
||||
usage: {
|
||||
/**
|
||||
* statistics about the users of this server.
|
||||
*/
|
||||
users: {
|
||||
/**
|
||||
* The total amount of on this server registered users.
|
||||
*/
|
||||
total?: number
|
||||
/**
|
||||
* The amount of users that signed in at least once in the last 180 days.
|
||||
*/
|
||||
activeHalfyear?: number
|
||||
/**
|
||||
* The amount of users that signed in at least once in the last 30 days.
|
||||
*/
|
||||
activeMonth?: number
|
||||
}
|
||||
/**
|
||||
* The amount of posts that were made by users that are registered on this server.
|
||||
*/
|
||||
localPosts?: number
|
||||
/**
|
||||
* The amount of comments that were made by users that are registered on this server.
|
||||
*/
|
||||
localComments?: number
|
||||
}
|
||||
/**
|
||||
* Free form key value pairs for software specific values. Clients should not rely on any specific key present.
|
||||
*/
|
||||
metadata: {
|
||||
[k: string]: any
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export * from './videos-overview.model.js'
|
||||
@@ -0,0 +1,24 @@
|
||||
import { Video, VideoChannelSummary, VideoConstant } from '../videos/index.js'
|
||||
|
||||
export interface ChannelOverview {
|
||||
channel: VideoChannelSummary
|
||||
videos: Video[]
|
||||
}
|
||||
|
||||
export interface CategoryOverview {
|
||||
category: VideoConstant<number>
|
||||
videos: Video[]
|
||||
}
|
||||
|
||||
export interface TagOverview {
|
||||
tag: string
|
||||
videos: Video[]
|
||||
}
|
||||
|
||||
export interface VideosOverview {
|
||||
channels: ChannelOverview[]
|
||||
|
||||
categories: CategoryOverview[]
|
||||
|
||||
tags: TagOverview[]
|
||||
}
|
||||
@@ -0,0 +1,195 @@
|
||||
// Data from API hooks: {hookType}:api.{location}.{elementType}.{actionType}.{target}
|
||||
// Data in internal functions: {hookType}:{location}.{elementType}.{actionType}.{target}
|
||||
|
||||
export const clientFilterHookObject = {
|
||||
// Filter params/result of the function that fetch videos of the trending page
|
||||
'filter:api.trending-videos.videos.list.params': true,
|
||||
'filter:api.trending-videos.videos.list.result': true,
|
||||
|
||||
// Filter params/result of the function that fetch videos of the trending page
|
||||
'filter:api.most-liked-videos.videos.list.params': true,
|
||||
'filter:api.most-liked-videos.videos.list.result': true,
|
||||
|
||||
// Filter params/result of the function that fetch videos of the local page
|
||||
'filter:api.local-videos.videos.list.params': true,
|
||||
'filter:api.local-videos.videos.list.result': true,
|
||||
|
||||
// Filter params/result of the function that fetch videos of the recently-added page
|
||||
'filter:api.recently-added-videos.videos.list.params': true,
|
||||
'filter:api.recently-added-videos.videos.list.result': true,
|
||||
|
||||
// Filter params/result of the function that fetch videos of the user subscription page
|
||||
'filter:api.user-subscriptions-videos.videos.list.params': true,
|
||||
'filter:api.user-subscriptions-videos.videos.list.result': true,
|
||||
|
||||
// Filter params/result of the function that fetch the video of the video-watch page
|
||||
'filter:api.video-watch.video.get.params': true,
|
||||
'filter:api.video-watch.video.get.result': true,
|
||||
|
||||
// Filter params/result of the function that fetch video playlist elements of the video-watch page
|
||||
'filter:api.video-watch.video-playlist-elements.get.params': true,
|
||||
'filter:api.video-watch.video-playlist-elements.get.result': true,
|
||||
|
||||
// Filter params/result of the function that fetch the threads of the video-watch page
|
||||
'filter:api.video-watch.video-threads.list.params': true,
|
||||
'filter:api.video-watch.video-threads.list.result': true,
|
||||
|
||||
// Filter params/result of the function that fetch the replies of a thread in the video-watch page
|
||||
'filter:api.video-watch.video-thread-replies.list.params': true,
|
||||
'filter:api.video-watch.video-thread-replies.list.result': true,
|
||||
|
||||
// Filter params/result of the function that fetch videos according to the user search
|
||||
'filter:api.search.videos.list.params': true,
|
||||
'filter:api.search.videos.list.result': true,
|
||||
// Filter params/result of the function that fetch video channels according to the user search
|
||||
'filter:api.search.video-channels.list.params': true,
|
||||
'filter:api.search.video-channels.list.result': true,
|
||||
// Filter params/result of the function that fetch video playlists according to the user search
|
||||
'filter:api.search.video-playlists.list.params': true,
|
||||
'filter:api.search.video-playlists.list.result': true,
|
||||
|
||||
// Filter form
|
||||
'filter:api.signup.registration.create.params': true,
|
||||
|
||||
// Filter params/result of the function that fetch video playlist elements of the my-library page
|
||||
'filter:api.my-library.video-playlist-elements.list.params': true,
|
||||
'filter:api.my-library.video-playlist-elements.list.result': true,
|
||||
|
||||
// Filter the options to create our player
|
||||
'filter:internal.video-watch.player.build-options.params': true,
|
||||
'filter:internal.video-watch.player.build-options.result': true,
|
||||
|
||||
// Filter the options to load a new video in our player
|
||||
'filter:internal.video-watch.player.load-options.params': true,
|
||||
'filter:internal.video-watch.player.load-options.result': true,
|
||||
|
||||
// Filter our SVG icons content
|
||||
'filter:internal.common.svg-icons.get-content.params': true,
|
||||
'filter:internal.common.svg-icons.get-content.result': true,
|
||||
|
||||
// Filter left menu links
|
||||
'filter:left-menu.links.create.result': true,
|
||||
|
||||
// Filter upload page alert messages
|
||||
'filter:upload.messages.create.result': true,
|
||||
|
||||
'filter:login.instance-about-plugin-panels.create.result': true,
|
||||
'filter:signup.instance-about-plugin-panels.create.result': true,
|
||||
|
||||
'filter:share.video-embed-code.build.params': true,
|
||||
'filter:share.video-embed-code.build.result': true,
|
||||
'filter:share.video-playlist-embed-code.build.params': true,
|
||||
'filter:share.video-playlist-embed-code.build.result': true,
|
||||
|
||||
'filter:share.video-embed-url.build.params': true,
|
||||
'filter:share.video-embed-url.build.result': true,
|
||||
'filter:share.video-playlist-embed-url.build.params': true,
|
||||
'filter:share.video-playlist-embed-url.build.result': true,
|
||||
|
||||
'filter:share.video-url.build.params': true,
|
||||
'filter:share.video-url.build.result': true,
|
||||
'filter:share.video-playlist-url.build.params': true,
|
||||
'filter:share.video-playlist-url.build.result': true,
|
||||
|
||||
'filter:video-watch.video-plugin-metadata.result': true,
|
||||
|
||||
// Filter videojs options built for PeerTube player
|
||||
'filter:internal.player.videojs.options.result': true,
|
||||
|
||||
// Filter p2p media loader options built for PeerTube player
|
||||
'filter:internal.player.p2p-media-loader.options.result': true
|
||||
}
|
||||
|
||||
export type ClientFilterHookName = keyof typeof clientFilterHookObject
|
||||
|
||||
export const clientActionHookObject = {
|
||||
// Fired when the application is being initialized
|
||||
'action:application.init': true,
|
||||
|
||||
// Fired when the video watch page is being initialized
|
||||
'action:video-watch.init': true,
|
||||
// Fired when the video watch page loaded the video
|
||||
'action:video-watch.video.loaded': true,
|
||||
// Fired when the player finished loading
|
||||
'action:video-watch.player.loaded': true,
|
||||
// Fired when the video watch page comments(threads) are loaded and load more comments on scroll
|
||||
'action:video-watch.video-threads.loaded': true,
|
||||
// Fired when a user click on 'View x replies' and they're loaded
|
||||
'action:video-watch.video-thread-replies.loaded': true,
|
||||
|
||||
// Fired when the video channel creation page is being initialized
|
||||
'action:video-channel-create.init': true,
|
||||
|
||||
// Fired when the video channel update page is being initialized
|
||||
'action:video-channel-update.init': true,
|
||||
'action:video-channel-update.video-channel.loaded': true,
|
||||
|
||||
// Fired when the page that list video channel videos is being initialized
|
||||
'action:video-channel-videos.init': true,
|
||||
'action:video-channel-videos.video-channel.loaded': true,
|
||||
'action:video-channel-videos.videos.loaded': true,
|
||||
|
||||
// Fired when the page that list video channel playlists is being initialized
|
||||
'action:video-channel-playlists.init': true,
|
||||
'action:video-channel-playlists.video-channel.loaded': true,
|
||||
'action:video-channel-playlists.playlists.loaded': true,
|
||||
|
||||
// Fired when the video edit page (upload, URL/torrent import, update) is being initialized
|
||||
// Contains a `type` and `updateForm` object attributes
|
||||
'action:video-edit.init': true,
|
||||
|
||||
// Fired when values of the video edit form changed
|
||||
'action:video-edit.form.updated': true,
|
||||
|
||||
// Fired when the login page is being initialized
|
||||
'action:login.init': true,
|
||||
|
||||
// Fired when the search page is being initialized
|
||||
'action:search.init': true,
|
||||
|
||||
// Fired every time Angular URL changes
|
||||
'action:router.navigation-end': true,
|
||||
|
||||
// Fired when the registration page is being initialized
|
||||
'action:signup.register.init': true,
|
||||
|
||||
// PeerTube >= 3.2
|
||||
// Fired when the admin plugin settings page is being initialized
|
||||
'action:admin-plugin-settings.init': true,
|
||||
|
||||
// Fired when the video upload page is being initialized
|
||||
'action:video-upload.init': true,
|
||||
// Fired when the video import by URL page is being initialized
|
||||
'action:video-url-import.init': true,
|
||||
// Fired when the video import by torrent/magnet URI page is being initialized
|
||||
'action:video-torrent-import.init': true,
|
||||
// Fired when the "Go Live" page is being initialized
|
||||
'action:go-live.init': true,
|
||||
|
||||
// Fired when the user explicitly logged in/logged out
|
||||
'action:auth-user.logged-in': true,
|
||||
'action:auth-user.logged-out': true,
|
||||
// Fired when the application loaded user information (using tokens from the local storage or after a successful login)
|
||||
'action:auth-user.information-loaded': true,
|
||||
|
||||
// Fired when the modal to download a video/caption is shown
|
||||
'action:modal.video-download.shown': true,
|
||||
// Fired when the modal to share a video/playlist is shown
|
||||
'action:modal.share.shown': true,
|
||||
|
||||
// ####### Embed hooks #######
|
||||
// /!\ In embed scope, peertube helpers are not available
|
||||
// ###########################
|
||||
|
||||
// Fired when the embed loaded the player
|
||||
'action:embed.player.loaded': true
|
||||
}
|
||||
|
||||
export type ClientActionHookName = keyof typeof clientActionHookObject
|
||||
|
||||
export const clientHookObject = Object.assign({}, clientFilterHookObject, clientActionHookObject)
|
||||
export type ClientHookName = keyof typeof clientHookObject
|
||||
|
||||
export interface ClientHook {
|
||||
runHook <T> (hookName: ClientHookName, result?: T, params?: any): Promise<T>
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
export * from './client-hook.model.js'
|
||||
export * from './plugin-client-scope.type.js'
|
||||
export * from './plugin-element-placeholder.type.js'
|
||||
export * from './plugin-selector-id.type.js'
|
||||
export * from './register-client-form-field.model.js'
|
||||
export * from './register-client-hook.model.js'
|
||||
export * from './register-client-route.model.js'
|
||||
export * from './register-client-settings-script.model.js'
|
||||
@@ -0,0 +1,12 @@
|
||||
export type PluginClientScope =
|
||||
'common' |
|
||||
'video-watch' |
|
||||
'search' |
|
||||
'signup' |
|
||||
'login' |
|
||||
'embed' |
|
||||
'video-edit' |
|
||||
'admin-plugin' |
|
||||
'my-library' |
|
||||
'video-channel' |
|
||||
'my-account'
|
||||
@@ -0,0 +1,4 @@
|
||||
export type PluginElementPlaceholder =
|
||||
'player-next' |
|
||||
'share-modal-playlist-settings' |
|
||||
'share-modal-video-settings'
|
||||
@@ -0,0 +1,10 @@
|
||||
export type PluginSelectorId =
|
||||
'login-form' |
|
||||
'menu-user-dropdown-language-item' |
|
||||
'about-instance-features' |
|
||||
'about-instance-statistics' |
|
||||
'about-instance-moderation' |
|
||||
'about-menu-instance' |
|
||||
'about-menu-peertube' |
|
||||
'about-menu-network' |
|
||||
'about-instance-other-information'
|
||||
@@ -0,0 +1,30 @@
|
||||
export type RegisterClientFormFieldOptions = {
|
||||
name?: string
|
||||
label?: string
|
||||
type: 'input' | 'input-checkbox' | 'input-password' | 'input-textarea' | 'markdown-text' | 'markdown-enhanced' | 'select' | 'html'
|
||||
|
||||
// For select type
|
||||
options?: { value: string, label: string }[]
|
||||
|
||||
// For html type
|
||||
html?: string
|
||||
|
||||
descriptionHTML?: string
|
||||
|
||||
// Default setting value
|
||||
default?: string | boolean
|
||||
|
||||
// Not supported by plugin setting registration, use registerSettingsScript instead
|
||||
hidden?: (options: any) => boolean
|
||||
|
||||
// Return undefined | null if there is no error or return a string with the detailed error
|
||||
// Not supported by plugin setting registration
|
||||
error?: (options: any) => Promise<{ error: boolean, text?: string }>
|
||||
}
|
||||
|
||||
export interface RegisterClientVideoFieldOptions {
|
||||
type: 'update' | 'upload' | 'import-url' | 'import-torrent' | 'go-live'
|
||||
|
||||
// Default to 'plugin-settings'
|
||||
tab?: 'main' | 'plugin-settings'
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import { ClientHookName } from './client-hook.model.js'
|
||||
|
||||
export interface RegisterClientHookOptions {
|
||||
target: ClientHookName
|
||||
handler: Function
|
||||
priority?: number
|
||||
}
|
||||
変更されたファイルが多すぎるため,一部のファイルは表示されません さらに表示
新しい課題から参照
ユーザをブロックする