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

Annexes are supplementary parts of EU legislation, often containing technical specifications, lists, or tables referenced within the articles. Each annex belongs to one framework and is identified by its annex number or letter (e.g. "I", "II", "A").

Methods

list()

Returns a page of annex summaries for a framework.
const page = await client.annexes.list('cra', { page: 1, perPage: 20 });

console.log(`CRA has ${page.meta.total} annexes`);

for (const annex of page.data) {
  console.log(`Annex ${annex.annexNumber}: ${annex.title}`);
}
Parameters
ParameterTypeDefaultDescription
frameworkSlugstringrequiredFramework slug, e.g. "cra"
pagenumber1Page number
perPagenumber20Items per page (1–100)
Returns Promise<Page<AnnexSummary>>

get()

Fetch the full content of a single annex.
const annex = await client.annexes.get('cra', 'I');

console.log(`Annex ${annex.annexNumber}: ${annex.title}`);
console.log(annex.content);
Parameters
ParameterTypeDescription
frameworkSlugstringFramework slug
annexNumberstringAnnex identifier, e.g. "I", "II", "A"
Returns Promise<Annex>

iter()

Iterate over all annexes in a framework.
for await (const annex of client.annexes.iter('cra')) {
  console.log(`Annex ${annex.annexNumber}: ${annex.title}`);
}
Parameters — same options as list() (except page, which is managed internally). Returns AsyncGenerator<AnnexSummary>

Models

AnnexSummary

Returned by list() and iter().
FieldTypeDescription
idnumberInternal numeric ID
frameworkSlugstringParent framework slug
annexNumberstringAnnex identifier, e.g. "I", "II", "A"
titlestring | nullAnnex title
positionnumberDisplay order within the framework

Annex

Returned by get(). Extends AnnexSummary with:
FieldTypeDescription
contentstring | nullFull annex text

Example: enumerate all CRA annexes

const annexTitles: string[] = [];

for await (const annex of client.annexes.iter('cra')) {
  annexTitles.push(`Annex ${annex.annexNumber}: ${annex.title ?? '(no title)'}`);
}

console.log('CRA Annexes:');
for (const title of annexTitles) {
  console.log(` - ${title}`);
}