@aooth/arbac 0.1.57 → 0.1.59

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/dist/index.cjs CHANGED
@@ -335,7 +335,7 @@ function canOptimizeToIn(scopes) {
335
335
  * Other controls only support boolean gates in v1; supplying a whitelist
336
336
  * for them throws from {@link unionControlsPolicy}.
337
337
  */
338
- const WHITELISTABLE_CONTROLS = new Set(["$with", "$groupBy"]);
338
+ const WHITELISTABLE_CONTROLS = /* @__PURE__ */ new Set(["$with", "$groupBy"]);
339
339
  /**
340
340
  * Union per-role `controls` policies. Additive RBAC semantics: more roles =
341
341
  * broader access, mirroring how `mergeScopeFilters` and `unionProjections`
@@ -420,7 +420,7 @@ function unionControlsPolicy(scopes) {
420
420
  */
421
421
  function intersectControlsPolicy(a, b) {
422
422
  const result = {};
423
- const keys = new Set([...Object.keys(a), ...Object.keys(b)]);
423
+ const keys = /* @__PURE__ */ new Set([...Object.keys(a), ...Object.keys(b)]);
424
424
  for (const key of keys) {
425
425
  const av = key in a ? a[key] : true;
426
426
  const bv = key in b ? b[key] : true;
package/dist/index.d.cts CHANGED
@@ -1,6 +1,5 @@
1
1
  import { TArbacRole, TArbacRule } from "@aooth/arbac-core";
2
2
  export * from "@aooth/arbac-core";
3
-
4
3
  //#region src/define-role.d.ts
5
4
  /**
6
5
  * A privilege function produces an array of rules when called.
@@ -45,7 +44,7 @@ interface RoleBuilder<TUserAttrs, TScope> {
45
44
  * pin. Runtime storage type-erases through a cast.
46
45
  */
47
46
  use(...privileges: TPrivilegeFunction<TUserAttrs, TScope>[]): RoleBuilder<TUserAttrs, TScope>;
48
- use<TScopes extends readonly unknown[]>(...privileges: { [K in keyof TScopes]: TPrivilegeFunction<TUserAttrs, TScopes[K]> }): RoleBuilder<TUserAttrs, TScope>;
47
+ use<TScopes extends readonly unknown[]>(...privileges: { [K in keyof TScopes]: TPrivilegeFunction<TUserAttrs, TScopes[K]>; }): RoleBuilder<TUserAttrs, TScope>;
49
48
  /**
50
49
  * Finalize and return a plain {@link TArbacRole} object suitable for
51
50
  * `Arbac.registerRole`. Throws if `.id()` was never called.
package/dist/index.d.mts CHANGED
@@ -1,6 +1,5 @@
1
1
  import { TArbacRole, TArbacRule } from "@aooth/arbac-core";
2
2
  export * from "@aooth/arbac-core";
3
-
4
3
  //#region src/define-role.d.ts
5
4
  /**
6
5
  * A privilege function produces an array of rules when called.
@@ -45,7 +44,7 @@ interface RoleBuilder<TUserAttrs, TScope> {
45
44
  * pin. Runtime storage type-erases through a cast.
46
45
  */
47
46
  use(...privileges: TPrivilegeFunction<TUserAttrs, TScope>[]): RoleBuilder<TUserAttrs, TScope>;
48
- use<TScopes extends readonly unknown[]>(...privileges: { [K in keyof TScopes]: TPrivilegeFunction<TUserAttrs, TScopes[K]> }): RoleBuilder<TUserAttrs, TScope>;
47
+ use<TScopes extends readonly unknown[]>(...privileges: { [K in keyof TScopes]: TPrivilegeFunction<TUserAttrs, TScopes[K]>; }): RoleBuilder<TUserAttrs, TScope>;
49
48
  /**
50
49
  * Finalize and return a plain {@link TArbacRole} object suitable for
51
50
  * `Arbac.registerRole`. Throws if `.id()` was never called.
package/dist/index.mjs CHANGED
@@ -335,7 +335,7 @@ function canOptimizeToIn(scopes) {
335
335
  * Other controls only support boolean gates in v1; supplying a whitelist
336
336
  * for them throws from {@link unionControlsPolicy}.
337
337
  */
338
- const WHITELISTABLE_CONTROLS = new Set(["$with", "$groupBy"]);
338
+ const WHITELISTABLE_CONTROLS = /* @__PURE__ */ new Set(["$with", "$groupBy"]);
339
339
  /**
340
340
  * Union per-role `controls` policies. Additive RBAC semantics: more roles =
341
341
  * broader access, mirroring how `mergeScopeFilters` and `unionProjections`
@@ -420,7 +420,7 @@ function unionControlsPolicy(scopes) {
420
420
  */
421
421
  function intersectControlsPolicy(a, b) {
422
422
  const result = {};
423
- const keys = new Set([...Object.keys(a), ...Object.keys(b)]);
423
+ const keys = /* @__PURE__ */ new Set([...Object.keys(a), ...Object.keys(b)]);
424
424
  for (const key of keys) {
425
425
  const av = key in a ? a[key] : true;
426
426
  const bv = key in b ? b[key] : true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aooth/arbac",
3
- "version": "0.1.57",
3
+ "version": "0.1.59",
4
4
  "description": "Batteries-included RBAC: builder API, privilege factories, scope merge utilities",
5
5
  "keywords": [
6
6
  "access-control",
@@ -45,7 +45,7 @@
45
45
  "access": "public"
46
46
  },
47
47
  "dependencies": {
48
- "@aooth/arbac-core": "0.1.57"
48
+ "@aooth/arbac-core": "0.1.59"
49
49
  },
50
50
  "scripts": {
51
51
  "build": "vp pack",