@lexapi/client 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -88,6 +88,20 @@ interface ResponseHeaders {
88
88
  languagePartialKept?: number;
89
89
  /** Age in seconds of a cached answer (`X-Cache-Age`). */
90
90
  cacheAge?: number;
91
+ /**
92
+ * National-law monthly call allowance for plans below BUSINESS
93
+ * (`X-National-Limit`/`X-National-Remaining`/`X-National-Reset`). Sent on
94
+ * the four national document/semantic endpoints for FREE/STARTER/
95
+ * PROFESSIONAL callers only — absent for BUSINESS/SCALE/ENTERPRISE and
96
+ * `getNationalCoverage`. A used-up allowance is a
97
+ * 402 `NationalAllowanceExhaustedError`, not a header you need to poll.
98
+ */
99
+ nationalAllowance?: {
100
+ limit?: number;
101
+ remaining?: number;
102
+ /** ISO date-time: start of the next UTC month. */
103
+ resetsAt?: string;
104
+ };
91
105
  }
92
106
  /** Minimal `Headers` surface (works with polyfilled / injected fetch implementations). */
93
107
  interface HeaderGetter {
@@ -110,7 +124,7 @@ declare function parseResponseHeaders(source: {
110
124
  */
111
125
 
112
126
  /** Stable error codes from the OpenAPI `ErrorResponse.error.code` enum. */
113
- type ErrorCode = "NOT_FOUND" | "INVALID_CELEX" | "INVALID_URL" | "INVALID_PARAMS" | "RATE_LIMITED" | "QUOTA_EXHAUSTED" | "TIER_FORBIDDEN" | "CREDITS_EXHAUSTED" | "UPSTREAM_ERROR" | "TIMEOUT" | "INTERNAL" | "UNAUTHORIZED" | "SERVICE_UNAVAILABLE" | "CONNECTION_ERROR" | "REQUEST_TIMEOUT" | "ABORTED" | "INVALID_RESPONSE" | "INCOMPLETE_EXPORT" | (string & {});
127
+ type ErrorCode = "NOT_FOUND" | "INVALID_CELEX" | "INVALID_URL" | "INVALID_PARAMS" | "RATE_LIMITED" | "QUOTA_EXHAUSTED" | "TIER_FORBIDDEN" | "CREDITS_EXHAUSTED" | "UPSTREAM_ERROR" | "TIMEOUT" | "INTERNAL" | "UNAUTHORIZED" | "SERVICE_UNAVAILABLE" | "CONNECTION_ERROR" | "REQUEST_TIMEOUT" | "ABORTED" | "INVALID_RESPONSE" | "INCOMPLETE_EXPORT" | "NATIONAL_ALLOWANCE_EXHAUSTED" | "NATIONAL_SEMANTIC_NOT_ENABLED" | "NATIONAL_SEMANTIC_UNAVAILABLE" | "NATIONAL_SEMANTIC_FILTER_UNREACHABLE" | "DOCUMENT_WITHDRAWN" | (string & {});
114
128
  /** Extra context attached to errors built from an HTTP response. */
115
129
  interface LexAPIErrorContext {
116
130
  /** The parsed JSON error body, verbatim (e.g. legacy `upgradeUrl`, `current`/`limit`). */
@@ -130,7 +144,8 @@ declare class LexAPIError extends Error {
130
144
  /** The `error.details` object from the typed envelope, when present. */
131
145
  readonly details: unknown;
132
146
  /**
133
- * Seconds to wait before retrying, when the server said so (429).
147
+ * Seconds to wait before retrying, when the server said so (429; also the
148
+ * 503 of an incomplete national semantic search).
134
149
  * Sourced from the `Retry-After` response HEADER first; the JSON
135
150
  * `retryAfter` body field is only a fallback because it historically
136
151
  * carried buggy epoch-seconds values (epoch-looking values are
@@ -170,7 +185,23 @@ declare class InvalidUrlError extends LexAPIError {
170
185
  /** 400 — missing or malformed params (`INVALID_PARAMS`). */
171
186
  declare class InvalidParamsError extends LexAPIError {
172
187
  static readonly kind: string;
173
- constructor(message: string, status?: number, details?: unknown, retryAfter?: number, context?: LexAPIErrorContext);
188
+ constructor(message: string, status?: number, details?: unknown, retryAfter?: number, context?: LexAPIErrorContext,
189
+ /**
190
+ * @internal Lets a subclass (`NationalSemanticFilterUnreachableError`)
191
+ * keep its own `code` while still being `instanceof InvalidParamsError`.
192
+ * Not part of the public constructor contract.
193
+ */
194
+ code?: ErrorCode);
195
+ /**
196
+ * The parameter that was refused, when the server names it — e.g. an
197
+ * unknown citation-graph filter value (API 2.11.0). Read from `details`
198
+ * (typed envelope) or the top level of the body (legacy shape).
199
+ */
200
+ get param(): string | undefined;
201
+ /** The refused value of {@link param}, when the server echoes it. */
202
+ get value(): unknown;
203
+ /** The allowed values of {@link param}, when the server lists them (may be empty). */
204
+ get allowed(): string[] | undefined;
174
205
  }
175
206
  /** 401 — missing, invalid, or revoked API key. */
176
207
  declare class AuthenticationError extends LexAPIError {
@@ -244,6 +275,45 @@ declare class CreditsExhaustedError extends LexAPIError {
244
275
  /** The refused operation (`details.operation`). */
245
276
  get operation(): string | undefined;
246
277
  }
278
+ /** `error.details` on a 402 `NATIONAL_ALLOWANCE_EXHAUSTED` envelope. */
279
+ interface NationalAllowanceExhaustedDetails {
280
+ /** ISO 3166-1 alpha-2 jurisdiction code of the call that was refused. */
281
+ jurisdiction?: string;
282
+ /** The tier's monthly allowance of national calls. */
283
+ limit?: number;
284
+ /** Always `0` on this error. */
285
+ remaining?: number;
286
+ /** When the allowance resets (ISO date-time: start of the next UTC month). */
287
+ resetsAt?: string;
288
+ /** `/pricing` — upgrading to BUSINESS removes the allowance entirely. */
289
+ upgradeUrl?: string;
290
+ [key: string]: unknown;
291
+ }
292
+ /**
293
+ * 402 — the monthly national-law call allowance of a plan below BUSINESS
294
+ * (FREE/STARTER/PROFESSIONAL) is used up (`NATIONAL_ALLOWANCE_EXHAUSTED`).
295
+ * A usage shortfall, not a credit shortfall: no credits
296
+ * were charged for the refused call. Resolves at `resetsAt` (start of next
297
+ * UTC month) or immediately on upgrading to BUSINESS/SCALE/ENTERPRISE, which
298
+ * have no separate limit. Mirrors `X-National-Limit`/`X-National-Remaining`/
299
+ * `X-National-Reset` on the response that triggered it.
300
+ */
301
+ declare class NationalAllowanceExhaustedError extends LexAPIError {
302
+ static readonly kind: string;
303
+ /** Typed view of `error.details` (jurisdiction, limit, remaining, resetsAt, upgradeUrl). */
304
+ readonly details: NationalAllowanceExhaustedDetails | undefined;
305
+ constructor(message: string, status?: number, details?: unknown, retryAfter?: number, context?: LexAPIErrorContext);
306
+ /** The jurisdiction code of the refused call (`details.jurisdiction`). */
307
+ get jurisdiction(): string | undefined;
308
+ /** The tier's monthly allowance of national calls (`details.limit`). */
309
+ get limit(): number | undefined;
310
+ /** Always `0` (`details.remaining`). */
311
+ get remaining(): number | undefined;
312
+ /** When the allowance resets (`details.resetsAt`, ISO date-time). */
313
+ get resetsAt(): string | undefined;
314
+ /** `/pricing` (`details.upgradeUrl`). */
315
+ get upgradeUrl(): string | undefined;
316
+ }
247
317
  /** 502 — EUR-Lex returned an error (`UPSTREAM_ERROR`). Retry-safe on GETs. */
248
318
  declare class UpstreamError extends LexAPIError {
249
319
  static readonly kind: string;
@@ -251,13 +321,19 @@ declare class UpstreamError extends LexAPIError {
251
321
  }
252
322
  /**
253
323
  * A timeout. Two cases, told apart by `code` / `status`:
254
- * - `TIMEOUT` (504, 524): the server or Cloudflare gave up on the upstream.
324
+ * - `TIMEOUT` (504, 524): the server or Cloudflare gave up on the upstream;
325
+ * also a 503 from `getCounterparts` when the lookup exceeded its
326
+ * server-side budget (`partial === true`, refunded).
255
327
  * - `REQUEST_TIMEOUT` (`status === 0`): the SDK's own response timeout —
256
328
  * no bytes for `timeoutMs` (SDK contract §1.6).
257
329
  */
258
330
  declare class TimeoutError extends LexAPIError {
259
331
  static readonly kind: string;
260
332
  constructor(message: string, status?: number, details?: unknown, retryAfter?: number, context?: LexAPIErrorContext);
333
+ /** `true` when the server answered a budget timeout with `partial: true` (nothing else was returned). */
334
+ get partial(): boolean | undefined;
335
+ /** The server-side budget that expired, in ms, when the body reports it. */
336
+ get serverTimeoutMs(): number | undefined;
261
337
  }
262
338
  /**
263
339
  * 503 — service temporarily unavailable (e.g. a deploy's drain window).
@@ -265,7 +341,99 @@ declare class TimeoutError extends LexAPIError {
265
341
  */
266
342
  declare class ServiceUnavailableError extends LexAPIError {
267
343
  static readonly kind: string;
344
+ constructor(message: string, status?: number, details?: unknown, retryAfter?: number, context?: LexAPIErrorContext, code?: ErrorCode);
345
+ }
346
+ /**
347
+ * 409 — this jurisdiction's semantic index isn't enabled at all
348
+ * (`NATIONAL_SEMANTIC_NOT_ENABLED`). Legacy-shape body (`{code, error,
349
+ * message, jurisdiction}`, no `error.details`) — `jurisdiction` is read off
350
+ * the raw `body`, not `details`. Not retryable; the call was refunded in
351
+ * full and never reached the national allowance counter.
352
+ */
353
+ declare class NationalSemanticNotEnabledError extends LexAPIError {
354
+ static readonly kind: string;
355
+ constructor(message: string, status?: number, details?: unknown, retryAfter?: number, context?: LexAPIErrorContext);
356
+ /** ISO 3166-1 alpha-2 jurisdiction code (top-level `jurisdiction` on the raw body). */
357
+ get jurisdiction(): string | undefined;
358
+ }
359
+ /**
360
+ * 503 — a jurisdiction's semantic index exists but is temporarily
361
+ * unreachable (`NATIONAL_SEMANTIC_UNAVAILABLE`). Extends
362
+ * `ServiceUnavailableError` so `instanceof ServiceUnavailableError` still
363
+ * holds (and any existing 503-retry handling still catches it), while
364
+ * `code`/`name` stay specific. Legacy-shape body, same as
365
+ * `NationalSemanticNotEnabledError` — `jurisdiction` comes off `body`.
366
+ */
367
+ declare class NationalSemanticUnavailableError extends ServiceUnavailableError {
368
+ static readonly kind: string;
369
+ constructor(message: string, status?: number, details?: unknown, retryAfter?: number, context?: LexAPIErrorContext);
370
+ get jurisdiction(): string | undefined;
371
+ /**
372
+ * `"SEARCH_INCOMPLETE"` when the index could not complete this search for a
373
+ * temporary reason and there was nothing left to return (an empty answer
374
+ * would not have meant "no matches"). `retryAfter` is then the wait the
375
+ * server asked for — absent once the same search has repeatedly come back
376
+ * incomplete (try again later, or rephrase or narrow it). `undefined` on
377
+ * the plain "index unavailable" 503.
378
+ */
379
+ get partialReason(): string | undefined;
380
+ }
381
+ /**
382
+ * 422 — the national semantic index cannot search this slice (jurisdiction,
383
+ * document kind and filters) completely and there is nothing left to return
384
+ * (`NATIONAL_SEMANTIC_FILTER_UNREACHABLE`, `partialReason:
385
+ * "SEARCH_INCOMPLETE"`). Not a "no matches" answer, and not temporary:
386
+ * retrying the same request gives the same answer, so it is never retried —
387
+ * rephrase the query or change the filters. Refunded in full. Extends
388
+ * `InvalidParamsError` (the request has to change) while `code`/`name` stay
389
+ * specific — but the request may be perfectly valid: this is a coverage
390
+ * limit of the index, not a malformed request, and `param` is absent.
391
+ * Legacy-shape body — `jurisdiction` comes off `body`.
392
+ */
393
+ declare class NationalSemanticFilterUnreachableError extends InvalidParamsError {
394
+ static readonly kind: string;
395
+ constructor(message: string, status?: number, details?: unknown, retryAfter?: number, context?: LexAPIErrorContext);
396
+ get jurisdiction(): string | undefined;
397
+ /** `"SEARCH_INCOMPLETE"`. */
398
+ get partialReason(): string | undefined;
399
+ }
400
+ /** `error.details` (typed envelope) or the raw body (legacy envelope) on a `DOCUMENT_WITHDRAWN` 410. */
401
+ interface DocumentWithdrawnDetails {
402
+ id?: string;
403
+ jurisdiction?: string;
404
+ /** ISO date-time the source withdrew the document; `null` when unknown. */
405
+ withdrawnAt?: string | null;
406
+ [key: string]: unknown;
407
+ }
408
+ /**
409
+ * 410 — a national document its source withdrew (a takedown, a
410
+ * pseudonymisation fix, a robots.txt listing). LexAPI
411
+ * serves nothing of it: no title, no metadata, no text. Two envelope shapes
412
+ * carry this code: the TYPED envelope on a direct document read
413
+ * (`GET /{jurisdiction}/documents/{id}`, `error.details: {id, jurisdiction,
414
+ * withdrawnAt}`), and the LEGACY shape with those same three fields as
415
+ * top-level siblings of `code`/`error` on the citation routes (a withdrawn
416
+ * id queried directly, or via `includeNational`). The getters below check
417
+ * `details` first, then fall back to the raw `body` — correct for either
418
+ * shape without the caller needing to know which one answered.
419
+ *
420
+ * Not retryable (the document is gone, not temporarily failing); never
421
+ * charges anything (the credits/allowance refund rule already returns
422
+ * every non-404 4xx-or-5xx). If you hold a cached copy of this document,
423
+ * drop it — the source withdrew it for a reason that may include a legal
424
+ * takedown or a pseudonymisation fix (see docs §7, no re-identification).
425
+ */
426
+ declare class DocumentWithdrawnError extends LexAPIError {
427
+ static readonly kind: string;
428
+ readonly details: DocumentWithdrawnDetails | undefined;
268
429
  constructor(message: string, status?: number, details?: unknown, retryAfter?: number, context?: LexAPIErrorContext);
430
+ private field;
431
+ /** The withdrawn document's id (e.g. `AT-NOR-10001597`). */
432
+ get id(): string | undefined;
433
+ /** Upper-case jurisdiction code. */
434
+ get jurisdiction(): string | undefined;
435
+ /** ISO date-time the source withdrew the document; `undefined` when unknown. */
436
+ get withdrawnAt(): string | undefined;
269
437
  }
270
438
  /** 500 — unexpected server failure (`INTERNAL`). Not retried by default. */
271
439
  declare class InternalServerError extends LexAPIError {
@@ -335,7 +503,11 @@ interface RetryOptions {
335
503
  maxRetries?: number;
336
504
  /** Exponential backoff base. Default 500 ms. */
337
505
  baseDelayMs?: number;
338
- /** Cap on any single wait (computed or server-directed). Default 30 000 ms. */
506
+ /**
507
+ * Cap on any single wait (computed or server-directed). Default 30 000 ms.
508
+ * A cap below the server's requested wait (`Retry-After` / `retryAfter`)
509
+ * shortens that wait, so the retry may come too early.
510
+ */
339
511
  maxDelayMs?: number;
340
512
  /**
341
513
  * SDK contract §1.2 opt-in (default `false`): also retry the eight
@@ -398,8 +570,9 @@ declare const INSPECT: unique symbol;
398
570
  * - Retries follow the billing-safety rule of SDK contract §1.2 — only when
399
571
  * a retry cannot charge twice (see `shouldRetryStatus` and PLAN.md §1.2).
400
572
  * - Server-directed waits: `Retry-After` on any status; on a 429 only, then
401
- * `RateLimit-Reset` and the JSON `retryAfter` field. `X-RateLimit-*` is
402
- * never read.
573
+ * `RateLimit-Reset` and the JSON `retryAfter` field; on a 503
574
+ * `NATIONAL_SEMANTIC_UNAVAILABLE`, the JSON `retryAfter` field.
575
+ * `X-RateLimit-*` is never read.
403
576
  */
404
577
  declare class HttpClient {
405
578
  #private;
@@ -1017,24 +1190,143 @@ interface DocumentMetadataResponse extends CreditedResponse, WithResponseHeaders
1017
1190
  }
1018
1191
  type IdentifierType = "celex" | "url" | "eli" | "ecli";
1019
1192
  /**
1020
- * Which resolution path matched. `celex`/`url`/`eli` resolve purely from the
1021
- * identifier; `ecli-corpus` / `eli-corpus` mean a corpus lookup answered.
1193
+ * Which resolution path matched. `celex`/`url` resolve purely from the
1194
+ * identifier; `ecli-corpus` / `eli-corpus` mean a corpus lookup answered;
1195
+ * `eli-cellar` means the ELI was looked up in the Publications Office's
1196
+ * Cellar register. `eli` means the CELEX was derived from the ELI's pattern
1197
+ * alone (`verified: false` on servers that send `verified`).
1022
1198
  */
1023
- type ResolvedVia = "celex" | "url" | "eli" | "ecli-corpus" | "eli-corpus" | (string & {});
1199
+ type ResolvedVia = "celex" | "url" | "eli" | "ecli-corpus" | "eli-corpus" | "eli-cellar" | (string & {});
1024
1200
  interface ResolveResponse extends CreditedResponse, WithResponseHeaders {
1025
1201
  success: boolean;
1026
1202
  /** Echo of the caller's input. */
1027
1203
  identifier: string;
1028
1204
  identifierType: IdentifierType;
1029
1205
  resolvedVia: ResolvedVia;
1206
+ /**
1207
+ * `true` when the corpus or Cellar confirmed the identifier → CELEX mapping.
1208
+ * `false` when the CELEX was read off the identifier without a lookup:
1209
+ * CELEX and URL inputs (resolve does not check that the document exists),
1210
+ * and an ELI resolved from its pattern while Cellar was unreachable — that
1211
+ * last kind may name a CELEX that does not exist, so resolve it again later.
1212
+ * Absent on servers older than the field.
1213
+ */
1214
+ verified?: boolean;
1030
1215
  celex: string;
1031
1216
  urls: DocumentUrls;
1032
1217
  }
1033
1218
  /**
1034
1219
  * Classification of a citation edge. `amendment`, `repeal` and
1035
1220
  * `corrigendum` are structural relations (from Cellar for legislation).
1221
+ * `transposition` (API 2.11.0): a member-state measure → the EU act it was
1222
+ * notified for or records that it transposes. A notified measure is a
1223
+ * notification, not a finding that the measure transposes the act, or
1224
+ * transposes it completely.
1225
+ */
1226
+ type CitationType = "reference" | "amendment" | "repeal" | "corrigendum" | "implementation" | "legal-basis" | "proposal" | "transposition";
1227
+ /** Every {@link CitationType} value, for building filters or validating input. */
1228
+ declare const CITATION_TYPES: readonly ["reference", "amendment", "repeal", "corrigendum", "implementation", "legal-basis", "proposal", "transposition"];
1229
+ /**
1230
+ * Where an edge comes from (API 2.11.0): `notice` — the EUR-Lex notice page
1231
+ * of the citing document; `cellar` — a relation recorded in the Publications
1232
+ * Office's Cellar repository; `notice+cellar` — both; `cellar-nim` — a
1233
+ * measure a member state notified to the Commission for an EU act (a
1234
+ * notification, not a finding that the measure transposes the act);
1235
+ * `source` — the national source itself records the relation; `resolver` —
1236
+ * the national source records a textual reference that LexAPI's
1237
+ * deterministic resolver matched (see {@link CitationResolution}).
1238
+ */
1239
+ type CitationProvenance = "notice" | "cellar" | "notice+cellar" | "cellar-nim" | "source" | "resolver";
1240
+ /** Every {@link CitationProvenance} value. */
1241
+ declare const CITATION_PROVENANCES: readonly ["notice", "cellar", "notice+cellar", "cellar-nim", "source", "resolver"];
1242
+ /**
1243
+ * How the target of a national edge was identified (API 2.11.0): `id` — the
1244
+ * source names it by its id or a one-to-one native id; `key` — a unique
1245
+ * native key (an official number, a gazette position); `abbreviation` — a
1246
+ * code abbreviation matched to its act (filter it out with
1247
+ * `resolution: ["id", "key"]` if you need only id and key matches);
1248
+ * `text-pattern` — an EU act number with its EU marker found in running
1249
+ * text. Edges read from EUR-Lex or Cellar have no resolution (`null`).
1036
1250
  */
1037
- type CitationType = "reference" | "amendment" | "repeal" | "corrigendum" | "implementation" | "legal-basis" | "proposal";
1251
+ type CitationResolution = "id" | "key" | "abbreviation" | "text-pattern";
1252
+ /** Every {@link CitationResolution} value. */
1253
+ declare const CITATION_RESOLUTIONS: readonly ["id", "key", "abbreviation", "text-pattern"];
1254
+ /**
1255
+ * A graph node's kind (API 2.11.0): `act` for an EU act (CELEX sector 3) or a
1256
+ * national act, `decision` for an EU court decision (sector 6) or a national
1257
+ * decision; `null` for every other CELEX sector.
1258
+ */
1259
+ type CitationDocumentKind = "act" | "decision";
1260
+ /**
1261
+ * Where `totalCitations` / `totalEdges` (and the network's paging totals)
1262
+ * come from (API 2.10.0): `stats` — the per-node counts the graph maintains
1263
+ * with every write; `counted` — counted over the matching edge rows for this
1264
+ * request. Both are exact for the request; the totals mean the same either way.
1265
+ */
1266
+ type CountsSource = "stats" | "counted";
1267
+ /**
1268
+ * The identity of a graph node (API 2.11.0), on every `citedBy[]` /
1269
+ * `cites[]` group, network neighbour, `path[]` node and `related[]` entry.
1270
+ * `celexNumber` is unchanged and carries the same id.
1271
+ */
1272
+ interface CitationNode {
1273
+ /** The CELEX number of an EU document; a national document's LexAPI id (`AT-NOR-10001597`). */
1274
+ id?: string | null;
1275
+ /** `EU` for an EU document, otherwise the upper-case national code (`AT`, `DE`, …). */
1276
+ jurisdiction?: string | null;
1277
+ documentKind?: CitationDocumentKind | null;
1278
+ }
1279
+ /**
1280
+ * Edge filters shared by `getCites`, `getCitedBy`, `getCitationNetwork`,
1281
+ * `getCitationPath` and `getRelatedDocuments` (API 2.11.0). Each takes one
1282
+ * value or a list, sent comma-separated. An unknown value is a `400`
1283
+ * `InvalidParamsError` naming the parameter (`err.param`) and its allowed
1284
+ * values (`err.allowed`), refunded in full.
1285
+ */
1286
+ interface CitationFilterParams {
1287
+ /** Keep only edges of these types (one value or a list). */
1288
+ citationType?: OneOrMany<CitationType>;
1289
+ /**
1290
+ * Keep only edges with these provenances. `cellar-nim`, `source` and
1291
+ * `resolver` are accepted only while a national jurisdiction is open to you.
1292
+ */
1293
+ provenance?: OneOrMany<CitationProvenance>;
1294
+ /**
1295
+ * Keep only neighbours in these jurisdictions: `eu` and the lower-case
1296
+ * codes of the national jurisdictions open to you (`["eu", "at"]`). A
1297
+ * national code asks for national documents exactly like
1298
+ * `includeNational: true`, with the same plan gate (BUSINESS, SCALE and
1299
+ * ENTERPRISE; `403 TierForbiddenError` below). Any other code is a `400`.
1300
+ */
1301
+ jurisdictions?: OneOrMany<string>;
1302
+ /**
1303
+ * Keep only edges whose target was identified by one of these methods
1304
+ * (national edges only — EU edges never match). While no national
1305
+ * jurisdiction is open to you every value is a `400`.
1306
+ */
1307
+ resolution?: OneOrMany<CitationResolution>;
1308
+ }
1309
+ /**
1310
+ * A reference a national document records that LexAPI could not turn into
1311
+ * an edge (API 2.11.0) — `unresolved: true` on `getCites` /
1312
+ * `getCitationNetwork` for a national document id.
1313
+ */
1314
+ interface UnresolvedReference {
1315
+ /** What the source recorded: a cited norm, an EU act, a relation field, a notified measure. */
1316
+ kind: "norm" | "eu-act" | "relation" | "nim" | (string & {});
1317
+ /** The source's own string (at most 500 characters). */
1318
+ text: string;
1319
+ /** What the resolver understood of `text`; `null` when nothing. */
1320
+ parsedKey: Record<string, unknown> | null;
1321
+ /**
1322
+ * `unresolved` — not matched; `not-held` — identified, but LexAPI does not
1323
+ * hold it; `ambiguous` — more than one candidate; `out-of-scope` — a target
1324
+ * outside the graph.
1325
+ */
1326
+ status: "unresolved" | "not-held" | "ambiguous" | "out-of-scope" | (string & {});
1327
+ /** The id the target would have, when it could be built and is visible to you. */
1328
+ targetId: string | null;
1329
+ }
1038
1330
  /**
1039
1331
  * Where a neighbour's title came from: the corpus (in the requested
1040
1332
  * language, or another language), a citation row, the edge itself, or
@@ -1090,9 +1382,13 @@ interface CitationEdgeDetail {
1090
1382
  citationType?: CitationType;
1091
1383
  contextSnippet?: string | null;
1092
1384
  extractedAt?: string;
1385
+ /** Where the edge comes from (API 2.11.0); `null` on a national edge not yet classified. */
1386
+ provenance?: CitationProvenance | null;
1387
+ /** How the target was identified (API 2.11.0); `null` on every EUR-Lex / Cellar edge. */
1388
+ resolution?: CitationResolution | null;
1093
1389
  }
1094
1390
  /** All edges from one source document into the target (cited-by grouping). */
1095
- interface CitingDocumentGroup {
1391
+ interface CitingDocumentGroup extends CitationNode {
1096
1392
  celexNumber?: string;
1097
1393
  title?: string | null;
1098
1394
  titleSource?: TitleSource;
@@ -1105,50 +1401,90 @@ interface CitingDocumentGroup {
1105
1401
  citations?: CitationEdgeDetail[];
1106
1402
  }
1107
1403
  /** All edges from the source document into one target (cites grouping). */
1108
- interface CitedDocumentGroup {
1404
+ interface CitedDocumentGroup extends CitationNode {
1109
1405
  celexNumber?: string;
1110
1406
  title?: string | null;
1111
1407
  titleSource?: TitleSource;
1112
1408
  citationCount?: number;
1113
1409
  citations?: CitationEdgeDetail[];
1114
1410
  }
1115
- /** Pagination filters shared by the cites / cited-by endpoints. */
1116
- interface CitationEdgeParams {
1117
- /** Filter to a single citation type. */
1118
- citationType?: CitationType;
1411
+ /** Pagination and filters shared by the cites / cited-by endpoints. */
1412
+ interface CitationEdgeParams extends CitationFilterParams {
1119
1413
  /** Max edges to return per page. Default 100. */
1120
1414
  limit?: number;
1121
1415
  /** Pagination offset (in edges, not documents). Default 0. */
1122
1416
  offset?: number;
1123
1417
  /** Language preferred for neighbour titles (default `en`). */
1124
1418
  language?: Language;
1419
+ /**
1420
+ * Also return national documents of live jurisdictions as neighbours
1421
+ * (national acts/decisions that cite, implement or are cited by the EU
1422
+ * graph, where the national source records the link). BUSINESS, SCALE
1423
+ * and ENTERPRISE only — `403 TierForbiddenError` below that. A `celexNumber`
1424
+ * that is itself a national id (`AT-…`) includes national neighbours
1425
+ * without this flag.
1426
+ */
1427
+ includeNational?: boolean;
1428
+ }
1429
+ /** Params for {@link getCites}: the shared edge params plus `unresolved`. */
1430
+ interface CitesParams extends CitationEdgeParams {
1431
+ /**
1432
+ * `true` on a national document id adds `unresolved` /
1433
+ * `unresolvedTruncated` to the response — the references the document
1434
+ * records that could not be turned into an edge. Ignored on an EU id. No
1435
+ * extra credits.
1436
+ */
1437
+ unresolved?: boolean;
1125
1438
  }
1126
1439
  interface CitedByResponse extends CreditedResponse, WithResponseHeaders {
1127
1440
  success: boolean;
1128
1441
  /** The CELEX whose inbound edges are being listed. */
1129
1442
  targetDocument: string;
1130
- /** Total inbound edges matching the filter (across all pages). */
1443
+ /** Distinct citing→cited document pairs matching the filter (across all pages). */
1131
1444
  totalCitations?: number;
1445
+ /** Edge rows matching the filter — what `offset` / `limit` page over. */
1446
+ totalEdges?: number;
1447
+ /** Where the totals come from (API 2.10.0). */
1448
+ countsSource?: CountsSource;
1132
1449
  /** Citing documents in THIS page (not the global distinct total). */
1133
1450
  uniqueDocuments?: number;
1134
1451
  limit?: number;
1135
1452
  offset?: number;
1136
1453
  citedBy: CitingDocumentGroup[];
1137
1454
  relationSync?: RelationSync;
1455
+ /** Whether national documents were included (see `includeNational`). Absent while no national jurisdiction is live. */
1456
+ includeNational?: boolean;
1138
1457
  }
1139
1458
  interface CitesResponse extends CreditedResponse, WithResponseHeaders {
1140
1459
  success: boolean;
1141
1460
  /** The CELEX whose outbound edges are being listed. */
1142
1461
  sourceDocument: string;
1462
+ /** Distinct citing→cited document pairs matching the filter (across all pages). */
1143
1463
  totalCitations?: number;
1464
+ /** Edge rows matching the filter — what `offset` / `limit` page over. */
1465
+ totalEdges?: number;
1466
+ /** Where the totals come from (API 2.10.0). */
1467
+ countsSource?: CountsSource;
1144
1468
  /** Cited documents in THIS page (not the global distinct total). */
1145
1469
  uniqueDocuments?: number;
1146
1470
  limit?: number;
1147
1471
  offset?: number;
1148
1472
  cites: CitedDocumentGroup[];
1473
+ /** Whether national documents were included (see `includeNational`). Absent while no national jurisdiction is live. */
1474
+ includeNational?: boolean;
1475
+ /** With `unresolved: true` on a national document id: references that did not become an edge (at most 500). */
1476
+ unresolved?: UnresolvedReference[];
1477
+ /** `true` when the document has more than 500 such references. With `unresolved` only. */
1478
+ unresolvedTruncated?: boolean;
1479
+ }
1480
+ /** One distinct (`citationType`, `provenance`, `resolution`) combination of a neighbour's edges (API 2.11.0). */
1481
+ interface CitationEdgeKind {
1482
+ citationType: CitationType;
1483
+ provenance: CitationProvenance | null;
1484
+ resolution: CitationResolution | null;
1149
1485
  }
1150
1486
  /** A neighbour in the citation graph, deduplicated across edge types. */
1151
- interface CitationNeighbour {
1487
+ interface CitationNeighbour extends CitationNode {
1152
1488
  celexNumber?: string;
1153
1489
  title?: string | null;
1154
1490
  titleSource?: TitleSource;
@@ -1156,16 +1492,20 @@ interface CitationNeighbour {
1156
1492
  count?: number;
1157
1493
  /** Union of `citationType` values across all edges to/from it. */
1158
1494
  types?: CitationType[];
1495
+ /** The distinct type / provenance / resolution of this page's edges to/from the neighbour (API 2.11.0). */
1496
+ edgeDetails?: CitationEdgeKind[];
1159
1497
  }
1160
- interface CitationNetworkParams {
1161
- /** Filter both directions to a single citation type. */
1162
- citationType?: CitationType;
1498
+ interface CitationNetworkParams extends CitationFilterParams {
1163
1499
  /** Max edges to fetch per direction (default 100, max 500). */
1164
1500
  limit?: number;
1165
1501
  /** Pagination offset (in edges, applied to both directions). */
1166
1502
  offset?: number;
1167
1503
  /** Language preferred for neighbour titles (default `en`). */
1168
1504
  language?: Language;
1505
+ /** Also include national neighbours of live jurisdictions. BUSINESS+ only — `403 TierForbiddenError` below that. */
1506
+ includeNational?: boolean;
1507
+ /** `true` on a national document id adds `unresolved` / `unresolvedTruncated` (not on a partial response). No extra credits. */
1508
+ unresolved?: boolean;
1169
1509
  }
1170
1510
  interface CitationNetworkResponse extends CreditedResponse, WithResponseHeaders {
1171
1511
  success: boolean;
@@ -1188,6 +1528,12 @@ interface CitationNetworkResponse extends CreditedResponse, WithResponseHeaders
1188
1528
  citesTotal: number | null;
1189
1529
  /** Total inbound edges matching the query. `null` when the response is partial. */
1190
1530
  citedByTotal: number | null;
1531
+ /** Outbound edge ROWS — what `offset` pages over. `null` when partial. */
1532
+ citesEdgeTotal?: number | null;
1533
+ /** Inbound edge ROWS — what `offset` pages over. `null` when partial. */
1534
+ citedByEdgeTotal?: number | null;
1535
+ /** Where the totals come from (API 2.10.0); `null` when partial. */
1536
+ countsSource?: CountsSource | null;
1191
1537
  };
1192
1538
  /**
1193
1539
  * Present and `true` when the server-side wall-clock budget expired —
@@ -1200,6 +1546,12 @@ interface CitationNetworkResponse extends CreditedResponse, WithResponseHeaders
1200
1546
  /** The server-side budget that expired (only on partial responses). */
1201
1547
  timeoutMs?: number;
1202
1548
  relationSync?: RelationSync;
1549
+ /** Whether national neighbours were included (see `includeNational`). Absent while no national jurisdiction is live. */
1550
+ includeNational?: boolean;
1551
+ /** With `unresolved: true` on a national document id: references that did not become an edge (at most 500). */
1552
+ unresolved?: UnresolvedReference[];
1553
+ /** `true` when the document has more than 500 such references. With `unresolved` only. */
1554
+ unresolvedTruncated?: boolean;
1203
1555
  }
1204
1556
  interface CitationStatsTopCited {
1205
1557
  celexNumber?: string;
@@ -1211,8 +1563,15 @@ interface CitationStatsTopCiting {
1211
1563
  title?: string | null;
1212
1564
  citesCount?: number;
1213
1565
  }
1566
+ /** Params for {@link getCitationStats}. */
1567
+ interface CitationStatsParams {
1568
+ /** Also count national documents of live jurisdictions. BUSINESS+ only — `403 TierForbiddenError` below that. */
1569
+ includeNational?: boolean;
1570
+ }
1214
1571
  interface CitationStatsResponse extends CreditedResponse, WithResponseHeaders {
1215
1572
  success: boolean;
1573
+ /** Whether national documents were counted (see `includeNational`). Absent while no national jurisdiction is live. */
1574
+ includeNational?: boolean;
1216
1575
  stats: {
1217
1576
  totalCitations: number;
1218
1577
  uniqueSourceDocuments: number;
@@ -1221,23 +1580,55 @@ interface CitationStatsResponse extends CreditedResponse, WithResponseHeaders {
1221
1580
  mostCited: CitationStatsTopCited[];
1222
1581
  /** Top-10 documents with the most outbound citations. */
1223
1582
  mostCiting: CitationStatsTopCiting[];
1583
+ /**
1584
+ * With `includeNational: true` only (API 2.11.0): per jurisdiction (`EU`
1585
+ * and each live one in scope), the edges whose citing end (`asSource`) or
1586
+ * cited end (`asTarget`) is in it. Unclassified edges are counted under
1587
+ * `unstamped`, only while there are any.
1588
+ */
1589
+ byJurisdiction?: Record<string, {
1590
+ asSource?: number;
1591
+ asTarget?: number;
1592
+ }>;
1593
+ /** With `includeNational: true` only: edges per `provenance` value (`unstamped` while edges remain unclassified). */
1594
+ byProvenance?: Record<string, number>;
1595
+ /**
1596
+ * With `includeNational: true` only: the measures the in-scope member
1597
+ * states notified to the Commission that Cellar still lists, and how many
1598
+ * are matched to a document LexAPI holds — the same rule as `counts` on
1599
+ * {@link TranspositionResponse}.
1600
+ */
1601
+ transposition?: {
1602
+ measures?: number;
1603
+ resolved?: number;
1604
+ byCountry?: Record<string, {
1605
+ measures?: number;
1606
+ resolved?: number;
1607
+ }>;
1608
+ };
1224
1609
  };
1225
1610
  /** When these (cached) statistics were computed. */
1226
1611
  cachedAt?: string;
1227
1612
  /** How long the statistics are cached, in seconds. */
1228
1613
  cacheTtlSeconds?: number;
1229
1614
  }
1230
- interface CitationPathNode {
1615
+ interface CitationPathNode extends CitationNode {
1231
1616
  celexNumber: string;
1232
1617
  /** Enriched at read time from the corpus where available. */
1233
1618
  title: string | null;
1234
1619
  titleSource?: TitleSource;
1235
1620
  }
1236
- interface CitationPathParams {
1621
+ interface CitationPathParams extends CitationFilterParams {
1237
1622
  /** Hop budget (default 3, max 8). */
1238
1623
  maxDepth?: number;
1239
1624
  /** Language preferred for node titles (default `en`). */
1240
1625
  language?: Language;
1626
+ /**
1627
+ * Also follow national documents of live jurisdictions. BUSINESS+ only —
1628
+ * `403 TierForbiddenError` below that. `from`/`to` may themselves be
1629
+ * national ids (`AT-…`) regardless of this flag.
1630
+ */
1631
+ includeNational?: boolean;
1241
1632
  }
1242
1633
  interface CitationPathResponse extends CreditedResponse, WithResponseHeaders {
1243
1634
  success: boolean;
@@ -1252,8 +1643,10 @@ interface CitationPathResponse extends CreditedResponse, WithResponseHeaders {
1252
1643
  path: CitationPathNode[];
1253
1644
  /** Present when `found` is false. */
1254
1645
  message?: string;
1646
+ /** Whether national documents were followed (see `includeNational`). Absent while no national jurisdiction is live. */
1647
+ includeNational?: boolean;
1255
1648
  }
1256
- interface RelatedDocument {
1649
+ interface RelatedDocument extends CitationNode {
1257
1650
  celexNumber: string;
1258
1651
  title?: string | null;
1259
1652
  titleSource?: TitleSource;
@@ -1261,11 +1654,13 @@ interface RelatedDocument {
1261
1654
  sharedCount: number;
1262
1655
  sharedTargets?: string[];
1263
1656
  }
1264
- interface RelatedDocumentsParams {
1657
+ interface RelatedDocumentsParams extends CitationFilterParams {
1265
1658
  /** Max neighbours (default 10, max 50). */
1266
1659
  limit?: number;
1267
1660
  /** Language preferred for titles (default `en`). */
1268
1661
  language?: Language;
1662
+ /** Also consider national documents of live jurisdictions. BUSINESS+ only — `403 TierForbiddenError` below that. */
1663
+ includeNational?: boolean;
1269
1664
  }
1270
1665
  interface RelatedDocumentsResponse extends CreditedResponse, WithResponseHeaders {
1271
1666
  success: boolean;
@@ -1277,6 +1672,186 @@ interface RelatedDocumentsResponse extends CreditedResponse, WithResponseHeaders
1277
1672
  related: RelatedDocument[];
1278
1673
  /** Present when the seed has no outbound citations to couple on. */
1279
1674
  message?: string;
1675
+ /** Whether national documents were considered (see `includeNational`). Absent while no national jurisdiction is live. */
1676
+ includeNational?: boolean;
1677
+ }
1678
+ /** Params for {@link getTransposition}. */
1679
+ interface TranspositionParams {
1680
+ /**
1681
+ * Countries to list, ISO-2 codes (`["es", "cz"]`; `EL` for Greece, `UK`
1682
+ * for the United Kingdom); default all 28. `eu` is accepted and ignored;
1683
+ * an unknown code is a `400`.
1684
+ */
1685
+ jurisdictions?: OneOrMany<string>;
1686
+ /**
1687
+ * `true`: only the measures resolved to a document LexAPI holds, in live
1688
+ * jurisdictions. Does nothing when holdings are not joined (below
1689
+ * BUSINESS, or `termsRequired`).
1690
+ */
1691
+ resolvedOnly?: boolean;
1692
+ /** Language of the act's title (default `en`). */
1693
+ language?: Language;
1694
+ }
1695
+ /**
1696
+ * One notified measure for an EU act (API 2.11.0) — the same keys for every
1697
+ * country; a field the record lacks is `null`. `id`, `resolved`,
1698
+ * `resolution` and `resolutionBasis` come from LexAPI's holdings: filled on
1699
+ * BUSINESS, SCALE and ENTERPRISE for a live jurisdiction, `null` otherwise.
1700
+ */
1701
+ interface TranspositionMeasure {
1702
+ /** The LexAPI id of the document the measure resolves to, when held and not withdrawn. */
1703
+ id: string | null;
1704
+ /** Whether the measure is matched to a document LexAPI holds; `null` when holdings are not joined. */
1705
+ resolved: boolean | null;
1706
+ resolution: CitationResolution | null;
1707
+ /** What the match used (e.g. the gazette number); `null` when not resolved or not joined. */
1708
+ resolutionBasis: {
1709
+ keyKind?: string;
1710
+ key?: string;
1711
+ } | null;
1712
+ /**
1713
+ * `cellar-nim` — the Cellar record of the member state's notification;
1714
+ * `source` — the national source itself records that the document
1715
+ * transposes or implements the act (`cellar` is then `null`).
1716
+ */
1717
+ provenance: "cellar-nim" | "source" | (string & {});
1718
+ /** `transposition` when Cellar types the act as a directive or framework decision, else `implementation`. */
1719
+ citationType: "transposition" | "implementation" | (string & {});
1720
+ /** The measure's title as notified, in the member state's language. */
1721
+ title: string | null;
1722
+ /** The kind of measure as notified (`Ley Orgánica`, `Zákon`, …). */
1723
+ typeAct: string | null;
1724
+ /** Where the measure was published, as notified. */
1725
+ officialJournal: {
1726
+ name?: string | null;
1727
+ number?: string | null;
1728
+ date?: string | null;
1729
+ };
1730
+ /** The member state's own reference for the measure. */
1731
+ reference: string | null;
1732
+ eli: string | null;
1733
+ /** A link to the measure, as notified. */
1734
+ link: string | null;
1735
+ /** The Cellar record of the notification; `null` on a measure only a national source records. */
1736
+ cellar: {
1737
+ id?: string | null;
1738
+ /** The record's sector-7 CELEX number for this act; `null` when it has none (never guessed). */
1739
+ celex?: string | null;
1740
+ /** Not mirrored — always `null`. */
1741
+ commissionReference?: null;
1742
+ dateDocument?: string | null;
1743
+ dateNotification?: string | null;
1744
+ entryIntoForce?: string | null;
1745
+ } | null;
1746
+ }
1747
+ /** One country's measures for the act. */
1748
+ interface TranspositionCountry {
1749
+ /** Upper-case code of the member state (`EL` for Greece), or `UK`. */
1750
+ jurisdiction: string;
1751
+ /** Whether LexAPI serves this country's national law (the same `live` as `getNationalCoverage`). */
1752
+ live: boolean;
1753
+ counts: {
1754
+ /** Measures for the act in this country (not only those in this page). */
1755
+ measures?: number;
1756
+ /** Of those, matched to a document LexAPI holds; `null` when holdings are not joined. */
1757
+ resolved?: number | null;
1758
+ };
1759
+ measures: TranspositionMeasure[];
1760
+ }
1761
+ /** `GET /citations/transposition/{celexNumber}` (API 2.11.0). */
1762
+ interface TranspositionResponse extends CreditedResponse, WithResponseHeaders {
1763
+ success: boolean;
1764
+ /** `true` when LexAPI's holdings are joined, `false` otherwise. Absent while no national jurisdiction is live. */
1765
+ includeNational?: boolean;
1766
+ /**
1767
+ * Present (`true`) only when holdings would be joined but the account has
1768
+ * not yet accepted the national-source terms: every holdings field is
1769
+ * then `null`. Accept the terms once in the dashboard.
1770
+ */
1771
+ termsRequired?: true;
1772
+ document: {
1773
+ id?: string;
1774
+ celexNumber?: string;
1775
+ jurisdiction?: "EU" | (string & {});
1776
+ documentKind?: "act" | (string & {});
1777
+ title?: string | null;
1778
+ };
1779
+ source: {
1780
+ cellar?: {
1781
+ /** When the newest of the act's records was last read from Cellar; `null` when the act has none. */
1782
+ syncedAt?: string | null;
1783
+ /** All the act's measures across every country (not narrowed by `jurisdictions`). */
1784
+ measures?: number;
1785
+ /** The attribution the Publications Office's reuse terms require — keep it with anything you republish. */
1786
+ attribution?: string;
1787
+ };
1788
+ /** The live jurisdictions whose own sources record a transposition or implementation of this act; `null` when holdings are not joined. */
1789
+ lanes?: string[] | null;
1790
+ };
1791
+ /**
1792
+ * Always: "Measures are those the member state notified to the Commission
1793
+ * for this act. A notification is not a finding that the measure
1794
+ * transposes the act, or transposes it completely."
1795
+ */
1796
+ note: string;
1797
+ /** Per country with at least one measure (in the `jurisdictions` asked for), in code order. */
1798
+ jurisdictions: TranspositionCountry[];
1799
+ /** `true` when more than 2,000 measures matched (narrow with `jurisdictions`), or the national-source edge cap was hit. */
1800
+ truncated: boolean;
1801
+ }
1802
+ /** Params for {@link getCounterparts}. */
1803
+ interface CounterpartsParams {
1804
+ /** Jurisdictions to look in, ISO-2 codes; default every live one. Codes that are not live are left out; an unknown code is a `400`. */
1805
+ jurisdictions?: OneOrMany<string>;
1806
+ /** Language of the titles (default `en`). */
1807
+ language?: Language;
1808
+ }
1809
+ /** A measure of another live jurisdiction for the same EU act. */
1810
+ interface Counterpart {
1811
+ jurisdiction: string;
1812
+ /** The LexAPI id of the counterpart; `null` for a notified Cellar record LexAPI does not hold (rank 3). */
1813
+ id: string | null;
1814
+ resolved: boolean;
1815
+ title: string | null;
1816
+ citationType: "transposition" | "implementation" | (string & {});
1817
+ provenance: "source" | "cellar-nim" | (string & {});
1818
+ /**
1819
+ * `1` — the national source records the relation (`source`); `2` — a
1820
+ * notified measure LexAPI holds (`cellar-nim`, resolved); `3` — a notified
1821
+ * Cellar record LexAPI does not hold.
1822
+ */
1823
+ rank: 1 | 2 | 3;
1824
+ }
1825
+ /** One EU act the queried document transposes or implements, with the other jurisdictions' measures for it. */
1826
+ interface CounterpartVia {
1827
+ euAct: CitationNode & {
1828
+ title?: string | null;
1829
+ /** Measures all member states notified for the act. */
1830
+ notifiedMeasures?: number;
1831
+ };
1832
+ /** The document's own edge to the act; `null` when the queried id is the EU act itself. */
1833
+ edge: {
1834
+ citationType?: "transposition" | "implementation" | (string & {});
1835
+ provenance?: CitationProvenance | null;
1836
+ resolution?: CitationResolution | null;
1837
+ } | null;
1838
+ /** By `rank`, then jurisdiction; at most 200. Never the queried document. */
1839
+ counterparts: Counterpart[];
1840
+ /** `true` when more than 200 counterparts matched for this act. */
1841
+ truncated: boolean;
1842
+ }
1843
+ /** `GET /citations/counterparts/{id}` (API 2.11.0). */
1844
+ interface CounterpartsResponse extends CreditedResponse, WithResponseHeaders {
1845
+ success: boolean;
1846
+ /** Always `true` when present; absent while no national jurisdiction is live. */
1847
+ includeNational?: boolean;
1848
+ document: CitationNode & {
1849
+ title?: string | null;
1850
+ };
1851
+ /** One entry per EU act the document transposes or implements (CELEX order, at most 200); for an EU act as id, the act itself. */
1852
+ via: CounterpartVia[];
1853
+ /** `true` when the document implements more than 200 EU acts. */
1854
+ truncated: boolean;
1280
1855
  }
1281
1856
  /** Languages accepted by the semantic endpoints (narrower than `Language`). */
1282
1857
  type SemanticLanguage = "en" | "fr" | "de" | "es" | "it" | "sl" | "el" | "nl" | "pt" | "pl";
@@ -1538,6 +2113,606 @@ interface SemanticLegislationSearchResponse extends CreditedResponse, WithRespon
1538
2113
  /** Legacy daily-call plans only. */
1539
2114
  semanticUsage?: SemanticUsageInfo;
1540
2115
  }
2116
+ /** Availability block shared by `legislation` and `caseLaw` on a coverage entry. */
2117
+ interface NationalCoverageAvailability {
2118
+ available: boolean;
2119
+ description?: string;
2120
+ /** Approximate document count. `null` whenever `available` is false (incl. every jurisdiction still in preparation). */
2121
+ documents?: number | null;
2122
+ /** Earliest year covered, as an integer. `null` when unknown — today, always `null` for `legislation`. */
2123
+ from?: number | null;
2124
+ }
2125
+ /** `caseLaw` adds the courts covered. */
2126
+ interface NationalCaseLawCoverageAvailability extends NationalCoverageAvailability {
2127
+ courts?: string[];
2128
+ }
2129
+ /** Whether semantic search is indexed for this jurisdiction, per domain. */
2130
+ interface NationalSemanticSearchAvailability {
2131
+ legislation: boolean;
2132
+ caseLaw: boolean;
2133
+ }
2134
+ /** One upstream data source a jurisdiction's corpus is built from. */
2135
+ interface NationalSource {
2136
+ name: string;
2137
+ url: string;
2138
+ licence: string;
2139
+ attribution: string;
2140
+ }
2141
+ /**
2142
+ * Reason a citation-graph rate is not measured (API 2.13.0):
2143
+ * `not-collected` — LexAPI does not hold these references for the documents
2144
+ * it already has; `source-empty` — the source leaves the field empty or
2145
+ * absent on every document LexAPI holds.
2146
+ */
2147
+ type NationalCitationGraphUnmeasuredReason = "not-collected" | "source-empty" | (string & {});
2148
+ /** A citation-graph rate key, as used by `methods.unmeasured` and `floors`. */
2149
+ type NationalCitationGraphRateKey = "decisionsToActs" | "actsToEu" | "textPattern";
2150
+ /** What a jurisdiction's citation extraction does. */
2151
+ interface NationalCitationGraphMethods {
2152
+ /** How court decisions' references to acts are resolved. */
2153
+ decisions?: CitationResolution | null;
2154
+ /** Resolution methods used for references to national acts. */
2155
+ acts?: string[];
2156
+ /** Resolution methods used for references to EU law. */
2157
+ eu?: string[];
2158
+ /**
2159
+ * API 2.13.0 — absent when every rate is measured; otherwise rate →
2160
+ * reason code for the rates the sources do not let LexAPI measure (such a
2161
+ * rate is `null` and carries no floor), e.g. `{ decisionsToActs: "not-collected" }`.
2162
+ */
2163
+ unmeasured?: Partial<Record<NationalCitationGraphRateKey, NationalCitationGraphUnmeasuredReason>>;
2164
+ }
2165
+ /** The labelled-sample check of one resolution method of the jurisdiction's own extraction. */
2166
+ interface NationalCitationGraphPrecision {
2167
+ resolver?: string | null;
2168
+ resolverVersion?: number | null;
2169
+ /** `source` or `resolver` (API 2.12.0). */
2170
+ provenance?: "source" | "resolver" | null;
2171
+ /** Edges checked by hand. */
2172
+ labelled?: number | null;
2173
+ /** Clopper-Pearson 95 % upper bound on the error rate; `null` with no labels. */
2174
+ errorUpperBound?: number | null;
2175
+ }
2176
+ /**
2177
+ * API 2.12.0 — the lowest values the rates are expected to stay at (each the
2178
+ * measured value minus 10 percentage points, never below 0, at a dated
2179
+ * measurement). A rate that does not apply, is unmeasured, or was not
2180
+ * measured when the floors were set is `null`.
2181
+ */
2182
+ interface NationalCitationGraphFloors {
2183
+ /** Floor of `decisionResolutionRate`. */
2184
+ decisionsToActs?: number | null;
2185
+ /** Floor of `actEuRate`. */
2186
+ actsToEu?: number | null;
2187
+ /** Floor of `textPatternRate`. */
2188
+ textPattern?: number | null;
2189
+ /** Floor of `nimResolvedRate`. */
2190
+ nimResolved?: number | null;
2191
+ /** When the floors were set. */
2192
+ derivedAt?: string;
2193
+ /** The measurements the floors were taken from. */
2194
+ measuredAt?: {
2195
+ rebuild?: string | null;
2196
+ nim?: string | null;
2197
+ };
2198
+ }
2199
+ /**
2200
+ * A jurisdiction's citation graph, as measured (API 2.11.0). Nothing is
2201
+ * estimated: a value that was not measured is `null`.
2202
+ */
2203
+ interface NationalCitationGraph {
2204
+ methods?: NationalCitationGraphMethods | null;
2205
+ /** Edges whose citing document is in this jurisdiction and whose cited document is EU law or in a live jurisdiction. */
2206
+ edges?: number;
2207
+ /** Share of decisions with at least one structured reference that got an edge; `null` when not measured. */
2208
+ decisionResolutionRate?: number | null;
2209
+ /** Share of acts with recorded EU references that got an EU edge; `null` when not measured, and for a text-pattern-only jurisdiction. */
2210
+ actEuRate?: number | null;
2211
+ /** API 2.12.0. Share of EU act numbers found in running text that produced an edge; `null` when not measured. */
2212
+ textPatternRate?: number | null;
2213
+ /** The measures this member state notified to the Commission that Cellar still lists, and how many LexAPI holds. */
2214
+ transposition?: {
2215
+ measures?: number;
2216
+ resolved?: number;
2217
+ };
2218
+ precision?: NationalCitationGraphPrecision;
2219
+ /** When the rebuild rates were measured; `null` without. */
2220
+ measuredAt?: string | null;
2221
+ /** API 2.12.0. Share of the notified measures in scope for matching that were matched to a held document; `null` without a complete run. */
2222
+ nimResolvedRate?: number | null;
2223
+ /** API 2.12.0. When that matching run finished. */
2224
+ nimMeasuredAt?: string | null;
2225
+ /** API 2.12.0. `null` until LexAPI has set them. */
2226
+ floors?: NationalCitationGraphFloors | null;
2227
+ }
2228
+ /** One jurisdiction's entry on `GET /national/coverage`. */
2229
+ interface NationalJurisdictionCoverage {
2230
+ /** ISO 3166-1 alpha-2, e.g. `"AT"`. Non-EU legal orders (e.g. `"UK"`) are included too. */
2231
+ code: string;
2232
+ name: string;
2233
+ /** Whether customers can call this jurisdiction's endpoints today. */
2234
+ live: boolean;
2235
+ /** `null` before launch. */
2236
+ launchedAt?: string | null;
2237
+ legislation: NationalCoverageAvailability;
2238
+ caseLaw: NationalCaseLawCoverageAvailability;
2239
+ semanticSearch: NationalSemanticSearchAvailability;
2240
+ sources: NationalSource[];
2241
+ /** When this jurisdiction's corpus was last synced. `null` if never. */
2242
+ lastSyncAt?: string | null;
2243
+ /** The jurisdiction's citation graph as measured (API 2.11.0); `null` for one that is not live, or when its numbers could not be read. */
2244
+ citationGraph?: NationalCitationGraph | null;
2245
+ }
2246
+ /**
2247
+ * `GET /national/coverage` — public, free, no API key or allowance headers
2248
+ * required. Call this before `getNationalDocument` / `listNationalDocuments`
2249
+ * / `nationalSemanticSearch` / `nationalLegislationSemanticSearch` to check
2250
+ * whether a jurisdiction is live, so a 404 is never a surprise.
2251
+ */
2252
+ interface NationalCoverageResponse extends WithResponseHeaders {
2253
+ updatedAt: string;
2254
+ jurisdictions: NationalJurisdictionCoverage[];
2255
+ }
2256
+ /** Known `NationalTextBasis.basis` wire values (snake_case). Open for forward compatibility. */
2257
+ type NationalTextBasisKind = "as_announced" | "official_consolidated" | "official_consolidated_superseded" | "none" | (string & {});
2258
+ /**
2259
+ * `NationalDocument.textBasis` — which text a source says it publishes
2260
+ * (e.g. Poland). `null` (since API 2.8.0, no longer absent) for every
2261
+ * source that does not say.
2262
+ */
2263
+ interface NationalTextBasis {
2264
+ basis: NationalTextBasisKind;
2265
+ /** The date the text speaks for (never "valid until"). */
2266
+ asOf?: string;
2267
+ newerConsolidationExists?: boolean;
2268
+ newestPdfOnlyDate?: string;
2269
+ newerPdfOnly?: string[];
2270
+ amendedSince?: boolean;
2271
+ /** ELI of the act this text was consolidated from, when applicable. */
2272
+ textFrom?: string;
2273
+ }
2274
+ /**
2275
+ * What a national document is, in one vocabulary for every jurisdiction
2276
+ * (API 2.8.0): `"act"` (legislation) or `"decision"` (case law). Use it —
2277
+ * not `documentType`, the source's own label — to tell them apart.
2278
+ */
2279
+ type NationalDocumentKind = "act" | "decision";
2280
+ /**
2281
+ * A national document's metadata, as the listing returns it — the same
2282
+ * fields, types and formats for every jurisdiction (API 2.8.0). Every field
2283
+ * is always present; one the source does not provide is `null`, never
2284
+ * absent.
2285
+ */
2286
+ interface NationalDocumentSummary {
2287
+ /** The national corpus id (e.g. `"AT-NOR-12345"`), analogous to a CELEX number. */
2288
+ id: string;
2289
+ /** ISO 3166-1 alpha-2 jurisdiction code. */
2290
+ jurisdiction: string;
2291
+ /** ISO 639-1 code of the source language. */
2292
+ language: string;
2293
+ /**
2294
+ * `"act"` | `"decision"` — see {@link NationalDocumentKind}. `null` only
2295
+ * for an id that matches no collection LexAPI knows for the jurisdiction.
2296
+ */
2297
+ documentKind: NationalDocumentKind | null;
2298
+ title: string | null;
2299
+ /**
2300
+ * The source's own type label, in its language (`"Bundesgesetz (konsolidiert)"`,
2301
+ * `"Uitspraak (NL)"`) — different in every jurisdiction. Use `documentKind`
2302
+ * for act / decision.
2303
+ */
2304
+ documentType: string | null;
2305
+ /** The decision's ECLI. `null` for acts and where the source gives none. */
2306
+ ecli: string | null;
2307
+ /** The act's ELI (a URI). `null` where the source gives none. */
2308
+ eli: string | null;
2309
+ /** The document's own date, `YYYY-MM-DD`; `null` when the source gives none. */
2310
+ dateOfDocument: string | null;
2311
+ /** LexAPI's version counter for this document (bumped when its text changes). */
2312
+ version: number;
2313
+ /** When LexAPI last stored real content for it (ISO 8601). */
2314
+ fetchedAt: string;
2315
+ /**
2316
+ * Last day in force (`YYYY-MM-DD`), set once the source confirmed the act
2317
+ * is no longer in force. `null` when there is no known end (an act in
2318
+ * force, case law, a source that does not record repeals).
2319
+ */
2320
+ validTo: string | null;
2321
+ /** `false` once `validTo` has passed (UTC), `true` while it is today or later; `null` when `validTo` is `null`. */
2322
+ inForce: boolean | null;
2323
+ }
2324
+ /** Legislation a decision cites — {@link NationalDecision.citedNorms}. */
2325
+ interface NationalCitedNorm {
2326
+ /** The source's citation string (`"§ 62 Abs 1a S 3 EStG 2009"`, `"§ 7 177/1996 Sb."`). */
2327
+ text: string;
2328
+ /**
2329
+ * LexAPI id of the cited act when the source identifies it (CZ, SI, PL,
2330
+ * SE) — whether or not LexAPI holds that act; `null` otherwise.
2331
+ */
2332
+ documentId: string | null;
2333
+ }
2334
+ /**
2335
+ * A decision's case-law metadata (`documentKind: "decision"`). Values are
2336
+ * the source's own (local language and spelling); the field set and types
2337
+ * are the same in every jurisdiction — the server reads them from whichever
2338
+ * field the source uses (Austria's `gericht`, Germany's `aktenzeichen`, …),
2339
+ * so read these, never the raw source keys under `content.details`.
2340
+ */
2341
+ interface NationalDecision {
2342
+ /** The deciding court as the source names it (`"OGH"`, `"BFH 3. Senat"`, `"Gerechtshof Amsterdam"`). */
2343
+ court: string | null;
2344
+ /**
2345
+ * The chamber, section or department, where the source names it apart
2346
+ * from the court (`"Sección Cuarta"`, `"Civilni oddelek"`). `null`
2347
+ * otherwise (Austria and Germany name the panel inside `court`).
2348
+ */
2349
+ chamber: string | null;
2350
+ /** The case (docket) numbers as the source writes them (`["III R 27/24"]`); `[]` when none. */
2351
+ caseNumbers: string[];
2352
+ /** Legislation the decision cites, where the source lists it; `[]` otherwise. */
2353
+ citedNorms: NationalCitedNorm[];
2354
+ }
2355
+ /** One unit of an act (article, section, annex) — the same fields in every jurisdiction. */
2356
+ interface NationalArticle {
2357
+ /** The source's own label (`"§ 1"`, `"Art. 1"`, `"1 kap. 1 §"`); `null` for an unnumbered unit. */
2358
+ number: string | null;
2359
+ /** The unit's heading. */
2360
+ title: string | null;
2361
+ /** The part or chapter it sits in (`"Kapitel 1 — …"`, `"1 luku"`). */
2362
+ section: string | null;
2363
+ /** The unit's text; `null` when the source has no text for it — never an empty provision. */
2364
+ text: string | null;
2365
+ /** The unit's own validity start (`YYYY-MM-DD`), where the source dates units (AT, ES, FR). */
2366
+ inForceFrom: string | null;
2367
+ inForceTo: string | null;
2368
+ /** The source's other unit fields (unit ids, kinds, notes). Source-specific. */
2369
+ details: Record<string, unknown>;
2370
+ }
2371
+ /** `content.repeal` — the source's confirmation behind `validTo`. */
2372
+ interface NationalRepeal {
2373
+ /** Last day in force (`YYYY-MM-DD`). */
2374
+ validTo: string | null;
2375
+ /** What the source says, in its words. */
2376
+ basis: string | null;
2377
+ /** When LexAPI recorded it. */
2378
+ detectedAt: string | null;
2379
+ }
2380
+ /**
2381
+ * The parsed text of a national document — a closed key set, the same in
2382
+ * every jurisdiction (API 2.8.0). What a source adds beyond these keys is
2383
+ * under `source` (provenance) and `details`, both source-specific.
2384
+ */
2385
+ interface NationalDocumentContent {
2386
+ fullText: string;
2387
+ /** The act's units in order. `[]` for decisions and for acts the source publishes without units. */
2388
+ articles: NationalArticle[];
2389
+ /**
2390
+ * The languages the text is in (ISO 639-1). Dutch treaties (`NL-BWBV…`):
2391
+ * the languages BWB publishes the treaty in, in order (`["en", "nl"]`);
2392
+ * otherwise the one language of the text.
2393
+ */
2394
+ textLanguages: string[];
2395
+ /** Set when the whole text is in one language other than the document's `language`; else `null`. */
2396
+ textLanguage: string | null;
2397
+ /** `true` when the text includes text in a language other than the document's `language`. */
2398
+ embeddedForeignText: boolean;
2399
+ /**
2400
+ * Where the text was read from (API 2.9.0): `html` (the source's web
2401
+ * rendition), `pdf-text` (the text layer of the source's PDF) or `ocr`
2402
+ * (machine-read from a scanned page — see `ocr`). `null` for jurisdictions
2403
+ * that do not label it. Treat unknown values as additive.
2404
+ */
2405
+ textSource: NationalTextSource | null;
2406
+ /** `null` unless `textSource` is `ocr` (API 2.9.0). OCR text may contain recognition errors and is never the official text. */
2407
+ ocr: NationalOcrInfo | null;
2408
+ /** The source's confirmation that the act is no longer in force (the basis of `validTo`); `null` otherwise. */
2409
+ repeal: NationalRepeal | null;
2410
+ /** Provenance from the upstream (system, its ids and URLs). Keys vary by jurisdiction. */
2411
+ source: Record<string, unknown>;
2412
+ /** Everything else the source provides, under its own field names. Keys vary by jurisdiction. */
2413
+ details: Record<string, unknown>;
2414
+ }
2415
+ /** Known `NationalDocumentContent.textSource` values. Open for forward compatibility. */
2416
+ type NationalTextSource = "html" | "pdf-text" | "ocr" | (string & {});
2417
+ /** How an OCR'd national text was recognised (API 2.9.0). */
2418
+ interface NationalOcrInfo {
2419
+ engine: string | null;
2420
+ engineVersion: string | null;
2421
+ /** The version of the engine's recognition core. */
2422
+ coreVersion: string | null;
2423
+ /** The recognition model used. */
2424
+ traineddata: string | null;
2425
+ /** Recognition confidence, 0–100, averaged over the recognised characters. */
2426
+ confidence: number | null;
2427
+ /** The lowest page's confidence, 0–100. */
2428
+ minPageConfidence: number | null;
2429
+ /** The PDF pages read by OCR. */
2430
+ pages: number[];
2431
+ /** Pages of the same document read from the PDF's text layer. */
2432
+ textLayerPages: number[];
2433
+ /** Human-readable statement that the text is machine-read and not the official text. */
2434
+ notice: string;
2435
+ }
2436
+ /** Full national document — `GET /{jurisdiction}/documents/{id}` (API 2.8.0 shape). */
2437
+ interface NationalDocument extends NationalDocumentSummary {
2438
+ /**
2439
+ * Case-law metadata when `documentKind` is `"decision"` (served also when
2440
+ * the decision has no text); `null` for acts. See {@link isNationalDecision}.
2441
+ */
2442
+ decision: NationalDecision | null;
2443
+ /** `null` when the jurisdiction's source publishes no text for this id — check `textAvailability`. */
2444
+ content: NationalDocumentContent | null;
2445
+ textAvailability: TextAvailability;
2446
+ /** The jurisdiction's source attribution — always show this to users alongside the text. */
2447
+ attribution: string;
2448
+ /** Only from sources that say which text they publish (e.g. Poland); `null` for every other source. */
2449
+ textBasis: NationalTextBasis | null;
2450
+ }
2451
+ /** A {@link NationalDocument} narrowed to a decision (`decision` is non-null). */
2452
+ type NationalDecisionDocument = NationalDocument & {
2453
+ documentKind: "decision";
2454
+ decision: NationalDecision;
2455
+ };
2456
+ /**
2457
+ * Narrow a national document to a decision: `documentKind === "decision"`
2458
+ * with its `decision` block. Works the same for every jurisdiction.
2459
+ */
2460
+ declare function isNationalDecision(document: NationalDocument): document is NationalDecisionDocument;
2461
+ /**
2462
+ * `GET /{jurisdiction}/documents/{id}`. No `success` field (unlike the EU
2463
+ * document endpoints). Credit cost: every national read is a corpus read
2464
+ * (there is no live-fetch fallback) — reserved at the `document_fetch`
2465
+ * weight (5) and settled to the corpus-hit weight (1).
2466
+ */
2467
+ interface NationalDocumentResponse extends CreditedResponse, WithResponseHeaders {
2468
+ document: NationalDocument;
2469
+ }
2470
+ interface NationalDocumentListParams {
2471
+ /**
2472
+ * 1-based page, within the first `LISTING_MAX_OFFSET` (1,000) rows only —
2473
+ * `(page - 1) * limit >= 1000` is a 400 `InvalidParamsError`. Mutually
2474
+ * exclusive with `cursor`; omit both for page 1. Beyond the first 1,000
2475
+ * rows, page through with `cursor` (each response's `nextCursor`) instead.
2476
+ */
2477
+ page?: number;
2478
+ /**
2479
+ * Opaque keyset cursor from a previous response's `nextCursor`. Works at
2480
+ * any depth (unlike `page`, which only reaches the first 1,000 rows). An
2481
+ * invalid cursor is a 400.
2482
+ */
2483
+ cursor?: string;
2484
+ /** Default 20, max 100. */
2485
+ limit?: number;
2486
+ /** Case-insensitive title search, 3–200 characters (Unicode code points). */
2487
+ q?: string;
2488
+ /** Case-insensitive substring match on `documentType` (wire param: `type`), at most 200 characters. */
2489
+ documentType?: string;
2490
+ /** Repealed acts are hidden by default; `true` includes them. */
2491
+ includeRepealed?: boolean;
2492
+ }
2493
+ /**
2494
+ * `GET /{jurisdiction}/documents`. No `success` field. 3 credits per call
2495
+ * (flat — pagination does not multiply the price, unlike `search`).
2496
+ *
2497
+ * Results are newest-first by the document's own date (undated rows last),
2498
+ * then by id — a total order, so pages never repeat or skip a row even
2499
+ * while the corpus keeps changing underneath the walk.
2500
+ */
2501
+ interface NationalDocumentListResponse extends CreditedResponse, WithResponseHeaders {
2502
+ jurisdiction: string;
2503
+ /** Matching rows, counted up to 10,000 — see `totalExact`. */
2504
+ total: number;
2505
+ /** `false` when `total` is a lower bound (more than 10,000 rows matched, or the count timed out). */
2506
+ totalExact: boolean;
2507
+ /** Present only when the request paged with `page` (absent in cursor mode). */
2508
+ page?: number;
2509
+ limit: number;
2510
+ includeRepealed: boolean;
2511
+ /** `true` when another page follows — page with `nextCursor`. */
2512
+ hasMore: boolean;
2513
+ /** Opaque cursor for the next page (via `cursor`), or `null` on the last page. */
2514
+ nextCursor: string | null;
2515
+ results: NationalDocumentSummary[];
2516
+ }
2517
+ /**
2518
+ * Filters honoured by `POST /{jurisdiction}/search/semantic` — deliberately
2519
+ * an EXACT interface (no index signature): the server 400s any unsupported
2520
+ * key (`"Unsupported filter"`), so a typo here should be a compile error,
2521
+ * not a silent 400 at runtime. `jurisdiction` must equal the path's
2522
+ * jurisdiction, or be omitted.
2523
+ */
2524
+ interface NationalCaseLawFilters {
2525
+ court?: string;
2526
+ date_from?: string;
2527
+ date_to?: string;
2528
+ ecli?: string;
2529
+ language?: string;
2530
+ jurisdiction?: string;
2531
+ }
2532
+ /**
2533
+ * Filters honoured by `POST /{jurisdiction}/legislation/semantic` — exact,
2534
+ * like {@link NationalCaseLawFilters}. `law_id`/`in_force`/`law_type` are
2535
+ * the semantic index's own names, accepted as aliases.
2536
+ */
2537
+ interface NationalLegislationFilters {
2538
+ id?: string;
2539
+ law_id?: string;
2540
+ inForce?: boolean;
2541
+ in_force?: boolean;
2542
+ documentType?: string;
2543
+ law_type?: string;
2544
+ language?: string;
2545
+ jurisdiction?: string;
2546
+ }
2547
+ /**
2548
+ * Options for `nationalSemanticSearch`. `hyde` is accepted for API
2549
+ * compatibility but is always a no-op here: the national index never
2550
+ * rewrites, so the response reports `hyde: false` (never `true`) when the
2551
+ * request set it, and billing stays the flat 5 credits (no 15-credit tier).
2552
+ *
2553
+ * Deliberately NOT `extends SemanticSearchOptions`: `language` here is a
2554
+ * plain `string` (the jurisdiction's own language — anything else is a
2555
+ * 400), not the 10-code EU `SemanticLanguage` enum, and `filters` is the
2556
+ * exact {@link NationalCaseLawFilters} rather than a free-form record.
2557
+ */
2558
+ interface NationalSemanticCaseLawOptions {
2559
+ /** Natural-language query to embed. */
2560
+ query: string;
2561
+ /** Max results. Default 10. */
2562
+ limit?: number;
2563
+ /** Drop results below this cosine similarity (wire: `min_score`). */
2564
+ minScore?: number;
2565
+ /** Omit, or the jurisdiction's own language — any other value is a 400. */
2566
+ language?: string;
2567
+ /** Receive the full matched text per hit (wire: `include: ["text"]`) instead of a `snippet`. */
2568
+ includeText?: boolean;
2569
+ hyde?: boolean;
2570
+ filters?: NationalCaseLawFilters;
2571
+ }
2572
+ /**
2573
+ * Options for `nationalLegislationSemanticSearch`. No `hyde`, no `asOf` —
2574
+ * both are EU-only. See {@link NationalSemanticCaseLawOptions} for why this
2575
+ * does not extend `SemanticSearchOptions`.
2576
+ */
2577
+ interface NationalSemanticLegislationOptions {
2578
+ query: string;
2579
+ limit?: number;
2580
+ minScore?: number;
2581
+ /** Omit, or the jurisdiction's own language — any other value is a 400. */
2582
+ language?: string;
2583
+ includeText?: boolean;
2584
+ filters?: NationalLegislationFilters;
2585
+ }
2586
+ /**
2587
+ * Single hit from `nationalSemanticSearch`, same shape as
2588
+ * {@link SemanticCaseLawResult} (which index metadata fields are filled
2589
+ * depends on the national source) plus national fields. For metadata that
2590
+ * is the same in every jurisdiction, read `document` — the matched decision
2591
+ * as the listing returns it (API 2.8.0).
2592
+ */
2593
+ interface NationalSemanticCaseLawResult extends SemanticCaseLawResult {
2594
+ /** The national corpus id this hit resolved to (also mirrored into `metadata.celex_id`). */
2595
+ documentId: string;
2596
+ /** ISO 3166-1 alpha-2 jurisdiction code. */
2597
+ jurisdiction: string;
2598
+ /**
2599
+ * The matched decision as the listing returns it, from LexAPI's own
2600
+ * record — the same fields in every jurisdiction, whatever metadata the
2601
+ * index carries for it (API 2.8.0).
2602
+ */
2603
+ document: NationalDocumentSummary;
2604
+ /** When the source recorded an end of validity (also a future one). */
2605
+ validTo?: string;
2606
+ /** Only `false`, and only once `validTo` has passed. */
2607
+ inForce?: boolean;
2608
+ attribution: string;
2609
+ }
2610
+ /**
2611
+ * Single hit from `nationalLegislationSemanticSearch`, same shape as
2612
+ * {@link SemanticLegislationResult} plus national fields. Unlike the EU hit,
2613
+ * a national hit always carries `law_title`, `article_ref`, `section`,
2614
+ * `language`, `in_force`, `valid_from`, `valid_to` and `law_type` — `null`
2615
+ * when the index has nothing for the unit (API 2.8.0). NOTE: these index
2616
+ * fields are deliberately snake_case — that is what the server sends — do
2617
+ * not "fix" the casing without changing the server first. The act's
2618
+ * cross-jurisdiction metadata is under `document`.
2619
+ */
2620
+ interface NationalSemanticLegislationResult extends Omit<SemanticLegislationResult, "law_id" | "law_title" | "article_ref" | "section" | "language"> {
2621
+ /** LexAPI id of the act. */
2622
+ law_id: string;
2623
+ /** Same as `law_id`. */
2624
+ documentId: string;
2625
+ jurisdiction: string;
2626
+ law_title: string | null;
2627
+ /** The unit's label, as in `content.articles[].number` of the document. */
2628
+ article_ref: string | null;
2629
+ section: string | null;
2630
+ language: string | null;
2631
+ /**
2632
+ * From the index, as of today; `false` (with `valid_to`) when LexAPI
2633
+ * knows the act is repealed (LexAPI only ever overrides it toward
2634
+ * `false`); `null` when unknown.
2635
+ */
2636
+ in_force: boolean | null;
2637
+ /** The unit's validity start (`YYYY-MM-DD`), where the source dates units. */
2638
+ valid_from: string | null;
2639
+ valid_to: string | null;
2640
+ /** The index's type code of the act. */
2641
+ law_type: string | null;
2642
+ /** The matched act as the listing returns it, from LexAPI's own record (API 2.8.0). */
2643
+ document: NationalDocumentSummary;
2644
+ attribution: string;
2645
+ }
2646
+ /**
2647
+ * Why a national semantic search answer is incomplete. `SEARCH_INCOMPLETE`:
2648
+ * the national index could not complete the search.
2649
+ */
2650
+ type NationalSearchPartialReason = "SEARCH_INCOMPLETE" | (string & {});
2651
+ /**
2652
+ * `POST /{jurisdiction}/search/semantic` — national case-law semantic
2653
+ * search. `credits` is present on the body, like every other credit-metered
2654
+ * route, typed optional only via the shared `CreditedResponse` shape.
2655
+ */
2656
+ interface NationalSemanticCaseLawResponse extends CreditedResponse, WithResponseHeaders {
2657
+ success: boolean;
2658
+ searchType?: "semantic-case-law";
2659
+ jurisdiction?: string;
2660
+ query?: string;
2661
+ resultCount?: number;
2662
+ results: NationalSemanticCaseLawResult[];
2663
+ /** Present only when the request set `hyde: true` — always `false` (see {@link NationalSemanticCaseLawOptions}). */
2664
+ hyde?: boolean;
2665
+ metadata?: Record<string, unknown>;
2666
+ hint?: string;
2667
+ /**
2668
+ * Present (`true`) only when the national index could not complete the
2669
+ * search but some hits are left: the results may be missing better
2670
+ * matches. `hint` says what may complete it — a retry, or a rephrased
2671
+ * query / changed filters. When nothing is left to return the call fails
2672
+ * instead: `NationalSemanticUnavailableError` (503) or
2673
+ * `NationalSemanticFilterUnreachableError` (422).
2674
+ */
2675
+ partial?: true;
2676
+ /** Present with `partial`. */
2677
+ partialReason?: NationalSearchPartialReason;
2678
+ /** The jurisdiction's source attribution — always show this to users alongside results. */
2679
+ attribution?: string;
2680
+ tookMs?: number;
2681
+ semanticUsage?: SemanticUsageInfo;
2682
+ subscription?: {
2683
+ tier?: SubscriptionTier;
2684
+ maxResults?: number;
2685
+ };
2686
+ }
2687
+ /** `POST /{jurisdiction}/legislation/semantic` — national legislation semantic search. */
2688
+ interface NationalSemanticLegislationResponse extends CreditedResponse, WithResponseHeaders {
2689
+ success: boolean;
2690
+ searchType?: "semantic-legislation";
2691
+ jurisdiction?: string;
2692
+ query?: string;
2693
+ resultCount?: number;
2694
+ results: NationalSemanticLegislationResult[];
2695
+ metadata?: Record<string, unknown>;
2696
+ hint?: string;
2697
+ /**
2698
+ * Present (`true`) only when the national index could not complete the
2699
+ * search but some hits are left: the results may be missing better
2700
+ * matches. `hint` says what may complete it — a retry, or a rephrased
2701
+ * query / changed filters. When nothing is left to return the call fails
2702
+ * instead: `NationalSemanticUnavailableError` (503) or
2703
+ * `NationalSemanticFilterUnreachableError` (422).
2704
+ */
2705
+ partial?: true;
2706
+ /** Present with `partial`. */
2707
+ partialReason?: NationalSearchPartialReason;
2708
+ attribution?: string;
2709
+ tookMs?: number;
2710
+ semanticUsage?: SemanticUsageInfo;
2711
+ subscription?: {
2712
+ tier?: SubscriptionTier;
2713
+ maxResults?: number;
2714
+ };
2715
+ }
1541
2716
  /** Operational state. `FAILED` is set automatically when one delivery fails all 7 attempts (~24 h). */
1542
2717
  type WebhookStatus = "ACTIVE" | "PAUSED" | "FAILED";
1543
2718
  type DeliveryStatus = "PENDING" | "SUCCESS" | "FAILED" | "RETRYING";
@@ -2379,13 +3554,29 @@ declare class LexAPI {
2379
3554
  * `GET /citations/cites/{celexNumber}` — documents this one cites
2380
3555
  * (outbound edges), grouped by target. The document must first have been
2381
3556
  * crawled via `extractCitations` to appear here. 1 credit.
3557
+ *
3558
+ * `celexNumber` may be a national document id (e.g. `AT-NOR-10001597`);
3559
+ * `params.includeNational` also pulls in national neighbours of live
3560
+ * jurisdictions — BUSINESS, SCALE and ENTERPRISE only (`403
3561
+ * TierForbiddenError` below that, refunded in full). A national id whose
3562
+ * jurisdiction is not live is `404 NotFoundError`.
3563
+ *
3564
+ * Filters (API 2.11.0): `citationType`, `provenance`, `jurisdictions` and
3565
+ * `resolution` each take one value or a list (sent comma-separated). On a
3566
+ * national id, `unresolved: true` also returns the references the
3567
+ * document records that could not be turned into an edge
3568
+ * (`unresolved` / `unresolvedTruncated`), at no extra cost.
2382
3569
  */
2383
- getCites(celexNumber: string, params?: CitationEdgeParams, options?: CallOptions): Promise<CitesResponse>;
3570
+ getCites(celexNumber: string, params?: CitesParams, options?: CallOptions): Promise<CitesResponse>;
2384
3571
  /**
2385
3572
  * `GET /citations/cited-by/{celexNumber}` — documents that cite this one
2386
3573
  * (inbound edges), grouped by source. 1 credit. For legislation, inbound
2387
3574
  * amendment / corrigendum / repeal edges are refreshed from Cellar when
2388
3575
  * older than 7 days (waits ≤ ~2.5 s) — see `relationSync`.
3576
+ *
3577
+ * `celexNumber` may be a national document id; `params.includeNational`
3578
+ * also pulls in national neighbours of live jurisdictions — BUSINESS+
3579
+ * only (`403 TierForbiddenError` below that). Filters as on `getCites`.
2389
3580
  */
2390
3581
  getCitedBy(celexNumber: string, params?: CitationEdgeParams, options?: CallOptions): Promise<CitedByResponse>;
2391
3582
  /**
@@ -2397,7 +3588,7 @@ declare class LexAPI {
2397
3588
  * `celexNumber` may appear in two consecutive pages — merge by
2398
3589
  * `celexNumber` if you need one group per document.
2399
3590
  */
2400
- paginateCites(celexNumber: string, params?: CitationEdgeParams, options?: CallOptions): AsyncGenerator<CitesResponse, void>;
3591
+ paginateCites(celexNumber: string, params?: CitesParams, options?: CallOptions): AsyncGenerator<CitesResponse, void>;
2401
3592
  /**
2402
3593
  * Walk every page of `getCitedBy` (offset in edge rows) until a short or
2403
3594
  * empty page (SDK contract §1.4). Each page is a billed call (1 credit);
@@ -2412,6 +3603,10 @@ declare class LexAPI {
2412
3603
  * If the server-side wall-clock budget expires the endpoint still
2413
3604
  * returns 200 with `partial: true`, an EMPTY `network`, and `null`
2414
3605
  * paging totals — check `partial` before treating the network as empty.
3606
+ *
3607
+ * `celexNumber` may be a national document id; `params.includeNational`
3608
+ * also pulls in national neighbours of live jurisdictions — BUSINESS+
3609
+ * only (`403 TierForbiddenError` below that). See `getCites`.
2415
3610
  */
2416
3611
  getCitationNetwork(celexNumber: string, params?: CitationNetworkParams, options?: CallOptions): Promise<CitationNetworkResponse>;
2417
3612
  /**
@@ -2419,6 +3614,10 @@ declare class LexAPI {
2419
3614
  * outbound edges). 20 credits. `found: false` is a graceful HTTP 200,
2420
3615
  * not an error. Default `maxDepth` 3 (max 8); the visited set is bounded
2421
3616
  * to 5000 nodes.
3617
+ *
3618
+ * `from`/`to` may be national document ids; `params.includeNational` also
3619
+ * follows national documents of live jurisdictions along the way —
3620
+ * BUSINESS+ only (`403 TierForbiddenError` below that). See `getCites`.
2422
3621
  */
2423
3622
  getCitationPath(from: string, to: string, params?: CitationPathParams, options?: CallOptions): Promise<CitationPathResponse>;
2424
3623
  /**
@@ -2426,10 +3625,149 @@ declare class LexAPI {
2426
3625
  * neighbours (documents sharing the most outbound citation targets with
2427
3626
  * the seed). 20 credits. Returns a graceful empty list with `message`
2428
3627
  * when the seed has no outbound citations to couple on.
3628
+ *
3629
+ * `celexNumber` may be a national document id; `params.includeNational`
3630
+ * also considers national documents of live jurisdictions — BUSINESS+
3631
+ * only (`403 TierForbiddenError` below that). See `getCites`.
2429
3632
  */
2430
3633
  getRelatedDocuments(celexNumber: string, params?: RelatedDocumentsParams, options?: CallOptions): Promise<RelatedDocumentsResponse>;
2431
- /** `GET /citations/stats` — global citation graph statistics. 20 credits. */
3634
+ /**
3635
+ * `GET /citations/stats` — global citation graph statistics. 20 credits.
3636
+ *
3637
+ * `params.includeNational` also counts national documents of live
3638
+ * jurisdictions — BUSINESS+ only (`403 TierForbiddenError` below that).
3639
+ *
3640
+ * **Back-compat:** 0.2.0's signature was `getCitationStats(options?:
3641
+ * CallOptions)`. Both the single-argument form (`getCitationStats({
3642
+ * timeoutMs, signal })`) and the current two-argument form
3643
+ * (`getCitationStats(params, options)`) keep working — overloaded here so
3644
+ * TypeScript callers on either shape type-check, and a first argument
3645
+ * that looks like `CallOptions` rather than `CitationStatsParams` is also
3646
+ * detected at runtime (for a non-literal variable or a JS caller, which
3647
+ * the overloads alone can't catch) and honoured as the per-call options
3648
+ * rather than silently read as `params` with the timeout or abort signal
3649
+ * dropped.
3650
+ */
2432
3651
  getCitationStats(options?: CallOptions): Promise<CitationStatsResponse>;
3652
+ getCitationStats(params: CitationStatsParams, options?: CallOptions): Promise<CitationStatsResponse>;
3653
+ /**
3654
+ * `GET /citations/transposition/{celexNumber}` — the measures the member
3655
+ * states notified to the Commission for an EU act (CELEX sector 3),
3656
+ * grouped by country, from the Publications Office's Cellar records of the
3657
+ * notifications (API 2.11.0). **A notification is not a finding that the
3658
+ * measure transposes the act, or transposes it completely** — `note` says
3659
+ * so on every answer. 5 credits, every plan; a 5xx is refunded.
3660
+ *
3661
+ * On BUSINESS, SCALE and ENTERPRISE, for live jurisdictions, the answer
3662
+ * also says which measures LexAPI holds (`id`, `resolved`, `resolution`,
3663
+ * `resolutionBasis`, `counts.resolved`, `source.lanes`) and adds the
3664
+ * documents whose national source records that they transpose or
3665
+ * implement the act (`provenance: "source"`); `resolvedOnly: true` keeps
3666
+ * only the held ones. Below BUSINESS, for a jurisdiction that is not live,
3667
+ * and while the national-source terms are not accepted (`termsRequired:
3668
+ * true` — never a 403) those fields are `null`.
3669
+ *
3670
+ * A CELEX that is not an EU act (sector 3) is `404 NotFoundError`.
3671
+ */
3672
+ getTransposition(celexNumber: string, params?: TranspositionParams, options?: CallOptions): Promise<TranspositionResponse>;
3673
+ /**
3674
+ * `GET /citations/counterparts/{id}` — a national document's counterparts
3675
+ * in the other live jurisdictions, through the EU acts it transposes or
3676
+ * implements (API 2.11.0). Each `via[]` entry is one EU act, with the
3677
+ * other jurisdictions' measures for it ranked `1` (the national source
3678
+ * records the relation), `2` (a notified measure LexAPI holds) or `3` (a
3679
+ * notified Cellar record LexAPI does not hold, `id: null`). An EU act
3680
+ * CELEX as `id` lists its own measures the same way.
3681
+ *
3682
+ * **20 credits; BUSINESS, SCALE and ENTERPRISE only** (`403
3683
+ * TierForbiddenError` below that, refunded). A lookup past its 20-second
3684
+ * server-side budget throws `TimeoutError` (503, `err.partial === true`),
3685
+ * refunded. The SDK does not retry it (the same lookup would hit the same
3686
+ * budget); retry yourself, or narrow with `jurisdictions`.
3687
+ */
3688
+ getCounterparts(id: string, params?: CounterpartsParams, options?: CallOptions): Promise<CounterpartsResponse>;
3689
+ /**
3690
+ * `GET /national/coverage` — which jurisdictions are live, what each one
3691
+ * covers (legislation / case law, semantic search, sources with their
3692
+ * attribution), and when each was last synced. Public: no API key or
3693
+ * allowance required, free.
3694
+ */
3695
+ getNationalCoverage(options?: CallOptions): Promise<NationalCoverageResponse>;
3696
+ /**
3697
+ * `GET /{jurisdiction}/documents/{id}` — one national document by its
3698
+ * corpus id (e.g. `"AT-NOR-12345"`), analogous to `getDocument`.
3699
+ *
3700
+ * **Cost: 1 credit** — every national read is a corpus read (there is no
3701
+ * live-fetch fallback), so the 5-credit upfront reservation always
3702
+ * settles to 1 (an unknown id too). Check
3703
+ * `document.textAvailability.available` before reading `content`, and
3704
+ * always show `document.attribution` to the user alongside the text.
3705
+ * The document has one shape for every jurisdiction (API 2.8.0):
3706
+ * `documentKind` (`act` | `decision`), `decision` (court, chamber,
3707
+ * caseNumbers, citedNorms — `null` for acts; see `isNationalDecision`)
3708
+ * and the closed `content` key set.
3709
+ *
3710
+ * A document its source withdrew (a takedown, a pseudonymisation fix)
3711
+ * throws `DocumentWithdrawnError` (410) instead of answering — nothing of
3712
+ * it is served, not even the title; drop any copy you hold.
3713
+ */
3714
+ getNationalDocument(jurisdiction: string, id: string, params?: {
3715
+ language?: string;
3716
+ }, options?: CallOptions): Promise<NationalDocumentResponse>;
3717
+ /**
3718
+ * `GET /{jurisdiction}/documents` — browse a jurisdiction's corpus by
3719
+ * title (`q`), type, and in-force status. Newest-first by the document's
3720
+ * own date.
3721
+ *
3722
+ * **Cost: 3 credits per call** — flat; pagination does not multiply the
3723
+ * price, unlike `search`. **Paging:** `page` only reaches the first 1,000
3724
+ * rows (a 400 past that); page further with `cursor` (each response's
3725
+ * `nextCursor`), which works at any depth — see
3726
+ * `paginateNationalDocuments` for a ready-made walk. A slow page is a
3727
+ * retry-safe `TimeoutError` (504, refunded); the `total` count is capped
3728
+ * at 10,000 and flagged `totalExact: false` past that or on a slow count.
3729
+ */
3730
+ listNationalDocuments(jurisdiction: string, params?: NationalDocumentListParams, options?: CallOptions): Promise<NationalDocumentListResponse>;
3731
+ /**
3732
+ * Walk every page of `listNationalDocuments` via `cursor` (works past the
3733
+ * 1,000-row `page` ceiling, unlike passing `page` yourself). Each page is
3734
+ * a separate billed call. Stops after a page with `hasMore: false` (or an
3735
+ * empty page). Any `params.page` is ignored and never sent — pass
3736
+ * `params.cursor` only to resume a walk you saved partway through;
3737
+ * `page` together with `cursor` is a 400 ("Use either cursor or page,
3738
+ * not both"), so this strips `page` at runtime, not just in the type
3739
+ * (`Omit` alone only guards TypeScript callers — a JS caller, or one
3740
+ * using `as`, could otherwise still pass it through).
3741
+ */
3742
+ paginateNationalDocuments(jurisdiction: string, params?: Omit<NationalDocumentListParams, "page">, options?: CallOptions): AsyncGenerator<NationalDocumentListResponse, void>;
3743
+ /**
3744
+ * `POST /{jurisdiction}/search/semantic` — embedding-based semantic
3745
+ * search over a jurisdiction's case law. Same request/response shape as
3746
+ * `semanticSearch`, plus `jurisdiction`/`documentId`/`attribution` and
3747
+ * `document` (the matched decision as the listing returns it — the same
3748
+ * fields in every jurisdiction, API 2.8.0) on every hit.
3749
+ *
3750
+ * **Cost: a flat 5 credits** — `hyde` is accepted but never changes the
3751
+ * price or the billing tier here: the national index never rewrites, so
3752
+ * the response reports `hyde: false` (never `true`) when requested.
3753
+ */
3754
+ nationalSemanticSearch(jurisdiction: string, request: NationalSemanticCaseLawOptions, options?: CallOptions): Promise<NationalSemanticCaseLawResponse>;
3755
+ /**
3756
+ * `POST /{jurisdiction}/legislation/semantic` — embedding-based semantic
3757
+ * search over a jurisdiction's legislation; article-level matches. Same
3758
+ * shape as `semanticLegislationSearch`, plus `jurisdiction`/`documentId`/
3759
+ * `attribution` and `document` (the matched act's listing summary) on
3760
+ * every hit; the index fields (`law_title`, `article_ref`, `section`,
3761
+ * `language`, `in_force`, `valid_from`, `valid_to`, `law_type`) are
3762
+ * always present, `null` when the index has nothing (API 2.8.0). No `hyde`, no `asOf` — both are EU-only.
3763
+ * `NationalSemanticLegislationOptions` has no `hyde` field, and this SDK
3764
+ * never forwards one on this call even if a caller bypasses the type
3765
+ * system — the server now validates `hyde` as a boolean on this route too
3766
+ * (400 otherwise), so a stray non-boolean value would 400 for nothing.
3767
+ *
3768
+ * **Cost: 5 credits.**
3769
+ */
3770
+ nationalLegislationSemanticSearch(jurisdiction: string, request: NationalSemanticLegislationOptions, options?: CallOptions): Promise<NationalSemanticLegislationResponse>;
2433
3771
  /**
2434
3772
  * `POST /search/semantic` — embedding-based semantic search over CJEU
2435
3773
  * case law. Use this (not `search`) for *concept* queries; EUR-Lex
@@ -2598,6 +3936,6 @@ declare function verifySignature(rawBody: WebhookBody, signature: string | null
2598
3936
  */
2599
3937
  declare function verifyWebhook(rawBody: WebhookBody, signature: string | null | undefined, secret: string, options?: VerifyWebhookOptions): Promise<WebhookPayload>;
2600
3938
 
2601
- declare const VERSION = "0.2.0";
3939
+ declare const VERSION = "0.4.0";
2602
3940
 
2603
- export { AS_OF_REASONS, type AcceptLanguages, type Annex, type Article, type AsOfReason, type AsOfVersion, AuthenticationError, type Author, type BatchDocumentError, type BatchSourceCounts, type CallOptions, type CitationEdgeDetail, type CitationEdgeParams, type CitationEdgeSummary, type CitationExtractResponse, type CitationNeighbour, type CitationNetworkParams, type CitationNetworkResponse, type CitationPathNode, type CitationPathParams, type CitationPathResponse, type CitationStatsResponse, type CitationStatsTopCited, type CitationStatsTopCiting, type CitationType, type CitedByResponse, type CitedDocumentGroup, type CitesResponse, type CitingDocumentGroup, type ConsolidatedVersionHint, type CreditUsage, type CreditedResponse, type CreditsExhaustedDetails, CreditsExhaustedError, type CreditsInfo, DEFAULT_BASE_URL, DEFAULT_TIMEOUT_MS, type DeliveryStatus, type Document, type DocumentByUrlRequest, type DocumentByUrlResponse, type DocumentContent, type DocumentContentBatchRequest, type DocumentContentBatchResponse, type DocumentContentRequest, type DocumentContentResponse, type DocumentMetadata, type DocumentMetadataRequest, type DocumentMetadataResponse, type DocumentType, type DocumentTypeCode, type DocumentUrls, type DocumentVersionResponse, type DocumentVersionsResponse, type Domain, type ErrorCode, type ExportDone, type ExportDoneInfo, type ExportHeaderInfo, type ExportListFilter, type ExportMeta, type ExportMetaInfo, type ExportParams, type ExportRow, type ExportStream, type ExportStreamOptions, type IdentifierType, type IncludeSelection, type IncludeToken, IncompleteExportError, type InfoResponse, type InfoSearchFilters, InternalServerError, InvalidCelexError, InvalidParamsError, InvalidResponseError, InvalidUrlError, type Language, LexAPI, LexAPIError, type LexAPIErrorContext, type LexAPIOptions, NetworkError, NotFoundError, type OneOrMany, type Procedure, type RateLimitInfo, RateLimitedError, type RecentDocumentsParams, type RecentDocumentsResponse, type Recital, type RelatedDocument, type RelatedDocumentsParams, type RelatedDocumentsResponse, type RelationSync, RequestAbortedError, type ResolveResponse, type ResolvedVia, type ResponseHeaders, type RetryOptions, type SearchRequest, type SearchResponse, type SearchResult, type Section, type SemanticCaseLawResult, type SemanticCaseLawSearchOptions, type SemanticCaseLawSearchResponse, type SemanticLanguage, type SemanticLegislationResult, type SemanticLegislationSearchOptions, type SemanticLegislationSearchResponse, type SemanticSearchOptions, type SemanticUsageInfo, ServiceUnavailableError, type Subdomain, type SubscriptionInfo, type SubscriptionTier, type Table, type TextAvailability, type TextScope, type TextUnavailableReason, TierForbiddenError, TimeoutError, type TitleSource, UpstreamError, type UsageInfo, VERSION, type VerifyWebhookOptions, type VersionEntry, type VersionParams, WEBHOOK_DELIVERY_HEADER, WEBHOOK_ID_HEADER, WEBHOOK_SIGNATURE_HEADER, type WatchlistRelation, type WebhookBody, type WebhookChangeDocument, type WebhookCreateRequest, type WebhookCreateResponse, type WebhookCriteria, type WebhookDeleteResponse, type WebhookDeliveriesParams, type WebhookDeliveriesResponse, type WebhookDelivery, type WebhookDeliveryEnvelope, type WebhookDetail, type WebhookDocumentsNewPayload, type WebhookListItem, type WebhookListResponse, type WebhookPayload, type WebhookResponse, type WebhookRetryPolicy, WebhookSignatureError, type WebhookStatus, type WebhookTestPayload, type WebhookTestResponse, type WebhookUpdateRequest, type WebhookUpdateResponse, type WebhookWatchlistChange, type WebhookWatchlistChangesPayload, WebhooksAPI, type WithResponseHeaders, computeSignature, getCreditUsage, isLexAPIError, normalizeRetryAfterSeconds, parseResponseHeaders, verifySignature, verifyWebhook };
3941
+ export { AS_OF_REASONS, type AcceptLanguages, type Annex, type Article, type AsOfReason, type AsOfVersion, AuthenticationError, type Author, type BatchDocumentError, type BatchSourceCounts, CITATION_PROVENANCES, CITATION_RESOLUTIONS, CITATION_TYPES, type CallOptions, type CitationDocumentKind, type CitationEdgeDetail, type CitationEdgeKind, type CitationEdgeParams, type CitationEdgeSummary, type CitationExtractResponse, type CitationFilterParams, type CitationNeighbour, type CitationNetworkParams, type CitationNetworkResponse, type CitationNode, type CitationPathNode, type CitationPathParams, type CitationPathResponse, type CitationProvenance, type CitationResolution, type CitationStatsParams, type CitationStatsResponse, type CitationStatsTopCited, type CitationStatsTopCiting, type CitationType, type CitedByResponse, type CitedDocumentGroup, type CitesParams, type CitesResponse, type CitingDocumentGroup, type ConsolidatedVersionHint, type Counterpart, type CounterpartVia, type CounterpartsParams, type CounterpartsResponse, type CountsSource, type CreditUsage, type CreditedResponse, type CreditsExhaustedDetails, CreditsExhaustedError, type CreditsInfo, DEFAULT_BASE_URL, DEFAULT_TIMEOUT_MS, type DeliveryStatus, type Document, type DocumentByUrlRequest, type DocumentByUrlResponse, type DocumentContent, type DocumentContentBatchRequest, type DocumentContentBatchResponse, type DocumentContentRequest, type DocumentContentResponse, type DocumentMetadata, type DocumentMetadataRequest, type DocumentMetadataResponse, type DocumentType, type DocumentTypeCode, type DocumentUrls, type DocumentVersionResponse, type DocumentVersionsResponse, type DocumentWithdrawnDetails, DocumentWithdrawnError, type Domain, type ErrorCode, type ExportDone, type ExportDoneInfo, type ExportHeaderInfo, type ExportListFilter, type ExportMeta, type ExportMetaInfo, type ExportParams, type ExportRow, type ExportStream, type ExportStreamOptions, type IdentifierType, type IncludeSelection, type IncludeToken, IncompleteExportError, type InfoResponse, type InfoSearchFilters, InternalServerError, InvalidCelexError, InvalidParamsError, InvalidResponseError, InvalidUrlError, type Language, LexAPI, LexAPIError, type LexAPIErrorContext, type LexAPIOptions, type NationalAllowanceExhaustedDetails, NationalAllowanceExhaustedError, type NationalArticle, type NationalCaseLawCoverageAvailability, type NationalCaseLawFilters, type NationalCitationGraph, type NationalCitationGraphFloors, type NationalCitationGraphMethods, type NationalCitationGraphPrecision, type NationalCitationGraphRateKey, type NationalCitationGraphUnmeasuredReason, type NationalCitedNorm, type NationalCoverageAvailability, type NationalCoverageResponse, type NationalDecision, type NationalDecisionDocument, type NationalDocument, type NationalDocumentContent, type NationalDocumentKind, type NationalDocumentListParams, type NationalDocumentListResponse, type NationalDocumentResponse, type NationalDocumentSummary, type NationalJurisdictionCoverage, type NationalLegislationFilters, type NationalOcrInfo, type NationalRepeal, type NationalSearchPartialReason, type NationalSemanticCaseLawOptions, type NationalSemanticCaseLawResponse, type NationalSemanticCaseLawResult, NationalSemanticFilterUnreachableError, type NationalSemanticLegislationOptions, type NationalSemanticLegislationResponse, type NationalSemanticLegislationResult, NationalSemanticNotEnabledError, type NationalSemanticSearchAvailability, NationalSemanticUnavailableError, type NationalSource, type NationalTextBasis, type NationalTextBasisKind, type NationalTextSource, NetworkError, NotFoundError, type OneOrMany, type Procedure, type RateLimitInfo, RateLimitedError, type RecentDocumentsParams, type RecentDocumentsResponse, type Recital, type RelatedDocument, type RelatedDocumentsParams, type RelatedDocumentsResponse, type RelationSync, RequestAbortedError, type ResolveResponse, type ResolvedVia, type ResponseHeaders, type RetryOptions, type SearchRequest, type SearchResponse, type SearchResult, type Section, type SemanticCaseLawResult, type SemanticCaseLawSearchOptions, type SemanticCaseLawSearchResponse, type SemanticLanguage, type SemanticLegislationResult, type SemanticLegislationSearchOptions, type SemanticLegislationSearchResponse, type SemanticSearchOptions, type SemanticUsageInfo, ServiceUnavailableError, type Subdomain, type SubscriptionInfo, type SubscriptionTier, type Table, type TextAvailability, type TextScope, type TextUnavailableReason, TierForbiddenError, TimeoutError, type TitleSource, type TranspositionCountry, type TranspositionMeasure, type TranspositionParams, type TranspositionResponse, type UnresolvedReference, UpstreamError, type UsageInfo, VERSION, type VerifyWebhookOptions, type VersionEntry, type VersionParams, WEBHOOK_DELIVERY_HEADER, WEBHOOK_ID_HEADER, WEBHOOK_SIGNATURE_HEADER, type WatchlistRelation, type WebhookBody, type WebhookChangeDocument, type WebhookCreateRequest, type WebhookCreateResponse, type WebhookCriteria, type WebhookDeleteResponse, type WebhookDeliveriesParams, type WebhookDeliveriesResponse, type WebhookDelivery, type WebhookDeliveryEnvelope, type WebhookDetail, type WebhookDocumentsNewPayload, type WebhookListItem, type WebhookListResponse, type WebhookPayload, type WebhookResponse, type WebhookRetryPolicy, WebhookSignatureError, type WebhookStatus, type WebhookTestPayload, type WebhookTestResponse, type WebhookUpdateRequest, type WebhookUpdateResponse, type WebhookWatchlistChange, type WebhookWatchlistChangesPayload, WebhooksAPI, type WithResponseHeaders, computeSignature, getCreditUsage, isLexAPIError, isNationalDecision, normalizeRetryAfterSeconds, parseResponseHeaders, verifySignature, verifyWebhook };