@dudousxd/nestjs-authz-codegen 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @dudousxd/nestjs-authz-codegen
2
2
 
3
+ ## 0.3.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#70](https://github.com/DavideCarvalho/nestjs-authz/pull/70) [`416f0bd`](https://github.com/DavideCarvalho/nestjs-authz/commit/416f0bd7d9340f6f3314017d4925cb89834c4342) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - README fixes: the codegen README no longer describes the removed `PostPolicy` → `Post` name guess and lists `@PolicyFor` among the names that must not be aliased; the core README covers the dropped `DecisionProvider` deny message and the expected boot error under `unannotated: 'allow'`.
8
+
3
9
  ## 0.3.0
4
10
 
5
11
  ### Minor Changes
package/README.md CHANGED
@@ -51,7 +51,7 @@ How each form maps to a client ability:
51
51
 
52
52
  | Decorator | Client ability |
53
53
  | --- | --- |
54
- | `@Can(PostPolicy, 'update', byId(Post))` | `update` on `Post` (from `byId`, else the policy's `@PolicyFor` link, else `PostPolicy` → `Post`) |
54
+ | `@Can(PostPolicy, 'update', byId(Post))` | `update` on `Post` (from `byId`, else the policy's `@PolicyFor` link; with neither, no resource) |
55
55
  | `@Can(PermissionPolicy, 'has', permission('posts.publish'))`, `@Permission('posts.publish')` | `posts.publish` |
56
56
  | `@Can(GatePolicy, 'allows', ability('access-admin'))` | `access-admin` |
57
57
  | `@Roles(...)`, `@Can(RolePolicy, ...)` | none (roles are not client abilities) |
@@ -120,7 +120,7 @@ async can(@Body() body: { ability: string; resource?: { type: string; id?: strin
120
120
 
121
121
  ## Caveats
122
122
 
123
- Decorators are discovered by their **canonical names** — import `@Can` / `@Policy` under their real
124
- names. An aliased import (`import { Can as Authorize } from '@dudousxd/nestjs-authz'`) is NOT
125
- discovered, because codegen matches the decorator identifier (`Can` / `Policy`) syntactically and
126
- does not resolve aliases.
123
+ Decorators are discovered by their **canonical names** — import `@Can`, `@Permission`, `@Policy`
124
+ and `@PolicyFor` under their real names. An aliased import
125
+ (`import { Can as Authorize } from '@nestjs/authorization'`) is NOT discovered, because codegen
126
+ matches the decorator identifier syntactically and does not resolve aliases.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dudousxd/nestjs-authz-codegen",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "nestjs-codegen extension for @dudousxd/nestjs-authz — discovers @Can abilities and emits a typed can() into your generated client.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -53,7 +53,7 @@
53
53
  "typescript": "5.9.3",
54
54
  "vitest": "3.2.7",
55
55
  "@dudousxd/nestjs-authz-client": "^0.2.2",
56
- "@dudousxd/nestjs-authz": "^0.9.1"
56
+ "@dudousxd/nestjs-authz": "^0.9.2"
57
57
  },
58
58
  "engines": {
59
59
  "node": ">=22"