UNPKG

@re-auth/http-adapters

Version:

HTTP protocol adapters for ReAuth - framework-agnostic integration with Express, Fastify, and Hono

44 lines (43 loc) 1.41 kB
// src/types.ts var HttpAdapterError = class extends Error { constructor(message, statusCode = 500, code = "INTERNAL_ERROR", details) { super(message); this.statusCode = statusCode; this.code = code; this.details = details; this.name = "HttpAdapterError"; } }; var ValidationError = class extends HttpAdapterError { constructor(message, details) { super(message, 400, "VALIDATION_ERROR", details); this.name = "ValidationError"; } }; var AuthenticationError = class extends HttpAdapterError { constructor(message, details) { super(message, 401, "AUTHENTICATION_ERROR", details); this.name = "AuthenticationError"; } }; var AuthorizationError = class extends HttpAdapterError { constructor(message, details) { super(message, 403, "AUTHORIZATION_ERROR", details); this.name = "AuthorizationError"; } }; var NotFoundError = class extends HttpAdapterError { constructor(message, details) { super(message, 404, "NOT_FOUND", details); this.name = "NotFoundError"; } }; var RateLimitError = class extends HttpAdapterError { constructor(message, details) { super(message, 429, "RATE_LIMIT_EXCEEDED", details); this.name = "RateLimitError"; } }; export { AuthenticationError, AuthorizationError, HttpAdapterError, NotFoundError, RateLimitError, ValidationError }; //# sourceMappingURL=types.js.map //# sourceMappingURL=types.js.map