@tricoteuses/assemblee 2.5.16 → 2.5.18
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 +0 -1
- package/lib/git.js +54 -77
- package/lib/loaders.js +268 -257
- package/package.json +1 -1
- package/lib/file_systems-CzTtoLWb.js +0 -33
package/lib/loaders.js
CHANGED
|
@@ -2,8 +2,8 @@ import q from "node:assert";
|
|
|
2
2
|
import n from "fs-extra";
|
|
3
3
|
import i from "node:path";
|
|
4
4
|
import "node:crypto";
|
|
5
|
-
import { L as
|
|
6
|
-
import
|
|
5
|
+
import { L as r, a1 as C, a2 as M, a3 as R, a4 as Z, a5 as B, a6 as J, Y, $ as G, a0 as K, X as ee, Z as te, _ as se } from "./uids-DaRrTkI-.js";
|
|
6
|
+
import "glob";
|
|
7
7
|
import { C as N } from "./amendements-40Z7OJLT.js";
|
|
8
8
|
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
9
|
async function h(t, s) {
|
|
@@ -38,7 +38,7 @@ const A = {
|
|
|
38
38
|
// Il n'apporte donc absolument rien par rapport à AMO20 ou l'AMO30.
|
|
39
39
|
filename: "AMO10_deputes_actifs_mandats_actifs_organes_XVII.json",
|
|
40
40
|
ignoreForWeb: !0,
|
|
41
|
-
legislature:
|
|
41
|
+
legislature: r.DixSept,
|
|
42
42
|
repairZip: h,
|
|
43
43
|
structure: 1,
|
|
44
44
|
title: "Députés actifs et organes de la XVIIème législature",
|
|
@@ -67,7 +67,7 @@ const A = {
|
|
|
67
67
|
// Il n'apporte donc absolument rien par rapport à AMO20 ou l'AMO30.
|
|
68
68
|
filename: "AMO10_deputes_actifs_mandats_actifs_organes_XVI.json",
|
|
69
69
|
ignoreForWeb: !0,
|
|
70
|
-
legislature:
|
|
70
|
+
legislature: r.Seize,
|
|
71
71
|
repairZip: h,
|
|
72
72
|
structure: 1,
|
|
73
73
|
title: "Députés actifs et organes de la XVIème législature",
|
|
@@ -96,7 +96,7 @@ const A = {
|
|
|
96
96
|
// Il n'apporte donc absolument rien par rapport à AMO20 ou l'AMO30.
|
|
97
97
|
filename: "AMO10_deputes_actifs_mandats_actifs_organes_XV.json",
|
|
98
98
|
ignoreForWeb: !0,
|
|
99
|
-
legislature:
|
|
99
|
+
legislature: r.Quinze,
|
|
100
100
|
repairZip: h,
|
|
101
101
|
structure: 1,
|
|
102
102
|
title: "Députés actifs et organes de la XVème législature",
|
|
@@ -125,7 +125,7 @@ const A = {
|
|
|
125
125
|
// Il n'apporte donc absolument rien par rapport à l'AMO30.
|
|
126
126
|
filename: "AMO20_dep_sen_min_tous_mandats_et_organes_XVII.json",
|
|
127
127
|
ignoreForWeb: !0,
|
|
128
|
-
legislature:
|
|
128
|
+
legislature: r.DixSept,
|
|
129
129
|
repairZip: h,
|
|
130
130
|
structure: 1,
|
|
131
131
|
title: "Acteurs et organes de la XVIIème législature",
|
|
@@ -154,7 +154,7 @@ const A = {
|
|
|
154
154
|
// Il n'apporte donc absolument rien par rapport à l'AMO30.
|
|
155
155
|
filename: "AMO20_dep_sen_min_tous_mandats_et_organes_XVI.json",
|
|
156
156
|
ignoreForWeb: !0,
|
|
157
|
-
legislature:
|
|
157
|
+
legislature: r.Seize,
|
|
158
158
|
repairZip: h,
|
|
159
159
|
structure: 1,
|
|
160
160
|
title: "Acteurs et organes de la XVIème législature",
|
|
@@ -183,7 +183,7 @@ const A = {
|
|
|
183
183
|
// Il n'apporte donc absolument rien par rapport à l'AMO30.
|
|
184
184
|
filename: "AMO20_dep_sen_min_tous_mandats_et_organes_XV.json",
|
|
185
185
|
ignoreForWeb: !0,
|
|
186
|
-
legislature:
|
|
186
|
+
legislature: r.Quinze,
|
|
187
187
|
repairZip: h,
|
|
188
188
|
structure: 1,
|
|
189
189
|
title: "Acteurs et organes de la XVème législature",
|
|
@@ -202,7 +202,7 @@ const A = {
|
|
|
202
202
|
// Il n'apporte donc quasiment rien par rapport à l'AMO30.
|
|
203
203
|
filename: "AMO20_dep_sen_min_tous_mandats_et_organes_XIV.json",
|
|
204
204
|
ignoreForWeb: !0,
|
|
205
|
-
legislature:
|
|
205
|
+
legislature: r.Quatorze,
|
|
206
206
|
structure: 0,
|
|
207
207
|
title: "Acteurs et organes de la XIVème législature",
|
|
208
208
|
url: "https://data.assemblee-nationale.fr/static/openData/repository/14/amo/deputes_senateurs_ministres_legislatures_XIV/AMO20_dep_sen_min_tous_mandats_et_organes_XIV.json.zip"
|
|
@@ -213,7 +213,7 @@ const A = {
|
|
|
213
213
|
// Ce fichier contient tous les acteurs et organes.
|
|
214
214
|
// C'est un sur-ensemble des fichiers AMO20.
|
|
215
215
|
filename: "AMO30_tous_acteurs_tous_mandats_tous_organes_historique.json",
|
|
216
|
-
legislature:
|
|
216
|
+
legislature: r.All,
|
|
217
217
|
repairZip: h,
|
|
218
218
|
structure: 1,
|
|
219
219
|
title: "Historique de tous les acteurs et organes depuis la XIème législature",
|
|
@@ -278,7 +278,7 @@ const A = {
|
|
|
278
278
|
// précédentes.
|
|
279
279
|
filename: "AMO40_deputes_actifs_mandats_actifs_organes_divises_XVII.json",
|
|
280
280
|
ignoreForWeb: !0,
|
|
281
|
-
legislature:
|
|
281
|
+
legislature: r.DixSept,
|
|
282
282
|
repairZip: async (t, s) => {
|
|
283
283
|
const e = i.join(s, t.filename);
|
|
284
284
|
await n.pathExists(e) && await n.remove(e), await n.mkdir(e), await n.pathExists(
|
|
@@ -322,7 +322,7 @@ const A = {
|
|
|
322
322
|
// précédentes.
|
|
323
323
|
filename: "AMO40_deputes_actifs_mandats_actifs_organes_divises_XVI.json",
|
|
324
324
|
ignoreForWeb: !0,
|
|
325
|
-
legislature:
|
|
325
|
+
legislature: r.Seize,
|
|
326
326
|
repairZip: async (t, s) => {
|
|
327
327
|
const e = i.join(s, t.filename);
|
|
328
328
|
await n.pathExists(e) && await n.remove(e), await n.mkdir(e), await n.pathExists(
|
|
@@ -366,7 +366,7 @@ const A = {
|
|
|
366
366
|
// précédentes.
|
|
367
367
|
filename: "AMO40_deputes_actifs_mandats_actifs_organes_divises_XV.json",
|
|
368
368
|
ignoreForWeb: !0,
|
|
369
|
-
legislature:
|
|
369
|
+
legislature: r.Quinze,
|
|
370
370
|
repairZip: async (t, s) => {
|
|
371
371
|
const e = i.join(s, t.filename);
|
|
372
372
|
await n.pathExists(e) && await n.remove(e), await n.mkdir(e), await n.move(
|
|
@@ -398,7 +398,7 @@ const A = {
|
|
|
398
398
|
// dont il est un sous ensemble obsolète.
|
|
399
399
|
filename: "AMO50_acteurs_mandats_organes_divises_XVII.json",
|
|
400
400
|
ignoreForWeb: !0,
|
|
401
|
-
legislature:
|
|
401
|
+
legislature: r.DixSept,
|
|
402
402
|
repairZip: async (t, s) => {
|
|
403
403
|
const e = i.join(s, t.filename);
|
|
404
404
|
await n.pathExists(e) && await n.remove(e), await n.mkdir(e), await n.move(
|
|
@@ -433,7 +433,7 @@ const A = {
|
|
|
433
433
|
// dont il est un sous ensemble obsolète.
|
|
434
434
|
filename: "AMO50_acteurs_mandats_organes_divises_XVI.json",
|
|
435
435
|
ignoreForWeb: !0,
|
|
436
|
-
legislature:
|
|
436
|
+
legislature: r.Seize,
|
|
437
437
|
repairZip: async (t, s) => {
|
|
438
438
|
const e = i.join(s, t.filename);
|
|
439
439
|
await n.pathExists(e) && await n.remove(e), await n.mkdir(e), await n.move(
|
|
@@ -468,7 +468,7 @@ const A = {
|
|
|
468
468
|
// dont il est un sous ensemble obsolète.
|
|
469
469
|
filename: "AMO50_acteurs_mandats_organes_divises_XV.json",
|
|
470
470
|
ignoreForWeb: !0,
|
|
471
|
-
legislature:
|
|
471
|
+
legislature: r.Quinze,
|
|
472
472
|
repairZip: async (t, s) => {
|
|
473
473
|
const e = i.join(s, t.filename);
|
|
474
474
|
await n.pathExists(e) && await n.remove(e), await n.mkdir(e), await n.move(
|
|
@@ -490,7 +490,7 @@ const A = {
|
|
|
490
490
|
agendas: [
|
|
491
491
|
{
|
|
492
492
|
filename: "Agenda_XVII.json",
|
|
493
|
-
legislature:
|
|
493
|
+
legislature: r.DixSept,
|
|
494
494
|
repairZip: h,
|
|
495
495
|
structure: 1,
|
|
496
496
|
title: "Agenda de la XVIIème législature",
|
|
@@ -498,7 +498,7 @@ const A = {
|
|
|
498
498
|
},
|
|
499
499
|
{
|
|
500
500
|
filename: "Agenda_XVI.json",
|
|
501
|
-
legislature:
|
|
501
|
+
legislature: r.Seize,
|
|
502
502
|
repairZip: h,
|
|
503
503
|
structure: 1,
|
|
504
504
|
title: "Agenda de la XVIème législature",
|
|
@@ -506,7 +506,7 @@ const A = {
|
|
|
506
506
|
},
|
|
507
507
|
{
|
|
508
508
|
filename: "Agenda_XV.json",
|
|
509
|
-
legislature:
|
|
509
|
+
legislature: r.Quinze,
|
|
510
510
|
repairZip: h,
|
|
511
511
|
structure: 1,
|
|
512
512
|
title: "Agenda de la XVème législature",
|
|
@@ -514,7 +514,7 @@ const A = {
|
|
|
514
514
|
},
|
|
515
515
|
{
|
|
516
516
|
filename: "Agenda_XIV.json",
|
|
517
|
-
legislature:
|
|
517
|
+
legislature: r.Quatorze,
|
|
518
518
|
structure: 0,
|
|
519
519
|
title: "Agenda de la XIVème législature",
|
|
520
520
|
url: "https://data.assemblee-nationale.fr/static/openData/repository/14/vp/reunions/Agenda_XIV.json.zip"
|
|
@@ -523,7 +523,7 @@ const A = {
|
|
|
523
523
|
amendements: [
|
|
524
524
|
{
|
|
525
525
|
filename: "Amendements_XVII.json",
|
|
526
|
-
legislature:
|
|
526
|
+
legislature: r.DixSept,
|
|
527
527
|
repairZip: h,
|
|
528
528
|
structure: 1,
|
|
529
529
|
title: "Amendements de la XVIIème législature",
|
|
@@ -531,7 +531,7 @@ const A = {
|
|
|
531
531
|
},
|
|
532
532
|
{
|
|
533
533
|
filename: "Amendements_XVI.json",
|
|
534
|
-
legislature:
|
|
534
|
+
legislature: r.Seize,
|
|
535
535
|
repairZip: h,
|
|
536
536
|
structure: 1,
|
|
537
537
|
title: "Amendements de la XVIème législature",
|
|
@@ -539,7 +539,7 @@ const A = {
|
|
|
539
539
|
},
|
|
540
540
|
{
|
|
541
541
|
filename: "Amendements_XV.json",
|
|
542
|
-
legislature:
|
|
542
|
+
legislature: r.Quinze,
|
|
543
543
|
repairZip: h,
|
|
544
544
|
structure: 1,
|
|
545
545
|
title: "Amendements de la XVème législature",
|
|
@@ -558,7 +558,7 @@ const A = {
|
|
|
558
558
|
dossiersLegislatifs: [
|
|
559
559
|
{
|
|
560
560
|
filename: "Dossiers_Legislatifs_XVII.json",
|
|
561
|
-
legislature:
|
|
561
|
+
legislature: r.DixSept,
|
|
562
562
|
repairZip: h,
|
|
563
563
|
structure: 1,
|
|
564
564
|
title: "Dossiers législatifs de la XVIIème législature",
|
|
@@ -566,7 +566,7 @@ const A = {
|
|
|
566
566
|
},
|
|
567
567
|
{
|
|
568
568
|
filename: "Dossiers_Legislatifs_XVI.json",
|
|
569
|
-
legislature:
|
|
569
|
+
legislature: r.Seize,
|
|
570
570
|
repairZip: h,
|
|
571
571
|
structure: 1,
|
|
572
572
|
title: "Dossiers législatifs de la XVIème législature",
|
|
@@ -574,7 +574,7 @@ const A = {
|
|
|
574
574
|
},
|
|
575
575
|
{
|
|
576
576
|
filename: "Dossiers_Legislatifs_XV.json",
|
|
577
|
-
legislature:
|
|
577
|
+
legislature: r.Quinze,
|
|
578
578
|
repairZip: h,
|
|
579
579
|
structure: 1,
|
|
580
580
|
title: "Dossiers législatifs de la XVème législature",
|
|
@@ -582,7 +582,7 @@ const A = {
|
|
|
582
582
|
},
|
|
583
583
|
{
|
|
584
584
|
filename: "Dossiers_Legislatifs_XIV.json",
|
|
585
|
-
legislature:
|
|
585
|
+
legislature: r.Quatorze,
|
|
586
586
|
structure: 0,
|
|
587
587
|
title: "Dossiers législatifs de la XIVème législature",
|
|
588
588
|
url: "https://data.assemblee-nationale.fr/static/openData/repository/14/loi/dossiers_legislatifs/Dossiers_Legislatifs_XIV.json.zip"
|
|
@@ -591,7 +591,7 @@ const A = {
|
|
|
591
591
|
scrutins: [
|
|
592
592
|
{
|
|
593
593
|
filename: "Scrutins_XVII.json",
|
|
594
|
-
legislature:
|
|
594
|
+
legislature: r.DixSept,
|
|
595
595
|
repairZip: h,
|
|
596
596
|
structure: 1,
|
|
597
597
|
title: "Scrutins de la XVIIème législature",
|
|
@@ -599,7 +599,7 @@ const A = {
|
|
|
599
599
|
},
|
|
600
600
|
{
|
|
601
601
|
filename: "Scrutins_XVI.json",
|
|
602
|
-
legislature:
|
|
602
|
+
legislature: r.Seize,
|
|
603
603
|
repairZip: h,
|
|
604
604
|
structure: 1,
|
|
605
605
|
title: "Scrutins de la XVIème législature",
|
|
@@ -607,7 +607,7 @@ const A = {
|
|
|
607
607
|
},
|
|
608
608
|
{
|
|
609
609
|
filename: "Scrutins_XV.json",
|
|
610
|
-
legislature:
|
|
610
|
+
legislature: r.Quinze,
|
|
611
611
|
repairZip: h,
|
|
612
612
|
structure: 1,
|
|
613
613
|
title: "Scrutins de la XVème législature",
|
|
@@ -615,7 +615,7 @@ const A = {
|
|
|
615
615
|
},
|
|
616
616
|
{
|
|
617
617
|
filename: "Scrutins_XIV.json",
|
|
618
|
-
legislature:
|
|
618
|
+
legislature: r.Quatorze,
|
|
619
619
|
structure: 0,
|
|
620
620
|
title: "Scrutins de la XIVème législature",
|
|
621
621
|
url: "https://data.assemblee-nationale.fr/static/openData/repository/14/loi/scrutins/Scrutins_XIV.json.zip"
|
|
@@ -624,7 +624,7 @@ const A = {
|
|
|
624
624
|
questions: [
|
|
625
625
|
{
|
|
626
626
|
filename: "Questions_ecrites_XVII.json",
|
|
627
|
-
legislature:
|
|
627
|
+
legislature: r.DixSept,
|
|
628
628
|
repairZip: h,
|
|
629
629
|
structure: 1,
|
|
630
630
|
title: "Questions écrites de la XVIIème législature",
|
|
@@ -632,7 +632,7 @@ const A = {
|
|
|
632
632
|
},
|
|
633
633
|
{
|
|
634
634
|
filename: "Questions_ecrites_XVI.json",
|
|
635
|
-
legislature:
|
|
635
|
+
legislature: r.Seize,
|
|
636
636
|
repairZip: h,
|
|
637
637
|
structure: 1,
|
|
638
638
|
title: "Questions écrites de la XVIème législature",
|
|
@@ -640,7 +640,7 @@ const A = {
|
|
|
640
640
|
},
|
|
641
641
|
{
|
|
642
642
|
filename: "Questions_gouvernement_XVII.json",
|
|
643
|
-
legislature:
|
|
643
|
+
legislature: r.DixSept,
|
|
644
644
|
repairZip: h,
|
|
645
645
|
structure: 1,
|
|
646
646
|
title: "Questions au gouvernement de la XVIIème législature",
|
|
@@ -648,7 +648,7 @@ const A = {
|
|
|
648
648
|
},
|
|
649
649
|
{
|
|
650
650
|
filename: "Questions_gouvernement_XVI.json",
|
|
651
|
-
legislature:
|
|
651
|
+
legislature: r.Seize,
|
|
652
652
|
repairZip: h,
|
|
653
653
|
structure: 1,
|
|
654
654
|
title: "Questions au gouvernement de la XVIème législature",
|
|
@@ -656,7 +656,7 @@ const A = {
|
|
|
656
656
|
},
|
|
657
657
|
{
|
|
658
658
|
filename: "Questions_orales_XVII.json",
|
|
659
|
-
legislature:
|
|
659
|
+
legislature: r.DixSept,
|
|
660
660
|
repairZip: h,
|
|
661
661
|
structure: 1,
|
|
662
662
|
title: "Questions orales sans débats de la XVIIème législature",
|
|
@@ -664,7 +664,7 @@ const A = {
|
|
|
664
664
|
},
|
|
665
665
|
{
|
|
666
666
|
filename: "Questions_orales_XVI.json",
|
|
667
|
-
legislature:
|
|
667
|
+
legislature: r.Seize,
|
|
668
668
|
repairZip: h,
|
|
669
669
|
structure: 1,
|
|
670
670
|
title: "Questions orales sans débats de la XVIème législature",
|
|
@@ -674,7 +674,7 @@ const A = {
|
|
|
674
674
|
comptesRendusSeances: [
|
|
675
675
|
{
|
|
676
676
|
filename: "Comptes_Rendus_Seances_XVII.xml",
|
|
677
|
-
legislature:
|
|
677
|
+
legislature: r.DixSept,
|
|
678
678
|
repairZip: async (t, s) => {
|
|
679
679
|
const e = i.join(s, t.filename);
|
|
680
680
|
await n.pathExists(e) && await n.remove(e), await n.move(
|
|
@@ -688,7 +688,7 @@ const A = {
|
|
|
688
688
|
},
|
|
689
689
|
{
|
|
690
690
|
filename: "Comptes_Rendus_Seances_XVI.xml",
|
|
691
|
-
legislature:
|
|
691
|
+
legislature: r.Seize,
|
|
692
692
|
repairZip: async (t, s) => {
|
|
693
693
|
const e = i.join(s, t.filename);
|
|
694
694
|
await n.pathExists(e) && await n.remove(e), await n.move(
|
|
@@ -701,7 +701,18 @@ const A = {
|
|
|
701
701
|
url: "https://data.assemblee-nationale.fr/static/openData/repository/16/vp/syceronbrut/syseron.xml.zip"
|
|
702
702
|
}
|
|
703
703
|
]
|
|
704
|
-
}
|
|
704
|
+
};
|
|
705
|
+
function* x(t, s = []) {
|
|
706
|
+
const e = i.join(t, ...s);
|
|
707
|
+
if (n.existsSync(e))
|
|
708
|
+
for (const o of n.readdirSync(e)) {
|
|
709
|
+
if (o[0] === ".")
|
|
710
|
+
continue;
|
|
711
|
+
const l = i.join(e, o), m = [...s, o];
|
|
712
|
+
n.statSync(l).isDirectory() ? yield* x(t, m) : yield m;
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
const Q = [
|
|
705
716
|
1e3,
|
|
706
717
|
"M",
|
|
707
718
|
900,
|
|
@@ -740,28 +751,28 @@ function ie(t) {
|
|
|
740
751
|
s += Q[e + 1], t -= Q[e];
|
|
741
752
|
return s;
|
|
742
753
|
}
|
|
743
|
-
function* z(t, s, e,
|
|
754
|
+
function* z(t, s, e, o, l, m = "json", { enriched: _ = !1, log: j = !1, noValidation: y = !1 } = {}) {
|
|
744
755
|
const F = /* @__PURE__ */ new Set();
|
|
745
756
|
for (const v of e) {
|
|
746
757
|
if (v.ignoreForWeb || !ne(s, v))
|
|
747
758
|
continue;
|
|
748
|
-
const b = new RegExp(`\\.${
|
|
759
|
+
const b = new RegExp(`\\.${m}$`), P = i.join(
|
|
749
760
|
t,
|
|
750
761
|
v.filename.replace(
|
|
751
762
|
b,
|
|
752
763
|
_ ? "_enrichi" : "_nettoye"
|
|
753
764
|
)
|
|
754
765
|
);
|
|
755
|
-
for (const
|
|
756
|
-
if (!
|
|
766
|
+
for (const X of x(P, l)) {
|
|
767
|
+
if (!X[X.length - 1].endsWith(".json"))
|
|
757
768
|
continue;
|
|
758
|
-
const
|
|
759
|
-
j && console.log(`Loading file: ${
|
|
760
|
-
let V = n.readFileSync(
|
|
761
|
-
const $ = y ? JSON.parse(V) :
|
|
769
|
+
const D = i.join(P, ...X);
|
|
770
|
+
j && console.log(`Loading file: ${D}…`);
|
|
771
|
+
let V = n.readFileSync(D, { encoding: "utf8" });
|
|
772
|
+
const $ = y ? JSON.parse(V) : o(V);
|
|
762
773
|
F.has($.uid) || (F.add($.uid), yield {
|
|
763
774
|
datasetLegislature: v.legislature,
|
|
764
|
-
filePath:
|
|
775
|
+
filePath: D,
|
|
765
776
|
item: $
|
|
766
777
|
}, V = null);
|
|
767
778
|
}
|
|
@@ -770,13 +781,13 @@ function* z(t, s, e, r, l, d = "json", { enriched: _ = !1, log: j = !1, noValida
|
|
|
770
781
|
}
|
|
771
782
|
function ne(t, s) {
|
|
772
783
|
const e = Array.isArray(t) ? t : t !== void 0 ? [t] : [];
|
|
773
|
-
return t === void 0 || e.includes(0) || s.legislature ===
|
|
784
|
+
return t === void 0 || e.includes(0) || s.legislature === r.All ? !0 : e.includes(s.legislature);
|
|
774
785
|
}
|
|
775
786
|
function* de(t, s, e = {}) {
|
|
776
787
|
for (const {
|
|
777
|
-
datasetLegislature:
|
|
788
|
+
datasetLegislature: o,
|
|
778
789
|
item: l,
|
|
779
|
-
filePath:
|
|
790
|
+
filePath: m
|
|
780
791
|
} of z(
|
|
781
792
|
t,
|
|
782
793
|
s,
|
|
@@ -786,13 +797,13 @@ function* de(t, s, e = {}) {
|
|
|
786
797
|
"json",
|
|
787
798
|
e
|
|
788
799
|
))
|
|
789
|
-
yield { acteur: l, datasetLegislature:
|
|
800
|
+
yield { acteur: l, datasetLegislature: o, filePath: m };
|
|
790
801
|
}
|
|
791
802
|
function* pe(t, s, e = {}) {
|
|
792
803
|
for (const {
|
|
793
|
-
item:
|
|
804
|
+
item: o,
|
|
794
805
|
datasetLegislature: l,
|
|
795
|
-
filePath:
|
|
806
|
+
filePath: m
|
|
796
807
|
} of z(
|
|
797
808
|
t,
|
|
798
809
|
s,
|
|
@@ -802,13 +813,13 @@ function* pe(t, s, e = {}) {
|
|
|
802
813
|
"json",
|
|
803
814
|
e
|
|
804
815
|
))
|
|
805
|
-
yield { organe:
|
|
816
|
+
yield { organe: o, datasetLegislature: l, filePath: m };
|
|
806
817
|
}
|
|
807
818
|
function* ge(t, s, e = {}) {
|
|
808
819
|
for (const {
|
|
809
|
-
datasetLegislature:
|
|
820
|
+
datasetLegislature: o,
|
|
810
821
|
item: l,
|
|
811
|
-
filePath:
|
|
822
|
+
filePath: m
|
|
812
823
|
} of z(
|
|
813
824
|
t,
|
|
814
825
|
s,
|
|
@@ -818,13 +829,13 @@ function* ge(t, s, e = {}) {
|
|
|
818
829
|
"json",
|
|
819
830
|
e
|
|
820
831
|
))
|
|
821
|
-
yield { amendement: l, datasetLegislature:
|
|
832
|
+
yield { amendement: l, datasetLegislature: o, filePath: m };
|
|
822
833
|
}
|
|
823
834
|
function* _e(t, s, e = {}) {
|
|
824
835
|
for (const {
|
|
825
|
-
item:
|
|
836
|
+
item: o,
|
|
826
837
|
datasetLegislature: l,
|
|
827
|
-
filePath:
|
|
838
|
+
filePath: m
|
|
828
839
|
} of z(
|
|
829
840
|
t,
|
|
830
841
|
s,
|
|
@@ -834,13 +845,13 @@ function* _e(t, s, e = {}) {
|
|
|
834
845
|
"json",
|
|
835
846
|
e
|
|
836
847
|
))
|
|
837
|
-
yield { document:
|
|
848
|
+
yield { document: o, datasetLegislature: l, filePath: m };
|
|
838
849
|
}
|
|
839
850
|
function* je(t, s, e = {}) {
|
|
840
851
|
for (const {
|
|
841
|
-
item:
|
|
852
|
+
item: o,
|
|
842
853
|
datasetLegislature: l,
|
|
843
|
-
filePath:
|
|
854
|
+
filePath: m
|
|
844
855
|
} of z(
|
|
845
856
|
t,
|
|
846
857
|
s,
|
|
@@ -850,13 +861,13 @@ function* je(t, s, e = {}) {
|
|
|
850
861
|
"json",
|
|
851
862
|
e
|
|
852
863
|
))
|
|
853
|
-
yield { dossierParlementaire:
|
|
864
|
+
yield { dossierParlementaire: o, datasetLegislature: l, filePath: m };
|
|
854
865
|
}
|
|
855
866
|
function* he(t, s, e = {}) {
|
|
856
867
|
for (const {
|
|
857
|
-
item:
|
|
868
|
+
item: o,
|
|
858
869
|
datasetLegislature: l,
|
|
859
|
-
filePath:
|
|
870
|
+
filePath: m
|
|
860
871
|
} of z(
|
|
861
872
|
t,
|
|
862
873
|
s,
|
|
@@ -866,13 +877,13 @@ function* he(t, s, e = {}) {
|
|
|
866
877
|
"json",
|
|
867
878
|
e
|
|
868
879
|
))
|
|
869
|
-
yield { reunion:
|
|
880
|
+
yield { reunion: o, datasetLegislature: l, filePath: m };
|
|
870
881
|
}
|
|
871
882
|
function* ye(t, s, e = {}) {
|
|
872
883
|
for (const {
|
|
873
|
-
item:
|
|
884
|
+
item: o,
|
|
874
885
|
datasetLegislature: l,
|
|
875
|
-
filePath:
|
|
886
|
+
filePath: m
|
|
876
887
|
} of z(
|
|
877
888
|
t,
|
|
878
889
|
s,
|
|
@@ -882,13 +893,13 @@ function* ye(t, s, e = {}) {
|
|
|
882
893
|
"json",
|
|
883
894
|
e
|
|
884
895
|
))
|
|
885
|
-
yield { scrutin:
|
|
896
|
+
yield { scrutin: o, datasetLegislature: l, filePath: m };
|
|
886
897
|
}
|
|
887
898
|
function* Ae(t, s, e = {}) {
|
|
888
899
|
for (const {
|
|
889
|
-
item:
|
|
900
|
+
item: o,
|
|
890
901
|
datasetLegislature: l,
|
|
891
|
-
filePath:
|
|
902
|
+
filePath: m
|
|
892
903
|
} of z(
|
|
893
904
|
t,
|
|
894
905
|
s,
|
|
@@ -898,13 +909,13 @@ function* Ae(t, s, e = {}) {
|
|
|
898
909
|
"json",
|
|
899
910
|
e
|
|
900
911
|
))
|
|
901
|
-
yield { question:
|
|
912
|
+
yield { question: o, datasetLegislature: l, filePath: m };
|
|
902
913
|
}
|
|
903
914
|
function* Se(t, s, e = {}) {
|
|
904
915
|
for (const {
|
|
905
|
-
item:
|
|
916
|
+
item: o,
|
|
906
917
|
datasetLegislature: l,
|
|
907
|
-
filePath:
|
|
918
|
+
filePath: m
|
|
908
919
|
} of z(
|
|
909
920
|
t,
|
|
910
921
|
s,
|
|
@@ -914,21 +925,21 @@ function* Se(t, s, e = {}) {
|
|
|
914
925
|
"xml",
|
|
915
926
|
e
|
|
916
927
|
))
|
|
917
|
-
yield { compteRendu:
|
|
928
|
+
yield { compteRendu: o, datasetLegislature: l, filePath: m };
|
|
918
929
|
}
|
|
919
930
|
function* Fe(t, s, { enriched: e = !1 } = {}) {
|
|
920
|
-
const
|
|
931
|
+
const o = `Comptes_Rendus_Commissions_${ie(s)}${e ? "_enrichi" : "_nettoye"}`, l = i.join(t, o);
|
|
921
932
|
if (n.existsSync(l))
|
|
922
|
-
for (const
|
|
933
|
+
for (const m of k(l))
|
|
923
934
|
try {
|
|
924
|
-
const _ = n.readFileSync(
|
|
935
|
+
const _ = n.readFileSync(m, "utf-8");
|
|
925
936
|
yield {
|
|
926
937
|
compteRendu: JSON.parse(_),
|
|
927
938
|
datasetLegislature: s,
|
|
928
|
-
filePath:
|
|
939
|
+
filePath: m
|
|
929
940
|
};
|
|
930
941
|
} catch (_) {
|
|
931
|
-
console.warn(`Erreur lors de la lecture du fichier ${
|
|
942
|
+
console.warn(`Erreur lors de la lecture du fichier ${m} :`, _);
|
|
932
943
|
}
|
|
933
944
|
}
|
|
934
945
|
function* k(t) {
|
|
@@ -938,214 +949,214 @@ function* k(t) {
|
|
|
938
949
|
s.isDirectory() ? yield* k(e) : s.isFile() && e.endsWith(".json") && (yield e);
|
|
939
950
|
}
|
|
940
951
|
}
|
|
941
|
-
function ve(t, s, e, { enriched:
|
|
942
|
-
const
|
|
952
|
+
function ve(t, s, e, { enriched: o = !1, log: l = !1 } = {}) {
|
|
953
|
+
const m = {}, _ = {};
|
|
943
954
|
if (s & I.ActeursEtOrganes)
|
|
944
|
-
for (const
|
|
945
|
-
if (
|
|
955
|
+
for (const a of A.acteursEtOrganes) {
|
|
956
|
+
if (a.ignoreForWeb || e !== r.All && a.legislature !== r.All && e !== a.legislature)
|
|
946
957
|
continue;
|
|
947
|
-
const
|
|
958
|
+
const f = i.join(
|
|
948
959
|
t,
|
|
949
|
-
|
|
960
|
+
a.filename.replace(/\.json$/, o ? "_enrichi" : "_nettoye")
|
|
950
961
|
);
|
|
951
|
-
for (const u of
|
|
962
|
+
for (const u of x(f, ["acteurs"])) {
|
|
952
963
|
if (!u[u.length - 1].endsWith(".json"))
|
|
953
964
|
continue;
|
|
954
|
-
const g = i.join(
|
|
965
|
+
const g = i.join(f, ...u);
|
|
955
966
|
l && console.log(`Loading file: ${g}…`);
|
|
956
967
|
const S = n.readFileSync(g, {
|
|
957
968
|
encoding: "utf8"
|
|
958
|
-
}),
|
|
959
|
-
d
|
|
969
|
+
}), d = C.toActeur(S);
|
|
970
|
+
m[d.uid] === void 0 && (m[d.uid] = d);
|
|
960
971
|
}
|
|
961
|
-
for (const u of
|
|
972
|
+
for (const u of x(f, ["organes"])) {
|
|
962
973
|
if (!u[u.length - 1].endsWith(".json"))
|
|
963
974
|
continue;
|
|
964
|
-
const g = i.join(
|
|
975
|
+
const g = i.join(f, ...u);
|
|
965
976
|
l && console.log(`Loading file: ${g}…`);
|
|
966
977
|
const S = n.readFileSync(g, {
|
|
967
978
|
encoding: "utf8"
|
|
968
|
-
}),
|
|
969
|
-
_[
|
|
979
|
+
}), d = C.toOrgane(S);
|
|
980
|
+
_[d.uid] === void 0 && (_[d.uid] = d);
|
|
970
981
|
}
|
|
971
982
|
}
|
|
972
983
|
const j = {}, y = {}, F = {};
|
|
973
984
|
if (s & I.Agendas)
|
|
974
|
-
for (const
|
|
975
|
-
if (
|
|
985
|
+
for (const a of A.agendas) {
|
|
986
|
+
if (a.ignoreForWeb || e !== r.All && a.legislature !== r.All && e !== a.legislature)
|
|
976
987
|
continue;
|
|
977
|
-
const
|
|
988
|
+
const f = i.join(
|
|
978
989
|
t,
|
|
979
|
-
|
|
990
|
+
a.filename.replace(/\.json$/, o ? "_enrichi" : "_nettoye")
|
|
980
991
|
);
|
|
981
|
-
for (const u of
|
|
992
|
+
for (const u of x(f)) {
|
|
982
993
|
if (!u[u.length - 1].endsWith(".json"))
|
|
983
994
|
continue;
|
|
984
|
-
const g = i.join(
|
|
995
|
+
const g = i.join(f, ...u);
|
|
985
996
|
l && console.log(`Loading file: ${g}…`);
|
|
986
997
|
const S = n.readFileSync(g, {
|
|
987
998
|
encoding: "utf8"
|
|
988
|
-
}),
|
|
989
|
-
j[
|
|
990
|
-
const L =
|
|
999
|
+
}), d = M.toReunion(S);
|
|
1000
|
+
j[d.uid] === void 0 && (j[d.uid] = d);
|
|
1001
|
+
const L = d.timestampDebut.toISOString().split("T")[0];
|
|
991
1002
|
let w = y[L];
|
|
992
|
-
w === void 0 && (w = y[L] = []), w.push(
|
|
993
|
-
const U =
|
|
1003
|
+
w === void 0 && (w = y[L] = []), w.push(d);
|
|
1004
|
+
const U = d.odj;
|
|
994
1005
|
if (U !== void 0)
|
|
995
1006
|
for (const H of U.pointsOdj || [])
|
|
996
1007
|
for (const E of H.dossiersLegislatifsRefs || []) {
|
|
997
1008
|
let W = F[E];
|
|
998
|
-
W === void 0 && (W = F[E] = []), W.push(
|
|
1009
|
+
W === void 0 && (W = F[E] = []), W.push(d);
|
|
999
1010
|
}
|
|
1000
1011
|
}
|
|
1001
1012
|
}
|
|
1002
1013
|
const v = {};
|
|
1003
1014
|
if (s & I.Amendements)
|
|
1004
|
-
for (const
|
|
1005
|
-
if (
|
|
1015
|
+
for (const a of A.amendements) {
|
|
1016
|
+
if (a.ignoreForWeb || e !== r.All && a.legislature !== r.All && e !== a.legislature)
|
|
1006
1017
|
continue;
|
|
1007
|
-
const
|
|
1018
|
+
const f = i.join(
|
|
1008
1019
|
t,
|
|
1009
|
-
|
|
1020
|
+
a.filename.replace(/\.json$/, o ? "_enrichi" : "_nettoye")
|
|
1010
1021
|
);
|
|
1011
|
-
for (const u of
|
|
1022
|
+
for (const u of x(f)) {
|
|
1012
1023
|
if (!u[u.length - 1].endsWith(".json"))
|
|
1013
1024
|
continue;
|
|
1014
|
-
const g = i.join(
|
|
1025
|
+
const g = i.join(f, ...u);
|
|
1015
1026
|
l && console.log(`Loading file: ${g}…`);
|
|
1016
1027
|
const S = n.readFileSync(g, {
|
|
1017
1028
|
encoding: "utf8"
|
|
1018
|
-
}),
|
|
1019
|
-
v[
|
|
1029
|
+
}), d = N.toAmendement(S);
|
|
1030
|
+
v[d.uid] === void 0 && (v[d.uid] = d);
|
|
1020
1031
|
}
|
|
1021
1032
|
}
|
|
1022
|
-
const b = {},
|
|
1033
|
+
const b = {}, P = {}, X = {}, O = {};
|
|
1023
1034
|
if (s & I.DossiersLegislatifs)
|
|
1024
|
-
for (const
|
|
1025
|
-
if (
|
|
1035
|
+
for (const a of A.dossiersLegislatifs) {
|
|
1036
|
+
if (a.ignoreForWeb || e !== r.All && a.legislature !== r.All && e !== a.legislature)
|
|
1026
1037
|
continue;
|
|
1027
|
-
const
|
|
1038
|
+
const f = i.join(
|
|
1028
1039
|
t,
|
|
1029
|
-
|
|
1040
|
+
a.filename.replace(/\.json$/, o ? "_enrichi" : "_nettoye")
|
|
1030
1041
|
);
|
|
1031
|
-
for (const u of
|
|
1042
|
+
for (const u of x(f, ["documents"])) {
|
|
1032
1043
|
if (!u[u.length - 1].endsWith(".json"))
|
|
1033
1044
|
continue;
|
|
1034
|
-
const g = i.join(
|
|
1045
|
+
const g = i.join(f, ...u);
|
|
1035
1046
|
l && console.log(`Loading file: ${g}…`);
|
|
1036
1047
|
const S = n.readFileSync(g, {
|
|
1037
1048
|
encoding: "utf8"
|
|
1038
|
-
}),
|
|
1039
|
-
b[
|
|
1049
|
+
}), d = R.toDocument(S);
|
|
1050
|
+
b[d.uid] === void 0 && (b[d.uid] = d);
|
|
1040
1051
|
}
|
|
1041
|
-
for (const u of
|
|
1052
|
+
for (const u of x(f, ["dossiers"])) {
|
|
1042
1053
|
if (!u[u.length - 1].endsWith(".json"))
|
|
1043
1054
|
continue;
|
|
1044
|
-
const g = i.join(
|
|
1055
|
+
const g = i.join(f, ...u);
|
|
1045
1056
|
l && console.log(`Loading file: ${g}…`);
|
|
1046
1057
|
const S = n.readFileSync(g, {
|
|
1047
1058
|
encoding: "utf8"
|
|
1048
|
-
}),
|
|
1049
|
-
L.senatChemin &&
|
|
1059
|
+
}), d = R.toDossierParlementaire(S), L = d.titreDossier;
|
|
1060
|
+
L.senatChemin && P[L.senatChemin] === void 0 && (P[L.senatChemin] = d), L.titreChemin && X[L.titreChemin] === void 0 && (X[L.titreChemin] = d), O[d.uid] === void 0 && (O[d.uid] = d);
|
|
1050
1061
|
}
|
|
1051
1062
|
}
|
|
1052
|
-
let
|
|
1063
|
+
let D = {};
|
|
1053
1064
|
if (s & I.Photos) {
|
|
1054
1065
|
{
|
|
1055
|
-
const
|
|
1066
|
+
const a = i.join(
|
|
1056
1067
|
t,
|
|
1057
1068
|
`photos_deputes_${// TODO: Handle Legislature.All.
|
|
1058
|
-
e ===
|
|
1069
|
+
e === r.All ? r.DixSept : e}`,
|
|
1059
1070
|
"deputes.json"
|
|
1060
1071
|
);
|
|
1061
|
-
if (n.existsSync(
|
|
1062
|
-
l && console.log(`Loading file: ${
|
|
1063
|
-
const
|
|
1064
|
-
Object.assign(
|
|
1065
|
-
} else l && console.log(`Ignoring missing file: ${
|
|
1072
|
+
if (n.existsSync(a)) {
|
|
1073
|
+
l && console.log(`Loading file: ${a}`);
|
|
1074
|
+
const f = n.readFileSync(a, { encoding: "utf8" });
|
|
1075
|
+
Object.assign(D, JSON.parse(f));
|
|
1076
|
+
} else l && console.log(`Ignoring missing file: ${a}`);
|
|
1066
1077
|
}
|
|
1067
1078
|
{
|
|
1068
|
-
const
|
|
1079
|
+
const a = i.join(
|
|
1069
1080
|
t,
|
|
1070
1081
|
"photos_senateurs",
|
|
1071
1082
|
"senateurs.json"
|
|
1072
1083
|
);
|
|
1073
|
-
if (n.existsSync(
|
|
1074
|
-
l && console.log(`Loading file: ${
|
|
1075
|
-
const
|
|
1076
|
-
Object.assign(
|
|
1077
|
-
} else l && console.log(`Ignoring missing file: ${
|
|
1084
|
+
if (n.existsSync(a)) {
|
|
1085
|
+
l && console.log(`Loading file: ${a}`);
|
|
1086
|
+
const f = n.readFileSync(a, { encoding: "utf8" });
|
|
1087
|
+
Object.assign(D, JSON.parse(f));
|
|
1088
|
+
} else l && console.log(`Ignoring missing file: ${a}`);
|
|
1078
1089
|
}
|
|
1079
1090
|
}
|
|
1080
1091
|
const V = {};
|
|
1081
1092
|
if (s & I.Scrutins)
|
|
1082
|
-
for (const
|
|
1083
|
-
if (
|
|
1093
|
+
for (const a of A.scrutins) {
|
|
1094
|
+
if (a.ignoreForWeb || e !== r.All && a.legislature !== r.All && e !== a.legislature)
|
|
1084
1095
|
continue;
|
|
1085
|
-
const
|
|
1096
|
+
const f = i.join(
|
|
1086
1097
|
t,
|
|
1087
|
-
|
|
1098
|
+
a.filename.replace(/\.json$/, o ? "_enrichi" : "_nettoye")
|
|
1088
1099
|
);
|
|
1089
|
-
for (const u of
|
|
1100
|
+
for (const u of x(f)) {
|
|
1090
1101
|
if (!u[u.length - 1].endsWith(".json"))
|
|
1091
1102
|
continue;
|
|
1092
|
-
const g = i.join(
|
|
1103
|
+
const g = i.join(f, ...u);
|
|
1093
1104
|
l && console.log(`Loading file: ${g}…`);
|
|
1094
1105
|
const S = n.readFileSync(g, {
|
|
1095
1106
|
encoding: "utf8"
|
|
1096
|
-
}),
|
|
1097
|
-
V[
|
|
1107
|
+
}), d = Z.toScrutin(S);
|
|
1108
|
+
V[d.uid] === void 0 && (V[d.uid] = d);
|
|
1098
1109
|
}
|
|
1099
1110
|
}
|
|
1100
1111
|
const $ = {};
|
|
1101
1112
|
if (s & I.Questions)
|
|
1102
|
-
for (const
|
|
1103
|
-
if (
|
|
1113
|
+
for (const a of A.questions) {
|
|
1114
|
+
if (a.ignoreForWeb || e !== r.All && a.legislature !== r.All && e !== a.legislature)
|
|
1104
1115
|
continue;
|
|
1105
|
-
const
|
|
1116
|
+
const f = i.join(
|
|
1106
1117
|
t,
|
|
1107
|
-
|
|
1118
|
+
a.filename.replace(/\.json$/, o ? "_enrichi" : "_nettoye")
|
|
1108
1119
|
);
|
|
1109
|
-
for (const u of
|
|
1120
|
+
for (const u of x(f)) {
|
|
1110
1121
|
if (!u[u.length - 1].endsWith(".json"))
|
|
1111
1122
|
continue;
|
|
1112
|
-
const g = i.join(
|
|
1123
|
+
const g = i.join(f, ...u);
|
|
1113
1124
|
l && console.log(`Loading file: ${g}…`);
|
|
1114
1125
|
const S = n.readFileSync(g, {
|
|
1115
1126
|
encoding: "utf8"
|
|
1116
|
-
}),
|
|
1117
|
-
$[
|
|
1127
|
+
}), d = B.toQuestion(S);
|
|
1128
|
+
$[d.uid] === void 0 && ($[d.uid] = d);
|
|
1118
1129
|
}
|
|
1119
1130
|
}
|
|
1120
1131
|
const p = {};
|
|
1121
1132
|
if (s & I.ComptesRendusSeances)
|
|
1122
|
-
for (const
|
|
1123
|
-
if (
|
|
1133
|
+
for (const a of A.comptesRendusSeances) {
|
|
1134
|
+
if (a.ignoreForWeb || e !== r.All && a.legislature !== r.All && e !== a.legislature)
|
|
1124
1135
|
continue;
|
|
1125
|
-
const
|
|
1136
|
+
const f = i.join(
|
|
1126
1137
|
t,
|
|
1127
|
-
|
|
1138
|
+
a.filename.replace(/\.json$/, o ? "_enrichi" : "_nettoye")
|
|
1128
1139
|
);
|
|
1129
|
-
for (const u of
|
|
1140
|
+
for (const u of x(f)) {
|
|
1130
1141
|
if (!u[u.length - 1].endsWith(".json"))
|
|
1131
1142
|
continue;
|
|
1132
|
-
const g = i.join(
|
|
1143
|
+
const g = i.join(f, ...u);
|
|
1133
1144
|
l && console.log(`Loading file: ${g}…`);
|
|
1134
1145
|
const S = n.readFileSync(g, {
|
|
1135
1146
|
encoding: "utf8"
|
|
1136
|
-
}),
|
|
1137
|
-
p[
|
|
1147
|
+
}), d = J.toCompteRendu(S);
|
|
1148
|
+
p[d.uid] === void 0 && (p[d.uid] = d);
|
|
1138
1149
|
}
|
|
1139
1150
|
}
|
|
1140
1151
|
return {
|
|
1141
|
-
acteurByUid:
|
|
1152
|
+
acteurByUid: m,
|
|
1142
1153
|
amendementByUid: v,
|
|
1143
1154
|
documentByUid: b,
|
|
1144
|
-
dossierParlementaireBySenatChemin:
|
|
1145
|
-
dossierParlementaireByTitreChemin:
|
|
1155
|
+
dossierParlementaireBySenatChemin: P,
|
|
1156
|
+
dossierParlementaireByTitreChemin: X,
|
|
1146
1157
|
dossierParlementaireByUid: O,
|
|
1147
1158
|
organeByUid: _,
|
|
1148
|
-
photoByUid:
|
|
1159
|
+
photoByUid: D,
|
|
1149
1160
|
reunionByUid: j,
|
|
1150
1161
|
reunionsByDay: y,
|
|
1151
1162
|
reunionsByDossierUid: F,
|
|
@@ -1154,42 +1165,42 @@ function ve(t, s, e, { enriched: r = !1, log: l = !1 } = {}) {
|
|
|
1154
1165
|
compteRenduByUid: p
|
|
1155
1166
|
};
|
|
1156
1167
|
}
|
|
1157
|
-
function Ie(t, s, e, { log:
|
|
1158
|
-
const l = {},
|
|
1168
|
+
function Ie(t, s, e, { log: o = !1 } = {}) {
|
|
1169
|
+
const l = {}, m = {};
|
|
1159
1170
|
if (s & I.ActeursEtOrganes)
|
|
1160
1171
|
for (const p of A.acteursEtOrganes) {
|
|
1161
|
-
if (p.ignoreForWeb || e !==
|
|
1172
|
+
if (p.ignoreForWeb || e !== r.All && p.legislature !== r.All && e !== p.legislature)
|
|
1162
1173
|
continue;
|
|
1163
|
-
const
|
|
1174
|
+
const a = i.join(
|
|
1164
1175
|
t,
|
|
1165
1176
|
p.filename.replace(/\.json$/, "_nettoye.json")
|
|
1166
1177
|
);
|
|
1167
|
-
|
|
1168
|
-
const
|
|
1178
|
+
o && console.log(`Loading file: ${a}`);
|
|
1179
|
+
const f = n.readFileSync(a, { encoding: "utf8" }), u = C.toActeursEtOrganes(f);
|
|
1169
1180
|
for (const c of u.acteurs)
|
|
1170
1181
|
l[c.uid] === void 0 && (l[c.uid] = c);
|
|
1171
1182
|
for (const c of u.organes)
|
|
1172
|
-
|
|
1183
|
+
m[c.uid] === void 0 && (m[c.uid] = c);
|
|
1173
1184
|
}
|
|
1174
1185
|
const _ = {}, j = {}, y = {};
|
|
1175
1186
|
if (s & I.Agendas)
|
|
1176
1187
|
for (const p of A.agendas) {
|
|
1177
|
-
if (p.ignoreForWeb || e !==
|
|
1188
|
+
if (p.ignoreForWeb || e !== r.All && p.legislature !== r.All && e !== p.legislature)
|
|
1178
1189
|
continue;
|
|
1179
|
-
const
|
|
1190
|
+
const a = i.join(
|
|
1180
1191
|
t,
|
|
1181
1192
|
p.filename.replace(/\.json$/, "_nettoye.json")
|
|
1182
1193
|
);
|
|
1183
|
-
|
|
1184
|
-
const
|
|
1194
|
+
o && console.log(`Loading file: ${a}`);
|
|
1195
|
+
const f = n.readFileSync(a, { encoding: "utf8" }), u = M.toAgendas(f);
|
|
1185
1196
|
for (const c of u.reunions) {
|
|
1186
1197
|
_[c.uid] === void 0 && (_[c.uid] = c);
|
|
1187
1198
|
const g = c.timestampDebut.toISOString().split("T")[0];
|
|
1188
1199
|
let S = j[g];
|
|
1189
1200
|
S === void 0 && (S = j[g] = []), S.push(c);
|
|
1190
|
-
const
|
|
1191
|
-
if (
|
|
1192
|
-
for (const L of
|
|
1201
|
+
const d = c.odj;
|
|
1202
|
+
if (d !== void 0)
|
|
1203
|
+
for (const L of d.pointsOdj || [])
|
|
1193
1204
|
for (const w of L.dossiersLegislatifsRefs || []) {
|
|
1194
1205
|
let U = y[w];
|
|
1195
1206
|
U === void 0 && (U = y[w] = []), U.push(c);
|
|
@@ -1199,104 +1210,104 @@ function Ie(t, s, e, { log: r = !1 } = {}) {
|
|
|
1199
1210
|
const F = {};
|
|
1200
1211
|
if (s & I.Amendements)
|
|
1201
1212
|
for (const p of A.amendements) {
|
|
1202
|
-
if (p.ignoreForWeb || e !==
|
|
1213
|
+
if (p.ignoreForWeb || e !== r.All && p.legislature !== r.All && e !== p.legislature)
|
|
1203
1214
|
continue;
|
|
1204
|
-
const
|
|
1215
|
+
const a = i.join(
|
|
1205
1216
|
t,
|
|
1206
1217
|
p.filename.replace(/\.json$/, "_nettoye.json")
|
|
1207
1218
|
);
|
|
1208
|
-
|
|
1209
|
-
const
|
|
1219
|
+
o && console.log(`Loading file: ${a}`);
|
|
1220
|
+
const f = n.readFileSync(a, { encoding: "utf8" }), u = N.toAmendements(f);
|
|
1210
1221
|
for (const c of u.textesLegislatifs)
|
|
1211
1222
|
for (const g of c.amendements)
|
|
1212
1223
|
F[g.uid] === void 0 && (F[g.uid] = g);
|
|
1213
1224
|
}
|
|
1214
|
-
const v = {}, b = {},
|
|
1225
|
+
const v = {}, b = {}, P = {}, X = {};
|
|
1215
1226
|
if (s & I.DossiersLegislatifs)
|
|
1216
1227
|
for (const p of A.dossiersLegislatifs) {
|
|
1217
|
-
if (p.ignoreForWeb || e !==
|
|
1228
|
+
if (p.ignoreForWeb || e !== r.All && p.legislature !== r.All && e !== p.legislature)
|
|
1218
1229
|
continue;
|
|
1219
|
-
const
|
|
1230
|
+
const a = i.join(
|
|
1220
1231
|
t,
|
|
1221
1232
|
p.filename.replace(/\.json$/, "_nettoye.json")
|
|
1222
1233
|
);
|
|
1223
|
-
|
|
1224
|
-
const
|
|
1234
|
+
o && console.log(`Loading file: ${a}`);
|
|
1235
|
+
const f = n.readFileSync(a, { encoding: "utf8" }), u = R.toDossiersLegislatifs(f);
|
|
1225
1236
|
for (const c of u.textesLegislatifs)
|
|
1226
1237
|
v[c.uid] === void 0 && (v[c.uid] = c);
|
|
1227
1238
|
for (const c of u.dossiersParlementaires) {
|
|
1228
1239
|
const g = c.titreDossier;
|
|
1229
|
-
g.senatChemin && b[g.senatChemin] === void 0 && (b[g.senatChemin] = c), g.titreChemin &&
|
|
1240
|
+
g.senatChemin && b[g.senatChemin] === void 0 && (b[g.senatChemin] = c), g.titreChemin && P[g.titreChemin] === void 0 && (P[g.titreChemin] = c), X[c.uid] === void 0 && (X[c.uid] = c);
|
|
1230
1241
|
}
|
|
1231
1242
|
}
|
|
1232
1243
|
const O = {};
|
|
1233
1244
|
if (s & I.Photos) {
|
|
1234
1245
|
const p = {};
|
|
1235
1246
|
{
|
|
1236
|
-
const
|
|
1247
|
+
const a = i.join(
|
|
1237
1248
|
t,
|
|
1238
1249
|
`photos_deputes_${// TODO: Handle Legislature.All.
|
|
1239
|
-
e ===
|
|
1250
|
+
e === r.All ? r.DixSept : e}`,
|
|
1240
1251
|
"deputes.json"
|
|
1241
1252
|
);
|
|
1242
|
-
if (n.existsSync(
|
|
1243
|
-
|
|
1244
|
-
const
|
|
1245
|
-
Object.assign(p, JSON.parse(
|
|
1246
|
-
} else
|
|
1253
|
+
if (n.existsSync(a)) {
|
|
1254
|
+
o && console.log(`Loading file: ${a}`);
|
|
1255
|
+
const f = n.readFileSync(a, { encoding: "utf8" });
|
|
1256
|
+
Object.assign(p, JSON.parse(f));
|
|
1257
|
+
} else o && console.log(`Ignoring missing file: ${a}`);
|
|
1247
1258
|
}
|
|
1248
1259
|
{
|
|
1249
|
-
const
|
|
1260
|
+
const a = i.join(
|
|
1250
1261
|
t,
|
|
1251
1262
|
"photos_senateurs",
|
|
1252
1263
|
"senateurs.json"
|
|
1253
1264
|
);
|
|
1254
|
-
if (n.existsSync(
|
|
1255
|
-
|
|
1256
|
-
const
|
|
1257
|
-
Object.assign(p, JSON.parse(
|
|
1258
|
-
} else
|
|
1265
|
+
if (n.existsSync(a)) {
|
|
1266
|
+
o && console.log(`Loading file: ${a}`);
|
|
1267
|
+
const f = n.readFileSync(a, { encoding: "utf8" });
|
|
1268
|
+
Object.assign(p, JSON.parse(f));
|
|
1269
|
+
} else o && console.log(`Ignoring missing file: ${a}`);
|
|
1259
1270
|
}
|
|
1260
1271
|
}
|
|
1261
|
-
const
|
|
1272
|
+
const D = {};
|
|
1262
1273
|
if (s & I.Scrutins)
|
|
1263
1274
|
for (const p of A.scrutins) {
|
|
1264
|
-
if (p.ignoreForWeb || e !==
|
|
1275
|
+
if (p.ignoreForWeb || e !== r.All && p.legislature !== r.All && e !== p.legislature)
|
|
1265
1276
|
continue;
|
|
1266
|
-
const
|
|
1277
|
+
const a = i.join(
|
|
1267
1278
|
t,
|
|
1268
1279
|
p.filename.replace(/\.json$/, "_nettoye.json")
|
|
1269
1280
|
);
|
|
1270
|
-
|
|
1271
|
-
const
|
|
1281
|
+
o && console.log(`Loading file: ${a}`);
|
|
1282
|
+
const f = n.readFileSync(a, { encoding: "utf8" }), u = Z.toScrutins(f);
|
|
1272
1283
|
for (const c of u.scrutins)
|
|
1273
|
-
|
|
1284
|
+
D[c.uid] === void 0 && (D[c.uid] = c);
|
|
1274
1285
|
}
|
|
1275
1286
|
const V = {};
|
|
1276
1287
|
if (s & I.Questions)
|
|
1277
1288
|
for (const p of A.questions) {
|
|
1278
|
-
if (p.ignoreForWeb || e !==
|
|
1289
|
+
if (p.ignoreForWeb || e !== r.All && p.legislature !== r.All && e !== p.legislature)
|
|
1279
1290
|
continue;
|
|
1280
|
-
const
|
|
1291
|
+
const a = i.join(
|
|
1281
1292
|
t,
|
|
1282
1293
|
p.filename.replace(/\.json$/, "_nettoye.json")
|
|
1283
1294
|
);
|
|
1284
|
-
|
|
1285
|
-
const
|
|
1295
|
+
o && console.log(`Loading file: ${a}`);
|
|
1296
|
+
const f = n.readFileSync(a, { encoding: "utf8" }), u = B.toQuestions(f);
|
|
1286
1297
|
for (const c of u.questions)
|
|
1287
1298
|
V[c.uid] === void 0 && (V[c.uid] = c);
|
|
1288
1299
|
}
|
|
1289
1300
|
const $ = {};
|
|
1290
1301
|
if (s & I.ComptesRendusSeances)
|
|
1291
1302
|
for (const p of A.comptesRendusSeances) {
|
|
1292
|
-
if (p.ignoreForWeb || e !==
|
|
1303
|
+
if (p.ignoreForWeb || e !== r.All && p.legislature !== r.All && e !== p.legislature)
|
|
1293
1304
|
continue;
|
|
1294
|
-
const
|
|
1305
|
+
const a = i.join(
|
|
1295
1306
|
t,
|
|
1296
1307
|
p.filename.replace(/\.json$/, "_nettoye.json")
|
|
1297
1308
|
);
|
|
1298
|
-
|
|
1299
|
-
const
|
|
1309
|
+
o && console.log(`Loading file: ${a}`);
|
|
1310
|
+
const f = n.readFileSync(a, { encoding: "utf8" }), u = J.toComptesRendus(f);
|
|
1300
1311
|
for (const c of u.comptesRendus)
|
|
1301
1312
|
$[c.uid] === void 0 && ($[c.uid] = c);
|
|
1302
1313
|
}
|
|
@@ -1305,48 +1316,48 @@ function Ie(t, s, e, { log: r = !1 } = {}) {
|
|
|
1305
1316
|
amendementByUid: F,
|
|
1306
1317
|
documentByUid: v,
|
|
1307
1318
|
dossierParlementaireBySenatChemin: b,
|
|
1308
|
-
dossierParlementaireByTitreChemin:
|
|
1309
|
-
dossierParlementaireByUid:
|
|
1310
|
-
organeByUid:
|
|
1319
|
+
dossierParlementaireByTitreChemin: P,
|
|
1320
|
+
dossierParlementaireByUid: X,
|
|
1321
|
+
organeByUid: m,
|
|
1311
1322
|
photoByUid: O,
|
|
1312
1323
|
reunionByUid: _,
|
|
1313
1324
|
reunionsByDay: j,
|
|
1314
1325
|
reunionsByDossierUid: y,
|
|
1315
|
-
scrutinByUid:
|
|
1326
|
+
scrutinByUid: D,
|
|
1316
1327
|
questionByUid: V,
|
|
1317
1328
|
compteRenduByUid: $
|
|
1318
1329
|
};
|
|
1319
1330
|
}
|
|
1320
1331
|
function be(t, s, e) {
|
|
1321
|
-
const
|
|
1322
|
-
if (!n.pathExistsSync(
|
|
1332
|
+
const o = i.join(t, "Documents"), l = oe(o, s), m = i.join(l, "index.json");
|
|
1333
|
+
if (!n.pathExistsSync(m))
|
|
1323
1334
|
return;
|
|
1324
|
-
const _ = n.readJsonSync(
|
|
1335
|
+
const _ = n.readJsonSync(m);
|
|
1325
1336
|
for (const j of e)
|
|
1326
1337
|
for (const { filename: y, url: F } of _[j] ?? [])
|
|
1327
1338
|
if (y !== void 0)
|
|
1328
1339
|
return { format: j, path: i.join(l, y), url: F };
|
|
1329
1340
|
}
|
|
1330
|
-
function
|
|
1331
|
-
const
|
|
1341
|
+
function Xe(t, s, { log: e = !1 } = {}) {
|
|
1342
|
+
const o = i.join(
|
|
1332
1343
|
t,
|
|
1333
1344
|
`photos_deputes_${// TODO: Handle Legislature.All.
|
|
1334
|
-
s ===
|
|
1345
|
+
s === r.All ? r.DixSept : s}`,
|
|
1335
1346
|
"deputes.json"
|
|
1336
1347
|
);
|
|
1337
|
-
e && console.log(`Loading file: ${
|
|
1338
|
-
const l = n.readFileSync(
|
|
1348
|
+
e && console.log(`Loading file: ${o}`);
|
|
1349
|
+
const l = n.readFileSync(o, { encoding: "utf8" });
|
|
1339
1350
|
return JSON.parse(l);
|
|
1340
1351
|
}
|
|
1341
|
-
function
|
|
1352
|
+
function De(t, { log: s = !1 } = {}) {
|
|
1342
1353
|
const e = i.join(
|
|
1343
1354
|
t,
|
|
1344
1355
|
"photos_senateurs",
|
|
1345
1356
|
"senateurs.json"
|
|
1346
1357
|
);
|
|
1347
1358
|
s && console.log(`Loading file: ${e}`);
|
|
1348
|
-
const
|
|
1349
|
-
return JSON.parse(
|
|
1359
|
+
const o = n.readFileSync(e, { encoding: "utf8" });
|
|
1360
|
+
return JSON.parse(o);
|
|
1350
1361
|
}
|
|
1351
1362
|
function oe(t, s) {
|
|
1352
1363
|
const e = s.match(Y);
|
|
@@ -1355,20 +1366,20 @@ function oe(t, s) {
|
|
|
1355
1366
|
null,
|
|
1356
1367
|
`Unexpected structure for document UID: ${s}`
|
|
1357
1368
|
);
|
|
1358
|
-
const
|
|
1369
|
+
const o = e.groups, l = i.join(
|
|
1359
1370
|
t,
|
|
1360
|
-
|
|
1361
|
-
),
|
|
1362
|
-
|
|
1363
|
-
|
|
1371
|
+
o.documentType ?? o.documentType2
|
|
1372
|
+
), m = i.join(l, o.chambre ?? o.chambre2), _ = i.join(
|
|
1373
|
+
m,
|
|
1374
|
+
o.republique ?? o.republique2
|
|
1364
1375
|
), j = i.join(
|
|
1365
1376
|
_,
|
|
1366
|
-
|
|
1367
|
-
), y =
|
|
1377
|
+
o.legislature ?? o.legislature2
|
|
1378
|
+
), y = o.etat;
|
|
1368
1379
|
if (y === void 0)
|
|
1369
1380
|
return n.ensureDirSync(j), i.join(j, s);
|
|
1370
1381
|
const F = i.join(j, y);
|
|
1371
|
-
let v = "000000" + (
|
|
1382
|
+
let v = "000000" + (o.numero ?? o.numero2);
|
|
1372
1383
|
v = v.substring(v.length - 6);
|
|
1373
1384
|
const b = i.join(F, v.substring(0, 3));
|
|
1374
1385
|
return n.ensureDirSync(b), i.join(b, s);
|
|
@@ -1383,7 +1394,7 @@ function $e(t, s) {
|
|
|
1383
1394
|
null,
|
|
1384
1395
|
`Unexpected structure for reunion UID: ${s}`
|
|
1385
1396
|
);
|
|
1386
|
-
const
|
|
1397
|
+
const o = i.join(t, e[1]), l = i.join(o, e[2]), m = i.join(l, e[3]), _ = i.join(m, e[4]), j = i.join(_, e[5]);
|
|
1387
1398
|
let y = "000000000" + e[6];
|
|
1388
1399
|
y = y.substring(y.length - 9);
|
|
1389
1400
|
const F = i.join(j, y.substring(0, 3)), v = i.join(F, y.substring(3, 3));
|
|
@@ -1396,10 +1407,10 @@ function Le(t, s) {
|
|
|
1396
1407
|
null,
|
|
1397
1408
|
`Unexpected structure for scrutin UID: ${s}`
|
|
1398
1409
|
);
|
|
1399
|
-
const
|
|
1410
|
+
const o = i.join(t, e[1]), l = i.join(o, e[2]), m = i.join(l, e[3]);
|
|
1400
1411
|
let _ = "000000" + e[4];
|
|
1401
1412
|
_ = _.substring(_.length - 6);
|
|
1402
|
-
const j = i.join(
|
|
1413
|
+
const j = i.join(m, _.substring(0, 3));
|
|
1403
1414
|
return n.ensureDirSync(j), i.join(j, s);
|
|
1404
1415
|
}
|
|
1405
1416
|
function xe(t, s) {
|
|
@@ -1412,23 +1423,23 @@ function Pe(t, s) {
|
|
|
1412
1423
|
null,
|
|
1413
1424
|
`Unexpected structure for object with UID: ${s}`
|
|
1414
1425
|
);
|
|
1415
|
-
const
|
|
1426
|
+
const o = i.join(t, e[2]), l = i.join(o, e[3]), m = i.join(l, e[4]), _ = i.join(m, e[5]);
|
|
1416
1427
|
let j = "000000000" + e[7];
|
|
1417
1428
|
j = j.substring(j.length - 9);
|
|
1418
1429
|
const y = i.join(_, j.substring(0, 3)), F = i.join(y, j.substring(3, 3));
|
|
1419
1430
|
return n.ensureDirSync(F), i.join(F, s);
|
|
1420
1431
|
}
|
|
1421
1432
|
function T(t, s, e) {
|
|
1422
|
-
const
|
|
1433
|
+
const o = e.exec(s);
|
|
1423
1434
|
q.notStrictEqual(
|
|
1424
|
-
|
|
1435
|
+
o,
|
|
1425
1436
|
null,
|
|
1426
1437
|
`Unexpected structure for object with UID: ${s}`
|
|
1427
1438
|
);
|
|
1428
|
-
const l = i.join(t,
|
|
1429
|
-
let _ = "000000" +
|
|
1439
|
+
const l = i.join(t, o[1]), m = i.join(l, o[2]);
|
|
1440
|
+
let _ = "000000" + o[3];
|
|
1430
1441
|
_ = _.substring(_.length - 6);
|
|
1431
|
-
const j = i.join(
|
|
1442
|
+
const j = i.join(m, _.substring(0, 3));
|
|
1432
1443
|
return n.ensureDirSync(j), i.join(j, s);
|
|
1433
1444
|
}
|
|
1434
1445
|
export {
|
|
@@ -1446,13 +1457,13 @@ export {
|
|
|
1446
1457
|
ve as loadAssembleeData,
|
|
1447
1458
|
Ie as loadAssembleeDataFromBigFiles,
|
|
1448
1459
|
be as loadAssembleeDocumentFile,
|
|
1449
|
-
|
|
1450
|
-
|
|
1460
|
+
Xe as loadAssembleePhotosDeputes,
|
|
1461
|
+
De as loadAssembleePhotosSenateurs,
|
|
1451
1462
|
Pe as pathFromCompteRenduUid,
|
|
1452
1463
|
oe as pathFromDocumentUid,
|
|
1453
1464
|
Ve as pathFromDossierParlementaireUid,
|
|
1454
1465
|
xe as pathFromQuestionUid,
|
|
1455
1466
|
$e as pathFromReunionUid,
|
|
1456
1467
|
Le as pathFromScrutinUid,
|
|
1457
|
-
|
|
1468
|
+
x as walkDir
|
|
1458
1469
|
};
|