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.
67 lines (66 loc) • 2.6 kB
JavaScript
;
/**
* @fileoverview Transport Service Interface - Clean Architecture Infrastructure
* @version 1.0.0
* @since 2025-07-30
* @lastUpdated 2025-07-30
* @module ITransportService
* @description Core transport service interface for Clean Architecture integration.
* Provides secure, authenticated, and monitored transport layer.
* @contributors Claude Code Agent
* @dependencies Clean Architecture Foundation
* @requirements SECURITY_001 (Transport Layer Integration)
* @testCoverage Security and integration tests required
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.MemoryExhaustionError = exports.RateLimitExceededError = exports.PayloadTooLargeError = exports.AuthorizationError = exports.AuthenticationError = exports.TransportSecurityError = void 0;
/**
* Transport Security Error Types
*/
class TransportSecurityError extends Error {
constructor(message, code, context) {
super(message);
this.code = code;
this.context = context;
this.name = 'TransportSecurityError';
}
}
exports.TransportSecurityError = TransportSecurityError;
class AuthenticationError extends TransportSecurityError {
constructor(message, context) {
super(message, 'AUTHENTICATION_FAILED', context);
this.name = 'AuthenticationError';
}
}
exports.AuthenticationError = AuthenticationError;
class AuthorizationError extends TransportSecurityError {
constructor(message, context) {
super(message, 'AUTHORIZATION_DENIED', context);
this.name = 'AuthorizationError';
}
}
exports.AuthorizationError = AuthorizationError;
class PayloadTooLargeError extends TransportSecurityError {
constructor(size, limit) {
super(`Payload size ${size} exceeds limit ${limit}`, 'PAYLOAD_TOO_LARGE', { size, limit });
this.name = 'PayloadTooLargeError';
}
}
exports.PayloadTooLargeError = PayloadTooLargeError;
class RateLimitExceededError extends TransportSecurityError {
constructor(limit, window) {
super(`Rate limit of ${limit} requests per ${window} exceeded`, 'RATE_LIMIT_EXCEEDED', {
limit,
window,
});
this.name = 'RateLimitExceededError';
}
}
exports.RateLimitExceededError = RateLimitExceededError;
class MemoryExhaustionError extends TransportSecurityError {
constructor(usage, limit) {
super(`Memory usage ${usage} exceeds limit ${limit}`, 'MEMORY_EXHAUSTION', { usage, limit });
this.name = 'MemoryExhaustionError';
}
}
exports.MemoryExhaustionError = MemoryExhaustionError;