import getAxiosInstance , { JiraClientError } from "../jira/client/axios" ; import { AxiosInstance } from "axios" ; import Installation from "./installation" ; import Logger from "bunyan" ; export default class JiraClient { axios : AxiosInstance ; constructor ( installation , log ) { this . axios = getAxiosInstance ( installation . jiraHost , installation . sharedSecret , log ) ; } async isAuthorized ( ) { try { return ( await this . axios . get ( "/rest/devinfo/0.10/existsByProperties?fakeProperty=1" ) ) . status === 200 ; } catch ( error ) { if ( ! ( error instanceof JiraClientError ) ) { throw error ; } return false ; } } }