ActivityPub-federated video streaming platform using P2P directly in your web browser
Move typescript utils in its own directory
Chocobozzz6b5f72beda96
diff --git a/server/controllers/api/users/me.ts b/server/controllers/api/users/me.tsindex 1125771d44..127b7ca5da 100644--- a/server/controllers/api/users/me.ts+++ b/server/controllers/api/users/me.ts@@ -2,7 +2,7 @@ import 'multer'import express from 'express'import { auditLoggerFactory, getAuditIdFromRes, UserAuditView } from '@server/helpers/audit-logger'import { Hooks } from '@server/lib/plugins/hooks'-import { AttributesOnly } from '@shared/core-utils'+import { AttributesOnly } from '@shared/typescript-utils'import { ActorImageType, UserUpdateMe, UserVideoRate as FormattedUserVideoRate } from '../../../../shared'import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes'import { UserVideoQuota } from '../../../../shared/models/users/user-video-quota.model'diff --git a/server/lib/activitypub/playlists/create-update.ts b/server/lib/activitypub/playlists/create-update.tsindex b152d709c3..ef572c8034 100644--- a/server/lib/activitypub/playlists/create-update.ts+++ b/server/lib/activitypub/playlists/create-update.ts@@ -9,7 +9,7 @@ import { VideoPlaylistModel } from '@server/models/video/video-playlist'import { VideoPlaylistElementModel } from '@server/models/video/video-playlist-element'import { FilteredModelAttributes } from '@server/types'import { MThumbnail, MVideoPlaylist, MVideoPlaylistFull, MVideoPlaylistVideosLength } from '@server/types/models'-import { AttributesOnly } from '@shared/core-utils'+import { AttributesOnly } from '@shared/typescript-utils'import { PlaylistObject } from '@shared/models'import { getOrCreateAPActor } from '../actors'import { crawlCollectionPage } from '../crawl'diff --git a/server/lib/activitypub/playlists/shared/object-to-model-attributes.ts b/server/lib/activitypub/playlists/shared/object-to-model-attributes.tsindex 70fd335bcc..753b5e6603 100644--- a/server/lib/activitypub/playlists/shared/object-to-model-attributes.ts+++ b/server/lib/activitypub/playlists/shared/object-to-model-attributes.ts@@ -2,7 +2,7 @@ import { ACTIVITY_PUB } from '@server/initializers/constants'import { VideoPlaylistModel } from '@server/models/video/video-playlist'import { VideoPlaylistElementModel } from '@server/models/video/video-playlist-element'import { MVideoId, MVideoPlaylistId } from '@server/types/models'-import { AttributesOnly } from '@shared/core-utils'+import { AttributesOnly } from '@shared/typescript-utils'import { PlaylistElementObject, PlaylistObject, VideoPlaylistPrivacy } from '@shared/models'function playlistObjectToDBAttributes (playlistObject: PlaylistObject, to: string[]) {diff --git a/server/models/abuse/abuse-message.ts b/server/models/abuse/abuse-message.tsindex 2c5987e96c..6a441a2103 100644--- a/server/models/abuse/abuse-message.ts+++ b/server/models/abuse/abuse-message.ts@@ -1,7 +1,7 @@import { AllowNull, BelongsTo, Column, CreatedAt, DataType, ForeignKey, Is, Model, Table, UpdatedAt } from 'sequelize-typescript'import { isAbuseMessageValid } from '@server/helpers/custom-validators/abuses'import { MAbuseMessage, MAbuseMessageFormattable } from '@server/types/models'-import { AttributesOnly } from '@shared/core-utils'+import { AttributesOnly } from '@shared/typescript-utils'import { AbuseMessage } from '@shared/models'import { AccountModel, ScopeNames as AccountScopeNames } from '../account/account'import { getSort, throwIfNotValid } from '../utils'diff --git a/server/models/abuse/abuse.ts b/server/models/abuse/abuse.tsindex 3518f5c029..4344df006e 100644--- a/server/models/abuse/abuse.ts+++ b/server/models/abuse/abuse.ts@@ -16,7 +16,7 @@ import {UpdatedAt} from 'sequelize-typescript'import { isAbuseModerationCommentValid, isAbuseReasonValid, isAbuseStateValid } from '@server/helpers/custom-validators/abuses'-import { abusePredefinedReasonsMap, AttributesOnly } from '@shared/core-utils'+import { abusePredefinedReasonsMap } from '@shared/core-utils'import {AbuseFilter,AbuseObject,@@ -30,6 +30,7 @@ import {UserAbuse,UserVideoAbuse} from '@shared/models'+import { AttributesOnly } from '@shared/typescript-utils'import { ABUSE_STATES, CONSTRAINTS_FIELDS } from '../../initializers/constants'import { MAbuseAdminFormattable, MAbuseAP, MAbuseFull, MAbuseReporter, MAbuseUserFormattable, MUserAccountId } from '../../types/models'import { AccountModel, ScopeNames as AccountScopeNames, SummaryOptions as AccountSummaryOptions } from '../account/account'diff --git a/server/models/abuse/video-abuse.ts b/server/models/abuse/video-abuse.tsindex 95bff50d09..773a9ebbab 100644--- a/server/models/abuse/video-abuse.ts+++ b/server/models/abuse/video-abuse.ts@@ -1,5 +1,5 @@import { AllowNull, BelongsTo, Column, CreatedAt, DataType, Default, ForeignKey, Model, Table, UpdatedAt } from 'sequelize-typescript'-import { AttributesOnly } from '@shared/core-utils'+import { AttributesOnly } from '@shared/typescript-utils'import { VideoDetails } from '@shared/models'import { VideoModel } from '../video/video'import { AbuseModel } from './abuse'diff --git a/server/models/abuse/video-comment-abuse.ts b/server/models/abuse/video-comment-abuse.tsindex 32cb2ca649..337aaaa58e 100644--- a/server/models/abuse/video-comment-abuse.ts+++ b/server/models/abuse/video-comment-abuse.ts@@ -1,5 +1,5 @@import { BelongsTo, Column, CreatedAt, ForeignKey, Model, Table, UpdatedAt } from 'sequelize-typescript'-import { AttributesOnly } from '@shared/core-utils'+import { AttributesOnly } from '@shared/typescript-utils'import { VideoCommentModel } from '../video/video-comment'import { AbuseModel } from './abuse'diff --git a/server/models/account/account-blocklist.ts b/server/models/account/account-blocklist.tsindex 21983428a7..1162962bfd 100644--- a/server/models/account/account-blocklist.ts+++ b/server/models/account/account-blocklist.ts@@ -2,7 +2,7 @@ import { Op, QueryTypes } from 'sequelize'import { BelongsTo, Column, CreatedAt, ForeignKey, Model, Scopes, Table, UpdatedAt } from 'sequelize-typescript'import { handlesToNameAndHost } from '@server/helpers/actors'import { MAccountBlocklist, MAccountBlocklistAccounts, MAccountBlocklistFormattable } from '@server/types/models'-import { AttributesOnly } from '@shared/core-utils'+import { AttributesOnly } from '@shared/typescript-utils'import { AccountBlock } from '../../../shared/models'import { ActorModel } from '../actor/actor'import { ServerModel } from '../server/server'diff --git a/server/models/account/account-video-rate.ts b/server/models/account/account-video-rate.tsindex ee6dbc6da0..2185619520 100644--- a/server/models/account/account-video-rate.ts+++ b/server/models/account/account-video-rate.ts@@ -7,7 +7,7 @@ import {MAccountVideoRateAccountVideo,MAccountVideoRateFormattable} from '@server/types/models/video/video-rate'-import { AttributesOnly } from '@shared/core-utils'+import { AttributesOnly } from '@shared/typescript-utils'import { AccountVideoRate } from '../../../shared'import { VideoRateType } from '../../../shared/models/videos'import { isActivityPubUrlValid } from '../../helpers/custom-validators/activitypub/misc'diff --git a/server/models/account/account.ts b/server/models/account/account.tsindex 71a9b8ccbc..619a598ddf 100644--- a/server/models/account/account.ts+++ b/server/models/account/account.ts@@ -17,7 +17,7 @@ import {UpdatedAt} from 'sequelize-typescript'import { ModelCache } from '@server/models/model-cache'-import { AttributesOnly } from '@shared/core-utils'+import { AttributesOnly } from '@shared/typescript-utils'import { Account, AccountSummary } from '../../../shared/models/actors'import { isAccountDescriptionValid } from '../../helpers/custom-validators/accounts'import { CONSTRAINTS_FIELDS, SERVER_ACTOR_NAME, WEBSERVER } from '../../initializers/constants'diff --git a/server/models/actor/actor-follow.ts b/server/models/actor/actor-follow.tsindex d6a2387a56..006282530b 100644--- a/server/models/actor/actor-follow.ts+++ b/server/models/actor/actor-follow.ts@@ -30,7 +30,7 @@ import {MActorFollowFormattable,MActorFollowSubscriptions} from '@server/types/models'-import { AttributesOnly } from '@shared/core-utils'+import { AttributesOnly } from '@shared/typescript-utils'import { ActivityPubActorType } from '@shared/models'import { FollowState } from '../../../shared/models/actors'import { ActorFollow } from '../../../shared/models/actors/follow.model'diff --git a/server/models/actor/actor-image.ts b/server/models/actor/actor-image.tsindex 98a7f6fbaa..8edff5ab41 100644--- a/server/models/actor/actor-image.ts+++ b/server/models/actor/actor-image.ts@@ -2,7 +2,7 @@ import { remove } from 'fs-extra'import { join } from 'path'import { AfterDestroy, AllowNull, Column, CreatedAt, Default, Is, Model, Table, UpdatedAt } from 'sequelize-typescript'import { MActorImageFormattable } from '@server/types/models'-import { AttributesOnly } from '@shared/core-utils'+import { AttributesOnly } from '@shared/typescript-utils'import { ActorImageType } from '@shared/models'import { ActorImage } from '../../../shared/models/actors/actor-image.model'import { isActivityPubUrlValid } from '../../helpers/custom-validators/activitypub/misc'diff --git a/server/models/actor/actor.ts b/server/models/actor/actor.tsindex cbd3f0e4a6..c12dcf6340 100644--- a/server/models/actor/actor.ts+++ b/server/models/actor/actor.ts@@ -17,7 +17,8 @@ import {UpdatedAt} from 'sequelize-typescript'import { ModelCache } from '@server/models/model-cache'-import { getLowercaseExtension, AttributesOnly } from '@shared/core-utils'+import { getLowercaseExtension } from '@shared/core-utils'+import { AttributesOnly } from '@shared/typescript-utils'import { ActivityIconObject, ActivityPubActorType } from '../../../shared/models/activitypub'import { ActorImage } from '../../../shared/models/actors/actor-image.model'import { activityPubContextify } from '../../helpers/activitypub'diff --git a/server/models/application/application.ts b/server/models/application/application.tsindex e3939383be..a479de5d29 100644--- a/server/models/application/application.ts+++ b/server/models/application/application.ts@@ -1,6 +1,6 @@import memoizee from 'memoizee'import { AllowNull, Column, Default, DefaultScope, HasOne, IsInt, Model, Table } from 'sequelize-typescript'-import { AttributesOnly } from '@shared/core-utils'+import { AttributesOnly } from '@shared/typescript-utils'import { AccountModel } from '../account/account'export const getServerActor = memoizee(async function () {diff --git a/server/models/oauth/oauth-client.ts b/server/models/oauth/oauth-client.tsindex 890954bdb6..860fa6f532 100644--- a/server/models/oauth/oauth-client.ts+++ b/server/models/oauth/oauth-client.ts@@ -1,5 +1,5 @@import { AllowNull, Column, CreatedAt, DataType, HasMany, Model, Table, UpdatedAt } from 'sequelize-typescript'-import { AttributesOnly } from '@shared/core-utils'+import { AttributesOnly } from '@shared/typescript-utils'import { OAuthTokenModel } from './oauth-token'@Table({diff --git a/server/models/oauth/oauth-token.ts b/server/models/oauth/oauth-token.tsindex af4b0ec421..f72423190e 100644--- a/server/models/oauth/oauth-token.ts+++ b/server/models/oauth/oauth-token.ts@@ -15,7 +15,7 @@ import {import { TokensCache } from '@server/lib/auth/tokens-cache'import { MUserAccountId } from '@server/types/models'import { MOAuthTokenUser } from '@server/types/models/oauth/oauth-token'-import { AttributesOnly } from '@shared/core-utils'+import { AttributesOnly } from '@shared/typescript-utils'import { logger } from '../../helpers/logger'import { AccountModel } from '../account/account'import { ActorModel } from '../actor/actor'diff --git a/server/models/redundancy/video-redundancy.ts b/server/models/redundancy/video-redundancy.tsindex e8d79a3ab2..7e4c7ddf25 100644--- a/server/models/redundancy/video-redundancy.ts+++ b/server/models/redundancy/video-redundancy.ts@@ -16,7 +16,7 @@ import {} from 'sequelize-typescript'import { getServerActor } from '@server/models/application/application'import { MActor, MVideoForRedundancyAPI, MVideoRedundancy, MVideoRedundancyAP, MVideoRedundancyVideo } from '@server/types/models'-import { AttributesOnly } from '@shared/core-utils'+import { AttributesOnly } from '@shared/typescript-utils'import { VideoRedundanciesTarget } from '@shared/models/redundancy/video-redundancies-filters.model'import {FileRedundancyInformation,diff --git a/server/models/server/plugin.ts b/server/models/server/plugin.tsindex c791787821..84f7a14e47 100644--- a/server/models/server/plugin.ts+++ b/server/models/server/plugin.ts@@ -1,7 +1,7 @@import { FindAndCountOptions, json, QueryTypes } from 'sequelize'import { AllowNull, Column, CreatedAt, DataType, DefaultScope, Is, Model, Table, UpdatedAt } from 'sequelize-typescript'import { MPlugin, MPluginFormattable } from '@server/types/models'-import { AttributesOnly } from '@shared/core-utils'+import { AttributesOnly } from '@shared/typescript-utils'import { PeerTubePlugin, PluginType, RegisterServerSettingOptions } from '../../../shared/models'import {isPluginDescriptionValid,diff --git a/server/models/server/server-blocklist.ts b/server/models/server/server-blocklist.tsindex 092998db33..9f64eeb7f9 100644--- a/server/models/server/server-blocklist.ts+++ b/server/models/server/server-blocklist.ts@@ -1,7 +1,7 @@import { Op, QueryTypes } from 'sequelize'import { BelongsTo, Column, CreatedAt, ForeignKey, Model, Scopes, Table, UpdatedAt } from 'sequelize-typescript'import { MServerBlocklist, MServerBlocklistAccountServer, MServerBlocklistFormattable } from '@server/types/models'-import { AttributesOnly } from '@shared/core-utils'+import { AttributesOnly } from '@shared/typescript-utils'import { ServerBlock } from '@shared/models'import { AccountModel } from '../account/account'import { createSafeIn, getSort, searchAttribute } from '../utils'diff --git a/server/models/server/server.ts b/server/models/server/server.tsindex edbe92f73f..ef42de0906 100644--- a/server/models/server/server.ts+++ b/server/models/server/server.ts@@ -1,7 +1,7 @@import { Transaction } from 'sequelize'import { AllowNull, Column, CreatedAt, Default, HasMany, Is, Model, Table, UpdatedAt } from 'sequelize-typescript'import { MServer, MServerFormattable } from '@server/types/models/server'-import { AttributesOnly } from '@shared/core-utils'+import { AttributesOnly } from '@shared/typescript-utils'import { isHostValid } from '../../helpers/custom-validators/servers'import { ActorModel } from '../actor/actor'import { throwIfNotValid } from '../utils'diff --git a/server/models/server/tracker.ts b/server/models/server/tracker.tsindex c09fdd64b0..ee087c4a30 100644--- a/server/models/server/tracker.ts+++ b/server/models/server/tracker.ts@@ -1,7 +1,7 @@import { AllowNull, BelongsToMany, Column, CreatedAt, Model, Table, UpdatedAt } from 'sequelize-typescript'import { Transaction } from 'sequelize/types'import { MTracker } from '@server/types/models/server/tracker'-import { AttributesOnly } from '@shared/core-utils'+import { AttributesOnly } from '@shared/typescript-utils'import { VideoModel } from '../video/video'import { VideoTrackerModel } from './video-tracker'diff --git a/server/models/server/video-tracker.ts b/server/models/server/video-tracker.tsindex c49fbd1c6c..f14f3bd7d1 100644--- a/server/models/server/video-tracker.ts+++ b/server/models/server/video-tracker.ts@@ -1,5 +1,5 @@import { Column, CreatedAt, ForeignKey, Model, Table, UpdatedAt } from 'sequelize-typescript'-import { AttributesOnly } from '@shared/core-utils'+import { AttributesOnly } from '@shared/typescript-utils'import { VideoModel } from '../video/video'import { TrackerModel } from './tracker'diff --git a/server/models/user/user-notification-setting.ts b/server/models/user/user-notification-setting.tsindex bee7d78515..f03b19e414 100644--- a/server/models/user/user-notification-setting.ts+++ b/server/models/user/user-notification-setting.ts@@ -14,7 +14,7 @@ import {} from 'sequelize-typescript'import { TokensCache } from '@server/lib/auth/tokens-cache'import { MNotificationSettingFormattable } from '@server/types/models'-import { AttributesOnly } from '@shared/core-utils'+import { AttributesOnly } from '@shared/typescript-utils'import { UserNotificationSetting, UserNotificationSettingValue } from '../../../shared/models/users/user-notification-setting.model'import { isUserNotificationSettingValid } from '../../helpers/custom-validators/user-notifications'import { throwIfNotValid } from '../utils'diff --git a/server/models/user/user-notification.ts b/server/models/user/user-notification.tsindex 55d65d6b2c..4a9a84a5bd 100644--- a/server/models/user/user-notification.ts+++ b/server/models/user/user-notification.ts@@ -2,7 +2,7 @@ import { FindOptions, ModelIndexesOptions, Op, WhereOptions } from 'sequelize'import { AllowNull, BelongsTo, Column, CreatedAt, Default, ForeignKey, Is, Model, Scopes, Table, UpdatedAt } from 'sequelize-typescript'import { uuidToShort } from '@shared/core-utils/uuid'import { UserNotificationIncludes, UserNotificationModelForApi } from '@server/types/models/user'-import { AttributesOnly } from '@shared/core-utils'+import { AttributesOnly } from '@shared/typescript-utils'import { UserNotification, UserNotificationType } from '../../../shared'import { isBooleanValid } from '../../helpers/custom-validators/misc'import { isUserNotificationTypeValid } from '../../helpers/custom-validators/user-notifications'diff --git a/server/models/user/user-video-history.ts b/server/models/user/user-video-history.tsindex 1aefdf02bf..6d9f2e03f7 100644--- a/server/models/user/user-video-history.ts+++ b/server/models/user/user-video-history.ts@@ -1,7 +1,7 @@import { DestroyOptions, Op, Transaction } from 'sequelize'import { AllowNull, BelongsTo, Column, CreatedAt, ForeignKey, IsInt, Model, Table, UpdatedAt } from 'sequelize-typescript'import { MUserAccountId, MUserId } from '@server/types/models'-import { AttributesOnly } from '@shared/core-utils'+import { AttributesOnly } from '@shared/typescript-utils'import { VideoModel } from '../video/video'import { UserModel } from './user'import { getServerActor } from '../application/application'diff --git a/server/models/user/user.ts b/server/models/user/user.tsindex 88c3ff5283..4ad76e5bc4 100644--- a/server/models/user/user.ts+++ b/server/models/user/user.ts@@ -31,7 +31,7 @@ import {MUserWithNotificationSetting,MVideoWithRights} from '@server/types/models'-import { AttributesOnly } from '@shared/core-utils'+import { AttributesOnly } from '@shared/typescript-utils'import { hasUserRight, USER_ROLE_LABELS } from '../../../shared/core-utils/users'import { AbuseState, MyUser, UserRight, VideoPlaylistType, VideoPrivacy } from '../../../shared/models'import { User, UserRole } from '../../../shared/models/users'diff --git a/server/models/video/schedule-video-update.ts b/server/models/video/schedule-video-update.tsindex d462c20c76..b3cf269667 100644--- a/server/models/video/schedule-video-update.ts+++ b/server/models/video/schedule-video-update.ts@@ -1,7 +1,7 @@import { Op, Transaction } from 'sequelize'import { AllowNull, BelongsTo, Column, CreatedAt, Default, ForeignKey, Model, Table, UpdatedAt } from 'sequelize-typescript'import { MScheduleVideoUpdateFormattable, MScheduleVideoUpdate } from '@server/types/models'-import { AttributesOnly } from '@shared/core-utils'+import { AttributesOnly } from '@shared/typescript-utils'import { VideoPrivacy } from '../../../shared/models/videos'import { VideoModel } from './video'diff --git a/server/models/video/tag.ts b/server/models/video/tag.tsindex 61dfb224d3..7900e070dd 100644--- a/server/models/video/tag.ts+++ b/server/models/video/tag.ts@@ -1,7 +1,7 @@import { col, fn, QueryTypes, Transaction } from 'sequelize'import { AllowNull, BelongsToMany, Column, CreatedAt, Is, Model, Table, UpdatedAt } from 'sequelize-typescript'import { MTag } from '@server/types/models'-import { AttributesOnly } from '@shared/core-utils'+import { AttributesOnly } from '@shared/typescript-utils'import { VideoPrivacy, VideoState } from '../../../shared/models/videos'import { isVideoTagValid } from '../../helpers/custom-validators/videos'import { throwIfNotValid } from '../utils'diff --git a/server/models/video/thumbnail.ts b/server/models/video/thumbnail.tsindex 3388478d92..05c58cf19c 100644--- a/server/models/video/thumbnail.ts+++ b/server/models/video/thumbnail.ts@@ -17,7 +17,7 @@ import {} from 'sequelize-typescript'import { afterCommitIfTransaction } from '@server/helpers/database-utils'import { MThumbnail, MThumbnailVideo, MVideo } from '@server/types/models'-import { AttributesOnly } from '@shared/core-utils'+import { AttributesOnly } from '@shared/typescript-utils'import { ThumbnailType } from '../../../shared/models/videos/thumbnail.type'import { logger } from '../../helpers/logger'import { CONFIG } from '../../initializers/config'diff --git a/server/models/video/video-blacklist.ts b/server/models/video/video-blacklist.tsindex 98f4ec9c5b..1cd8224c0a 100644--- a/server/models/video/video-blacklist.ts+++ b/server/models/video/video-blacklist.ts@@ -1,7 +1,7 @@import { FindOptions } from 'sequelize'import { AllowNull, BelongsTo, Column, CreatedAt, DataType, Default, ForeignKey, Is, Model, Table, UpdatedAt } from 'sequelize-typescript'import { MVideoBlacklist, MVideoBlacklistFormattable } from '@server/types/models'-import { AttributesOnly } from '@shared/core-utils'+import { AttributesOnly } from '@shared/typescript-utils'import { VideoBlacklist, VideoBlacklistType } from '../../../shared/models/videos'import { isVideoBlacklistReasonValid, isVideoBlacklistTypeValid } from '../../helpers/custom-validators/video-blacklist'import { CONSTRAINTS_FIELDS } from '../../initializers/constants'diff --git a/server/models/video/video-caption.ts b/server/models/video/video-caption.tsindex 590e72e527..642613cfe8 100644--- a/server/models/video/video-caption.ts+++ b/server/models/video/video-caption.ts@@ -17,7 +17,7 @@ import {} from 'sequelize-typescript'import { buildUUID } from '@shared/core-utils/uuid'import { MVideo, MVideoCaption, MVideoCaptionFormattable, MVideoCaptionVideo } from '@server/types/models'-import { AttributesOnly } from '@shared/core-utils'+import { AttributesOnly } from '@shared/typescript-utils'import { VideoCaption } from '../../../shared/models/videos/caption/video-caption.model'import { isVideoCaptionLanguageValid } from '../../helpers/custom-validators/video-captions'import { logger } from '../../helpers/logger'diff --git a/server/models/video/video-change-ownership.ts b/server/models/video/video-change-ownership.tsindex 7d20a954d6..1a1b8c88de 100644--- a/server/models/video/video-change-ownership.ts+++ b/server/models/video/video-change-ownership.ts@@ -1,6 +1,6 @@import { AllowNull, BelongsTo, Column, CreatedAt, ForeignKey, Model, Scopes, Table, UpdatedAt } from 'sequelize-typescript'import { MVideoChangeOwnershipFormattable, MVideoChangeOwnershipFull } from '@server/types/models/video/video-change-ownership'-import { AttributesOnly } from '@shared/core-utils'+import { AttributesOnly } from '@shared/typescript-utils'import { VideoChangeOwnership, VideoChangeOwnershipStatus } from '../../../shared/models/videos'import { AccountModel } from '../account/account'import { getSort } from '../utils'diff --git a/server/models/video/video-channel.ts b/server/models/video/video-channel.tsindex b652d8531a..2c6669bcba 100644--- a/server/models/video/video-channel.ts+++ b/server/models/video/video-channel.ts@@ -17,8 +17,10 @@ import {Table,UpdatedAt} from 'sequelize-typescript'+import { CONFIG } from '@server/initializers/config'import { MAccountActor } from '@server/types/models'-import { AttributesOnly, pick } from '@shared/core-utils'+import { pick } from '@shared/core-utils'+import { AttributesOnly } from '@shared/typescript-utils'import { ActivityPubActor } from '../../../shared/models/activitypub'import { VideoChannel, VideoChannelSummary } from '../../../shared/models/videos'import {@@ -44,7 +46,6 @@ import { setAsUpdated } from '../shared'import { buildServerIdsFollowedBy, buildTrigramSearchIndex, createSimilarityAttribute, getSort, throwIfNotValid } from '../utils'import { VideoModel } from './video'import { VideoPlaylistModel } from './video-playlist'-import { CONFIG } from '@server/initializers/config'export enum ScopeNames {FOR_API = 'FOR_API',diff --git a/server/models/video/video-comment.ts b/server/models/video/video-comment.tsindex c89279c65e..7f28b86b45 100644--- a/server/models/video/video-comment.ts+++ b/server/models/video/video-comment.ts@@ -16,7 +16,7 @@ import {} from 'sequelize-typescript'import { getServerActor } from '@server/models/application/application'import { MAccount, MAccountId, MUserAccountId } from '@server/types/models'-import { AttributesOnly } from '@shared/core-utils'+import { AttributesOnly } from '@shared/typescript-utils'import { VideoPrivacy } from '@shared/models'import { ActivityTagObject, ActivityTombstoneObject } from '../../../shared/models/activitypub/objects/common-objects'import { VideoCommentObject } from '../../../shared/models/activitypub/objects/video-comment-object'diff --git a/server/models/video/video-file.ts b/server/models/video/video-file.tsindex 87311c0edb..2b5ec3a20b 100644--- a/server/models/video/video-file.ts+++ b/server/models/video/video-file.ts@@ -26,7 +26,7 @@ import { extractVideo } from '@server/helpers/video'import { getHLSPublicFileUrl, getWebTorrentPublicFileUrl } from '@server/lib/object-storage'import { getFSTorrentFilePath } from '@server/lib/paths'import { isStreamingPlaylist, MStreamingPlaylistVideo, MVideo, MVideoWithHost } from '@server/types/models'-import { AttributesOnly } from '@shared/core-utils'+import { AttributesOnly } from '@shared/typescript-utils'import { VideoStorage } from '@shared/models'import {isVideoFileExtnameValid,diff --git a/server/models/video/video-import.ts b/server/models/video/video-import.tsindex 5c73fb07c8..c41085ef99 100644--- a/server/models/video/video-import.ts+++ b/server/models/video/video-import.ts@@ -15,7 +15,7 @@ import {} from 'sequelize-typescript'import { afterCommitIfTransaction } from '@server/helpers/database-utils'import { MVideoImportDefault, MVideoImportFormattable } from '@server/types/models/video/video-import'-import { AttributesOnly } from '@shared/core-utils'+import { AttributesOnly } from '@shared/typescript-utils'import { VideoImport, VideoImportState } from '../../../shared'import { isVideoImportStateValid, isVideoImportTargetUrlValid } from '../../helpers/custom-validators/video-imports'import { isVideoMagnetUriValid } from '../../helpers/custom-validators/videos'diff --git a/server/models/video/video-job-info.ts b/server/models/video/video-job-info.tsindex 7da5128d75..6a67a214c1 100644--- a/server/models/video/video-job-info.ts+++ b/server/models/video/video-job-info.ts@@ -1,6 +1,6 @@import { Op, QueryTypes, Transaction } from 'sequelize'import { AllowNull, BelongsTo, Column, CreatedAt, Default, ForeignKey, IsInt, Model, Table, Unique, UpdatedAt } from 'sequelize-typescript'-import { AttributesOnly } from '@shared/core-utils'+import { AttributesOnly } from '@shared/typescript-utils'import { VideoModel } from './video'export type VideoJobInfoColumnType = 'pendingMove' | 'pendingTranscode'diff --git a/server/models/video/video-live.ts b/server/models/video/video-live.tsindex 0bc8da0223..e3fdcc0bab 100644--- a/server/models/video/video-live.ts+++ b/server/models/video/video-live.ts@@ -1,7 +1,7 @@import { AllowNull, BelongsTo, Column, CreatedAt, DataType, DefaultScope, ForeignKey, Model, Table, UpdatedAt } from 'sequelize-typescript'import { WEBSERVER } from '@server/initializers/constants'import { MVideoLive, MVideoLiveVideo } from '@server/types/models'-import { AttributesOnly } from '@shared/core-utils'+import { AttributesOnly } from '@shared/typescript-utils'import { LiveVideo, VideoState } from '@shared/models'import { VideoModel } from './video'import { VideoBlacklistModel } from './video-blacklist'diff --git a/server/models/video/video-playlist-element.ts b/server/models/video/video-playlist-element.tsindex a87b2bcaea..e20e32f8b4 100644--- a/server/models/video/video-playlist-element.ts+++ b/server/models/video/video-playlist-element.ts@@ -32,7 +32,7 @@ import { AccountModel } from '../account/account'import { getSort, throwIfNotValid } from '../utils'import { ForAPIOptions, ScopeNames as VideoScopeNames, VideoModel } from './video'import { VideoPlaylistModel } from './video-playlist'-import { AttributesOnly } from '@shared/core-utils'+import { AttributesOnly } from '@shared/typescript-utils'@Table({tableName: 'videoPlaylistElement',diff --git a/server/models/video/video-playlist.ts b/server/models/video/video-playlist.tsindex d0c73cbd1f..132fa0e680 100644--- a/server/models/video/video-playlist.ts+++ b/server/models/video/video-playlist.ts@@ -17,9 +17,10 @@ import {Table,UpdatedAt} from 'sequelize-typescript'-import { buildUUID, uuidToShort } from '@shared/core-utils/uuid'import { MAccountId, MChannelId } from '@server/types/models'-import { AttributesOnly, buildPlaylistEmbedPath, buildPlaylistWatchPath, pick } from '@shared/core-utils'+import { buildPlaylistEmbedPath, buildPlaylistWatchPath, pick } from '@shared/core-utils'+import { buildUUID, uuidToShort } from '@shared/core-utils/uuid'+import { AttributesOnly } from '@shared/typescript-utils'import { ActivityIconObject } from '../../../shared/models/activitypub/objects'import { PlaylistObject } from '../../../shared/models/activitypub/objects/playlist-object'import { VideoPlaylistPrivacy } from '../../../shared/models/videos/playlist/video-playlist-privacy.model'diff --git a/server/models/video/video-share.ts b/server/models/video/video-share.tsindex 505c305e23..f6659b9928 100644--- a/server/models/video/video-share.ts+++ b/server/models/video/video-share.ts@@ -1,6 +1,6 @@import { literal, Op, QueryTypes, Transaction } from 'sequelize'import { AllowNull, BelongsTo, Column, CreatedAt, DataType, ForeignKey, Is, Model, Scopes, Table, UpdatedAt } from 'sequelize-typescript'-import { AttributesOnly } from '@shared/core-utils'+import { AttributesOnly } from '@shared/typescript-utils'import { isActivityPubUrlValid } from '../../helpers/custom-validators/activitypub/misc'import { CONSTRAINTS_FIELDS } from '../../initializers/constants'import { MActorDefault } from '../../types/models'diff --git a/server/models/video/video-streaming-playlist.ts b/server/models/video/video-streaming-playlist.tsindex 23b3fbcbe4..d813f89b5a 100644--- a/server/models/video/video-streaming-playlist.ts+++ b/server/models/video/video-streaming-playlist.ts@@ -18,7 +18,7 @@ import {import { getHLSPublicFileUrl } from '@server/lib/object-storage'import { VideoFileModel } from '@server/models/video/video-file'import { MStreamingPlaylist, MVideo } from '@server/types/models'-import { AttributesOnly } from '@shared/core-utils'+import { AttributesOnly } from '@shared/typescript-utils'import { VideoStorage } from '@shared/models'import { VideoStreamingPlaylistType } from '../../../shared/models/videos/video-streaming-playlist.type'import { sha1 } from '@shared/core-utils/crypto'diff --git a/server/models/video/video-tag.ts b/server/models/video/video-tag.tsindex 1285d375bb..7e880c9680 100644--- a/server/models/video/video-tag.ts+++ b/server/models/video/video-tag.ts@@ -1,5 +1,5 @@import { Column, CreatedAt, ForeignKey, Model, Table, UpdatedAt } from 'sequelize-typescript'-import { AttributesOnly } from '@shared/core-utils'+import { AttributesOnly } from '@shared/typescript-utils'import { TagModel } from './tag'import { VideoModel } from './video'diff --git a/server/models/video/video-view.ts b/server/models/video/video-view.tsindex b51f0f84d1..d72df100f1 100644--- a/server/models/video/video-view.ts+++ b/server/models/video/video-view.ts@@ -1,6 +1,6 @@import { literal, Op } from 'sequelize'import { AllowNull, BelongsTo, Column, CreatedAt, DataType, ForeignKey, Model, Table } from 'sequelize-typescript'-import { AttributesOnly } from '@shared/core-utils'+import { AttributesOnly } from '@shared/typescript-utils'import { VideoModel } from './video'@Table({diff --git a/server/models/video/video.ts b/server/models/video/video.tsindex efd4d84624..a99b012b9d 100644--- a/server/models/video/video.ts+++ b/server/models/video/video.ts@@ -25,7 +25,6 @@ import {UpdatedAt} from 'sequelize-typescript'import { buildNSFWFilter } from '@server/helpers/express-utils'-import { uuidToShort } from '@shared/core-utils/uuid'import { getPrivaciesForFederation, isPrivacyForFederation, isStateForFederation } from '@server/helpers/video'import { LiveManager } from '@server/lib/live/live-manager'import { removeHLSObjectStorage, removeWebTorrentObjectStorage } from '@server/lib/object-storage'@@ -33,8 +32,10 @@ import { getHLSDirectory, getHLSRedundancyDirectory } from '@server/lib/paths'import { VideoPathManager } from '@server/lib/video-path-manager'import { getServerActor } from '@server/models/application/application'import { ModelCache } from '@server/models/model-cache'-import { AttributesOnly, buildVideoEmbedPath, buildVideoWatchPath, pick } from '@shared/core-utils'+import { buildVideoEmbedPath, buildVideoWatchPath, pick } from '@shared/core-utils'+import { uuidToShort } from '@shared/core-utils/uuid'import { VideoFile, VideoInclude } from '@shared/models'+import { AttributesOnly } from '@shared/typescript-utils'import { ResultList, UserRight, VideoPrivacy, VideoState } from '../../../shared'import { VideoObject } from '../../../shared/models/activitypub/objects'import { Video, VideoDetails, VideoRateType, VideoStorage } from '../../../shared/models/videos'diff --git a/server/types/models/abuse/abuse-message.ts b/server/types/models/abuse/abuse-message.tsindex 565eca7066..2d7d093167 100644--- a/server/types/models/abuse/abuse-message.ts+++ b/server/types/models/abuse/abuse-message.ts@@ -1,5 +1,5 @@import { AbuseMessageModel } from '@server/models/abuse/abuse-message'-import { PickWith } from '@shared/core-utils'+import { PickWith } from '@shared/typescript-utils'import { AbuseModel } from '../../../models/abuse/abuse'import { MAccountFormattable } from '../account'diff --git a/server/types/models/abuse/abuse.ts b/server/types/models/abuse/abuse.tsindex 6fd83684c6..1b45b3879f 100644--- a/server/types/models/abuse/abuse.ts+++ b/server/types/models/abuse/abuse.ts@@ -1,7 +1,7 @@import { VideoAbuseModel } from '@server/models/abuse/video-abuse'import { VideoCommentAbuseModel } from '@server/models/abuse/video-comment-abuse'import { VideoCommentModel } from '@server/models/video/video-comment'-import { PickWith } from '@shared/core-utils'+import { PickWith } from '@shared/typescript-utils'import { AbuseModel } from '../../../models/abuse/abuse'import { MAccountDefault, MAccountFormattable, MAccountLight, MAccountUrl } from '../account'import { MComment, MCommentOwner, MCommentUrl, MCommentVideo, MVideoUrl } from '../video'diff --git a/server/types/models/account/account-blocklist.ts b/server/types/models/account/account-blocklist.tsindex 3126fd0ab4..9dae10915f 100644--- a/server/types/models/account/account-blocklist.ts+++ b/server/types/models/account/account-blocklist.ts@@ -1,5 +1,5 @@import { AccountBlocklistModel } from '../../../models/account/account-blocklist'-import { PickWith } from '@shared/core-utils'+import { PickWith } from '@shared/typescript-utils'import { MAccountDefault, MAccountFormattable } from './account'type Use<K extends keyof AccountBlocklistModel, M> = PickWith<AccountBlocklistModel, K, M>diff --git a/server/types/models/account/account.ts b/server/types/models/account/account.tsindex 71f6c79aad..282a2971b0 100644--- a/server/types/models/account/account.ts+++ b/server/types/models/account/account.ts@@ -1,4 +1,4 @@-import { FunctionProperties, PickWith } from '@shared/core-utils'+import { FunctionProperties, PickWith } from '@shared/typescript-utils'import { AccountModel } from '../../../models/account/account'import {MActor,diff --git a/server/types/models/account/actor-custom-page.ts b/server/types/models/account/actor-custom-page.tsindex 2cb8aa7e4b..fcd8069be5 100644--- a/server/types/models/account/actor-custom-page.ts+++ b/server/types/models/account/actor-custom-page.ts@@ -1,4 +1,3 @@-import { ActorCustomPageModel } from '../../../models/account/actor-custom-page'export type MActorCustomPage = Omit<ActorCustomPageModel, 'Actor'>diff --git a/server/types/models/actor/actor-follow.ts b/server/types/models/actor/actor-follow.tsindex 98a6ca8a59..3381585612 100644--- a/server/types/models/actor/actor-follow.ts+++ b/server/types/models/actor/actor-follow.ts@@ -1,4 +1,4 @@-import { PickWith } from '@shared/core-utils'+import { PickWith } from '@shared/typescript-utils'import { ActorFollowModel } from '../../../models/actor/actor-follow'import {MActor,diff --git a/server/types/models/actor/actor-image.ts b/server/types/models/actor/actor-image.tsindex 89adb01aee..521b4cc59c 100644--- a/server/types/models/actor/actor-image.ts+++ b/server/types/models/actor/actor-image.ts@@ -1,4 +1,4 @@-import { FunctionProperties } from '@shared/core-utils'+import { FunctionProperties } from '@shared/typescript-utils'import { ActorImageModel } from '../../../models/actor/actor-image'export type MActorImage = ActorImageModeldiff --git a/server/types/models/actor/actor.ts b/server/types/models/actor/actor.tsindex b3a70cbcef..9ce97094fb 100644--- a/server/types/models/actor/actor.ts+++ b/server/types/models/actor/actor.ts@@ -1,4 +1,4 @@-import { FunctionProperties, PickWith, PickWithOpt } from '@shared/core-utils'+import { FunctionProperties, PickWith, PickWithOpt } from '@shared/typescript-utils'import { ActorModel } from '../../../models/actor/actor'import { MAccount, MAccountDefault, MAccountId, MAccountIdActor } from '../account'import { MServer, MServerHost, MServerHostBlocks, MServerRedundancyAllowed } from '../server'diff --git a/server/types/models/oauth/oauth-token.ts b/server/types/models/oauth/oauth-token.tsindex 8399af8f17..6af087e3c1 100644--- a/server/types/models/oauth/oauth-token.ts+++ b/server/types/models/oauth/oauth-token.ts@@ -1,5 +1,5 @@import { OAuthTokenModel } from '@server/models/oauth/oauth-token'-import { PickWith } from '@shared/core-utils'+import { PickWith } from '@shared/typescript-utils'import { MUserAccountUrl } from '../user/user'type Use<K extends keyof OAuthTokenModel, M> = PickWith<OAuthTokenModel, K, M>diff --git a/server/types/models/server/server-blocklist.ts b/server/types/models/server/server-blocklist.tsindex 801f179fd7..71a4ea963e 100644--- a/server/types/models/server/server-blocklist.ts+++ b/server/types/models/server/server-blocklist.ts@@ -1,5 +1,5 @@import { ServerBlocklistModel } from '@server/models/server/server-blocklist'-import { PickWith } from '@shared/core-utils'+import { PickWith } from '@shared/typescript-utils'import { MAccountDefault, MAccountFormattable } from '../account/account'import { MServer, MServerFormattable } from './server'diff --git a/server/types/models/server/server.ts b/server/types/models/server/server.tsindex 876186fc0b..0b16186cd6 100644--- a/server/types/models/server/server.ts+++ b/server/types/models/server/server.ts@@ -1,5 +1,5 @@+import { FunctionProperties, PickWith } from '@shared/typescript-utils'import { ServerModel } from '../../../models/server/server'-import { FunctionProperties, PickWith } from '@shared/core-utils'import { MAccountBlocklistId } from '../account'type Use<K extends keyof ServerModel, M> = PickWith<ServerModel, K, M>diff --git a/server/types/models/user/user-notification.ts b/server/types/models/user/user-notification.tsindex 918614dd1b..db9ec04008 100644--- a/server/types/models/user/user-notification.ts+++ b/server/types/models/user/user-notification.ts@@ -3,7 +3,7 @@ import { VideoCommentAbuseModel } from '@server/models/abuse/video-comment-abuseimport { ApplicationModel } from '@server/models/application/application'import { PluginModel } from '@server/models/server/plugin'import { UserNotificationModel } from '@server/models/user/user-notification'-import { PickWith, PickWithOpt } from '@shared/core-utils'+import { PickWith, PickWithOpt } from '@shared/typescript-utils'import { AbuseModel } from '../../../models/abuse/abuse'import { AccountModel } from '../../../models/account/account'import { ActorModel } from '../../../models/actor/actor'diff --git a/server/types/models/user/user.ts b/server/types/models/user/user.tsindex f79220e115..89092c2426 100644--- a/server/types/models/user/user.ts+++ b/server/types/models/user/user.ts@@ -1,7 +1,7 @@import { AccountModel } from '@server/models/account/account'import { UserModel } from '@server/models/user/user'import { MVideoPlaylist } from '@server/types/models'-import { PickWith, PickWithOpt } from '@shared/core-utils'+import { PickWith, PickWithOpt } from '@shared/typescript-utils'import {MAccount,MAccountDefault,diff --git a/server/types/models/video/thumbnail.ts b/server/types/models/video/thumbnail.tsindex 81a29e062a..c3b27681f7 100644--- a/server/types/models/video/thumbnail.ts+++ b/server/types/models/video/thumbnail.ts@@ -1,4 +1,4 @@-import { PickWith } from '@shared/core-utils'+import { PickWith } from '@shared/typescript-utils'import { ThumbnailModel } from '../../../models/video/thumbnail'import { MVideo } from './video'diff --git a/server/types/models/video/video-blacklist.ts b/server/types/models/video/video-blacklist.tsindex 2ac912405e..048b63bd20 100644--- a/server/types/models/video/video-blacklist.ts+++ b/server/types/models/video/video-blacklist.ts@@ -1,5 +1,5 @@+import { PickWith } from '@shared/typescript-utils'import { VideoBlacklistModel } from '../../../models/video/video-blacklist'-import { PickWith } from '@shared/core-utils'import { MVideo, MVideoFormattable } from './video'type Use<K extends keyof VideoBlacklistModel, M> = PickWith<VideoBlacklistModel, K, M>diff --git a/server/types/models/video/video-caption.ts b/server/types/models/video/video-caption.tsindex 1f761a8661..8cd8010645 100644--- a/server/types/models/video/video-caption.ts+++ b/server/types/models/video/video-caption.ts@@ -1,4 +1,4 @@-import { PickWith } from '@shared/core-utils'+import { PickWith } from '@shared/typescript-utils'import { VideoCaptionModel } from '../../../models/video/video-caption'import { MVideo, MVideoUUID } from './video'diff --git a/server/types/models/video/video-change-ownership.ts b/server/types/models/video/video-change-ownership.tsindex 6cad48e4a9..d99f25071f 100644--- a/server/types/models/video/video-change-ownership.ts+++ b/server/types/models/video/video-change-ownership.ts@@ -1,7 +1,7 @@import { VideoChangeOwnershipModel } from '@server/models/video/video-change-ownership'-import { PickWith } from '@shared/core-utils'+import { PickWith } from '@shared/typescript-utils'import { MAccountDefault, MAccountFormattable } from '../account/account'-import { MVideoWithAllFiles, MVideoFormattable } from './video'+import { MVideoFormattable, MVideoWithAllFiles } from './video'type Use<K extends keyof VideoChangeOwnershipModel, M> = PickWith<VideoChangeOwnershipModel, K, M>diff --git a/server/types/models/video/video-channels.ts b/server/types/models/video/video-channels.tsindex c147567d95..af8c2ffe48 100644--- a/server/types/models/video/video-channels.ts+++ b/server/types/models/video/video-channels.ts@@ -1,4 +1,4 @@-import { FunctionProperties, PickWith, PickWithOpt } from '@shared/core-utils'+import { FunctionProperties, PickWith, PickWithOpt } from '@shared/typescript-utils'import { VideoChannelModel } from '../../../models/video/video-channel'import {MAccountActor,diff --git a/server/types/models/video/video-comment.ts b/server/types/models/video/video-comment.tsindex 83479e7b2a..b66de064f4 100644--- a/server/types/models/video/video-comment.ts+++ b/server/types/models/video/video-comment.ts@@ -1,4 +1,4 @@-import { PickWith, PickWithOpt } from '@shared/core-utils'+import { PickWith, PickWithOpt } from '@shared/typescript-utils'import { VideoCommentModel } from '../../../models/video/video-comment'import { MAccountDefault, MAccountFormattable, MAccountUrl } from '../account'import { MVideo, MVideoAccountLight, MVideoFeed, MVideoIdUrl, MVideoUrl } from './video'diff --git a/server/types/models/video/video-file.ts b/server/types/models/video/video-file.tsindex 327a148ce9..55603e59c6 100644--- a/server/types/models/video/video-file.ts+++ b/server/types/models/video/video-file.ts@@ -1,8 +1,8 @@+import { PickWith, PickWithOpt } from '@shared/typescript-utils'import { VideoFileModel } from '../../../models/video/video-file'-import { PickWith, PickWithOpt } from '@shared/core-utils'import { MVideo, MVideoUUID } from './video'import { MVideoRedundancy, MVideoRedundancyFileUrl } from './video-redundancy'-import { MStreamingPlaylistVideo, MStreamingPlaylist } from './video-streaming-playlist'+import { MStreamingPlaylist, MStreamingPlaylistVideo } from './video-streaming-playlist'type Use<K extends keyof VideoFileModel, M> = PickWith<VideoFileModel, K, M>diff --git a/server/types/models/video/video-import.ts b/server/types/models/video/video-import.tsindex 759b13c6ef..650c293f79 100644--- a/server/types/models/video/video-import.ts+++ b/server/types/models/video/video-import.ts@@ -1,7 +1,7 @@import { VideoImportModel } from '@server/models/video/video-import'-import { PickWith, PickWithOpt } from '@shared/core-utils'-import { MVideo, MVideoAccountLight, MVideoFormattable, MVideoTag, MVideoThumbnail, MVideoWithFile } from './video'+import { PickWith, PickWithOpt } from '@shared/typescript-utils'import { MUser } from '../user/user'+import { MVideo, MVideoAccountLight, MVideoFormattable, MVideoTag, MVideoThumbnail, MVideoWithFile } from './video'type Use<K extends keyof VideoImportModel, M> = PickWith<VideoImportModel, K, M>diff --git a/server/types/models/video/video-live.ts b/server/types/models/video/video-live.tsindex 346052417b..903cea9820 100644--- a/server/types/models/video/video-live.ts+++ b/server/types/models/video/video-live.ts@@ -1,5 +1,5 @@import { VideoLiveModel } from '@server/models/video/video-live'-import { PickWith } from '@shared/core-utils'+import { PickWith } from '@shared/typescript-utils'import { MVideo } from './video'type Use<K extends keyof VideoLiveModel, M> = PickWith<VideoLiveModel, K, M>diff --git a/server/types/models/video/video-playlist-element.ts b/server/types/models/video/video-playlist-element.tsindex f46ff4d49b..eae6760961 100644--- a/server/types/models/video/video-playlist-element.ts+++ b/server/types/models/video/video-playlist-element.ts@@ -1,5 +1,5 @@import { VideoPlaylistElementModel } from '@server/models/video/video-playlist-element'-import { PickWith } from '@shared/core-utils'+import { PickWith } from '@shared/typescript-utils'import { MVideoFormattable, MVideoThumbnail, MVideoUrl } from './video'import { MVideoPlaylistPrivacy } from './video-playlist'diff --git a/server/types/models/video/video-playlist.ts b/server/types/models/video/video-playlist.tsindex 2f9537cf57..33fe5416ad 100644--- a/server/types/models/video/video-playlist.ts+++ b/server/types/models/video/video-playlist.ts@@ -1,9 +1,9 @@+import { MVideoPlaylistElementLight } from '@server/types/models/video/video-playlist-element'+import { PickWith } from '@shared/typescript-utils'import { VideoPlaylistModel } from '../../../models/video/video-playlist'-import { PickWith } from '@shared/core-utils'import { MAccount, MAccountDefault, MAccountSummary, MAccountSummaryFormattable } from '../account'import { MThumbnail } from './thumbnail'import { MChannelDefault, MChannelSummary, MChannelSummaryFormattable, MChannelUrl } from './video-channels'-import { MVideoPlaylistElementLight } from '@server/types/models/video/video-playlist-element'type Use<K extends keyof VideoPlaylistModel, M> = PickWith<VideoPlaylistModel, K, M>diff --git a/server/types/models/video/video-rate.ts b/server/types/models/video/video-rate.tsindex 7bd54f7b01..0dbdf3c41e 100644--- a/server/types/models/video/video-rate.ts+++ b/server/types/models/video/video-rate.ts@@ -1,5 +1,5 @@import { AccountVideoRateModel } from '@server/models/account/account-video-rate'-import { PickWith } from '@shared/core-utils'+import { PickWith } from '@shared/typescript-utils'import { MAccountAudience, MAccountUrl } from '../account/account'import { MVideo, MVideoFormattable } from './video'diff --git a/server/types/models/video/video-redundancy.ts b/server/types/models/video/video-redundancy.tsindex 411375c81e..e2a9beb936 100644--- a/server/types/models/video/video-redundancy.ts+++ b/server/types/models/video/video-redundancy.ts@@ -1,10 +1,10 @@-import { VideoRedundancyModel } from '../../../models/redundancy/video-redundancy'-import { PickWith, PickWithOpt } from '@shared/core-utils'-import { VideoStreamingPlaylistModel } from '@server/models/video/video-streaming-playlist'import { VideoFileModel } from '@server/models/video/video-file'+import { VideoStreamingPlaylistModel } from '@server/models/video/video-streaming-playlist'+import { PickWith, PickWithOpt } from '@shared/typescript-utils'+import { VideoRedundancyModel } from '../../../models/redundancy/video-redundancy'+import { MVideoUrl } from './video'import { MVideoFile, MVideoFileVideo } from './video-file'import { MStreamingPlaylistVideo } from './video-streaming-playlist'-import { MVideoUrl } from './video'type Use<K extends keyof VideoRedundancyModel, M> = PickWith<VideoRedundancyModel, K, M>diff --git a/server/types/models/video/video-share.ts b/server/types/models/video/video-share.tsindex 78f44e58cc..ffc0edad62 100644--- a/server/types/models/video/video-share.ts+++ b/server/types/models/video/video-share.ts@@ -1,4 +1,4 @@-import { PickWith } from '@shared/core-utils'+import { PickWith } from '@shared/typescript-utils'import { VideoShareModel } from '../../../models/video/video-share'import { MActorDefault } from '../actor'import { MVideo } from './video'diff --git a/server/types/models/video/video-streaming-playlist.ts b/server/types/models/video/video-streaming-playlist.tsindex 1e4dccb8e9..1c2f834892 100644--- a/server/types/models/video/video-streaming-playlist.ts+++ b/server/types/models/video/video-streaming-playlist.ts@@ -1,8 +1,8 @@+import { PickWith, PickWithOpt } from '@shared/typescript-utils'import { VideoStreamingPlaylistModel } from '../../../models/video/video-streaming-playlist'-import { PickWith, PickWithOpt } from '@shared/core-utils'-import { MVideoRedundancyFileUrl, MVideoRedundancy } from './video-redundancy'import { MVideo } from './video'import { MVideoFile } from './video-file'+import { MVideoRedundancy, MVideoRedundancyFileUrl } from './video-redundancy'type Use<K extends keyof VideoStreamingPlaylistModel, M> = PickWith<VideoStreamingPlaylistModel, K, M>diff --git a/server/types/models/video/video.ts b/server/types/models/video/video.tsindex 9a6b27888a..d1af53b92d 100644--- a/server/types/models/video/video.ts+++ b/server/types/models/video/video.ts@@ -1,4 +1,4 @@-import { PickWith, PickWithOpt } from '@shared/core-utils'+import { PickWith, PickWithOpt } from '@shared/typescript-utils'import { VideoModel } from '../../../models/video/video'import { MTrackerUrl } from '../server/tracker'import { MUserVideoHistoryTime } from '../user/user-video-history'diff --git a/server/types/sequelize.ts b/server/types/sequelize.tsindex 535113d011..e399c3d5d8 100644--- a/server/types/sequelize.ts+++ b/server/types/sequelize.ts@@ -1,4 +1,4 @@-import { AttributesOnly } from '@shared/core-utils'+import { AttributesOnly } from '@shared/typescript-utils'import { Model } from 'sequelize'// Thanks to sequelize-typescript: https://github.com/RobinBuschmann/sequelize-typescriptdiff --git a/shared/core-utils/common/index.ts b/shared/core-utils/common/index.tsindex 0908ff9811..5d35121484 100644--- a/shared/core-utils/common/index.ts+++ b/shared/core-utils/common/index.ts@@ -2,5 +2,4 @@ export * from './date'export * from './miscs'export * from './regexp'export * from './promises'-export * from './types'export * from './url'diff --git a/shared/core-utils/common/types.ts b/shared/core-utils/common/types.tsdeleted file mode 100644index bd2a97b98b..0000000000--- a/shared/core-utils/common/types.ts+++ /dev/null@@ -1,45 +0,0 @@-/* eslint-disable @typescript-eslint/array-type */--export type FunctionPropertyNames<T> = {- [K in keyof T]: T[K] extends Function ? K : never-}[keyof T]--export type FunctionProperties<T> = Pick<T, FunctionPropertyNames<T>>--export type AttributesOnly<T> = {- [K in keyof T]: T[K] extends Function ? never : T[K]-}--export type PickWith<T, KT extends keyof T, V> = {- [P in KT]: T[P] extends V ? V : never-}--export type PickWithOpt<T, KT extends keyof T, V> = {- [P in KT]?: T[P] extends V ? V : never-}--// https://github.com/krzkaczor/ts-essentials Rocks!-export type DeepPartial<T> = {- [P in keyof T]?: T[P] extends Array<infer U>- ? Array<DeepPartial<U>>- : T[P] extends ReadonlyArray<infer U>- ? ReadonlyArray<DeepPartial<U>>- : DeepPartial<T[P]>-}--type Primitive = string | Function | number | boolean | Symbol | undefined | null-export type DeepOmitHelper<T, K extends keyof T> = {- [P in K]: // extra level of indirection needed to trigger homomorhic behavior- T[P] extends infer TP // distribute over unions- ? TP extends Primitive- ? TP // leave primitives and functions alone- : TP extends any[]- ? DeepOmitArray<TP, K> // Array special handling- : DeepOmit<TP, K>- : never-}-export type DeepOmit<T, K> = T extends Primitive ? T : DeepOmitHelper<T, Exclude<keyof T, K>>--export type DeepOmitArray<T extends any[], K> = {- [P in keyof T]: DeepOmit<T[P], K>-}diff --git a/shared/extra-utils/server/config-command.ts b/shared/extra-utils/server/config-command.tsindex a061ca89e8..89ae8eb4f6 100644--- a/shared/extra-utils/server/config-command.ts+++ b/shared/extra-utils/server/config-command.ts@@ -1,5 +1,5 @@import { merge } from 'lodash'-import { DeepPartial } from '@shared/core-utils'+import { DeepPartial } from '@shared/typescript-utils'import { About, HttpStatusCode, ServerConfig } from '@shared/models'import { CustomConfig } from '../../models/server/custom-config.model'import { AbstractCommand, OverrideCommandOptions } from '../shared'