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:
1 parent
91e5c6e0c5
commit
726b8a7d24
4 files changed
+61
No files matched your search
@@ -167,3 +167,4 @@ export type {
|
||||
SubjectAssignments,
|
||||
} from "./types.ts";
|
||||
export type { AuthorizeDecisionOptions } from "./advanced.ts";
|
||||
export { generatePermissionTypes } from "./codegen.ts";
|
||||
Reference in new issue
Block a user