@tricoteuses/assemblee 2.5.19 → 2.5.21
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/git.d.ts +19 -0
- package/lib/git.js +51 -25
- package/lib/loaders.d.ts +9 -0
- package/lib/loaders.js +568 -485
- package/package.json +1 -1
package/lib/loaders.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import
|
|
1
|
+
import C from "node:assert";
|
|
2
2
|
import n from "fs-extra";
|
|
3
|
-
import
|
|
3
|
+
import s from "node:path";
|
|
4
4
|
import "node:crypto";
|
|
5
|
-
import { L as r, a1 as
|
|
5
|
+
import { L as r, a1 as U, a2 as M, a3 as q, a4 as Z, a5 as B, a6 as J, Y as G, $ as K, a0 as ee, X as te, Z as ie, _ as se } from "./uids-DaRrTkI-.js";
|
|
6
6
|
import "glob";
|
|
7
|
+
import { getChangedFilesSinceCommit as k } from "./git.js";
|
|
7
8
|
import { C as N } from "./amendements-40Z7OJLT.js";
|
|
8
9
|
var I = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.ActeursEtOrganes = 1] = "ActeursEtOrganes", t[t.Agendas = 2] = "Agendas", t[t.Amendements = 4] = "Amendements", t[t.DossiersLegislatifs = 8] = "DossiersLegislatifs", t[t.Photos = 16] = "Photos", t[t.Scrutins = 32] = "Scrutins", t[t.Questions = 64] = "Questions", t[t.ComptesRendusSeances = 128] = "ComptesRendusSeances", t[t.All = 255] = "All", t))(I || {});
|
|
9
|
-
async function h(t,
|
|
10
|
-
const e =
|
|
11
|
-
await n.pathExists(e) && await n.remove(e), await n.pathExists(
|
|
12
|
-
|
|
10
|
+
async function h(t, i) {
|
|
11
|
+
const e = s.join(i, t.filename);
|
|
12
|
+
await n.pathExists(e) && await n.remove(e), await n.pathExists(s.join(i, `${t.filename}.temp`, "json")) ? await n.move(
|
|
13
|
+
s.join(i, `${t.filename}.temp`, "json"),
|
|
13
14
|
e
|
|
14
15
|
) : await n.mkdir(e);
|
|
15
16
|
}
|
|
@@ -279,16 +280,16 @@ const A = {
|
|
|
279
280
|
filename: "AMO40_deputes_actifs_mandats_actifs_organes_divises_XVII.json",
|
|
280
281
|
ignoreForWeb: !0,
|
|
281
282
|
legislature: r.DixSept,
|
|
282
|
-
repairZip: async (t,
|
|
283
|
-
const e =
|
|
283
|
+
repairZip: async (t, i) => {
|
|
284
|
+
const e = s.join(i, t.filename);
|
|
284
285
|
await n.pathExists(e) && await n.remove(e), await n.mkdir(e), await n.pathExists(
|
|
285
|
-
|
|
286
|
+
s.join(i, `${t.filename}.temp`, "acteur")
|
|
286
287
|
) && await n.move(
|
|
287
|
-
|
|
288
|
-
|
|
288
|
+
s.join(i, `${t.filename}.temp`, "acteur"),
|
|
289
|
+
s.join(e, "acteur")
|
|
289
290
|
), await n.move(
|
|
290
|
-
|
|
291
|
-
|
|
291
|
+
s.join(i, `${t.filename}.temp`, "organe"),
|
|
292
|
+
s.join(e, "organe")
|
|
292
293
|
);
|
|
293
294
|
},
|
|
294
295
|
structure: 1,
|
|
@@ -323,16 +324,16 @@ const A = {
|
|
|
323
324
|
filename: "AMO40_deputes_actifs_mandats_actifs_organes_divises_XVI.json",
|
|
324
325
|
ignoreForWeb: !0,
|
|
325
326
|
legislature: r.Seize,
|
|
326
|
-
repairZip: async (t,
|
|
327
|
-
const e =
|
|
327
|
+
repairZip: async (t, i) => {
|
|
328
|
+
const e = s.join(i, t.filename);
|
|
328
329
|
await n.pathExists(e) && await n.remove(e), await n.mkdir(e), await n.pathExists(
|
|
329
|
-
|
|
330
|
+
s.join(i, `${t.filename}.temp`, "acteur")
|
|
330
331
|
) && await n.move(
|
|
331
|
-
|
|
332
|
-
|
|
332
|
+
s.join(i, `${t.filename}.temp`, "acteur"),
|
|
333
|
+
s.join(e, "acteur")
|
|
333
334
|
), await n.move(
|
|
334
|
-
|
|
335
|
-
|
|
335
|
+
s.join(i, `${t.filename}.temp`, "organe"),
|
|
336
|
+
s.join(e, "organe")
|
|
336
337
|
);
|
|
337
338
|
},
|
|
338
339
|
structure: 1,
|
|
@@ -367,14 +368,14 @@ const A = {
|
|
|
367
368
|
filename: "AMO40_deputes_actifs_mandats_actifs_organes_divises_XV.json",
|
|
368
369
|
ignoreForWeb: !0,
|
|
369
370
|
legislature: r.Quinze,
|
|
370
|
-
repairZip: async (t,
|
|
371
|
-
const e =
|
|
371
|
+
repairZip: async (t, i) => {
|
|
372
|
+
const e = s.join(i, t.filename);
|
|
372
373
|
await n.pathExists(e) && await n.remove(e), await n.mkdir(e), await n.move(
|
|
373
|
-
|
|
374
|
-
|
|
374
|
+
s.join(i, `${t.filename}.temp`, "acteur"),
|
|
375
|
+
s.join(e, "acteur")
|
|
375
376
|
), await n.move(
|
|
376
|
-
|
|
377
|
-
|
|
377
|
+
s.join(i, `${t.filename}.temp`, "organe"),
|
|
378
|
+
s.join(e, "organe")
|
|
378
379
|
);
|
|
379
380
|
},
|
|
380
381
|
structure: 1,
|
|
@@ -399,17 +400,17 @@ const A = {
|
|
|
399
400
|
filename: "AMO50_acteurs_mandats_organes_divises_XVII.json",
|
|
400
401
|
ignoreForWeb: !0,
|
|
401
402
|
legislature: r.DixSept,
|
|
402
|
-
repairZip: async (t,
|
|
403
|
-
const e =
|
|
403
|
+
repairZip: async (t, i) => {
|
|
404
|
+
const e = s.join(i, t.filename);
|
|
404
405
|
await n.pathExists(e) && await n.remove(e), await n.mkdir(e), await n.move(
|
|
405
|
-
|
|
406
|
-
|
|
406
|
+
s.join(i, `${t.filename}.temp`, "mandat"),
|
|
407
|
+
s.join(e, "mandat")
|
|
407
408
|
), await n.move(
|
|
408
|
-
|
|
409
|
-
|
|
409
|
+
s.join(i, `${t.filename}.temp`, "acteur"),
|
|
410
|
+
s.join(e, "acteur")
|
|
410
411
|
), await n.move(
|
|
411
|
-
|
|
412
|
-
|
|
412
|
+
s.join(i, `${t.filename}.temp`, "organe"),
|
|
413
|
+
s.join(e, "organe")
|
|
413
414
|
);
|
|
414
415
|
},
|
|
415
416
|
structure: 1,
|
|
@@ -434,17 +435,17 @@ const A = {
|
|
|
434
435
|
filename: "AMO50_acteurs_mandats_organes_divises_XVI.json",
|
|
435
436
|
ignoreForWeb: !0,
|
|
436
437
|
legislature: r.Seize,
|
|
437
|
-
repairZip: async (t,
|
|
438
|
-
const e =
|
|
438
|
+
repairZip: async (t, i) => {
|
|
439
|
+
const e = s.join(i, t.filename);
|
|
439
440
|
await n.pathExists(e) && await n.remove(e), await n.mkdir(e), await n.move(
|
|
440
|
-
|
|
441
|
-
|
|
441
|
+
s.join(i, `${t.filename}.temp`, "mandat"),
|
|
442
|
+
s.join(e, "mandat")
|
|
442
443
|
), await n.move(
|
|
443
|
-
|
|
444
|
-
|
|
444
|
+
s.join(i, `${t.filename}.temp`, "acteur"),
|
|
445
|
+
s.join(e, "acteur")
|
|
445
446
|
), await n.move(
|
|
446
|
-
|
|
447
|
-
|
|
447
|
+
s.join(i, `${t.filename}.temp`, "organe"),
|
|
448
|
+
s.join(e, "organe")
|
|
448
449
|
);
|
|
449
450
|
},
|
|
450
451
|
structure: 1,
|
|
@@ -469,17 +470,17 @@ const A = {
|
|
|
469
470
|
filename: "AMO50_acteurs_mandats_organes_divises_XV.json",
|
|
470
471
|
ignoreForWeb: !0,
|
|
471
472
|
legislature: r.Quinze,
|
|
472
|
-
repairZip: async (t,
|
|
473
|
-
const e =
|
|
473
|
+
repairZip: async (t, i) => {
|
|
474
|
+
const e = s.join(i, t.filename);
|
|
474
475
|
await n.pathExists(e) && await n.remove(e), await n.mkdir(e), await n.move(
|
|
475
|
-
|
|
476
|
-
|
|
476
|
+
s.join(i, `${t.filename}.temp`, "mandat"),
|
|
477
|
+
s.join(e, "mandat")
|
|
477
478
|
), await n.move(
|
|
478
|
-
|
|
479
|
-
|
|
479
|
+
s.join(i, `${t.filename}.temp`, "acteur"),
|
|
480
|
+
s.join(e, "acteur")
|
|
480
481
|
), await n.move(
|
|
481
|
-
|
|
482
|
-
|
|
482
|
+
s.join(i, `${t.filename}.temp`, "organe"),
|
|
483
|
+
s.join(e, "organe")
|
|
483
484
|
);
|
|
484
485
|
},
|
|
485
486
|
structure: 1,
|
|
@@ -675,10 +676,10 @@ const A = {
|
|
|
675
676
|
{
|
|
676
677
|
filename: "Comptes_Rendus_Seances_XVII.xml",
|
|
677
678
|
legislature: r.DixSept,
|
|
678
|
-
repairZip: async (t,
|
|
679
|
-
const e =
|
|
679
|
+
repairZip: async (t, i) => {
|
|
680
|
+
const e = s.join(i, t.filename);
|
|
680
681
|
await n.pathExists(e) && await n.remove(e), await n.move(
|
|
681
|
-
|
|
682
|
+
s.join(i, `${t.filename}.temp`, "xml"),
|
|
682
683
|
e
|
|
683
684
|
);
|
|
684
685
|
},
|
|
@@ -689,10 +690,10 @@ const A = {
|
|
|
689
690
|
{
|
|
690
691
|
filename: "Comptes_Rendus_Seances_XVI.xml",
|
|
691
692
|
legislature: r.Seize,
|
|
692
|
-
repairZip: async (t,
|
|
693
|
-
const e =
|
|
693
|
+
repairZip: async (t, i) => {
|
|
694
|
+
const e = s.join(i, t.filename);
|
|
694
695
|
await n.pathExists(e) && await n.remove(e), await n.move(
|
|
695
|
-
|
|
696
|
+
s.join(i, `${t.filename}.temp`, "xml"),
|
|
696
697
|
e
|
|
697
698
|
);
|
|
698
699
|
},
|
|
@@ -702,14 +703,14 @@ const A = {
|
|
|
702
703
|
}
|
|
703
704
|
]
|
|
704
705
|
};
|
|
705
|
-
function*
|
|
706
|
-
const e =
|
|
706
|
+
function* P(t, i = []) {
|
|
707
|
+
const e = s.join(t, ...i);
|
|
707
708
|
if (n.existsSync(e))
|
|
708
|
-
for (const
|
|
709
|
-
if (
|
|
709
|
+
for (const a of n.readdirSync(e)) {
|
|
710
|
+
if (a[0] === ".")
|
|
710
711
|
continue;
|
|
711
|
-
const
|
|
712
|
-
n.statSync(
|
|
712
|
+
const u = s.join(e, a), d = [...i, a];
|
|
713
|
+
n.statSync(u).isDirectory() ? yield* P(t, d) : yield d;
|
|
713
714
|
}
|
|
714
715
|
}
|
|
715
716
|
const Q = [
|
|
@@ -740,730 +741,812 @@ const Q = [
|
|
|
740
741
|
1,
|
|
741
742
|
"I"
|
|
742
743
|
];
|
|
743
|
-
function
|
|
744
|
+
function ne(t) {
|
|
744
745
|
if (t < 0)
|
|
745
746
|
return;
|
|
746
747
|
if (t === 0)
|
|
747
748
|
return "0I";
|
|
748
|
-
let
|
|
749
|
+
let i = "";
|
|
749
750
|
for (let e = 0; e < Q.length; e += 2)
|
|
750
751
|
for (; t >= Q[e]; )
|
|
751
|
-
|
|
752
|
-
return
|
|
752
|
+
i += Q[e + 1], t -= Q[e];
|
|
753
|
+
return i;
|
|
753
754
|
}
|
|
754
|
-
function*
|
|
755
|
-
const
|
|
756
|
-
for (const
|
|
757
|
-
if (
|
|
755
|
+
function* O(t, i, e, a, u, d = "json", { enriched: l = !1, log: j = !1, noValidation: y = !1, sinceCommit: S } = {}) {
|
|
756
|
+
const v = /* @__PURE__ */ new Set();
|
|
757
|
+
for (const b of e) {
|
|
758
|
+
if (b.ignoreForWeb || !oe(i, b))
|
|
758
759
|
continue;
|
|
759
|
-
const
|
|
760
|
+
const x = new RegExp(`\\.${d}$`), D = s.join(
|
|
760
761
|
t,
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
762
|
+
b.filename.replace(
|
|
763
|
+
x,
|
|
764
|
+
l ? "_enrichi" : "_nettoye"
|
|
764
765
|
)
|
|
765
|
-
)
|
|
766
|
-
|
|
766
|
+
), z = S ? k(D, S, {
|
|
767
|
+
diffFilter: "AMR"
|
|
768
|
+
}) : null;
|
|
769
|
+
j && S && (console.log(
|
|
770
|
+
`Filtering files changed since commit ${S} in ${D}`
|
|
771
|
+
), console.log(`Found ${z?.size || 0} changed files`));
|
|
772
|
+
for (const X of P(D, u)) {
|
|
767
773
|
if (!X[X.length - 1].endsWith(".json"))
|
|
768
774
|
continue;
|
|
769
|
-
const
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
775
|
+
const V = s.join(D, ...X), p = s.join(...X), o = z?.get(p);
|
|
776
|
+
if (z && !o)
|
|
777
|
+
continue;
|
|
778
|
+
j && console.log(`Loading file: ${V}…`);
|
|
779
|
+
let f = n.readFileSync(V, { encoding: "utf8" });
|
|
780
|
+
const c = y ? JSON.parse(f) : a(f);
|
|
781
|
+
v.has(c.uid) || (v.add(c.uid), yield {
|
|
782
|
+
datasetLegislature: b.legislature,
|
|
783
|
+
filePath: V,
|
|
784
|
+
item: c,
|
|
785
|
+
...o && { gitStatus: o }
|
|
786
|
+
}, f = null);
|
|
787
|
+
}
|
|
788
|
+
if (S) {
|
|
789
|
+
const X = k(
|
|
790
|
+
D,
|
|
791
|
+
S,
|
|
792
|
+
{
|
|
793
|
+
diffFilter: "D"
|
|
794
|
+
}
|
|
795
|
+
);
|
|
796
|
+
for (const [$, V] of X.entries()) {
|
|
797
|
+
const p = s.join(D, $);
|
|
798
|
+
j && console.log(`Deleted file: ${p}`);
|
|
799
|
+
const f = { uid: s.basename($, `.${d}`) };
|
|
800
|
+
yield {
|
|
801
|
+
datasetLegislature: b.legislature,
|
|
802
|
+
filePath: p,
|
|
803
|
+
item: f,
|
|
804
|
+
gitStatus: V
|
|
805
|
+
};
|
|
806
|
+
}
|
|
778
807
|
}
|
|
779
808
|
}
|
|
780
|
-
|
|
809
|
+
v.clear();
|
|
781
810
|
}
|
|
782
|
-
function
|
|
811
|
+
function oe(t, i) {
|
|
783
812
|
const e = Array.isArray(t) ? t : t !== void 0 ? [t] : [];
|
|
784
|
-
return t === void 0 || e.includes(0) ||
|
|
813
|
+
return t === void 0 || e.includes(0) || i.legislature === r.All ? !0 : e.includes(i.legislature);
|
|
785
814
|
}
|
|
786
|
-
function*
|
|
815
|
+
function* ge(t, i, e = {}) {
|
|
787
816
|
for (const {
|
|
788
|
-
datasetLegislature:
|
|
789
|
-
item:
|
|
790
|
-
filePath:
|
|
791
|
-
|
|
817
|
+
datasetLegislature: a,
|
|
818
|
+
item: u,
|
|
819
|
+
filePath: d,
|
|
820
|
+
gitStatus: l
|
|
821
|
+
} of O(
|
|
792
822
|
t,
|
|
793
|
-
|
|
823
|
+
i,
|
|
794
824
|
A.acteursEtOrganes,
|
|
795
|
-
|
|
825
|
+
U.toActeur,
|
|
796
826
|
["acteurs"],
|
|
797
827
|
"json",
|
|
798
828
|
e
|
|
799
829
|
))
|
|
800
|
-
yield {
|
|
830
|
+
yield {
|
|
831
|
+
acteur: u,
|
|
832
|
+
datasetLegislature: a,
|
|
833
|
+
filePath: d,
|
|
834
|
+
...l && { gitStatus: l }
|
|
835
|
+
};
|
|
801
836
|
}
|
|
802
|
-
function*
|
|
837
|
+
function* _e(t, i, e = {}) {
|
|
803
838
|
for (const {
|
|
804
|
-
item:
|
|
805
|
-
datasetLegislature:
|
|
806
|
-
filePath:
|
|
807
|
-
|
|
839
|
+
item: a,
|
|
840
|
+
datasetLegislature: u,
|
|
841
|
+
filePath: d,
|
|
842
|
+
gitStatus: l
|
|
843
|
+
} of O(
|
|
808
844
|
t,
|
|
809
|
-
|
|
845
|
+
i,
|
|
810
846
|
A.acteursEtOrganes,
|
|
811
|
-
|
|
847
|
+
U.toOrgane,
|
|
812
848
|
["organes"],
|
|
813
849
|
"json",
|
|
814
850
|
e
|
|
815
851
|
))
|
|
816
|
-
yield {
|
|
852
|
+
yield {
|
|
853
|
+
organe: a,
|
|
854
|
+
datasetLegislature: u,
|
|
855
|
+
filePath: d,
|
|
856
|
+
...l && { gitStatus: l }
|
|
857
|
+
};
|
|
817
858
|
}
|
|
818
|
-
function*
|
|
859
|
+
function* je(t, i, e = {}) {
|
|
819
860
|
for (const {
|
|
820
|
-
datasetLegislature:
|
|
821
|
-
item:
|
|
822
|
-
filePath:
|
|
823
|
-
|
|
861
|
+
datasetLegislature: a,
|
|
862
|
+
item: u,
|
|
863
|
+
filePath: d,
|
|
864
|
+
gitStatus: l
|
|
865
|
+
} of O(
|
|
824
866
|
t,
|
|
825
|
-
|
|
867
|
+
i,
|
|
826
868
|
A.amendements,
|
|
827
869
|
N.toAmendement,
|
|
828
870
|
[],
|
|
829
871
|
"json",
|
|
830
872
|
e
|
|
831
873
|
))
|
|
832
|
-
yield {
|
|
874
|
+
yield {
|
|
875
|
+
amendement: u,
|
|
876
|
+
datasetLegislature: a,
|
|
877
|
+
filePath: d,
|
|
878
|
+
...l && { gitStatus: l }
|
|
879
|
+
};
|
|
833
880
|
}
|
|
834
|
-
function*
|
|
881
|
+
function* he(t, i, e = {}) {
|
|
835
882
|
for (const {
|
|
836
|
-
item:
|
|
837
|
-
datasetLegislature:
|
|
838
|
-
filePath:
|
|
839
|
-
|
|
883
|
+
item: a,
|
|
884
|
+
datasetLegislature: u,
|
|
885
|
+
filePath: d,
|
|
886
|
+
gitStatus: l
|
|
887
|
+
} of O(
|
|
840
888
|
t,
|
|
841
|
-
|
|
889
|
+
i,
|
|
842
890
|
A.dossiersLegislatifs,
|
|
843
|
-
|
|
891
|
+
q.toDocument,
|
|
844
892
|
["documents"],
|
|
845
893
|
"json",
|
|
846
894
|
e
|
|
847
895
|
))
|
|
848
|
-
yield {
|
|
896
|
+
yield {
|
|
897
|
+
document: a,
|
|
898
|
+
datasetLegislature: u,
|
|
899
|
+
filePath: d,
|
|
900
|
+
...l && { gitStatus: l }
|
|
901
|
+
};
|
|
849
902
|
}
|
|
850
|
-
function*
|
|
903
|
+
function* ye(t, i, e = {}) {
|
|
851
904
|
for (const {
|
|
852
|
-
item:
|
|
853
|
-
datasetLegislature:
|
|
854
|
-
filePath:
|
|
855
|
-
|
|
905
|
+
item: a,
|
|
906
|
+
datasetLegislature: u,
|
|
907
|
+
filePath: d,
|
|
908
|
+
gitStatus: l
|
|
909
|
+
} of O(
|
|
856
910
|
t,
|
|
857
|
-
|
|
911
|
+
i,
|
|
858
912
|
A.dossiersLegislatifs,
|
|
859
|
-
|
|
913
|
+
q.toDossierParlementaire,
|
|
860
914
|
["dossiers"],
|
|
861
915
|
"json",
|
|
862
916
|
e
|
|
863
917
|
))
|
|
864
|
-
yield {
|
|
918
|
+
yield {
|
|
919
|
+
dossierParlementaire: a,
|
|
920
|
+
datasetLegislature: u,
|
|
921
|
+
filePath: d,
|
|
922
|
+
...l && { gitStatus: l }
|
|
923
|
+
};
|
|
865
924
|
}
|
|
866
|
-
function*
|
|
925
|
+
function* Se(t, i, e = {}) {
|
|
867
926
|
for (const {
|
|
868
|
-
item:
|
|
869
|
-
datasetLegislature:
|
|
870
|
-
filePath:
|
|
871
|
-
|
|
927
|
+
item: a,
|
|
928
|
+
datasetLegislature: u,
|
|
929
|
+
filePath: d,
|
|
930
|
+
gitStatus: l
|
|
931
|
+
} of O(
|
|
872
932
|
t,
|
|
873
|
-
|
|
933
|
+
i,
|
|
874
934
|
A.agendas,
|
|
875
935
|
M.toReunion,
|
|
876
936
|
[],
|
|
877
937
|
"json",
|
|
878
938
|
e
|
|
879
939
|
))
|
|
880
|
-
yield {
|
|
940
|
+
yield {
|
|
941
|
+
reunion: a,
|
|
942
|
+
datasetLegislature: u,
|
|
943
|
+
filePath: d,
|
|
944
|
+
...l && { gitStatus: l }
|
|
945
|
+
};
|
|
881
946
|
}
|
|
882
|
-
function*
|
|
947
|
+
function* Ae(t, i, e = {}) {
|
|
883
948
|
for (const {
|
|
884
|
-
item:
|
|
885
|
-
datasetLegislature:
|
|
886
|
-
filePath:
|
|
887
|
-
|
|
949
|
+
item: a,
|
|
950
|
+
datasetLegislature: u,
|
|
951
|
+
filePath: d,
|
|
952
|
+
gitStatus: l
|
|
953
|
+
} of O(
|
|
888
954
|
t,
|
|
889
|
-
|
|
955
|
+
i,
|
|
890
956
|
A.scrutins,
|
|
891
957
|
Z.toScrutin,
|
|
892
958
|
[],
|
|
893
959
|
"json",
|
|
894
960
|
e
|
|
895
961
|
))
|
|
896
|
-
yield {
|
|
962
|
+
yield {
|
|
963
|
+
scrutin: a,
|
|
964
|
+
datasetLegislature: u,
|
|
965
|
+
filePath: d,
|
|
966
|
+
...l && { gitStatus: l }
|
|
967
|
+
};
|
|
897
968
|
}
|
|
898
|
-
function*
|
|
969
|
+
function* Fe(t, i, e = {}) {
|
|
899
970
|
for (const {
|
|
900
|
-
item:
|
|
901
|
-
datasetLegislature:
|
|
902
|
-
filePath:
|
|
903
|
-
|
|
971
|
+
item: a,
|
|
972
|
+
datasetLegislature: u,
|
|
973
|
+
filePath: d,
|
|
974
|
+
gitStatus: l
|
|
975
|
+
} of O(
|
|
904
976
|
t,
|
|
905
|
-
|
|
977
|
+
i,
|
|
906
978
|
A.questions,
|
|
907
979
|
B.toQuestion,
|
|
908
980
|
[],
|
|
909
981
|
"json",
|
|
910
982
|
e
|
|
911
983
|
))
|
|
912
|
-
yield {
|
|
984
|
+
yield {
|
|
985
|
+
question: a,
|
|
986
|
+
datasetLegislature: u,
|
|
987
|
+
filePath: d,
|
|
988
|
+
...l && { gitStatus: l }
|
|
989
|
+
};
|
|
913
990
|
}
|
|
914
|
-
function*
|
|
991
|
+
function* ve(t, i, e = {}) {
|
|
915
992
|
for (const {
|
|
916
|
-
item:
|
|
917
|
-
datasetLegislature:
|
|
918
|
-
filePath:
|
|
919
|
-
|
|
993
|
+
item: a,
|
|
994
|
+
datasetLegislature: u,
|
|
995
|
+
filePath: d,
|
|
996
|
+
gitStatus: l
|
|
997
|
+
} of O(
|
|
920
998
|
t,
|
|
921
|
-
|
|
999
|
+
i,
|
|
922
1000
|
A.comptesRendusSeances,
|
|
923
1001
|
J.toCompteRendu,
|
|
924
1002
|
[],
|
|
925
1003
|
"xml",
|
|
926
1004
|
e
|
|
927
1005
|
))
|
|
928
|
-
yield {
|
|
1006
|
+
yield {
|
|
1007
|
+
compteRendu: a,
|
|
1008
|
+
datasetLegislature: u,
|
|
1009
|
+
filePath: d,
|
|
1010
|
+
...l && { gitStatus: l }
|
|
1011
|
+
};
|
|
929
1012
|
}
|
|
930
|
-
function*
|
|
931
|
-
const
|
|
932
|
-
if (n.existsSync(
|
|
933
|
-
for (const
|
|
1013
|
+
function* Ie(t, i, { enriched: e = !1 } = {}) {
|
|
1014
|
+
const a = `Comptes_Rendus_Commissions_${ne(i)}${e ? "_enrichi" : "_nettoye"}`, u = s.join(t, a);
|
|
1015
|
+
if (n.existsSync(u))
|
|
1016
|
+
for (const d of T(u))
|
|
934
1017
|
try {
|
|
935
|
-
const
|
|
1018
|
+
const l = n.readFileSync(d, "utf-8");
|
|
936
1019
|
yield {
|
|
937
|
-
compteRendu: JSON.parse(
|
|
938
|
-
datasetLegislature:
|
|
939
|
-
filePath:
|
|
1020
|
+
compteRendu: JSON.parse(l),
|
|
1021
|
+
datasetLegislature: i,
|
|
1022
|
+
filePath: d
|
|
940
1023
|
};
|
|
941
|
-
} catch (
|
|
942
|
-
console.warn(`Erreur lors de la lecture du fichier ${
|
|
1024
|
+
} catch (l) {
|
|
1025
|
+
console.warn(`Erreur lors de la lecture du fichier ${d} :`, l);
|
|
943
1026
|
}
|
|
944
1027
|
}
|
|
945
|
-
function*
|
|
1028
|
+
function* T(t) {
|
|
946
1029
|
if (n.existsSync(t))
|
|
947
|
-
for (const
|
|
948
|
-
const e =
|
|
949
|
-
|
|
1030
|
+
for (const i of n.readdirSync(t, { withFileTypes: !0 })) {
|
|
1031
|
+
const e = s.join(t, i.name);
|
|
1032
|
+
i.isDirectory() ? yield* T(e) : i.isFile() && e.endsWith(".json") && (yield e);
|
|
950
1033
|
}
|
|
951
1034
|
}
|
|
952
|
-
function
|
|
953
|
-
const
|
|
954
|
-
if (
|
|
955
|
-
for (const
|
|
956
|
-
if (
|
|
1035
|
+
function be(t, i, e, { enriched: a = !1, log: u = !1 } = {}) {
|
|
1036
|
+
const d = {}, l = {};
|
|
1037
|
+
if (i & I.ActeursEtOrganes)
|
|
1038
|
+
for (const o of A.acteursEtOrganes) {
|
|
1039
|
+
if (o.ignoreForWeb || e !== r.All && o.legislature !== r.All && e !== o.legislature)
|
|
957
1040
|
continue;
|
|
958
|
-
const f =
|
|
1041
|
+
const f = s.join(
|
|
959
1042
|
t,
|
|
960
|
-
|
|
1043
|
+
o.filename.replace(/\.json$/, a ? "_enrichi" : "_nettoye")
|
|
961
1044
|
);
|
|
962
|
-
for (const
|
|
963
|
-
if (!
|
|
1045
|
+
for (const c of P(f, ["acteurs"])) {
|
|
1046
|
+
if (!c[c.length - 1].endsWith(".json"))
|
|
964
1047
|
continue;
|
|
965
|
-
const
|
|
966
|
-
|
|
967
|
-
const
|
|
1048
|
+
const _ = s.join(f, ...c);
|
|
1049
|
+
u && console.log(`Loading file: ${_}…`);
|
|
1050
|
+
const F = n.readFileSync(_, {
|
|
968
1051
|
encoding: "utf8"
|
|
969
|
-
}),
|
|
970
|
-
|
|
1052
|
+
}), g = U.toActeur(F);
|
|
1053
|
+
d[g.uid] === void 0 && (d[g.uid] = g);
|
|
971
1054
|
}
|
|
972
|
-
for (const
|
|
973
|
-
if (!
|
|
1055
|
+
for (const c of P(f, ["organes"])) {
|
|
1056
|
+
if (!c[c.length - 1].endsWith(".json"))
|
|
974
1057
|
continue;
|
|
975
|
-
const
|
|
976
|
-
|
|
977
|
-
const
|
|
1058
|
+
const _ = s.join(f, ...c);
|
|
1059
|
+
u && console.log(`Loading file: ${_}…`);
|
|
1060
|
+
const F = n.readFileSync(_, {
|
|
978
1061
|
encoding: "utf8"
|
|
979
|
-
}),
|
|
980
|
-
|
|
1062
|
+
}), g = U.toOrgane(F);
|
|
1063
|
+
l[g.uid] === void 0 && (l[g.uid] = g);
|
|
981
1064
|
}
|
|
982
1065
|
}
|
|
983
|
-
const j = {}, y = {},
|
|
984
|
-
if (
|
|
985
|
-
for (const
|
|
986
|
-
if (
|
|
1066
|
+
const j = {}, y = {}, S = {};
|
|
1067
|
+
if (i & I.Agendas)
|
|
1068
|
+
for (const o of A.agendas) {
|
|
1069
|
+
if (o.ignoreForWeb || e !== r.All && o.legislature !== r.All && e !== o.legislature)
|
|
987
1070
|
continue;
|
|
988
|
-
const f =
|
|
1071
|
+
const f = s.join(
|
|
989
1072
|
t,
|
|
990
|
-
|
|
1073
|
+
o.filename.replace(/\.json$/, a ? "_enrichi" : "_nettoye")
|
|
991
1074
|
);
|
|
992
|
-
for (const
|
|
993
|
-
if (!
|
|
1075
|
+
for (const c of P(f)) {
|
|
1076
|
+
if (!c[c.length - 1].endsWith(".json"))
|
|
994
1077
|
continue;
|
|
995
|
-
const
|
|
996
|
-
|
|
997
|
-
const
|
|
1078
|
+
const _ = s.join(f, ...c);
|
|
1079
|
+
u && console.log(`Loading file: ${_}…`);
|
|
1080
|
+
const F = n.readFileSync(_, {
|
|
998
1081
|
encoding: "utf8"
|
|
999
|
-
}),
|
|
1000
|
-
j[
|
|
1001
|
-
const L =
|
|
1082
|
+
}), g = M.toReunion(F);
|
|
1083
|
+
j[g.uid] === void 0 && (j[g.uid] = g);
|
|
1084
|
+
const L = g.timestampDebut.toISOString().split("T")[0];
|
|
1002
1085
|
let w = y[L];
|
|
1003
|
-
w === void 0 && (w = y[L] = []), w.push(
|
|
1004
|
-
const
|
|
1005
|
-
if (
|
|
1006
|
-
for (const
|
|
1007
|
-
for (const E of
|
|
1008
|
-
let W =
|
|
1009
|
-
W === void 0 && (W =
|
|
1086
|
+
w === void 0 && (w = y[L] = []), w.push(g);
|
|
1087
|
+
const R = g.odj;
|
|
1088
|
+
if (R !== void 0)
|
|
1089
|
+
for (const Y of R.pointsOdj || [])
|
|
1090
|
+
for (const E of Y.dossiersLegislatifsRefs || []) {
|
|
1091
|
+
let W = S[E];
|
|
1092
|
+
W === void 0 && (W = S[E] = []), W.push(g);
|
|
1010
1093
|
}
|
|
1011
1094
|
}
|
|
1012
1095
|
}
|
|
1013
1096
|
const v = {};
|
|
1014
|
-
if (
|
|
1015
|
-
for (const
|
|
1016
|
-
if (
|
|
1097
|
+
if (i & I.Amendements)
|
|
1098
|
+
for (const o of A.amendements) {
|
|
1099
|
+
if (o.ignoreForWeb || e !== r.All && o.legislature !== r.All && e !== o.legislature)
|
|
1017
1100
|
continue;
|
|
1018
|
-
const f =
|
|
1101
|
+
const f = s.join(
|
|
1019
1102
|
t,
|
|
1020
|
-
|
|
1103
|
+
o.filename.replace(/\.json$/, a ? "_enrichi" : "_nettoye")
|
|
1021
1104
|
);
|
|
1022
|
-
for (const
|
|
1023
|
-
if (!
|
|
1105
|
+
for (const c of P(f)) {
|
|
1106
|
+
if (!c[c.length - 1].endsWith(".json"))
|
|
1024
1107
|
continue;
|
|
1025
|
-
const
|
|
1026
|
-
|
|
1027
|
-
const
|
|
1108
|
+
const _ = s.join(f, ...c);
|
|
1109
|
+
u && console.log(`Loading file: ${_}…`);
|
|
1110
|
+
const F = n.readFileSync(_, {
|
|
1028
1111
|
encoding: "utf8"
|
|
1029
|
-
}),
|
|
1030
|
-
v[
|
|
1112
|
+
}), g = N.toAmendement(F);
|
|
1113
|
+
v[g.uid] === void 0 && (v[g.uid] = g);
|
|
1031
1114
|
}
|
|
1032
1115
|
}
|
|
1033
|
-
const b = {},
|
|
1034
|
-
if (
|
|
1035
|
-
for (const
|
|
1036
|
-
if (
|
|
1116
|
+
const b = {}, x = {}, D = {}, z = {};
|
|
1117
|
+
if (i & I.DossiersLegislatifs)
|
|
1118
|
+
for (const o of A.dossiersLegislatifs) {
|
|
1119
|
+
if (o.ignoreForWeb || e !== r.All && o.legislature !== r.All && e !== o.legislature)
|
|
1037
1120
|
continue;
|
|
1038
|
-
const f =
|
|
1121
|
+
const f = s.join(
|
|
1039
1122
|
t,
|
|
1040
|
-
|
|
1123
|
+
o.filename.replace(/\.json$/, a ? "_enrichi" : "_nettoye")
|
|
1041
1124
|
);
|
|
1042
|
-
for (const
|
|
1043
|
-
if (!
|
|
1125
|
+
for (const c of P(f, ["documents"])) {
|
|
1126
|
+
if (!c[c.length - 1].endsWith(".json"))
|
|
1044
1127
|
continue;
|
|
1045
|
-
const
|
|
1046
|
-
|
|
1047
|
-
const
|
|
1128
|
+
const _ = s.join(f, ...c);
|
|
1129
|
+
u && console.log(`Loading file: ${_}…`);
|
|
1130
|
+
const F = n.readFileSync(_, {
|
|
1048
1131
|
encoding: "utf8"
|
|
1049
|
-
}),
|
|
1050
|
-
b[
|
|
1132
|
+
}), g = q.toDocument(F);
|
|
1133
|
+
b[g.uid] === void 0 && (b[g.uid] = g);
|
|
1051
1134
|
}
|
|
1052
|
-
for (const
|
|
1053
|
-
if (!
|
|
1135
|
+
for (const c of P(f, ["dossiers"])) {
|
|
1136
|
+
if (!c[c.length - 1].endsWith(".json"))
|
|
1054
1137
|
continue;
|
|
1055
|
-
const
|
|
1056
|
-
|
|
1057
|
-
const
|
|
1138
|
+
const _ = s.join(f, ...c);
|
|
1139
|
+
u && console.log(`Loading file: ${_}…`);
|
|
1140
|
+
const F = n.readFileSync(_, {
|
|
1058
1141
|
encoding: "utf8"
|
|
1059
|
-
}),
|
|
1060
|
-
L.senatChemin &&
|
|
1142
|
+
}), g = q.toDossierParlementaire(F), L = g.titreDossier;
|
|
1143
|
+
L.senatChemin && x[L.senatChemin] === void 0 && (x[L.senatChemin] = g), L.titreChemin && D[L.titreChemin] === void 0 && (D[L.titreChemin] = g), z[g.uid] === void 0 && (z[g.uid] = g);
|
|
1061
1144
|
}
|
|
1062
1145
|
}
|
|
1063
|
-
let
|
|
1064
|
-
if (
|
|
1146
|
+
let X = {};
|
|
1147
|
+
if (i & I.Photos) {
|
|
1065
1148
|
{
|
|
1066
|
-
const
|
|
1149
|
+
const o = s.join(
|
|
1067
1150
|
t,
|
|
1068
1151
|
`photos_deputes_${// TODO: Handle Legislature.All.
|
|
1069
1152
|
e === r.All ? r.DixSept : e}`,
|
|
1070
1153
|
"deputes.json"
|
|
1071
1154
|
);
|
|
1072
|
-
if (n.existsSync(
|
|
1073
|
-
|
|
1074
|
-
const f = n.readFileSync(
|
|
1075
|
-
Object.assign(
|
|
1076
|
-
} else
|
|
1155
|
+
if (n.existsSync(o)) {
|
|
1156
|
+
u && console.log(`Loading file: ${o}`);
|
|
1157
|
+
const f = n.readFileSync(o, { encoding: "utf8" });
|
|
1158
|
+
Object.assign(X, JSON.parse(f));
|
|
1159
|
+
} else u && console.log(`Ignoring missing file: ${o}`);
|
|
1077
1160
|
}
|
|
1078
1161
|
{
|
|
1079
|
-
const
|
|
1162
|
+
const o = s.join(
|
|
1080
1163
|
t,
|
|
1081
1164
|
"photos_senateurs",
|
|
1082
1165
|
"senateurs.json"
|
|
1083
1166
|
);
|
|
1084
|
-
if (n.existsSync(
|
|
1085
|
-
|
|
1086
|
-
const f = n.readFileSync(
|
|
1087
|
-
Object.assign(
|
|
1088
|
-
} else
|
|
1167
|
+
if (n.existsSync(o)) {
|
|
1168
|
+
u && console.log(`Loading file: ${o}`);
|
|
1169
|
+
const f = n.readFileSync(o, { encoding: "utf8" });
|
|
1170
|
+
Object.assign(X, JSON.parse(f));
|
|
1171
|
+
} else u && console.log(`Ignoring missing file: ${o}`);
|
|
1089
1172
|
}
|
|
1090
1173
|
}
|
|
1091
|
-
const
|
|
1092
|
-
if (
|
|
1093
|
-
for (const
|
|
1094
|
-
if (
|
|
1174
|
+
const $ = {};
|
|
1175
|
+
if (i & I.Scrutins)
|
|
1176
|
+
for (const o of A.scrutins) {
|
|
1177
|
+
if (o.ignoreForWeb || e !== r.All && o.legislature !== r.All && e !== o.legislature)
|
|
1095
1178
|
continue;
|
|
1096
|
-
const f =
|
|
1179
|
+
const f = s.join(
|
|
1097
1180
|
t,
|
|
1098
|
-
|
|
1181
|
+
o.filename.replace(/\.json$/, a ? "_enrichi" : "_nettoye")
|
|
1099
1182
|
);
|
|
1100
|
-
for (const
|
|
1101
|
-
if (!
|
|
1183
|
+
for (const c of P(f)) {
|
|
1184
|
+
if (!c[c.length - 1].endsWith(".json"))
|
|
1102
1185
|
continue;
|
|
1103
|
-
const
|
|
1104
|
-
|
|
1105
|
-
const
|
|
1186
|
+
const _ = s.join(f, ...c);
|
|
1187
|
+
u && console.log(`Loading file: ${_}…`);
|
|
1188
|
+
const F = n.readFileSync(_, {
|
|
1106
1189
|
encoding: "utf8"
|
|
1107
|
-
}),
|
|
1108
|
-
|
|
1190
|
+
}), g = Z.toScrutin(F);
|
|
1191
|
+
$[g.uid] === void 0 && ($[g.uid] = g);
|
|
1109
1192
|
}
|
|
1110
1193
|
}
|
|
1111
|
-
const
|
|
1112
|
-
if (
|
|
1113
|
-
for (const
|
|
1114
|
-
if (
|
|
1194
|
+
const V = {};
|
|
1195
|
+
if (i & I.Questions)
|
|
1196
|
+
for (const o of A.questions) {
|
|
1197
|
+
if (o.ignoreForWeb || e !== r.All && o.legislature !== r.All && e !== o.legislature)
|
|
1115
1198
|
continue;
|
|
1116
|
-
const f =
|
|
1199
|
+
const f = s.join(
|
|
1117
1200
|
t,
|
|
1118
|
-
|
|
1201
|
+
o.filename.replace(/\.json$/, a ? "_enrichi" : "_nettoye")
|
|
1119
1202
|
);
|
|
1120
|
-
for (const
|
|
1121
|
-
if (!
|
|
1203
|
+
for (const c of P(f)) {
|
|
1204
|
+
if (!c[c.length - 1].endsWith(".json"))
|
|
1122
1205
|
continue;
|
|
1123
|
-
const
|
|
1124
|
-
|
|
1125
|
-
const
|
|
1206
|
+
const _ = s.join(f, ...c);
|
|
1207
|
+
u && console.log(`Loading file: ${_}…`);
|
|
1208
|
+
const F = n.readFileSync(_, {
|
|
1126
1209
|
encoding: "utf8"
|
|
1127
|
-
}),
|
|
1128
|
-
|
|
1210
|
+
}), g = B.toQuestion(F);
|
|
1211
|
+
V[g.uid] === void 0 && (V[g.uid] = g);
|
|
1129
1212
|
}
|
|
1130
1213
|
}
|
|
1131
1214
|
const p = {};
|
|
1132
|
-
if (
|
|
1133
|
-
for (const
|
|
1134
|
-
if (
|
|
1215
|
+
if (i & I.ComptesRendusSeances)
|
|
1216
|
+
for (const o of A.comptesRendusSeances) {
|
|
1217
|
+
if (o.ignoreForWeb || e !== r.All && o.legislature !== r.All && e !== o.legislature)
|
|
1135
1218
|
continue;
|
|
1136
|
-
const f =
|
|
1219
|
+
const f = s.join(
|
|
1137
1220
|
t,
|
|
1138
|
-
|
|
1221
|
+
o.filename.replace(/\.json$/, a ? "_enrichi" : "_nettoye")
|
|
1139
1222
|
);
|
|
1140
|
-
for (const
|
|
1141
|
-
if (!
|
|
1223
|
+
for (const c of P(f)) {
|
|
1224
|
+
if (!c[c.length - 1].endsWith(".json"))
|
|
1142
1225
|
continue;
|
|
1143
|
-
const
|
|
1144
|
-
|
|
1145
|
-
const
|
|
1226
|
+
const _ = s.join(f, ...c);
|
|
1227
|
+
u && console.log(`Loading file: ${_}…`);
|
|
1228
|
+
const F = n.readFileSync(_, {
|
|
1146
1229
|
encoding: "utf8"
|
|
1147
|
-
}),
|
|
1148
|
-
p[
|
|
1230
|
+
}), g = J.toCompteRendu(F);
|
|
1231
|
+
p[g.uid] === void 0 && (p[g.uid] = g);
|
|
1149
1232
|
}
|
|
1150
1233
|
}
|
|
1151
1234
|
return {
|
|
1152
|
-
acteurByUid:
|
|
1235
|
+
acteurByUid: d,
|
|
1153
1236
|
amendementByUid: v,
|
|
1154
1237
|
documentByUid: b,
|
|
1155
|
-
dossierParlementaireBySenatChemin:
|
|
1156
|
-
dossierParlementaireByTitreChemin:
|
|
1157
|
-
dossierParlementaireByUid:
|
|
1158
|
-
organeByUid:
|
|
1159
|
-
photoByUid:
|
|
1238
|
+
dossierParlementaireBySenatChemin: x,
|
|
1239
|
+
dossierParlementaireByTitreChemin: D,
|
|
1240
|
+
dossierParlementaireByUid: z,
|
|
1241
|
+
organeByUid: l,
|
|
1242
|
+
photoByUid: X,
|
|
1160
1243
|
reunionByUid: j,
|
|
1161
1244
|
reunionsByDay: y,
|
|
1162
|
-
reunionsByDossierUid:
|
|
1163
|
-
scrutinByUid:
|
|
1164
|
-
questionByUid:
|
|
1245
|
+
reunionsByDossierUid: S,
|
|
1246
|
+
scrutinByUid: $,
|
|
1247
|
+
questionByUid: V,
|
|
1165
1248
|
compteRenduByUid: p
|
|
1166
1249
|
};
|
|
1167
1250
|
}
|
|
1168
|
-
function
|
|
1169
|
-
const
|
|
1170
|
-
if (
|
|
1251
|
+
function De(t, i, e, { log: a = !1 } = {}) {
|
|
1252
|
+
const u = {}, d = {};
|
|
1253
|
+
if (i & I.ActeursEtOrganes)
|
|
1171
1254
|
for (const p of A.acteursEtOrganes) {
|
|
1172
1255
|
if (p.ignoreForWeb || e !== r.All && p.legislature !== r.All && e !== p.legislature)
|
|
1173
1256
|
continue;
|
|
1174
|
-
const
|
|
1257
|
+
const o = s.join(
|
|
1175
1258
|
t,
|
|
1176
1259
|
p.filename.replace(/\.json$/, "_nettoye.json")
|
|
1177
1260
|
);
|
|
1178
|
-
|
|
1179
|
-
const f = n.readFileSync(
|
|
1180
|
-
for (const
|
|
1181
|
-
|
|
1182
|
-
for (const
|
|
1183
|
-
m
|
|
1261
|
+
a && console.log(`Loading file: ${o}`);
|
|
1262
|
+
const f = n.readFileSync(o, { encoding: "utf8" }), c = U.toActeursEtOrganes(f);
|
|
1263
|
+
for (const m of c.acteurs)
|
|
1264
|
+
u[m.uid] === void 0 && (u[m.uid] = m);
|
|
1265
|
+
for (const m of c.organes)
|
|
1266
|
+
d[m.uid] === void 0 && (d[m.uid] = m);
|
|
1184
1267
|
}
|
|
1185
|
-
const
|
|
1186
|
-
if (
|
|
1268
|
+
const l = {}, j = {}, y = {};
|
|
1269
|
+
if (i & I.Agendas)
|
|
1187
1270
|
for (const p of A.agendas) {
|
|
1188
1271
|
if (p.ignoreForWeb || e !== r.All && p.legislature !== r.All && e !== p.legislature)
|
|
1189
1272
|
continue;
|
|
1190
|
-
const
|
|
1273
|
+
const o = s.join(
|
|
1191
1274
|
t,
|
|
1192
1275
|
p.filename.replace(/\.json$/, "_nettoye.json")
|
|
1193
1276
|
);
|
|
1194
|
-
|
|
1195
|
-
const f = n.readFileSync(
|
|
1196
|
-
for (const
|
|
1197
|
-
|
|
1198
|
-
const
|
|
1199
|
-
let
|
|
1200
|
-
|
|
1201
|
-
const
|
|
1202
|
-
if (
|
|
1203
|
-
for (const L of
|
|
1277
|
+
a && console.log(`Loading file: ${o}`);
|
|
1278
|
+
const f = n.readFileSync(o, { encoding: "utf8" }), c = M.toAgendas(f);
|
|
1279
|
+
for (const m of c.reunions) {
|
|
1280
|
+
l[m.uid] === void 0 && (l[m.uid] = m);
|
|
1281
|
+
const _ = m.timestampDebut.toISOString().split("T")[0];
|
|
1282
|
+
let F = j[_];
|
|
1283
|
+
F === void 0 && (F = j[_] = []), F.push(m);
|
|
1284
|
+
const g = m.odj;
|
|
1285
|
+
if (g !== void 0)
|
|
1286
|
+
for (const L of g.pointsOdj || [])
|
|
1204
1287
|
for (const w of L.dossiersLegislatifsRefs || []) {
|
|
1205
|
-
let
|
|
1206
|
-
|
|
1288
|
+
let R = y[w];
|
|
1289
|
+
R === void 0 && (R = y[w] = []), R.push(m);
|
|
1207
1290
|
}
|
|
1208
1291
|
}
|
|
1209
1292
|
}
|
|
1210
|
-
const
|
|
1211
|
-
if (
|
|
1293
|
+
const S = {};
|
|
1294
|
+
if (i & I.Amendements)
|
|
1212
1295
|
for (const p of A.amendements) {
|
|
1213
1296
|
if (p.ignoreForWeb || e !== r.All && p.legislature !== r.All && e !== p.legislature)
|
|
1214
1297
|
continue;
|
|
1215
|
-
const
|
|
1298
|
+
const o = s.join(
|
|
1216
1299
|
t,
|
|
1217
1300
|
p.filename.replace(/\.json$/, "_nettoye.json")
|
|
1218
1301
|
);
|
|
1219
|
-
|
|
1220
|
-
const f = n.readFileSync(
|
|
1221
|
-
for (const
|
|
1222
|
-
for (const
|
|
1223
|
-
|
|
1302
|
+
a && console.log(`Loading file: ${o}`);
|
|
1303
|
+
const f = n.readFileSync(o, { encoding: "utf8" }), c = N.toAmendements(f);
|
|
1304
|
+
for (const m of c.textesLegislatifs)
|
|
1305
|
+
for (const _ of m.amendements)
|
|
1306
|
+
S[_.uid] === void 0 && (S[_.uid] = _);
|
|
1224
1307
|
}
|
|
1225
|
-
const v = {}, b = {},
|
|
1226
|
-
if (
|
|
1308
|
+
const v = {}, b = {}, x = {}, D = {};
|
|
1309
|
+
if (i & I.DossiersLegislatifs)
|
|
1227
1310
|
for (const p of A.dossiersLegislatifs) {
|
|
1228
1311
|
if (p.ignoreForWeb || e !== r.All && p.legislature !== r.All && e !== p.legislature)
|
|
1229
1312
|
continue;
|
|
1230
|
-
const
|
|
1313
|
+
const o = s.join(
|
|
1231
1314
|
t,
|
|
1232
1315
|
p.filename.replace(/\.json$/, "_nettoye.json")
|
|
1233
1316
|
);
|
|
1234
|
-
|
|
1235
|
-
const f = n.readFileSync(
|
|
1236
|
-
for (const
|
|
1237
|
-
v[
|
|
1238
|
-
for (const
|
|
1239
|
-
const
|
|
1240
|
-
|
|
1317
|
+
a && console.log(`Loading file: ${o}`);
|
|
1318
|
+
const f = n.readFileSync(o, { encoding: "utf8" }), c = q.toDossiersLegislatifs(f);
|
|
1319
|
+
for (const m of c.textesLegislatifs)
|
|
1320
|
+
v[m.uid] === void 0 && (v[m.uid] = m);
|
|
1321
|
+
for (const m of c.dossiersParlementaires) {
|
|
1322
|
+
const _ = m.titreDossier;
|
|
1323
|
+
_.senatChemin && b[_.senatChemin] === void 0 && (b[_.senatChemin] = m), _.titreChemin && x[_.titreChemin] === void 0 && (x[_.titreChemin] = m), D[m.uid] === void 0 && (D[m.uid] = m);
|
|
1241
1324
|
}
|
|
1242
1325
|
}
|
|
1243
|
-
const
|
|
1244
|
-
if (
|
|
1326
|
+
const z = {};
|
|
1327
|
+
if (i & I.Photos) {
|
|
1245
1328
|
const p = {};
|
|
1246
1329
|
{
|
|
1247
|
-
const
|
|
1330
|
+
const o = s.join(
|
|
1248
1331
|
t,
|
|
1249
1332
|
`photos_deputes_${// TODO: Handle Legislature.All.
|
|
1250
1333
|
e === r.All ? r.DixSept : e}`,
|
|
1251
1334
|
"deputes.json"
|
|
1252
1335
|
);
|
|
1253
|
-
if (n.existsSync(
|
|
1254
|
-
|
|
1255
|
-
const f = n.readFileSync(
|
|
1336
|
+
if (n.existsSync(o)) {
|
|
1337
|
+
a && console.log(`Loading file: ${o}`);
|
|
1338
|
+
const f = n.readFileSync(o, { encoding: "utf8" });
|
|
1256
1339
|
Object.assign(p, JSON.parse(f));
|
|
1257
|
-
} else
|
|
1340
|
+
} else a && console.log(`Ignoring missing file: ${o}`);
|
|
1258
1341
|
}
|
|
1259
1342
|
{
|
|
1260
|
-
const
|
|
1343
|
+
const o = s.join(
|
|
1261
1344
|
t,
|
|
1262
1345
|
"photos_senateurs",
|
|
1263
1346
|
"senateurs.json"
|
|
1264
1347
|
);
|
|
1265
|
-
if (n.existsSync(
|
|
1266
|
-
|
|
1267
|
-
const f = n.readFileSync(
|
|
1348
|
+
if (n.existsSync(o)) {
|
|
1349
|
+
a && console.log(`Loading file: ${o}`);
|
|
1350
|
+
const f = n.readFileSync(o, { encoding: "utf8" });
|
|
1268
1351
|
Object.assign(p, JSON.parse(f));
|
|
1269
|
-
} else
|
|
1352
|
+
} else a && console.log(`Ignoring missing file: ${o}`);
|
|
1270
1353
|
}
|
|
1271
1354
|
}
|
|
1272
|
-
const
|
|
1273
|
-
if (
|
|
1355
|
+
const X = {};
|
|
1356
|
+
if (i & I.Scrutins)
|
|
1274
1357
|
for (const p of A.scrutins) {
|
|
1275
1358
|
if (p.ignoreForWeb || e !== r.All && p.legislature !== r.All && e !== p.legislature)
|
|
1276
1359
|
continue;
|
|
1277
|
-
const
|
|
1360
|
+
const o = s.join(
|
|
1278
1361
|
t,
|
|
1279
1362
|
p.filename.replace(/\.json$/, "_nettoye.json")
|
|
1280
1363
|
);
|
|
1281
|
-
|
|
1282
|
-
const f = n.readFileSync(
|
|
1283
|
-
for (const
|
|
1284
|
-
|
|
1364
|
+
a && console.log(`Loading file: ${o}`);
|
|
1365
|
+
const f = n.readFileSync(o, { encoding: "utf8" }), c = Z.toScrutins(f);
|
|
1366
|
+
for (const m of c.scrutins)
|
|
1367
|
+
X[m.uid] === void 0 && (X[m.uid] = m);
|
|
1285
1368
|
}
|
|
1286
|
-
const
|
|
1287
|
-
if (
|
|
1369
|
+
const $ = {};
|
|
1370
|
+
if (i & I.Questions)
|
|
1288
1371
|
for (const p of A.questions) {
|
|
1289
1372
|
if (p.ignoreForWeb || e !== r.All && p.legislature !== r.All && e !== p.legislature)
|
|
1290
1373
|
continue;
|
|
1291
|
-
const
|
|
1374
|
+
const o = s.join(
|
|
1292
1375
|
t,
|
|
1293
1376
|
p.filename.replace(/\.json$/, "_nettoye.json")
|
|
1294
1377
|
);
|
|
1295
|
-
|
|
1296
|
-
const f = n.readFileSync(
|
|
1297
|
-
for (const
|
|
1298
|
-
|
|
1378
|
+
a && console.log(`Loading file: ${o}`);
|
|
1379
|
+
const f = n.readFileSync(o, { encoding: "utf8" }), c = B.toQuestions(f);
|
|
1380
|
+
for (const m of c.questions)
|
|
1381
|
+
$[m.uid] === void 0 && ($[m.uid] = m);
|
|
1299
1382
|
}
|
|
1300
|
-
const
|
|
1301
|
-
if (
|
|
1383
|
+
const V = {};
|
|
1384
|
+
if (i & I.ComptesRendusSeances)
|
|
1302
1385
|
for (const p of A.comptesRendusSeances) {
|
|
1303
1386
|
if (p.ignoreForWeb || e !== r.All && p.legislature !== r.All && e !== p.legislature)
|
|
1304
1387
|
continue;
|
|
1305
|
-
const
|
|
1388
|
+
const o = s.join(
|
|
1306
1389
|
t,
|
|
1307
1390
|
p.filename.replace(/\.json$/, "_nettoye.json")
|
|
1308
1391
|
);
|
|
1309
|
-
|
|
1310
|
-
const f = n.readFileSync(
|
|
1311
|
-
for (const
|
|
1312
|
-
|
|
1392
|
+
a && console.log(`Loading file: ${o}`);
|
|
1393
|
+
const f = n.readFileSync(o, { encoding: "utf8" }), c = J.toComptesRendus(f);
|
|
1394
|
+
for (const m of c.comptesRendus)
|
|
1395
|
+
V[m.uid] === void 0 && (V[m.uid] = m);
|
|
1313
1396
|
}
|
|
1314
1397
|
return {
|
|
1315
|
-
acteurByUid:
|
|
1316
|
-
amendementByUid:
|
|
1398
|
+
acteurByUid: u,
|
|
1399
|
+
amendementByUid: S,
|
|
1317
1400
|
documentByUid: v,
|
|
1318
1401
|
dossierParlementaireBySenatChemin: b,
|
|
1319
|
-
dossierParlementaireByTitreChemin:
|
|
1320
|
-
dossierParlementaireByUid:
|
|
1321
|
-
organeByUid:
|
|
1322
|
-
photoByUid:
|
|
1323
|
-
reunionByUid:
|
|
1402
|
+
dossierParlementaireByTitreChemin: x,
|
|
1403
|
+
dossierParlementaireByUid: D,
|
|
1404
|
+
organeByUid: d,
|
|
1405
|
+
photoByUid: z,
|
|
1406
|
+
reunionByUid: l,
|
|
1324
1407
|
reunionsByDay: j,
|
|
1325
1408
|
reunionsByDossierUid: y,
|
|
1326
|
-
scrutinByUid:
|
|
1327
|
-
questionByUid:
|
|
1328
|
-
compteRenduByUid:
|
|
1409
|
+
scrutinByUid: X,
|
|
1410
|
+
questionByUid: $,
|
|
1411
|
+
compteRenduByUid: V
|
|
1329
1412
|
};
|
|
1330
1413
|
}
|
|
1331
|
-
function
|
|
1332
|
-
const
|
|
1333
|
-
if (!n.pathExistsSync(
|
|
1414
|
+
function Xe(t, i, e) {
|
|
1415
|
+
const a = s.join(t, "Documents"), u = ae(a, i), d = s.join(u, "index.json");
|
|
1416
|
+
if (!n.pathExistsSync(d))
|
|
1334
1417
|
return;
|
|
1335
|
-
const
|
|
1418
|
+
const l = n.readJsonSync(d);
|
|
1336
1419
|
for (const j of e)
|
|
1337
|
-
for (const { filename: y, url:
|
|
1420
|
+
for (const { filename: y, url: S } of l[j] ?? [])
|
|
1338
1421
|
if (y !== void 0)
|
|
1339
|
-
return { format: j, path:
|
|
1422
|
+
return { format: j, path: s.join(u, y), url: S };
|
|
1340
1423
|
}
|
|
1341
|
-
function
|
|
1342
|
-
const
|
|
1424
|
+
function Ve(t, i, { log: e = !1 } = {}) {
|
|
1425
|
+
const a = s.join(
|
|
1343
1426
|
t,
|
|
1344
1427
|
`photos_deputes_${// TODO: Handle Legislature.All.
|
|
1345
|
-
|
|
1428
|
+
i === r.All ? r.DixSept : i}`,
|
|
1346
1429
|
"deputes.json"
|
|
1347
1430
|
);
|
|
1348
|
-
e && console.log(`Loading file: ${
|
|
1349
|
-
const
|
|
1350
|
-
return JSON.parse(
|
|
1431
|
+
e && console.log(`Loading file: ${a}`);
|
|
1432
|
+
const u = n.readFileSync(a, { encoding: "utf8" });
|
|
1433
|
+
return JSON.parse(u);
|
|
1351
1434
|
}
|
|
1352
|
-
function
|
|
1353
|
-
const e =
|
|
1435
|
+
function $e(t, { log: i = !1 } = {}) {
|
|
1436
|
+
const e = s.join(
|
|
1354
1437
|
t,
|
|
1355
1438
|
"photos_senateurs",
|
|
1356
1439
|
"senateurs.json"
|
|
1357
1440
|
);
|
|
1358
|
-
|
|
1359
|
-
const
|
|
1360
|
-
return JSON.parse(
|
|
1441
|
+
i && console.log(`Loading file: ${e}`);
|
|
1442
|
+
const a = n.readFileSync(e, { encoding: "utf8" });
|
|
1443
|
+
return JSON.parse(a);
|
|
1361
1444
|
}
|
|
1362
|
-
function
|
|
1363
|
-
const e =
|
|
1364
|
-
|
|
1445
|
+
function ae(t, i) {
|
|
1446
|
+
const e = i.match(G);
|
|
1447
|
+
C.notStrictEqual(
|
|
1365
1448
|
e,
|
|
1366
1449
|
null,
|
|
1367
|
-
`Unexpected structure for document UID: ${
|
|
1450
|
+
`Unexpected structure for document UID: ${i}`
|
|
1368
1451
|
);
|
|
1369
|
-
const
|
|
1452
|
+
const a = e.groups, u = s.join(
|
|
1370
1453
|
t,
|
|
1371
|
-
|
|
1372
|
-
),
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
), j =
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
), y =
|
|
1454
|
+
a.documentType ?? a.documentType2
|
|
1455
|
+
), d = s.join(u, a.chambre ?? a.chambre2), l = s.join(
|
|
1456
|
+
d,
|
|
1457
|
+
a.republique ?? a.republique2
|
|
1458
|
+
), j = s.join(
|
|
1459
|
+
l,
|
|
1460
|
+
a.legislature ?? a.legislature2
|
|
1461
|
+
), y = a.etat;
|
|
1379
1462
|
if (y === void 0)
|
|
1380
|
-
return n.ensureDirSync(j),
|
|
1381
|
-
const
|
|
1382
|
-
let v = "000000" + (
|
|
1463
|
+
return n.ensureDirSync(j), s.join(j, i);
|
|
1464
|
+
const S = s.join(j, y);
|
|
1465
|
+
let v = "000000" + (a.numero ?? a.numero2);
|
|
1383
1466
|
v = v.substring(v.length - 6);
|
|
1384
|
-
const b =
|
|
1385
|
-
return n.ensureDirSync(b),
|
|
1467
|
+
const b = s.join(S, v.substring(0, 3));
|
|
1468
|
+
return n.ensureDirSync(b), s.join(b, i);
|
|
1386
1469
|
}
|
|
1387
|
-
function
|
|
1388
|
-
return
|
|
1470
|
+
function Le(t, i) {
|
|
1471
|
+
return H(t, i, ie);
|
|
1389
1472
|
}
|
|
1390
|
-
function
|
|
1391
|
-
const e =
|
|
1392
|
-
|
|
1473
|
+
function Pe(t, i) {
|
|
1474
|
+
const e = K.exec(i);
|
|
1475
|
+
C.notStrictEqual(
|
|
1393
1476
|
e,
|
|
1394
1477
|
null,
|
|
1395
|
-
`Unexpected structure for reunion UID: ${
|
|
1478
|
+
`Unexpected structure for reunion UID: ${i}`
|
|
1396
1479
|
);
|
|
1397
|
-
const
|
|
1480
|
+
const a = s.join(t, e[1]), u = s.join(a, e[2]), d = s.join(u, e[3]), l = s.join(d, e[4]), j = s.join(l, e[5]);
|
|
1398
1481
|
let y = "000000000" + e[6];
|
|
1399
1482
|
y = y.substring(y.length - 9);
|
|
1400
|
-
const
|
|
1401
|
-
return n.ensureDirSync(v),
|
|
1483
|
+
const S = s.join(j, y.substring(0, 3)), v = s.join(S, y.substring(3, 3));
|
|
1484
|
+
return n.ensureDirSync(v), s.join(v, i);
|
|
1402
1485
|
}
|
|
1403
|
-
function
|
|
1404
|
-
const e =
|
|
1405
|
-
|
|
1486
|
+
function xe(t, i) {
|
|
1487
|
+
const e = ee.exec(i);
|
|
1488
|
+
C.notStrictEqual(
|
|
1406
1489
|
e,
|
|
1407
1490
|
null,
|
|
1408
|
-
`Unexpected structure for scrutin UID: ${
|
|
1491
|
+
`Unexpected structure for scrutin UID: ${i}`
|
|
1409
1492
|
);
|
|
1410
|
-
const
|
|
1411
|
-
let
|
|
1412
|
-
|
|
1413
|
-
const j =
|
|
1414
|
-
return n.ensureDirSync(j),
|
|
1493
|
+
const a = s.join(t, e[1]), u = s.join(a, e[2]), d = s.join(u, e[3]);
|
|
1494
|
+
let l = "000000" + e[4];
|
|
1495
|
+
l = l.substring(l.length - 6);
|
|
1496
|
+
const j = s.join(d, l.substring(0, 3));
|
|
1497
|
+
return n.ensureDirSync(j), s.join(j, i);
|
|
1415
1498
|
}
|
|
1416
|
-
function
|
|
1417
|
-
return
|
|
1499
|
+
function ze(t, i) {
|
|
1500
|
+
return H(t, i, se);
|
|
1418
1501
|
}
|
|
1419
|
-
function
|
|
1420
|
-
const e =
|
|
1421
|
-
|
|
1502
|
+
function Oe(t, i) {
|
|
1503
|
+
const e = te.exec(i);
|
|
1504
|
+
C.notStrictEqual(
|
|
1422
1505
|
e,
|
|
1423
1506
|
null,
|
|
1424
|
-
`Unexpected structure for object with UID: ${
|
|
1507
|
+
`Unexpected structure for object with UID: ${i}`
|
|
1425
1508
|
);
|
|
1426
|
-
const
|
|
1509
|
+
const a = s.join(t, e[2]), u = s.join(a, e[3]), d = s.join(u, e[4]), l = s.join(d, e[5]);
|
|
1427
1510
|
let j = "000000000" + e[7];
|
|
1428
1511
|
j = j.substring(j.length - 9);
|
|
1429
|
-
const y =
|
|
1430
|
-
return n.ensureDirSync(
|
|
1512
|
+
const y = s.join(l, j.substring(0, 3)), S = s.join(y, j.substring(3, 3));
|
|
1513
|
+
return n.ensureDirSync(S), s.join(S, i);
|
|
1431
1514
|
}
|
|
1432
|
-
function
|
|
1433
|
-
const
|
|
1434
|
-
|
|
1435
|
-
|
|
1515
|
+
function H(t, i, e) {
|
|
1516
|
+
const a = e.exec(i);
|
|
1517
|
+
C.notStrictEqual(
|
|
1518
|
+
a,
|
|
1436
1519
|
null,
|
|
1437
|
-
`Unexpected structure for object with UID: ${
|
|
1520
|
+
`Unexpected structure for object with UID: ${i}`
|
|
1438
1521
|
);
|
|
1439
|
-
const
|
|
1440
|
-
let
|
|
1441
|
-
|
|
1442
|
-
const j =
|
|
1443
|
-
return n.ensureDirSync(j),
|
|
1522
|
+
const u = s.join(t, a[1]), d = s.join(u, a[2]);
|
|
1523
|
+
let l = "000000" + a[3];
|
|
1524
|
+
l = l.substring(l.length - 6);
|
|
1525
|
+
const j = s.join(d, l.substring(0, 3));
|
|
1526
|
+
return n.ensureDirSync(j), s.join(j, i);
|
|
1444
1527
|
}
|
|
1445
1528
|
export {
|
|
1446
1529
|
I as EnabledDatasets,
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1530
|
+
ge as iterLoadAssembleeActeurs,
|
|
1531
|
+
je as iterLoadAssembleeAmendements,
|
|
1532
|
+
ve as iterLoadAssembleeComptesRendus,
|
|
1533
|
+
Ie as iterLoadAssembleeComptesRendusCommissions,
|
|
1534
|
+
he as iterLoadAssembleeDocuments,
|
|
1535
|
+
ye as iterLoadAssembleeDossiersParlementaires,
|
|
1536
|
+
_e as iterLoadAssembleeOrganes,
|
|
1537
|
+
Fe as iterLoadAssembleeQuestions,
|
|
1538
|
+
Se as iterLoadAssembleeReunions,
|
|
1539
|
+
Ae as iterLoadAssembleeScrutins,
|
|
1540
|
+
be as loadAssembleeData,
|
|
1541
|
+
De as loadAssembleeDataFromBigFiles,
|
|
1542
|
+
Xe as loadAssembleeDocumentFile,
|
|
1543
|
+
Ve as loadAssembleePhotosDeputes,
|
|
1544
|
+
$e as loadAssembleePhotosSenateurs,
|
|
1545
|
+
Oe as pathFromCompteRenduUid,
|
|
1546
|
+
ae as pathFromDocumentUid,
|
|
1547
|
+
Le as pathFromDossierParlementaireUid,
|
|
1548
|
+
ze as pathFromQuestionUid,
|
|
1549
|
+
Pe as pathFromReunionUid,
|
|
1550
|
+
xe as pathFromScrutinUid,
|
|
1551
|
+
P as walkDir
|
|
1469
1552
|
};
|