Skip to content
TypeWire

@tahanabavi/type-permission

v0.1.0

Framework-less, dependency-free capability permissions: one shared bit map, evaluated identically on client and server, with layered resolution, codecs, a lock file and contract-linkable requirements.

A transport endpoint may carry an inline requirement; nothing changes for endpoints without one:

ts
deleteMessage: {
method: "DELETE", path: "/messages/:id",
request, response,
permission: { require: ["chat.MANAGE_MESSAGES"] }, // ← the flag, written once
}

P.authorize(perms, endpoint.permission) returns a decision rich enough to build both a 403 body and an audit-log line — the same evaluation the client uses to pre-block the call and grey out the button. The NestJS guard that reads this key lives in @tahanabavi/typewire-nestjs, never here.