feat(authz): generate Permission and Role union types

Emits sorted TS unions from the merged catalog so a typo in
can(ctx, "post:wrtie") is a compile-time error. Uses JSON.stringify
for string-literal escaping (not manual backslash/quote replace) so
role names containing raw newlines still produce valid TypeScript;
role names are not regex-validated like permission ids, so this
matters for the raw mergeCatalogs path.
This commit is contained in:
2026-08-04 21:19:04 +05:30
parent 91e5c6e0c5
commit 726b8a7d24
4 changed files with 61 additions and 0 deletions
+1
View File
@@ -505,6 +505,7 @@
"expandRoles",
"filterAuthorized",
"filterCan",
"generatePermissionTypes",
"guardPermission",
"hasRole",
"memoryAuditSink",