import 'reflect-metadata'; import { AxiosInstance } from 'axios'; import { AuthInfo, TenantUserInfo } from '../utilities/authUtils'; import { CustomFunctionLogger } from './logger'; import { AIService } from './ai'; import { AttachmentService } from './attachment'; import { ConfigurationService } from './configuration'; import { DataHelperService } from './dataHelper'; import { GraphQLService } from './graphql'; import { FnDataServices } from '../types'; /** * What `new MexClient(context)` accepts. In practice `context` is the handler argument itself: * - a request handler's input (carries `headers` + `userInfo`) — the isolation path, or * - a `SharedResourcesThunk`'s `Utilities` bag (carries `services`, no `headers`) — the wrap path. * A raw `AuthInfo` (`{ token, baseUrl, userInfo, staticToken }`) is also accepted for callers outside * a handler. */ export type MexContext = { headers?: { [key: string]: any; }; userInfo?: TenantUserInfo; services?: FnDataServices; logger?: CustomFunctionLogger; } | AuthInfo; /** * Explicit, per-context accessor for the platform services — the successor to reaching into * `input.services.*`. Construct it from the handler argument: * * const { apiService, graphqlService } = new MexClient(context) * await apiService.get('/abc') * * Two construction paths, chosen by what the context carries: * - **headers / raw auth present** → resolve a FRESH `ServiceController` graph (isolated per call, * no shared mutable state). This is the request-handler path. * - **only `services` present** (a thunk's `Utilities` bag — has no `headers`/token) → wrap the * already-built, admin-token services rather than re-deriving auth. */ export declare class MexClient { readonly apiService: AxiosInstance; readonly staticApiService?: AxiosInstance; readonly graphqlService: GraphQLService; readonly attachmentService: AttachmentService; readonly configurationService: ConfigurationService; readonly dataHelperService: DataHelperService; readonly aiService: AIService; constructor(context: MexContext); } //# sourceMappingURL=mexClient.d.ts.map