import { DocumentNode } from 'graphql'; import { AxiosInstance } from 'axios'; interface Config { baseUrl: string; tenantId?: string; graphqlPath?: string; middlewares?: Middleware[]; logger?: (instance: AxiosInstance) => void; axiosConfig?: { timeout?: number; headers?: Record; keepAlive?: boolean; }; } interface AuthConfig { tenantId?: string; credential?: Credential; } interface RequestOptions { /** Request timeout in milliseconds */ timeout?: number; /** Enable HTTP keep-alive for this request */ keepAlive?: boolean; /** Additional headers for this request */ headers?: Record; } interface Credential { client_secret: string, grant_type: string, client_id: string, username: string, password: string } interface Middleware { before?: (command: Command) => Promise; after?: (command: Command, response: any) => Promise; onError?: (command: Command, error: Error) => Promise; } interface Command { input: TInput; metadata: { commandName: string; path: string; method: 'GET' | 'POST' | 'PUT' | 'DELETE'; }; execute?: (config: Config) => Promise; executeGQL?: (config: Config) => Promise; } interface GraphQLRequest { command: string | DocumentNode; tenantId?: string; variables?: any; operationName?: string; } export type { AuthConfig as A, Config as C, GraphQLRequest as G, Middleware as M, RequestOptions as R, Command as a };