import { AxiosRequestConfig } from 'axios' import type * as EntityManagerClient from '@rlvt/entity-manager-openapi-client' export type getClientOptions = { type: ClientType, clientId: string, gatewayEndpoint: string authenticationType: AuthenticationType, onAuthenticationRequired: (options: { currentTokens: Partial, options: getClientOptions, request: AxiosRequestConfig, client: EntityManagerClient.default }) => Promise, onAuthenticationFailure: (error: Error) => void, onAuthenticationSuccess: (profile: EntityManagerClient.ReturnForMethod<'User', 'list'>[number]) => void } export enum ClientType { DATASOURCES = 'DATASOURCES', ENTITIES = 'ENTITIES', WORKFLOWS = 'WORKFLOWS', CONTENTS = 'CONTENTS' } export type Tokens = { accessToken: string refreshToken: string } type PasswordGrantType = { type: 'password' email: string password: string } type TokenGrantType = { type: 'refresh_token', refreshToken: string } export type AuthenticationType = PasswordGrantType | TokenGrantType