@zap-studio/permit 0.2.0 → 0.2.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.
Files changed (2) hide show
  1. package/CHANGELOG.md +39 -33
  2. package/package.json +5 -5
package/CHANGELOG.md CHANGED
@@ -1,57 +1,63 @@
1
1
  # @zap-studio/permit
2
2
 
3
- ## 0.2.0
3
+ ## 0.2.1
4
4
 
5
- ### Minor Changes
5
+ ### Patch Changes
6
6
 
7
- - f0f503e: Make policy evaluation async by default.
7
+ - 5ea3d3b: Updated dependencies.
8
+ - @zap-studio/validation@0.3.1
8
9
 
9
- `policy.can(...)` now returns a `Promise<boolean>` and must be awaited.
10
10
 
11
- `createPolicy` now uses async-safe Standard Schema validation internally, so resource schemas with async validation are supported.
11
+ ## 0.2.0
12
12
 
13
- `mergePolicies` and `mergePoliciesAny` are also async through the shared `Policy` interface.
13
+ ### Changed
14
14
 
15
- ### Patch Changes
15
+ - f0f503e: Made policy evaluation asynchronous by default.
16
16
 
17
- - Updated dependencies [f75b984]
18
- - @zap-studio/validation@0.3.0
17
+ ### Breaking Changes
18
+
19
+ - f0f503e: `policy.can(...)` now returns `Promise<boolean>`.
20
+ - f0f503e: `createPolicy()` now uses async-safe Standard Schema validation for resource schemas (including async resource schemas); this is not a separate `Policy` schema API.
21
+ - f0f503e: The `Policy` interface changed so `can()` is async, and `mergePolicies`/`mergePoliciesAny` are async accordingly.
22
+ - Action required: callers must `await policy.can(...)` and handle `mergePolicies`/`mergePoliciesAny` as async operations; also account for async-safe resource schema validation in `createPolicy()`.
23
+
24
+ ### Dependencies
25
+
26
+ - f75b984: Updated dependency `@zap-studio/validation` to `0.3.0`.
19
27
 
20
28
  ## 0.1.3
21
29
 
22
- ### Patch Changes
30
+ ### Dependencies
23
31
 
24
- - Updated dependencies [e4542bb]
25
- - @zap-studio/validation@0.2.1
32
+ - e4542bb: Updated dependency `@zap-studio/validation` to `0.2.1`.
26
33
 
27
34
  ## 0.1.2
28
35
 
29
- ### Patch Changes
30
-
31
- - 2de8183: Add a reusable synchronous Standard Schema validator helper in `@zap-studio/validation` and refactor `@zap-studio/permit` to use it for resource schema validation in `createPolicy`.
32
- - Updated dependencies [2de8183]
33
- - @zap-studio/validation@0.2.0
36
+ ### Changed
34
37
 
35
- ## 0.1.1
38
+ - 2de8183: Adopted shared synchronous Standard Schema validator utilities from `@zap-studio/validation` for resource schema validation in `createPolicy`.
36
39
 
37
- ### Patch Changes
40
+ ### Dependencies
38
41
 
39
- - 907d903: Add runtime resource validation and fail-closed behavior, including denying access when merges are called with no policies.
42
+ - 2de8183: Updated dependency `@zap-studio/validation` to `0.2.0`.
40
43
 
41
- ## 0.1.0
44
+ ## 0.1.1
42
45
 
43
- ### Minor Changes
46
+ ### Fixed
44
47
 
45
- - 0627885: Initial release of @zap-studio/permit - a type-safe, declarative authorization library for TypeScript.
48
+ - 907d903: Added runtime resource validation and fail-closed behavior, including deny-by-default when merges are invoked with no policies.
46
49
 
47
- Features:
50
+ ## 0.1.0
48
51
 
49
- - Declarative policy creation with `createPolicy()`
50
- - Policy rules: `allow()`, `deny()`, and `when()` for conditional access
51
- - Condition combinators: `and()`, `or()`, `not()`, and `has()`
52
- - Role-based access control with `hasRole()` and role hierarchies
53
- - Policy merging with `mergePolicies()` (deny-overrides) and `mergePoliciesAny()` (allow-overrides)
54
- - Standard Schema support (Zod, Valibot, ArkType, etc.)
55
- - Full TypeScript support with type inference
56
- - `PolicyError` class for authorization errors
57
- - `assertNever()` helper for exhaustive type checking
52
+ ### Added
53
+
54
+ - 0627885: Initial release of `@zap-studio/permit`.
55
+ - Declarative policy creation with `createPolicy()`.
56
+ - Policy rules: `allow()`, `deny()`, and `when()` for conditional access.
57
+ - Condition combinators: `and()`, `or()`, `not()`, and `has()`.
58
+ - Role-based access control with `hasRole()` and role hierarchies.
59
+ - Policy merging with `mergePolicies()` (deny-overrides) and `mergePoliciesAny()` (allow-overrides).
60
+ - Standard Schema support (Zod, Valibot, ArkType, and more).
61
+ - Full TypeScript type inference support.
62
+ - `PolicyError` for authorization failures.
63
+ - `assertNever()` for exhaustive checks.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zap-studio/permit",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "private": false,
@@ -35,7 +35,7 @@
35
35
  ],
36
36
  "dependencies": {
37
37
  "@standard-schema/spec": "^1.1.0",
38
- "@zap-studio/validation": "0.3.0"
38
+ "@zap-studio/validation": "0.3.1"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@types/node": "^25.0.2",
@@ -43,9 +43,9 @@
43
43
  "tsdown": "^0.18.0",
44
44
  "typescript": "^5.9.3",
45
45
  "vitest": "^4.0.18",
46
+ "@zap-studio/vitest-config": "0.0.0",
46
47
  "@zap-studio/typescript-config": "0.0.0",
47
- "@zap-studio/tsdown-config": "0.0.0",
48
- "@zap-studio/vitest-config": "0.0.0"
48
+ "@zap-studio/tsdown-config": "0.0.0"
49
49
  },
50
50
  "exports": {
51
51
  ".": "./dist/index.mjs",
@@ -59,7 +59,7 @@
59
59
  "types": "./dist/index.d.mts",
60
60
  "scripts": {
61
61
  "build": "tsdown --config tsdown.config.ts",
62
- "check": "tsc --noEmit",
62
+ "typecheck": "tsc --noEmit",
63
63
  "test": "vitest run",
64
64
  "test:watch": "vitest --watch"
65
65
  }