metrics-command.ts 527 B

123456789101112131415161718
  1. import { HttpStatusCode, PlaybackMetricCreate } from '@shared/models'
  2. import { AbstractCommand, OverrideCommandOptions } from '../shared'
  3. export class MetricsCommand extends AbstractCommand {
  4. addPlaybackMetric (options: OverrideCommandOptions & { metrics: PlaybackMetricCreate }) {
  5. const path = '/api/v1/metrics/playback'
  6. return this.postBodyRequest({
  7. ...options,
  8. path,
  9. fields: options.metrics,
  10. implicitToken: false,
  11. defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204
  12. })
  13. }
  14. }