+import { pick } from '@shared/core-utils'
import { HttpStatusCode, VideoStatsOverall, VideoStatsRetention, VideoStatsTimeserie, VideoStatsTimeserieMetric } from '@shared/models'
import { AbstractCommand, OverrideCommandOptions } from '../shared'
getOverallStats (options: OverrideCommandOptions & {
videoId: number | string
+ startDate?: string
+ endDate?: string
}) {
const path = '/api/v1/videos/' + options.videoId + '/stats/overall'
...options,
path,
+ query: pick(options, [ 'startDate', 'endDate' ]),
+
implicitToken: true,
defaultExpectedStatus: HttpStatusCode.OK_200
})
getTimeserieStats (options: OverrideCommandOptions & {
videoId: number | string
metric: VideoStatsTimeserieMetric
+ startDate?: Date
+ endDate?: Date
}) {
const path = '/api/v1/videos/' + options.videoId + '/stats/timeseries/' + options.metric
...options,
path,
+ query: pick(options, [ 'startDate', 'endDate' ]),
implicitToken: true,
defaultExpectedStatus: HttpStatusCode.OK_200
})