@tricoteuses/tisseuse 0.22.2 → 0.22.3
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/README.md +11 -2
- package/dist/{html-BTaoaqX5.js → html-ClFZh0_V.js} +3991 -4556
- package/dist/index.js +53 -52
- package/dist/lib/extractors/links.d.ts +39 -5
- package/dist/lib/index.d.ts +3 -2
- package/dist/lib/legi/canutes_resolver.d.ts +24 -3
- package/dist/lib/legi/europe_attestation.d.ts +20 -0
- package/dist/lib/legi/europe_attestation.fixture.d.ts +8 -0
- package/dist/lib/legi/europe_attestation.test.d.ts +1 -0
- package/dist/lib/legi/europe_designation.d.ts +76 -0
- package/dist/lib/legi/europe_designation.test.d.ts +1 -0
- package/dist/lib/legi/europe_designation_cellar.test.d.ts +1 -0
- package/dist/lib/legi/europe_observation.d.ts +23 -0
- package/dist/lib/legi/europe_observation.test.d.ts +1 -0
- package/dist/lib/legi/resolver.d.ts +95 -0
- package/dist/lib/linkers/bascule_render_decisions.test.d.ts +1 -0
- package/dist/lib/linkers/html_european.test.d.ts +1 -0
- package/dist/lib/linkers/link_decision_metadata.d.ts +5 -0
- package/dist/lib/links.d.ts +29 -0
- package/dist/lib/text_parsers/ast.d.ts +6 -0
- package/dist/link-decision-metadata.js +8 -2
- package/dist/{resolver-GT7457lQ.js → resolver-C8c79uNU.js} +1341 -406
- package/dist/scripts/shared/assemblee_document_content.d.ts +46 -0
- package/dist/scripts/shared/assemblee_document_content.test.d.ts +1 -0
- package/dist/server-f-legi.js +83 -83
- package/dist/server.js +445 -445
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { $ as e,
|
|
2
|
-
import { $ as
|
|
1
|
+
import { $ as e, At as t, B as n, Ct as r, Dt as i, Et as a, F as o, Ft as s, G as c, H as l, I as u, It as d, J as f, K as p, L as m, Lt as h, Mt as ee, N as te, Nt as ne, Ot as re, P as ie, Pt as ae, Q as oe, R as se, St as ce, Tt as le, V as ue, X as de, Y as fe, Z as pe, _ as me, _t as he, a as ge, at as _e, bt as ve, c as ye, ct as be, dt as xe, et as Se, g as Ce, gt as we, h as Te, ht as Ee, i as De, it as Oe, jt as ke, k as Ae, kt as g, l as _, lt as v, mt as y, n as b, o as x, ot as S, pt as C, q as je, r as Me, rt as Ne, s as w, st as Pe, t as Fe, tt as Ie, u as Le, ut as Re, v as ze, vt as Be, w as Ve, wt as He, xt as Ue, y as We, yt as Ge, z as Ke } from "./html-ClFZh0_V.js";
|
|
2
|
+
import { $ as qe, $t as Je, A as Ye, An as Xe, Bt as Ze, Cn as Qe, En as $e, Fn as T, Ft as et, G as tt, Gn as nt, Gt as rt, Hn as it, Ht as at, I as ot, In as E, It as st, J as ct, K as lt, Kn as ut, Kt as dt, L as D, Ln as O, M as ft, Mn as pt, N as mt, O as ht, Ot as gt, P as _t, Pn as vt, Q as k, Qt as yt, R as A, Rn as j, Rt as bt, S as xt, Sn as St, St as Ct, Tn as wt, Un as M, Ut as Tt, Vn as N, Vt as Et, Wn as Dt, Wt as Ot, X as kt, Xt as At, Y as jt, Yt as Mt, Z as Nt, Zt as Pt, _t as P, a as Ft, an as It, at as Lt, b as F, bn as Rt, bt as zt, c as Bt, cn as Vt, ct as I, dn as Ht, dt as Ut, en as Wt, et as Gt, fn as Kt, ft as qt, gt as L, h as Jt, hn as Yt, ht as Xt, i as Zt, in as Qt, it as $t, j as en, jn as tn, k as nn, kn as R, kt as rn, l as an, ln as on, lt as sn, m as cn, mn as ln, mt as un, n as z, nn as dn, nt as fn, o as B, on as pn, ot as mn, pn as hn, pt as gn, q as _n, qn as V, qt as vn, r as yn, rn as bn, s as H, sn as xn, st as U, t as Sn, tn as Cn, tt as wn, un as Tn, ut as En, vn as Dn, vt as On, wn as kn, wt as An, x as jn, xt as Mn, y as Nn, yt as Pn, z as Fn } from "./resolver-C8c79uNU.js";
|
|
3
|
+
import { linkDecisionReferenceClasses as In } from "./link-decision-metadata.js";
|
|
3
4
|
//#region src/lib/cache.ts
|
|
4
|
-
var
|
|
5
|
-
assemblee:
|
|
6
|
-
legifrance:
|
|
7
|
-
}),
|
|
8
|
-
function
|
|
9
|
-
return
|
|
5
|
+
var W = () => /* @__PURE__ */ new Map(), G = () => /* @__PURE__ */ new Map(), Ln = () => ({
|
|
6
|
+
assemblee: W(),
|
|
7
|
+
legifrance: G()
|
|
8
|
+
}), Rn = new Intl.DateTimeFormat("fr-FR", { dateStyle: "long" });
|
|
9
|
+
function zn(e) {
|
|
10
|
+
return Rn.format(new Date(e)).replace(/^1 /, "1er ");
|
|
10
11
|
}
|
|
11
12
|
//#endregion
|
|
12
13
|
//#region src/lib/json.ts
|
|
13
|
-
var
|
|
14
|
+
var Bn = (e, t) => t instanceof Object && !Array.isArray(t) ? Object.keys(t).sort().reduce((e, n) => (e[n] = t[n], e), {}) : t;
|
|
14
15
|
//#endregion
|
|
15
16
|
//#region src/lib/markdown.ts
|
|
16
17
|
function K(e) {
|
|
@@ -19,13 +20,13 @@ function K(e) {
|
|
|
19
20
|
//#endregion
|
|
20
21
|
//#region src/lib/linkers/markdown.ts
|
|
21
22
|
async function q({ canutesDb: e, callerDate: t, legiResolver: n, date: r, linkBaseUrl: i, linkDecisionDocumentId: a, linkType: o, parsingMode: s, previousContext: c, text: l }) {
|
|
22
|
-
let u = n ?? (e === void 0 ? void 0 : new
|
|
23
|
+
let u = n ?? (e === void 0 ? void 0 : new Le(e));
|
|
23
24
|
if (u === void 0) throw Error("A Canutes database or legal resolver is required");
|
|
24
25
|
await u.preloadTextTitlesInfos();
|
|
25
|
-
let d =
|
|
26
|
+
let d = k(l), f = new T(d.output);
|
|
26
27
|
f.currentArticle = c?.currentArticle, f.currentText = c?.currentText;
|
|
27
28
|
let p = l, m = 0, h = a === void 0 ? void 0 : [];
|
|
28
|
-
for await (let e of
|
|
29
|
+
for await (let e of w({
|
|
29
30
|
callerDate: t,
|
|
30
31
|
legiResolver: u,
|
|
31
32
|
context: f,
|
|
@@ -39,10 +40,10 @@ async function q({ canutesDb: e, callerDate: t, legiResolver: n, date: r, linkBa
|
|
|
39
40
|
})) switch (e.type) {
|
|
40
41
|
case "article_definition": break;
|
|
41
42
|
case "external_article": {
|
|
42
|
-
let { articleId: t, historyArticleId: n, originalTransformation: r } = e, a = t === void 0 ? n === void 0 ? void 0 :
|
|
43
|
+
let { articleId: t, historyArticleId: n, originalTransformation: r } = e, a = t === void 0 ? n === void 0 ? void 0 : B(o, i, n) : H(o, i, t);
|
|
43
44
|
if (a !== void 0) {
|
|
44
45
|
if (r === void 0) throw Error(`Missing originalTransformation attribute in external article link: ${JSON.stringify(e, null, 2)}`);
|
|
45
|
-
let t =
|
|
46
|
+
let t = I(r, `[${K(U(p, r, m))}](${a})`);
|
|
46
47
|
p = p.slice(0, r.position.start + m) + t + p.slice(r.position.stop + m), m += t.length - (r.position.stop - r.position.start);
|
|
47
48
|
}
|
|
48
49
|
break;
|
|
@@ -51,7 +52,7 @@ async function q({ canutesDb: e, callerDate: t, legiResolver: n, date: r, linkBa
|
|
|
51
52
|
let { originalTransformation: t, sectionTaId: n } = e;
|
|
52
53
|
if (n !== void 0) {
|
|
53
54
|
if (t === void 0) throw Error(`Missing originalTransformation attribute in external division link: ${JSON.stringify(e, null, 2)}`);
|
|
54
|
-
let r =
|
|
55
|
+
let r = I(t, `[${K(U(p, t, m))}](${H(o, i, n)})`);
|
|
55
56
|
p = p.slice(0, t.position.start + m) + r + p.slice(t.position.stop + m), m += r.length - (t.position.stop - t.position.start);
|
|
56
57
|
}
|
|
57
58
|
break;
|
|
@@ -63,25 +64,25 @@ async function q({ canutesDb: e, callerDate: t, legiResolver: n, date: r, linkBa
|
|
|
63
64
|
continue;
|
|
64
65
|
}
|
|
65
66
|
if (t === void 0) throw Error(`Missing originalTransformation attribute in external text link: ${JSON.stringify(e, null, 2)}`);
|
|
66
|
-
let a =
|
|
67
|
+
let a = z(f.text(n.position)), s;
|
|
67
68
|
if (a !== void 0) {
|
|
68
|
-
let { articleId: t, historyArticleId: c } = e.namedArticle ?? await
|
|
69
|
+
let { articleId: t, historyArticleId: c } = e.namedArticle ?? await _({
|
|
69
70
|
date: r,
|
|
70
71
|
legiResolver: u,
|
|
71
72
|
num: a,
|
|
72
73
|
textId: n.cid
|
|
73
74
|
});
|
|
74
|
-
t === void 0 ? c !== void 0 && (s =
|
|
75
|
+
t === void 0 ? c !== void 0 && (s = B(o, i, c)) : s = H(o, i, t);
|
|
75
76
|
}
|
|
76
|
-
s === void 0 && (s =
|
|
77
|
-
let c =
|
|
77
|
+
s === void 0 && (s = H(o, i, n.cid));
|
|
78
|
+
let c = I(t, `[${K(U(p, t, m))}](${s})`);
|
|
78
79
|
p = p.slice(0, t.position.start + m) + c + p.slice(t.position.stop + m), m += c.length - (t.position.stop - t.position.start);
|
|
79
80
|
break;
|
|
80
81
|
}
|
|
81
82
|
case "internal_article": {
|
|
82
83
|
let { definition: t, originalTransformation: n } = e;
|
|
83
84
|
if (n === void 0) throw Error(`Missing originalTransformation attribute in internal article link: ${JSON.stringify(e, null, 2)}`);
|
|
84
|
-
let r =
|
|
85
|
+
let r = I(n, `[${K(U(p, n, m))}](#definition_article_${t.textId}_${t.article.num.replaceAll(" ", "_")})`);
|
|
85
86
|
p = p.slice(0, n.position.start + m) + r + p.slice(n.position.stop + m), m += r.length - (n.position.stop - n.position.start);
|
|
86
87
|
break;
|
|
87
88
|
}
|
|
@@ -89,11 +90,11 @@ async function q({ canutesDb: e, callerDate: t, legiResolver: n, date: r, linkBa
|
|
|
89
90
|
let { url: t, originalTransformation: n } = e;
|
|
90
91
|
if (t === void 0) continue;
|
|
91
92
|
if (n === void 0) throw Error(`Missing originalTransformation attribute in european text link: ${JSON.stringify(e, null, 2)}`);
|
|
92
|
-
let r =
|
|
93
|
+
let r = U(p, n, m), i = I(n, `<a class="${In.european_text.linked}" href="${t}"${t.startsWith("/") ? "" : " target=\"_blank\""}>${r}</a>`);
|
|
93
94
|
p = p.slice(0, n.position.start + m) + i + p.slice(n.position.stop + m), m += i.length - (n.position.stop - n.position.start);
|
|
94
95
|
break;
|
|
95
96
|
}
|
|
96
|
-
default:
|
|
97
|
+
default: V("Link", e);
|
|
97
98
|
}
|
|
98
99
|
return {
|
|
99
100
|
context: f,
|
|
@@ -103,7 +104,7 @@ async function q({ canutesDb: e, callerDate: t, legiResolver: n, date: r, linkBa
|
|
|
103
104
|
}
|
|
104
105
|
//#endregion
|
|
105
106
|
//#region src/lib/loaders/assemblee.ts
|
|
106
|
-
async function
|
|
107
|
+
async function Vn(e, t, n) {
|
|
107
108
|
let r = t.get("Document");
|
|
108
109
|
r === void 0 && (r = /* @__PURE__ */ new Map(), t.set("Document", r));
|
|
109
110
|
let i = r.get(n);
|
|
@@ -113,7 +114,7 @@ async function In(e, t, n) {
|
|
|
113
114
|
WHERE uid = ${n}
|
|
114
115
|
`)[0]?.data, r.set(n, i ?? null)), i ?? void 0;
|
|
115
116
|
}
|
|
116
|
-
async function
|
|
117
|
+
async function Hn(e, t, n) {
|
|
117
118
|
let r = t.get("Document");
|
|
118
119
|
return r === void 0 && (r = /* @__PURE__ */ new Map(), t.set("Document", r)), (await e`
|
|
119
120
|
SELECT data, uid
|
|
@@ -121,7 +122,7 @@ async function Ln(e, t, n) {
|
|
|
121
122
|
WHERE data ->> 'dossierRef' = ${n}
|
|
122
123
|
`).map(({ data: e, uid: t }) => (r.set(t, e ?? null), e));
|
|
123
124
|
}
|
|
124
|
-
async function
|
|
125
|
+
async function Un(e, t, n) {
|
|
125
126
|
let r = t.get("DossierParlementaire");
|
|
126
127
|
r === void 0 && (r = /* @__PURE__ */ new Map(), t.set("DossierParlementaire", r));
|
|
127
128
|
let i = r.get(n);
|
|
@@ -133,15 +134,15 @@ async function Rn(e, t, n) {
|
|
|
133
134
|
}
|
|
134
135
|
//#endregion
|
|
135
136
|
//#region src/lib/text_parsers/search_queries.ts
|
|
136
|
-
var J =
|
|
137
|
+
var J = M("art(?:icle|icl|ic|i|s)?\\.?|al(?:inéa|inea|in|i)?\\.?", { flags: "i" }), Y = O([
|
|
137
138
|
J,
|
|
138
|
-
|
|
139
|
-
|
|
139
|
+
N(R, { default: "" }),
|
|
140
|
+
E(L, P)
|
|
140
141
|
], { value: (e, t) => ({
|
|
141
142
|
num: e[2],
|
|
142
143
|
position: t.position(),
|
|
143
144
|
type: "article"
|
|
144
|
-
}) }), X =
|
|
145
|
+
}) }), X = E(M("c(?:ode|\\.)? ?civ(?:il)?", {
|
|
145
146
|
flags: "i",
|
|
146
147
|
value: (e, t) => ({
|
|
147
148
|
cid: "LEGITEXT000006070721",
|
|
@@ -150,7 +151,7 @@ var J = N("art(?:icle|icl|ic|i|s)?\\.?|al(?:inéa|inea|in|i)?\\.?", { flags: "i"
|
|
|
150
151
|
title: "Code civil",
|
|
151
152
|
type: "texte"
|
|
152
153
|
})
|
|
153
|
-
}),
|
|
154
|
+
}), M("c(?:ode|\\.)? ?trav(?:ail)?", {
|
|
154
155
|
flags: "i",
|
|
155
156
|
value: (e, t) => ({
|
|
156
157
|
cid: "LEGITEXT000006072050",
|
|
@@ -159,7 +160,7 @@ var J = N("art(?:icle|icl|ic|i|s)?\\.?|al(?:inéa|inea|in|i)?\\.?", { flags: "i"
|
|
|
159
160
|
title: "Code du travail",
|
|
160
161
|
type: "texte"
|
|
161
162
|
})
|
|
162
|
-
}),
|
|
163
|
+
}), M("c(?:ode|\\.)? ?p[eé]n(?:al)?", {
|
|
163
164
|
flags: "i",
|
|
164
165
|
value: (e, t) => ({
|
|
165
166
|
cid: "LEGITEXT000006070719",
|
|
@@ -168,7 +169,7 @@ var J = N("art(?:icle|icl|ic|i|s)?\\.?|al(?:inéa|inea|in|i)?\\.?", { flags: "i"
|
|
|
168
169
|
title: "Code pénal",
|
|
169
170
|
type: "texte"
|
|
170
171
|
})
|
|
171
|
-
}),
|
|
172
|
+
}), M("c(?:ode|\\.)? ?pr(?:oc(?:[eé]dure)?)? ?p[eé]n(?:al)?|cpp", {
|
|
172
173
|
flags: "i",
|
|
173
174
|
value: (e, t) => ({
|
|
174
175
|
cid: "LEGITEXT000006071154",
|
|
@@ -177,7 +178,7 @@ var J = N("art(?:icle|icl|ic|i|s)?\\.?|al(?:inéa|inea|in|i)?\\.?", { flags: "i"
|
|
|
177
178
|
title: "Code de procédure pénale",
|
|
178
179
|
type: "texte"
|
|
179
180
|
})
|
|
180
|
-
}),
|
|
181
|
+
}), M("c(?:ode|\\.)? ?pr(?:oc(?:[eé]dure)?)? ?civ(?:il)?|cpc", {
|
|
181
182
|
flags: "i",
|
|
182
183
|
value: (e, t) => ({
|
|
183
184
|
cid: "LEGITEXT000006070716",
|
|
@@ -186,7 +187,7 @@ var J = N("art(?:icle|icl|ic|i|s)?\\.?|al(?:inéa|inea|in|i)?\\.?", { flags: "i"
|
|
|
186
187
|
title: "Code de procédure civile",
|
|
187
188
|
type: "texte"
|
|
188
189
|
})
|
|
189
|
-
}),
|
|
190
|
+
}), M("c(?:ode|\\.)? ?s[eé]cur(?:it[eé])? ?soc(?:iale)?|css", {
|
|
190
191
|
flags: "i",
|
|
191
192
|
value: (e, t) => ({
|
|
192
193
|
cid: "LEGITEXT000006073189",
|
|
@@ -195,7 +196,7 @@ var J = N("art(?:icle|icl|ic|i|s)?\\.?|al(?:inéa|inea|in|i)?\\.?", { flags: "i"
|
|
|
195
196
|
title: "Code de la sécurité sociale",
|
|
196
197
|
type: "texte"
|
|
197
198
|
})
|
|
198
|
-
}),
|
|
199
|
+
}), M("c(?:ode|\\.)? ?rur(?:al)?(?: et de la p[êe]che maritime)?", {
|
|
199
200
|
flags: "i",
|
|
200
201
|
value: (e, t) => ({
|
|
201
202
|
cid: "LEGITEXT000006071367",
|
|
@@ -204,7 +205,7 @@ var J = N("art(?:icle|icl|ic|i|s)?\\.?|al(?:inéa|inea|in|i)?\\.?", { flags: "i"
|
|
|
204
205
|
title: "Code rural et de la pêche maritime",
|
|
205
206
|
type: "texte"
|
|
206
207
|
})
|
|
207
|
-
}),
|
|
208
|
+
}), M("c(?:ode|\\.)? ?env(?:ironnement)?", {
|
|
208
209
|
flags: "i",
|
|
209
210
|
value: (e, t) => ({
|
|
210
211
|
cid: "LEGITEXT000006074220",
|
|
@@ -213,7 +214,7 @@ var J = N("art(?:icle|icl|ic|i|s)?\\.?|al(?:inéa|inea|in|i)?\\.?", { flags: "i"
|
|
|
213
214
|
title: "Code de l'environnement",
|
|
214
215
|
type: "texte"
|
|
215
216
|
})
|
|
216
|
-
}),
|
|
217
|
+
}), M("c(?:ode|\\.)? ?urb(?:anisme)?", {
|
|
217
218
|
flags: "i",
|
|
218
219
|
value: (e, t) => ({
|
|
219
220
|
cid: "LEGITEXT000006074075",
|
|
@@ -222,7 +223,7 @@ var J = N("art(?:icle|icl|ic|i|s)?\\.?|al(?:inéa|inea|in|i)?\\.?", { flags: "i"
|
|
|
222
223
|
title: "Code de l'urbanisme",
|
|
223
224
|
type: "texte"
|
|
224
225
|
})
|
|
225
|
-
}),
|
|
226
|
+
}), M("c(?:ode|\\.)? ?jus(?:tice)? ?adm(?:in(?:istrative)?)?|cja", {
|
|
226
227
|
flags: "i",
|
|
227
228
|
value: (e, t) => ({
|
|
228
229
|
cid: "LEGITEXT000006070933",
|
|
@@ -231,7 +232,7 @@ var J = N("art(?:icle|icl|ic|i|s)?\\.?|al(?:inéa|inea|in|i)?\\.?", { flags: "i"
|
|
|
231
232
|
title: "Code de justice administrative",
|
|
232
233
|
type: "texte"
|
|
233
234
|
})
|
|
234
|
-
}),
|
|
235
|
+
}), M("cgi", {
|
|
235
236
|
flags: "i",
|
|
236
237
|
value: (e, t) => ({
|
|
237
238
|
cid: "LEGITEXT000006069577",
|
|
@@ -240,7 +241,7 @@ var J = N("art(?:icle|icl|ic|i|s)?\\.?|al(?:inéa|inea|in|i)?\\.?", { flags: "i"
|
|
|
240
241
|
title: "Code général des impôts",
|
|
241
242
|
type: "texte"
|
|
242
243
|
})
|
|
243
|
-
}),
|
|
244
|
+
}), M("c(?:ode|\\.)? ?com(?:merce)?", {
|
|
244
245
|
flags: "i",
|
|
245
246
|
value: (e, t) => ({
|
|
246
247
|
cid: "LEGITEXT000005634379",
|
|
@@ -249,27 +250,27 @@ var J = N("art(?:icle|icl|ic|i|s)?\\.?|al(?:inéa|inea|in|i)?\\.?", { flags: "i"
|
|
|
249
250
|
title: "Code de commerce",
|
|
250
251
|
type: "texte"
|
|
251
252
|
})
|
|
252
|
-
})), Z =
|
|
253
|
+
})), Z = E(X, j(A, { value: (e, t) => e === void 0 ? void 0 : {
|
|
253
254
|
...e,
|
|
254
255
|
position: t.position()
|
|
255
|
-
} }),
|
|
256
|
+
} }), j(D, { value: (e, t) => ({
|
|
256
257
|
...e,
|
|
257
258
|
position: t.position()
|
|
258
|
-
}) })), Q =
|
|
259
|
+
}) })), Q = N(M(" (?:du |de la |de l'|des |de |d')?", { flags: "i" }), { default: "" }), Wn = M(".+?(?=\\s*(?:du |de la |de l'|des |de |d')?\\s*(?:art(?:icle|icl|ic|i|s)?\\.?|al(?:inéa|inea|in|i)?\\.?))", {
|
|
259
260
|
flags: "i",
|
|
260
261
|
value: (e, t) => ({
|
|
261
262
|
type: "texte",
|
|
262
263
|
title: e[0].trim(),
|
|
263
264
|
position: t.position()
|
|
264
265
|
})
|
|
265
|
-
}), $ =
|
|
266
|
+
}), $ = M(".+", {
|
|
266
267
|
flags: "i",
|
|
267
268
|
value: (e, t) => ({
|
|
268
269
|
type: "texte",
|
|
269
270
|
title: e[0].trim(),
|
|
270
271
|
position: t.position()
|
|
271
272
|
})
|
|
272
|
-
}),
|
|
273
|
+
}), Gn = E(O([
|
|
273
274
|
Z,
|
|
274
275
|
Q,
|
|
275
276
|
Y
|
|
@@ -281,7 +282,7 @@ var J = N("art(?:icle|icl|ic|i|s)?\\.?|al(?:inéa|inea|in|i)?\\.?", { flags: "i"
|
|
|
281
282
|
position: t.position(),
|
|
282
283
|
type: "parent-enfant"
|
|
283
284
|
};
|
|
284
|
-
} }),
|
|
285
|
+
} }), O([
|
|
285
286
|
Y,
|
|
286
287
|
Q,
|
|
287
288
|
Z
|
|
@@ -290,8 +291,8 @@ var J = N("art(?:icle|icl|ic|i|s)?\\.?|al(?:inéa|inea|in|i)?\\.?", { flags: "i"
|
|
|
290
291
|
parent: e[2],
|
|
291
292
|
position: t.position(),
|
|
292
293
|
type: "parent-enfant"
|
|
293
|
-
}) }),
|
|
294
|
-
|
|
294
|
+
}) }), O([
|
|
295
|
+
Wn,
|
|
295
296
|
Q,
|
|
296
297
|
Y
|
|
297
298
|
], { value: (e, t) => {
|
|
@@ -302,7 +303,7 @@ var J = N("art(?:icle|icl|ic|i|s)?\\.?|al(?:inéa|inea|in|i)?\\.?", { flags: "i"
|
|
|
302
303
|
position: t.position(),
|
|
303
304
|
type: "parent-enfant"
|
|
304
305
|
};
|
|
305
|
-
} }),
|
|
306
|
+
} }), O([
|
|
306
307
|
Y,
|
|
307
308
|
Q,
|
|
308
309
|
$
|
|
@@ -311,6 +312,6 @@ var J = N("art(?:icle|icl|ic|i|s)?\\.?|al(?:inéa|inea|in|i)?\\.?", { flags: "i"
|
|
|
311
312
|
parent: e[2],
|
|
312
313
|
position: t.position(),
|
|
313
314
|
type: "parent-enfant"
|
|
314
|
-
}) }), Y, Z, $),
|
|
315
|
+
}) }), Y, Z, $), Kn = q;
|
|
315
316
|
//#endregion
|
|
316
|
-
export {
|
|
317
|
+
export { Sn as LegiResolver, T as TextParserContext, pe as action, Ve as actionDirective, Cn as actionTargets, Mt as addChildLeftToLastChild, Fe as addLinksOrReferencesToHtmlPage, b as addLinksToHtml, q as addLinksToMarkdown, Kn as addLinksToText, Me as addPositionsToTableOfContentsItems, Yt as adjectifNumeralCardinal, Dn as adjectifNumeralOrdinalCourt, Et as adjectifTemporelSingulier, Rt as adverbeMultiplicatifLatin, et as adverbeRelatif, E as alternatives, sn as article, En as articles, V as assertNever, Mn as auPortion, Ct as auxPortions, cn as buildAndInstallTextTitlesInfos, _e as buildArticlePortionTreeFromHtml, Jt as buildTextTitlesInfos, O as chain, wn as chainTransformers, oe as citation, e as citationLigne, Se as citationSimple, Ie as citationToText, z as citedArticleNumFromTextCitation, Ue as classifyArticleTemporalStatus, Nn as cleanTexteTitle, dn as compoundReferencesSeparators, j as convert, tt as convertHtmlElementsToText, At as createEnumerationOrBoundedInterval, Pt as createParentChildTreeFromReferences, hn as date, lt as decodeNamedHtmlEntities, _n as decodeNumericHtmlEntities, Ut as definitionArticleDansCitation, qt as definitionArticleDansProjetOuPropositionLoi, y as definitionDivision, ht as definitionTexteFrancais, gn as designationArticle, Ee as designationDivision, at as ditPluriel, Tt as ditSingulier, we as division, bn as divisionTypes, he as divisions, ln as duDate, R as espace, st as espaceAdverbeRelatif, yn as europeanDocumentUrl, Zt as europeanFragmentRegExp, Qt as europeanLawNatures, Bt as europeanObservationEmpreinte, an as europeanObservationEmpreinteRegExp, i as extendLoadedArticle, Te as extractActionDirectiveAstsFromText, Ce as extractActionDirectivesFromHtml, me as extractActionDirectivesFromText, un as extractArticleDefinitionsFromCitation, C as extractBillDefinitions, te as extractCitationReferences, Ne as extractFrenchCitations, S as extractPortionSelectors, ie as extractReferences, o as extractReferencesWithOriginalTransformations, w as extractTextLinks, Ae as findBoundaryPositionCue, zn as formatLongDate, It as frenchLawNatures, ce as getArticleDateDebut, r as getArticleDateSignature, u as getExtractedReferences, m as getExtractedReferencesWithOriginalTransformations, De as getExtractedTableOfContentsFromTextBill, Pe as getLegalPhraseTextBounds, re as getOrLoadArticle, He as getOrLoadArticleSiblingId, Vn as getOrLoadDocument, Hn as getOrLoadDocumentsByDossierParlementaireUid, Un as getOrLoadDossierParlementaire, g as getOrLoadJo, t as getOrLoadSectionTa, ke as getOrLoadSectionsTa, ee as getOrLoadTexteVersion, ne as getOrLoadTextekali, ae as getOrLoadTextelr, s as getOrLoadTextesVersions, d as getOrLoadTexteslr, ge as getTableOfContentsItems, be as getTableUnitNoteRanges, F as getTexteVersionDateDebut, jn as getTexteVersionDateSignature, nn as identificationTexteEuropeen, pn as internationalLawNatures, Ot as introPluriel, rt as introSingulier, v as isArticlePortionStructuralStart, le as isLegifranceSentinelDate, xn as isTextAstAtomicReference, Vt as isTextAstDivision, on as isTextAstPortion, yt as iterAtomicFirstParentReferences, Je as iterAtomicReferences, Wt as iterIncludedReferences, ye as iterReferenceLinks, Bn as jsonReplacer, Tn as lawNatures, Xe as lettreAscii, dt as liaisonPluriel, vn as liaisonSingulier, Ft as linkTypes, Xt as listeArticles, c as listeReferencesSeules, h as loadArticles, Ht as localizationAdverbs, Be as natureDivisionSingulier, Ye as natureTexteFrancais, W as newAssembleeObjectCache, G as newLegifranceObjectCache, Ln as newObjectCache, fn as newReverseTransformationsMergedFromPositionsIterator, L as nomArticle, P as nomSpecialArticle, St as nombreAsTextAstNumber, Qe as nombreCardinal, kn as nombreRomainCardinal, wt as nombreRomainOrdinal, $e as nombreRomainOu0iAsTextAstNumber, tn as nonLettre, On as normalizeBillArticleNumber, pt as numero, Ge as numeroDivision, en as numeroEtOuDateTexteFrancais, An as numeroPortion, ft as numeroTexteEuropeen, mt as numeroTexteFrancais, N as optional, _t as optionalEspaceDuTerritoire, Pn as parseArticleNumber, Re as parseArticleSubdivisionMarker, zt as parseBillArticleLabel, Oe as parseFrenchCitationAt, it as parseText, Kt as portionTypes, gt as portions, p as reference, Ke as referenceDoctrinale, n as referenceDoctrinaleArticleAvantSource, ue as referenceDoctrinaleArticlesAvantSource, l as referenceDoctrinaleSourceAvantArticle, se as referenceParsingModes, je as referenceSeule, M as regExp, bt as relatifPlurielPrepose, Ze as relatifSingulierPrepose, Dt as repeat, ct as replaceHtmlPatterns, jt as replacePattern, kt as replaceTextPatterns, ze as resolveActionDirectivesFromHtml, We as resolveActionDirectivesFromText, xe as resolvePortionSelector, $t as reversePositionsSplitFromPositions, Lt as reverseTransformationFromPosition, mn as reverseTransformationsMergedFromPositions, U as reverseTransformedInnerFragment, I as reverseTransformedReplacement, Y as searchArticle, J as searchArticleKeyword, Gn as searchQueryReference, Z as searchTexte, X as searchTexteAbbreviations, Nt as simplifyHtml, k as simplifyPlainText, qe as simplifyText, Gt as simplifyUnicodeCharacters, a as sortArticlesByDate, xt as sortTextesVersionsByDate, ve as startCanutesTitlesMetrics, ot as texte, D as texteEuropeen, A as texteFrancais, de as texteFrancaisAbrege, Fn as texteInternational, rn as unePortion, f as uniteBasePreciseeSingulier, fe as uniteBaseSingulier, B as urlFromArticleVersionsId, H as urlFromLegalId, nt as variable, vt as virguleOuEspace, x as walkTableOfContents, ut as wordsTree };
|
|
@@ -119,9 +119,11 @@ export interface LinkOccurrence {
|
|
|
119
119
|
sourceStart: number;
|
|
120
120
|
sourceStop: number;
|
|
121
121
|
}
|
|
122
|
-
export type LinkDecisionReason = "composant_publication" | "article_futur_a_date_reference" | "article_abroge_avant_date_reference" | "indice_structurel" | "structure_absente" | "reference_historique_explicite" | "publication_rectificative" | "plusieurs_candidats_indepartageables" | "cid_non_etabli" | "donnees_insuffisantes"
|
|
122
|
+
export type LinkDecisionReason = "composant_publication" | "article_futur_a_date_reference" | "article_abroge_avant_date_reference" | "indice_structurel" | "structure_absente" | "reference_historique_explicite" | "publication_rectificative" | "plusieurs_candidats_indepartageables" | "cid_non_etabli" | "donnees_insuffisantes"
|
|
123
|
+
/** The cited treaty regime and the act's own designate the same treaty under different names. */
|
|
124
|
+
| "nomenclature_decalee";
|
|
123
125
|
export interface LinkDecisionCandidate {
|
|
124
|
-
kind: "article" | "text";
|
|
126
|
+
kind: "article" | "text" | "european_text";
|
|
125
127
|
id: string;
|
|
126
128
|
cid: string;
|
|
127
129
|
debut?: string;
|
|
@@ -132,6 +134,19 @@ export interface LinkDecisionCandidate {
|
|
|
132
134
|
export interface LinkDecision {
|
|
133
135
|
occurrence: LinkOccurrence;
|
|
134
136
|
kind: LinkDecisionEvidence["kind"];
|
|
137
|
+
/**
|
|
138
|
+
* Verified position inside the consultation target, when one was proven and
|
|
139
|
+
* a single target was retained. The fragment carries no version: the
|
|
140
|
+
* observation names the version it was verified in.
|
|
141
|
+
*/
|
|
142
|
+
consultationFragment?: {
|
|
143
|
+
/** Observation the fragment was verified in (Europe: `version_id`). */
|
|
144
|
+
observation: string;
|
|
145
|
+
/** SHA-256 of the HTML read for that observation, as verified. */
|
|
146
|
+
empreinte: string;
|
|
147
|
+
/** Canonical ELI subdivision fragment, without `#`. */
|
|
148
|
+
fragment: string;
|
|
149
|
+
};
|
|
135
150
|
recognition: "reconnue" | "sans_candidat" | "non_prise_en_charge" | "non_reconnue";
|
|
136
151
|
date: {
|
|
137
152
|
value: string;
|
|
@@ -185,7 +200,7 @@ export interface LinkDecisionEvidence {
|
|
|
185
200
|
lawArticleUnresolved?: boolean;
|
|
186
201
|
/** Evidence from a resolver; an empty list is distinct from unavailable evidence. */
|
|
187
202
|
candidates?: Array<{
|
|
188
|
-
kind: "article" | "text";
|
|
203
|
+
kind: "article" | "text" | "european_text";
|
|
189
204
|
id: string;
|
|
190
205
|
cid: string;
|
|
191
206
|
debut?: string;
|
|
@@ -194,6 +209,24 @@ export interface LinkDecisionEvidence {
|
|
|
194
209
|
structure?: "valable" | "absente" | "invalide";
|
|
195
210
|
abrogationVerified?: boolean;
|
|
196
211
|
}>;
|
|
212
|
+
/**
|
|
213
|
+
* Fragment of a subdivision verified in one observation of the cited act. A
|
|
214
|
+
* fragment proves nothing about the act: it is only kept when the retained
|
|
215
|
+
* consultation target is that same act.
|
|
216
|
+
*/
|
|
217
|
+
fragment?: {
|
|
218
|
+
/** Act whose observation was verified; never another act. */
|
|
219
|
+
celexId: string;
|
|
220
|
+
observation: string;
|
|
221
|
+
empreinte: string;
|
|
222
|
+
fragment: string;
|
|
223
|
+
};
|
|
224
|
+
/**
|
|
225
|
+
* Regimes written by a European citation that the act's designation carries
|
|
226
|
+
* under another nomenclature of the same treaty (`CE`/`CEE`/`UE`): the link
|
|
227
|
+
* is kept by equivalence, not by equality, so it is announced.
|
|
228
|
+
*/
|
|
229
|
+
europeanRegimesDecales?: string[];
|
|
197
230
|
recognized?: boolean;
|
|
198
231
|
}
|
|
199
232
|
export interface LinkDecisionObserver {
|
|
@@ -221,7 +254,7 @@ type TextLinksResolverDiagnostics = {
|
|
|
221
254
|
getActiveArticlesByTextAndNumCount: number;
|
|
222
255
|
getArticleHistoryInfoCount: number;
|
|
223
256
|
getDirectSectionChildrenCount: number;
|
|
224
|
-
|
|
257
|
+
getEuropeanActCandidatesCount: number;
|
|
225
258
|
getUniqueActiveArticlesByNumCount: number;
|
|
226
259
|
uniqueFallbackCheckCount: number;
|
|
227
260
|
};
|
|
@@ -245,8 +278,9 @@ type TextLinksIterationDiagnostics = {
|
|
|
245
278
|
divisionDirectChildrenLookupMs: number;
|
|
246
279
|
divisionLinkCount: number;
|
|
247
280
|
divisionLinkMs: number;
|
|
281
|
+
europeanActCandidatesMs: number;
|
|
248
282
|
europeanTextLinkCount: number;
|
|
249
|
-
|
|
283
|
+
europeanTextMs: number;
|
|
250
284
|
ignoredReferenceCount: number;
|
|
251
285
|
textChildArticleMs: number;
|
|
252
286
|
textChildDivisionMs: number;
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export { extractCitationReferences, extractReferences, extractReferencesWithOrig
|
|
|
11
11
|
export { buildArticlePortionTreeFromHtml, extractPortionSelectors, getLegalPhraseTextBounds, getTableUnitNoteRanges, isArticlePortionStructuralStart, parseArticleSubdivisionMarker, resolvePortionSelector, type ArticlePortionArticle, type ArticlePortionDivision, type ArticlePortionItem, type ArticlePortionAlinea, type ArticlePortionPhrase, type ArticlePortionMatch, type ArticlePortionNode, type ArticleSubdivisionMarker, type PortionSelector, type PortionSelectorStep, } from './extractors/article_portions.js';
|
|
12
12
|
export { addPositionsToTableOfContentsItems, getExtractedTableOfContentsFromTextBill, getTableOfContentsItems, walkTableOfContents, type TableOfContents, type TableOfContentsArticle, type TableOfContentsArticlePositioned, type TableOfContentsDivision, type TableOfContentsDivisionPositioned, type TableOfContentsItem, type TableOfContentsItemPositioned, type TableOfContentsPositioned, } from './extractors/table_of_contents.js';
|
|
13
13
|
export { jsonReplacer } from './json.js';
|
|
14
|
-
export { LegiResolver, type LegiArticleInfo, type LegiSectionInfo, type PreloadActiveArticlesByTextIdsOptions, type PreloadTextTitlesInfosOptions, type PreloadTextTitlesInfosProgress, } from './legi/resolver.js';
|
|
14
|
+
export { LegiResolver, type EuropeanActReference, type LegiArticleInfo, type LegiSectionInfo, type PreloadActiveArticlesByTextIdsOptions, type PreloadTextTitlesInfosOptions, type PreloadTextTitlesInfosProgress, } from './legi/resolver.js';
|
|
15
15
|
export { buildAndInstallTextTitlesInfos, buildTextTitlesInfos, type BuildTextTitlesInfosProgress, type TextTitlesInfoRow, type TextTitlesInfos, } from './legi/text_titles_infos.js';
|
|
16
16
|
export { addLinksToHtml, addLinksOrReferencesToHtmlPage, type OutputByType, type OutputType, } from './linkers/html.js';
|
|
17
17
|
/**
|
|
@@ -20,7 +20,8 @@ export { addLinksToHtml, addLinksOrReferencesToHtmlPage, type OutputByType, type
|
|
|
20
20
|
*/
|
|
21
21
|
export declare const addLinksToText: typeof addLinksToMarkdown;
|
|
22
22
|
export { addLinksToMarkdown };
|
|
23
|
-
export {
|
|
23
|
+
export { europeanObservationEmpreinte, europeanObservationEmpreinteRegExp, } from './legi/europe_attestation.js';
|
|
24
|
+
export { linkTypes, citedArticleNumFromTextCitation, europeanDocumentUrl, europeanFragmentRegExp, urlFromArticleVersionsId, urlFromLegalId, type LinkType, } from './links.js';
|
|
24
25
|
export { getOrLoadDocument, getOrLoadDocumentsByDossierParlementaireUid, getOrLoadDossierParlementaire, } from './loaders/assemblee.js';
|
|
25
26
|
export { extendLoadedArticle, getOrLoadArticle, getOrLoadJo, getOrLoadSectionTa, getOrLoadSectionsTa, getOrLoadTextelr, getOrLoadTextekali, getOrLoadTexteslr, getOrLoadTextesVersions, getOrLoadTexteVersion, loadArticles, type ArticleExtension, type JorfArticleExtended, type KaliArticleExtended, type LegiArticleExtended, } from './loaders/legifrance.js';
|
|
26
27
|
export { action } from './text_parsers/actions.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CanutesSql } from './canutes_sql.js';
|
|
2
|
-
import { LegiResolver, LegiArticleAbrogationProof, LegiArticleHistoryInfo, LegiArticleInfo, LegiArticleStructureProof, LegiSectionInfo, PreloadActiveArticlesByTextIdsOptions, PreloadTextTitlesInfosOptions } from './resolver.js';
|
|
2
|
+
import { LegiResolver, EuropeanActIdentity, EuropeanActReference, EuropeanObservationFragment, LegiArticleAbrogationProof, LegiArticleHistoryInfo, LegiArticleInfo, LegiArticleStructureProof, LegiSectionInfo, PreloadActiveArticlesByTextIdsOptions, PreloadTextTitlesInfosOptions } from './resolver.js';
|
|
3
3
|
/**
|
|
4
4
|
* Minimal structural view of a Légifrance article row needed to compute an
|
|
5
5
|
* article history entry point; shared with the audit preload.
|
|
@@ -12,7 +12,8 @@ export declare class CanutesResolver extends LegiResolver {
|
|
|
12
12
|
private readonly articleNumsLoadedByTextAndDate;
|
|
13
13
|
private readonly directSectionChildrenByParentAndDate;
|
|
14
14
|
private readonly globalArticleRowsByNumAndDate;
|
|
15
|
-
private readonly
|
|
15
|
+
private readonly europeanCandidateRowsByNumero;
|
|
16
|
+
private readonly europeanArticleFragments;
|
|
16
17
|
private readonly textIdBySegmentId;
|
|
17
18
|
constructor(canutesDb: CanutesSql);
|
|
18
19
|
getActiveArticlesByTextAndNum({ date, num, textId, }: {
|
|
@@ -44,7 +45,27 @@ export declare class CanutesResolver extends LegiResolver {
|
|
|
44
45
|
date: string;
|
|
45
46
|
parentPath: string;
|
|
46
47
|
}): Promise<LegiSectionInfo[]>;
|
|
47
|
-
|
|
48
|
+
/**
|
|
49
|
+
* Identity of a cited act: the single consultable CELEX it designates, and
|
|
50
|
+
* the regimes it writes that the act's own designation carries under another
|
|
51
|
+
* nomenclature of the same treaty. A number alone is never proof: every row
|
|
52
|
+
* of `europe.titre_lien` for that number must designate the same act, and
|
|
53
|
+
* that act must have a document and an observation. An incomplete row never
|
|
54
|
+
* hides a collision, and an unknown date never excludes a candidate.
|
|
55
|
+
*/
|
|
56
|
+
getEuropeanActIdentity({ date, institution, nature, numero, regime, }: EuropeanActReference): Promise<EuropeanActIdentity | undefined>;
|
|
57
|
+
/**
|
|
58
|
+
* Fragment of a cited article, verified in the current observation of the
|
|
59
|
+
* act. The link built on it pins `?version=` on that observation, so the
|
|
60
|
+
* consulted page is the HTML the anchor was counted in, and carries the
|
|
61
|
+
* SHA-256 of the HTML read here, so the page can recompute it and drop the
|
|
62
|
+
* fragment on any difference. Observations are retired
|
|
63
|
+
* (`is_current = false`), never deleted: the pin stays resolvable.
|
|
64
|
+
*/
|
|
65
|
+
getEuropeanArticleFragment({ celexId, article, }: {
|
|
66
|
+
celexId: string;
|
|
67
|
+
article: string;
|
|
68
|
+
}): Promise<EuropeanObservationFragment | undefined>;
|
|
48
69
|
getTextIdFromSegmentId(segmentId: string): Promise<string | undefined>;
|
|
49
70
|
getUniqueActiveArticlesByNum({ date, num, }: {
|
|
50
71
|
date: string;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Empreinte of one observation of a European act: the SHA-256 of the HTML read
|
|
3
|
+
* in `europe.document_version`, as stored.
|
|
4
|
+
*
|
|
5
|
+
* `europe.document_version.content_hash` is **not** this value, though it is
|
|
6
|
+
* also a SHA-256: the collection computes it on the **source XHTML** it fetched
|
|
7
|
+
* from Cellar (`hash(sourceXhtml)`, stored as `version_id`,
|
|
8
|
+
* `tricoteuses-europe/src/documents.ts`). It attests neither the simplified
|
|
9
|
+
* `html` column hashed here, nor bytes recomputable from `canutes` — the source
|
|
10
|
+
* XHTML is not stored in the database. The linker therefore computes its own
|
|
11
|
+
* digest of `html`, travels it with the fragment, and the page recomputes it on
|
|
12
|
+
* the observation it renders.
|
|
13
|
+
*
|
|
14
|
+
* What it proves: the stored observation rendered is the one the anchor was
|
|
15
|
+
* verified in. What it does not prove: that Cellar still serves that content,
|
|
16
|
+
* nor that the fragment designates the same legal subdivision (see the ADR).
|
|
17
|
+
*/
|
|
18
|
+
export declare function europeanObservationEmpreinte(html: string): string;
|
|
19
|
+
/** Form of an empreinte as carried by a link: lowercase SHA-256 hex. */
|
|
20
|
+
export declare const europeanObservationEmpreinteRegExp: RegExp;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Empreinte of a stored observation whose anchor the linker verified, as a
|
|
3
|
+
* link's `?empreinte=` carries it. Shared by the tests that compose, render or
|
|
4
|
+
* degrade such a link, so that the fixtures cannot drift from one another.
|
|
5
|
+
*/
|
|
6
|
+
export declare const attestedObservationEmpreinte = "27a2248cf0cf7c79a3ec7eae30b6e871817230d9f577632fed915181642144c2";
|
|
7
|
+
/** The observation id that {@link attestedObservationEmpreinte} belongs to. */
|
|
8
|
+
export declare const attestedObservationId = "0f1e2d";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Identity criteria a citation adds to the number of a European act: the treaty
|
|
3
|
+
* regime written in parentheses or as a suffix of the number, and the
|
|
4
|
+
* institution that adopted the act. Both are read by the same grammar on the
|
|
5
|
+
* citation and on the act's own designation (`europe.document.title`), so that
|
|
6
|
+
* a criterion written by the source can be confronted with the act it
|
|
7
|
+
* designates.
|
|
8
|
+
*
|
|
9
|
+
* The grammar is deliberately closed: what it does not read is not guessed. A
|
|
10
|
+
* citation is never linked on a criterion its own act's designation
|
|
11
|
+
* contradicts, and when the contradiction cannot be measured the caller
|
|
12
|
+
* abstains instead of ignoring the criterion.
|
|
13
|
+
*
|
|
14
|
+
* This module has no dependency, so the offline measurement imports it
|
|
15
|
+
* directly (`europe_designation_cellar.test.ts`) instead of recopying the
|
|
16
|
+
* grammar; the script under `docs/linker/scripts/` only refreshes the Cellar
|
|
17
|
+
* snapshot that measurement reads.
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* Treaty regimes the resolver can prove an act with. A written form outside
|
|
21
|
+
* this vocabulary is not judged here: {@link writtenRegimes} reports it as
|
|
22
|
+
* unrecognized, and the resolver abstains instead of ignoring it.
|
|
23
|
+
*/
|
|
24
|
+
export declare const europeanRegimes: readonly string[];
|
|
25
|
+
/**
|
|
26
|
+
* The written regimes that designate the same treaty as `regime`, itself
|
|
27
|
+
* included. A regime the vocabulary does not class is only equivalent to
|
|
28
|
+
* itself: equivalence is a fact about treaties, never a guess about wording.
|
|
29
|
+
*/
|
|
30
|
+
export declare function equivalentRegimes(regime: string): readonly string[];
|
|
31
|
+
/**
|
|
32
|
+
* Treaty regimes written around a citation: the parenthetical one, and the
|
|
33
|
+
* suffix of the number (« directive 2008/98/CE »). Both are read because both
|
|
34
|
+
* are written forms of the same claim, and a citation may carry either.
|
|
35
|
+
*
|
|
36
|
+
* `recognized` is false as soon as one written form is outside the vocabulary:
|
|
37
|
+
* an unread regime is not an absent regime, and the caller must abstain.
|
|
38
|
+
*/
|
|
39
|
+
export declare function writtenRegimes({ numero, regime, }: {
|
|
40
|
+
numero?: string;
|
|
41
|
+
regime?: string;
|
|
42
|
+
}): {
|
|
43
|
+
recognized: boolean;
|
|
44
|
+
written: string[];
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Canonical codes of the institutions a designation names, or `undefined` when
|
|
48
|
+
* it names none the vocabulary knows. An empty answer is not "no institution":
|
|
49
|
+
* it is "an institution this grammar cannot read", which the resolver must
|
|
50
|
+
* refuse rather than ignore.
|
|
51
|
+
*/
|
|
52
|
+
export declare function designationInstitutions(phrase: string): string[] | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* The institution a citation names right after the act it designates, or
|
|
55
|
+
* `undefined` when the source names none. A trailing article (« … du Conseil
|
|
56
|
+
* du 27 avril ») belongs to the date, not to the institution.
|
|
57
|
+
*/
|
|
58
|
+
export declare function citedInstitutionPhrase(tail: string): string | undefined;
|
|
59
|
+
/** A European act as its own designation in a title. */
|
|
60
|
+
export type EuropeanTitleDesignation = {
|
|
61
|
+
/** Institutions the title names, read by {@link designationInstitutions}. */
|
|
62
|
+
institutions?: string[];
|
|
63
|
+
/** Nature as the title writes it, lower case. */
|
|
64
|
+
nature: string;
|
|
65
|
+
/** Number as the title writes it, without its regime suffix. */
|
|
66
|
+
numero: string;
|
|
67
|
+
/** Treaty regimes the title writes, in parentheses or as number suffix. */
|
|
68
|
+
regimes: string[];
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* The designation that opens the French title of a European act, or
|
|
72
|
+
* `undefined` when the title does not open on one (« Décision du Comité mixte
|
|
73
|
+
* de l'EEE n o 110/2008 »). Nothing is read outside that designation: the tail
|
|
74
|
+
* of a title cites other acts, in which no identity criterion is attested.
|
|
75
|
+
*/
|
|
76
|
+
export declare function europeanTitleDesignation(title: string): EuropeanTitleDesignation | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|