@tricoteuses/assemblee 3.8.5 → 3.9.0

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.
@@ -1,863 +0,0 @@
1
- import { i as e } from "./amendements-DfZse75q.js";
2
- import { Fn as t, In as n, Mn as r, Mt as i, Nn as a, O as o, Pn as s, Q as c, Ut as l, jn as u, l as d, ln as f, ti as p } from "./scrutins-CLWnMYLE.js";
3
- import { getChangedFilesSinceCommit as m } from "./git.js";
4
- import h from "node:assert";
5
- import g from "fs-extra";
6
- import _ from "node:path";
7
- import "glob";
8
- import "node:fs/promises";
9
- //#region src/datasets.ts
10
- var v = /* @__PURE__ */ function(e) {
11
- return e[e.SingleFile = 0] = "SingleFile", e[e.SegmentedFiles = 1] = "SegmentedFiles", e;
12
- }({}), y = /* @__PURE__ */ function(e) {
13
- return e[e.None = 0] = "None", e[e.ActeursEtOrganes = 1] = "ActeursEtOrganes", e[e.Agendas = 2] = "Agendas", e[e.Amendements = 4] = "Amendements", e[e.DossiersLegislatifs = 8] = "DossiersLegislatifs", e[e.Photos = 16] = "Photos", e[e.Scrutins = 32] = "Scrutins", e[e.Questions = 64] = "Questions", e[e.ComptesRendus = 128] = "ComptesRendus", e[e.All = 255] = "All", e;
14
- }({});
15
- Object.keys(y).filter((e) => Number.isNaN(Number(e)) && e !== "None" && e !== "All");
16
- //#endregion
17
- //#region src/file_systems.ts
18
- function* b(e, t = []) {
19
- let n = _.join(e, ...t);
20
- if (g.existsSync(n)) for (let r of g.readdirSync(n)) {
21
- if (r[0] === ".") continue;
22
- let i = _.join(n, r), a = [...t, r];
23
- g.statSync(i).isDirectory() ? yield* b(e, a) : yield a;
24
- }
25
- }
26
- //#endregion
27
- //#region src/loaders.ts
28
- var x = {
29
- acteursEtOrganes: [
30
- {
31
- filename: "AMO10_deputes_actifs_mandats_actifs_organes_XVII.json",
32
- name: "AMO10_deputes_actifs_mandats_actifs_organes_XVII",
33
- ignoreForWeb: !0,
34
- legislature: p.DixSept,
35
- repairZip: G,
36
- structure: v.SegmentedFiles,
37
- title: "Députés actifs et organes de la XVIIème législature",
38
- url: "https://data.assemblee-nationale.fr/static/openData/repository/17/amo/deputes_actifs_mandats_actifs_organes/AMO10_deputes_actifs_mandats_actifs_organes.json.zip"
39
- },
40
- {
41
- filename: "AMO10_deputes_actifs_mandats_actifs_organes_XVI.json",
42
- name: "AMO10_deputes_actifs_mandats_actifs_organes_XVI",
43
- ignoreForWeb: !0,
44
- legislature: p.Seize,
45
- repairZip: G,
46
- structure: v.SegmentedFiles,
47
- title: "Députés actifs et organes de la XVIème législature",
48
- url: "https://data.assemblee-nationale.fr/static/openData/repository/16/amo/deputes_actifs_mandats_actifs_organes/AMO10_deputes_actifs_mandats_actifs_organes.json.zip"
49
- },
50
- {
51
- filename: "AMO10_deputes_actifs_mandats_actifs_organes_XV.json",
52
- name: "AMO10_deputes_actifs_mandats_actifs_organes_XV",
53
- ignoreForWeb: !0,
54
- legislature: p.Quinze,
55
- repairZip: G,
56
- structure: v.SegmentedFiles,
57
- title: "Députés actifs et organes de la XVème législature",
58
- url: "https://data.assemblee-nationale.fr/static/openData/repository/15/amo/deputes_actifs_mandats_actifs_organes/AMO10_deputes_actifs_mandats_actifs_organes_XV.json.zip"
59
- },
60
- {
61
- filename: "AMO20_dep_sen_min_tous_mandats_et_organes_XVII.json",
62
- name: "AMO20_dep_sen_min_tous_mandats_et_organes_XVII",
63
- ignoreForWeb: !0,
64
- legislature: p.DixSept,
65
- repairZip: G,
66
- structure: v.SegmentedFiles,
67
- title: "Acteurs et organes de la XVIIème législature",
68
- url: "https://data.assemblee-nationale.fr/static/openData/repository/17/amo/deputes_senateurs_ministres_legislature/AMO20_dep_sen_min_tous_mandats_et_organes.json.zip"
69
- },
70
- {
71
- filename: "AMO20_dep_sen_min_tous_mandats_et_organes_XVI.json",
72
- name: "AMO20_dep_sen_min_tous_mandats_et_organes_XVI",
73
- ignoreForWeb: !0,
74
- legislature: p.Seize,
75
- repairZip: G,
76
- structure: v.SegmentedFiles,
77
- title: "Acteurs et organes de la XVIème législature",
78
- url: "https://data.assemblee-nationale.fr/static/openData/repository/16/amo/deputes_senateurs_ministres_legislature/AMO20_dep_sen_min_tous_mandats_et_organes.json.zip"
79
- },
80
- {
81
- filename: "AMO20_dep_sen_min_tous_mandats_et_organes_XV.json",
82
- name: "AMO20_dep_sen_min_tous_mandats_et_organes_XV",
83
- ignoreForWeb: !0,
84
- legislature: p.Quinze,
85
- repairZip: G,
86
- structure: v.SegmentedFiles,
87
- title: "Acteurs et organes de la XVème législature",
88
- url: "https://data.assemblee-nationale.fr/static/openData/repository/15/amo/deputes_senateurs_ministres_legislature/AMO20_dep_sen_min_tous_mandats_et_organes_XV.json.zip"
89
- },
90
- {
91
- filename: "AMO20_dep_sen_min_tous_mandats_et_organes_XIV.json",
92
- name: "AMO20_dep_sen_min_tous_mandats_et_organes_XIV",
93
- ignoreForWeb: !0,
94
- legislature: p.Quatorze,
95
- structure: v.SingleFile,
96
- title: "Acteurs et organes de la XIVème législature",
97
- 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"
98
- },
99
- {
100
- filename: "AMO30_tous_acteurs_tous_mandats_tous_organes_historique.json",
101
- name: "AMO30_tous_acteurs_tous_mandats_tous_organes_historique",
102
- legislature: p.All,
103
- repairZip: G,
104
- structure: v.SegmentedFiles,
105
- title: "Historique de tous les acteurs et organes depuis la XIème législature",
106
- url: "https://data.assemblee-nationale.fr/static/openData/repository/17/amo/tous_acteurs_mandats_organes_xi_legislature/AMO30_tous_acteurs_tous_mandats_tous_organes_historique.json.zip"
107
- },
108
- {
109
- filename: "AMO40_deputes_actifs_mandats_actifs_organes_divises_XVII.json",
110
- name: "AMO40_deputes_actifs_mandats_actifs_organes_divises_XVII",
111
- ignoreForWeb: !0,
112
- legislature: p.DixSept,
113
- repairZip: async (e, t) => {
114
- let n = _.join(t, e.filename);
115
- await g.pathExists(n) && await g.remove(n), await g.mkdir(n), await g.pathExists(_.join(t, `${e.filename}.temp`, "acteur")) && await g.move(_.join(t, `${e.filename}.temp`, "acteur"), _.join(n, "acteur")), await g.move(_.join(t, `${e.filename}.temp`, "organe"), _.join(n, "organe"));
116
- },
117
- structure: v.SegmentedFiles,
118
- title: "Députés actifs et organes de la XVIIème législature",
119
- url: "https://data.assemblee-nationale.fr/static/openData/repository/17/amo/deputes_actifs_mandats_actifs_organes_divises/AMO40_deputes_actifs_mandats_actifs_organes_divises.json.zip"
120
- },
121
- {
122
- filename: "AMO40_deputes_actifs_mandats_actifs_organes_divises_XVI.json",
123
- name: "AMO40_deputes_actifs_mandats_actifs_organes_divises_XVI",
124
- ignoreForWeb: !0,
125
- legislature: p.Seize,
126
- repairZip: async (e, t) => {
127
- let n = _.join(t, e.filename);
128
- await g.pathExists(n) && await g.remove(n), await g.mkdir(n), await g.pathExists(_.join(t, `${e.filename}.temp`, "acteur")) && await g.move(_.join(t, `${e.filename}.temp`, "acteur"), _.join(n, "acteur")), await g.move(_.join(t, `${e.filename}.temp`, "organe"), _.join(n, "organe"));
129
- },
130
- structure: v.SegmentedFiles,
131
- title: "Députés actifs et organes de la XVIème législature",
132
- url: "https://data.assemblee-nationale.fr/static/openData/repository/16/amo/deputes_actifs_mandats_actifs_organes_divises/AMO40_deputes_actifs_mandats_actifs_organes_divises.json.zip"
133
- },
134
- {
135
- filename: "AMO40_deputes_actifs_mandats_actifs_organes_divises_XV.json",
136
- name: "AMO40_deputes_actifs_mandats_actifs_organes_divises_XV",
137
- ignoreForWeb: !0,
138
- legislature: p.Quinze,
139
- repairZip: async (e, t) => {
140
- let n = _.join(t, e.filename);
141
- await g.pathExists(n) && await g.remove(n), await g.mkdir(n), await g.move(_.join(t, `${e.filename}.temp`, "acteur"), _.join(n, "acteur")), await g.move(_.join(t, `${e.filename}.temp`, "organe"), _.join(n, "organe"));
142
- },
143
- structure: v.SegmentedFiles,
144
- title: "Députés actifs et organes de la XVème législature",
145
- url: "https://data.assemblee-nationale.fr/static/openData/repository/15/amo/deputes_actifs_mandats_actifs_organes_divises/AMO40_deputes_actifs_mandats_actifs_organes_divises_XV.json.zip"
146
- },
147
- {
148
- filename: "AMO50_acteurs_mandats_organes_divises_XVII.json",
149
- name: "AMO50_acteurs_mandats_organes_divises_XVII",
150
- ignoreForWeb: !0,
151
- legislature: p.DixSept,
152
- repairZip: async (e, t) => {
153
- let n = _.join(t, e.filename);
154
- await g.pathExists(n) && await g.remove(n), await g.mkdir(n), await g.move(_.join(t, `${e.filename}.temp`, "mandat"), _.join(n, "mandat")), await g.move(_.join(t, `${e.filename}.temp`, "acteur"), _.join(n, "acteur")), await g.move(_.join(t, `${e.filename}.temp`, "organe"), _.join(n, "organe"));
155
- },
156
- structure: v.SegmentedFiles,
157
- title: "Acteurs, mandats et organes de la XVIIème législature (fichiers séparés, y compris mandats)",
158
- url: "https://data.assemblee-nationale.fr/static/openData/repository/17/amo/acteurs_mandats_organes_divises/AMO50_acteurs_mandats_organes_divises.json.zip"
159
- },
160
- {
161
- filename: "AMO50_acteurs_mandats_organes_divises_XVI.json",
162
- name: "AMO50_acteurs_mandats_organes_divises_XVI",
163
- ignoreForWeb: !0,
164
- legislature: p.Seize,
165
- repairZip: async (e, t) => {
166
- let n = _.join(t, e.filename);
167
- await g.pathExists(n) && await g.remove(n), await g.mkdir(n), await g.move(_.join(t, `${e.filename}.temp`, "mandat"), _.join(n, "mandat")), await g.move(_.join(t, `${e.filename}.temp`, "acteur"), _.join(n, "acteur")), await g.move(_.join(t, `${e.filename}.temp`, "organe"), _.join(n, "organe"));
168
- },
169
- structure: v.SegmentedFiles,
170
- title: "Acteurs, mandats et organes de la XVIème législature (fichiers séparés, y compris mandats)",
171
- url: "https://data.assemblee-nationale.fr/static/openData/repository/16/amo/acteurs_mandats_organes_divises/AMO50_acteurs_mandats_organes_divises.json.zip"
172
- },
173
- {
174
- filename: "AMO50_acteurs_mandats_organes_divises_XV.json",
175
- name: "AMO50_acteurs_mandats_organes_divises_XV",
176
- ignoreForWeb: !0,
177
- legislature: p.Quinze,
178
- repairZip: async (e, t) => {
179
- let n = _.join(t, e.filename);
180
- await g.pathExists(n) && await g.remove(n), await g.mkdir(n), await g.move(_.join(t, `${e.filename}.temp`, "mandat"), _.join(n, "mandat")), await g.move(_.join(t, `${e.filename}.temp`, "acteur"), _.join(n, "acteur")), await g.move(_.join(t, `${e.filename}.temp`, "organe"), _.join(n, "organe"));
181
- },
182
- structure: v.SegmentedFiles,
183
- title: "Acteurs, mandats et organes de la XVème législature (fichiers séparés, y compris mandats)",
184
- url: "https://data.assemblee-nationale.fr/static/openData/repository/15/amo/acteurs_mandats_organes_divises/AMO50_acteurs_mandats_organes_divises_XV.json.zip"
185
- }
186
- ],
187
- agendas: [
188
- {
189
- filename: "Agenda_XVII.json",
190
- name: "Agenda_XVII",
191
- legislature: p.DixSept,
192
- repairZip: G,
193
- structure: v.SegmentedFiles,
194
- title: "Agenda de la XVIIème législature",
195
- url: "https://data.assemblee-nationale.fr/static/openData/repository/17/vp/reunions/Agenda.json.zip"
196
- },
197
- {
198
- filename: "Agenda_XVI.json",
199
- name: "Agenda_XVI",
200
- legislature: p.Seize,
201
- repairZip: G,
202
- structure: v.SegmentedFiles,
203
- title: "Agenda de la XVIème législature",
204
- url: "https://data.assemblee-nationale.fr/static/openData/repository/16/vp/reunions/Agenda.json.zip"
205
- },
206
- {
207
- filename: "Agenda_XV.json",
208
- name: "Agenda_XV",
209
- legislature: p.Quinze,
210
- repairZip: G,
211
- structure: v.SegmentedFiles,
212
- title: "Agenda de la XVème législature",
213
- url: "https://data.assemblee-nationale.fr/static/openData/repository/15/vp/reunions/Agenda_XV.json.zip"
214
- },
215
- {
216
- filename: "Agenda_XIV.json",
217
- name: "Agenda_XIV",
218
- legislature: p.Quatorze,
219
- structure: v.SingleFile,
220
- title: "Agenda de la XIVème législature",
221
- url: "https://data.assemblee-nationale.fr/static/openData/repository/14/vp/reunions/Agenda_XIV.json.zip"
222
- }
223
- ],
224
- amendements: [
225
- {
226
- filename: "Amendements_XVII.json",
227
- name: "Amendements_XVII",
228
- legislature: p.DixSept,
229
- repairZip: G,
230
- structure: v.SegmentedFiles,
231
- title: "Amendements de la XVIIème législature",
232
- url: "https://data.assemblee-nationale.fr/static/openData/repository/17/loi/amendements_div_legis/Amendements.json.zip"
233
- },
234
- {
235
- filename: "Amendements_XVI.json",
236
- name: "Amendements_XVI",
237
- legislature: p.Seize,
238
- repairZip: G,
239
- structure: v.SegmentedFiles,
240
- title: "Amendements de la XVIème législature",
241
- url: "https://data.assemblee-nationale.fr/static/openData/repository/16/loi/amendements_div_legis/Amendements.json.zip"
242
- },
243
- {
244
- filename: "Amendements_XV.json",
245
- name: "Amendements_XV",
246
- legislature: p.Quinze,
247
- repairZip: G,
248
- structure: v.SegmentedFiles,
249
- title: "Amendements de la XVème législature",
250
- url: "https://data.assemblee-nationale.fr/static/openData/repository/15/loi/amendements_legis/Amendements_XV.json.zip"
251
- },
252
- {
253
- filename: "Amendements_XIV.json",
254
- name: "Amendements_XIV",
255
- ignoreForWeb: !0,
256
- legislature: p.Quatorze,
257
- structure: v.SingleFile,
258
- title: "Amendements de la XIVème législature",
259
- url: "https://data.assemblee-nationale.fr/static/openData/repository/14/loi/amendements_legis_XIV/Amendements_XIV.json.zip"
260
- }
261
- ],
262
- dossiersLegislatifs: [
263
- {
264
- filename: "Dossiers_Legislatifs_XVII.json",
265
- name: "Dossiers_Legislatifs_XVII",
266
- legislature: p.DixSept,
267
- repairZip: G,
268
- structure: v.SegmentedFiles,
269
- title: "Dossiers législatifs de la XVIIème législature",
270
- url: "https://data.assemblee-nationale.fr/static/openData/repository/17/loi/dossiers_legislatifs/Dossiers_Legislatifs.json.zip"
271
- },
272
- {
273
- filename: "Dossiers_Legislatifs_XVI.json",
274
- name: "Dossiers_Legislatifs_XVI",
275
- legislature: p.Seize,
276
- repairZip: G,
277
- structure: v.SegmentedFiles,
278
- title: "Dossiers législatifs de la XVIème législature",
279
- url: "https://data.assemblee-nationale.fr/static/openData/repository/16/loi/dossiers_legislatifs/Dossiers_Legislatifs.json.zip"
280
- },
281
- {
282
- filename: "Dossiers_Legislatifs_XV.json",
283
- name: "Dossiers_Legislatifs_XV",
284
- legislature: p.Quinze,
285
- repairZip: G,
286
- structure: v.SegmentedFiles,
287
- title: "Dossiers législatifs de la XVème législature",
288
- url: "https://data.assemblee-nationale.fr/static/openData/repository/15/loi/dossiers_legislatifs/Dossiers_Legislatifs_XV.json.zip"
289
- },
290
- {
291
- filename: "Dossiers_Legislatifs_XIV.json",
292
- name: "Dossiers_Legislatifs_XIV",
293
- legislature: p.Quatorze,
294
- structure: v.SingleFile,
295
- title: "Dossiers législatifs de la XIVème législature",
296
- url: "https://data.assemblee-nationale.fr/static/openData/repository/14/loi/dossiers_legislatifs/Dossiers_Legislatifs_XIV.json.zip"
297
- }
298
- ],
299
- scrutins: [
300
- {
301
- filename: "Scrutins_XVII.json",
302
- name: "Scrutins_XVII",
303
- legislature: p.DixSept,
304
- repairZip: G,
305
- structure: v.SegmentedFiles,
306
- title: "Scrutins de la XVIIème législature",
307
- url: "https://data.assemblee-nationale.fr/static/openData/repository/17/loi/scrutins/Scrutins.json.zip"
308
- },
309
- {
310
- filename: "Scrutins_XVI.json",
311
- name: "Scrutins_XVI",
312
- legislature: p.Seize,
313
- repairZip: G,
314
- structure: v.SegmentedFiles,
315
- title: "Scrutins de la XVIème législature",
316
- url: "https://data.assemblee-nationale.fr/static/openData/repository/16/loi/scrutins/Scrutins.json.zip"
317
- },
318
- {
319
- filename: "Scrutins_XV.json",
320
- name: "Scrutins_XV",
321
- legislature: p.Quinze,
322
- repairZip: G,
323
- structure: v.SegmentedFiles,
324
- title: "Scrutins de la XVème législature",
325
- url: "https://data.assemblee-nationale.fr/static/openData/repository/15/loi/scrutins/Scrutins_XV.json.zip"
326
- },
327
- {
328
- filename: "Scrutins_XIV.json",
329
- name: "Scrutins_XIV",
330
- legislature: p.Quatorze,
331
- structure: v.SingleFile,
332
- title: "Scrutins de la XIVème législature",
333
- url: "https://data.assemblee-nationale.fr/static/openData/repository/14/loi/scrutins/Scrutins_XIV.json.zip"
334
- }
335
- ],
336
- questions: [
337
- {
338
- filename: "Questions_ecrites_XVII.json",
339
- name: "Questions_ecrites_XVII",
340
- legislature: p.DixSept,
341
- repairZip: G,
342
- structure: v.SegmentedFiles,
343
- title: "Questions écrites de la XVIIème législature",
344
- url: "https://data.assemblee-nationale.fr/static/openData/repository/17/questions/questions_ecrites/Questions_ecrites.json.zip"
345
- },
346
- {
347
- filename: "Questions_ecrites_XVI.json",
348
- name: "Questions_ecrites_XVI",
349
- legislature: p.Seize,
350
- repairZip: G,
351
- structure: v.SegmentedFiles,
352
- title: "Questions écrites de la XVIème législature",
353
- url: "https://data.assemblee-nationale.fr/static/openData/repository/16/questions/questions_ecrites/Questions_ecrites.json.zip"
354
- },
355
- {
356
- filename: "Questions_gouvernement_XVII.json",
357
- name: "Questions_gouvernement_XVII",
358
- legislature: p.DixSept,
359
- repairZip: G,
360
- structure: v.SegmentedFiles,
361
- title: "Questions au gouvernement de la XVIIème législature",
362
- url: "https://data.assemblee-nationale.fr/static/openData/repository/17/questions/questions_gouvernement/Questions_gouvernement.json.zip"
363
- },
364
- {
365
- filename: "Questions_gouvernement_XVI.json",
366
- name: "Questions_gouvernement_XVI",
367
- legislature: p.Seize,
368
- repairZip: G,
369
- structure: v.SegmentedFiles,
370
- title: "Questions au gouvernement de la XVIème législature",
371
- url: "https://data.assemblee-nationale.fr/static/openData/repository/16/questions/questions_gouvernement/Questions_gouvernement.json.zip"
372
- },
373
- {
374
- filename: "Questions_orales_XVII.json",
375
- name: "Questions_orales_XVII",
376
- legislature: p.DixSept,
377
- repairZip: G,
378
- structure: v.SegmentedFiles,
379
- title: "Questions orales sans débats de la XVIIème législature",
380
- url: "https://data.assemblee-nationale.fr/static/openData/repository/17/questions/questions_orales_sans_debat/Questions_orales_sans_debat.json.zip"
381
- },
382
- {
383
- filename: "Questions_orales_XVI.json",
384
- name: "Questions_orales_XVI",
385
- legislature: p.Seize,
386
- repairZip: G,
387
- structure: v.SegmentedFiles,
388
- title: "Questions orales sans débats de la XVIème législature",
389
- url: "https://data.assemblee-nationale.fr/static/openData/repository/16/questions/questions_orales_sans_debat/Questions_orales_sans_debat.json.zip"
390
- }
391
- ],
392
- comptesRendus: [
393
- {
394
- filename: "Comptes_Rendus_Seances_XVII.xml",
395
- name: "Comptes_Rendus_Seances_XVII",
396
- legislature: p.DixSept,
397
- repairZip: async (e, t) => {
398
- let n = _.join(t, e.filename);
399
- await g.pathExists(n) && await g.remove(n), await g.move(_.join(t, `${e.filename}.temp`, "xml"), n);
400
- },
401
- structure: v.SegmentedFiles,
402
- title: "Comptes rendus des séances publiques de la XVIIème législature",
403
- url: "https://data.assemblee-nationale.fr/static/openData/repository/17/vp/syceronbrut/syseron.xml.zip"
404
- },
405
- {
406
- filename: "Comptes_Rendus_Seances_XVI.xml",
407
- name: "Comptes_Rendus_Seances_XVI",
408
- legislature: p.Seize,
409
- repairZip: async (e, t) => {
410
- let n = _.join(t, e.filename);
411
- await g.pathExists(n) && await g.remove(n), await g.move(_.join(t, `${e.filename}.temp`, "xml"), n);
412
- },
413
- structure: v.SegmentedFiles,
414
- title: "Comptes rendus des séances publiques de la XVIème législature",
415
- url: "https://data.assemblee-nationale.fr/static/openData/repository/16/vp/syceronbrut/syseron.xml.zip"
416
- },
417
- {
418
- filename: "Comptes_Rendus_Commissions_XVII.xml",
419
- name: "Comptes_Rendus_Commissions_XVII",
420
- legislature: p.DixSept,
421
- structure: v.SegmentedFiles,
422
- title: "Comptes rendus des commissions de la XVIIème législature"
423
- }
424
- ]
425
- };
426
- function* S(e, t, n, r, i, { log: a = !1, noValidation: o = !1, sinceCommits: s } = {}) {
427
- let c = /* @__PURE__ */ new Set();
428
- for (let l of n) {
429
- if (l.ignoreForWeb || !C(t, l)) continue;
430
- let n = _.join(e, `${l.name}_nettoye`), u = s ? s[l.name] : void 0, d = u ? m(n, u, { diffFilter: "AMR" }) : null;
431
- a && u && (console.log(`Filtering files changed since commit ${u} in ${n}`), console.log(`Found ${d?.size || 0} changed files`));
432
- for (let e of b(n, i)) {
433
- if (!e[e.length - 1].endsWith(".json")) continue;
434
- let t = _.join(n, ...e), i = _.join(...e), s = d?.get(i);
435
- if (d != null && s == null) continue;
436
- a && console.log(`Loading file: ${t}…`);
437
- let u = g.readFileSync(t, { encoding: "utf8" }), f = o ? JSON.parse(u) : r(u);
438
- c.has(f.uid) || (c.add(f.uid), yield {
439
- datasetLegislature: l.legislature,
440
- filePath: t,
441
- item: f,
442
- ...s && { gitStatus: s }
443
- });
444
- }
445
- if (u) {
446
- let e = m(n, u, { diffFilter: "D" });
447
- for (let [t, r] of e.entries()) {
448
- let e = _.join(n, t);
449
- a && console.log(`Deleted file: ${e}`);
450
- let i = { uid: _.parse(t).name };
451
- yield {
452
- datasetLegislature: l.legislature,
453
- filePath: e,
454
- item: i,
455
- gitStatus: r
456
- };
457
- }
458
- }
459
- }
460
- c.clear();
461
- }
462
- function C(e, t) {
463
- let n = Array.isArray(e) ? e : e === void 0 ? [] : [e];
464
- return e === void 0 || n.includes(0) || t.legislature === p.All ? !0 : n.includes(t.legislature);
465
- }
466
- function* w(e, t, n = {}, r) {
467
- for (let { datasetLegislature: i, item: a, filePath: o, gitStatus: s } of S(e, t, r ?? x.acteursEtOrganes, f.toActeur, ["acteurs"], n)) yield {
468
- acteur: a,
469
- datasetLegislature: i,
470
- filePath: o,
471
- ...s && { gitStatus: s }
472
- };
473
- }
474
- function* T(e, t, n = {}, r) {
475
- for (let { item: i, datasetLegislature: a, filePath: o, gitStatus: s } of S(e, t, r ?? x.acteursEtOrganes, f.toOrgane, ["organes"], n)) yield {
476
- organe: i,
477
- datasetLegislature: a,
478
- filePath: o,
479
- ...s && { gitStatus: s }
480
- };
481
- }
482
- function* E(t, n, r = {}, i) {
483
- for (let { datasetLegislature: a, item: o, filePath: s, gitStatus: c } of S(t, n, i ?? x.amendements, e.toAmendement, [], r)) yield {
484
- amendement: o,
485
- datasetLegislature: a,
486
- filePath: s,
487
- ...c && { gitStatus: c }
488
- };
489
- }
490
- function* D(e, t, n = {}, r) {
491
- for (let { item: i, datasetLegislature: a, filePath: o, gitStatus: s } of S(e, t, r ?? x.dossiersLegislatifs, c.toDocument, ["documents"], n)) yield {
492
- document: i,
493
- datasetLegislature: a,
494
- filePath: o,
495
- ...s && { gitStatus: s }
496
- };
497
- }
498
- function* O(e, t, n = {}, r) {
499
- for (let { item: i, datasetLegislature: a, filePath: o, gitStatus: s } of S(e, t, r ?? x.dossiersLegislatifs, c.toDossierParlementaire, ["dossiers"], n)) yield {
500
- dossierParlementaire: i,
501
- datasetLegislature: a,
502
- filePath: o,
503
- ...s && { gitStatus: s }
504
- };
505
- }
506
- function* k(e, t, n = {}, r) {
507
- for (let { item: i, datasetLegislature: a, filePath: o, gitStatus: s } of S(e, t, r ?? x.agendas, l.toReunion, [], n)) yield {
508
- reunion: i,
509
- datasetLegislature: a,
510
- filePath: o,
511
- ...s && { gitStatus: s }
512
- };
513
- }
514
- function* A(e, t, n = {}, r) {
515
- for (let { item: i, datasetLegislature: a, filePath: o, gitStatus: s } of S(e, t, r ?? x.scrutins, d.toScrutin, [], n)) yield {
516
- scrutin: i,
517
- datasetLegislature: a,
518
- filePath: o,
519
- ...s && { gitStatus: s }
520
- };
521
- }
522
- function* j(e, t, n = {}, r) {
523
- for (let { item: i, datasetLegislature: a, filePath: s, gitStatus: c } of S(e, t, r ?? x.questions, o.toQuestion, [], n)) yield {
524
- question: i,
525
- datasetLegislature: a,
526
- filePath: s,
527
- ...c && { gitStatus: c }
528
- };
529
- }
530
- function* M(e, t, n = {}, r) {
531
- for (let { item: a, datasetLegislature: o, filePath: s, gitStatus: c } of S(e, t, r ?? x.comptesRendus, i.toCompteRendu, [], n)) yield {
532
- compteRendu: a,
533
- datasetLegislature: o,
534
- filePath: s,
535
- ...c && { gitStatus: c }
536
- };
537
- }
538
- function N(t, n, r, { log: a = !1 } = {}) {
539
- let s = {}, u = {};
540
- if (n & y.ActeursEtOrganes) for (let e of x.acteursEtOrganes) {
541
- if (e.ignoreForWeb || r !== p.All && e.legislature !== p.All && r !== e.legislature) continue;
542
- let n = _.join(t, e.filename.replace(/\.json$/, "_nettoye"));
543
- for (let e of b(n, ["acteurs"])) {
544
- if (!e[e.length - 1].endsWith(".json")) continue;
545
- let t = _.join(n, ...e);
546
- a && console.log(`Loading file: ${t}…`);
547
- let r = g.readFileSync(t, { encoding: "utf8" }), i = f.toActeur(r);
548
- s[i.uid] === void 0 && (s[i.uid] = i);
549
- }
550
- for (let e of b(n, ["organes"])) {
551
- if (!e[e.length - 1].endsWith(".json")) continue;
552
- let t = _.join(n, ...e);
553
- a && console.log(`Loading file: ${t}…`);
554
- let r = g.readFileSync(t, { encoding: "utf8" }), i = f.toOrgane(r);
555
- u[i.uid] === void 0 && (u[i.uid] = i);
556
- }
557
- }
558
- let m = {}, h = {}, v = {};
559
- if (n & y.Agendas) for (let e of x.agendas) {
560
- if (e.ignoreForWeb || r !== p.All && e.legislature !== p.All && r !== e.legislature) continue;
561
- let n = _.join(t, e.filename.replace(/\.json$/, "_nettoye"));
562
- for (let e of b(n)) {
563
- if (!e[e.length - 1].endsWith(".json")) continue;
564
- let t = _.join(n, ...e);
565
- a && console.log(`Loading file: ${t}…`);
566
- let r = g.readFileSync(t, { encoding: "utf8" }), i = l.toReunion(r);
567
- m[i.uid] === void 0 && (m[i.uid] = i);
568
- let o = i.timestampDebut.toISOString().split("T")[0], s = h[o];
569
- s === void 0 && (s = h[o] = []), s.push(i);
570
- let c = i.odj;
571
- if (c !== void 0) for (let e of c.pointsOdj || []) for (let t of e.dossiersLegislatifsRefs || []) {
572
- let e = v[t];
573
- e === void 0 && (e = v[t] = []), e.push(i);
574
- }
575
- }
576
- }
577
- let S = {};
578
- if (n & y.Amendements) for (let n of x.amendements) {
579
- if (n.ignoreForWeb || r !== p.All && n.legislature !== p.All && r !== n.legislature) continue;
580
- let i = _.join(t, n.filename.replace(/\.json$/, "_nettoye"));
581
- for (let t of b(i)) {
582
- if (!t[t.length - 1].endsWith(".json")) continue;
583
- let n = _.join(i, ...t);
584
- a && console.log(`Loading file: ${n}…`);
585
- let r = g.readFileSync(n, { encoding: "utf8" }), o = e.toAmendement(r);
586
- S[o.uid] === void 0 && (S[o.uid] = o);
587
- }
588
- }
589
- let C = {}, w = {}, T = {}, E = {};
590
- if (n & y.DossiersLegislatifs) for (let e of x.dossiersLegislatifs) {
591
- if (e.ignoreForWeb || r !== p.All && e.legislature !== p.All && r !== e.legislature) continue;
592
- let n = _.join(t, e.filename.replace(/\.json$/, "_nettoye"));
593
- for (let e of b(n, ["documents"])) {
594
- if (!e[e.length - 1].endsWith(".json")) continue;
595
- let t = _.join(n, ...e);
596
- a && console.log(`Loading file: ${t}…`);
597
- let r = g.readFileSync(t, { encoding: "utf8" }), i = c.toDocument(r);
598
- C[i.uid] === void 0 && (C[i.uid] = i);
599
- }
600
- for (let e of b(n, ["dossiers"])) {
601
- if (!e[e.length - 1].endsWith(".json")) continue;
602
- let t = _.join(n, ...e);
603
- a && console.log(`Loading file: ${t}…`);
604
- let r = g.readFileSync(t, { encoding: "utf8" }), i = c.toDossierParlementaire(r), o = i.titreDossier;
605
- o.senatChemin && w[o.senatChemin] === void 0 && (w[o.senatChemin] = i), o.titreChemin && T[o.titreChemin] === void 0 && (T[o.titreChemin] = i), E[i.uid] === void 0 && (E[i.uid] = i);
606
- }
607
- }
608
- let D = {};
609
- if (n & y.Photos) {
610
- {
611
- let e = _.join(t, `photos_deputes_${r === p.All ? p.DixSept : r}`, "deputes.json");
612
- if (g.existsSync(e)) {
613
- a && console.log(`Loading file: ${e}`);
614
- let t = g.readFileSync(e, { encoding: "utf8" });
615
- Object.assign(D, JSON.parse(t));
616
- } else a && console.log(`Ignoring missing file: ${e}`);
617
- }
618
- {
619
- let e = _.join(t, "photos_senateurs", "senateurs.json");
620
- if (g.existsSync(e)) {
621
- a && console.log(`Loading file: ${e}`);
622
- let t = g.readFileSync(e, { encoding: "utf8" });
623
- Object.assign(D, JSON.parse(t));
624
- } else a && console.log(`Ignoring missing file: ${e}`);
625
- }
626
- }
627
- let O = {};
628
- if (n & y.Scrutins) for (let e of x.scrutins) {
629
- if (e.ignoreForWeb || r !== p.All && e.legislature !== p.All && r !== e.legislature) continue;
630
- let n = _.join(t, e.filename.replace(/\.json$/, "_nettoye"));
631
- for (let e of b(n)) {
632
- if (!e[e.length - 1].endsWith(".json")) continue;
633
- let t = _.join(n, ...e);
634
- a && console.log(`Loading file: ${t}…`);
635
- let r = g.readFileSync(t, { encoding: "utf8" }), i = d.toScrutin(r);
636
- O[i.uid] === void 0 && (O[i.uid] = i);
637
- }
638
- }
639
- let k = {};
640
- if (n & y.Questions) for (let e of x.questions) {
641
- if (e.ignoreForWeb || r !== p.All && e.legislature !== p.All && r !== e.legislature) continue;
642
- let n = _.join(t, e.filename.replace(/\.json$/, "_nettoye"));
643
- for (let e of b(n)) {
644
- if (!e[e.length - 1].endsWith(".json")) continue;
645
- let t = _.join(n, ...e);
646
- a && console.log(`Loading file: ${t}…`);
647
- let r = g.readFileSync(t, { encoding: "utf8" }), i = o.toQuestion(r);
648
- k[i.uid] === void 0 && (k[i.uid] = i);
649
- }
650
- }
651
- let A = {};
652
- if (n & y.ComptesRendus) for (let e of x.comptesRendus) {
653
- if (e.ignoreForWeb || r !== p.All && e.legislature !== p.All && r !== e.legislature) continue;
654
- let n = _.join(t, e.filename.replace(/\.json$/, "_nettoye"));
655
- for (let e of b(n)) {
656
- if (!e[e.length - 1].endsWith(".json")) continue;
657
- let t = _.join(n, ...e);
658
- a && console.log(`Loading file: ${t}…`);
659
- let r = g.readFileSync(t, { encoding: "utf8" }), o = i.toCompteRendu(r);
660
- A[o.uid] === void 0 && (A[o.uid] = o);
661
- }
662
- }
663
- return {
664
- acteurByUid: s,
665
- amendementByUid: S,
666
- documentByUid: C,
667
- dossierParlementaireBySenatChemin: w,
668
- dossierParlementaireByTitreChemin: T,
669
- dossierParlementaireByUid: E,
670
- organeByUid: u,
671
- photoByUid: D,
672
- reunionByUid: m,
673
- reunionsByDay: h,
674
- reunionsByDossierUid: v,
675
- scrutinByUid: O,
676
- questionByUid: k,
677
- compteRenduByUid: A
678
- };
679
- }
680
- function P(t, n, r, { log: a = !1 } = {}) {
681
- let s = {}, u = {};
682
- if (n & y.ActeursEtOrganes) for (let e of x.acteursEtOrganes) {
683
- if (e.ignoreForWeb || r !== p.All && e.legislature !== p.All && r !== e.legislature) continue;
684
- let n = _.join(t, e.filename.replace(/\.json$/, "_nettoye.json"));
685
- a && console.log(`Loading file: ${n}`);
686
- let i = g.readFileSync(n, { encoding: "utf8" }), o = f.toActeursEtOrganes(i);
687
- for (let e of o.acteurs) s[e.uid] === void 0 && (s[e.uid] = e);
688
- for (let e of o.organes) u[e.uid] === void 0 && (u[e.uid] = e);
689
- }
690
- let m = {}, h = {}, v = {};
691
- if (n & y.Agendas) for (let e of x.agendas) {
692
- if (e.ignoreForWeb || r !== p.All && e.legislature !== p.All && r !== e.legislature) continue;
693
- let n = _.join(t, e.filename.replace(/\.json$/, "_nettoye.json"));
694
- a && console.log(`Loading file: ${n}`);
695
- let i = g.readFileSync(n, { encoding: "utf8" }), o = l.toAgendas(i);
696
- for (let e of o.reunions) {
697
- m[e.uid] === void 0 && (m[e.uid] = e);
698
- let t = e.timestampDebut.toISOString().split("T")[0], n = h[t];
699
- n === void 0 && (n = h[t] = []), n.push(e);
700
- let r = e.odj;
701
- if (r !== void 0) for (let t of r.pointsOdj || []) for (let n of t.dossiersLegislatifsRefs || []) {
702
- let t = v[n];
703
- t === void 0 && (t = v[n] = []), t.push(e);
704
- }
705
- }
706
- }
707
- let b = {};
708
- if (n & y.Amendements) for (let n of x.amendements) {
709
- if (n.ignoreForWeb || r !== p.All && n.legislature !== p.All && r !== n.legislature) continue;
710
- let i = _.join(t, n.filename.replace(/\.json$/, "_nettoye.json"));
711
- a && console.log(`Loading file: ${i}`);
712
- let o = g.readFileSync(i, { encoding: "utf8" }), s = e.toAmendements(o);
713
- for (let e of s.textesLegislatifs) for (let t of e.amendements) b[t.uid] === void 0 && (b[t.uid] = t);
714
- }
715
- let S = {}, C = {}, w = {}, T = {};
716
- if (n & y.DossiersLegislatifs) for (let e of x.dossiersLegislatifs) {
717
- if (e.ignoreForWeb || r !== p.All && e.legislature !== p.All && r !== e.legislature) continue;
718
- let n = _.join(t, e.filename.replace(/\.json$/, "_nettoye.json"));
719
- a && console.log(`Loading file: ${n}`);
720
- let i = g.readFileSync(n, { encoding: "utf8" }), o = c.toDossiersLegislatifs(i);
721
- for (let e of o.textesLegislatifs) S[e.uid] === void 0 && (S[e.uid] = e);
722
- for (let e of o.dossiersParlementaires) {
723
- let t = e.titreDossier;
724
- t.senatChemin && C[t.senatChemin] === void 0 && (C[t.senatChemin] = e), t.titreChemin && w[t.titreChemin] === void 0 && (w[t.titreChemin] = e), T[e.uid] === void 0 && (T[e.uid] = e);
725
- }
726
- }
727
- let E = {};
728
- if (n & y.Photos) {
729
- let e = {};
730
- {
731
- let n = _.join(t, `photos_deputes_${r === p.All ? p.DixSept : r}`, "deputes.json");
732
- if (g.existsSync(n)) {
733
- a && console.log(`Loading file: ${n}`);
734
- let t = g.readFileSync(n, { encoding: "utf8" });
735
- Object.assign(e, JSON.parse(t));
736
- } else a && console.log(`Ignoring missing file: ${n}`);
737
- }
738
- {
739
- let n = _.join(t, "photos_senateurs", "senateurs.json");
740
- if (g.existsSync(n)) {
741
- a && console.log(`Loading file: ${n}`);
742
- let t = g.readFileSync(n, { encoding: "utf8" });
743
- Object.assign(e, JSON.parse(t));
744
- } else a && console.log(`Ignoring missing file: ${n}`);
745
- }
746
- }
747
- let D = {};
748
- if (n & y.Scrutins) for (let e of x.scrutins) {
749
- if (e.ignoreForWeb || r !== p.All && e.legislature !== p.All && r !== e.legislature) continue;
750
- let n = _.join(t, e.filename.replace(/\.json$/, "_nettoye.json"));
751
- a && console.log(`Loading file: ${n}`);
752
- let i = g.readFileSync(n, { encoding: "utf8" }), o = d.toScrutins(i);
753
- for (let e of o.scrutins) D[e.uid] === void 0 && (D[e.uid] = e);
754
- }
755
- let O = {};
756
- if (n & y.Questions) for (let e of x.questions) {
757
- if (e.ignoreForWeb || r !== p.All && e.legislature !== p.All && r !== e.legislature) continue;
758
- let n = _.join(t, e.filename.replace(/\.json$/, "_nettoye.json"));
759
- a && console.log(`Loading file: ${n}`);
760
- let i = g.readFileSync(n, { encoding: "utf8" }), s = o.toQuestions(i);
761
- for (let e of s.questions) O[e.uid] === void 0 && (O[e.uid] = e);
762
- }
763
- let k = {};
764
- if (n & y.ComptesRendus) for (let e of x.comptesRendus) {
765
- if (e.ignoreForWeb || r !== p.All && e.legislature !== p.All && r !== e.legislature) continue;
766
- let n = _.join(t, e.filename.replace(/\.json$/, "_nettoye.json"));
767
- a && console.log(`Loading file: ${n}`);
768
- let o = g.readFileSync(n, { encoding: "utf8" }), s = i.toComptesRendus(o);
769
- for (let e of s.comptesRendus) k[e.uid] === void 0 && (k[e.uid] = e);
770
- }
771
- return {
772
- acteurByUid: s,
773
- amendementByUid: b,
774
- documentByUid: S,
775
- dossierParlementaireBySenatChemin: C,
776
- dossierParlementaireByTitreChemin: w,
777
- dossierParlementaireByUid: T,
778
- organeByUid: u,
779
- photoByUid: E,
780
- reunionByUid: m,
781
- reunionsByDay: h,
782
- reunionsByDossierUid: v,
783
- scrutinByUid: D,
784
- questionByUid: O,
785
- compteRenduByUid: k
786
- };
787
- }
788
- function F(e, t, n) {
789
- let r = R(_.join(e, "Documents"), t), i = _.join(r, "index.json");
790
- if (!g.pathExistsSync(i)) return;
791
- let a = g.readJsonSync(i);
792
- for (let e of n) for (let { filename: t, url: n } of a[e] ?? []) if (t !== void 0) return {
793
- format: e,
794
- path: _.join(r, t),
795
- url: n
796
- };
797
- }
798
- function I(e, t, { log: n = !1 } = {}) {
799
- let r = _.join(e, `photos_deputes_${t === p.All ? p.DixSept : t}`, "deputes.json");
800
- n && console.log(`Loading file: ${r}`);
801
- let i = g.readFileSync(r, { encoding: "utf8" });
802
- return JSON.parse(i);
803
- }
804
- function L(e, { log: t = !1 } = {}) {
805
- let n = _.join(e, "photos_senateurs", "senateurs.json");
806
- t && console.log(`Loading file: ${n}`);
807
- let r = g.readFileSync(n, { encoding: "utf8" });
808
- return JSON.parse(r);
809
- }
810
- function R(e, t) {
811
- let n = t.match(r);
812
- h.notStrictEqual(n, null, `Unexpected structure for document UID: ${t}`);
813
- let i = n.groups, a = _.join(e, i.documentType ?? i.documentType2), o = _.join(a, i.chambre ?? i.chambre2), s = _.join(o, i.republique ?? i.republique2), c = _.join(s, i.legislature ?? i.legislature2), l = i.etat;
814
- if (l === void 0) return g.ensureDirSync(c), _.join(c, t);
815
- let u = _.join(c, l), d = "000000" + (i.numero ?? i.numero2);
816
- d = d.substring(d.length - 6);
817
- let f = _.join(u, d.substring(0, 3));
818
- return g.ensureDirSync(f), _.join(f, t);
819
- }
820
- function z(e, t) {
821
- return W(e, t, a);
822
- }
823
- function B(e, n) {
824
- let r = t.exec(n);
825
- h.notStrictEqual(r, null, `Unexpected structure for reunion UID: ${n}`);
826
- let i = _.join(e, r[1]), a = _.join(i, r[2]), o = _.join(a, r[3]), s = _.join(o, r[4]), c = _.join(s, r[5]), l = "000000000" + r[6];
827
- l = l.substring(l.length - 9);
828
- let u = _.join(c, l.substring(0, 3)), d = _.join(u, l.substring(3, 3));
829
- return g.ensureDirSync(d), _.join(d, n);
830
- }
831
- function V(e, t) {
832
- let r = n.exec(t);
833
- h.notStrictEqual(r, null, `Unexpected structure for scrutin UID: ${t}`);
834
- let i = _.join(e, r[1]), a = _.join(i, r[2]), o = _.join(a, r[3]), s = "000000" + r[4];
835
- s = s.substring(s.length - 6);
836
- let c = _.join(o, s.substring(0, 3));
837
- return g.ensureDirSync(c), _.join(c, t);
838
- }
839
- function H(e, t) {
840
- return W(e, t, s);
841
- }
842
- function U(e, t) {
843
- let n = u.exec(t);
844
- h.notStrictEqual(n, null, `Unexpected structure for object with UID: ${t}`);
845
- let r = _.join(e, n[2]), i = _.join(r, n[3]), a = _.join(i, n[4]), o = _.join(a, n[5]), s = "000000000" + n[7];
846
- s = s.substring(s.length - 9);
847
- let c = _.join(o, s.substring(0, 3)), l = _.join(c, s.substring(3, 3));
848
- return g.ensureDirSync(l), _.join(l, t);
849
- }
850
- function W(e, t, n) {
851
- let r = n.exec(t);
852
- h.notStrictEqual(r, null, `Unexpected structure for object with UID: ${t}`);
853
- let i = _.join(e, r[1]), a = _.join(i, r[2]), o = "000000" + r[3];
854
- o = o.substring(o.length - 6);
855
- let s = _.join(a, o.substring(0, 3));
856
- return g.ensureDirSync(s), _.join(s, t);
857
- }
858
- async function G(e, t) {
859
- let n = _.join(t, e.filename);
860
- await g.pathExists(n) && await g.remove(n), await g.pathExists(_.join(t, `${e.filename}.temp`, "json")) ? await g.move(_.join(t, `${e.filename}.temp`, "json"), n) : await g.mkdir(n);
861
- }
862
- //#endregion
863
- export { y as C, b as S, R as _, D as a, B as b, j as c, N as d, P as f, U as g, L as h, M as i, k as l, I as m, w as n, O as o, F as p, E as r, T as s, x as t, A as u, z as v, V as x, H as y };