@mandaitor/taxonomy-core
v0.1.1
Published
Mandaitor — Core taxonomy types, interfaces, and validation
Maintainers
Readme
@mandaitor/taxonomy-core
Core taxonomy types, interfaces, and validation for the Mandaitor delegation framework.
Overview
This package defines the foundational type system that all industry-specific taxonomies extend. It provides:
- Type definitions for actions, resources, constraints, and mandate templates
- Registry for registering and discovering taxonomy modules at runtime
- Validator for validating mandate scopes against registered taxonomies
Usage
import { TaxonomyRegistry, validateScope } from "@mandaitor/taxonomy-core";
import { constructionTaxonomy } from "@mandaitor/taxonomy-construction";
// Register an industry taxonomy
TaxonomyRegistry.register(constructionTaxonomy);
// Validate a mandate scope against registered taxonomies
const result = validateScope({
actions: ["construction.validation.approve"],
resources: ["project:proj-1/zone:EG/installation:stk_01"],
effect: "ALLOW",
});Core Types
| Type | Description |
|------|-------------|
| TaxonomyAction | Defines a delegatable action within a vertical |
| TaxonomyResource | Defines a resource pattern with hierarchical segments |
| TaxonomyConstraint | Time, count, or escalation constraints for mandates |
| TaxonomyMandateTemplate | Pre-configured mandate blueprint for common delegation patterns |
Development
pnpm build
pnpm test:unit