UNPKG

@vulog/aima-client

Version:

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

41 lines (37 loc) 989 B
import { AxiosInstance } from 'axios'; type Token = { accessToken: string; refreshToken: string; }; type Store = { getToken: () => Promise<Token | undefined>; setToken: (token: Token) => Promise<void>; }; 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; }; type ClientError = { formattedError: { status?: number; data?: any; message?: string; }; originalError: any; }; type Client = AxiosInstance & { signInWithPassword: (username: string, password: string) => Promise<Token>; clientOptions: ClientOptions; }; declare const getClient: (options: ClientOptions) => Client; export { type Client, type ClientError, type ClientOptions, type Store, type Token, getClient };