Overview
Frameworks are the top-level objects in Law4Devs. Each framework represents one EU regulatory act (e.g. GDPR, NIS2, CRA) and acts as a namespace for articles, recitals, requirements, and annexes.
Methods
list()
Returns a page of framework summaries.
Parameters
| Parameter | Type | Default | Description |
|---|
page | number | 1 | Page number |
perPage | number | 20 | Items per page (1–100) |
Returns Promise<Page<Framework>>
get()
Fetch the full detail of a single framework by its slug.
Parameters
| Parameter | Type | Description |
|---|
slug | string | Framework slug, e.g. "gdpr", "nis2", "cra" |
Returns Promise<FrameworkDetail>
iter()
Iterate over all frameworks without managing pagination.
Parameters — same options as list() (except page, which is managed internally).
Returns AsyncGenerator<Framework>
Models
Framework
Returned by list() and iter().
| Field | Type | Description |
|---|
id | number | Internal numeric ID |
slug | string | URL-safe identifier, e.g. "gdpr" |
name | string | Full official name |
shortName | string | Short name, e.g. "GDPR" |
celexNumber | string | null | EUR-Lex CELEX identifier |
description | string | null | Plain-text summary |
isActive | boolean | Whether the framework is published |
status | string | "active", "superseded", or "draft" |
expectedArticles | number | null | Target article count for sync progress |
expectedRecitals | number | null | Target recital count for sync progress |
lastSyncedAt | string | null | ISO 8601 timestamp of last content sync |
createdAt | string | ISO 8601 creation timestamp |
articleCount | number | Number of articles currently in the database |
recitalCount | number | Number of recitals currently in the database |
FrameworkDetail
Returned by get(). Extends Framework with:
| Field | Type | Description |
|---|
eurLexUrl | string | null | Direct link to EUR-Lex source document |
requirementCount | number | Number of extracted requirements |
annexCount | number | Number of annexes |
tagCount | number | Number of tags applied |
coverage | number | Sync coverage percentage (0–100) |
Example: filter active frameworks
NIS1 has status: "superseded" and remains browsable for historical reference. Filter by status === "active" if you only want current legislation.