@tricoteuses/assemblee 2.4.2 → 2.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/loaders.js CHANGED
@@ -2,10 +2,10 @@ import Q from "node:assert";
2
2
  import i from "fs-extra";
3
3
  import n from "node:path";
4
4
  import "node:crypto";
5
- import { L as a, a1 as R, a2 as Z, a3 as q, a4 as B, a5 as J, a6 as N, Y as H, $ as Y, a0 as G, X as K, Z as ee, _ as te } from "./uids-DaRrTkI-.js";
6
- import { w as L } from "./file_systems-CzTtoLWb.js";
5
+ import { L as r, a1 as R, a2 as Z, a3 as q, a4 as B, a5 as J, a6 as N, Y, $ as G, a0 as K, X as ee, Z as te, _ as se } from "./uids-DaRrTkI-.js";
6
+ import { w as z } from "./file_systems-CzTtoLWb.js";
7
7
  import { C as w } from "./amendements-40Z7OJLT.js";
8
- var v = /* @__PURE__ */ ((s) => (s[s.None = 0] = "None", s[s.ActeursEtOrganes = 1] = "ActeursEtOrganes", s[s.Agendas = 2] = "Agendas", s[s.Amendements = 4] = "Amendements", s[s.DossiersLegislatifs = 8] = "DossiersLegislatifs", s[s.Photos = 16] = "Photos", s[s.Scrutins = 32] = "Scrutins", s[s.Questions = 64] = "Questions", s[s.ComptesRendusSeances = 128] = "ComptesRendusSeances", s[s.All = 255] = "All", s))(v || {});
8
+ var I = /* @__PURE__ */ ((s) => (s[s.None = 0] = "None", s[s.ActeursEtOrganes = 1] = "ActeursEtOrganes", s[s.Agendas = 2] = "Agendas", s[s.Amendements = 4] = "Amendements", s[s.DossiersLegislatifs = 8] = "DossiersLegislatifs", s[s.Photos = 16] = "Photos", s[s.Scrutins = 32] = "Scrutins", s[s.Questions = 64] = "Questions", s[s.ComptesRendusSeances = 128] = "ComptesRendusSeances", s[s.All = 255] = "All", s))(I || {});
9
9
  function y(s, t) {
10
10
  const e = n.join(t, s.filename);
11
11
  i.existsSync(e) && i.removeSync(e), i.existsSync(n.join(t, "json")) ? i.moveSync(n.join(t, "json"), e) : i.mkdirSync(e);
@@ -35,7 +35,7 @@ const S = {
35
35
  // Il n'apporte donc absolument rien par rapport à AMO20 ou l'AMO30.
36
36
  filename: "AMO10_deputes_actifs_mandats_actifs_organes_XVII.json",
37
37
  ignoreForWeb: !0,
38
- legislature: a.DixSept,
38
+ legislature: r.DixSept,
39
39
  repairZip: y,
40
40
  structure: 1,
41
41
  title: "Députés actifs et organes de la XVIIème législature",
@@ -64,7 +64,7 @@ const S = {
64
64
  // Il n'apporte donc absolument rien par rapport à AMO20 ou l'AMO30.
65
65
  filename: "AMO10_deputes_actifs_mandats_actifs_organes_XVI.json",
66
66
  ignoreForWeb: !0,
67
- legislature: a.Seize,
67
+ legislature: r.Seize,
68
68
  repairZip: y,
69
69
  structure: 1,
70
70
  title: "Députés actifs et organes de la XVIème législature",
@@ -93,7 +93,7 @@ const S = {
93
93
  // Il n'apporte donc absolument rien par rapport à AMO20 ou l'AMO30.
94
94
  filename: "AMO10_deputes_actifs_mandats_actifs_organes_XV.json",
95
95
  ignoreForWeb: !0,
96
- legislature: a.Quinze,
96
+ legislature: r.Quinze,
97
97
  repairZip: y,
98
98
  structure: 1,
99
99
  title: "Députés actifs et organes de la XVème législature",
@@ -122,7 +122,7 @@ const S = {
122
122
  // Il n'apporte donc absolument rien par rapport à l'AMO30.
123
123
  filename: "AMO20_dep_sen_min_tous_mandats_et_organes_XVII.json",
124
124
  ignoreForWeb: !0,
125
- legislature: a.DixSept,
125
+ legislature: r.DixSept,
126
126
  repairZip: y,
127
127
  structure: 1,
128
128
  title: "Acteurs et organes de la XVIIème législature",
@@ -151,7 +151,7 @@ const S = {
151
151
  // Il n'apporte donc absolument rien par rapport à l'AMO30.
152
152
  filename: "AMO20_dep_sen_min_tous_mandats_et_organes_XVI.json",
153
153
  ignoreForWeb: !0,
154
- legislature: a.Seize,
154
+ legislature: r.Seize,
155
155
  repairZip: y,
156
156
  structure: 1,
157
157
  title: "Acteurs et organes de la XVIème législature",
@@ -180,7 +180,7 @@ const S = {
180
180
  // Il n'apporte donc absolument rien par rapport à l'AMO30.
181
181
  filename: "AMO20_dep_sen_min_tous_mandats_et_organes_XV.json",
182
182
  ignoreForWeb: !0,
183
- legislature: a.Quinze,
183
+ legislature: r.Quinze,
184
184
  repairZip: y,
185
185
  structure: 1,
186
186
  title: "Acteurs et organes de la XVème législature",
@@ -199,7 +199,7 @@ const S = {
199
199
  // Il n'apporte donc quasiment rien par rapport à l'AMO30.
200
200
  filename: "AMO20_dep_sen_min_tous_mandats_et_organes_XIV.json",
201
201
  ignoreForWeb: !0,
202
- legislature: a.Quatorze,
202
+ legislature: r.Quatorze,
203
203
  structure: 0,
204
204
  title: "Acteurs et organes de la XIVème législature",
205
205
  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"
@@ -210,7 +210,7 @@ const S = {
210
210
  // Ce fichier contient tous les acteurs et organes.
211
211
  // C'est un sur-ensemble des fichiers AMO20.
212
212
  filename: "AMO30_tous_acteurs_tous_mandats_tous_organes_historique.json",
213
- legislature: a.All,
213
+ legislature: r.All,
214
214
  repairZip: y,
215
215
  structure: 1,
216
216
  title: "Historique de tous les acteurs et organes depuis la XIème législature",
@@ -275,7 +275,7 @@ const S = {
275
275
  // précédentes.
276
276
  filename: "AMO40_deputes_actifs_mandats_actifs_organes_divises_XVII.json",
277
277
  ignoreForWeb: !0,
278
- legislature: a.DixSept,
278
+ legislature: r.DixSept,
279
279
  repairZip: (s, t) => {
280
280
  const e = n.join(t, s.filename);
281
281
  i.existsSync(e) && i.removeSync(e), i.mkdirSync(e), i.pathExistsSync(n.join(t, "acteur")) && i.moveSync(
@@ -317,7 +317,7 @@ const S = {
317
317
  // précédentes.
318
318
  filename: "AMO40_deputes_actifs_mandats_actifs_organes_divises_XVI.json",
319
319
  ignoreForWeb: !0,
320
- legislature: a.Seize,
320
+ legislature: r.Seize,
321
321
  repairZip: (s, t) => {
322
322
  const e = n.join(t, s.filename);
323
323
  i.existsSync(e) && i.removeSync(e), i.mkdirSync(e), i.pathExistsSync(n.join(t, "acteur")) && i.moveSync(
@@ -359,7 +359,7 @@ const S = {
359
359
  // précédentes.
360
360
  filename: "AMO40_deputes_actifs_mandats_actifs_organes_divises_XV.json",
361
361
  ignoreForWeb: !0,
362
- legislature: a.Quinze,
362
+ legislature: r.Quinze,
363
363
  repairZip: (s, t) => {
364
364
  const e = n.join(t, s.filename);
365
365
  i.existsSync(e) && i.removeSync(e), i.mkdirSync(e), i.moveSync(
@@ -391,7 +391,7 @@ const S = {
391
391
  // dont il est un sous ensemble obsolète.
392
392
  filename: "AMO50_acteurs_mandats_organes_divises_XVII.json",
393
393
  ignoreForWeb: !0,
394
- legislature: a.DixSept,
394
+ legislature: r.DixSept,
395
395
  repairZip: (s, t) => {
396
396
  const e = n.join(t, s.filename);
397
397
  i.existsSync(e) && i.removeSync(e), i.mkdirSync(e), i.moveSync(
@@ -426,7 +426,7 @@ const S = {
426
426
  // dont il est un sous ensemble obsolète.
427
427
  filename: "AMO50_acteurs_mandats_organes_divises_XVI.json",
428
428
  ignoreForWeb: !0,
429
- legislature: a.Seize,
429
+ legislature: r.Seize,
430
430
  repairZip: (s, t) => {
431
431
  const e = n.join(t, s.filename);
432
432
  i.existsSync(e) && i.removeSync(e), i.mkdirSync(e), i.moveSync(
@@ -461,7 +461,7 @@ const S = {
461
461
  // dont il est un sous ensemble obsolète.
462
462
  filename: "AMO50_acteurs_mandats_organes_divises_XV.json",
463
463
  ignoreForWeb: !0,
464
- legislature: a.Quinze,
464
+ legislature: r.Quinze,
465
465
  repairZip: (s, t) => {
466
466
  const e = n.join(t, s.filename);
467
467
  i.existsSync(e) && i.removeSync(e), i.mkdirSync(e), i.moveSync(
@@ -483,7 +483,7 @@ const S = {
483
483
  agendas: [
484
484
  {
485
485
  filename: "Agenda_XVII.json",
486
- legislature: a.DixSept,
486
+ legislature: r.DixSept,
487
487
  repairZip: y,
488
488
  structure: 1,
489
489
  title: "Agenda de la XVIIème législature",
@@ -491,7 +491,7 @@ const S = {
491
491
  },
492
492
  {
493
493
  filename: "Agenda_XVI.json",
494
- legislature: a.Seize,
494
+ legislature: r.Seize,
495
495
  repairZip: y,
496
496
  structure: 1,
497
497
  title: "Agenda de la XVIème législature",
@@ -499,7 +499,7 @@ const S = {
499
499
  },
500
500
  {
501
501
  filename: "Agenda_XV.json",
502
- legislature: a.Quinze,
502
+ legislature: r.Quinze,
503
503
  repairZip: y,
504
504
  structure: 1,
505
505
  title: "Agenda de la XVème législature",
@@ -507,7 +507,7 @@ const S = {
507
507
  },
508
508
  {
509
509
  filename: "Agenda_XIV.json",
510
- legislature: a.Quatorze,
510
+ legislature: r.Quatorze,
511
511
  structure: 0,
512
512
  title: "Agenda de la XIVème législature",
513
513
  url: "https://data.assemblee-nationale.fr/static/openData/repository/14/vp/reunions/Agenda_XIV.json.zip"
@@ -516,7 +516,7 @@ const S = {
516
516
  amendements: [
517
517
  {
518
518
  filename: "Amendements_XVII.json",
519
- legislature: a.DixSept,
519
+ legislature: r.DixSept,
520
520
  repairZip: y,
521
521
  structure: 1,
522
522
  title: "Amendements de la XVIIème législature",
@@ -524,7 +524,7 @@ const S = {
524
524
  },
525
525
  {
526
526
  filename: "Amendements_XVI.json",
527
- legislature: a.Seize,
527
+ legislature: r.Seize,
528
528
  repairZip: y,
529
529
  structure: 1,
530
530
  title: "Amendements de la XVIème législature",
@@ -532,7 +532,7 @@ const S = {
532
532
  },
533
533
  {
534
534
  filename: "Amendements_XV.json",
535
- legislature: a.Quinze,
535
+ legislature: r.Quinze,
536
536
  repairZip: y,
537
537
  structure: 1,
538
538
  title: "Amendements de la XVème législature",
@@ -551,7 +551,7 @@ const S = {
551
551
  dossiersLegislatifs: [
552
552
  {
553
553
  filename: "Dossiers_Legislatifs_XVII.json",
554
- legislature: a.DixSept,
554
+ legislature: r.DixSept,
555
555
  repairZip: y,
556
556
  structure: 1,
557
557
  title: "Dossiers législatifs de la XVIIème législature",
@@ -559,7 +559,7 @@ const S = {
559
559
  },
560
560
  {
561
561
  filename: "Dossiers_Legislatifs_XVI.json",
562
- legislature: a.Seize,
562
+ legislature: r.Seize,
563
563
  repairZip: y,
564
564
  structure: 1,
565
565
  title: "Dossiers législatifs de la XVIème législature",
@@ -567,7 +567,7 @@ const S = {
567
567
  },
568
568
  {
569
569
  filename: "Dossiers_Legislatifs_XV.json",
570
- legislature: a.Quinze,
570
+ legislature: r.Quinze,
571
571
  repairZip: y,
572
572
  structure: 1,
573
573
  title: "Dossiers législatifs de la XVème législature",
@@ -575,7 +575,7 @@ const S = {
575
575
  },
576
576
  {
577
577
  filename: "Dossiers_Legislatifs_XIV.json",
578
- legislature: a.Quatorze,
578
+ legislature: r.Quatorze,
579
579
  structure: 0,
580
580
  title: "Dossiers législatifs de la XIVème législature",
581
581
  url: "https://data.assemblee-nationale.fr/static/openData/repository/14/loi/dossiers_legislatifs/Dossiers_Legislatifs_XIV.json.zip"
@@ -584,7 +584,7 @@ const S = {
584
584
  scrutins: [
585
585
  {
586
586
  filename: "Scrutins_XVII.json",
587
- legislature: a.DixSept,
587
+ legislature: r.DixSept,
588
588
  repairZip: y,
589
589
  structure: 1,
590
590
  title: "Scrutins de la XVIIème législature",
@@ -592,7 +592,7 @@ const S = {
592
592
  },
593
593
  {
594
594
  filename: "Scrutins_XVI.json",
595
- legislature: a.Seize,
595
+ legislature: r.Seize,
596
596
  repairZip: y,
597
597
  structure: 1,
598
598
  title: "Scrutins de la XVIème législature",
@@ -600,7 +600,7 @@ const S = {
600
600
  },
601
601
  {
602
602
  filename: "Scrutins_XV.json",
603
- legislature: a.Quinze,
603
+ legislature: r.Quinze,
604
604
  repairZip: y,
605
605
  structure: 1,
606
606
  title: "Scrutins de la XVème législature",
@@ -608,7 +608,7 @@ const S = {
608
608
  },
609
609
  {
610
610
  filename: "Scrutins_XIV.json",
611
- legislature: a.Quatorze,
611
+ legislature: r.Quatorze,
612
612
  structure: 0,
613
613
  title: "Scrutins de la XIVème législature",
614
614
  url: "https://data.assemblee-nationale.fr/static/openData/repository/14/loi/scrutins/Scrutins_XIV.json.zip"
@@ -617,7 +617,7 @@ const S = {
617
617
  questions: [
618
618
  {
619
619
  filename: "Questions_ecrites_XVII.json",
620
- legislature: a.DixSept,
620
+ legislature: r.DixSept,
621
621
  repairZip: y,
622
622
  structure: 1,
623
623
  title: "Questions écrites de la XVIIème législature",
@@ -625,7 +625,7 @@ const S = {
625
625
  },
626
626
  {
627
627
  filename: "Questions_ecrites_XVI.json",
628
- legislature: a.Seize,
628
+ legislature: r.Seize,
629
629
  repairZip: y,
630
630
  structure: 1,
631
631
  title: "Questions écrites de la XVIème législature",
@@ -633,7 +633,7 @@ const S = {
633
633
  },
634
634
  {
635
635
  filename: "Questions_gouvernement_XVII.json",
636
- legislature: a.DixSept,
636
+ legislature: r.DixSept,
637
637
  repairZip: y,
638
638
  structure: 1,
639
639
  title: "Questions au gouvernement de la XVIIème législature",
@@ -641,7 +641,7 @@ const S = {
641
641
  },
642
642
  {
643
643
  filename: "Questions_gouvernement_XVI.json",
644
- legislature: a.Seize,
644
+ legislature: r.Seize,
645
645
  repairZip: y,
646
646
  structure: 1,
647
647
  title: "Questions au gouvernement de la XVIème législature",
@@ -649,7 +649,7 @@ const S = {
649
649
  },
650
650
  {
651
651
  filename: "Questions_orales_XVII.json",
652
- legislature: a.DixSept,
652
+ legislature: r.DixSept,
653
653
  repairZip: y,
654
654
  structure: 1,
655
655
  title: "Questions orales sans débats de la XVIIème législature",
@@ -657,7 +657,7 @@ const S = {
657
657
  },
658
658
  {
659
659
  filename: "Questions_orales_XVI.json",
660
- legislature: a.Seize,
660
+ legislature: r.Seize,
661
661
  repairZip: y,
662
662
  structure: 1,
663
663
  title: "Questions orales sans débats de la XVIème législature",
@@ -667,7 +667,7 @@ const S = {
667
667
  comptesRendusSeances: [
668
668
  {
669
669
  filename: "Comptes_Rendus_Seances_XVII.xml",
670
- legislature: a.DixSept,
670
+ legislature: r.DixSept,
671
671
  repairZip: (s, t) => {
672
672
  const e = n.join(t, s.filename);
673
673
  i.existsSync(e) && i.removeSync(e), i.moveSync(n.join(t, "xml"), e);
@@ -678,7 +678,7 @@ const S = {
678
678
  },
679
679
  {
680
680
  filename: "Comptes_Rendus_Seances_XVI.xml",
681
- legislature: a.Seize,
681
+ legislature: r.Seize,
682
682
  repairZip: (s, t) => {
683
683
  const e = n.join(t, s.filename);
684
684
  i.existsSync(e) && i.removeSync(e), i.moveSync(n.join(t, "xml"), e);
@@ -716,7 +716,7 @@ const S = {
716
716
  1,
717
717
  "I"
718
718
  ];
719
- function se(s) {
719
+ function ne(s) {
720
720
  if (s < 0)
721
721
  return;
722
722
  if (s === 0)
@@ -727,41 +727,44 @@ function se(s) {
727
727
  t += W[e + 1], s -= W[e];
728
728
  return t;
729
729
  }
730
- function* P(s, t, e, r, d, f = "json", { noValidation: _ = !1, log: g = !1 } = {}) {
731
- const j = /* @__PURE__ */ new Set();
732
- for (const A of e) {
733
- if (A.ignoreForWeb || !ne(t, A))
730
+ function* $(s, t, e, a, l, d = "json", { enriched: _ = !1, log: j = !1, noValidation: h = !1 } = {}) {
731
+ const F = /* @__PURE__ */ new Set();
732
+ for (const v of e) {
733
+ if (v.ignoreForWeb || !ie(t, v))
734
734
  continue;
735
- const F = new RegExp(`\\.${f}$`), I = n.join(
735
+ const b = new RegExp(`\\.${d}$`), P = n.join(
736
736
  s,
737
- A.filename.replace(F, "_nettoye")
737
+ v.filename.replace(
738
+ b,
739
+ _ ? "_enrichi" : "_nettoye"
740
+ )
738
741
  );
739
- for (const D of L(I, d)) {
742
+ for (const D of z(P, l)) {
740
743
  if (!D[D.length - 1].endsWith(".json"))
741
744
  continue;
742
- const x = n.join(I, ...D);
743
- g && console.log(`Loading file: ${x}…`);
744
- let X = i.readFileSync(x, { encoding: "utf8" });
745
- const V = _ ? JSON.parse(X) : r(X);
746
- j.has(V.uid) || (j.add(V.uid), yield {
747
- datasetLegislature: A.legislature,
748
- filePath: x,
749
- item: V
750
- }, X = null);
745
+ const X = n.join(P, ...D);
746
+ j && console.log(`Loading file: ${X}…`);
747
+ let V = i.readFileSync(X, { encoding: "utf8" });
748
+ const L = h ? JSON.parse(V) : a(V);
749
+ F.has(L.uid) || (F.add(L.uid), yield {
750
+ datasetLegislature: v.legislature,
751
+ filePath: X,
752
+ item: L
753
+ }, V = null);
751
754
  }
752
755
  }
753
- j.clear();
756
+ F.clear();
754
757
  }
755
- function ne(s, t) {
758
+ function ie(s, t) {
756
759
  const e = Array.isArray(s) ? s : s !== void 0 ? [s] : [];
757
- return s === void 0 || e.includes(0) || t.legislature === a.All ? !0 : e.includes(t.legislature);
760
+ return s === void 0 || e.includes(0) || t.legislature === r.All ? !0 : e.includes(t.legislature);
758
761
  }
759
- function* me(s, t, e = {}) {
762
+ function* de(s, t, e = {}) {
760
763
  for (const {
761
- datasetLegislature: r,
762
- item: d,
763
- filePath: f
764
- } of P(
764
+ datasetLegislature: a,
765
+ item: l,
766
+ filePath: d
767
+ } of $(
765
768
  s,
766
769
  t,
767
770
  S.acteursEtOrganes,
@@ -770,14 +773,14 @@ function* me(s, t, e = {}) {
770
773
  "json",
771
774
  e
772
775
  ))
773
- yield { acteur: d, datasetLegislature: r, filePath: f };
776
+ yield { acteur: l, datasetLegislature: a, filePath: d };
774
777
  }
775
- function* fe(s, t, e = {}) {
778
+ function* pe(s, t, e = {}) {
776
779
  for (const {
777
- item: r,
778
- datasetLegislature: d,
779
- filePath: f
780
- } of P(
780
+ item: a,
781
+ datasetLegislature: l,
782
+ filePath: d
783
+ } of $(
781
784
  s,
782
785
  t,
783
786
  S.acteursEtOrganes,
@@ -786,14 +789,14 @@ function* fe(s, t, e = {}) {
786
789
  "json",
787
790
  e
788
791
  ))
789
- yield { organe: r, datasetLegislature: d, filePath: f };
792
+ yield { organe: a, datasetLegislature: l, filePath: d };
790
793
  }
791
- function* pe(s, t, e = {}) {
794
+ function* ge(s, t, e = {}) {
792
795
  for (const {
793
- datasetLegislature: r,
794
- item: d,
795
- filePath: f
796
- } of P(
796
+ datasetLegislature: a,
797
+ item: l,
798
+ filePath: d
799
+ } of $(
797
800
  s,
798
801
  t,
799
802
  S.amendements,
@@ -802,14 +805,14 @@ function* pe(s, t, e = {}) {
802
805
  "json",
803
806
  e
804
807
  ))
805
- yield { amendement: d, datasetLegislature: r, filePath: f };
808
+ yield { amendement: l, datasetLegislature: a, filePath: d };
806
809
  }
807
- function* ge(s, t, e = {}) {
810
+ function* _e(s, t, e = {}) {
808
811
  for (const {
809
- item: r,
810
- datasetLegislature: d,
811
- filePath: f
812
- } of P(
812
+ item: a,
813
+ datasetLegislature: l,
814
+ filePath: d
815
+ } of $(
813
816
  s,
814
817
  t,
815
818
  S.dossiersLegislatifs,
@@ -818,14 +821,14 @@ function* ge(s, t, e = {}) {
818
821
  "json",
819
822
  e
820
823
  ))
821
- yield { document: r, datasetLegislature: d, filePath: f };
824
+ yield { document: a, datasetLegislature: l, filePath: d };
822
825
  }
823
- function* _e(s, t, e = {}) {
826
+ function* je(s, t, e = {}) {
824
827
  for (const {
825
- item: r,
826
- datasetLegislature: d,
827
- filePath: f
828
- } of P(
828
+ item: a,
829
+ datasetLegislature: l,
830
+ filePath: d
831
+ } of $(
829
832
  s,
830
833
  t,
831
834
  S.dossiersLegislatifs,
@@ -834,14 +837,14 @@ function* _e(s, t, e = {}) {
834
837
  "json",
835
838
  e
836
839
  ))
837
- yield { dossierParlementaire: r, datasetLegislature: d, filePath: f };
840
+ yield { dossierParlementaire: a, datasetLegislature: l, filePath: d };
838
841
  }
839
- function* je(s, t, e = {}) {
842
+ function* ye(s, t, e = {}) {
840
843
  for (const {
841
- item: r,
842
- datasetLegislature: d,
843
- filePath: f
844
- } of P(
844
+ item: a,
845
+ datasetLegislature: l,
846
+ filePath: d
847
+ } of $(
845
848
  s,
846
849
  t,
847
850
  S.agendas,
@@ -850,14 +853,14 @@ function* je(s, t, e = {}) {
850
853
  "json",
851
854
  e
852
855
  ))
853
- yield { reunion: r, datasetLegislature: d, filePath: f };
856
+ yield { reunion: a, datasetLegislature: l, filePath: d };
854
857
  }
855
- function* ye(s, t, e = {}) {
858
+ function* he(s, t, e = {}) {
856
859
  for (const {
857
- item: r,
858
- datasetLegislature: d,
859
- filePath: f
860
- } of P(
860
+ item: a,
861
+ datasetLegislature: l,
862
+ filePath: d
863
+ } of $(
861
864
  s,
862
865
  t,
863
866
  S.scrutins,
@@ -866,14 +869,14 @@ function* ye(s, t, e = {}) {
866
869
  "json",
867
870
  e
868
871
  ))
869
- yield { scrutin: r, datasetLegislature: d, filePath: f };
872
+ yield { scrutin: a, datasetLegislature: l, filePath: d };
870
873
  }
871
- function* he(s, t, e = {}) {
874
+ function* Se(s, t, e = {}) {
872
875
  for (const {
873
- item: r,
874
- datasetLegislature: d,
875
- filePath: f
876
- } of P(
876
+ item: a,
877
+ datasetLegislature: l,
878
+ filePath: d
879
+ } of $(
877
880
  s,
878
881
  t,
879
882
  S.questions,
@@ -882,14 +885,14 @@ function* he(s, t, e = {}) {
882
885
  "json",
883
886
  e
884
887
  ))
885
- yield { question: r, datasetLegislature: d, filePath: f };
888
+ yield { question: a, datasetLegislature: l, filePath: d };
886
889
  }
887
- function* Se(s, t, e = {}) {
890
+ function* Ae(s, t, e = {}) {
888
891
  for (const {
889
- item: r,
890
- datasetLegislature: d,
891
- filePath: f
892
- } of P(
892
+ item: a,
893
+ datasetLegislature: l,
894
+ filePath: d
895
+ } of $(
893
896
  s,
894
897
  t,
895
898
  S.comptesRendusSeances,
@@ -898,21 +901,21 @@ function* Se(s, t, e = {}) {
898
901
  "xml",
899
902
  e
900
903
  ))
901
- yield { compteRendu: r, datasetLegislature: d, filePath: f };
904
+ yield { compteRendu: a, datasetLegislature: l, filePath: d };
902
905
  }
903
- function* Ae(s, t) {
904
- const e = `Comptes_Rendus_Commissions_${se(t)}_nettoye`, r = n.join(s, e);
905
- if (i.existsSync(r))
906
- for (const d of T(r))
906
+ function* Fe(s, t, { enriched: e = !1 } = {}) {
907
+ const a = `Comptes_Rendus_Commissions_${ne(t)}${e ? "_enrichi" : "_nettoye"}`, l = n.join(s, a);
908
+ if (i.existsSync(l))
909
+ for (const d of T(l))
907
910
  try {
908
- const f = i.readFileSync(d, "utf-8");
911
+ const _ = i.readFileSync(d, "utf-8");
909
912
  yield {
910
- compteRendu: JSON.parse(f),
913
+ compteRendu: JSON.parse(_),
911
914
  datasetLegislature: t,
912
915
  filePath: d
913
916
  };
914
- } catch (f) {
915
- console.warn(`Erreur lors de la lecture du fichier ${d} :`, f);
917
+ } catch (_) {
918
+ console.warn(`Erreur lors de la lecture du fichier ${d} :`, _);
916
919
  }
917
920
  }
918
921
  function* T(s) {
@@ -922,131 +925,131 @@ function* T(s) {
922
925
  t.isDirectory() ? yield* T(e) : t.isFile() && e.endsWith(".json") && (yield e);
923
926
  }
924
927
  }
925
- function Fe(s, t, e, { log: r = !1 } = {}) {
926
- const d = {}, f = {};
927
- if (t & v.ActeursEtOrganes)
928
+ function ve(s, t, e, { enriched: a = !1, log: l = !1 } = {}) {
929
+ const d = {}, _ = {};
930
+ if (t & I.ActeursEtOrganes)
928
931
  for (const o of S.acteursEtOrganes) {
929
- if (o.ignoreForWeb || e !== a.All && o.legislature !== a.All && e !== o.legislature)
932
+ if (o.ignoreForWeb || e !== r.All && o.legislature !== r.All && e !== o.legislature)
930
933
  continue;
931
- const u = n.join(
934
+ const m = n.join(
932
935
  s,
933
- o.filename.replace(/\.json$/, "_nettoye")
936
+ o.filename.replace(/\.json$/, a ? "_enrichi" : "_nettoye")
934
937
  );
935
- for (const c of L(u, ["acteurs"])) {
936
- if (!c[c.length - 1].endsWith(".json"))
938
+ for (const u of z(m, ["acteurs"])) {
939
+ if (!u[u.length - 1].endsWith(".json"))
937
940
  continue;
938
- const l = n.join(u, ...c);
939
- r && console.log(`Loading file: ${l}…`);
940
- const p = i.readFileSync(l, {
941
+ const g = n.join(m, ...u);
942
+ l && console.log(`Loading file: ${g}…`);
943
+ const A = i.readFileSync(g, {
941
944
  encoding: "utf8"
942
- }), m = R.toActeur(p);
943
- d[m.uid] === void 0 && (d[m.uid] = m);
945
+ }), f = R.toActeur(A);
946
+ d[f.uid] === void 0 && (d[f.uid] = f);
944
947
  }
945
- for (const c of L(u, ["organes"])) {
946
- if (!c[c.length - 1].endsWith(".json"))
948
+ for (const u of z(m, ["organes"])) {
949
+ if (!u[u.length - 1].endsWith(".json"))
947
950
  continue;
948
- const l = n.join(u, ...c);
949
- r && console.log(`Loading file: ${l}…`);
950
- const p = i.readFileSync(l, {
951
+ const g = n.join(m, ...u);
952
+ l && console.log(`Loading file: ${g}…`);
953
+ const A = i.readFileSync(g, {
951
954
  encoding: "utf8"
952
- }), m = R.toOrgane(p);
953
- f[m.uid] === void 0 && (f[m.uid] = m);
955
+ }), f = R.toOrgane(A);
956
+ _[f.uid] === void 0 && (_[f.uid] = f);
954
957
  }
955
958
  }
956
- const _ = {}, g = {}, j = {};
957
- if (t & v.Agendas)
959
+ const j = {}, h = {}, F = {};
960
+ if (t & I.Agendas)
958
961
  for (const o of S.agendas) {
959
- if (o.ignoreForWeb || e !== a.All && o.legislature !== a.All && e !== o.legislature)
962
+ if (o.ignoreForWeb || e !== r.All && o.legislature !== r.All && e !== o.legislature)
960
963
  continue;
961
- const u = n.join(
964
+ const m = n.join(
962
965
  s,
963
- o.filename.replace(/\.json$/, "_nettoye")
966
+ o.filename.replace(/\.json$/, a ? "_enrichi" : "_nettoye")
964
967
  );
965
- for (const c of L(u)) {
966
- if (!c[c.length - 1].endsWith(".json"))
968
+ for (const u of z(m)) {
969
+ if (!u[u.length - 1].endsWith(".json"))
967
970
  continue;
968
- const l = n.join(u, ...c);
969
- r && console.log(`Loading file: ${l}…`);
970
- const p = i.readFileSync(l, {
971
+ const g = n.join(m, ...u);
972
+ l && console.log(`Loading file: ${g}…`);
973
+ const A = i.readFileSync(g, {
971
974
  encoding: "utf8"
972
- }), m = Z.toReunion(p);
973
- _[m.uid] === void 0 && (_[m.uid] = m);
974
- const b = m.timestampDebut.toISOString().split("T")[0];
975
- let $ = g[b];
976
- $ === void 0 && ($ = g[b] = []), $.push(m);
977
- const U = m.odj;
978
- if (U !== void 0)
979
- for (const C of U.pointsOdj || [])
980
- for (const k of C.dossiersLegislatifsRefs || []) {
981
- let M = j[k];
982
- M === void 0 && (M = j[k] = []), M.push(m);
975
+ }), f = Z.toReunion(A);
976
+ j[f.uid] === void 0 && (j[f.uid] = f);
977
+ const x = f.timestampDebut.toISOString().split("T")[0];
978
+ let U = h[x];
979
+ U === void 0 && (U = h[x] = []), U.push(f);
980
+ const C = f.odj;
981
+ if (C !== void 0)
982
+ for (const H of C.pointsOdj || [])
983
+ for (const k of H.dossiersLegislatifsRefs || []) {
984
+ let M = F[k];
985
+ M === void 0 && (M = F[k] = []), M.push(f);
983
986
  }
984
987
  }
985
988
  }
986
- const A = {};
987
- if (t & v.Amendements)
989
+ const v = {};
990
+ if (t & I.Amendements)
988
991
  for (const o of S.amendements) {
989
- if (o.ignoreForWeb || e !== a.All && o.legislature !== a.All && e !== o.legislature)
992
+ if (o.ignoreForWeb || e !== r.All && o.legislature !== r.All && e !== o.legislature)
990
993
  continue;
991
- const u = n.join(
994
+ const m = n.join(
992
995
  s,
993
- o.filename.replace(/\.json$/, "_nettoye")
996
+ o.filename.replace(/\.json$/, a ? "_enrichi" : "_nettoye")
994
997
  );
995
- for (const c of L(u)) {
996
- if (!c[c.length - 1].endsWith(".json"))
998
+ for (const u of z(m)) {
999
+ if (!u[u.length - 1].endsWith(".json"))
997
1000
  continue;
998
- const l = n.join(u, ...c);
999
- r && console.log(`Loading file: ${l}…`);
1000
- const p = i.readFileSync(l, {
1001
+ const g = n.join(m, ...u);
1002
+ l && console.log(`Loading file: ${g}…`);
1003
+ const A = i.readFileSync(g, {
1001
1004
  encoding: "utf8"
1002
- }), m = w.toAmendement(p);
1003
- A[m.uid] === void 0 && (A[m.uid] = m);
1005
+ }), f = w.toAmendement(A);
1006
+ v[f.uid] === void 0 && (v[f.uid] = f);
1004
1007
  }
1005
1008
  }
1006
- const F = {}, I = {}, D = {}, z = {};
1007
- if (t & v.DossiersLegislatifs)
1009
+ const b = {}, P = {}, D = {}, O = {};
1010
+ if (t & I.DossiersLegislatifs)
1008
1011
  for (const o of S.dossiersLegislatifs) {
1009
- if (o.ignoreForWeb || e !== a.All && o.legislature !== a.All && e !== o.legislature)
1012
+ if (o.ignoreForWeb || e !== r.All && o.legislature !== r.All && e !== o.legislature)
1010
1013
  continue;
1011
- const u = n.join(
1014
+ const m = n.join(
1012
1015
  s,
1013
- o.filename.replace(/\.json$/, "_nettoye")
1016
+ o.filename.replace(/\.json$/, a ? "_enrichi" : "_nettoye")
1014
1017
  );
1015
- for (const c of L(u, ["documents"])) {
1016
- if (!c[c.length - 1].endsWith(".json"))
1018
+ for (const u of z(m, ["documents"])) {
1019
+ if (!u[u.length - 1].endsWith(".json"))
1017
1020
  continue;
1018
- const l = n.join(u, ...c);
1019
- r && console.log(`Loading file: ${l}…`);
1020
- const p = i.readFileSync(l, {
1021
+ const g = n.join(m, ...u);
1022
+ l && console.log(`Loading file: ${g}…`);
1023
+ const A = i.readFileSync(g, {
1021
1024
  encoding: "utf8"
1022
- }), m = q.toDocument(p);
1023
- F[m.uid] === void 0 && (F[m.uid] = m);
1025
+ }), f = q.toDocument(A);
1026
+ b[f.uid] === void 0 && (b[f.uid] = f);
1024
1027
  }
1025
- for (const c of L(u, ["dossiers"])) {
1026
- if (!c[c.length - 1].endsWith(".json"))
1028
+ for (const u of z(m, ["dossiers"])) {
1029
+ if (!u[u.length - 1].endsWith(".json"))
1027
1030
  continue;
1028
- const l = n.join(u, ...c);
1029
- r && console.log(`Loading file: ${l}…`);
1030
- const p = i.readFileSync(l, {
1031
+ const g = n.join(m, ...u);
1032
+ l && console.log(`Loading file: ${g}…`);
1033
+ const A = i.readFileSync(g, {
1031
1034
  encoding: "utf8"
1032
- }), m = q.toDossierParlementaire(p), b = m.titreDossier;
1033
- b.senatChemin && I[b.senatChemin] === void 0 && (I[b.senatChemin] = m), b.titreChemin && D[b.titreChemin] === void 0 && (D[b.titreChemin] = m), z[m.uid] === void 0 && (z[m.uid] = m);
1035
+ }), f = q.toDossierParlementaire(A), x = f.titreDossier;
1036
+ x.senatChemin && P[x.senatChemin] === void 0 && (P[x.senatChemin] = f), x.titreChemin && D[x.titreChemin] === void 0 && (D[x.titreChemin] = f), O[f.uid] === void 0 && (O[f.uid] = f);
1034
1037
  }
1035
1038
  }
1036
- let x = {};
1037
- if (t & v.Photos) {
1039
+ let X = {};
1040
+ if (t & I.Photos) {
1038
1041
  {
1039
1042
  const o = n.join(
1040
1043
  s,
1041
1044
  `photos_deputes_${// TODO: Handle Legislature.All.
1042
- e === a.All ? a.DixSept : e}`,
1045
+ e === r.All ? r.DixSept : e}`,
1043
1046
  "deputes.json"
1044
1047
  );
1045
1048
  if (i.existsSync(o)) {
1046
- r && console.log(`Loading file: ${o}`);
1047
- const u = i.readFileSync(o, { encoding: "utf8" });
1048
- Object.assign(x, JSON.parse(u));
1049
- } else r && console.log(`Ignoring missing file: ${o}`);
1049
+ l && console.log(`Loading file: ${o}`);
1050
+ const m = i.readFileSync(o, { encoding: "utf8" });
1051
+ Object.assign(X, JSON.parse(m));
1052
+ } else l && console.log(`Ignoring missing file: ${o}`);
1050
1053
  }
1051
1054
  {
1052
1055
  const o = n.join(
@@ -1055,388 +1058,388 @@ function Fe(s, t, e, { log: r = !1 } = {}) {
1055
1058
  "senateurs.json"
1056
1059
  );
1057
1060
  if (i.existsSync(o)) {
1058
- r && console.log(`Loading file: ${o}`);
1059
- const u = i.readFileSync(o, { encoding: "utf8" });
1060
- Object.assign(x, JSON.parse(u));
1061
- } else r && console.log(`Ignoring missing file: ${o}`);
1061
+ l && console.log(`Loading file: ${o}`);
1062
+ const m = i.readFileSync(o, { encoding: "utf8" });
1063
+ Object.assign(X, JSON.parse(m));
1064
+ } else l && console.log(`Ignoring missing file: ${o}`);
1062
1065
  }
1063
1066
  }
1064
- const X = {};
1065
- if (t & v.Scrutins)
1067
+ const V = {};
1068
+ if (t & I.Scrutins)
1066
1069
  for (const o of S.scrutins) {
1067
- if (o.ignoreForWeb || e !== a.All && o.legislature !== a.All && e !== o.legislature)
1070
+ if (o.ignoreForWeb || e !== r.All && o.legislature !== r.All && e !== o.legislature)
1068
1071
  continue;
1069
- const u = n.join(
1072
+ const m = n.join(
1070
1073
  s,
1071
- o.filename.replace(/\.json$/, "_nettoye")
1074
+ o.filename.replace(/\.json$/, a ? "_enrichi" : "_nettoye")
1072
1075
  );
1073
- for (const c of L(u)) {
1074
- if (!c[c.length - 1].endsWith(".json"))
1076
+ for (const u of z(m)) {
1077
+ if (!u[u.length - 1].endsWith(".json"))
1075
1078
  continue;
1076
- const l = n.join(u, ...c);
1077
- r && console.log(`Loading file: ${l}…`);
1078
- const p = i.readFileSync(l, {
1079
+ const g = n.join(m, ...u);
1080
+ l && console.log(`Loading file: ${g}…`);
1081
+ const A = i.readFileSync(g, {
1079
1082
  encoding: "utf8"
1080
- }), m = B.toScrutin(p);
1081
- X[m.uid] === void 0 && (X[m.uid] = m);
1083
+ }), f = B.toScrutin(A);
1084
+ V[f.uid] === void 0 && (V[f.uid] = f);
1082
1085
  }
1083
1086
  }
1084
- const V = {};
1085
- if (t & v.Questions)
1087
+ const L = {};
1088
+ if (t & I.Questions)
1086
1089
  for (const o of S.questions) {
1087
- if (o.ignoreForWeb || e !== a.All && o.legislature !== a.All && e !== o.legislature)
1090
+ if (o.ignoreForWeb || e !== r.All && o.legislature !== r.All && e !== o.legislature)
1088
1091
  continue;
1089
- const u = n.join(
1092
+ const m = n.join(
1090
1093
  s,
1091
- o.filename.replace(/\.json$/, "_nettoye")
1094
+ o.filename.replace(/\.json$/, a ? "_enrichi" : "_nettoye")
1092
1095
  );
1093
- for (const c of L(u)) {
1094
- if (!c[c.length - 1].endsWith(".json"))
1096
+ for (const u of z(m)) {
1097
+ if (!u[u.length - 1].endsWith(".json"))
1095
1098
  continue;
1096
- const l = n.join(u, ...c);
1097
- r && console.log(`Loading file: ${l}…`);
1098
- const p = i.readFileSync(l, {
1099
+ const g = n.join(m, ...u);
1100
+ l && console.log(`Loading file: ${g}…`);
1101
+ const A = i.readFileSync(g, {
1099
1102
  encoding: "utf8"
1100
- }), m = J.toQuestion(p);
1101
- V[m.uid] === void 0 && (V[m.uid] = m);
1103
+ }), f = J.toQuestion(A);
1104
+ L[f.uid] === void 0 && (L[f.uid] = f);
1102
1105
  }
1103
1106
  }
1104
- const O = {};
1105
- if (t & v.ComptesRendusSeances)
1107
+ const p = {};
1108
+ if (t & I.ComptesRendusSeances)
1106
1109
  for (const o of S.comptesRendusSeances) {
1107
- if (o.ignoreForWeb || e !== a.All && o.legislature !== a.All && e !== o.legislature)
1110
+ if (o.ignoreForWeb || e !== r.All && o.legislature !== r.All && e !== o.legislature)
1108
1111
  continue;
1109
- const u = n.join(
1112
+ const m = n.join(
1110
1113
  s,
1111
- o.filename.replace(/\.json$/, "_nettoye")
1114
+ o.filename.replace(/\.json$/, a ? "_enrichi" : "_nettoye")
1112
1115
  );
1113
- for (const c of L(u)) {
1114
- if (!c[c.length - 1].endsWith(".json"))
1116
+ for (const u of z(m)) {
1117
+ if (!u[u.length - 1].endsWith(".json"))
1115
1118
  continue;
1116
- const l = n.join(u, ...c);
1117
- r && console.log(`Loading file: ${l}…`);
1118
- const p = i.readFileSync(l, {
1119
+ const g = n.join(m, ...u);
1120
+ l && console.log(`Loading file: ${g}…`);
1121
+ const A = i.readFileSync(g, {
1119
1122
  encoding: "utf8"
1120
- }), m = N.toCompteRendu(p);
1121
- O[m.uid] === void 0 && (O[m.uid] = m);
1123
+ }), f = N.toCompteRendu(A);
1124
+ p[f.uid] === void 0 && (p[f.uid] = f);
1122
1125
  }
1123
1126
  }
1124
1127
  return {
1125
1128
  acteurByUid: d,
1126
- amendementByUid: A,
1127
- documentByUid: F,
1128
- dossierParlementaireBySenatChemin: I,
1129
+ amendementByUid: v,
1130
+ documentByUid: b,
1131
+ dossierParlementaireBySenatChemin: P,
1129
1132
  dossierParlementaireByTitreChemin: D,
1130
- dossierParlementaireByUid: z,
1131
- organeByUid: f,
1132
- photoByUid: x,
1133
- reunionByUid: _,
1134
- reunionsByDay: g,
1135
- reunionsByDossierUid: j,
1136
- scrutinByUid: X,
1137
- questionByUid: V,
1138
- compteRenduByUid: O
1133
+ dossierParlementaireByUid: O,
1134
+ organeByUid: _,
1135
+ photoByUid: X,
1136
+ reunionByUid: j,
1137
+ reunionsByDay: h,
1138
+ reunionsByDossierUid: F,
1139
+ scrutinByUid: V,
1140
+ questionByUid: L,
1141
+ compteRenduByUid: p
1139
1142
  };
1140
1143
  }
1141
- function ve(s, t, e, { log: r = !1 } = {}) {
1142
- const d = {}, f = {};
1143
- if (t & v.ActeursEtOrganes)
1144
- for (const o of S.acteursEtOrganes) {
1145
- if (o.ignoreForWeb || e !== a.All && o.legislature !== a.All && e !== o.legislature)
1144
+ function Ie(s, t, e, { log: a = !1 } = {}) {
1145
+ const l = {}, d = {};
1146
+ if (t & I.ActeursEtOrganes)
1147
+ for (const p of S.acteursEtOrganes) {
1148
+ if (p.ignoreForWeb || e !== r.All && p.legislature !== r.All && e !== p.legislature)
1146
1149
  continue;
1147
- const u = n.join(
1150
+ const o = n.join(
1148
1151
  s,
1149
- o.filename.replace(/\.json$/, "_nettoye.json")
1152
+ p.filename.replace(/\.json$/, "_nettoye.json")
1150
1153
  );
1151
- r && console.log(`Loading file: ${u}`);
1152
- const c = i.readFileSync(u, { encoding: "utf8" }), h = R.toActeursEtOrganes(c);
1153
- for (const l of h.acteurs)
1154
- d[l.uid] === void 0 && (d[l.uid] = l);
1155
- for (const l of h.organes)
1156
- f[l.uid] === void 0 && (f[l.uid] = l);
1154
+ a && console.log(`Loading file: ${o}`);
1155
+ const m = i.readFileSync(o, { encoding: "utf8" }), u = R.toActeursEtOrganes(m);
1156
+ for (const c of u.acteurs)
1157
+ l[c.uid] === void 0 && (l[c.uid] = c);
1158
+ for (const c of u.organes)
1159
+ d[c.uid] === void 0 && (d[c.uid] = c);
1157
1160
  }
1158
- const _ = {}, g = {}, j = {};
1159
- if (t & v.Agendas)
1160
- for (const o of S.agendas) {
1161
- if (o.ignoreForWeb || e !== a.All && o.legislature !== a.All && e !== o.legislature)
1161
+ const _ = {}, j = {}, h = {};
1162
+ if (t & I.Agendas)
1163
+ for (const p of S.agendas) {
1164
+ if (p.ignoreForWeb || e !== r.All && p.legislature !== r.All && e !== p.legislature)
1162
1165
  continue;
1163
- const u = n.join(
1166
+ const o = n.join(
1164
1167
  s,
1165
- o.filename.replace(/\.json$/, "_nettoye.json")
1168
+ p.filename.replace(/\.json$/, "_nettoye.json")
1166
1169
  );
1167
- r && console.log(`Loading file: ${u}`);
1168
- const c = i.readFileSync(u, { encoding: "utf8" }), h = Z.toAgendas(c);
1169
- for (const l of h.reunions) {
1170
- _[l.uid] === void 0 && (_[l.uid] = l);
1171
- const p = l.timestampDebut.toISOString().split("T")[0];
1172
- let m = g[p];
1173
- m === void 0 && (m = g[p] = []), m.push(l);
1174
- const b = l.odj;
1175
- if (b !== void 0)
1176
- for (const $ of b.pointsOdj || [])
1177
- for (const U of $.dossiersLegislatifsRefs || []) {
1178
- let C = j[U];
1179
- C === void 0 && (C = j[U] = []), C.push(l);
1170
+ a && console.log(`Loading file: ${o}`);
1171
+ const m = i.readFileSync(o, { encoding: "utf8" }), u = Z.toAgendas(m);
1172
+ for (const c of u.reunions) {
1173
+ _[c.uid] === void 0 && (_[c.uid] = c);
1174
+ const g = c.timestampDebut.toISOString().split("T")[0];
1175
+ let A = j[g];
1176
+ A === void 0 && (A = j[g] = []), A.push(c);
1177
+ const f = c.odj;
1178
+ if (f !== void 0)
1179
+ for (const x of f.pointsOdj || [])
1180
+ for (const U of x.dossiersLegislatifsRefs || []) {
1181
+ let C = h[U];
1182
+ C === void 0 && (C = h[U] = []), C.push(c);
1180
1183
  }
1181
1184
  }
1182
1185
  }
1183
- const A = {};
1184
- if (t & v.Amendements)
1185
- for (const o of S.amendements) {
1186
- if (o.ignoreForWeb || e !== a.All && o.legislature !== a.All && e !== o.legislature)
1186
+ const F = {};
1187
+ if (t & I.Amendements)
1188
+ for (const p of S.amendements) {
1189
+ if (p.ignoreForWeb || e !== r.All && p.legislature !== r.All && e !== p.legislature)
1187
1190
  continue;
1188
- const u = n.join(
1191
+ const o = n.join(
1189
1192
  s,
1190
- o.filename.replace(/\.json$/, "_nettoye.json")
1193
+ p.filename.replace(/\.json$/, "_nettoye.json")
1191
1194
  );
1192
- r && console.log(`Loading file: ${u}`);
1193
- const c = i.readFileSync(u, { encoding: "utf8" }), h = w.toAmendements(c);
1194
- for (const l of h.textesLegislatifs)
1195
- for (const p of l.amendements)
1196
- A[p.uid] === void 0 && (A[p.uid] = p);
1195
+ a && console.log(`Loading file: ${o}`);
1196
+ const m = i.readFileSync(o, { encoding: "utf8" }), u = w.toAmendements(m);
1197
+ for (const c of u.textesLegislatifs)
1198
+ for (const g of c.amendements)
1199
+ F[g.uid] === void 0 && (F[g.uid] = g);
1197
1200
  }
1198
- const F = {}, I = {}, D = {}, z = {};
1199
- if (t & v.DossiersLegislatifs)
1200
- for (const o of S.dossiersLegislatifs) {
1201
- if (o.ignoreForWeb || e !== a.All && o.legislature !== a.All && e !== o.legislature)
1201
+ const v = {}, b = {}, P = {}, D = {};
1202
+ if (t & I.DossiersLegislatifs)
1203
+ for (const p of S.dossiersLegislatifs) {
1204
+ if (p.ignoreForWeb || e !== r.All && p.legislature !== r.All && e !== p.legislature)
1202
1205
  continue;
1203
- const u = n.join(
1206
+ const o = n.join(
1204
1207
  s,
1205
- o.filename.replace(/\.json$/, "_nettoye.json")
1208
+ p.filename.replace(/\.json$/, "_nettoye.json")
1206
1209
  );
1207
- r && console.log(`Loading file: ${u}`);
1208
- const c = i.readFileSync(u, { encoding: "utf8" }), h = q.toDossiersLegislatifs(c);
1209
- for (const l of h.textesLegislatifs)
1210
- F[l.uid] === void 0 && (F[l.uid] = l);
1211
- for (const l of h.dossiersParlementaires) {
1212
- const p = l.titreDossier;
1213
- p.senatChemin && I[p.senatChemin] === void 0 && (I[p.senatChemin] = l), p.titreChemin && D[p.titreChemin] === void 0 && (D[p.titreChemin] = l), z[l.uid] === void 0 && (z[l.uid] = l);
1210
+ a && console.log(`Loading file: ${o}`);
1211
+ const m = i.readFileSync(o, { encoding: "utf8" }), u = q.toDossiersLegislatifs(m);
1212
+ for (const c of u.textesLegislatifs)
1213
+ v[c.uid] === void 0 && (v[c.uid] = c);
1214
+ for (const c of u.dossiersParlementaires) {
1215
+ const g = c.titreDossier;
1216
+ g.senatChemin && b[g.senatChemin] === void 0 && (b[g.senatChemin] = c), g.titreChemin && P[g.titreChemin] === void 0 && (P[g.titreChemin] = c), D[c.uid] === void 0 && (D[c.uid] = c);
1214
1217
  }
1215
1218
  }
1216
- const x = {};
1217
- if (t & v.Photos) {
1218
- const o = {};
1219
+ const O = {};
1220
+ if (t & I.Photos) {
1221
+ const p = {};
1219
1222
  {
1220
- const u = n.join(
1223
+ const o = n.join(
1221
1224
  s,
1222
1225
  `photos_deputes_${// TODO: Handle Legislature.All.
1223
- e === a.All ? a.DixSept : e}`,
1226
+ e === r.All ? r.DixSept : e}`,
1224
1227
  "deputes.json"
1225
1228
  );
1226
- if (i.existsSync(u)) {
1227
- r && console.log(`Loading file: ${u}`);
1228
- const c = i.readFileSync(u, { encoding: "utf8" });
1229
- Object.assign(o, JSON.parse(c));
1230
- } else r && console.log(`Ignoring missing file: ${u}`);
1229
+ if (i.existsSync(o)) {
1230
+ a && console.log(`Loading file: ${o}`);
1231
+ const m = i.readFileSync(o, { encoding: "utf8" });
1232
+ Object.assign(p, JSON.parse(m));
1233
+ } else a && console.log(`Ignoring missing file: ${o}`);
1231
1234
  }
1232
1235
  {
1233
- const u = n.join(
1236
+ const o = n.join(
1234
1237
  s,
1235
1238
  "photos_senateurs",
1236
1239
  "senateurs.json"
1237
1240
  );
1238
- if (i.existsSync(u)) {
1239
- r && console.log(`Loading file: ${u}`);
1240
- const c = i.readFileSync(u, { encoding: "utf8" });
1241
- Object.assign(o, JSON.parse(c));
1242
- } else r && console.log(`Ignoring missing file: ${u}`);
1241
+ if (i.existsSync(o)) {
1242
+ a && console.log(`Loading file: ${o}`);
1243
+ const m = i.readFileSync(o, { encoding: "utf8" });
1244
+ Object.assign(p, JSON.parse(m));
1245
+ } else a && console.log(`Ignoring missing file: ${o}`);
1243
1246
  }
1244
1247
  }
1245
1248
  const X = {};
1246
- if (t & v.Scrutins)
1247
- for (const o of S.scrutins) {
1248
- if (o.ignoreForWeb || e !== a.All && o.legislature !== a.All && e !== o.legislature)
1249
+ if (t & I.Scrutins)
1250
+ for (const p of S.scrutins) {
1251
+ if (p.ignoreForWeb || e !== r.All && p.legislature !== r.All && e !== p.legislature)
1249
1252
  continue;
1250
- const u = n.join(
1253
+ const o = n.join(
1251
1254
  s,
1252
- o.filename.replace(/\.json$/, "_nettoye.json")
1255
+ p.filename.replace(/\.json$/, "_nettoye.json")
1253
1256
  );
1254
- r && console.log(`Loading file: ${u}`);
1255
- const c = i.readFileSync(u, { encoding: "utf8" }), h = B.toScrutins(c);
1256
- for (const l of h.scrutins)
1257
- X[l.uid] === void 0 && (X[l.uid] = l);
1257
+ a && console.log(`Loading file: ${o}`);
1258
+ const m = i.readFileSync(o, { encoding: "utf8" }), u = B.toScrutins(m);
1259
+ for (const c of u.scrutins)
1260
+ X[c.uid] === void 0 && (X[c.uid] = c);
1258
1261
  }
1259
1262
  const V = {};
1260
- if (t & v.Questions)
1261
- for (const o of S.questions) {
1262
- if (o.ignoreForWeb || e !== a.All && o.legislature !== a.All && e !== o.legislature)
1263
+ if (t & I.Questions)
1264
+ for (const p of S.questions) {
1265
+ if (p.ignoreForWeb || e !== r.All && p.legislature !== r.All && e !== p.legislature)
1263
1266
  continue;
1264
- const u = n.join(
1267
+ const o = n.join(
1265
1268
  s,
1266
- o.filename.replace(/\.json$/, "_nettoye.json")
1269
+ p.filename.replace(/\.json$/, "_nettoye.json")
1267
1270
  );
1268
- r && console.log(`Loading file: ${u}`);
1269
- const c = i.readFileSync(u, { encoding: "utf8" }), h = J.toQuestions(c);
1270
- for (const l of h.questions)
1271
- V[l.uid] === void 0 && (V[l.uid] = l);
1271
+ a && console.log(`Loading file: ${o}`);
1272
+ const m = i.readFileSync(o, { encoding: "utf8" }), u = J.toQuestions(m);
1273
+ for (const c of u.questions)
1274
+ V[c.uid] === void 0 && (V[c.uid] = c);
1272
1275
  }
1273
- const O = {};
1274
- if (t & v.ComptesRendusSeances)
1275
- for (const o of S.comptesRendusSeances) {
1276
- if (o.ignoreForWeb || e !== a.All && o.legislature !== a.All && e !== o.legislature)
1276
+ const L = {};
1277
+ if (t & I.ComptesRendusSeances)
1278
+ for (const p of S.comptesRendusSeances) {
1279
+ if (p.ignoreForWeb || e !== r.All && p.legislature !== r.All && e !== p.legislature)
1277
1280
  continue;
1278
- const u = n.join(
1281
+ const o = n.join(
1279
1282
  s,
1280
- o.filename.replace(/\.json$/, "_nettoye.json")
1283
+ p.filename.replace(/\.json$/, "_nettoye.json")
1281
1284
  );
1282
- r && console.log(`Loading file: ${u}`);
1283
- const c = i.readFileSync(u, { encoding: "utf8" }), h = N.toComptesRendus(c);
1284
- for (const l of h.comptesRendus)
1285
- O[l.uid] === void 0 && (O[l.uid] = l);
1285
+ a && console.log(`Loading file: ${o}`);
1286
+ const m = i.readFileSync(o, { encoding: "utf8" }), u = N.toComptesRendus(m);
1287
+ for (const c of u.comptesRendus)
1288
+ L[c.uid] === void 0 && (L[c.uid] = c);
1286
1289
  }
1287
1290
  return {
1288
- acteurByUid: d,
1289
- amendementByUid: A,
1290
- documentByUid: F,
1291
- dossierParlementaireBySenatChemin: I,
1292
- dossierParlementaireByTitreChemin: D,
1293
- dossierParlementaireByUid: z,
1294
- organeByUid: f,
1295
- photoByUid: x,
1291
+ acteurByUid: l,
1292
+ amendementByUid: F,
1293
+ documentByUid: v,
1294
+ dossierParlementaireBySenatChemin: b,
1295
+ dossierParlementaireByTitreChemin: P,
1296
+ dossierParlementaireByUid: D,
1297
+ organeByUid: d,
1298
+ photoByUid: O,
1296
1299
  reunionByUid: _,
1297
- reunionsByDay: g,
1298
- reunionsByDossierUid: j,
1300
+ reunionsByDay: j,
1301
+ reunionsByDossierUid: h,
1299
1302
  scrutinByUid: X,
1300
1303
  questionByUid: V,
1301
- compteRenduByUid: O
1304
+ compteRenduByUid: L
1302
1305
  };
1303
1306
  }
1304
- function Ie(s, t, e) {
1305
- const r = n.join(s, "Documents"), d = ie(r, t), f = n.join(d, "index.json");
1306
- if (!i.pathExistsSync(f))
1307
+ function be(s, t, e) {
1308
+ const a = n.join(s, "Documents"), l = oe(a, t), d = n.join(l, "index.json");
1309
+ if (!i.pathExistsSync(d))
1307
1310
  return;
1308
- const _ = i.readJsonSync(f);
1309
- for (const g of e)
1310
- for (const { filename: j, url: A } of _[g] ?? [])
1311
- if (j !== void 0)
1312
- return { format: g, path: n.join(d, j), url: A };
1311
+ const _ = i.readJsonSync(d);
1312
+ for (const j of e)
1313
+ for (const { filename: h, url: F } of _[j] ?? [])
1314
+ if (h !== void 0)
1315
+ return { format: j, path: n.join(l, h), url: F };
1313
1316
  }
1314
- function be(s, t, { log: e = !1 } = {}) {
1315
- const r = n.join(
1317
+ function De(s, t, { log: e = !1 } = {}) {
1318
+ const a = n.join(
1316
1319
  s,
1317
1320
  `photos_deputes_${// TODO: Handle Legislature.All.
1318
- t === a.All ? a.DixSept : t}`,
1321
+ t === r.All ? r.DixSept : t}`,
1319
1322
  "deputes.json"
1320
1323
  );
1321
- e && console.log(`Loading file: ${r}`);
1322
- const d = i.readFileSync(r, { encoding: "utf8" });
1323
- return JSON.parse(d);
1324
+ e && console.log(`Loading file: ${a}`);
1325
+ const l = i.readFileSync(a, { encoding: "utf8" });
1326
+ return JSON.parse(l);
1324
1327
  }
1325
- function De(s, { log: t = !1 } = {}) {
1328
+ function Xe(s, { log: t = !1 } = {}) {
1326
1329
  const e = n.join(
1327
1330
  s,
1328
1331
  "photos_senateurs",
1329
1332
  "senateurs.json"
1330
1333
  );
1331
1334
  t && console.log(`Loading file: ${e}`);
1332
- const r = i.readFileSync(e, { encoding: "utf8" });
1333
- return JSON.parse(r);
1335
+ const a = i.readFileSync(e, { encoding: "utf8" });
1336
+ return JSON.parse(a);
1334
1337
  }
1335
- function ie(s, t) {
1336
- const e = t.match(H);
1338
+ function oe(s, t) {
1339
+ const e = t.match(Y);
1337
1340
  Q.notStrictEqual(
1338
1341
  e,
1339
1342
  null,
1340
1343
  `Unexpected structure for document UID: ${t}`
1341
1344
  );
1342
- const r = e.groups, d = n.join(
1345
+ const a = e.groups, l = n.join(
1343
1346
  s,
1344
- r.documentType ?? r.documentType2
1345
- ), f = n.join(d, r.chambre ?? r.chambre2), _ = n.join(
1346
- f,
1347
- r.republique ?? r.republique2
1348
- ), g = n.join(
1347
+ a.documentType ?? a.documentType2
1348
+ ), d = n.join(l, a.chambre ?? a.chambre2), _ = n.join(
1349
+ d,
1350
+ a.republique ?? a.republique2
1351
+ ), j = n.join(
1349
1352
  _,
1350
- r.legislature ?? r.legislature2
1351
- ), j = r.etat;
1352
- if (j === void 0)
1353
- return i.ensureDirSync(g), n.join(g, t);
1354
- const A = n.join(g, j);
1355
- let F = "000000" + (r.numero ?? r.numero2);
1356
- F = F.substring(F.length - 6);
1357
- const I = n.join(A, F.substring(0, 3));
1358
- return i.ensureDirSync(I), n.join(I, t);
1359
- }
1360
- function Xe(s, t) {
1361
- return E(s, t, ee);
1353
+ a.legislature ?? a.legislature2
1354
+ ), h = a.etat;
1355
+ if (h === void 0)
1356
+ return i.ensureDirSync(j), n.join(j, t);
1357
+ const F = n.join(j, h);
1358
+ let v = "000000" + (a.numero ?? a.numero2);
1359
+ v = v.substring(v.length - 6);
1360
+ const b = n.join(F, v.substring(0, 3));
1361
+ return i.ensureDirSync(b), n.join(b, t);
1362
1362
  }
1363
1363
  function Ve(s, t) {
1364
- const e = Y.exec(t);
1364
+ return E(s, t, te);
1365
+ }
1366
+ function Le(s, t) {
1367
+ const e = G.exec(t);
1365
1368
  Q.notStrictEqual(
1366
1369
  e,
1367
1370
  null,
1368
1371
  `Unexpected structure for reunion UID: ${t}`
1369
1372
  );
1370
- const r = n.join(s, e[1]), d = n.join(r, e[2]), f = n.join(d, e[3]), _ = n.join(f, e[4]), g = n.join(_, e[5]);
1371
- let j = "000000000" + e[6];
1372
- j = j.substring(j.length - 9);
1373
- const A = n.join(g, j.substring(0, 3)), F = n.join(A, j.substring(3, 3));
1374
- return i.ensureDirSync(F), n.join(F, t);
1373
+ const a = n.join(s, e[1]), l = n.join(a, e[2]), d = n.join(l, e[3]), _ = n.join(d, e[4]), j = n.join(_, e[5]);
1374
+ let h = "000000000" + e[6];
1375
+ h = h.substring(h.length - 9);
1376
+ const F = n.join(j, h.substring(0, 3)), v = n.join(F, h.substring(3, 3));
1377
+ return i.ensureDirSync(v), n.join(v, t);
1375
1378
  }
1376
- function Le(s, t) {
1377
- const e = G.exec(t);
1379
+ function xe(s, t) {
1380
+ const e = K.exec(t);
1378
1381
  Q.notStrictEqual(
1379
1382
  e,
1380
1383
  null,
1381
1384
  `Unexpected structure for scrutin UID: ${t}`
1382
1385
  );
1383
- const r = n.join(s, e[1]), d = n.join(r, e[2]), f = n.join(d, e[3]);
1386
+ const a = n.join(s, e[1]), l = n.join(a, e[2]), d = n.join(l, e[3]);
1384
1387
  let _ = "000000" + e[4];
1385
1388
  _ = _.substring(_.length - 6);
1386
- const g = n.join(f, _.substring(0, 3));
1387
- return i.ensureDirSync(g), n.join(g, t);
1388
- }
1389
- function xe(s, t) {
1390
- return E(s, t, te);
1389
+ const j = n.join(d, _.substring(0, 3));
1390
+ return i.ensureDirSync(j), n.join(j, t);
1391
1391
  }
1392
1392
  function Pe(s, t) {
1393
- const e = K.exec(t);
1393
+ return E(s, t, se);
1394
+ }
1395
+ function ze(s, t) {
1396
+ const e = ee.exec(t);
1394
1397
  Q.notStrictEqual(
1395
1398
  e,
1396
1399
  null,
1397
1400
  `Unexpected structure for object with UID: ${t}`
1398
1401
  );
1399
- const r = n.join(s, e[2]), d = n.join(r, e[3]), f = n.join(d, e[4]), _ = n.join(f, e[5]);
1400
- let g = "000000000" + e[7];
1401
- g = g.substring(g.length - 9);
1402
- const j = n.join(_, g.substring(0, 3)), A = n.join(j, g.substring(3, 3));
1403
- return i.ensureDirSync(A), n.join(A, t);
1402
+ const a = n.join(s, e[2]), l = n.join(a, e[3]), d = n.join(l, e[4]), _ = n.join(d, e[5]);
1403
+ let j = "000000000" + e[7];
1404
+ j = j.substring(j.length - 9);
1405
+ const h = n.join(_, j.substring(0, 3)), F = n.join(h, j.substring(3, 3));
1406
+ return i.ensureDirSync(F), n.join(F, t);
1404
1407
  }
1405
1408
  function E(s, t, e) {
1406
- const r = e.exec(t);
1409
+ const a = e.exec(t);
1407
1410
  Q.notStrictEqual(
1408
- r,
1411
+ a,
1409
1412
  null,
1410
1413
  `Unexpected structure for object with UID: ${t}`
1411
1414
  );
1412
- const d = n.join(s, r[1]), f = n.join(d, r[2]);
1413
- let _ = "000000" + r[3];
1415
+ const l = n.join(s, a[1]), d = n.join(l, a[2]);
1416
+ let _ = "000000" + a[3];
1414
1417
  _ = _.substring(_.length - 6);
1415
- const g = n.join(f, _.substring(0, 3));
1416
- return i.ensureDirSync(g), n.join(g, t);
1418
+ const j = n.join(d, _.substring(0, 3));
1419
+ return i.ensureDirSync(j), n.join(j, t);
1417
1420
  }
1418
1421
  export {
1419
- v as EnabledDatasets,
1420
- me as iterLoadAssembleeActeurs,
1421
- pe as iterLoadAssembleeAmendements,
1422
- Se as iterLoadAssembleeComptesRendus,
1423
- Ae as iterLoadAssembleeComptesRendusCommissions,
1424
- ge as iterLoadAssembleeDocuments,
1425
- _e as iterLoadAssembleeDossiersParlementaires,
1426
- fe as iterLoadAssembleeOrganes,
1427
- he as iterLoadAssembleeQuestions,
1428
- je as iterLoadAssembleeReunions,
1429
- ye as iterLoadAssembleeScrutins,
1430
- Fe as loadAssembleeData,
1431
- ve as loadAssembleeDataFromBigFiles,
1432
- Ie as loadAssembleeDocumentFile,
1433
- be as loadAssembleePhotosDeputes,
1434
- De as loadAssembleePhotosSenateurs,
1435
- Pe as pathFromCompteRenduUid,
1436
- ie as pathFromDocumentUid,
1437
- Xe as pathFromDossierParlementaireUid,
1438
- xe as pathFromQuestionUid,
1439
- Ve as pathFromReunionUid,
1440
- Le as pathFromScrutinUid,
1441
- L as walkDir
1422
+ I as EnabledDatasets,
1423
+ de as iterLoadAssembleeActeurs,
1424
+ ge as iterLoadAssembleeAmendements,
1425
+ Ae as iterLoadAssembleeComptesRendus,
1426
+ Fe as iterLoadAssembleeComptesRendusCommissions,
1427
+ _e as iterLoadAssembleeDocuments,
1428
+ je as iterLoadAssembleeDossiersParlementaires,
1429
+ pe as iterLoadAssembleeOrganes,
1430
+ Se as iterLoadAssembleeQuestions,
1431
+ ye as iterLoadAssembleeReunions,
1432
+ he as iterLoadAssembleeScrutins,
1433
+ ve as loadAssembleeData,
1434
+ Ie as loadAssembleeDataFromBigFiles,
1435
+ be as loadAssembleeDocumentFile,
1436
+ De as loadAssembleePhotosDeputes,
1437
+ Xe as loadAssembleePhotosSenateurs,
1438
+ ze as pathFromCompteRenduUid,
1439
+ oe as pathFromDocumentUid,
1440
+ Ve as pathFromDossierParlementaireUid,
1441
+ Pe as pathFromQuestionUid,
1442
+ Le as pathFromReunionUid,
1443
+ xe as pathFromScrutinUid,
1444
+ z as walkDir
1442
1445
  };