/** * Internal Moodle Web Services API client. * * All Moodle API calls MUST go through this class. Tool handlers * must never call fetch() against Moodle directly — that keeps * auth, error handling, and retry logic centralized. */ export interface MoodleAPICall { /** Web service function name, e.g. "core_course_get_courses" */ wsfunction: string; /** Query params to append to the request (courseid, userid, etc.) */ params?: Record; /** Expected response key in the JSON body (Moodle wraps responses) */ responseKey?: string; } export interface MoodleError { exception?: string; errorcode?: string; message?: string; debuginfo?: string; } export declare class MoodleClient { private baseUrl; private token; constructor(baseUrl: string, token: string); getBaseUrl(): string; /** * Execute a Moodle Web Services API call. * Returns the parsed response body (already unwrapped from Moodle's envelope). */ call(call: MoodleAPICall): Promise; private buildUrl; } export declare class MoodleAPIError extends Error { readonly httpStatus?: number; readonly moodleError?: MoodleError; constructor(message: string, httpStatus?: number, moodleError?: MoodleError); } //# sourceMappingURL=client.d.ts.map