feat(shared-hono): add credit client for Hono backends

Add credits.ts to @manacore/shared-hono as replacement for
CreditClientService from @mana-core/nestjs-integration.

Exports: getBalance, validateCredits, consumeCredits, refundCredits
Calls mana-credits service via MANA_CREDITS_URL + X-Service-Key.

Same API surface as the NestJS version but as pure functions
instead of an @Injectable() service class.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Till JS 2026-03-28 10:13:34 +01:00
parent 87d7966b0f
commit 3fca0de680
3 changed files with 129 additions and 1 deletions

View file

@ -12,7 +12,8 @@
"./db": "./src/db.ts",
"./health": "./src/health.ts",
"./admin": "./src/admin.ts",
"./error": "./src/error.ts"
"./error": "./src/error.ts",
"./credits": "./src/credits.ts"
},
"scripts": {
"type-check": "tsc --noEmit"