UNPKG

@vulog/aima-client

Version:

```bash npm i @vulog/aima-client ```

41 lines (35 loc) 868 B
import { AxiosInstance } from 'axios'; export type Token = { accessToken: string; refreshToken: string; }; export type Store = { getToken: () => Promise<Token | undefined>; setToken: (token: Token) => Promise<void>; }; export type ClientOptions = { fleetId: string; name?: string; fleetMaster?: string; baseUrl: string; clientId: string; clientSecret: string; apiKey: string; secure?: boolean; logCurl?: boolean; logResponse?: boolean; store?: Store; onLog?: (...args: any[]) => void; }; export type ClientError = { formattedError: { status?: number; data?: any; message?: string; }; originalError: any; }; export type Client = AxiosInstance & { signInWithPassword: (username: string, password: string) => Promise<Token>; clientOptions: ClientOptions; };