Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@eturino/claims

eturino5kMIT0.4.7TypeScript support: included

Claim, ClaimSet and Ability for permissions (Typescript port of https://github.com/eturino/claims)

claims, permissions

readme

Claims (typescript)

npm version Maintainability Test Coverage

TypeDoc generated docs in here

Github repo here

Library to encapsulate Claims ("verb:resource") as well as ClaimSet (set of Claims) and Ability (permitted ClaimSet + prohibited ClaimSet).

TBD

(TypeScript port of https://github.com/eturino/claims)

Library bootstrapped using typescript-starter.

Installation

yarn add @eturino/claims or npm install @eturino/claims.

Usage

Allowed verbs: "admin", "read", "delete", "create", "update", "manage".

see the type docs for now

instantiating the object using the buildClaim(), buildClaimSet() and buildAbility() functions is recommended

Collaborators

changelog

Changelog

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

0.4.7 (2025-02-17)

Bug Fixes

  • deps: bump es-toolkit from 1.31.0 to 1.32.0 (#590) (512c2fa)
  • deps: bump vite from 5.4.11 to 5.4.14 (#583) (d2b63d6)
  • update dependencies and open peerDeps (16ea553)

0.4.6 (2025-01-09)

0.4.5 (2025-01-09)

Bug Fixes

  • better key-set peerDependency (0e5a384)
  • deps: bump es-toolkit from 1.27.0 to 1.29.0 (#563) (2e8ebd3)
  • deps: bump es-toolkit from 1.29.0 to 1.30.1 (#568) (ba5b655)
  • deps: bump es-toolkit from 1.30.1 to 1.31.0 (#571) (24e8544)
  • updated dependencies, including updated @eturino/key-set peerDependency (b5def87)

0.4.4 (2025-01-08)

Bug Fixes

  • updated dependencies, including updated @eturino/key-set peerDependency (5fa39ac)

0.4.3 (2024-11-20)

Features

  • enhance types to allow for readonly arguments (a04ffe1)

Bug Fixes

  • deps: bump es-toolkit from 1.26.1 to 1.27.0 (#549) (07a09d3)

0.4.2 (2024-11-05)

Bug Fixes

  • fixing tests and lodash usage (7d15fb2)

0.4.1 (2024-11-05)

Features

  • replace lodash with es-toolkit, plus migrating to new project structure, ci, and tooling (#548) (d8342fe)

0.3.1 (2023-09-19)

Features

  • adding more allowed verbs: "admin", "read", "delete", "create", "update", "manage" (6e90a42)

0.3.0 (2022-04-06)

⚠ BREAKING CHANGES

  • the peer dependency of @eturino/key-set is updated to v5.x

Features

  • adding clone() and updating to KeySet 5.x (1e02765)

0.2.1 (2022-02-23)

Features

  • added claimSet.toJSONString() and ability.cacheID (5580d3f)

0.2.0 (2022-02-21)

⚠ BREAKING CHANGES

  • The type of the verb of a claim is now AllowedVerbs which is "admin" | "read"

Features

0.1.10 (2022-02-16)

Features

0.1.9 (2021-02-05)

0.1.8 (2021-01-26)

0.1.7 (2020-05-27)

Features

  • ability#accessToResources(query): KeySet<string> with access to children of given query (b652775)

0.1.6 (2020-05-12)

0.1.5 (2020-05-12)

Bug Fixes

  • target ES2017 instead of esnext for module, and ES2015 for main (dee3c6d)

0.1.4 (2020-04-29)

0.1.3 (2020-04-14)

0.1.2 (2019-09-12)

Features

  • claim.toString() to return "verb:resource" or "verb:*" (also better docs) (a86989c)

0.1.1 (2019-09-09)

Bug Fixes

  • exporting all needed data + refactor (12b1a63)

0.1.0 (2019-09-09)