import { IHttpInterceptor } from 'angular' ; import { Injectable } from 'angular-ts-decorators' ; import autobind from 'autobind-decorator' ; import Globals from '../../global-shared.constants' ; @ autobind @ Injectable ( 'ApiRequestInterceptorFactory' ) export class ApiRequestInterceptorFactory implements IHttpInterceptor { $q : ng . IQService ; static $inject = [ '$q' ] ; constructor ( $q ) { this . $q = $q ; } request ( config ) { if ( config . url !== Globals . ReleaseLatestUrl ) { config . headers ! [ 'Accept-Version' ] = Globals . MinApiVersion ; } config . timeout = ! config . timeout ? 8000 : config . timeout ; return config ?? this . $q . when ( config ) ; } }