@tricoteuses/assemblee 3.6.1 → 3.7.1
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/lib/eliasse-CP5wde9Z.js +275 -0
- package/lib/eliasse-details.d.ts +14 -0
- package/lib/eliasse-details.test.d.ts +1 -0
- package/lib/eliasse-retry.d.ts +54 -0
- package/lib/eliasse-retry.test.d.ts +1 -0
- package/lib/eliasse-socket.d.ts +22 -0
- package/lib/eliasse-socket.js +62 -8
- package/lib/eliasse-sync.d.ts +31 -3
- package/lib/eliasse-sync.js +116 -46
- package/lib/eliasse.d.ts +1 -0
- package/lib/eliasse.js +2 -150
- package/lib/open_data/artifacts.d.ts +4 -0
- package/lib/parsers.js +130 -68
- package/lib/scripts/prepare_targeted_documents.d.ts +1 -0
- package/lib/scripts/retrieve_documents.d.ts +4 -0
- package/lib/scripts/shared/senateur_photo.d.ts +1 -0
- package/lib/scripts/shared/senateur_photo.test.d.ts +1 -0
- package/lib/scripts/validate_targeted_document_content.d.ts +1 -0
- package/lib/targeted_documents.d.ts +14 -0
- package/lib/targeted_documents.test.d.ts +1 -0
- package/package.json +1 -1
package/lib/parsers.js
CHANGED
|
@@ -8181,7 +8181,7 @@ function Fu(e) {
|
|
|
8181
8181
|
let t = Nu(e.prop("outerHTML") || ""), n = "";
|
|
8182
8182
|
return t("tr").each((e, r) => {
|
|
8183
8183
|
t(r).find("td, th").each((e, r) => {
|
|
8184
|
-
n += t(r).text().trim() + " ";
|
|
8184
|
+
n += t(r).text().replace(/\u00A0/g, " ").trim() + " ";
|
|
8185
8185
|
}), n += "\n";
|
|
8186
8186
|
}), n.trim();
|
|
8187
8187
|
}
|
|
@@ -8546,13 +8546,15 @@ var ed = [
|
|
|
8546
8546
|
"Section"
|
|
8547
8547
|
];
|
|
8548
8548
|
function td(e) {
|
|
8549
|
-
let t = Nu(Pu(e)), n = [], r = [], i = "generalExpose", a = null, o = null, s = t("h1, h2, h3, h4, h5, h6, p.assnatFPFexpogentitre1, p.assnatFPFexpogentexte, li.assnatFPFprojetloiartexte, p.assnatFPFfinartexte, table, img").toArray(),
|
|
8550
|
-
o && (
|
|
8549
|
+
let t = Nu(Pu(e)), n = [], r = [], i = "generalExpose", a = null, o = null, s = [], c = t("h1, h2, h3, h4, h5, h6, p.assnatPastille, p.assnatFPFexpogentitre1, p.assnatFPFexpogentexte, li.assnatFPFexpogentexte, li.assnatFPFprojetloiartexte, p.assnatFPFprojetloiartexte, p.assnatFPFfinartexte, table, img").toArray(), l = () => {
|
|
8550
|
+
o && s.length > 0 && (o.alineas = nd(s)), s = [];
|
|
8551
|
+
}, u = () => {
|
|
8552
|
+
o && (l(), n.push(o), o = null);
|
|
8551
8553
|
};
|
|
8552
|
-
for (let e of
|
|
8554
|
+
for (let e of c) {
|
|
8553
8555
|
if (i === "done") break;
|
|
8554
|
-
let
|
|
8555
|
-
if (!(v && g.length === 0)) {
|
|
8556
|
+
let c = t(e), g = Q(c.text()), _ = sd(c), v = _ !== null, y = _ !== null && _ >= 2 && _ <= 5, b = c.hasClass("assnatFPFexpogentitre1"), x = c.hasClass("assnatFPFexpogentexte"), S = c.hasClass("assnatPastille"), te = c.hasClass("assnatFPFprojetloiartexte"), ne = c.hasClass("assnatFPFfinartexte"), re = c.is("table"), ie = c.is("img"), ae = c.find("img").length > 0;
|
|
8557
|
+
if (!(v && g.length === 0) && !(re && c.find("p.assnatFARTT08Bleu").length > 0) && !(re && od(c)) && !(x && g.length === 0)) {
|
|
8556
8558
|
if (i === "generalExpose") {
|
|
8557
8559
|
if (_ === 1) {
|
|
8558
8560
|
let e = g.toLowerCase();
|
|
@@ -8563,88 +8565,148 @@ function td(e) {
|
|
|
8563
8565
|
e.includes("exposé général des motifs") && (a ?? (a = Zu("D_EXPOSE", "Exposé des motifs", 1, 1)));
|
|
8564
8566
|
}
|
|
8565
8567
|
if (y && (a && n.push(a), a = null, i = "hierarchy"), a) {
|
|
8566
|
-
if (
|
|
8567
|
-
let e =
|
|
8568
|
+
if (ie) {
|
|
8569
|
+
let e = ud(c);
|
|
8568
8570
|
if (e) {
|
|
8569
|
-
var
|
|
8570
|
-
(
|
|
8571
|
+
var d;
|
|
8572
|
+
(d = a).alineas ?? (d.alineas = []), a.alineas.push(e);
|
|
8571
8573
|
}
|
|
8572
8574
|
} else if ((_ === 1 || _ === 6) && g.length > 0) {
|
|
8573
|
-
var
|
|
8574
|
-
(
|
|
8575
|
+
var f;
|
|
8576
|
+
(f = a).titres ?? (f.titres = []), a.titres.push($(c));
|
|
8575
8577
|
} else if (b || x) {
|
|
8576
|
-
let e =
|
|
8578
|
+
let e = ae ? cd(c) : $(c);
|
|
8577
8579
|
if (e) {
|
|
8578
|
-
var
|
|
8579
|
-
(
|
|
8580
|
+
var p;
|
|
8581
|
+
(p = a).alineas ?? (p.alineas = []), a.alineas.push(e);
|
|
8580
8582
|
}
|
|
8581
|
-
} else if (
|
|
8582
|
-
var
|
|
8583
|
-
(
|
|
8583
|
+
} else if (re) {
|
|
8584
|
+
var ee;
|
|
8585
|
+
(ee = a).alineas ?? (ee.alineas = []), a.alineas.push($u(c));
|
|
8584
8586
|
}
|
|
8585
8587
|
continue;
|
|
8586
8588
|
}
|
|
8587
8589
|
}
|
|
8588
8590
|
if (Qu(g)) {
|
|
8589
|
-
|
|
8591
|
+
u(), a && (n.push(a), a = null), i = "done";
|
|
8590
8592
|
continue;
|
|
8591
8593
|
}
|
|
8592
8594
|
if (_ !== 1) {
|
|
8593
8595
|
if (y) {
|
|
8594
|
-
|
|
8596
|
+
u();
|
|
8595
8597
|
let e = _ - 2, t = ed[e];
|
|
8596
8598
|
for (; r.length > 0 && r[r.length - 1] >= e;) r.pop();
|
|
8597
8599
|
r.push(e);
|
|
8598
8600
|
let a = Zu(`D_${Xu(g)}`, t, e + 1, r.length);
|
|
8599
|
-
a.titres = [$(
|
|
8601
|
+
a.titres = [$(c)], n.push(a), i = "hierarchy";
|
|
8600
8602
|
continue;
|
|
8601
8603
|
}
|
|
8602
8604
|
if (_ === 6) {
|
|
8603
|
-
|
|
8605
|
+
u();
|
|
8604
8606
|
let e = r.length + 1;
|
|
8605
|
-
o = Zu(`D_${Xu(g)}`, "Article", 5, e), o.titres = [$(
|
|
8607
|
+
o = Zu(`D_${Xu(g)}`, "Article", 5, e), o.titres = [$(c)], s = [], i = "articleBody";
|
|
8606
8608
|
continue;
|
|
8607
8609
|
}
|
|
8608
8610
|
if (S && i === "articleBody" && o) {
|
|
8609
|
-
|
|
8610
|
-
|
|
8611
|
+
s.push({
|
|
8612
|
+
type: "marker",
|
|
8613
|
+
number: ad(g)
|
|
8614
|
+
});
|
|
8615
|
+
continue;
|
|
8616
|
+
}
|
|
8617
|
+
if (te && i === "articleBody" && o) {
|
|
8618
|
+
if (g.length === 0) continue;
|
|
8619
|
+
s.push({
|
|
8620
|
+
type: "content",
|
|
8621
|
+
content: $(c)
|
|
8622
|
+
});
|
|
8611
8623
|
continue;
|
|
8612
8624
|
}
|
|
8613
|
-
if (
|
|
8614
|
-
|
|
8615
|
-
|
|
8625
|
+
if (re && i === "articleBody" && o) {
|
|
8626
|
+
s.push({
|
|
8627
|
+
type: "content",
|
|
8628
|
+
content: $u(c)
|
|
8629
|
+
});
|
|
8616
8630
|
continue;
|
|
8617
8631
|
}
|
|
8618
|
-
if (
|
|
8619
|
-
i = "articleExpose";
|
|
8632
|
+
if (ne && o) {
|
|
8633
|
+
l(), i = "articleExpose";
|
|
8620
8634
|
continue;
|
|
8621
8635
|
}
|
|
8622
8636
|
if (b && i === "articleBody" && o) {
|
|
8623
|
-
i = "articleExpose";
|
|
8637
|
+
l(), i = "articleExpose";
|
|
8624
8638
|
continue;
|
|
8625
8639
|
}
|
|
8626
8640
|
if (i === "articleExpose" && o) {
|
|
8627
8641
|
if (b) continue;
|
|
8628
8642
|
if (x) {
|
|
8629
8643
|
var m;
|
|
8630
|
-
(m = o).exposeDesMotifs ?? (m.exposeDesMotifs = []), o.exposeDesMotifs.push($(
|
|
8644
|
+
(m = o).exposeDesMotifs ?? (m.exposeDesMotifs = []), o.exposeDesMotifs.push($(c));
|
|
8631
8645
|
continue;
|
|
8632
8646
|
}
|
|
8633
|
-
if (
|
|
8647
|
+
if (re) {
|
|
8634
8648
|
var h;
|
|
8635
|
-
(h = o).exposeDesMotifs ?? (h.exposeDesMotifs = []), o.exposeDesMotifs.push($u(
|
|
8649
|
+
(h = o).exposeDesMotifs ?? (h.exposeDesMotifs = []), o.exposeDesMotifs.push($u(c));
|
|
8636
8650
|
}
|
|
8637
8651
|
}
|
|
8638
8652
|
}
|
|
8639
8653
|
}
|
|
8640
8654
|
}
|
|
8641
|
-
return
|
|
8655
|
+
return u(), a && n.push(a), { subdivisions: n };
|
|
8642
8656
|
}
|
|
8643
8657
|
function nd(e) {
|
|
8658
|
+
let t = e.flatMap((e) => e.type === "content" ? [e.content] : []);
|
|
8659
|
+
if (e.length - t.length === 0) return t;
|
|
8660
|
+
let n = [], r, i;
|
|
8661
|
+
for (let a of e) {
|
|
8662
|
+
if (a.type === "content") {
|
|
8663
|
+
if (!r) return t;
|
|
8664
|
+
r.contents.push(a.content);
|
|
8665
|
+
continue;
|
|
8666
|
+
}
|
|
8667
|
+
if (a.number === void 0 || (i === void 0 ? a.number !== 1 : a.number <= i)) return t;
|
|
8668
|
+
r = {
|
|
8669
|
+
number: a.number,
|
|
8670
|
+
contents: []
|
|
8671
|
+
}, n.push(r), i = a.number;
|
|
8672
|
+
}
|
|
8673
|
+
rd(n);
|
|
8674
|
+
let a = [];
|
|
8675
|
+
for (let e = 0; e < n.length; e++) {
|
|
8676
|
+
let r = n[e], i = n[e + 1], o = i ? i.number - r.number : 1;
|
|
8677
|
+
if (r.contents.length < o) return t;
|
|
8678
|
+
for (let e = 0; e < o - 1; e++) a.push(r.contents[e]);
|
|
8679
|
+
a.push(id(r.contents.slice(o - 1)));
|
|
8680
|
+
}
|
|
8681
|
+
return a;
|
|
8682
|
+
}
|
|
8683
|
+
function rd(e) {
|
|
8684
|
+
for (let t = 0; t < e.length - 1; t++) {
|
|
8685
|
+
let n = e[t].contents, r = e[t + 1].contents, i = n[n.length - 1];
|
|
8686
|
+
i?.texte?.trim() === "«" && r.some(({ html: e }) => /<table\b/.test(e ?? "")) && (n.pop(), r.unshift(i));
|
|
8687
|
+
}
|
|
8688
|
+
}
|
|
8689
|
+
function id(e) {
|
|
8690
|
+
return {
|
|
8691
|
+
texte: e.flatMap(({ texte: e }) => e === void 0 ? [] : [e]).join("\n"),
|
|
8692
|
+
html: e.flatMap(({ html: e }) => e === void 0 ? [] : [e]).join("\n")
|
|
8693
|
+
};
|
|
8694
|
+
}
|
|
8695
|
+
function ad(e) {
|
|
8696
|
+
let t = /^\((\d+)\)$/.exec(e);
|
|
8697
|
+
if (!t) return;
|
|
8698
|
+
let n = Number(t[1]);
|
|
8699
|
+
return Number.isSafeInteger(n) && n > 0 ? n : void 0;
|
|
8700
|
+
}
|
|
8701
|
+
function od(e) {
|
|
8702
|
+
let t = e.children("tbody").children("tr").add(e.children("tr"));
|
|
8703
|
+
return t.length === 1 && t.children("td").length === 1 && e.find("h6, .assnatFPFexpogentexte").length > 0;
|
|
8704
|
+
}
|
|
8705
|
+
function sd(e) {
|
|
8644
8706
|
for (let t = 1; t <= 6; t++) if (e.is(`h${t}`)) return t;
|
|
8645
8707
|
return null;
|
|
8646
8708
|
}
|
|
8647
|
-
function
|
|
8709
|
+
function cd(e) {
|
|
8648
8710
|
let t = e.clone();
|
|
8649
8711
|
t.find("img").remove();
|
|
8650
8712
|
let n = Q(t.text());
|
|
@@ -8653,14 +8715,14 @@ function rd(e) {
|
|
|
8653
8715
|
html: Q(t.html())
|
|
8654
8716
|
} : null;
|
|
8655
8717
|
}
|
|
8656
|
-
function
|
|
8718
|
+
function ld(e) {
|
|
8657
8719
|
if (!e || !/^\d+$/.test(e)) return;
|
|
8658
8720
|
let t = Number(e);
|
|
8659
8721
|
return t > 0 ? t : void 0;
|
|
8660
8722
|
}
|
|
8661
|
-
function
|
|
8723
|
+
function ud(e) {
|
|
8662
8724
|
if (!e.attr("src")) return null;
|
|
8663
|
-
let t =
|
|
8725
|
+
let t = ld(e.attr("width")), n = ld(e.attr("height"));
|
|
8664
8726
|
return t === 15 && n === 15 || t === 2 && n === 138 ? null : {
|
|
8665
8727
|
texte: Q(e.attr("alt") ?? ""),
|
|
8666
8728
|
html: e.prop("outerHTML") || ""
|
|
@@ -8668,7 +8730,7 @@ function ad(e) {
|
|
|
8668
8730
|
}
|
|
8669
8731
|
//#endregion
|
|
8670
8732
|
//#region src/parsers/plf/later_stage.ts
|
|
8671
|
-
function
|
|
8733
|
+
function dd(e) {
|
|
8672
8734
|
let t = Nu(Pu(e)), n = [], r = [], i = null, a = null, o = null, s = !1, c = t("p.assnat2PartieNum, p.assnat2PartieIntit, p.assnat4TitreNum, p.assnat4TitreNum0, p.assnat4TitreIntit, p.assnat9ArticleNum, p.assnatLoiTexte, p.assnat1TomeNum, table, p.assnat5ChapitreIntit, p.assnat5ChapitreIntit0, p.assnat5ChapitreNum, p.assnat5ChapitreNum0, p.assnat6SectionIntit, p.assnat6SectionIntit0, p.assnat6SectionNum, p.assnat6SectionNum0").toArray();
|
|
8673
8735
|
for (let e of c) {
|
|
8674
8736
|
let c = t(e), l = Q(c.text());
|
|
@@ -8677,7 +8739,7 @@ function od(e) {
|
|
|
8677
8739
|
if (d) {
|
|
8678
8740
|
for (i && (n.push(i), i = null); r.length > 0 && r[r.length - 1] >= 0;) r.pop();
|
|
8679
8741
|
r.push(0);
|
|
8680
|
-
let e =
|
|
8742
|
+
let e = fd(a, $(c));
|
|
8681
8743
|
a = null, o = null;
|
|
8682
8744
|
let t = Zu(`D_${Xu(e.texte ?? l)}`, "Partie", 1, r.length);
|
|
8683
8745
|
t.titres = [e], n.push(t);
|
|
@@ -8690,7 +8752,7 @@ function od(e) {
|
|
|
8690
8752
|
if (p) {
|
|
8691
8753
|
for (i && (n.push(i), i = null); r.length > 0 && r[r.length - 1] >= 1;) r.pop();
|
|
8692
8754
|
r.push(1);
|
|
8693
|
-
let e =
|
|
8755
|
+
let e = fd(o, $(c));
|
|
8694
8756
|
o = null;
|
|
8695
8757
|
let t = Zu(`D_${Xu(e.texte ?? l)}`, "Titre", 2, r.length);
|
|
8696
8758
|
t.titres = [e], n.push(t);
|
|
@@ -8728,7 +8790,7 @@ function od(e) {
|
|
|
8728
8790
|
}
|
|
8729
8791
|
return i && n.push(i), { subdivisions: n };
|
|
8730
8792
|
}
|
|
8731
|
-
function
|
|
8793
|
+
function fd(e, t) {
|
|
8732
8794
|
return e === null ? t : {
|
|
8733
8795
|
texte: `${e.texte} : ${t.texte}`,
|
|
8734
8796
|
html: `${e.html} : ${t.html}`
|
|
@@ -8736,20 +8798,20 @@ function sd(e, t) {
|
|
|
8736
8798
|
}
|
|
8737
8799
|
//#endregion
|
|
8738
8800
|
//#region src/parsers/plf/variant_detection.ts
|
|
8739
|
-
var
|
|
8801
|
+
var pd = [
|
|
8740
8802
|
"assnatFPFexpogentexte",
|
|
8741
8803
|
"assnatFPFexpogentitre1",
|
|
8742
8804
|
"assnatFPFexpogentitre2",
|
|
8743
8805
|
"assnatFPFexpogentitre3",
|
|
8744
8806
|
"assnatFPFexpogentitre4"
|
|
8745
8807
|
];
|
|
8746
|
-
function
|
|
8808
|
+
function md(e) {
|
|
8747
8809
|
let t = Nu(Pu(e));
|
|
8748
|
-
return t("h1, h2, h3, h4, h5, h6").toArray().some((e) => Q(t(e).text()).normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase().includes("expose general des motifs")) || t(
|
|
8810
|
+
return t("h1, h2, h3, h4, h5, h6").toArray().some((e) => Q(t(e).text()).normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase().includes("expose general des motifs")) || t(pd.map((e) => `.${e}`).join(", ")).length > 0 ? "depot" : "laterStage";
|
|
8749
8811
|
}
|
|
8750
8812
|
//#endregion
|
|
8751
8813
|
//#region src/parsers/plf/credits.ts
|
|
8752
|
-
var
|
|
8814
|
+
var hd = {
|
|
8753
8815
|
bg: {
|
|
8754
8816
|
budgetType: "budgetGeneral",
|
|
8755
8817
|
libelle: "Budget général"
|
|
@@ -8767,15 +8829,15 @@ var ud = {
|
|
|
8767
8829
|
libelle: "Comptes de concours financiers"
|
|
8768
8830
|
}
|
|
8769
8831
|
};
|
|
8770
|
-
function
|
|
8832
|
+
function gd(e) {
|
|
8771
8833
|
if (!e) return [];
|
|
8772
|
-
let t = Nu(Pu(e)), n =
|
|
8834
|
+
let t = Nu(Pu(e)), n = Sd(t);
|
|
8773
8835
|
if (n.length === 0) return [];
|
|
8774
8836
|
let r = [];
|
|
8775
8837
|
for (let e of n) {
|
|
8776
8838
|
let n = [], i;
|
|
8777
8839
|
for (let r of e.tableEls) {
|
|
8778
|
-
let e =
|
|
8840
|
+
let e = bd(t, r);
|
|
8779
8841
|
n.push(...e.missions), e.total && (i = e.total);
|
|
8780
8842
|
}
|
|
8781
8843
|
n.length === 0 && !e.estConformeVersionPrecedente || r.push({
|
|
@@ -8791,7 +8853,7 @@ function dd(e) {
|
|
|
8791
8853
|
}
|
|
8792
8854
|
return r;
|
|
8793
8855
|
}
|
|
8794
|
-
function
|
|
8856
|
+
function _d(e) {
|
|
8795
8857
|
let t = Q(e).replace(/[\u2212\u2011]/g, "-").replace(/\s/g, "").replace(/[^0-9,.-]/g, ""), n = (t.match(/,/g) ?? []).length;
|
|
8796
8858
|
if (n > 1) return;
|
|
8797
8859
|
let r = n === 1 ? t.replace(/\./g, "").replace(",", ".") : t;
|
|
@@ -8799,23 +8861,23 @@ function fd(e) {
|
|
|
8799
8861
|
let i = Number(r);
|
|
8800
8862
|
return Number.isNaN(i) ? void 0 : i;
|
|
8801
8863
|
}
|
|
8802
|
-
function
|
|
8864
|
+
function vd(e) {
|
|
8803
8865
|
let t = Q(e);
|
|
8804
8866
|
if (!/\(\s*ligne\s+supprim(?:ée|ee)\s*\)\s*$/i.test(t)) return t.replace(/\s*\(\s*ligne\s+nouvelle\s*\)\s*$/i, "").trim();
|
|
8805
8867
|
}
|
|
8806
|
-
function
|
|
8807
|
-
let n =
|
|
8868
|
+
function yd(e, t) {
|
|
8869
|
+
let n = _d(t(e[1]).text()), r = _d(t(e[2]).text());
|
|
8808
8870
|
return e.length >= 5 ? {
|
|
8809
8871
|
autorisationEngagement: n,
|
|
8810
8872
|
creditPaiement: r,
|
|
8811
|
-
autorisationEngagementAnnule:
|
|
8812
|
-
creditPaiementAnnule:
|
|
8873
|
+
autorisationEngagementAnnule: _d(t(e[3]).text()),
|
|
8874
|
+
creditPaiementAnnule: _d(t(e[4]).text())
|
|
8813
8875
|
} : {
|
|
8814
8876
|
autorisationEngagement: n,
|
|
8815
8877
|
creditPaiement: r
|
|
8816
8878
|
};
|
|
8817
8879
|
}
|
|
8818
|
-
function
|
|
8880
|
+
function bd(e, t) {
|
|
8819
8881
|
let n = [], r = null, i = null, a, o = e(t).find("tbody tr").toArray(), s = o.some((t) => {
|
|
8820
8882
|
let n = (e(t).find("td").first().attr("style") || "").replace(/[\n\t]/g, " ");
|
|
8821
8883
|
return /border-top/.test(n);
|
|
@@ -8825,7 +8887,7 @@ function hd(e, t) {
|
|
|
8825
8887
|
if (o.length < 3) continue;
|
|
8826
8888
|
let c = e(o[0]), l = (c.attr("style") || "").replace(/[\n\t]/g, " "), u = Q(c.text());
|
|
8827
8889
|
if (!u) continue;
|
|
8828
|
-
let d = /^total/i.test(u), f =
|
|
8890
|
+
let d = /^total/i.test(u), f = yd(o, e);
|
|
8829
8891
|
if (d) {
|
|
8830
8892
|
a = f;
|
|
8831
8893
|
continue;
|
|
@@ -8839,7 +8901,7 @@ function hd(e, t) {
|
|
|
8839
8901
|
}
|
|
8840
8902
|
if (s ? /border-top/.test(l) : /border-bottom/.test(l)) {
|
|
8841
8903
|
r && n.push(r);
|
|
8842
|
-
let e =
|
|
8904
|
+
let e = vd(c.text());
|
|
8843
8905
|
if (e === void 0) {
|
|
8844
8906
|
r = null, i = null;
|
|
8845
8907
|
continue;
|
|
@@ -8853,7 +8915,7 @@ function hd(e, t) {
|
|
|
8853
8915
|
continue;
|
|
8854
8916
|
}
|
|
8855
8917
|
if (r) {
|
|
8856
|
-
let e =
|
|
8918
|
+
let e = vd(c.text());
|
|
8857
8919
|
if (e === void 0) {
|
|
8858
8920
|
i = null;
|
|
8859
8921
|
continue;
|
|
@@ -8869,11 +8931,11 @@ function hd(e, t) {
|
|
|
8869
8931
|
total: a
|
|
8870
8932
|
};
|
|
8871
8933
|
}
|
|
8872
|
-
function
|
|
8934
|
+
function xd(e, t) {
|
|
8873
8935
|
let n = e(t).find("tr").slice(0, 3).find("th, td").toArray().map((t) => Q(e(t).text()).toLocaleLowerCase("fr"));
|
|
8874
8936
|
return n.some((e) => e.includes("mission / programme")) && n.some((e) => e.includes("autorisation") && e.includes("engagement")) && n.some((e) => e.includes("crédit") && e.includes("paiement"));
|
|
8875
8937
|
}
|
|
8876
|
-
function
|
|
8938
|
+
function Sd(e) {
|
|
8877
8939
|
let t, n, r = !1, i = /* @__PURE__ */ new Map(), a = e("p, h1, h2, h3, h4, h5, h6, a:not([href]), table").toArray().filter((t) => e(t).parents("table").length === 0);
|
|
8878
8940
|
for (let o of a) {
|
|
8879
8941
|
let a = e(o);
|
|
@@ -8890,7 +8952,7 @@ function _d(e) {
|
|
|
8890
8952
|
for (let t of e) {
|
|
8891
8953
|
let e = i.get(t);
|
|
8892
8954
|
e ? e.estConformeVersionPrecedente = !0 : i.set(t, {
|
|
8893
|
-
...
|
|
8955
|
+
...hd[t],
|
|
8894
8956
|
tableEls: [],
|
|
8895
8957
|
estConformeVersionPrecedente: !0
|
|
8896
8958
|
});
|
|
@@ -8906,7 +8968,7 @@ function _d(e) {
|
|
|
8906
8968
|
s !== /COMPTES\s+DE\s+CONCOURS\s+FINANCIERS/i.test(e) && (n = s ? "cas" : "ccf");
|
|
8907
8969
|
continue;
|
|
8908
8970
|
}
|
|
8909
|
-
if (!
|
|
8971
|
+
if (!xd(e, o)) continue;
|
|
8910
8972
|
let s = t === "B" ? "bg" : t === "C" ? "ba" : t === "D" ? n : void 0;
|
|
8911
8973
|
if (!s) continue;
|
|
8912
8974
|
r = !0;
|
|
@@ -8916,7 +8978,7 @@ function _d(e) {
|
|
|
8916
8978
|
continue;
|
|
8917
8979
|
}
|
|
8918
8980
|
i.set(s, {
|
|
8919
|
-
...
|
|
8981
|
+
...hd[s],
|
|
8920
8982
|
tableEls: [o],
|
|
8921
8983
|
estConformeVersionPrecedente: !1
|
|
8922
8984
|
});
|
|
@@ -8925,8 +8987,8 @@ function _d(e) {
|
|
|
8925
8987
|
}
|
|
8926
8988
|
//#endregion
|
|
8927
8989
|
//#region src/parsers/plf/index.ts
|
|
8928
|
-
function
|
|
8929
|
-
return e ?
|
|
8990
|
+
function Cd(e) {
|
|
8991
|
+
return e ? md(e) === "depot" ? td(e) : dd(e) : { subdivisions: [] };
|
|
8930
8992
|
}
|
|
8931
8993
|
//#endregion
|
|
8932
|
-
export { Ju as iterRechercheAmendements, Yu as iterRechercheRawAmendements,
|
|
8994
|
+
export { Ju as iterRechercheAmendements, Yu as iterRechercheRawAmendements, Cd as parsePlf, gd as parsePlfCredits, Wu as parseTexte };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -20,6 +20,10 @@ declare const retrieveDocumentsParser: import('zod-opts').Parser<{
|
|
|
20
20
|
description: string;
|
|
21
21
|
type: z.ZodDefault<z.ZodNumber>;
|
|
22
22
|
};
|
|
23
|
+
forceFetchDocuments: {
|
|
24
|
+
description: string;
|
|
25
|
+
type: z.ZodDefault<z.ZodBoolean>;
|
|
26
|
+
};
|
|
23
27
|
forceParseDocuments: {
|
|
24
28
|
description: string;
|
|
25
29
|
type: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function ensureSenateurPhoto(urlPhoto: string, photoFilePath: string, width: number, height: number): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface TargetedDocumentEntry {
|
|
2
|
+
document: unknown;
|
|
3
|
+
sourceUrl: string;
|
|
4
|
+
note?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function requestedDocumentUids(value: string, legislature: number): string[];
|
|
7
|
+
export declare function prepareTargetedDocuments({ dataDir, outputDir, legislature, documentUids, metadataFile, persistMetadata, }: {
|
|
8
|
+
dataDir: string;
|
|
9
|
+
outputDir: string;
|
|
10
|
+
legislature: number;
|
|
11
|
+
documentUids: string;
|
|
12
|
+
metadataFile?: string;
|
|
13
|
+
persistMetadata?: boolean;
|
|
14
|
+
}): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|