X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fhelpers%2Faudit-logger.ts;h=7e8a03e8fc4b974d35feec3c4adf17c0649dd537;hb=cffef25313bdf7a6c435f56ac6715fdd91acf7b3;hp=79ef44be18bd490dda87a74718e30422de1ea524;hpb=d17c7b4e8c52317bdc874917387b7a49f6cf8b01;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/helpers/audit-logger.ts b/server/helpers/audit-logger.ts index 79ef44be1..7e8a03e8f 100644 --- a/server/helpers/audit-logger.ts +++ b/server/helpers/audit-logger.ts @@ -5,7 +5,7 @@ import { chain } from 'lodash' import { join } from 'path' import { addColors, config, createLogger, format, transports } from 'winston' import { AUDIT_LOG_FILENAME } from '@server/initializers/constants' -import { AdminAbuse, CustomConfig, User, VideoChannel, VideoComment, VideoDetails, VideoImport } from '@shared/models' +import { AdminAbuse, CustomConfig, User, VideoChannel, VideoChannelSync, VideoComment, VideoDetails, VideoImport } from '@shared/models' import { CONFIG } from '../initializers/config' import { jsonLoggerFormat, labelFormatter } from './logger' @@ -120,7 +120,7 @@ const videoKeysToKeep = [ 'downloadEnabled' ] class VideoAuditView extends EntityAuditView { - constructor (private readonly video: VideoDetails) { + constructor (video: VideoDetails) { super(videoKeysToKeep, 'video', video) } } @@ -131,7 +131,7 @@ const videoImportKeysToKeep = [ 'video-name' ] class VideoImportAuditView extends EntityAuditView { - constructor (private readonly videoImport: VideoImport) { + constructor (videoImport: VideoImport) { super(videoImportKeysToKeep, 'video-import', videoImport) } } @@ -150,7 +150,7 @@ const commentKeysToKeep = [ 'account-name' ] class CommentAuditView extends EntityAuditView { - constructor (private readonly comment: VideoComment) { + constructor (comment: VideoComment) { super(commentKeysToKeep, 'comment', comment) } } @@ -179,7 +179,7 @@ const userKeysToKeep = [ 'videoChannels' ] class UserAuditView extends EntityAuditView { - constructor (private readonly user: User) { + constructor (user: User) { super(userKeysToKeep, 'user', user) } } @@ -205,7 +205,7 @@ const channelKeysToKeep = [ 'ownerAccount-displayedName' ] class VideoChannelAuditView extends EntityAuditView { - constructor (private readonly channel: VideoChannel) { + constructor (channel: VideoChannel) { super(channelKeysToKeep, 'channel', channel) } } @@ -217,7 +217,7 @@ const abuseKeysToKeep = [ 'createdAt' ] class AbuseAuditView extends EntityAuditView { - constructor (private readonly abuse: AdminAbuse) { + constructor (abuse: AdminAbuse) { super(abuseKeysToKeep, 'abuse', abuse) } } @@ -260,6 +260,18 @@ class CustomConfigAuditView extends EntityAuditView { } } +const channelSyncKeysToKeep = [ + 'id', + 'externalChannelUrl', + 'channel-id', + 'channel-name' +] +class VideoChannelSyncAuditView extends EntityAuditView { + constructor (channelSync: VideoChannelSync) { + super(channelSyncKeysToKeep, 'channelSync', channelSync) + } +} + export { getAuditIdFromRes, @@ -270,5 +282,6 @@ export { UserAuditView, VideoAuditView, AbuseAuditView, - CustomConfigAuditView + CustomConfigAuditView, + VideoChannelSyncAuditView }