mcp-quiz-server
Version:
🧠AI-Powered Quiz Management via Model Context Protocol (MCP) - Create, manage, and take quizzes directly from VS Code, Claude, and other AI agents.
51 lines (50 loc) • 1.89 kB
JavaScript
;
/**
* @fileoverview Quiz Repository Interface - Domain Layer
* @version 1.0.0
* @since 2025-07-29
* @lastUpdated 2025-07-29
* @module IQuizRepository Interface
* @description Repository interface for Quiz aggregate root following
* Repository pattern and Dependency Inversion Principle.
* Defines the contract for quiz data access without implementation details.
* @contributors Claude Code Agent
* @dependencies Quiz domain entity, QuizId value object
* @requirements REQ-ARCH-001 (Clean Architecture Domain Layer)
* @testCoverage Unit tests for interface contracts via mock implementations
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.RepositoryConnectionError = exports.DuplicateQuizError = exports.QuizNotFoundError = exports.RepositoryError = void 0;
/**
* Repository Error Types
*/
class RepositoryError extends Error {
constructor(message, code, cause) {
super(message);
this.code = code;
this.cause = cause;
this.name = 'RepositoryError';
}
}
exports.RepositoryError = RepositoryError;
class QuizNotFoundError extends RepositoryError {
constructor(quizId) {
super(`Quiz with ID ${quizId} not found`, 'QUIZ_NOT_FOUND');
this.name = 'QuizNotFoundError';
}
}
exports.QuizNotFoundError = QuizNotFoundError;
class DuplicateQuizError extends RepositoryError {
constructor(title) {
super(`Quiz with title "${title}" already exists`, 'DUPLICATE_QUIZ');
this.name = 'DuplicateQuizError';
}
}
exports.DuplicateQuizError = DuplicateQuizError;
class RepositoryConnectionError extends RepositoryError {
constructor(cause) {
super('Failed to connect to data store', 'CONNECTION_ERROR', cause);
this.name = 'RepositoryConnectionError';
}
}
exports.RepositoryConnectionError = RepositoryConnectionError;