mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-17 09:59:40 +02:00
Extract feedback, analytics, and AI modules from mana-core-auth into standalone mana-analytics service (Hono + Bun, Port 3064). New service (services/mana-analytics/): - User feedback CRUD with voting - AI-powered feedback title generation via mana-llm - Simplified from DuckDB analytics to pure PostgreSQL - ~550 LOC Removed from mana-core-auth: - feedback/ module (6 files) - analytics/ module (4 files) - ai/ module (3 files) - db/schema/feedback.schema.ts mana-core-auth now contains ONLY pure auth: - Better Auth (JWT, Sessions, 2FA, Passkeys, OIDC, Magic Links) - Organizations/Guilds (membership management) - API Keys, Security, Me (GDPR), Health, Metrics - Ready for Phase 5: Hono rewrite Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
43 lines
917 B
TypeScript
43 lines
917 B
TypeScript
import { HTTPException } from 'hono/http-exception';
|
|
|
|
export class BadRequestError extends HTTPException {
|
|
constructor(message: string) {
|
|
super(400, { message });
|
|
}
|
|
}
|
|
|
|
export class UnauthorizedError extends HTTPException {
|
|
constructor(message = 'Unauthorized') {
|
|
super(401, { message });
|
|
}
|
|
}
|
|
|
|
export class ForbiddenError extends HTTPException {
|
|
constructor(message = 'Forbidden') {
|
|
super(403, { message });
|
|
}
|
|
}
|
|
|
|
export class NotFoundError extends HTTPException {
|
|
constructor(message = 'Not found') {
|
|
super(404, { message });
|
|
}
|
|
}
|
|
|
|
export class ConflictError extends HTTPException {
|
|
constructor(message = 'Conflict') {
|
|
super(409, { message });
|
|
}
|
|
}
|
|
|
|
export class InsufficientCreditsError extends HTTPException {
|
|
constructor(
|
|
public readonly required: number,
|
|
public readonly available: number
|
|
) {
|
|
super(402, {
|
|
message: 'Insufficient credits',
|
|
cause: { required, available },
|
|
});
|
|
}
|
|
}
|