@tricoteuses/assemblee 2.4.0 → 2.4.2
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/file_systems-CzTtoLWb.js +33 -0
- package/lib/git.js +121 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +229 -223
- package/lib/loaders.d.ts +10 -0
- package/lib/loaders.js +441 -425
- package/lib/numbers.d.ts +4 -0
- package/lib/scripts/retrieve_documents.d.ts +2 -1
- package/lib/scripts/shared/utils.d.ts +0 -1
- package/lib/{scrutins-DhX6h3KY.js → uids-DaRrTkI-.js} +100 -94
- package/lib/uids.d.ts +6 -0
- package/package.json +6 -1
package/lib/loaders.js
CHANGED
|
@@ -2,16 +2,15 @@ import Q from "node:assert";
|
|
|
2
2
|
import i from "fs-extra";
|
|
3
3
|
import n from "node:path";
|
|
4
4
|
import "node:crypto";
|
|
5
|
-
import { L as a,
|
|
6
|
-
import "
|
|
7
|
-
import { C as
|
|
8
|
-
|
|
9
|
-
var F = /* @__PURE__ */ ((s) => (s[s.None = 0] = "None", s[s.ActeursEtOrganes = 1] = "ActeursEtOrganes", s[s.Agendas = 2] = "Agendas", s[s.Amendements = 4] = "Amendements", s[s.DossiersLegislatifs = 8] = "DossiersLegislatifs", s[s.Photos = 16] = "Photos", s[s.Scrutins = 32] = "Scrutins", s[s.Questions = 64] = "Questions", s[s.ComptesRendusSeances = 128] = "ComptesRendusSeances", s[s.All = 255] = "All", s))(F || {});
|
|
5
|
+
import { L as a, a1 as R, a2 as Z, a3 as q, a4 as B, a5 as J, a6 as N, Y as H, $ as Y, a0 as G, X as K, Z as ee, _ as te } from "./uids-DaRrTkI-.js";
|
|
6
|
+
import { w as L } from "./file_systems-CzTtoLWb.js";
|
|
7
|
+
import { C as w } from "./amendements-40Z7OJLT.js";
|
|
8
|
+
var v = /* @__PURE__ */ ((s) => (s[s.None = 0] = "None", s[s.ActeursEtOrganes = 1] = "ActeursEtOrganes", s[s.Agendas = 2] = "Agendas", s[s.Amendements = 4] = "Amendements", s[s.DossiersLegislatifs = 8] = "DossiersLegislatifs", s[s.Photos = 16] = "Photos", s[s.Scrutins = 32] = "Scrutins", s[s.Questions = 64] = "Questions", s[s.ComptesRendusSeances = 128] = "ComptesRendusSeances", s[s.All = 255] = "All", s))(v || {});
|
|
10
9
|
function y(s, t) {
|
|
11
10
|
const e = n.join(t, s.filename);
|
|
12
11
|
i.existsSync(e) && i.removeSync(e), i.existsSync(n.join(t, "json")) ? i.moveSync(n.join(t, "json"), e) : i.mkdirSync(e);
|
|
13
12
|
}
|
|
14
|
-
const
|
|
13
|
+
const S = {
|
|
15
14
|
acteursEtOrganes: [
|
|
16
15
|
{
|
|
17
16
|
// AMO10 (XVII)
|
|
@@ -689,738 +688,755 @@ const h = {
|
|
|
689
688
|
url: "https://data.assemblee-nationale.fr/static/openData/repository/16/vp/syceronbrut/syseron.xml.zip"
|
|
690
689
|
}
|
|
691
690
|
]
|
|
692
|
-
}
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
691
|
+
}, W = [
|
|
692
|
+
1e3,
|
|
693
|
+
"M",
|
|
694
|
+
900,
|
|
695
|
+
"CM",
|
|
696
|
+
500,
|
|
697
|
+
"D",
|
|
698
|
+
400,
|
|
699
|
+
"CD",
|
|
700
|
+
100,
|
|
701
|
+
"C",
|
|
702
|
+
90,
|
|
703
|
+
"XC",
|
|
704
|
+
50,
|
|
705
|
+
"L",
|
|
706
|
+
40,
|
|
707
|
+
"XL",
|
|
708
|
+
10,
|
|
709
|
+
"X",
|
|
710
|
+
9,
|
|
711
|
+
"IX",
|
|
712
|
+
5,
|
|
713
|
+
"V",
|
|
714
|
+
4,
|
|
715
|
+
"IV",
|
|
716
|
+
1,
|
|
717
|
+
"I"
|
|
718
|
+
];
|
|
719
|
+
function se(s) {
|
|
720
|
+
if (s < 0)
|
|
721
|
+
return;
|
|
722
|
+
if (s === 0)
|
|
723
|
+
return "0I";
|
|
724
|
+
let t = "";
|
|
725
|
+
for (let e = 0; e < W.length; e += 2)
|
|
726
|
+
for (; s >= W[e]; )
|
|
727
|
+
t += W[e + 1], s -= W[e];
|
|
728
|
+
return t;
|
|
726
729
|
}
|
|
727
|
-
|
|
728
|
-
function* x(s, t, e, o, d, g = "json", { noValidation: _ = !1, log: p = !1 } = {}) {
|
|
730
|
+
function* P(s, t, e, r, d, f = "json", { noValidation: _ = !1, log: g = !1 } = {}) {
|
|
729
731
|
const j = /* @__PURE__ */ new Set();
|
|
730
732
|
for (const A of e) {
|
|
731
|
-
if (A.ignoreForWeb || !
|
|
733
|
+
if (A.ignoreForWeb || !ne(t, A))
|
|
732
734
|
continue;
|
|
733
|
-
const
|
|
735
|
+
const F = new RegExp(`\\.${f}$`), I = n.join(
|
|
734
736
|
s,
|
|
735
|
-
A.filename.replace(
|
|
737
|
+
A.filename.replace(F, "_nettoye")
|
|
736
738
|
);
|
|
737
|
-
for (const
|
|
738
|
-
if (!
|
|
739
|
+
for (const D of L(I, d)) {
|
|
740
|
+
if (!D[D.length - 1].endsWith(".json"))
|
|
739
741
|
continue;
|
|
740
|
-
const
|
|
741
|
-
|
|
742
|
-
let
|
|
743
|
-
const
|
|
744
|
-
j.has(
|
|
742
|
+
const x = n.join(I, ...D);
|
|
743
|
+
g && console.log(`Loading file: ${x}…`);
|
|
744
|
+
let X = i.readFileSync(x, { encoding: "utf8" });
|
|
745
|
+
const V = _ ? JSON.parse(X) : r(X);
|
|
746
|
+
j.has(V.uid) || (j.add(V.uid), yield {
|
|
747
|
+
datasetLegislature: A.legislature,
|
|
748
|
+
filePath: x,
|
|
749
|
+
item: V
|
|
750
|
+
}, X = null);
|
|
745
751
|
}
|
|
746
752
|
}
|
|
747
753
|
j.clear();
|
|
748
754
|
}
|
|
749
|
-
function
|
|
755
|
+
function ne(s, t) {
|
|
750
756
|
const e = Array.isArray(s) ? s : s !== void 0 ? [s] : [];
|
|
751
757
|
return s === void 0 || e.includes(0) || t.legislature === a.All ? !0 : e.includes(t.legislature);
|
|
752
758
|
}
|
|
753
759
|
function* me(s, t, e = {}) {
|
|
754
760
|
for (const {
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
761
|
+
datasetLegislature: r,
|
|
762
|
+
item: d,
|
|
763
|
+
filePath: f
|
|
764
|
+
} of P(
|
|
758
765
|
s,
|
|
759
766
|
t,
|
|
760
|
-
|
|
761
|
-
|
|
767
|
+
S.acteursEtOrganes,
|
|
768
|
+
R.toActeur,
|
|
762
769
|
["acteurs"],
|
|
763
770
|
"json",
|
|
764
771
|
e
|
|
765
772
|
))
|
|
766
|
-
yield { acteur:
|
|
773
|
+
yield { acteur: d, datasetLegislature: r, filePath: f };
|
|
767
774
|
}
|
|
768
775
|
function* fe(s, t, e = {}) {
|
|
769
776
|
for (const {
|
|
770
|
-
item:
|
|
771
|
-
datasetLegislature: d
|
|
772
|
-
|
|
777
|
+
item: r,
|
|
778
|
+
datasetLegislature: d,
|
|
779
|
+
filePath: f
|
|
780
|
+
} of P(
|
|
773
781
|
s,
|
|
774
782
|
t,
|
|
775
|
-
|
|
776
|
-
|
|
783
|
+
S.acteursEtOrganes,
|
|
784
|
+
R.toOrgane,
|
|
777
785
|
["organes"],
|
|
778
786
|
"json",
|
|
779
787
|
e
|
|
780
788
|
))
|
|
781
|
-
yield { organe:
|
|
789
|
+
yield { organe: r, datasetLegislature: d, filePath: f };
|
|
782
790
|
}
|
|
783
791
|
function* pe(s, t, e = {}) {
|
|
784
792
|
for (const {
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
793
|
+
datasetLegislature: r,
|
|
794
|
+
item: d,
|
|
795
|
+
filePath: f
|
|
796
|
+
} of P(
|
|
788
797
|
s,
|
|
789
798
|
t,
|
|
790
|
-
|
|
791
|
-
|
|
799
|
+
S.amendements,
|
|
800
|
+
w.toAmendement,
|
|
792
801
|
[],
|
|
793
802
|
"json",
|
|
794
803
|
e
|
|
795
804
|
))
|
|
796
|
-
yield { amendement:
|
|
805
|
+
yield { amendement: d, datasetLegislature: r, filePath: f };
|
|
797
806
|
}
|
|
798
807
|
function* ge(s, t, e = {}) {
|
|
799
808
|
for (const {
|
|
800
|
-
item:
|
|
801
|
-
datasetLegislature: d
|
|
802
|
-
|
|
809
|
+
item: r,
|
|
810
|
+
datasetLegislature: d,
|
|
811
|
+
filePath: f
|
|
812
|
+
} of P(
|
|
803
813
|
s,
|
|
804
814
|
t,
|
|
805
|
-
|
|
815
|
+
S.dossiersLegislatifs,
|
|
806
816
|
q.toDocument,
|
|
807
817
|
["documents"],
|
|
808
818
|
"json",
|
|
809
819
|
e
|
|
810
820
|
))
|
|
811
|
-
yield { document:
|
|
821
|
+
yield { document: r, datasetLegislature: d, filePath: f };
|
|
812
822
|
}
|
|
813
823
|
function* _e(s, t, e = {}) {
|
|
814
824
|
for (const {
|
|
815
|
-
item:
|
|
816
|
-
datasetLegislature: d
|
|
817
|
-
|
|
825
|
+
item: r,
|
|
826
|
+
datasetLegislature: d,
|
|
827
|
+
filePath: f
|
|
828
|
+
} of P(
|
|
818
829
|
s,
|
|
819
830
|
t,
|
|
820
|
-
|
|
831
|
+
S.dossiersLegislatifs,
|
|
821
832
|
q.toDossierParlementaire,
|
|
822
833
|
["dossiers"],
|
|
823
834
|
"json",
|
|
824
835
|
e
|
|
825
836
|
))
|
|
826
|
-
yield { dossierParlementaire:
|
|
837
|
+
yield { dossierParlementaire: r, datasetLegislature: d, filePath: f };
|
|
827
838
|
}
|
|
828
839
|
function* je(s, t, e = {}) {
|
|
829
840
|
for (const {
|
|
830
|
-
item:
|
|
831
|
-
datasetLegislature: d
|
|
832
|
-
|
|
841
|
+
item: r,
|
|
842
|
+
datasetLegislature: d,
|
|
843
|
+
filePath: f
|
|
844
|
+
} of P(
|
|
833
845
|
s,
|
|
834
846
|
t,
|
|
835
|
-
|
|
836
|
-
|
|
847
|
+
S.agendas,
|
|
848
|
+
Z.toReunion,
|
|
837
849
|
[],
|
|
838
850
|
"json",
|
|
839
851
|
e
|
|
840
852
|
))
|
|
841
|
-
yield { reunion:
|
|
853
|
+
yield { reunion: r, datasetLegislature: d, filePath: f };
|
|
842
854
|
}
|
|
843
855
|
function* ye(s, t, e = {}) {
|
|
844
856
|
for (const {
|
|
845
|
-
item:
|
|
846
|
-
datasetLegislature: d
|
|
847
|
-
|
|
857
|
+
item: r,
|
|
858
|
+
datasetLegislature: d,
|
|
859
|
+
filePath: f
|
|
860
|
+
} of P(
|
|
848
861
|
s,
|
|
849
862
|
t,
|
|
850
|
-
|
|
851
|
-
|
|
863
|
+
S.scrutins,
|
|
864
|
+
B.toScrutin,
|
|
852
865
|
[],
|
|
853
866
|
"json",
|
|
854
867
|
e
|
|
855
868
|
))
|
|
856
|
-
yield { scrutin:
|
|
869
|
+
yield { scrutin: r, datasetLegislature: d, filePath: f };
|
|
857
870
|
}
|
|
858
|
-
function*
|
|
871
|
+
function* he(s, t, e = {}) {
|
|
859
872
|
for (const {
|
|
860
|
-
item:
|
|
861
|
-
datasetLegislature: d
|
|
862
|
-
|
|
873
|
+
item: r,
|
|
874
|
+
datasetLegislature: d,
|
|
875
|
+
filePath: f
|
|
876
|
+
} of P(
|
|
863
877
|
s,
|
|
864
878
|
t,
|
|
865
|
-
|
|
866
|
-
|
|
879
|
+
S.questions,
|
|
880
|
+
J.toQuestion,
|
|
867
881
|
[],
|
|
868
882
|
"json",
|
|
869
883
|
e
|
|
870
884
|
))
|
|
871
|
-
yield { question:
|
|
885
|
+
yield { question: r, datasetLegislature: d, filePath: f };
|
|
872
886
|
}
|
|
873
|
-
function*
|
|
887
|
+
function* Se(s, t, e = {}) {
|
|
874
888
|
for (const {
|
|
875
|
-
item:
|
|
876
|
-
datasetLegislature: d
|
|
877
|
-
|
|
889
|
+
item: r,
|
|
890
|
+
datasetLegislature: d,
|
|
891
|
+
filePath: f
|
|
892
|
+
} of P(
|
|
878
893
|
s,
|
|
879
894
|
t,
|
|
880
|
-
|
|
895
|
+
S.comptesRendusSeances,
|
|
881
896
|
N.toCompteRendu,
|
|
882
897
|
[],
|
|
883
898
|
"xml",
|
|
884
899
|
e
|
|
885
900
|
))
|
|
886
|
-
yield { compteRendu:
|
|
901
|
+
yield { compteRendu: r, datasetLegislature: d, filePath: f };
|
|
887
902
|
}
|
|
888
903
|
function* Ae(s, t) {
|
|
889
|
-
const e = `Comptes_Rendus_Commissions_${
|
|
890
|
-
if (i.existsSync(
|
|
891
|
-
for (const d of
|
|
904
|
+
const e = `Comptes_Rendus_Commissions_${se(t)}_nettoye`, r = n.join(s, e);
|
|
905
|
+
if (i.existsSync(r))
|
|
906
|
+
for (const d of T(r))
|
|
892
907
|
try {
|
|
893
|
-
const
|
|
908
|
+
const f = i.readFileSync(d, "utf-8");
|
|
894
909
|
yield {
|
|
895
|
-
compteRendu: JSON.parse(
|
|
896
|
-
datasetLegislature: t
|
|
910
|
+
compteRendu: JSON.parse(f),
|
|
911
|
+
datasetLegislature: t,
|
|
912
|
+
filePath: d
|
|
897
913
|
};
|
|
898
|
-
} catch (
|
|
899
|
-
console.warn(`Erreur lors de la lecture du fichier ${d} :`,
|
|
914
|
+
} catch (f) {
|
|
915
|
+
console.warn(`Erreur lors de la lecture du fichier ${d} :`, f);
|
|
900
916
|
}
|
|
901
917
|
}
|
|
902
|
-
function*
|
|
918
|
+
function* T(s) {
|
|
903
919
|
if (i.existsSync(s))
|
|
904
920
|
for (const t of i.readdirSync(s, { withFileTypes: !0 })) {
|
|
905
921
|
const e = n.join(s, t.name);
|
|
906
|
-
t.isDirectory() ? yield*
|
|
922
|
+
t.isDirectory() ? yield* T(e) : t.isFile() && e.endsWith(".json") && (yield e);
|
|
907
923
|
}
|
|
908
924
|
}
|
|
909
|
-
function
|
|
910
|
-
const d = {},
|
|
911
|
-
if (t &
|
|
912
|
-
for (const
|
|
913
|
-
if (
|
|
925
|
+
function Fe(s, t, e, { log: r = !1 } = {}) {
|
|
926
|
+
const d = {}, f = {};
|
|
927
|
+
if (t & v.ActeursEtOrganes)
|
|
928
|
+
for (const o of S.acteursEtOrganes) {
|
|
929
|
+
if (o.ignoreForWeb || e !== a.All && o.legislature !== a.All && e !== o.legislature)
|
|
914
930
|
continue;
|
|
915
|
-
const
|
|
931
|
+
const u = n.join(
|
|
916
932
|
s,
|
|
917
|
-
|
|
933
|
+
o.filename.replace(/\.json$/, "_nettoye")
|
|
918
934
|
);
|
|
919
|
-
for (const
|
|
920
|
-
if (!
|
|
935
|
+
for (const c of L(u, ["acteurs"])) {
|
|
936
|
+
if (!c[c.length - 1].endsWith(".json"))
|
|
921
937
|
continue;
|
|
922
|
-
const l = n.join(
|
|
923
|
-
|
|
924
|
-
const
|
|
938
|
+
const l = n.join(u, ...c);
|
|
939
|
+
r && console.log(`Loading file: ${l}…`);
|
|
940
|
+
const p = i.readFileSync(l, {
|
|
925
941
|
encoding: "utf8"
|
|
926
|
-
}), m =
|
|
942
|
+
}), m = R.toActeur(p);
|
|
927
943
|
d[m.uid] === void 0 && (d[m.uid] = m);
|
|
928
944
|
}
|
|
929
|
-
for (const
|
|
930
|
-
if (!
|
|
945
|
+
for (const c of L(u, ["organes"])) {
|
|
946
|
+
if (!c[c.length - 1].endsWith(".json"))
|
|
931
947
|
continue;
|
|
932
|
-
const l = n.join(
|
|
933
|
-
|
|
934
|
-
const
|
|
948
|
+
const l = n.join(u, ...c);
|
|
949
|
+
r && console.log(`Loading file: ${l}…`);
|
|
950
|
+
const p = i.readFileSync(l, {
|
|
935
951
|
encoding: "utf8"
|
|
936
|
-
}), m =
|
|
937
|
-
|
|
952
|
+
}), m = R.toOrgane(p);
|
|
953
|
+
f[m.uid] === void 0 && (f[m.uid] = m);
|
|
938
954
|
}
|
|
939
955
|
}
|
|
940
|
-
const _ = {},
|
|
941
|
-
if (t &
|
|
942
|
-
for (const
|
|
943
|
-
if (
|
|
956
|
+
const _ = {}, g = {}, j = {};
|
|
957
|
+
if (t & v.Agendas)
|
|
958
|
+
for (const o of S.agendas) {
|
|
959
|
+
if (o.ignoreForWeb || e !== a.All && o.legislature !== a.All && e !== o.legislature)
|
|
944
960
|
continue;
|
|
945
|
-
const
|
|
961
|
+
const u = n.join(
|
|
946
962
|
s,
|
|
947
|
-
|
|
963
|
+
o.filename.replace(/\.json$/, "_nettoye")
|
|
948
964
|
);
|
|
949
|
-
for (const
|
|
950
|
-
if (!
|
|
965
|
+
for (const c of L(u)) {
|
|
966
|
+
if (!c[c.length - 1].endsWith(".json"))
|
|
951
967
|
continue;
|
|
952
|
-
const l = n.join(
|
|
953
|
-
|
|
954
|
-
const
|
|
968
|
+
const l = n.join(u, ...c);
|
|
969
|
+
r && console.log(`Loading file: ${l}…`);
|
|
970
|
+
const p = i.readFileSync(l, {
|
|
955
971
|
encoding: "utf8"
|
|
956
|
-
}), m =
|
|
972
|
+
}), m = Z.toReunion(p);
|
|
957
973
|
_[m.uid] === void 0 && (_[m.uid] = m);
|
|
958
|
-
const
|
|
959
|
-
let
|
|
960
|
-
|
|
961
|
-
const
|
|
962
|
-
if (
|
|
963
|
-
for (const C of
|
|
964
|
-
for (const
|
|
965
|
-
let
|
|
966
|
-
|
|
974
|
+
const b = m.timestampDebut.toISOString().split("T")[0];
|
|
975
|
+
let $ = g[b];
|
|
976
|
+
$ === void 0 && ($ = g[b] = []), $.push(m);
|
|
977
|
+
const U = m.odj;
|
|
978
|
+
if (U !== void 0)
|
|
979
|
+
for (const C of U.pointsOdj || [])
|
|
980
|
+
for (const k of C.dossiersLegislatifsRefs || []) {
|
|
981
|
+
let M = j[k];
|
|
982
|
+
M === void 0 && (M = j[k] = []), M.push(m);
|
|
967
983
|
}
|
|
968
984
|
}
|
|
969
985
|
}
|
|
970
986
|
const A = {};
|
|
971
|
-
if (t &
|
|
972
|
-
for (const
|
|
973
|
-
if (
|
|
987
|
+
if (t & v.Amendements)
|
|
988
|
+
for (const o of S.amendements) {
|
|
989
|
+
if (o.ignoreForWeb || e !== a.All && o.legislature !== a.All && e !== o.legislature)
|
|
974
990
|
continue;
|
|
975
|
-
const
|
|
991
|
+
const u = n.join(
|
|
976
992
|
s,
|
|
977
|
-
|
|
993
|
+
o.filename.replace(/\.json$/, "_nettoye")
|
|
978
994
|
);
|
|
979
|
-
for (const
|
|
980
|
-
if (!
|
|
995
|
+
for (const c of L(u)) {
|
|
996
|
+
if (!c[c.length - 1].endsWith(".json"))
|
|
981
997
|
continue;
|
|
982
|
-
const l = n.join(
|
|
983
|
-
|
|
984
|
-
const
|
|
998
|
+
const l = n.join(u, ...c);
|
|
999
|
+
r && console.log(`Loading file: ${l}…`);
|
|
1000
|
+
const p = i.readFileSync(l, {
|
|
985
1001
|
encoding: "utf8"
|
|
986
|
-
}), m =
|
|
1002
|
+
}), m = w.toAmendement(p);
|
|
987
1003
|
A[m.uid] === void 0 && (A[m.uid] = m);
|
|
988
1004
|
}
|
|
989
1005
|
}
|
|
990
|
-
const
|
|
991
|
-
if (t &
|
|
992
|
-
for (const
|
|
993
|
-
if (
|
|
1006
|
+
const F = {}, I = {}, D = {}, z = {};
|
|
1007
|
+
if (t & v.DossiersLegislatifs)
|
|
1008
|
+
for (const o of S.dossiersLegislatifs) {
|
|
1009
|
+
if (o.ignoreForWeb || e !== a.All && o.legislature !== a.All && e !== o.legislature)
|
|
994
1010
|
continue;
|
|
995
|
-
const
|
|
1011
|
+
const u = n.join(
|
|
996
1012
|
s,
|
|
997
|
-
|
|
1013
|
+
o.filename.replace(/\.json$/, "_nettoye")
|
|
998
1014
|
);
|
|
999
|
-
for (const
|
|
1000
|
-
if (!
|
|
1015
|
+
for (const c of L(u, ["documents"])) {
|
|
1016
|
+
if (!c[c.length - 1].endsWith(".json"))
|
|
1001
1017
|
continue;
|
|
1002
|
-
const l = n.join(
|
|
1003
|
-
|
|
1004
|
-
const
|
|
1018
|
+
const l = n.join(u, ...c);
|
|
1019
|
+
r && console.log(`Loading file: ${l}…`);
|
|
1020
|
+
const p = i.readFileSync(l, {
|
|
1005
1021
|
encoding: "utf8"
|
|
1006
|
-
}), m = q.toDocument(
|
|
1007
|
-
|
|
1022
|
+
}), m = q.toDocument(p);
|
|
1023
|
+
F[m.uid] === void 0 && (F[m.uid] = m);
|
|
1008
1024
|
}
|
|
1009
|
-
for (const
|
|
1010
|
-
if (!
|
|
1025
|
+
for (const c of L(u, ["dossiers"])) {
|
|
1026
|
+
if (!c[c.length - 1].endsWith(".json"))
|
|
1011
1027
|
continue;
|
|
1012
|
-
const l = n.join(
|
|
1013
|
-
|
|
1014
|
-
const
|
|
1028
|
+
const l = n.join(u, ...c);
|
|
1029
|
+
r && console.log(`Loading file: ${l}…`);
|
|
1030
|
+
const p = i.readFileSync(l, {
|
|
1015
1031
|
encoding: "utf8"
|
|
1016
|
-
}), m = q.toDossierParlementaire(
|
|
1017
|
-
|
|
1032
|
+
}), m = q.toDossierParlementaire(p), b = m.titreDossier;
|
|
1033
|
+
b.senatChemin && I[b.senatChemin] === void 0 && (I[b.senatChemin] = m), b.titreChemin && D[b.titreChemin] === void 0 && (D[b.titreChemin] = m), z[m.uid] === void 0 && (z[m.uid] = m);
|
|
1018
1034
|
}
|
|
1019
1035
|
}
|
|
1020
|
-
let
|
|
1021
|
-
if (t &
|
|
1036
|
+
let x = {};
|
|
1037
|
+
if (t & v.Photos) {
|
|
1022
1038
|
{
|
|
1023
|
-
const
|
|
1039
|
+
const o = n.join(
|
|
1024
1040
|
s,
|
|
1025
1041
|
`photos_deputes_${// TODO: Handle Legislature.All.
|
|
1026
1042
|
e === a.All ? a.DixSept : e}`,
|
|
1027
1043
|
"deputes.json"
|
|
1028
1044
|
);
|
|
1029
|
-
if (i.existsSync(
|
|
1030
|
-
|
|
1031
|
-
const
|
|
1032
|
-
Object.assign(
|
|
1033
|
-
} else
|
|
1045
|
+
if (i.existsSync(o)) {
|
|
1046
|
+
r && console.log(`Loading file: ${o}`);
|
|
1047
|
+
const u = i.readFileSync(o, { encoding: "utf8" });
|
|
1048
|
+
Object.assign(x, JSON.parse(u));
|
|
1049
|
+
} else r && console.log(`Ignoring missing file: ${o}`);
|
|
1034
1050
|
}
|
|
1035
1051
|
{
|
|
1036
|
-
const
|
|
1052
|
+
const o = n.join(
|
|
1037
1053
|
s,
|
|
1038
1054
|
"photos_senateurs",
|
|
1039
1055
|
"senateurs.json"
|
|
1040
1056
|
);
|
|
1041
|
-
if (i.existsSync(
|
|
1042
|
-
|
|
1043
|
-
const
|
|
1044
|
-
Object.assign(
|
|
1045
|
-
} else
|
|
1057
|
+
if (i.existsSync(o)) {
|
|
1058
|
+
r && console.log(`Loading file: ${o}`);
|
|
1059
|
+
const u = i.readFileSync(o, { encoding: "utf8" });
|
|
1060
|
+
Object.assign(x, JSON.parse(u));
|
|
1061
|
+
} else r && console.log(`Ignoring missing file: ${o}`);
|
|
1046
1062
|
}
|
|
1047
1063
|
}
|
|
1048
|
-
const
|
|
1049
|
-
if (t &
|
|
1050
|
-
for (const
|
|
1051
|
-
if (
|
|
1064
|
+
const X = {};
|
|
1065
|
+
if (t & v.Scrutins)
|
|
1066
|
+
for (const o of S.scrutins) {
|
|
1067
|
+
if (o.ignoreForWeb || e !== a.All && o.legislature !== a.All && e !== o.legislature)
|
|
1052
1068
|
continue;
|
|
1053
|
-
const
|
|
1069
|
+
const u = n.join(
|
|
1054
1070
|
s,
|
|
1055
|
-
|
|
1071
|
+
o.filename.replace(/\.json$/, "_nettoye")
|
|
1056
1072
|
);
|
|
1057
|
-
for (const
|
|
1058
|
-
if (!
|
|
1073
|
+
for (const c of L(u)) {
|
|
1074
|
+
if (!c[c.length - 1].endsWith(".json"))
|
|
1059
1075
|
continue;
|
|
1060
|
-
const l = n.join(
|
|
1061
|
-
|
|
1062
|
-
const
|
|
1076
|
+
const l = n.join(u, ...c);
|
|
1077
|
+
r && console.log(`Loading file: ${l}…`);
|
|
1078
|
+
const p = i.readFileSync(l, {
|
|
1063
1079
|
encoding: "utf8"
|
|
1064
|
-
}), m =
|
|
1065
|
-
|
|
1080
|
+
}), m = B.toScrutin(p);
|
|
1081
|
+
X[m.uid] === void 0 && (X[m.uid] = m);
|
|
1066
1082
|
}
|
|
1067
1083
|
}
|
|
1068
|
-
const
|
|
1069
|
-
if (t &
|
|
1070
|
-
for (const
|
|
1071
|
-
if (
|
|
1084
|
+
const V = {};
|
|
1085
|
+
if (t & v.Questions)
|
|
1086
|
+
for (const o of S.questions) {
|
|
1087
|
+
if (o.ignoreForWeb || e !== a.All && o.legislature !== a.All && e !== o.legislature)
|
|
1072
1088
|
continue;
|
|
1073
|
-
const
|
|
1089
|
+
const u = n.join(
|
|
1074
1090
|
s,
|
|
1075
|
-
|
|
1091
|
+
o.filename.replace(/\.json$/, "_nettoye")
|
|
1076
1092
|
);
|
|
1077
|
-
for (const
|
|
1078
|
-
if (!
|
|
1093
|
+
for (const c of L(u)) {
|
|
1094
|
+
if (!c[c.length - 1].endsWith(".json"))
|
|
1079
1095
|
continue;
|
|
1080
|
-
const l = n.join(
|
|
1081
|
-
|
|
1082
|
-
const
|
|
1096
|
+
const l = n.join(u, ...c);
|
|
1097
|
+
r && console.log(`Loading file: ${l}…`);
|
|
1098
|
+
const p = i.readFileSync(l, {
|
|
1083
1099
|
encoding: "utf8"
|
|
1084
|
-
}), m =
|
|
1085
|
-
|
|
1100
|
+
}), m = J.toQuestion(p);
|
|
1101
|
+
V[m.uid] === void 0 && (V[m.uid] = m);
|
|
1086
1102
|
}
|
|
1087
1103
|
}
|
|
1088
|
-
const
|
|
1089
|
-
if (t &
|
|
1090
|
-
for (const
|
|
1091
|
-
if (
|
|
1104
|
+
const O = {};
|
|
1105
|
+
if (t & v.ComptesRendusSeances)
|
|
1106
|
+
for (const o of S.comptesRendusSeances) {
|
|
1107
|
+
if (o.ignoreForWeb || e !== a.All && o.legislature !== a.All && e !== o.legislature)
|
|
1092
1108
|
continue;
|
|
1093
|
-
const
|
|
1109
|
+
const u = n.join(
|
|
1094
1110
|
s,
|
|
1095
|
-
|
|
1111
|
+
o.filename.replace(/\.json$/, "_nettoye")
|
|
1096
1112
|
);
|
|
1097
|
-
for (const
|
|
1098
|
-
if (!
|
|
1113
|
+
for (const c of L(u)) {
|
|
1114
|
+
if (!c[c.length - 1].endsWith(".json"))
|
|
1099
1115
|
continue;
|
|
1100
|
-
const l = n.join(
|
|
1101
|
-
|
|
1102
|
-
const
|
|
1116
|
+
const l = n.join(u, ...c);
|
|
1117
|
+
r && console.log(`Loading file: ${l}…`);
|
|
1118
|
+
const p = i.readFileSync(l, {
|
|
1103
1119
|
encoding: "utf8"
|
|
1104
|
-
}), m = N.toCompteRendu(
|
|
1105
|
-
|
|
1120
|
+
}), m = N.toCompteRendu(p);
|
|
1121
|
+
O[m.uid] === void 0 && (O[m.uid] = m);
|
|
1106
1122
|
}
|
|
1107
1123
|
}
|
|
1108
1124
|
return {
|
|
1109
1125
|
acteurByUid: d,
|
|
1110
1126
|
amendementByUid: A,
|
|
1111
|
-
documentByUid:
|
|
1112
|
-
dossierParlementaireBySenatChemin:
|
|
1113
|
-
dossierParlementaireByTitreChemin:
|
|
1114
|
-
dossierParlementaireByUid:
|
|
1115
|
-
organeByUid:
|
|
1116
|
-
photoByUid:
|
|
1127
|
+
documentByUid: F,
|
|
1128
|
+
dossierParlementaireBySenatChemin: I,
|
|
1129
|
+
dossierParlementaireByTitreChemin: D,
|
|
1130
|
+
dossierParlementaireByUid: z,
|
|
1131
|
+
organeByUid: f,
|
|
1132
|
+
photoByUid: x,
|
|
1117
1133
|
reunionByUid: _,
|
|
1118
|
-
reunionsByDay:
|
|
1134
|
+
reunionsByDay: g,
|
|
1119
1135
|
reunionsByDossierUid: j,
|
|
1120
|
-
scrutinByUid:
|
|
1121
|
-
questionByUid:
|
|
1122
|
-
compteRenduByUid:
|
|
1136
|
+
scrutinByUid: X,
|
|
1137
|
+
questionByUid: V,
|
|
1138
|
+
compteRenduByUid: O
|
|
1123
1139
|
};
|
|
1124
1140
|
}
|
|
1125
|
-
function
|
|
1126
|
-
const d = {},
|
|
1127
|
-
if (t &
|
|
1128
|
-
for (const
|
|
1129
|
-
if (
|
|
1141
|
+
function ve(s, t, e, { log: r = !1 } = {}) {
|
|
1142
|
+
const d = {}, f = {};
|
|
1143
|
+
if (t & v.ActeursEtOrganes)
|
|
1144
|
+
for (const o of S.acteursEtOrganes) {
|
|
1145
|
+
if (o.ignoreForWeb || e !== a.All && o.legislature !== a.All && e !== o.legislature)
|
|
1130
1146
|
continue;
|
|
1131
|
-
const
|
|
1147
|
+
const u = n.join(
|
|
1132
1148
|
s,
|
|
1133
|
-
|
|
1149
|
+
o.filename.replace(/\.json$/, "_nettoye.json")
|
|
1134
1150
|
);
|
|
1135
|
-
|
|
1136
|
-
const
|
|
1137
|
-
for (const l of
|
|
1151
|
+
r && console.log(`Loading file: ${u}`);
|
|
1152
|
+
const c = i.readFileSync(u, { encoding: "utf8" }), h = R.toActeursEtOrganes(c);
|
|
1153
|
+
for (const l of h.acteurs)
|
|
1138
1154
|
d[l.uid] === void 0 && (d[l.uid] = l);
|
|
1139
|
-
for (const l of
|
|
1140
|
-
|
|
1155
|
+
for (const l of h.organes)
|
|
1156
|
+
f[l.uid] === void 0 && (f[l.uid] = l);
|
|
1141
1157
|
}
|
|
1142
|
-
const _ = {},
|
|
1143
|
-
if (t &
|
|
1144
|
-
for (const
|
|
1145
|
-
if (
|
|
1158
|
+
const _ = {}, g = {}, j = {};
|
|
1159
|
+
if (t & v.Agendas)
|
|
1160
|
+
for (const o of S.agendas) {
|
|
1161
|
+
if (o.ignoreForWeb || e !== a.All && o.legislature !== a.All && e !== o.legislature)
|
|
1146
1162
|
continue;
|
|
1147
|
-
const
|
|
1163
|
+
const u = n.join(
|
|
1148
1164
|
s,
|
|
1149
|
-
|
|
1165
|
+
o.filename.replace(/\.json$/, "_nettoye.json")
|
|
1150
1166
|
);
|
|
1151
|
-
|
|
1152
|
-
const
|
|
1153
|
-
for (const l of
|
|
1167
|
+
r && console.log(`Loading file: ${u}`);
|
|
1168
|
+
const c = i.readFileSync(u, { encoding: "utf8" }), h = Z.toAgendas(c);
|
|
1169
|
+
for (const l of h.reunions) {
|
|
1154
1170
|
_[l.uid] === void 0 && (_[l.uid] = l);
|
|
1155
|
-
const
|
|
1156
|
-
let m = p
|
|
1157
|
-
m === void 0 && (m = p
|
|
1158
|
-
const
|
|
1159
|
-
if (
|
|
1160
|
-
for (const
|
|
1161
|
-
for (const
|
|
1162
|
-
let C = j[
|
|
1163
|
-
C === void 0 && (C = j[
|
|
1171
|
+
const p = l.timestampDebut.toISOString().split("T")[0];
|
|
1172
|
+
let m = g[p];
|
|
1173
|
+
m === void 0 && (m = g[p] = []), m.push(l);
|
|
1174
|
+
const b = l.odj;
|
|
1175
|
+
if (b !== void 0)
|
|
1176
|
+
for (const $ of b.pointsOdj || [])
|
|
1177
|
+
for (const U of $.dossiersLegislatifsRefs || []) {
|
|
1178
|
+
let C = j[U];
|
|
1179
|
+
C === void 0 && (C = j[U] = []), C.push(l);
|
|
1164
1180
|
}
|
|
1165
1181
|
}
|
|
1166
1182
|
}
|
|
1167
1183
|
const A = {};
|
|
1168
|
-
if (t &
|
|
1169
|
-
for (const
|
|
1170
|
-
if (
|
|
1184
|
+
if (t & v.Amendements)
|
|
1185
|
+
for (const o of S.amendements) {
|
|
1186
|
+
if (o.ignoreForWeb || e !== a.All && o.legislature !== a.All && e !== o.legislature)
|
|
1171
1187
|
continue;
|
|
1172
|
-
const
|
|
1188
|
+
const u = n.join(
|
|
1173
1189
|
s,
|
|
1174
|
-
|
|
1190
|
+
o.filename.replace(/\.json$/, "_nettoye.json")
|
|
1175
1191
|
);
|
|
1176
|
-
|
|
1177
|
-
const
|
|
1178
|
-
for (const l of
|
|
1179
|
-
for (const
|
|
1180
|
-
A[
|
|
1192
|
+
r && console.log(`Loading file: ${u}`);
|
|
1193
|
+
const c = i.readFileSync(u, { encoding: "utf8" }), h = w.toAmendements(c);
|
|
1194
|
+
for (const l of h.textesLegislatifs)
|
|
1195
|
+
for (const p of l.amendements)
|
|
1196
|
+
A[p.uid] === void 0 && (A[p.uid] = p);
|
|
1181
1197
|
}
|
|
1182
|
-
const
|
|
1183
|
-
if (t &
|
|
1184
|
-
for (const
|
|
1185
|
-
if (
|
|
1198
|
+
const F = {}, I = {}, D = {}, z = {};
|
|
1199
|
+
if (t & v.DossiersLegislatifs)
|
|
1200
|
+
for (const o of S.dossiersLegislatifs) {
|
|
1201
|
+
if (o.ignoreForWeb || e !== a.All && o.legislature !== a.All && e !== o.legislature)
|
|
1186
1202
|
continue;
|
|
1187
|
-
const
|
|
1203
|
+
const u = n.join(
|
|
1188
1204
|
s,
|
|
1189
|
-
|
|
1205
|
+
o.filename.replace(/\.json$/, "_nettoye.json")
|
|
1190
1206
|
);
|
|
1191
|
-
|
|
1192
|
-
const
|
|
1193
|
-
for (const l of
|
|
1194
|
-
|
|
1195
|
-
for (const l of
|
|
1196
|
-
const
|
|
1197
|
-
|
|
1207
|
+
r && console.log(`Loading file: ${u}`);
|
|
1208
|
+
const c = i.readFileSync(u, { encoding: "utf8" }), h = q.toDossiersLegislatifs(c);
|
|
1209
|
+
for (const l of h.textesLegislatifs)
|
|
1210
|
+
F[l.uid] === void 0 && (F[l.uid] = l);
|
|
1211
|
+
for (const l of h.dossiersParlementaires) {
|
|
1212
|
+
const p = l.titreDossier;
|
|
1213
|
+
p.senatChemin && I[p.senatChemin] === void 0 && (I[p.senatChemin] = l), p.titreChemin && D[p.titreChemin] === void 0 && (D[p.titreChemin] = l), z[l.uid] === void 0 && (z[l.uid] = l);
|
|
1198
1214
|
}
|
|
1199
1215
|
}
|
|
1200
|
-
const
|
|
1201
|
-
if (t &
|
|
1202
|
-
const
|
|
1216
|
+
const x = {};
|
|
1217
|
+
if (t & v.Photos) {
|
|
1218
|
+
const o = {};
|
|
1203
1219
|
{
|
|
1204
|
-
const
|
|
1220
|
+
const u = n.join(
|
|
1205
1221
|
s,
|
|
1206
1222
|
`photos_deputes_${// TODO: Handle Legislature.All.
|
|
1207
1223
|
e === a.All ? a.DixSept : e}`,
|
|
1208
1224
|
"deputes.json"
|
|
1209
1225
|
);
|
|
1210
|
-
if (i.existsSync(
|
|
1211
|
-
|
|
1212
|
-
const
|
|
1213
|
-
Object.assign(
|
|
1214
|
-
} else
|
|
1226
|
+
if (i.existsSync(u)) {
|
|
1227
|
+
r && console.log(`Loading file: ${u}`);
|
|
1228
|
+
const c = i.readFileSync(u, { encoding: "utf8" });
|
|
1229
|
+
Object.assign(o, JSON.parse(c));
|
|
1230
|
+
} else r && console.log(`Ignoring missing file: ${u}`);
|
|
1215
1231
|
}
|
|
1216
1232
|
{
|
|
1217
|
-
const
|
|
1233
|
+
const u = n.join(
|
|
1218
1234
|
s,
|
|
1219
1235
|
"photos_senateurs",
|
|
1220
1236
|
"senateurs.json"
|
|
1221
1237
|
);
|
|
1222
|
-
if (i.existsSync(
|
|
1223
|
-
|
|
1224
|
-
const
|
|
1225
|
-
Object.assign(
|
|
1226
|
-
} else
|
|
1238
|
+
if (i.existsSync(u)) {
|
|
1239
|
+
r && console.log(`Loading file: ${u}`);
|
|
1240
|
+
const c = i.readFileSync(u, { encoding: "utf8" });
|
|
1241
|
+
Object.assign(o, JSON.parse(c));
|
|
1242
|
+
} else r && console.log(`Ignoring missing file: ${u}`);
|
|
1227
1243
|
}
|
|
1228
1244
|
}
|
|
1229
|
-
const
|
|
1230
|
-
if (t &
|
|
1231
|
-
for (const
|
|
1232
|
-
if (
|
|
1245
|
+
const X = {};
|
|
1246
|
+
if (t & v.Scrutins)
|
|
1247
|
+
for (const o of S.scrutins) {
|
|
1248
|
+
if (o.ignoreForWeb || e !== a.All && o.legislature !== a.All && e !== o.legislature)
|
|
1233
1249
|
continue;
|
|
1234
|
-
const
|
|
1250
|
+
const u = n.join(
|
|
1235
1251
|
s,
|
|
1236
|
-
|
|
1252
|
+
o.filename.replace(/\.json$/, "_nettoye.json")
|
|
1237
1253
|
);
|
|
1238
|
-
|
|
1239
|
-
const
|
|
1240
|
-
for (const l of
|
|
1241
|
-
|
|
1254
|
+
r && console.log(`Loading file: ${u}`);
|
|
1255
|
+
const c = i.readFileSync(u, { encoding: "utf8" }), h = B.toScrutins(c);
|
|
1256
|
+
for (const l of h.scrutins)
|
|
1257
|
+
X[l.uid] === void 0 && (X[l.uid] = l);
|
|
1242
1258
|
}
|
|
1243
|
-
const
|
|
1244
|
-
if (t &
|
|
1245
|
-
for (const
|
|
1246
|
-
if (
|
|
1259
|
+
const V = {};
|
|
1260
|
+
if (t & v.Questions)
|
|
1261
|
+
for (const o of S.questions) {
|
|
1262
|
+
if (o.ignoreForWeb || e !== a.All && o.legislature !== a.All && e !== o.legislature)
|
|
1247
1263
|
continue;
|
|
1248
|
-
const
|
|
1264
|
+
const u = n.join(
|
|
1249
1265
|
s,
|
|
1250
|
-
|
|
1266
|
+
o.filename.replace(/\.json$/, "_nettoye.json")
|
|
1251
1267
|
);
|
|
1252
|
-
|
|
1253
|
-
const
|
|
1254
|
-
for (const l of
|
|
1255
|
-
|
|
1268
|
+
r && console.log(`Loading file: ${u}`);
|
|
1269
|
+
const c = i.readFileSync(u, { encoding: "utf8" }), h = J.toQuestions(c);
|
|
1270
|
+
for (const l of h.questions)
|
|
1271
|
+
V[l.uid] === void 0 && (V[l.uid] = l);
|
|
1256
1272
|
}
|
|
1257
|
-
const
|
|
1258
|
-
if (t &
|
|
1259
|
-
for (const
|
|
1260
|
-
if (
|
|
1273
|
+
const O = {};
|
|
1274
|
+
if (t & v.ComptesRendusSeances)
|
|
1275
|
+
for (const o of S.comptesRendusSeances) {
|
|
1276
|
+
if (o.ignoreForWeb || e !== a.All && o.legislature !== a.All && e !== o.legislature)
|
|
1261
1277
|
continue;
|
|
1262
|
-
const
|
|
1278
|
+
const u = n.join(
|
|
1263
1279
|
s,
|
|
1264
|
-
|
|
1280
|
+
o.filename.replace(/\.json$/, "_nettoye.json")
|
|
1265
1281
|
);
|
|
1266
|
-
|
|
1267
|
-
const
|
|
1268
|
-
for (const l of
|
|
1269
|
-
|
|
1282
|
+
r && console.log(`Loading file: ${u}`);
|
|
1283
|
+
const c = i.readFileSync(u, { encoding: "utf8" }), h = N.toComptesRendus(c);
|
|
1284
|
+
for (const l of h.comptesRendus)
|
|
1285
|
+
O[l.uid] === void 0 && (O[l.uid] = l);
|
|
1270
1286
|
}
|
|
1271
1287
|
return {
|
|
1272
1288
|
acteurByUid: d,
|
|
1273
1289
|
amendementByUid: A,
|
|
1274
|
-
documentByUid:
|
|
1275
|
-
dossierParlementaireBySenatChemin:
|
|
1276
|
-
dossierParlementaireByTitreChemin:
|
|
1277
|
-
dossierParlementaireByUid:
|
|
1278
|
-
organeByUid:
|
|
1279
|
-
photoByUid:
|
|
1290
|
+
documentByUid: F,
|
|
1291
|
+
dossierParlementaireBySenatChemin: I,
|
|
1292
|
+
dossierParlementaireByTitreChemin: D,
|
|
1293
|
+
dossierParlementaireByUid: z,
|
|
1294
|
+
organeByUid: f,
|
|
1295
|
+
photoByUid: x,
|
|
1280
1296
|
reunionByUid: _,
|
|
1281
|
-
reunionsByDay:
|
|
1297
|
+
reunionsByDay: g,
|
|
1282
1298
|
reunionsByDossierUid: j,
|
|
1283
|
-
scrutinByUid:
|
|
1284
|
-
questionByUid:
|
|
1285
|
-
compteRenduByUid:
|
|
1299
|
+
scrutinByUid: X,
|
|
1300
|
+
questionByUid: V,
|
|
1301
|
+
compteRenduByUid: O
|
|
1286
1302
|
};
|
|
1287
1303
|
}
|
|
1288
|
-
function
|
|
1289
|
-
const
|
|
1290
|
-
if (!i.pathExistsSync(
|
|
1304
|
+
function Ie(s, t, e) {
|
|
1305
|
+
const r = n.join(s, "Documents"), d = ie(r, t), f = n.join(d, "index.json");
|
|
1306
|
+
if (!i.pathExistsSync(f))
|
|
1291
1307
|
return;
|
|
1292
|
-
const _ = i.readJsonSync(
|
|
1293
|
-
for (const
|
|
1294
|
-
for (const { filename: j, url: A } of _[
|
|
1308
|
+
const _ = i.readJsonSync(f);
|
|
1309
|
+
for (const g of e)
|
|
1310
|
+
for (const { filename: j, url: A } of _[g] ?? [])
|
|
1295
1311
|
if (j !== void 0)
|
|
1296
|
-
return { format:
|
|
1312
|
+
return { format: g, path: n.join(d, j), url: A };
|
|
1297
1313
|
}
|
|
1298
|
-
function
|
|
1299
|
-
const
|
|
1314
|
+
function be(s, t, { log: e = !1 } = {}) {
|
|
1315
|
+
const r = n.join(
|
|
1300
1316
|
s,
|
|
1301
1317
|
`photos_deputes_${// TODO: Handle Legislature.All.
|
|
1302
1318
|
t === a.All ? a.DixSept : t}`,
|
|
1303
1319
|
"deputes.json"
|
|
1304
1320
|
);
|
|
1305
|
-
e && console.log(`Loading file: ${
|
|
1306
|
-
const d = i.readFileSync(
|
|
1321
|
+
e && console.log(`Loading file: ${r}`);
|
|
1322
|
+
const d = i.readFileSync(r, { encoding: "utf8" });
|
|
1307
1323
|
return JSON.parse(d);
|
|
1308
1324
|
}
|
|
1309
|
-
function
|
|
1325
|
+
function De(s, { log: t = !1 } = {}) {
|
|
1310
1326
|
const e = n.join(
|
|
1311
1327
|
s,
|
|
1312
1328
|
"photos_senateurs",
|
|
1313
1329
|
"senateurs.json"
|
|
1314
1330
|
);
|
|
1315
1331
|
t && console.log(`Loading file: ${e}`);
|
|
1316
|
-
const
|
|
1317
|
-
return JSON.parse(
|
|
1332
|
+
const r = i.readFileSync(e, { encoding: "utf8" });
|
|
1333
|
+
return JSON.parse(r);
|
|
1318
1334
|
}
|
|
1319
|
-
function
|
|
1320
|
-
const e = t.match(
|
|
1335
|
+
function ie(s, t) {
|
|
1336
|
+
const e = t.match(H);
|
|
1321
1337
|
Q.notStrictEqual(
|
|
1322
1338
|
e,
|
|
1323
1339
|
null,
|
|
1324
1340
|
`Unexpected structure for document UID: ${t}`
|
|
1325
1341
|
);
|
|
1326
|
-
const
|
|
1342
|
+
const r = e.groups, d = n.join(
|
|
1327
1343
|
s,
|
|
1328
|
-
|
|
1329
|
-
),
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
),
|
|
1344
|
+
r.documentType ?? r.documentType2
|
|
1345
|
+
), f = n.join(d, r.chambre ?? r.chambre2), _ = n.join(
|
|
1346
|
+
f,
|
|
1347
|
+
r.republique ?? r.republique2
|
|
1348
|
+
), g = n.join(
|
|
1333
1349
|
_,
|
|
1334
|
-
|
|
1335
|
-
), j =
|
|
1350
|
+
r.legislature ?? r.legislature2
|
|
1351
|
+
), j = r.etat;
|
|
1336
1352
|
if (j === void 0)
|
|
1337
|
-
return i.ensureDirSync(
|
|
1338
|
-
const A = n.join(
|
|
1339
|
-
let
|
|
1340
|
-
|
|
1341
|
-
const
|
|
1342
|
-
return i.ensureDirSync(
|
|
1343
|
-
}
|
|
1344
|
-
function De(s, t) {
|
|
1345
|
-
return w(s, t, H);
|
|
1353
|
+
return i.ensureDirSync(g), n.join(g, t);
|
|
1354
|
+
const A = n.join(g, j);
|
|
1355
|
+
let F = "000000" + (r.numero ?? r.numero2);
|
|
1356
|
+
F = F.substring(F.length - 6);
|
|
1357
|
+
const I = n.join(A, F.substring(0, 3));
|
|
1358
|
+
return i.ensureDirSync(I), n.join(I, t);
|
|
1346
1359
|
}
|
|
1347
1360
|
function Xe(s, t) {
|
|
1361
|
+
return E(s, t, ee);
|
|
1362
|
+
}
|
|
1363
|
+
function Ve(s, t) {
|
|
1348
1364
|
const e = Y.exec(t);
|
|
1349
1365
|
Q.notStrictEqual(
|
|
1350
1366
|
e,
|
|
1351
1367
|
null,
|
|
1352
1368
|
`Unexpected structure for reunion UID: ${t}`
|
|
1353
1369
|
);
|
|
1354
|
-
const
|
|
1370
|
+
const r = n.join(s, e[1]), d = n.join(r, e[2]), f = n.join(d, e[3]), _ = n.join(f, e[4]), g = n.join(_, e[5]);
|
|
1355
1371
|
let j = "000000000" + e[6];
|
|
1356
1372
|
j = j.substring(j.length - 9);
|
|
1357
|
-
const A = n.join(
|
|
1358
|
-
return i.ensureDirSync(
|
|
1373
|
+
const A = n.join(g, j.substring(0, 3)), F = n.join(A, j.substring(3, 3));
|
|
1374
|
+
return i.ensureDirSync(F), n.join(F, t);
|
|
1359
1375
|
}
|
|
1360
1376
|
function Le(s, t) {
|
|
1361
|
-
const e =
|
|
1377
|
+
const e = G.exec(t);
|
|
1362
1378
|
Q.notStrictEqual(
|
|
1363
1379
|
e,
|
|
1364
1380
|
null,
|
|
1365
1381
|
`Unexpected structure for scrutin UID: ${t}`
|
|
1366
1382
|
);
|
|
1367
|
-
const
|
|
1383
|
+
const r = n.join(s, e[1]), d = n.join(r, e[2]), f = n.join(d, e[3]);
|
|
1368
1384
|
let _ = "000000" + e[4];
|
|
1369
1385
|
_ = _.substring(_.length - 6);
|
|
1370
|
-
const
|
|
1371
|
-
return i.ensureDirSync(
|
|
1386
|
+
const g = n.join(f, _.substring(0, 3));
|
|
1387
|
+
return i.ensureDirSync(g), n.join(g, t);
|
|
1372
1388
|
}
|
|
1373
1389
|
function xe(s, t) {
|
|
1374
|
-
return
|
|
1390
|
+
return E(s, t, te);
|
|
1375
1391
|
}
|
|
1376
|
-
function
|
|
1377
|
-
const e =
|
|
1392
|
+
function Pe(s, t) {
|
|
1393
|
+
const e = K.exec(t);
|
|
1378
1394
|
Q.notStrictEqual(
|
|
1379
1395
|
e,
|
|
1380
1396
|
null,
|
|
1381
1397
|
`Unexpected structure for object with UID: ${t}`
|
|
1382
1398
|
);
|
|
1383
|
-
const
|
|
1384
|
-
let
|
|
1385
|
-
|
|
1386
|
-
const j = n.join(_,
|
|
1399
|
+
const r = n.join(s, e[2]), d = n.join(r, e[3]), f = n.join(d, e[4]), _ = n.join(f, e[5]);
|
|
1400
|
+
let g = "000000000" + e[7];
|
|
1401
|
+
g = g.substring(g.length - 9);
|
|
1402
|
+
const j = n.join(_, g.substring(0, 3)), A = n.join(j, g.substring(3, 3));
|
|
1387
1403
|
return i.ensureDirSync(A), n.join(A, t);
|
|
1388
1404
|
}
|
|
1389
|
-
function
|
|
1390
|
-
const
|
|
1405
|
+
function E(s, t, e) {
|
|
1406
|
+
const r = e.exec(t);
|
|
1391
1407
|
Q.notStrictEqual(
|
|
1392
|
-
|
|
1408
|
+
r,
|
|
1393
1409
|
null,
|
|
1394
1410
|
`Unexpected structure for object with UID: ${t}`
|
|
1395
1411
|
);
|
|
1396
|
-
const d = n.join(s,
|
|
1397
|
-
let _ = "000000" +
|
|
1412
|
+
const d = n.join(s, r[1]), f = n.join(d, r[2]);
|
|
1413
|
+
let _ = "000000" + r[3];
|
|
1398
1414
|
_ = _.substring(_.length - 6);
|
|
1399
|
-
const
|
|
1400
|
-
return i.ensureDirSync(
|
|
1415
|
+
const g = n.join(f, _.substring(0, 3));
|
|
1416
|
+
return i.ensureDirSync(g), n.join(g, t);
|
|
1401
1417
|
}
|
|
1402
1418
|
export {
|
|
1403
|
-
|
|
1419
|
+
v as EnabledDatasets,
|
|
1404
1420
|
me as iterLoadAssembleeActeurs,
|
|
1405
1421
|
pe as iterLoadAssembleeAmendements,
|
|
1406
|
-
|
|
1422
|
+
Se as iterLoadAssembleeComptesRendus,
|
|
1407
1423
|
Ae as iterLoadAssembleeComptesRendusCommissions,
|
|
1408
1424
|
ge as iterLoadAssembleeDocuments,
|
|
1409
1425
|
_e as iterLoadAssembleeDossiersParlementaires,
|
|
1410
1426
|
fe as iterLoadAssembleeOrganes,
|
|
1411
|
-
|
|
1427
|
+
he as iterLoadAssembleeQuestions,
|
|
1412
1428
|
je as iterLoadAssembleeReunions,
|
|
1413
1429
|
ye as iterLoadAssembleeScrutins,
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1430
|
+
Fe as loadAssembleeData,
|
|
1431
|
+
ve as loadAssembleeDataFromBigFiles,
|
|
1432
|
+
Ie as loadAssembleeDocumentFile,
|
|
1433
|
+
be as loadAssembleePhotosDeputes,
|
|
1434
|
+
De as loadAssembleePhotosSenateurs,
|
|
1435
|
+
Pe as pathFromCompteRenduUid,
|
|
1436
|
+
ie as pathFromDocumentUid,
|
|
1437
|
+
Xe as pathFromDossierParlementaireUid,
|
|
1422
1438
|
xe as pathFromQuestionUid,
|
|
1423
|
-
|
|
1439
|
+
Ve as pathFromReunionUid,
|
|
1424
1440
|
Le as pathFromScrutinUid,
|
|
1425
1441
|
L as walkDir
|
|
1426
1442
|
};
|