@tricoteuses/assemblee 2.5.27 → 2.5.28
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 +58 -59
- package/package.json +1 -1
package/lib/loaders.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import E from "node:assert";
|
|
2
2
|
import g from "fs-extra";
|
|
3
3
|
import t from "node:path";
|
|
4
|
-
import { a1 as
|
|
4
|
+
import { a1 as F, a2 as L, L as j, a3 as _, a4 as M, a5 as J, a6 as N, a7 as Q, a8 as T, Y as X, $ as Y, a0 as Z, X as G, Z as H, _ as K } from "./datasets-CYS3pymi.js";
|
|
5
5
|
import "glob";
|
|
6
6
|
import { getChangedFilesSinceCommit as z } from "./git.js";
|
|
7
7
|
import { C as w } from "./amendements-40Z7OJLT.js";
|
|
@@ -17,11 +17,10 @@ function* C(s, i = []) {
|
|
|
17
17
|
}
|
|
18
18
|
function* B(s, i, e, o, m, { log: f = !1, noValidation: d = !1, sinceCommits: a } = {}) {
|
|
19
19
|
const p = /* @__PURE__ */ new Set();
|
|
20
|
-
for (const
|
|
21
|
-
if (
|
|
20
|
+
for (const S of e) {
|
|
21
|
+
if (S.ignoreForWeb || !ee(i, S))
|
|
22
22
|
continue;
|
|
23
|
-
|
|
24
|
-
const A = t.join(s, `${y.name}_nettoye`), P = a ? a[y.name] : void 0, R = P ? z(A, P, {
|
|
23
|
+
const A = t.join(s, `${S.name}_nettoye`), P = a ? a[S.name] : void 0, R = P ? z(A, P, {
|
|
25
24
|
diffFilter: "AMR"
|
|
26
25
|
}) : null;
|
|
27
26
|
f && P && (console.log(
|
|
@@ -37,7 +36,7 @@ function* B(s, i, e, o, m, { log: f = !1, noValidation: d = !1, sinceCommits: a
|
|
|
37
36
|
let n = g.readFileSync(D, { encoding: "utf8" });
|
|
38
37
|
const r = d ? JSON.parse(n) : o(n);
|
|
39
38
|
p.has(r.uid) || (p.add(r.uid), yield {
|
|
40
|
-
datasetLegislature:
|
|
39
|
+
datasetLegislature: S.legislature,
|
|
41
40
|
filePath: D,
|
|
42
41
|
item: r,
|
|
43
42
|
...U && { gitStatus: U }
|
|
@@ -56,7 +55,7 @@ function* B(s, i, e, o, m, { log: f = !1, noValidation: d = !1, sinceCommits: a
|
|
|
56
55
|
f && console.log(`Deleted file: ${b}`);
|
|
57
56
|
const n = { uid: t.parse(x).name };
|
|
58
57
|
yield {
|
|
59
|
-
datasetLegislature:
|
|
58
|
+
datasetLegislature: S.legislature,
|
|
60
59
|
filePath: b,
|
|
61
60
|
item: n,
|
|
62
61
|
gitStatus: D
|
|
@@ -79,7 +78,7 @@ function* le(s, i, e = {}, o) {
|
|
|
79
78
|
} of B(
|
|
80
79
|
s,
|
|
81
80
|
i,
|
|
82
|
-
o ??
|
|
81
|
+
o ?? F.acteursEtOrganes,
|
|
83
82
|
_.toActeur,
|
|
84
83
|
["acteurs"],
|
|
85
84
|
e
|
|
@@ -100,7 +99,7 @@ function* ue(s, i, e = {}, o) {
|
|
|
100
99
|
} of B(
|
|
101
100
|
s,
|
|
102
101
|
i,
|
|
103
|
-
o ??
|
|
102
|
+
o ?? F.acteursEtOrganes,
|
|
104
103
|
_.toOrgane,
|
|
105
104
|
["organes"],
|
|
106
105
|
e
|
|
@@ -121,7 +120,7 @@ function* fe(s, i, e = {}, o) {
|
|
|
121
120
|
} of B(
|
|
122
121
|
s,
|
|
123
122
|
i,
|
|
124
|
-
o ??
|
|
123
|
+
o ?? F.amendements,
|
|
125
124
|
w.toAmendement,
|
|
126
125
|
[],
|
|
127
126
|
e
|
|
@@ -142,7 +141,7 @@ function* de(s, i, e = {}, o) {
|
|
|
142
141
|
} of B(
|
|
143
142
|
s,
|
|
144
143
|
i,
|
|
145
|
-
o ??
|
|
144
|
+
o ?? F.dossiersLegislatifs,
|
|
146
145
|
J.toDocument,
|
|
147
146
|
["documents"],
|
|
148
147
|
e
|
|
@@ -163,7 +162,7 @@ function* me(s, i, e = {}, o) {
|
|
|
163
162
|
} of B(
|
|
164
163
|
s,
|
|
165
164
|
i,
|
|
166
|
-
o ??
|
|
165
|
+
o ?? F.dossiersLegislatifs,
|
|
167
166
|
J.toDossierParlementaire,
|
|
168
167
|
["dossiers"],
|
|
169
168
|
e
|
|
@@ -184,7 +183,7 @@ function* ge(s, i, e = {}, o) {
|
|
|
184
183
|
} of B(
|
|
185
184
|
s,
|
|
186
185
|
i,
|
|
187
|
-
o ??
|
|
186
|
+
o ?? F.agendas,
|
|
188
187
|
M.toReunion,
|
|
189
188
|
[],
|
|
190
189
|
e
|
|
@@ -205,7 +204,7 @@ function* je(s, i, e = {}, o) {
|
|
|
205
204
|
} of B(
|
|
206
205
|
s,
|
|
207
206
|
i,
|
|
208
|
-
o ??
|
|
207
|
+
o ?? F.scrutins,
|
|
209
208
|
N.toScrutin,
|
|
210
209
|
[],
|
|
211
210
|
e
|
|
@@ -226,7 +225,7 @@ function* he(s, i, e = {}, o) {
|
|
|
226
225
|
} of B(
|
|
227
226
|
s,
|
|
228
227
|
i,
|
|
229
|
-
o ??
|
|
228
|
+
o ?? F.questions,
|
|
230
229
|
Q.toQuestion,
|
|
231
230
|
[],
|
|
232
231
|
e
|
|
@@ -247,7 +246,7 @@ function* pe(s, i, e = {}, o) {
|
|
|
247
246
|
} of B(
|
|
248
247
|
s,
|
|
249
248
|
i,
|
|
250
|
-
o ??
|
|
249
|
+
o ?? F.comptesRendusSeances.concat(F.comptesRendusCommissions),
|
|
251
250
|
T.toCompteRendu,
|
|
252
251
|
[],
|
|
253
252
|
e
|
|
@@ -262,7 +261,7 @@ function* pe(s, i, e = {}, o) {
|
|
|
262
261
|
function ye(s, i, e, { log: o = !1 } = {}) {
|
|
263
262
|
const m = {}, f = {};
|
|
264
263
|
if (i & L.ActeursEtOrganes)
|
|
265
|
-
for (const n of
|
|
264
|
+
for (const n of F.acteursEtOrganes) {
|
|
266
265
|
if (n.ignoreForWeb || e !== j.All && n.legislature !== j.All && e !== n.legislature)
|
|
267
266
|
continue;
|
|
268
267
|
const r = t.join(
|
|
@@ -292,7 +291,7 @@ function ye(s, i, e, { log: o = !1 } = {}) {
|
|
|
292
291
|
}
|
|
293
292
|
const d = {}, a = {}, p = {};
|
|
294
293
|
if (i & L.Agendas)
|
|
295
|
-
for (const n of
|
|
294
|
+
for (const n of F.agendas) {
|
|
296
295
|
if (n.ignoreForWeb || e !== j.All && n.legislature !== j.All && e !== n.legislature)
|
|
297
296
|
continue;
|
|
298
297
|
const r = t.join(
|
|
@@ -320,9 +319,9 @@ function ye(s, i, e, { log: o = !1 } = {}) {
|
|
|
320
319
|
}
|
|
321
320
|
}
|
|
322
321
|
}
|
|
323
|
-
const
|
|
322
|
+
const S = {};
|
|
324
323
|
if (i & L.Amendements)
|
|
325
|
-
for (const n of
|
|
324
|
+
for (const n of F.amendements) {
|
|
326
325
|
if (n.ignoreForWeb || e !== j.All && n.legislature !== j.All && e !== n.legislature)
|
|
327
326
|
continue;
|
|
328
327
|
const r = t.join(
|
|
@@ -337,12 +336,12 @@ function ye(s, i, e, { log: o = !1 } = {}) {
|
|
|
337
336
|
const h = g.readFileSync(c, {
|
|
338
337
|
encoding: "utf8"
|
|
339
338
|
}), u = w.toAmendement(h);
|
|
340
|
-
|
|
339
|
+
S[u.uid] === void 0 && (S[u.uid] = u);
|
|
341
340
|
}
|
|
342
341
|
}
|
|
343
342
|
const A = {}, P = {}, R = {}, $ = {};
|
|
344
343
|
if (i & L.DossiersLegislatifs)
|
|
345
|
-
for (const n of
|
|
344
|
+
for (const n of F.dossiersLegislatifs) {
|
|
346
345
|
if (n.ignoreForWeb || e !== j.All && n.legislature !== j.All && e !== n.legislature)
|
|
347
346
|
continue;
|
|
348
347
|
const r = t.join(
|
|
@@ -400,7 +399,7 @@ function ye(s, i, e, { log: o = !1 } = {}) {
|
|
|
400
399
|
}
|
|
401
400
|
const D = {};
|
|
402
401
|
if (i & L.Scrutins)
|
|
403
|
-
for (const n of
|
|
402
|
+
for (const n of F.scrutins) {
|
|
404
403
|
if (n.ignoreForWeb || e !== j.All && n.legislature !== j.All && e !== n.legislature)
|
|
405
404
|
continue;
|
|
406
405
|
const r = t.join(
|
|
@@ -420,7 +419,7 @@ function ye(s, i, e, { log: o = !1 } = {}) {
|
|
|
420
419
|
}
|
|
421
420
|
const b = {};
|
|
422
421
|
if (i & L.Questions)
|
|
423
|
-
for (const n of
|
|
422
|
+
for (const n of F.questions) {
|
|
424
423
|
if (n.ignoreForWeb || e !== j.All && n.legislature !== j.All && e !== n.legislature)
|
|
425
424
|
continue;
|
|
426
425
|
const r = t.join(
|
|
@@ -440,7 +439,7 @@ function ye(s, i, e, { log: o = !1 } = {}) {
|
|
|
440
439
|
}
|
|
441
440
|
const U = {};
|
|
442
441
|
if (i & L.ComptesRendusSeances)
|
|
443
|
-
for (const n of
|
|
442
|
+
for (const n of F.comptesRendusSeances) {
|
|
444
443
|
if (n.ignoreForWeb || e !== j.All && n.legislature !== j.All && e !== n.legislature)
|
|
445
444
|
continue;
|
|
446
445
|
const r = t.join(
|
|
@@ -460,7 +459,7 @@ function ye(s, i, e, { log: o = !1 } = {}) {
|
|
|
460
459
|
}
|
|
461
460
|
return {
|
|
462
461
|
acteurByUid: m,
|
|
463
|
-
amendementByUid:
|
|
462
|
+
amendementByUid: S,
|
|
464
463
|
documentByUid: A,
|
|
465
464
|
dossierParlementaireBySenatChemin: P,
|
|
466
465
|
dossierParlementaireByTitreChemin: R,
|
|
@@ -478,7 +477,7 @@ function ye(s, i, e, { log: o = !1 } = {}) {
|
|
|
478
477
|
function Fe(s, i, e, { log: o = !1 } = {}) {
|
|
479
478
|
const m = {}, f = {};
|
|
480
479
|
if (i & L.ActeursEtOrganes)
|
|
481
|
-
for (const n of
|
|
480
|
+
for (const n of F.acteursEtOrganes) {
|
|
482
481
|
if (n.ignoreForWeb || e !== j.All && n.legislature !== j.All && e !== n.legislature)
|
|
483
482
|
continue;
|
|
484
483
|
const r = t.join(
|
|
@@ -486,15 +485,15 @@ function Fe(s, i, e, { log: o = !1 } = {}) {
|
|
|
486
485
|
n.filename.replace(/\.json$/, "_nettoye.json")
|
|
487
486
|
);
|
|
488
487
|
o && console.log(`Loading file: ${r}`);
|
|
489
|
-
const l = g.readFileSync(r, { encoding: "utf8" }),
|
|
490
|
-
for (const c of
|
|
488
|
+
const l = g.readFileSync(r, { encoding: "utf8" }), y = _.toActeursEtOrganes(l);
|
|
489
|
+
for (const c of y.acteurs)
|
|
491
490
|
m[c.uid] === void 0 && (m[c.uid] = c);
|
|
492
|
-
for (const c of
|
|
491
|
+
for (const c of y.organes)
|
|
493
492
|
f[c.uid] === void 0 && (f[c.uid] = c);
|
|
494
493
|
}
|
|
495
494
|
const d = {}, a = {}, p = {};
|
|
496
495
|
if (i & L.Agendas)
|
|
497
|
-
for (const n of
|
|
496
|
+
for (const n of F.agendas) {
|
|
498
497
|
if (n.ignoreForWeb || e !== j.All && n.legislature !== j.All && e !== n.legislature)
|
|
499
498
|
continue;
|
|
500
499
|
const r = t.join(
|
|
@@ -502,8 +501,8 @@ function Fe(s, i, e, { log: o = !1 } = {}) {
|
|
|
502
501
|
n.filename.replace(/\.json$/, "_nettoye.json")
|
|
503
502
|
);
|
|
504
503
|
o && console.log(`Loading file: ${r}`);
|
|
505
|
-
const l = g.readFileSync(r, { encoding: "utf8" }),
|
|
506
|
-
for (const c of
|
|
504
|
+
const l = g.readFileSync(r, { encoding: "utf8" }), y = M.toAgendas(l);
|
|
505
|
+
for (const c of y.reunions) {
|
|
507
506
|
d[c.uid] === void 0 && (d[c.uid] = c);
|
|
508
507
|
const h = c.timestampDebut.toISOString().split("T")[0];
|
|
509
508
|
let u = a[h];
|
|
@@ -517,9 +516,9 @@ function Fe(s, i, e, { log: o = !1 } = {}) {
|
|
|
517
516
|
}
|
|
518
517
|
}
|
|
519
518
|
}
|
|
520
|
-
const
|
|
519
|
+
const S = {};
|
|
521
520
|
if (i & L.Amendements)
|
|
522
|
-
for (const n of
|
|
521
|
+
for (const n of F.amendements) {
|
|
523
522
|
if (n.ignoreForWeb || e !== j.All && n.legislature !== j.All && e !== n.legislature)
|
|
524
523
|
continue;
|
|
525
524
|
const r = t.join(
|
|
@@ -527,14 +526,14 @@ function Fe(s, i, e, { log: o = !1 } = {}) {
|
|
|
527
526
|
n.filename.replace(/\.json$/, "_nettoye.json")
|
|
528
527
|
);
|
|
529
528
|
o && console.log(`Loading file: ${r}`);
|
|
530
|
-
const l = g.readFileSync(r, { encoding: "utf8" }),
|
|
531
|
-
for (const c of
|
|
529
|
+
const l = g.readFileSync(r, { encoding: "utf8" }), y = w.toAmendements(l);
|
|
530
|
+
for (const c of y.textesLegislatifs)
|
|
532
531
|
for (const h of c.amendements)
|
|
533
|
-
|
|
532
|
+
S[h.uid] === void 0 && (S[h.uid] = h);
|
|
534
533
|
}
|
|
535
534
|
const A = {}, P = {}, R = {}, $ = {};
|
|
536
535
|
if (i & L.DossiersLegislatifs)
|
|
537
|
-
for (const n of
|
|
536
|
+
for (const n of F.dossiersLegislatifs) {
|
|
538
537
|
if (n.ignoreForWeb || e !== j.All && n.legislature !== j.All && e !== n.legislature)
|
|
539
538
|
continue;
|
|
540
539
|
const r = t.join(
|
|
@@ -542,10 +541,10 @@ function Fe(s, i, e, { log: o = !1 } = {}) {
|
|
|
542
541
|
n.filename.replace(/\.json$/, "_nettoye.json")
|
|
543
542
|
);
|
|
544
543
|
o && console.log(`Loading file: ${r}`);
|
|
545
|
-
const l = g.readFileSync(r, { encoding: "utf8" }),
|
|
546
|
-
for (const c of
|
|
544
|
+
const l = g.readFileSync(r, { encoding: "utf8" }), y = J.toDossiersLegislatifs(l);
|
|
545
|
+
for (const c of y.textesLegislatifs)
|
|
547
546
|
A[c.uid] === void 0 && (A[c.uid] = c);
|
|
548
|
-
for (const c of
|
|
547
|
+
for (const c of y.dossiersParlementaires) {
|
|
549
548
|
const h = c.titreDossier;
|
|
550
549
|
h.senatChemin && P[h.senatChemin] === void 0 && (P[h.senatChemin] = c), h.titreChemin && R[h.titreChemin] === void 0 && (R[h.titreChemin] = c), $[c.uid] === void 0 && ($[c.uid] = c);
|
|
551
550
|
}
|
|
@@ -581,7 +580,7 @@ function Fe(s, i, e, { log: o = !1 } = {}) {
|
|
|
581
580
|
}
|
|
582
581
|
const D = {};
|
|
583
582
|
if (i & L.Scrutins)
|
|
584
|
-
for (const n of
|
|
583
|
+
for (const n of F.scrutins) {
|
|
585
584
|
if (n.ignoreForWeb || e !== j.All && n.legislature !== j.All && e !== n.legislature)
|
|
586
585
|
continue;
|
|
587
586
|
const r = t.join(
|
|
@@ -589,13 +588,13 @@ function Fe(s, i, e, { log: o = !1 } = {}) {
|
|
|
589
588
|
n.filename.replace(/\.json$/, "_nettoye.json")
|
|
590
589
|
);
|
|
591
590
|
o && console.log(`Loading file: ${r}`);
|
|
592
|
-
const l = g.readFileSync(r, { encoding: "utf8" }),
|
|
593
|
-
for (const c of
|
|
591
|
+
const l = g.readFileSync(r, { encoding: "utf8" }), y = N.toScrutins(l);
|
|
592
|
+
for (const c of y.scrutins)
|
|
594
593
|
D[c.uid] === void 0 && (D[c.uid] = c);
|
|
595
594
|
}
|
|
596
595
|
const b = {};
|
|
597
596
|
if (i & L.Questions)
|
|
598
|
-
for (const n of
|
|
597
|
+
for (const n of F.questions) {
|
|
599
598
|
if (n.ignoreForWeb || e !== j.All && n.legislature !== j.All && e !== n.legislature)
|
|
600
599
|
continue;
|
|
601
600
|
const r = t.join(
|
|
@@ -603,13 +602,13 @@ function Fe(s, i, e, { log: o = !1 } = {}) {
|
|
|
603
602
|
n.filename.replace(/\.json$/, "_nettoye.json")
|
|
604
603
|
);
|
|
605
604
|
o && console.log(`Loading file: ${r}`);
|
|
606
|
-
const l = g.readFileSync(r, { encoding: "utf8" }),
|
|
607
|
-
for (const c of
|
|
605
|
+
const l = g.readFileSync(r, { encoding: "utf8" }), y = Q.toQuestions(l);
|
|
606
|
+
for (const c of y.questions)
|
|
608
607
|
b[c.uid] === void 0 && (b[c.uid] = c);
|
|
609
608
|
}
|
|
610
609
|
const U = {};
|
|
611
610
|
if (i & L.ComptesRendusSeances)
|
|
612
|
-
for (const n of
|
|
611
|
+
for (const n of F.comptesRendusSeances) {
|
|
613
612
|
if (n.ignoreForWeb || e !== j.All && n.legislature !== j.All && e !== n.legislature)
|
|
614
613
|
continue;
|
|
615
614
|
const r = t.join(
|
|
@@ -617,13 +616,13 @@ function Fe(s, i, e, { log: o = !1 } = {}) {
|
|
|
617
616
|
n.filename.replace(/\.json$/, "_nettoye.json")
|
|
618
617
|
);
|
|
619
618
|
o && console.log(`Loading file: ${r}`);
|
|
620
|
-
const l = g.readFileSync(r, { encoding: "utf8" }),
|
|
621
|
-
for (const c of
|
|
619
|
+
const l = g.readFileSync(r, { encoding: "utf8" }), y = T.toComptesRendus(l);
|
|
620
|
+
for (const c of y.comptesRendus)
|
|
622
621
|
U[c.uid] === void 0 && (U[c.uid] = c);
|
|
623
622
|
}
|
|
624
623
|
return {
|
|
625
624
|
acteurByUid: m,
|
|
626
|
-
amendementByUid:
|
|
625
|
+
amendementByUid: S,
|
|
627
626
|
documentByUid: A,
|
|
628
627
|
dossierParlementaireBySenatChemin: P,
|
|
629
628
|
dossierParlementaireByTitreChemin: R,
|
|
@@ -644,9 +643,9 @@ function Se(s, i, e) {
|
|
|
644
643
|
return;
|
|
645
644
|
const d = g.readJsonSync(f);
|
|
646
645
|
for (const a of e)
|
|
647
|
-
for (const { filename: p, url:
|
|
646
|
+
for (const { filename: p, url: S } of d[a] ?? [])
|
|
648
647
|
if (p !== void 0)
|
|
649
|
-
return { format: a, path: t.join(m, p), url:
|
|
648
|
+
return { format: a, path: t.join(m, p), url: S };
|
|
650
649
|
}
|
|
651
650
|
function Ae(s, i, { log: e = !1 } = {}) {
|
|
652
651
|
const o = t.join(
|
|
@@ -688,10 +687,10 @@ function ne(s, i) {
|
|
|
688
687
|
), p = o.etat;
|
|
689
688
|
if (p === void 0)
|
|
690
689
|
return g.ensureDirSync(a), t.join(a, i);
|
|
691
|
-
const
|
|
690
|
+
const S = t.join(a, p);
|
|
692
691
|
let A = "000000" + (o.numero ?? o.numero2);
|
|
693
692
|
A = A.substring(A.length - 6);
|
|
694
|
-
const P = t.join(
|
|
693
|
+
const P = t.join(S, A.substring(0, 3));
|
|
695
694
|
return g.ensureDirSync(P), t.join(P, i);
|
|
696
695
|
}
|
|
697
696
|
function Le(s, i) {
|
|
@@ -707,7 +706,7 @@ function $e(s, i) {
|
|
|
707
706
|
const o = t.join(s, e[1]), m = t.join(o, e[2]), f = t.join(m, e[3]), d = t.join(f, e[4]), a = t.join(d, e[5]);
|
|
708
707
|
let p = "000000000" + e[6];
|
|
709
708
|
p = p.substring(p.length - 9);
|
|
710
|
-
const
|
|
709
|
+
const S = t.join(a, p.substring(0, 3)), A = t.join(S, p.substring(3, 3));
|
|
711
710
|
return g.ensureDirSync(A), t.join(A, i);
|
|
712
711
|
}
|
|
713
712
|
function De(s, i) {
|
|
@@ -736,8 +735,8 @@ function Ue(s, i) {
|
|
|
736
735
|
const o = t.join(s, e[2]), m = t.join(o, e[3]), f = t.join(m, e[4]), d = t.join(f, e[5]);
|
|
737
736
|
let a = "000000000" + e[7];
|
|
738
737
|
a = a.substring(a.length - 9);
|
|
739
|
-
const p = t.join(d, a.substring(0, 3)),
|
|
740
|
-
return g.ensureDirSync(
|
|
738
|
+
const p = t.join(d, a.substring(0, 3)), S = t.join(p, a.substring(3, 3));
|
|
739
|
+
return g.ensureDirSync(S), t.join(S, i);
|
|
741
740
|
}
|
|
742
741
|
function V(s, i, e) {
|
|
743
742
|
const o = e.exec(i);
|