@shivaedev/access 0.3.5 → 0.4.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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.0 - 2026-11-03
4
+
5
+ ### Breaking
6
+
7
+ - Import `AssignRoles` and `LastRoleAssigner` from `@shivaedev/identity/roles.ts` instead of `@shivaedev/access/roles.ts`, adding `@shivaedev/identity` as a direct dependency when needed. The access module is removed without a compatibility alias; access retains pure grant evaluation.
8
+
9
+ ## 0.3.6 - 2026-11-02
10
+
11
+ ### Changed
12
+
13
+ - Update `@shivaedev/errors` from 0.4.1 to 0.5.0.
14
+
3
15
  ## 0.3.5 - 2026-11-01
4
16
 
5
17
  ### Changed
package/README.md CHANGED
@@ -29,7 +29,7 @@ Both checks return `true`: the member owns the first record, and the operator ho
29
29
  A permission names the domain and action, such as `users.read`, `roles.assign` or `jobs.read`. `permission(name)` declares the default strength and exposes a separate override value as `.any`. Each role receives an explicit list of grants. There are no wildcard or prefix grants. An `any` grant covers an `own` check for the same name; an `own` grant never covers an `any` check. The resolved list still contains only the explicitly declared grants.
30
30
 
31
31
  ```ts
32
- import { AssignRoles } from "@shivaedev/access/roles.ts";
32
+ import { AssignRoles } from "@shivaedev/identity/roles.ts";
33
33
  const ReadJobs = permission("jobs.read");
34
34
  const Operator = role("operator", [ReadUsers.any, AssignRoles, ReadJobs]);
35
35
  const Guest = role("guest", []);
@@ -38,7 +38,7 @@ const Access = roleSet(Member, Operator, Guest);
38
38
 
39
39
  Each role name is declared once in a role set, and `roleSet` refuses a repeated literal name with a compile error. A name typed only as `string` escapes that check; when it repeats a declared name, every check and `resolve` use the first declaration's grants. Library code that takes an application's role set as a parameter types it as `AccessPolicy<TName>` from `@shivaedev/access/roleSet.ts`.
40
40
 
41
- Keep these declarations in application code. The package provides no persistence or runtime role editor.
41
+ Keep these declarations in application code. The package provides no persistence or runtime role editor. Add `@shivaedev/identity` for the shared `AssignRoles` permission and role-management services.
42
42
 
43
43
  ### Store and decode the role string
44
44
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shivaedev/access",
3
- "version": "0.3.5",
3
+ "version": "0.4.0",
4
4
  "description": "Browser-safe role declarations and permission checks for Effect applications",
5
5
  "homepage": "https://github.com/ShivaeDev/platform/tree/main/packages/access#readme",
6
6
  "bugs": {
@@ -42,11 +42,11 @@
42
42
  "README.md"
43
43
  ],
44
44
  "dependencies": {
45
- "@shivaedev/errors": "0.4.1"
45
+ "@shivaedev/errors": "0.6.0"
46
46
  },
47
47
  "devDependencies": {
48
- "@shivaedev/quality": "0.53.1",
49
- "@shivaedev/test-story": "0.31.4",
48
+ "@shivaedev/quality": "0.57.0",
49
+ "@shivaedev/test-story": "0.35.0",
50
50
  "@types/node": "24.19.2",
51
51
  "effect": "4.0.6",
52
52
  "typescript": "7.0.2",
package/dist/roles.d.ts DELETED
@@ -1,16 +0,0 @@
1
- import { Schema } from "effect";
2
- export declare const AssignRoles: {
3
- readonly any: {
4
- readonly name: "roles.assign";
5
- readonly strength: "any";
6
- };
7
- readonly name: "roles.assign";
8
- readonly strength: "own";
9
- };
10
- declare const LastRoleAssigner_base: Schema.Class<LastRoleAssigner, Schema.TaggedStruct<"LastRoleAssigner", {
11
- readonly userId: Schema.String;
12
- }>, import("effect/Cause").YieldableError>;
13
- export declare class LastRoleAssigner extends LastRoleAssigner_base {
14
- }
15
- export {};
16
- //# sourceMappingURL=roles.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"roles.d.ts","sourceRoot":"","sources":["../src/roles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,eAAO,MAAM,WAAW;;;;;;;CAA6B,CAAC;;;;AACtD,qBAAa,gBAAiB,SAAQ,qBAAqF;CAAG"}
package/dist/roles.js DELETED
@@ -1,6 +0,0 @@
1
- import { Schema } from "effect";
2
- import { permission } from "#permission.ts";
3
- export const AssignRoles = permission("roles.assign");
4
- export class LastRoleAssigner extends Schema.TaggedError()("LastRoleAssigner", { userId: Schema.String }) {
5
- }
6
- //# sourceMappingURL=roles.js.map
package/dist/roles.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"roles.js","sourceRoot":"","sources":["../src/roles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CAAC,cAAc,CAAC,CAAC;AACtD,MAAM,OAAO,gBAAiB,SAAQ,MAAM,CAAC,WAAW,EAAoB,CAAC,kBAAkB,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC;CAAG"}
package/src/roles.ts DELETED
@@ -1,5 +0,0 @@
1
- import { Schema } from "effect";
2
- import { permission } from "#permission.ts";
3
-
4
- export const AssignRoles = permission("roles.assign");
5
- export class LastRoleAssigner extends Schema.TaggedError<LastRoleAssigner>()("LastRoleAssigner", { userId: Schema.String }) {}