Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.law4devs.eu/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Requirements are structured compliance obligations extracted from regulation articles. Each requirement is linked back to its source article and paragraph, categorised by type, and optionally includes a compliance deadline and stakeholder roles.

Methods

list()

Returns a page of requirements, optionally filtered to a single framework.
// All requirements across all frameworks
const allPage = await client.requirements.list();

// Requirements for a specific framework
const gdprPage = await client.requirements.list({ frameworkSlug: 'gdpr' });

console.log(`GDPR has ${gdprPage.meta.total} requirements`);

for (const req of gdprPage.data) {
  console.log(`Art. ${req.articleNumber} [${req.requirementType}]: ${req.requirementText.slice(0, 80)}...`);
}
Parameters
ParameterTypeDefaultDescription
frameworkSlugstringFilter to a specific framework
pagenumber1Page number
perPagenumber20Items per page (1–100)
Returns Promise<Page<Requirement>>

iter()

Iterate over requirements, optionally filtered to a framework.
for await (const req of client.requirements.iter({ frameworkSlug: 'cra' })) {
  console.log(`[${req.requirementType}] Art. ${req.articleNumber}: ${req.requirementText.slice(0, 60)}...`);
}
Parameters — same options as list() (except page, which is managed internally). Returns AsyncGenerator<Requirement>

Model

Requirement

FieldTypeDescription
idnumberInternal numeric ID
frameworkSlugstringParent framework slug
articleNumbernumberSource article number
paragraphRefstring | nullSource paragraph reference, e.g. "1", "2a"
paragraphContentstring | nullFull text of the source paragraph
requirementTextstringExtracted requirement obligation text
requirementTypestringCategory, e.g. "obligation", "prohibition", "right"
complianceDeadlinestring | nullISO 8601 deadline date, if applicable
linkedArticleNumbersnumber[]Related article numbers
stakeholderRolesstring[]Roles this requirement applies to, e.g. ["controller", "processor"]
tagsTag[]Tags applied to the requirement
createdAtstringISO 8601 creation timestamp

Example: build a compliance checklist

interface ChecklistItem {
  id: number;
  article: string;
  type: string;
  text: string;
  deadline: string | null;
  roles: string[];
}

async function buildChecklist(frameworkSlug: string): Promise<ChecklistItem[]> {
  const checklist: ChecklistItem[] = [];

  for await (const req of client.requirements.iter({ frameworkSlug })) {
    checklist.push({
      id: req.id,
      article: `Art. ${req.articleNumber}${req.paragraphRef ? `(${req.paragraphRef})` : ''}`,
      type: req.requirementType,
      text: req.requirementText,
      deadline: req.complianceDeadline,
      roles: req.stakeholderRoles,
    });
  }

  // Sort obligations before other types
  checklist.sort((a, b) => {
    if (a.type === 'obligation' && b.type !== 'obligation') return -1;
    if (b.type === 'obligation' && a.type !== 'obligation') return 1;
    return 0;
  });

  return checklist;
}

const craChecklist = await buildChecklist('cra');
console.log(`CRA compliance checklist: ${craChecklist.length} items`);
Requirements are extracted from article paragraphs through automated analysis. Cross-check against the source article text — accessible via client.articles.get() — for authoritative wording.