managarten/services/mana-subscriptions/src/routes/internal.ts
Till JS 8ccf8ff818 chore: misc fixes, new services, lockfile cleanup
Assorted changes from recent sessions:
- .gitignore: add mana-sync binary, Forgejo data
- chat/web: add isSidebarMode to navigation store
- clock/web: fix alarm page markup
- contacts/mukke/presi/questions: add svelte.config.js aliases
- context/web: add missing dependency
- manacore/landing: update pricing page
- manacore/web + todo/web: update mana dashboard pages
- planta/web: fix dashboard layout
- pnpm-lock.yaml: cleanup after backend removals
- docs/APP_GAP_ANALYSIS.md: new gap analysis doc
- services/mana-analytics: add Dockerfile
- services/mana-subscriptions: new Go subscription service

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 10:27:35 +01:00

19 lines
654 B
TypeScript

/**
* Internal routes — service-to-service (X-Service-Key auth)
* Used by guilds service to check plan limits.
*/
import { Hono } from 'hono';
import type { SubscriptionsService } from '../services/subscriptions';
export function createInternalRoutes(subscriptionsService: SubscriptionsService) {
return new Hono()
.get('/plan-limits/:userId', async (c) => {
const limits = await subscriptionsService.getUserPlanLimits(c.req.param('userId'));
return c.json(limits);
})
.get('/subscription/:userId', async (c) => {
const sub = await subscriptionsService.getCurrentSubscription(c.req.param('userId'));
return c.json(sub);
});
}