@dudousxd/nestjs-authz-codegen 0.3.0 → 1.0.0
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 +13 -0
- package/README.md +5 -5
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @dudousxd/nestjs-authz-codegen
|
|
2
2
|
|
|
3
|
+
## 1.0.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`750a6b3`](https://github.com/DavideCarvalho/nestjs-authz/commit/750a6b3f80deea3803dec8df5f9f8cf67a046ac1)]:
|
|
8
|
+
- @dudousxd/nestjs-authz@0.10.0
|
|
9
|
+
|
|
10
|
+
## 0.3.1
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [#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'`.
|
|
15
|
+
|
|
3
16
|
## 0.3.0
|
|
4
17
|
|
|
5
18
|
### 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
|
|
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
|
|
124
|
-
|
|
125
|
-
|
|
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
|
+
"version": "1.0.0",
|
|
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": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"CHANGELOG.md"
|
|
39
39
|
],
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"@dudousxd/nestjs-authz": ">=0.
|
|
41
|
+
"@dudousxd/nestjs-authz": ">=0.10.0",
|
|
42
42
|
"@dudousxd/nestjs-authz-client": ">=0.0.0",
|
|
43
43
|
"@dudousxd/nestjs-codegen": ">=0.4.0"
|
|
44
44
|
},
|
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
"ts-morph": "28.0.0",
|
|
53
53
|
"typescript": "5.9.3",
|
|
54
54
|
"vitest": "3.2.7",
|
|
55
|
-
"@dudousxd/nestjs-authz
|
|
56
|
-
"@dudousxd/nestjs-authz": "^0.
|
|
55
|
+
"@dudousxd/nestjs-authz": "^0.10.0",
|
|
56
|
+
"@dudousxd/nestjs-authz-client": "^0.2.2"
|
|
57
57
|
},
|
|
58
58
|
"engines": {
|
|
59
59
|
"node": ">=22"
|