@vreippainen/hevy-mcp-server
Version:
A MCP server for Hevy
63 lines (62 loc) • 2.5 kB
TypeScript
/**
* Service for interacting with the Hevy API
*/
import { ExerciseTemplate, Routine, Workout, PaginationParams } from '../types/index.js';
/**
* Base response type containing pagination information
*/
interface PaginatedResponse {
page: number;
pageCount: number;
}
/**
* Response type for workouts with pagination
*/
interface WorkoutsResponse extends PaginatedResponse {
workouts: Workout[];
}
/**
* Response type for routines with pagination
*/
interface RoutinesResponse extends PaginatedResponse {
routines: Routine[];
}
/**
* Response type for exercise templates with pagination
*/
interface ExercisesResponse extends PaginatedResponse {
exercises: ExerciseTemplate[];
}
/**
* Get workouts from the Hevy API
* @param {PaginationParams} [params={}] - Pagination parameters
* @param {number} [params.page] - Page number (must be greater than 0)
* @param {number} [params.pageSize] - Page size (must be between 1 and 10)
* @returns {Promise<WorkoutsResponse>} - Promise resolving to workouts and pagination info
* @throws {Error} - If page or pageSize validation fails
*/
export declare const getWorkouts: (params?: PaginationParams) => Promise<WorkoutsResponse>;
/**
* Get routines from the Hevy API
* @param {PaginationParams} [params={}] - Pagination parameters
* @param {number} [params.page] - Page number (must be greater than 0)
* @param {number} [params.pageSize] - Page size (must be between 1 and 10)
* @returns {Promise<RoutinesResponse>} - Promise resolving to routines and pagination info
* @throws {Error} - If page or pageSize validation fails
*/
export declare const getRoutines: (params?: PaginationParams) => Promise<RoutinesResponse>;
/**
* Get exercise templates from the Hevy API
* @param {PaginationParams} [params={}] - Pagination parameters
* @param {number} [params.page] - Page number (must be greater than 0)
* @param {number} [params.pageSize] - Page size (must be between 1 and 10)
* @returns {Promise<ExercisesResponse>} - Promise resolving to exercise templates and pagination info
* @throws {Error} - If page or pageSize validation fails
*/
export declare const getExercises: (params?: PaginationParams) => Promise<ExercisesResponse>;
declare const _default: {
getWorkouts: (params?: PaginationParams) => Promise<WorkoutsResponse>;
getRoutines: (params?: PaginationParams) => Promise<RoutinesResponse>;
getExercises: (params?: PaginationParams) => Promise<ExercisesResponse>;
};
export default _default;