@tricoteuses/assemblee 2.5.23 → 2.5.25

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
@@ -1,719 +1,21 @@
1
- import C from "node:assert";
2
- import n from "fs-extra";
3
- import i from "node:path";
4
- import "node:crypto";
5
- import { L as r, a1 as U, a2 as M, a3 as q, a4 as Z, a5 as B, a6 as J, Y, $ as G, a0 as K, X as ee, Z as te, _ as se } from "./uids-DaRrTkI-.js";
1
+ import E from "node:assert";
2
+ import m from "fs-extra";
3
+ import s from "node:path";
4
+ import { a1 as F, a2 as P, L as g, a3 as W, a4 as M, a5 as J, a6 as w, a7 as T, a8 as Q, Y as Z, $ as G, a0 as H, X as K, Z as ee, _ as ne } from "./datasets-BCg11CdK.js";
6
5
  import "glob";
7
- import { getChangedFilesSinceCommit as k } from "./git.js";
8
- import { C as N } from "./amendements-40Z7OJLT.js";
9
- var v = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.ActeursEtOrganes = 1] = "ActeursEtOrganes", t[t.Agendas = 2] = "Agendas", t[t.Amendements = 4] = "Amendements", t[t.DossiersLegislatifs = 8] = "DossiersLegislatifs", t[t.Photos = 16] = "Photos", t[t.Scrutins = 32] = "Scrutins", t[t.Questions = 64] = "Questions", t[t.ComptesRendusSeances = 128] = "ComptesRendusSeances", t[t.All = 255] = "All", t))(v || {});
10
- async function h(t, s) {
11
- const e = i.join(s, t.filename);
12
- await n.pathExists(e) && await n.remove(e), await n.pathExists(i.join(s, `${t.filename}.temp`, "json")) ? await n.move(
13
- i.join(s, `${t.filename}.temp`, "json"),
14
- e
15
- ) : await n.mkdir(e);
16
- }
17
- const S = {
18
- acteursEtOrganes: [
19
- {
20
- // AMO10 (XVII)
21
- //
22
- // Contient les députés actifs
23
- // * avec tous les mandats en cours
24
- // * y compris avec leur parti politique (typeOrgane: "PARPOL")
25
- // * mais sans les mandats achevés (y compris dans cette législature)
26
- //
27
- // Organes :
28
- // * Contient seulement les organes correspondants aux mandats en cours
29
- // * avec le xsiType de l'organe
30
- // * avec des commissions sénatoriales (permanentes et spéciales) en cours
31
- // * avec des délégations sénatoriales en cours
32
- // * avec des groupes sénatoriaux en cours
33
- // * avec des ministères en cours
34
- // * avec les Présidences de la République (y compris Sarkozy)
35
- // * avec le Conseil constitutionnel
36
- //
37
- // Ce fichier est un sous-ensemble à tous les niveaux du fichier AMO20
38
- // (qui est lui même un sous-ensemble de l'AMO30).
39
- // Il n'apporte donc absolument rien par rapport à AMO20 ou l'AMO30.
40
- filename: "AMO10_deputes_actifs_mandats_actifs_organes_XVII.json",
41
- ignoreForWeb: !0,
42
- legislature: r.DixSept,
43
- repairZip: h,
44
- structure: 1,
45
- title: "Députés actifs et organes de la XVIIème législature",
46
- url: "https://data.assemblee-nationale.fr/static/openData/repository/17/amo/deputes_actifs_mandats_actifs_organes/AMO10_deputes_actifs_mandats_actifs_organes.json.zip"
47
- },
48
- {
49
- // AMO10 (XVI)
50
- //
51
- // Contient les députés actifs
52
- // * avec tous les mandats en cours
53
- // * y compris avec leur parti politique (typeOrgane: "PARPOL")
54
- // * mais sans les mandats achevés (y compris dans cette législature)
55
- //
56
- // Organes :
57
- // * Contient seulement les organes correspondants aux mandats en cours
58
- // * avec le xsiType de l'organe
59
- // * avec des commissions sénatoriales (permanentes et spéciales) en cours
60
- // * avec des délégations sénatoriales en cours
61
- // * avec des groupes sénatoriaux en cours
62
- // * avec des ministères en cours
63
- // * avec les Présidences de la République (y compris Sarkozy)
64
- // * avec le Conseil constitutionnel
65
- //
66
- // Ce fichier est un sous-ensemble à tous les niveaux du fichier AMO20
67
- // (qui est lui même un sous-ensemble de l'AMO30).
68
- // Il n'apporte donc absolument rien par rapport à AMO20 ou l'AMO30.
69
- filename: "AMO10_deputes_actifs_mandats_actifs_organes_XVI.json",
70
- ignoreForWeb: !0,
71
- legislature: r.Seize,
72
- repairZip: h,
73
- structure: 1,
74
- title: "Députés actifs et organes de la XVIème législature",
75
- url: "https://data.assemblee-nationale.fr/static/openData/repository/16/amo/deputes_actifs_mandats_actifs_organes/AMO10_deputes_actifs_mandats_actifs_organes.json.zip"
76
- },
77
- {
78
- // AMO10 (XV)
79
- //
80
- // Contient les députés actifs
81
- // * avec tous les mandats en cours
82
- // * y compris avec leur parti politique (typeOrgane: "PARPOL")
83
- // * mais sans les mandats achevés (y compris dans cette législature)
84
- //
85
- // Organes :
86
- // * Contient seulement les organes correspondants aux mandats en cours
87
- // * avec le xsiType de l'organe
88
- // * avec des commissions sénatoriales (permanentes et spéciales) en cours
89
- // * avec des délégations sénatoriales en cours
90
- // * avec des groupes sénatoriaux en cours
91
- // * avec des ministères en cours
92
- // * avec les Présidences de la République (y compris Sarkozy)
93
- // * avec le Conseil constitutionnel
94
- //
95
- // Ce fichier est un sous-ensemble à tous les niveaux du fichier AMO20
96
- // (qui est lui même un sous-ensemble de l'AMO30).
97
- // Il n'apporte donc absolument rien par rapport à AMO20 ou l'AMO30.
98
- filename: "AMO10_deputes_actifs_mandats_actifs_organes_XV.json",
99
- ignoreForWeb: !0,
100
- legislature: r.Quinze,
101
- repairZip: h,
102
- structure: 1,
103
- title: "Députés actifs et organes de la XVème législature",
104
- 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"
105
- },
106
- {
107
- // AMO20 (XVII)
108
- //
109
- // Contient les députés de la législature, actifs ou non (invalidés, etc), les sénateurs actuels
110
- // Pour les députés :
111
- // * avec tous leurs mandats de la législature
112
- // * y compris les mandats achevés
113
- // * y compris leurs partis politiques (typeOrgane: "PARPOL")
114
- // * mais sans les mandats des législatures précédentes (qui sont dans AMO40)
115
- //
116
- // Contient tous les organes référencés par les mandats
117
- // * avec le xsiType de l'organe
118
- // * avec des commissions sénatoriales (permanentes et spéciales) en cours
119
- // * avec des délégations sénatoriales en cours
120
- // * avec des groupes sénatoriaux en cours
121
- // * avec des ministères en cours
122
- // * avec les Présidences de la République (y compris Sarkozy)
123
- // * avec le Conseil constitutionnel
124
- //
125
- // Ce fichier est un sous-ensemble à tous les niveaux du fichier AMO30.
126
- // Il n'apporte donc absolument rien par rapport à l'AMO30.
127
- filename: "AMO20_dep_sen_min_tous_mandats_et_organes_XVII.json",
128
- ignoreForWeb: !0,
129
- legislature: r.DixSept,
130
- repairZip: h,
131
- structure: 1,
132
- title: "Acteurs et organes de la XVIIème législature",
133
- 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"
134
- },
135
- {
136
- // AMO20 (XVI)
137
- //
138
- // Contient les députés de la législature, actifs ou non (invalidés, etc), les sénateurs actuels
139
- // Pour les députés :
140
- // * avec tous leurs mandats de la législature
141
- // * y compris les mandats achevés
142
- // * y compris leurs partis politiques (typeOrgane: "PARPOL")
143
- // * mais sans les mandats des législatures précédentes (qui sont dans AMO40)
144
- //
145
- // Contient tous les organes référencés par les mandats
146
- // * avec le xsiType de l'organe
147
- // * avec des commissions sénatoriales (permanentes et spéciales) en cours
148
- // * avec des délégations sénatoriales en cours
149
- // * avec des groupes sénatoriaux en cours
150
- // * avec des ministères en cours
151
- // * avec les Présidences de la République (y compris Sarkozy)
152
- // * avec le Conseil constitutionnel
153
- //
154
- // Ce fichier est un sous-ensemble à tous les niveaux du fichier AMO30.
155
- // Il n'apporte donc absolument rien par rapport à l'AMO30.
156
- filename: "AMO20_dep_sen_min_tous_mandats_et_organes_XVI.json",
157
- ignoreForWeb: !0,
158
- legislature: r.Seize,
159
- repairZip: h,
160
- structure: 1,
161
- title: "Acteurs et organes de la XVIème législature",
162
- 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"
163
- },
164
- {
165
- // AMO20 (XV)
166
- //
167
- // Contient les députés de la législature, actifs ou non (invalidés, etc), les sénateurs actuels
168
- // Pour les députés :
169
- // * avec tous leurs mandats de la législature
170
- // * y compris les mandats achevés
171
- // * y compris leurs partis politiques (typeOrgane: "PARPOL")
172
- // * mais sans les mandats des législatures précédentes (qui sont dans AMO40)
173
- //
174
- // Contient tous les organes référencés par les mandats
175
- // * avec le xsiType de l'organe
176
- // * avec des commissions sénatoriales (permanentes et spéciales) en cours
177
- // * avec des délégations sénatoriales en cours
178
- // * avec des groupes sénatoriaux en cours
179
- // * avec des ministères en cours
180
- // * avec les Présidences de la République (y compris Sarkozy)
181
- // * avec le Conseil constitutionnel
182
- //
183
- // Ce fichier est un sous-ensemble à tous les niveaux du fichier AMO30.
184
- // Il n'apporte donc absolument rien par rapport à l'AMO30.
185
- filename: "AMO20_dep_sen_min_tous_mandats_et_organes_XV.json",
186
- ignoreForWeb: !0,
187
- legislature: r.Quinze,
188
- repairZip: h,
189
- structure: 1,
190
- title: "Acteurs et organes de la XVème législature",
191
- 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"
192
- },
193
- {
194
- // AMO20 (XIV)
195
- //
196
- // Comme AMO20 (XV) mais pour la XIVème législature
197
- // Tous les acteurs sauf un (PA429892) sont présents en plus à jour dans AMO30.
198
- // Cet acteur PA429892 (ancienne Sénatrice) n'est présent dans aucun des autres
199
- // fichiers AMO.
200
- // Tous les organes sont présents en plus complets dans AMO30.
201
- //
202
- // Ce fichier est donc à un détail prêt (PA429892) un sous-ensemble d'AMO30.
203
- // Il n'apporte donc quasiment rien par rapport à l'AMO30.
204
- filename: "AMO20_dep_sen_min_tous_mandats_et_organes_XIV.json",
205
- ignoreForWeb: !0,
206
- legislature: r.Quatorze,
207
- structure: 0,
208
- title: "Acteurs et organes de la XIVème législature",
209
- 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
- },
211
- {
212
- // AMO30 (XVII)
213
- //
214
- // Ce fichier contient tous les acteurs et organes.
215
- // C'est un sur-ensemble des fichiers AMO20.
216
- filename: "AMO30_tous_acteurs_tous_mandats_tous_organes_historique.json",
217
- legislature: r.All,
218
- repairZip: h,
219
- structure: 1,
220
- title: "Historique de tous les acteurs et organes depuis la XIème législature",
221
- 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"
222
- },
223
- // {
224
- // // AMO30 (XVI)
225
- // //
226
- // // Ce fichier contient tous les acteurs et organes.
227
- // // C'est un sur-ensemble des fichiers AMO20.
228
- // filename: "AMO30_tous_acteurs_tous_mandats_tous_organes_historique.json",
229
- // legislature: Legislature.All,
230
- // repairZip: repairForJsonSubdirectory,
231
- // structure: DatasetStructure.SegmentedFiles,
232
- // title:
233
- // "Historique de tous les acteurs et organes depuis la XIème législature",
234
- // url: "https://data.assemblee-nationale.fr/static/openData/repository/16/amo/tous_acteurs_mandats_organes_xi_legislature/AMO30_tous_acteurs_tous_mandats_tous_organes_historique.json.zip",
235
- // },
236
- // {
237
- // // AMO30 (XV)
238
- // //
239
- // // Ce fichier contient tous les acteurs et organes.
240
- // // C'est un sur-ensemble des fichiers AMO20.
241
- // filename: "AMO30_tous_acteurs_tous_mandats_tous_organes_historique.json",
242
- // legislature: Legislature.All,
243
- // repairZip: (dataset: Dataset, dataDir: string) => {
244
- // const targetDir = path.join(dataDir, dataset.filename)
245
- // if (fs.existsSync(targetDir)) {
246
- // fs.removeSync(targetDir)
247
- // }
248
- // fs.moveSync(path.join(dataDir, "json"), targetDir)
249
- // },
250
- // structure: DatasetStructure.SegmentedFiles,
251
- // title:
252
- // "Historique de tous les acteurs et organes depuis la XIème législature",
253
- // url: "https://data.assemblee-nationale.fr/static/openData/repository/15/amo/tous_acteurs_mandats_organes_xi_legislature/AMO30_tous_acteurs_tous_mandats_tous_organes_historique.json.zip",
254
- // },
255
- {
256
- // AMO40 (XVII)
257
- //
258
- // Contient les députés actifs (les mêmes qu'AMO20)
259
- // * avec presque tous leurs mandats
260
- // * y compris les mandats achevés et ceux des législatures précédentes
261
- // * y compris leurs partis politiques précédents
262
- // * mais sans leur parti politique actuel (typeOrgane: "PARPOL")
263
- //
264
- // Contient beaucoup d'organes référencés, y compris ceux des législatures
265
- // précédentes
266
- // * mais il manque le xsiType des organes
267
- // * ne contient pas les organes sénatoriaux
268
- // * ne contient pas les ministères
269
- // * ne contient pas la Présidence de la République
270
- // * ne contient pas le Conseil constitutionnel
271
- //
272
- // Pour les acteurs, ce dépôt est un sous-ensemble strict de AMO30 :
273
- // Il a moins d'acteurs et il sont moins complets.
274
- //
275
- // Pour les organes :
276
- // Quand l'organe est aussi présent dans AMO30, il vaut mieux prendre celui
277
- // d'AMO30, car il contient le xsiType (c'est la seule différence semble-t-i).
278
- // Sinon, il faut le prendre seulement si on est intéressé par les législatures
279
- // précédentes.
280
- filename: "AMO40_deputes_actifs_mandats_actifs_organes_divises_XVII.json",
281
- ignoreForWeb: !0,
282
- legislature: r.DixSept,
283
- repairZip: async (t, s) => {
284
- const e = i.join(s, t.filename);
285
- await n.pathExists(e) && await n.remove(e), await n.mkdir(e), await n.pathExists(
286
- i.join(s, `${t.filename}.temp`, "acteur")
287
- ) && await n.move(
288
- i.join(s, `${t.filename}.temp`, "acteur"),
289
- i.join(e, "acteur")
290
- ), await n.move(
291
- i.join(s, `${t.filename}.temp`, "organe"),
292
- i.join(e, "organe")
293
- );
294
- },
295
- structure: 1,
296
- title: "Députés actifs et organes de la XVIIème législature",
297
- 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"
298
- },
299
- {
300
- // AMO40 (XVI)
301
- //
302
- // Contient les députés actifs (les mêmes qu'AMO20)
303
- // * avec presque tous leurs mandats
304
- // * y compris les mandats achevés et ceux des législatures précédentes
305
- // * y compris leurs partis politiques précédents
306
- // * mais sans leur parti politique actuel (typeOrgane: "PARPOL")
307
- //
308
- // Contient beaucoup d'organes référencés, y compris ceux des législatures
309
- // précédentes
310
- // * mais il manque le xsiType des organes
311
- // * ne contient pas les organes sénatoriaux
312
- // * ne contient pas les ministères
313
- // * ne contient pas la Présidence de la République
314
- // * ne contient pas le Conseil constitutionnel
315
- //
316
- // Pour les acteurs, ce dépôt est un sous-ensemble strict de AMO30 :
317
- // Il a moins d'acteurs et il sont moins complets.
318
- //
319
- // Pour les organes :
320
- // Quand l'organe est aussi présent dans AMO30, il vaut mieux prendre celui
321
- // d'AMO30, car il contient le xsiType (c'est la seule différence semble-t-i).
322
- // Sinon, il faut le prendre seulement si on est intéressé par les législatures
323
- // précédentes.
324
- filename: "AMO40_deputes_actifs_mandats_actifs_organes_divises_XVI.json",
325
- ignoreForWeb: !0,
326
- legislature: r.Seize,
327
- repairZip: async (t, s) => {
328
- const e = i.join(s, t.filename);
329
- await n.pathExists(e) && await n.remove(e), await n.mkdir(e), await n.pathExists(
330
- i.join(s, `${t.filename}.temp`, "acteur")
331
- ) && await n.move(
332
- i.join(s, `${t.filename}.temp`, "acteur"),
333
- i.join(e, "acteur")
334
- ), await n.move(
335
- i.join(s, `${t.filename}.temp`, "organe"),
336
- i.join(e, "organe")
337
- );
338
- },
339
- structure: 1,
340
- title: "Députés actifs et organes de la XVIème législature",
341
- 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"
342
- },
343
- {
344
- // AMO40 (XV)
345
- //
346
- // Contient les députés actifs (les mêmes qu'AMO20)
347
- // * avec presque tous leurs mandats
348
- // * y compris les mandats achevés et ceux des législatures précédentes
349
- // * y compris leurs partis politiques précédents
350
- // * mais sans leur parti politique actuel (typeOrgane: "PARPOL")
351
- //
352
- // Contient beaucoup d'organes référencés, y compris ceux des législatures
353
- // précédentes
354
- // * mais il manque le xsiType des organes
355
- // * ne contient pas les organes sénatoriaux
356
- // * ne contient pas les ministères
357
- // * ne contient pas la Présidence de la République
358
- // * ne contient pas le Conseil constitutionnel
359
- //
360
- // Pour les acteurs, ce dépôt est un sous-ensemble strict de AMO30 :
361
- // Il a moins d'acteurs et il sont moins complets.
362
- //
363
- // Pour les organes :
364
- // Quand l'organe est aussi présent dans AMO30, il vaut mieux prendre celui
365
- // d'AMO30, car il contient le xsiType (c'est la seule différence semble-t-i).
366
- // Sinon, il faut le prendre seulement si on est intéressé par les législatures
367
- // précédentes.
368
- filename: "AMO40_deputes_actifs_mandats_actifs_organes_divises_XV.json",
369
- ignoreForWeb: !0,
370
- legislature: r.Quinze,
371
- repairZip: async (t, s) => {
372
- const e = i.join(s, t.filename);
373
- await n.pathExists(e) && await n.remove(e), await n.mkdir(e), await n.move(
374
- i.join(s, `${t.filename}.temp`, "acteur"),
375
- i.join(e, "acteur")
376
- ), await n.move(
377
- i.join(s, `${t.filename}.temp`, "organe"),
378
- i.join(e, "organe")
379
- );
380
- },
381
- structure: 1,
382
- title: "Députés actifs et organes de la XVème législature",
383
- 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"
384
- },
385
- {
386
- // AMO50 (XVII)
387
- //
388
- // Attention, ce fichier n'est pas mis à jour régulièrement !
389
- //
390
- // Pour les acteurs :
391
- // * c'est un sous ensemble obsolète d'AMO30
392
- // * il manque les xsiType aux mandats
393
- //
394
- // Pour les organes :
395
- // * c'est un sous ensemble obsolète d'AMO30
396
- // * il manque les xsiType
397
- //
398
- // Ce fichier n'apporte donc absolument rien par rapport à l'AMO30,
399
- // dont il est un sous ensemble obsolète.
400
- filename: "AMO50_acteurs_mandats_organes_divises_XVII.json",
401
- ignoreForWeb: !0,
402
- legislature: r.DixSept,
403
- repairZip: async (t, s) => {
404
- const e = i.join(s, t.filename);
405
- await n.pathExists(e) && await n.remove(e), await n.mkdir(e), await n.move(
406
- i.join(s, `${t.filename}.temp`, "mandat"),
407
- i.join(e, "mandat")
408
- ), await n.move(
409
- i.join(s, `${t.filename}.temp`, "acteur"),
410
- i.join(e, "acteur")
411
- ), await n.move(
412
- i.join(s, `${t.filename}.temp`, "organe"),
413
- i.join(e, "organe")
414
- );
415
- },
416
- structure: 1,
417
- title: "Acteurs, mandats et organes de la XVIIème législature (fichiers séparés, y compris mandats)",
418
- url: "https://data.assemblee-nationale.fr/static/openData/repository/17/amo/acteurs_mandats_organes_divises/AMO50_acteurs_mandats_organes_divises.json.zip"
419
- },
420
- {
421
- // AMO50 (XVI)
422
- //
423
- // Attention, ce fichier n'est pas mis à jour régulièrement !
424
- //
425
- // Pour les acteurs :
426
- // * c'est un sous ensemble obsolète d'AMO30
427
- // * il manque les xsiType aux mandats
428
- //
429
- // Pour les organes :
430
- // * c'est un sous ensemble obsolète d'AMO30
431
- // * il manque les xsiType
432
- //
433
- // Ce fichier n'apporte donc absolument rien par rapport à l'AMO30,
434
- // dont il est un sous ensemble obsolète.
435
- filename: "AMO50_acteurs_mandats_organes_divises_XVI.json",
436
- ignoreForWeb: !0,
437
- legislature: r.Seize,
438
- repairZip: async (t, s) => {
439
- const e = i.join(s, t.filename);
440
- await n.pathExists(e) && await n.remove(e), await n.mkdir(e), await n.move(
441
- i.join(s, `${t.filename}.temp`, "mandat"),
442
- i.join(e, "mandat")
443
- ), await n.move(
444
- i.join(s, `${t.filename}.temp`, "acteur"),
445
- i.join(e, "acteur")
446
- ), await n.move(
447
- i.join(s, `${t.filename}.temp`, "organe"),
448
- i.join(e, "organe")
449
- );
450
- },
451
- structure: 1,
452
- title: "Acteurs, mandats et organes de la XVIème législature (fichiers séparés, y compris mandats)",
453
- url: "https://data.assemblee-nationale.fr/static/openData/repository/16/amo/acteurs_mandats_organes_divises/AMO50_acteurs_mandats_organes_divises.json.zip"
454
- },
455
- {
456
- // AMO50 (XV)
457
- //
458
- // Attention, ce fichier n'est pas mis à jour régulièrement !
459
- //
460
- // Pour les acteurs :
461
- // * c'est un sous ensemble obsolète d'AMO30
462
- // * il manque les xsiType aux mandats
463
- //
464
- // Pour les organes :
465
- // * c'est un sous ensemble obsolète d'AMO30
466
- // * il manque les xsiType
467
- //
468
- // Ce fichier n'apporte donc absolument rien par rapport à l'AMO30,
469
- // dont il est un sous ensemble obsolète.
470
- filename: "AMO50_acteurs_mandats_organes_divises_XV.json",
471
- ignoreForWeb: !0,
472
- legislature: r.Quinze,
473
- repairZip: async (t, s) => {
474
- const e = i.join(s, t.filename);
475
- await n.pathExists(e) && await n.remove(e), await n.mkdir(e), await n.move(
476
- i.join(s, `${t.filename}.temp`, "mandat"),
477
- i.join(e, "mandat")
478
- ), await n.move(
479
- i.join(s, `${t.filename}.temp`, "acteur"),
480
- i.join(e, "acteur")
481
- ), await n.move(
482
- i.join(s, `${t.filename}.temp`, "organe"),
483
- i.join(e, "organe")
484
- );
485
- },
486
- structure: 1,
487
- title: "Acteurs, mandats et organes de la XVème législature (fichiers séparés, y compris mandats)",
488
- url: "https://data.assemblee-nationale.fr/static/openData/repository/15/amo/acteurs_mandats_organes_divises/AMO50_acteurs_mandats_organes_divises_XV.json.zip"
489
- }
490
- ],
491
- agendas: [
492
- {
493
- filename: "Agenda_XVII.json",
494
- legislature: r.DixSept,
495
- repairZip: h,
496
- structure: 1,
497
- title: "Agenda de la XVIIème législature",
498
- url: "https://data.assemblee-nationale.fr/static/openData/repository/17/vp/reunions/Agenda.json.zip"
499
- },
500
- {
501
- filename: "Agenda_XVI.json",
502
- legislature: r.Seize,
503
- repairZip: h,
504
- structure: 1,
505
- title: "Agenda de la XVIème législature",
506
- url: "https://data.assemblee-nationale.fr/static/openData/repository/16/vp/reunions/Agenda.json.zip"
507
- },
508
- {
509
- filename: "Agenda_XV.json",
510
- legislature: r.Quinze,
511
- repairZip: h,
512
- structure: 1,
513
- title: "Agenda de la XVème législature",
514
- url: "https://data.assemblee-nationale.fr/static/openData/repository/15/vp/reunions/Agenda_XV.json.zip"
515
- },
516
- {
517
- filename: "Agenda_XIV.json",
518
- legislature: r.Quatorze,
519
- structure: 0,
520
- title: "Agenda de la XIVème législature",
521
- url: "https://data.assemblee-nationale.fr/static/openData/repository/14/vp/reunions/Agenda_XIV.json.zip"
522
- }
523
- ],
524
- amendements: [
525
- {
526
- filename: "Amendements_XVII.json",
527
- legislature: r.DixSept,
528
- repairZip: h,
529
- structure: 1,
530
- title: "Amendements de la XVIIème législature",
531
- url: "https://data.assemblee-nationale.fr/static/openData/repository/17/loi/amendements_div_legis/Amendements.json.zip"
532
- },
533
- {
534
- filename: "Amendements_XVI.json",
535
- legislature: r.Seize,
536
- repairZip: h,
537
- structure: 1,
538
- title: "Amendements de la XVIème législature",
539
- url: "https://data.assemblee-nationale.fr/static/openData/repository/16/loi/amendements_div_legis/Amendements.json.zip"
540
- },
541
- {
542
- filename: "Amendements_XV.json",
543
- legislature: r.Quinze,
544
- repairZip: h,
545
- structure: 1,
546
- title: "Amendements de la XVème législature",
547
- url: "https://data.assemblee-nationale.fr/static/openData/repository/15/loi/amendements_legis/Amendements_XV.json.zip"
548
- }
549
- // {
550
- // filename: "Amendements_XIV.json",
551
- // ignoreForWeb: true,
552
- // legislature: Legislature.Quatorze,
553
- // structure: DatasetStructure.SingleFile,
554
- // title: "Amendements de la XIVème législature",
555
- // url:
556
- // "https://data.assemblee-nationale.fr/static/openData/repository/14/loi/amendements_legis_XIV/Amendements_XIV.json.zip",
557
- // },
558
- ],
559
- dossiersLegislatifs: [
560
- {
561
- filename: "Dossiers_Legislatifs_XVII.json",
562
- legislature: r.DixSept,
563
- repairZip: h,
564
- structure: 1,
565
- title: "Dossiers législatifs de la XVIIème législature",
566
- url: "https://data.assemblee-nationale.fr/static/openData/repository/17/loi/dossiers_legislatifs/Dossiers_Legislatifs.json.zip"
567
- },
568
- {
569
- filename: "Dossiers_Legislatifs_XVI.json",
570
- legislature: r.Seize,
571
- repairZip: h,
572
- structure: 1,
573
- title: "Dossiers législatifs de la XVIème législature",
574
- url: "https://data.assemblee-nationale.fr/static/openData/repository/16/loi/dossiers_legislatifs/Dossiers_Legislatifs.json.zip"
575
- },
576
- {
577
- filename: "Dossiers_Legislatifs_XV.json",
578
- legislature: r.Quinze,
579
- repairZip: h,
580
- structure: 1,
581
- title: "Dossiers législatifs de la XVème législature",
582
- url: "https://data.assemblee-nationale.fr/static/openData/repository/15/loi/dossiers_legislatifs/Dossiers_Legislatifs_XV.json.zip"
583
- },
584
- {
585
- filename: "Dossiers_Legislatifs_XIV.json",
586
- legislature: r.Quatorze,
587
- structure: 0,
588
- title: "Dossiers législatifs de la XIVème législature",
589
- url: "https://data.assemblee-nationale.fr/static/openData/repository/14/loi/dossiers_legislatifs/Dossiers_Legislatifs_XIV.json.zip"
590
- }
591
- ],
592
- scrutins: [
593
- {
594
- filename: "Scrutins_XVII.json",
595
- legislature: r.DixSept,
596
- repairZip: h,
597
- structure: 1,
598
- title: "Scrutins de la XVIIème législature",
599
- url: "https://data.assemblee-nationale.fr/static/openData/repository/17/loi/scrutins/Scrutins.json.zip"
600
- },
601
- {
602
- filename: "Scrutins_XVI.json",
603
- legislature: r.Seize,
604
- repairZip: h,
605
- structure: 1,
606
- title: "Scrutins de la XVIème législature",
607
- url: "https://data.assemblee-nationale.fr/static/openData/repository/16/loi/scrutins/Scrutins.json.zip"
608
- },
609
- {
610
- filename: "Scrutins_XV.json",
611
- legislature: r.Quinze,
612
- repairZip: h,
613
- structure: 1,
614
- title: "Scrutins de la XVème législature",
615
- url: "https://data.assemblee-nationale.fr/static/openData/repository/15/loi/scrutins/Scrutins_XV.json.zip"
616
- },
617
- {
618
- filename: "Scrutins_XIV.json",
619
- legislature: r.Quatorze,
620
- structure: 0,
621
- title: "Scrutins de la XIVème législature",
622
- url: "https://data.assemblee-nationale.fr/static/openData/repository/14/loi/scrutins/Scrutins_XIV.json.zip"
623
- }
624
- ],
625
- questions: [
626
- {
627
- filename: "Questions_ecrites_XVII.json",
628
- legislature: r.DixSept,
629
- repairZip: h,
630
- structure: 1,
631
- title: "Questions écrites de la XVIIème législature",
632
- url: "https://data.assemblee-nationale.fr/static/openData/repository/17/questions/questions_ecrites/Questions_ecrites.json.zip"
633
- },
634
- {
635
- filename: "Questions_ecrites_XVI.json",
636
- legislature: r.Seize,
637
- repairZip: h,
638
- structure: 1,
639
- title: "Questions écrites de la XVIème législature",
640
- url: "https://data.assemblee-nationale.fr/static/openData/repository/16/questions/questions_ecrites/Questions_ecrites.json.zip"
641
- },
642
- {
643
- filename: "Questions_gouvernement_XVII.json",
644
- legislature: r.DixSept,
645
- repairZip: h,
646
- structure: 1,
647
- title: "Questions au gouvernement de la XVIIème législature",
648
- url: "https://data.assemblee-nationale.fr/static/openData/repository/17/questions/questions_gouvernement/Questions_gouvernement.json.zip"
649
- },
650
- {
651
- filename: "Questions_gouvernement_XVI.json",
652
- legislature: r.Seize,
653
- repairZip: h,
654
- structure: 1,
655
- title: "Questions au gouvernement de la XVIème législature",
656
- url: "https://data.assemblee-nationale.fr/static/openData/repository/16/questions/questions_gouvernement/Questions_gouvernement.json.zip"
657
- },
658
- {
659
- filename: "Questions_orales_XVII.json",
660
- legislature: r.DixSept,
661
- repairZip: h,
662
- structure: 1,
663
- title: "Questions orales sans débats de la XVIIème législature",
664
- url: "https://data.assemblee-nationale.fr/static/openData/repository/17/questions/questions_orales_sans_debat/Questions_orales_sans_debat.json.zip"
665
- },
666
- {
667
- filename: "Questions_orales_XVI.json",
668
- legislature: r.Seize,
669
- repairZip: h,
670
- structure: 1,
671
- title: "Questions orales sans débats de la XVIème législature",
672
- url: "https://data.assemblee-nationale.fr/static/openData/repository/16/questions/questions_orales_sans_debat/Questions_orales_sans_debat.json.zip"
673
- }
674
- ],
675
- comptesRendusSeances: [
676
- {
677
- filename: "Comptes_Rendus_Seances_XVII.xml",
678
- legislature: r.DixSept,
679
- repairZip: async (t, s) => {
680
- const e = i.join(s, t.filename);
681
- await n.pathExists(e) && await n.remove(e), await n.move(
682
- i.join(s, `${t.filename}.temp`, "xml"),
683
- e
684
- );
685
- },
686
- structure: 1,
687
- title: "Comptes rendus des séances publiques de la XVIIème législature",
688
- url: "https://data.assemblee-nationale.fr/static/openData/repository/17/vp/syceronbrut/syseron.xml.zip"
689
- },
690
- {
691
- filename: "Comptes_Rendus_Seances_XVI.xml",
692
- legislature: r.Seize,
693
- repairZip: async (t, s) => {
694
- const e = i.join(s, t.filename);
695
- await n.pathExists(e) && await n.remove(e), await n.move(
696
- i.join(s, `${t.filename}.temp`, "xml"),
697
- e
698
- );
699
- },
700
- structure: 1,
701
- title: "Comptes rendus des séances publiques de la XVIème législature",
702
- url: "https://data.assemblee-nationale.fr/static/openData/repository/16/vp/syceronbrut/syseron.xml.zip"
703
- }
704
- ]
705
- };
706
- function* x(t, s = []) {
707
- const e = i.join(t, ...s);
708
- if (n.existsSync(e))
709
- for (const a of n.readdirSync(e)) {
710
- if (a[0] === ".")
6
+ import { getChangedFilesSinceCommit as V } from "./git.js";
7
+ import { C as X } from "./amendements-40Z7OJLT.js";
8
+ function* R(t, o = []) {
9
+ const e = s.join(t, ...o);
10
+ if (m.existsSync(e))
11
+ for (const i of m.readdirSync(e)) {
12
+ if (i[0] === ".")
711
13
  continue;
712
- const f = i.join(e, a), d = [...s, a];
713
- n.statSync(f).isDirectory() ? yield* x(t, d) : yield d;
14
+ const u = s.join(e, i), f = [...o, i];
15
+ m.statSync(u).isDirectory() ? yield* R(t, f) : yield f;
714
16
  }
715
17
  }
716
- const Q = [
18
+ const I = [
717
19
  1e3,
718
20
  "M",
719
21
  900,
@@ -741,809 +43,809 @@ const Q = [
741
43
  1,
742
44
  "I"
743
45
  ];
744
- function ie(t) {
46
+ function oe(t) {
745
47
  if (t < 0)
746
48
  return;
747
49
  if (t === 0)
748
50
  return "0I";
749
- let s = "";
750
- for (let e = 0; e < Q.length; e += 2)
751
- for (; t >= Q[e]; )
752
- s += Q[e + 1], t -= Q[e];
753
- return s;
51
+ let o = "";
52
+ for (let e = 0; e < I.length; e += 2)
53
+ for (; t >= I[e]; )
54
+ o += I[e + 1], t -= I[e];
55
+ return o;
754
56
  }
755
- function* z(t, s, e, a, f, d = "json", { log: c = !1, noValidation: _ = !1, sinceCommit: j } = {}) {
756
- const F = /* @__PURE__ */ new Set();
757
- for (const A of e) {
758
- if (A.ignoreForWeb || !ne(s, A))
57
+ function* B(t, o, e, i, u, f = "json", { log: l = !1, noValidation: h = !1, sinceCommits: y } = {}) {
58
+ const A = /* @__PURE__ */ new Set();
59
+ for (const S of e) {
60
+ if (S.ignoreForWeb || !ie(o, S))
759
61
  continue;
760
- const D = new RegExp(`\\.${d}$`), I = i.join(
62
+ const U = new RegExp(`\\.${f}$`), L = s.join(
761
63
  t,
762
- A.filename.replace(D, "_nettoye")
763
- ), L = j ? k(I, j, {
64
+ S.filename.replace(U, "_nettoye")
65
+ ), $ = y ? y[S.name] : void 0, x = $ ? V(L, $, {
764
66
  diffFilter: "AMR"
765
67
  }) : null;
766
- c && j && (console.log(
767
- `Filtering files changed since commit ${j} in ${I}`
768
- ), console.log(`Found ${L?.size || 0} changed files`));
769
- for (const X of x(I, f)) {
770
- if (!X[X.length - 1].endsWith(".json"))
68
+ l && $ && (console.log(
69
+ `Filtering files changed since commit ${$} in ${L}`
70
+ ), console.log(`Found ${x?.size || 0} changed files`));
71
+ for (const b of R(L, u)) {
72
+ if (!b[b.length - 1].endsWith(".json"))
771
73
  continue;
772
- const b = i.join(I, ...X), V = i.join(...X), o = L?.get(V);
773
- if (L && !o)
74
+ const D = s.join(L, ...b), n = s.join(...b), c = x?.get(n);
75
+ if (x && !c)
774
76
  continue;
775
- c && console.log(`Loading file: ${b}…`);
776
- let u = n.readFileSync(b, { encoding: "utf8" });
777
- const m = _ ? JSON.parse(u) : a(u);
778
- F.has(m.uid) || (F.add(m.uid), yield {
779
- datasetLegislature: A.legislature,
780
- filePath: b,
781
- item: m,
782
- ...o && { gitStatus: o }
783
- }, u = null);
77
+ l && console.log(`Loading file: ${D}…`);
78
+ let a = m.readFileSync(D, { encoding: "utf8" });
79
+ const p = h ? JSON.parse(a) : i(a);
80
+ A.has(p.uid) || (A.add(p.uid), yield {
81
+ datasetLegislature: S.legislature,
82
+ filePath: D,
83
+ item: p,
84
+ ...c && { gitStatus: c }
85
+ }, a = null);
784
86
  }
785
- if (j) {
786
- const X = k(
787
- I,
788
- j,
87
+ if ($) {
88
+ const b = V(
89
+ L,
90
+ $,
789
91
  {
790
92
  diffFilter: "D"
791
93
  }
792
94
  );
793
- for (const [P, b] of X.entries()) {
794
- const V = i.join(I, P);
795
- c && console.log(`Deleted file: ${V}`);
796
- const u = { uid: i.basename(P, `.${d}`) };
95
+ for (const [C, D] of b.entries()) {
96
+ const n = s.join(L, C);
97
+ l && console.log(`Deleted file: ${n}`);
98
+ const a = { uid: s.basename(C, `.${f}`) };
797
99
  yield {
798
- datasetLegislature: A.legislature,
799
- filePath: V,
800
- item: u,
801
- gitStatus: b
100
+ datasetLegislature: S.legislature,
101
+ filePath: n,
102
+ item: a,
103
+ gitStatus: D
802
104
  };
803
105
  }
804
106
  }
805
107
  }
806
- F.clear();
108
+ A.clear();
807
109
  }
808
- function ne(t, s) {
110
+ function ie(t, o) {
809
111
  const e = Array.isArray(t) ? t : t !== void 0 ? [t] : [];
810
- return t === void 0 || e.includes(0) || s.legislature === r.All ? !0 : e.includes(s.legislature);
112
+ return t === void 0 || e.includes(0) || o.legislature === g.All ? !0 : e.includes(o.legislature);
811
113
  }
812
- function* pe(t, s, e = {}) {
114
+ function* de(t, o, e = {}) {
813
115
  for (const {
814
- datasetLegislature: a,
815
- item: f,
816
- filePath: d,
817
- gitStatus: c
818
- } of z(
116
+ datasetLegislature: i,
117
+ item: u,
118
+ filePath: f,
119
+ gitStatus: l
120
+ } of B(
819
121
  t,
820
- s,
821
- S.acteursEtOrganes,
822
- U.toActeur,
122
+ o,
123
+ F.acteursEtOrganes,
124
+ W.toActeur,
823
125
  ["acteurs"],
824
126
  "json",
825
127
  e
826
128
  ))
827
129
  yield {
828
- acteur: f,
829
- datasetLegislature: a,
830
- filePath: d,
831
- ...c && { gitStatus: c }
130
+ acteur: u,
131
+ datasetLegislature: i,
132
+ filePath: f,
133
+ ...l && { gitStatus: l }
832
134
  };
833
135
  }
834
- function* ge(t, s, e = {}) {
136
+ function* me(t, o, e = {}) {
835
137
  for (const {
836
- item: a,
837
- datasetLegislature: f,
838
- filePath: d,
839
- gitStatus: c
840
- } of z(
138
+ item: i,
139
+ datasetLegislature: u,
140
+ filePath: f,
141
+ gitStatus: l
142
+ } of B(
841
143
  t,
842
- s,
843
- S.acteursEtOrganes,
844
- U.toOrgane,
144
+ o,
145
+ F.acteursEtOrganes,
146
+ W.toOrgane,
845
147
  ["organes"],
846
148
  "json",
847
149
  e
848
150
  ))
849
151
  yield {
850
- organe: a,
851
- datasetLegislature: f,
852
- filePath: d,
853
- ...c && { gitStatus: c }
152
+ organe: i,
153
+ datasetLegislature: u,
154
+ filePath: f,
155
+ ...l && { gitStatus: l }
854
156
  };
855
157
  }
856
- function* _e(t, s, e = {}) {
158
+ function* ge(t, o, e = {}) {
857
159
  for (const {
858
- datasetLegislature: a,
859
- item: f,
860
- filePath: d,
861
- gitStatus: c
862
- } of z(
160
+ datasetLegislature: i,
161
+ item: u,
162
+ filePath: f,
163
+ gitStatus: l
164
+ } of B(
863
165
  t,
864
- s,
865
- S.amendements,
866
- N.toAmendement,
166
+ o,
167
+ F.amendements,
168
+ X.toAmendement,
867
169
  [],
868
170
  "json",
869
171
  e
870
172
  ))
871
173
  yield {
872
- amendement: f,
873
- datasetLegislature: a,
874
- filePath: d,
875
- ...c && { gitStatus: c }
174
+ amendement: u,
175
+ datasetLegislature: i,
176
+ filePath: f,
177
+ ...l && { gitStatus: l }
876
178
  };
877
179
  }
878
- function* je(t, s, e = {}) {
180
+ function* je(t, o, e = {}) {
879
181
  for (const {
880
- item: a,
881
- datasetLegislature: f,
882
- filePath: d,
883
- gitStatus: c
884
- } of z(
182
+ item: i,
183
+ datasetLegislature: u,
184
+ filePath: f,
185
+ gitStatus: l
186
+ } of B(
885
187
  t,
886
- s,
887
- S.dossiersLegislatifs,
888
- q.toDocument,
188
+ o,
189
+ F.dossiersLegislatifs,
190
+ J.toDocument,
889
191
  ["documents"],
890
192
  "json",
891
193
  e
892
194
  ))
893
195
  yield {
894
- document: a,
895
- datasetLegislature: f,
896
- filePath: d,
897
- ...c && { gitStatus: c }
196
+ document: i,
197
+ datasetLegislature: u,
198
+ filePath: f,
199
+ ...l && { gitStatus: l }
898
200
  };
899
201
  }
900
- function* he(t, s, e = {}) {
202
+ function* he(t, o, e = {}) {
901
203
  for (const {
902
- item: a,
903
- datasetLegislature: f,
904
- filePath: d,
905
- gitStatus: c
906
- } of z(
204
+ item: i,
205
+ datasetLegislature: u,
206
+ filePath: f,
207
+ gitStatus: l
208
+ } of B(
907
209
  t,
908
- s,
909
- S.dossiersLegislatifs,
910
- q.toDossierParlementaire,
210
+ o,
211
+ F.dossiersLegislatifs,
212
+ J.toDossierParlementaire,
911
213
  ["dossiers"],
912
214
  "json",
913
215
  e
914
216
  ))
915
217
  yield {
916
- dossierParlementaire: a,
917
- datasetLegislature: f,
918
- filePath: d,
919
- ...c && { gitStatus: c }
218
+ dossierParlementaire: i,
219
+ datasetLegislature: u,
220
+ filePath: f,
221
+ ...l && { gitStatus: l }
920
222
  };
921
223
  }
922
- function* ye(t, s, e = {}) {
224
+ function* pe(t, o, e = {}) {
923
225
  for (const {
924
- item: a,
925
- datasetLegislature: f,
926
- filePath: d,
927
- gitStatus: c
928
- } of z(
226
+ item: i,
227
+ datasetLegislature: u,
228
+ filePath: f,
229
+ gitStatus: l
230
+ } of B(
929
231
  t,
930
- s,
931
- S.agendas,
232
+ o,
233
+ F.agendas,
932
234
  M.toReunion,
933
235
  [],
934
236
  "json",
935
237
  e
936
238
  ))
937
239
  yield {
938
- reunion: a,
939
- datasetLegislature: f,
940
- filePath: d,
941
- ...c && { gitStatus: c }
240
+ reunion: i,
241
+ datasetLegislature: u,
242
+ filePath: f,
243
+ ...l && { gitStatus: l }
942
244
  };
943
245
  }
944
- function* Se(t, s, e = {}) {
246
+ function* ye(t, o, e = {}) {
945
247
  for (const {
946
- item: a,
947
- datasetLegislature: f,
948
- filePath: d,
949
- gitStatus: c
950
- } of z(
248
+ item: i,
249
+ datasetLegislature: u,
250
+ filePath: f,
251
+ gitStatus: l
252
+ } of B(
951
253
  t,
952
- s,
953
- S.scrutins,
954
- Z.toScrutin,
254
+ o,
255
+ F.scrutins,
256
+ w.toScrutin,
955
257
  [],
956
258
  "json",
957
259
  e
958
260
  ))
959
261
  yield {
960
- scrutin: a,
961
- datasetLegislature: f,
962
- filePath: d,
963
- ...c && { gitStatus: c }
262
+ scrutin: i,
263
+ datasetLegislature: u,
264
+ filePath: f,
265
+ ...l && { gitStatus: l }
964
266
  };
965
267
  }
966
- function* Ae(t, s, e = {}) {
268
+ function* Fe(t, o, e = {}) {
967
269
  for (const {
968
- item: a,
969
- datasetLegislature: f,
970
- filePath: d,
971
- gitStatus: c
972
- } of z(
270
+ item: i,
271
+ datasetLegislature: u,
272
+ filePath: f,
273
+ gitStatus: l
274
+ } of B(
973
275
  t,
974
- s,
975
- S.questions,
976
- B.toQuestion,
276
+ o,
277
+ F.questions,
278
+ T.toQuestion,
977
279
  [],
978
280
  "json",
979
281
  e
980
282
  ))
981
283
  yield {
982
- question: a,
983
- datasetLegislature: f,
984
- filePath: d,
985
- ...c && { gitStatus: c }
284
+ question: i,
285
+ datasetLegislature: u,
286
+ filePath: f,
287
+ ...l && { gitStatus: l }
986
288
  };
987
289
  }
988
- function* Fe(t, s, e = {}) {
290
+ function* Se(t, o, e = {}) {
989
291
  for (const {
990
- item: a,
991
- datasetLegislature: f,
992
- filePath: d,
993
- gitStatus: c
994
- } of z(
292
+ item: i,
293
+ datasetLegislature: u,
294
+ filePath: f,
295
+ gitStatus: l
296
+ } of B(
995
297
  t,
996
- s,
997
- S.comptesRendusSeances,
998
- J.toCompteRendu,
298
+ o,
299
+ F.comptesRendusSeances,
300
+ Q.toCompteRendu,
999
301
  [],
1000
302
  "xml",
1001
303
  e
1002
304
  ))
1003
305
  yield {
1004
- compteRendu: a,
1005
- datasetLegislature: f,
1006
- filePath: d,
1007
- ...c && { gitStatus: c }
306
+ compteRendu: i,
307
+ datasetLegislature: u,
308
+ filePath: f,
309
+ ...l && { gitStatus: l }
1008
310
  };
1009
311
  }
1010
- function* ve(t, s, {} = {}) {
1011
- const e = `Comptes_Rendus_Commissions_${ie(s)}_nettoye`, a = i.join(t, e);
1012
- if (n.existsSync(a))
1013
- for (const f of T(a))
312
+ function* Ae(t, o, {} = {}) {
313
+ const e = `Comptes_Rendus_Commissions_${oe(o)}_nettoye`, i = s.join(t, e);
314
+ if (m.existsSync(i))
315
+ for (const u of z(i))
1014
316
  try {
1015
- const d = n.readFileSync(f, "utf-8");
317
+ const f = m.readFileSync(u, "utf-8");
1016
318
  yield {
1017
- compteRendu: JSON.parse(d),
1018
- datasetLegislature: s,
1019
- filePath: f
319
+ compteRendu: JSON.parse(f),
320
+ datasetLegislature: o,
321
+ filePath: u
1020
322
  };
1021
- } catch (d) {
1022
- console.warn(`Erreur lors de la lecture du fichier ${f} :`, d);
323
+ } catch (f) {
324
+ console.warn(`Erreur lors de la lecture du fichier ${u} :`, f);
1023
325
  }
1024
326
  }
1025
- function* T(t) {
1026
- if (n.existsSync(t))
1027
- for (const s of n.readdirSync(t, { withFileTypes: !0 })) {
1028
- const e = i.join(t, s.name);
1029
- s.isDirectory() ? yield* T(e) : s.isFile() && e.endsWith(".json") && (yield e);
327
+ function* z(t) {
328
+ if (m.existsSync(t))
329
+ for (const o of m.readdirSync(t, { withFileTypes: !0 })) {
330
+ const e = s.join(t, o.name);
331
+ o.isDirectory() ? yield* z(e) : o.isFile() && e.endsWith(".json") && (yield e);
1030
332
  }
1031
333
  }
1032
- function Ie(t, s, e, { log: a = !1 } = {}) {
1033
- const f = {}, d = {};
1034
- if (s & v.ActeursEtOrganes)
1035
- for (const o of S.acteursEtOrganes) {
1036
- if (o.ignoreForWeb || e !== r.All && o.legislature !== r.All && e !== o.legislature)
334
+ function Pe(t, o, e, { log: i = !1 } = {}) {
335
+ const u = {}, f = {};
336
+ if (o & P.ActeursEtOrganes)
337
+ for (const n of F.acteursEtOrganes) {
338
+ if (n.ignoreForWeb || e !== g.All && n.legislature !== g.All && e !== n.legislature)
1037
339
  continue;
1038
- const u = i.join(
340
+ const c = s.join(
1039
341
  t,
1040
- o.filename.replace(/\.json$/, "_nettoye")
342
+ n.filename.replace(/\.json$/, "_nettoye")
1041
343
  );
1042
- for (const m of x(u, ["acteurs"])) {
1043
- if (!m[m.length - 1].endsWith(".json"))
344
+ for (const a of R(c, ["acteurs"])) {
345
+ if (!a[a.length - 1].endsWith(".json"))
1044
346
  continue;
1045
- const l = i.join(u, ...m);
1046
- a && console.log(`Loading file: ${l}…`);
1047
- const g = n.readFileSync(l, {
347
+ const r = s.join(c, ...a);
348
+ i && console.log(`Loading file: ${r}…`);
349
+ const j = m.readFileSync(r, {
1048
350
  encoding: "utf8"
1049
- }), p = U.toActeur(g);
1050
- f[p.uid] === void 0 && (f[p.uid] = p);
351
+ }), d = W.toActeur(j);
352
+ u[d.uid] === void 0 && (u[d.uid] = d);
1051
353
  }
1052
- for (const m of x(u, ["organes"])) {
1053
- if (!m[m.length - 1].endsWith(".json"))
354
+ for (const a of R(c, ["organes"])) {
355
+ if (!a[a.length - 1].endsWith(".json"))
1054
356
  continue;
1055
- const l = i.join(u, ...m);
1056
- a && console.log(`Loading file: ${l}…`);
1057
- const g = n.readFileSync(l, {
357
+ const r = s.join(c, ...a);
358
+ i && console.log(`Loading file: ${r}…`);
359
+ const j = m.readFileSync(r, {
1058
360
  encoding: "utf8"
1059
- }), p = U.toOrgane(g);
1060
- d[p.uid] === void 0 && (d[p.uid] = p);
361
+ }), d = W.toOrgane(j);
362
+ f[d.uid] === void 0 && (f[d.uid] = d);
1061
363
  }
1062
364
  }
1063
- const c = {}, _ = {}, j = {};
1064
- if (s & v.Agendas)
1065
- for (const o of S.agendas) {
1066
- if (o.ignoreForWeb || e !== r.All && o.legislature !== r.All && e !== o.legislature)
365
+ const l = {}, h = {}, y = {};
366
+ if (o & P.Agendas)
367
+ for (const n of F.agendas) {
368
+ if (n.ignoreForWeb || e !== g.All && n.legislature !== g.All && e !== n.legislature)
1067
369
  continue;
1068
- const u = i.join(
370
+ const c = s.join(
1069
371
  t,
1070
- o.filename.replace(/\.json$/, "_nettoye")
372
+ n.filename.replace(/\.json$/, "_nettoye")
1071
373
  );
1072
- for (const m of x(u)) {
1073
- if (!m[m.length - 1].endsWith(".json"))
374
+ for (const a of R(c)) {
375
+ if (!a[a.length - 1].endsWith(".json"))
1074
376
  continue;
1075
- const l = i.join(u, ...m);
1076
- a && console.log(`Loading file: ${l}…`);
1077
- const g = n.readFileSync(l, {
377
+ const r = s.join(c, ...a);
378
+ i && console.log(`Loading file: ${r}…`);
379
+ const j = m.readFileSync(r, {
1078
380
  encoding: "utf8"
1079
- }), p = M.toReunion(g);
1080
- c[p.uid] === void 0 && (c[p.uid] = p);
1081
- const $ = p.timestampDebut.toISOString().split("T")[0];
1082
- let O = _[$];
1083
- O === void 0 && (O = _[$] = []), O.push(p);
1084
- const w = p.odj;
1085
- if (w !== void 0)
1086
- for (const R of w.pointsOdj || [])
1087
- for (const E of R.dossiersLegislatifsRefs || []) {
1088
- let W = j[E];
1089
- W === void 0 && (W = j[E] = []), W.push(p);
381
+ }), d = M.toReunion(j);
382
+ l[d.uid] === void 0 && (l[d.uid] = d);
383
+ const v = d.timestampDebut.toISOString().split("T")[0];
384
+ let O = h[v];
385
+ O === void 0 && (O = h[v] = []), O.push(d);
386
+ const _ = d.odj;
387
+ if (_ !== void 0)
388
+ for (const q of _.pointsOdj || [])
389
+ for (const k of q.dossiersLegislatifsRefs || []) {
390
+ let N = y[k];
391
+ N === void 0 && (N = y[k] = []), N.push(d);
1090
392
  }
1091
393
  }
1092
394
  }
1093
- const F = {};
1094
- if (s & v.Amendements)
1095
- for (const o of S.amendements) {
1096
- if (o.ignoreForWeb || e !== r.All && o.legislature !== r.All && e !== o.legislature)
395
+ const A = {};
396
+ if (o & P.Amendements)
397
+ for (const n of F.amendements) {
398
+ if (n.ignoreForWeb || e !== g.All && n.legislature !== g.All && e !== n.legislature)
1097
399
  continue;
1098
- const u = i.join(
400
+ const c = s.join(
1099
401
  t,
1100
- o.filename.replace(/\.json$/, "_nettoye")
402
+ n.filename.replace(/\.json$/, "_nettoye")
1101
403
  );
1102
- for (const m of x(u)) {
1103
- if (!m[m.length - 1].endsWith(".json"))
404
+ for (const a of R(c)) {
405
+ if (!a[a.length - 1].endsWith(".json"))
1104
406
  continue;
1105
- const l = i.join(u, ...m);
1106
- a && console.log(`Loading file: ${l}…`);
1107
- const g = n.readFileSync(l, {
407
+ const r = s.join(c, ...a);
408
+ i && console.log(`Loading file: ${r}…`);
409
+ const j = m.readFileSync(r, {
1108
410
  encoding: "utf8"
1109
- }), p = N.toAmendement(g);
1110
- F[p.uid] === void 0 && (F[p.uid] = p);
411
+ }), d = X.toAmendement(j);
412
+ A[d.uid] === void 0 && (A[d.uid] = d);
1111
413
  }
1112
414
  }
1113
- const A = {}, D = {}, I = {}, L = {};
1114
- if (s & v.DossiersLegislatifs)
1115
- for (const o of S.dossiersLegislatifs) {
1116
- if (o.ignoreForWeb || e !== r.All && o.legislature !== r.All && e !== o.legislature)
415
+ const S = {}, U = {}, L = {}, $ = {};
416
+ if (o & P.DossiersLegislatifs)
417
+ for (const n of F.dossiersLegislatifs) {
418
+ if (n.ignoreForWeb || e !== g.All && n.legislature !== g.All && e !== n.legislature)
1117
419
  continue;
1118
- const u = i.join(
420
+ const c = s.join(
1119
421
  t,
1120
- o.filename.replace(/\.json$/, "_nettoye")
422
+ n.filename.replace(/\.json$/, "_nettoye")
1121
423
  );
1122
- for (const m of x(u, ["documents"])) {
1123
- if (!m[m.length - 1].endsWith(".json"))
424
+ for (const a of R(c, ["documents"])) {
425
+ if (!a[a.length - 1].endsWith(".json"))
1124
426
  continue;
1125
- const l = i.join(u, ...m);
1126
- a && console.log(`Loading file: ${l}…`);
1127
- const g = n.readFileSync(l, {
427
+ const r = s.join(c, ...a);
428
+ i && console.log(`Loading file: ${r}…`);
429
+ const j = m.readFileSync(r, {
1128
430
  encoding: "utf8"
1129
- }), p = q.toDocument(g);
1130
- A[p.uid] === void 0 && (A[p.uid] = p);
431
+ }), d = J.toDocument(j);
432
+ S[d.uid] === void 0 && (S[d.uid] = d);
1131
433
  }
1132
- for (const m of x(u, ["dossiers"])) {
1133
- if (!m[m.length - 1].endsWith(".json"))
434
+ for (const a of R(c, ["dossiers"])) {
435
+ if (!a[a.length - 1].endsWith(".json"))
1134
436
  continue;
1135
- const l = i.join(u, ...m);
1136
- a && console.log(`Loading file: ${l}…`);
1137
- const g = n.readFileSync(l, {
437
+ const r = s.join(c, ...a);
438
+ i && console.log(`Loading file: ${r}…`);
439
+ const j = m.readFileSync(r, {
1138
440
  encoding: "utf8"
1139
- }), p = q.toDossierParlementaire(g), $ = p.titreDossier;
1140
- $.senatChemin && D[$.senatChemin] === void 0 && (D[$.senatChemin] = p), $.titreChemin && I[$.titreChemin] === void 0 && (I[$.titreChemin] = p), L[p.uid] === void 0 && (L[p.uid] = p);
441
+ }), d = J.toDossierParlementaire(j), v = d.titreDossier;
442
+ v.senatChemin && U[v.senatChemin] === void 0 && (U[v.senatChemin] = d), v.titreChemin && L[v.titreChemin] === void 0 && (L[v.titreChemin] = d), $[d.uid] === void 0 && ($[d.uid] = d);
1141
443
  }
1142
444
  }
1143
- let X = {};
1144
- if (s & v.Photos) {
445
+ let x = {};
446
+ if (o & P.Photos) {
1145
447
  {
1146
- const o = i.join(
448
+ const n = s.join(
1147
449
  t,
1148
450
  `photos_deputes_${// TODO: Handle Legislature.All.
1149
- e === r.All ? r.DixSept : e}`,
451
+ e === g.All ? g.DixSept : e}`,
1150
452
  "deputes.json"
1151
453
  );
1152
- if (n.existsSync(o)) {
1153
- a && console.log(`Loading file: ${o}`);
1154
- const u = n.readFileSync(o, { encoding: "utf8" });
1155
- Object.assign(X, JSON.parse(u));
1156
- } else a && console.log(`Ignoring missing file: ${o}`);
454
+ if (m.existsSync(n)) {
455
+ i && console.log(`Loading file: ${n}`);
456
+ const c = m.readFileSync(n, { encoding: "utf8" });
457
+ Object.assign(x, JSON.parse(c));
458
+ } else i && console.log(`Ignoring missing file: ${n}`);
1157
459
  }
1158
460
  {
1159
- const o = i.join(
461
+ const n = s.join(
1160
462
  t,
1161
463
  "photos_senateurs",
1162
464
  "senateurs.json"
1163
465
  );
1164
- if (n.existsSync(o)) {
1165
- a && console.log(`Loading file: ${o}`);
1166
- const u = n.readFileSync(o, { encoding: "utf8" });
1167
- Object.assign(X, JSON.parse(u));
1168
- } else a && console.log(`Ignoring missing file: ${o}`);
466
+ if (m.existsSync(n)) {
467
+ i && console.log(`Loading file: ${n}`);
468
+ const c = m.readFileSync(n, { encoding: "utf8" });
469
+ Object.assign(x, JSON.parse(c));
470
+ } else i && console.log(`Ignoring missing file: ${n}`);
1169
471
  }
1170
472
  }
1171
- const P = {};
1172
- if (s & v.Scrutins)
1173
- for (const o of S.scrutins) {
1174
- if (o.ignoreForWeb || e !== r.All && o.legislature !== r.All && e !== o.legislature)
473
+ const b = {};
474
+ if (o & P.Scrutins)
475
+ for (const n of F.scrutins) {
476
+ if (n.ignoreForWeb || e !== g.All && n.legislature !== g.All && e !== n.legislature)
1175
477
  continue;
1176
- const u = i.join(
478
+ const c = s.join(
1177
479
  t,
1178
- o.filename.replace(/\.json$/, "_nettoye")
480
+ n.filename.replace(/\.json$/, "_nettoye")
1179
481
  );
1180
- for (const m of x(u)) {
1181
- if (!m[m.length - 1].endsWith(".json"))
482
+ for (const a of R(c)) {
483
+ if (!a[a.length - 1].endsWith(".json"))
1182
484
  continue;
1183
- const l = i.join(u, ...m);
1184
- a && console.log(`Loading file: ${l}…`);
1185
- const g = n.readFileSync(l, {
485
+ const r = s.join(c, ...a);
486
+ i && console.log(`Loading file: ${r}…`);
487
+ const j = m.readFileSync(r, {
1186
488
  encoding: "utf8"
1187
- }), p = Z.toScrutin(g);
1188
- P[p.uid] === void 0 && (P[p.uid] = p);
489
+ }), d = w.toScrutin(j);
490
+ b[d.uid] === void 0 && (b[d.uid] = d);
1189
491
  }
1190
492
  }
1191
- const b = {};
1192
- if (s & v.Questions)
1193
- for (const o of S.questions) {
1194
- if (o.ignoreForWeb || e !== r.All && o.legislature !== r.All && e !== o.legislature)
493
+ const C = {};
494
+ if (o & P.Questions)
495
+ for (const n of F.questions) {
496
+ if (n.ignoreForWeb || e !== g.All && n.legislature !== g.All && e !== n.legislature)
1195
497
  continue;
1196
- const u = i.join(
498
+ const c = s.join(
1197
499
  t,
1198
- o.filename.replace(/\.json$/, "_nettoye")
500
+ n.filename.replace(/\.json$/, "_nettoye")
1199
501
  );
1200
- for (const m of x(u)) {
1201
- if (!m[m.length - 1].endsWith(".json"))
502
+ for (const a of R(c)) {
503
+ if (!a[a.length - 1].endsWith(".json"))
1202
504
  continue;
1203
- const l = i.join(u, ...m);
1204
- a && console.log(`Loading file: ${l}…`);
1205
- const g = n.readFileSync(l, {
505
+ const r = s.join(c, ...a);
506
+ i && console.log(`Loading file: ${r}…`);
507
+ const j = m.readFileSync(r, {
1206
508
  encoding: "utf8"
1207
- }), p = B.toQuestion(g);
1208
- b[p.uid] === void 0 && (b[p.uid] = p);
509
+ }), d = T.toQuestion(j);
510
+ C[d.uid] === void 0 && (C[d.uid] = d);
1209
511
  }
1210
512
  }
1211
- const V = {};
1212
- if (s & v.ComptesRendusSeances)
1213
- for (const o of S.comptesRendusSeances) {
1214
- if (o.ignoreForWeb || e !== r.All && o.legislature !== r.All && e !== o.legislature)
513
+ const D = {};
514
+ if (o & P.ComptesRendusSeances)
515
+ for (const n of F.comptesRendusSeances) {
516
+ if (n.ignoreForWeb || e !== g.All && n.legislature !== g.All && e !== n.legislature)
1215
517
  continue;
1216
- const u = i.join(
518
+ const c = s.join(
1217
519
  t,
1218
- o.filename.replace(/\.json$/, "_nettoye")
520
+ n.filename.replace(/\.json$/, "_nettoye")
1219
521
  );
1220
- for (const m of x(u)) {
1221
- if (!m[m.length - 1].endsWith(".json"))
522
+ for (const a of R(c)) {
523
+ if (!a[a.length - 1].endsWith(".json"))
1222
524
  continue;
1223
- const l = i.join(u, ...m);
1224
- a && console.log(`Loading file: ${l}…`);
1225
- const g = n.readFileSync(l, {
525
+ const r = s.join(c, ...a);
526
+ i && console.log(`Loading file: ${r}…`);
527
+ const j = m.readFileSync(r, {
1226
528
  encoding: "utf8"
1227
- }), p = J.toCompteRendu(g);
1228
- V[p.uid] === void 0 && (V[p.uid] = p);
529
+ }), d = Q.toCompteRendu(j);
530
+ D[d.uid] === void 0 && (D[d.uid] = d);
1229
531
  }
1230
532
  }
1231
533
  return {
1232
- acteurByUid: f,
1233
- amendementByUid: F,
1234
- documentByUid: A,
1235
- dossierParlementaireBySenatChemin: D,
1236
- dossierParlementaireByTitreChemin: I,
1237
- dossierParlementaireByUid: L,
1238
- organeByUid: d,
1239
- photoByUid: X,
1240
- reunionByUid: c,
1241
- reunionsByDay: _,
1242
- reunionsByDossierUid: j,
1243
- scrutinByUid: P,
1244
- questionByUid: b,
1245
- compteRenduByUid: V
534
+ acteurByUid: u,
535
+ amendementByUid: A,
536
+ documentByUid: S,
537
+ dossierParlementaireBySenatChemin: U,
538
+ dossierParlementaireByTitreChemin: L,
539
+ dossierParlementaireByUid: $,
540
+ organeByUid: f,
541
+ photoByUid: x,
542
+ reunionByUid: l,
543
+ reunionsByDay: h,
544
+ reunionsByDossierUid: y,
545
+ scrutinByUid: b,
546
+ questionByUid: C,
547
+ compteRenduByUid: D
1246
548
  };
1247
549
  }
1248
- function be(t, s, e, { log: a = !1 } = {}) {
1249
- const f = {}, d = {};
1250
- if (s & v.ActeursEtOrganes)
1251
- for (const o of S.acteursEtOrganes) {
1252
- if (o.ignoreForWeb || e !== r.All && o.legislature !== r.All && e !== o.legislature)
550
+ function Le(t, o, e, { log: i = !1 } = {}) {
551
+ const u = {}, f = {};
552
+ if (o & P.ActeursEtOrganes)
553
+ for (const n of F.acteursEtOrganes) {
554
+ if (n.ignoreForWeb || e !== g.All && n.legislature !== g.All && e !== n.legislature)
1253
555
  continue;
1254
- const u = i.join(
556
+ const c = s.join(
1255
557
  t,
1256
- o.filename.replace(/\.json$/, "_nettoye.json")
558
+ n.filename.replace(/\.json$/, "_nettoye.json")
1257
559
  );
1258
- a && console.log(`Loading file: ${u}`);
1259
- const m = n.readFileSync(u, { encoding: "utf8" }), y = U.toActeursEtOrganes(m);
1260
- for (const l of y.acteurs)
1261
- f[l.uid] === void 0 && (f[l.uid] = l);
1262
- for (const l of y.organes)
1263
- d[l.uid] === void 0 && (d[l.uid] = l);
560
+ i && console.log(`Loading file: ${c}`);
561
+ const a = m.readFileSync(c, { encoding: "utf8" }), p = W.toActeursEtOrganes(a);
562
+ for (const r of p.acteurs)
563
+ u[r.uid] === void 0 && (u[r.uid] = r);
564
+ for (const r of p.organes)
565
+ f[r.uid] === void 0 && (f[r.uid] = r);
1264
566
  }
1265
- const c = {}, _ = {}, j = {};
1266
- if (s & v.Agendas)
1267
- for (const o of S.agendas) {
1268
- if (o.ignoreForWeb || e !== r.All && o.legislature !== r.All && e !== o.legislature)
567
+ const l = {}, h = {}, y = {};
568
+ if (o & P.Agendas)
569
+ for (const n of F.agendas) {
570
+ if (n.ignoreForWeb || e !== g.All && n.legislature !== g.All && e !== n.legislature)
1269
571
  continue;
1270
- const u = i.join(
572
+ const c = s.join(
1271
573
  t,
1272
- o.filename.replace(/\.json$/, "_nettoye.json")
574
+ n.filename.replace(/\.json$/, "_nettoye.json")
1273
575
  );
1274
- a && console.log(`Loading file: ${u}`);
1275
- const m = n.readFileSync(u, { encoding: "utf8" }), y = M.toAgendas(m);
1276
- for (const l of y.reunions) {
1277
- c[l.uid] === void 0 && (c[l.uid] = l);
1278
- const g = l.timestampDebut.toISOString().split("T")[0];
1279
- let p = _[g];
1280
- p === void 0 && (p = _[g] = []), p.push(l);
1281
- const $ = l.odj;
1282
- if ($ !== void 0)
1283
- for (const O of $.pointsOdj || [])
1284
- for (const w of O.dossiersLegislatifsRefs || []) {
1285
- let R = j[w];
1286
- R === void 0 && (R = j[w] = []), R.push(l);
576
+ i && console.log(`Loading file: ${c}`);
577
+ const a = m.readFileSync(c, { encoding: "utf8" }), p = M.toAgendas(a);
578
+ for (const r of p.reunions) {
579
+ l[r.uid] === void 0 && (l[r.uid] = r);
580
+ const j = r.timestampDebut.toISOString().split("T")[0];
581
+ let d = h[j];
582
+ d === void 0 && (d = h[j] = []), d.push(r);
583
+ const v = r.odj;
584
+ if (v !== void 0)
585
+ for (const O of v.pointsOdj || [])
586
+ for (const _ of O.dossiersLegislatifsRefs || []) {
587
+ let q = y[_];
588
+ q === void 0 && (q = y[_] = []), q.push(r);
1287
589
  }
1288
590
  }
1289
591
  }
1290
- const F = {};
1291
- if (s & v.Amendements)
1292
- for (const o of S.amendements) {
1293
- if (o.ignoreForWeb || e !== r.All && o.legislature !== r.All && e !== o.legislature)
592
+ const A = {};
593
+ if (o & P.Amendements)
594
+ for (const n of F.amendements) {
595
+ if (n.ignoreForWeb || e !== g.All && n.legislature !== g.All && e !== n.legislature)
1294
596
  continue;
1295
- const u = i.join(
597
+ const c = s.join(
1296
598
  t,
1297
- o.filename.replace(/\.json$/, "_nettoye.json")
599
+ n.filename.replace(/\.json$/, "_nettoye.json")
1298
600
  );
1299
- a && console.log(`Loading file: ${u}`);
1300
- const m = n.readFileSync(u, { encoding: "utf8" }), y = N.toAmendements(m);
1301
- for (const l of y.textesLegislatifs)
1302
- for (const g of l.amendements)
1303
- F[g.uid] === void 0 && (F[g.uid] = g);
601
+ i && console.log(`Loading file: ${c}`);
602
+ const a = m.readFileSync(c, { encoding: "utf8" }), p = X.toAmendements(a);
603
+ for (const r of p.textesLegislatifs)
604
+ for (const j of r.amendements)
605
+ A[j.uid] === void 0 && (A[j.uid] = j);
1304
606
  }
1305
- const A = {}, D = {}, I = {}, L = {};
1306
- if (s & v.DossiersLegislatifs)
1307
- for (const o of S.dossiersLegislatifs) {
1308
- if (o.ignoreForWeb || e !== r.All && o.legislature !== r.All && e !== o.legislature)
607
+ const S = {}, U = {}, L = {}, $ = {};
608
+ if (o & P.DossiersLegislatifs)
609
+ for (const n of F.dossiersLegislatifs) {
610
+ if (n.ignoreForWeb || e !== g.All && n.legislature !== g.All && e !== n.legislature)
1309
611
  continue;
1310
- const u = i.join(
612
+ const c = s.join(
1311
613
  t,
1312
- o.filename.replace(/\.json$/, "_nettoye.json")
614
+ n.filename.replace(/\.json$/, "_nettoye.json")
1313
615
  );
1314
- a && console.log(`Loading file: ${u}`);
1315
- const m = n.readFileSync(u, { encoding: "utf8" }), y = q.toDossiersLegislatifs(m);
1316
- for (const l of y.textesLegislatifs)
1317
- A[l.uid] === void 0 && (A[l.uid] = l);
1318
- for (const l of y.dossiersParlementaires) {
1319
- const g = l.titreDossier;
1320
- g.senatChemin && D[g.senatChemin] === void 0 && (D[g.senatChemin] = l), g.titreChemin && I[g.titreChemin] === void 0 && (I[g.titreChemin] = l), L[l.uid] === void 0 && (L[l.uid] = l);
616
+ i && console.log(`Loading file: ${c}`);
617
+ const a = m.readFileSync(c, { encoding: "utf8" }), p = J.toDossiersLegislatifs(a);
618
+ for (const r of p.textesLegislatifs)
619
+ S[r.uid] === void 0 && (S[r.uid] = r);
620
+ for (const r of p.dossiersParlementaires) {
621
+ const j = r.titreDossier;
622
+ j.senatChemin && U[j.senatChemin] === void 0 && (U[j.senatChemin] = r), j.titreChemin && L[j.titreChemin] === void 0 && (L[j.titreChemin] = r), $[r.uid] === void 0 && ($[r.uid] = r);
1321
623
  }
1322
624
  }
1323
- const X = {};
1324
- if (s & v.Photos) {
1325
- const o = {};
625
+ const x = {};
626
+ if (o & P.Photos) {
627
+ const n = {};
1326
628
  {
1327
- const u = i.join(
629
+ const c = s.join(
1328
630
  t,
1329
631
  `photos_deputes_${// TODO: Handle Legislature.All.
1330
- e === r.All ? r.DixSept : e}`,
632
+ e === g.All ? g.DixSept : e}`,
1331
633
  "deputes.json"
1332
634
  );
1333
- if (n.existsSync(u)) {
1334
- a && console.log(`Loading file: ${u}`);
1335
- const m = n.readFileSync(u, { encoding: "utf8" });
1336
- Object.assign(o, JSON.parse(m));
1337
- } else a && console.log(`Ignoring missing file: ${u}`);
635
+ if (m.existsSync(c)) {
636
+ i && console.log(`Loading file: ${c}`);
637
+ const a = m.readFileSync(c, { encoding: "utf8" });
638
+ Object.assign(n, JSON.parse(a));
639
+ } else i && console.log(`Ignoring missing file: ${c}`);
1338
640
  }
1339
641
  {
1340
- const u = i.join(
642
+ const c = s.join(
1341
643
  t,
1342
644
  "photos_senateurs",
1343
645
  "senateurs.json"
1344
646
  );
1345
- if (n.existsSync(u)) {
1346
- a && console.log(`Loading file: ${u}`);
1347
- const m = n.readFileSync(u, { encoding: "utf8" });
1348
- Object.assign(o, JSON.parse(m));
1349
- } else a && console.log(`Ignoring missing file: ${u}`);
647
+ if (m.existsSync(c)) {
648
+ i && console.log(`Loading file: ${c}`);
649
+ const a = m.readFileSync(c, { encoding: "utf8" });
650
+ Object.assign(n, JSON.parse(a));
651
+ } else i && console.log(`Ignoring missing file: ${c}`);
1350
652
  }
1351
653
  }
1352
- const P = {};
1353
- if (s & v.Scrutins)
1354
- for (const o of S.scrutins) {
1355
- if (o.ignoreForWeb || e !== r.All && o.legislature !== r.All && e !== o.legislature)
654
+ const b = {};
655
+ if (o & P.Scrutins)
656
+ for (const n of F.scrutins) {
657
+ if (n.ignoreForWeb || e !== g.All && n.legislature !== g.All && e !== n.legislature)
1356
658
  continue;
1357
- const u = i.join(
659
+ const c = s.join(
1358
660
  t,
1359
- o.filename.replace(/\.json$/, "_nettoye.json")
661
+ n.filename.replace(/\.json$/, "_nettoye.json")
1360
662
  );
1361
- a && console.log(`Loading file: ${u}`);
1362
- const m = n.readFileSync(u, { encoding: "utf8" }), y = Z.toScrutins(m);
1363
- for (const l of y.scrutins)
1364
- P[l.uid] === void 0 && (P[l.uid] = l);
663
+ i && console.log(`Loading file: ${c}`);
664
+ const a = m.readFileSync(c, { encoding: "utf8" }), p = w.toScrutins(a);
665
+ for (const r of p.scrutins)
666
+ b[r.uid] === void 0 && (b[r.uid] = r);
1365
667
  }
1366
- const b = {};
1367
- if (s & v.Questions)
1368
- for (const o of S.questions) {
1369
- if (o.ignoreForWeb || e !== r.All && o.legislature !== r.All && e !== o.legislature)
668
+ const C = {};
669
+ if (o & P.Questions)
670
+ for (const n of F.questions) {
671
+ if (n.ignoreForWeb || e !== g.All && n.legislature !== g.All && e !== n.legislature)
1370
672
  continue;
1371
- const u = i.join(
673
+ const c = s.join(
1372
674
  t,
1373
- o.filename.replace(/\.json$/, "_nettoye.json")
675
+ n.filename.replace(/\.json$/, "_nettoye.json")
1374
676
  );
1375
- a && console.log(`Loading file: ${u}`);
1376
- const m = n.readFileSync(u, { encoding: "utf8" }), y = B.toQuestions(m);
1377
- for (const l of y.questions)
1378
- b[l.uid] === void 0 && (b[l.uid] = l);
677
+ i && console.log(`Loading file: ${c}`);
678
+ const a = m.readFileSync(c, { encoding: "utf8" }), p = T.toQuestions(a);
679
+ for (const r of p.questions)
680
+ C[r.uid] === void 0 && (C[r.uid] = r);
1379
681
  }
1380
- const V = {};
1381
- if (s & v.ComptesRendusSeances)
1382
- for (const o of S.comptesRendusSeances) {
1383
- if (o.ignoreForWeb || e !== r.All && o.legislature !== r.All && e !== o.legislature)
682
+ const D = {};
683
+ if (o & P.ComptesRendusSeances)
684
+ for (const n of F.comptesRendusSeances) {
685
+ if (n.ignoreForWeb || e !== g.All && n.legislature !== g.All && e !== n.legislature)
1384
686
  continue;
1385
- const u = i.join(
687
+ const c = s.join(
1386
688
  t,
1387
- o.filename.replace(/\.json$/, "_nettoye.json")
689
+ n.filename.replace(/\.json$/, "_nettoye.json")
1388
690
  );
1389
- a && console.log(`Loading file: ${u}`);
1390
- const m = n.readFileSync(u, { encoding: "utf8" }), y = J.toComptesRendus(m);
1391
- for (const l of y.comptesRendus)
1392
- V[l.uid] === void 0 && (V[l.uid] = l);
691
+ i && console.log(`Loading file: ${c}`);
692
+ const a = m.readFileSync(c, { encoding: "utf8" }), p = Q.toComptesRendus(a);
693
+ for (const r of p.comptesRendus)
694
+ D[r.uid] === void 0 && (D[r.uid] = r);
1393
695
  }
1394
696
  return {
1395
- acteurByUid: f,
1396
- amendementByUid: F,
1397
- documentByUid: A,
1398
- dossierParlementaireBySenatChemin: D,
1399
- dossierParlementaireByTitreChemin: I,
1400
- dossierParlementaireByUid: L,
1401
- organeByUid: d,
1402
- photoByUid: X,
1403
- reunionByUid: c,
1404
- reunionsByDay: _,
1405
- reunionsByDossierUid: j,
1406
- scrutinByUid: P,
1407
- questionByUid: b,
1408
- compteRenduByUid: V
697
+ acteurByUid: u,
698
+ amendementByUid: A,
699
+ documentByUid: S,
700
+ dossierParlementaireBySenatChemin: U,
701
+ dossierParlementaireByTitreChemin: L,
702
+ dossierParlementaireByUid: $,
703
+ organeByUid: f,
704
+ photoByUid: x,
705
+ reunionByUid: l,
706
+ reunionsByDay: h,
707
+ reunionsByDossierUid: y,
708
+ scrutinByUid: b,
709
+ questionByUid: C,
710
+ compteRenduByUid: D
1409
711
  };
1410
712
  }
1411
- function De(t, s, e) {
1412
- const a = i.join(t, "Documents"), f = oe(a, s), d = i.join(f, "index.json");
1413
- if (!n.pathExistsSync(d))
713
+ function $e(t, o, e) {
714
+ const i = s.join(t, "Documents"), u = te(i, o), f = s.join(u, "index.json");
715
+ if (!m.pathExistsSync(f))
1414
716
  return;
1415
- const c = n.readJsonSync(d);
1416
- for (const _ of e)
1417
- for (const { filename: j, url: F } of c[_] ?? [])
1418
- if (j !== void 0)
1419
- return { format: _, path: i.join(f, j), url: F };
717
+ const l = m.readJsonSync(f);
718
+ for (const h of e)
719
+ for (const { filename: y, url: A } of l[h] ?? [])
720
+ if (y !== void 0)
721
+ return { format: h, path: s.join(u, y), url: A };
1420
722
  }
1421
- function Xe(t, s, { log: e = !1 } = {}) {
1422
- const a = i.join(
723
+ function be(t, o, { log: e = !1 } = {}) {
724
+ const i = s.join(
1423
725
  t,
1424
726
  `photos_deputes_${// TODO: Handle Legislature.All.
1425
- s === r.All ? r.DixSept : s}`,
727
+ o === g.All ? g.DixSept : o}`,
1426
728
  "deputes.json"
1427
729
  );
1428
- e && console.log(`Loading file: ${a}`);
1429
- const f = n.readFileSync(a, { encoding: "utf8" });
1430
- return JSON.parse(f);
730
+ e && console.log(`Loading file: ${i}`);
731
+ const u = m.readFileSync(i, { encoding: "utf8" });
732
+ return JSON.parse(u);
1431
733
  }
1432
- function Ve(t, { log: s = !1 } = {}) {
1433
- const e = i.join(
734
+ function De(t, { log: o = !1 } = {}) {
735
+ const e = s.join(
1434
736
  t,
1435
737
  "photos_senateurs",
1436
738
  "senateurs.json"
1437
739
  );
1438
- s && console.log(`Loading file: ${e}`);
1439
- const a = n.readFileSync(e, { encoding: "utf8" });
1440
- return JSON.parse(a);
740
+ o && console.log(`Loading file: ${e}`);
741
+ const i = m.readFileSync(e, { encoding: "utf8" });
742
+ return JSON.parse(i);
1441
743
  }
1442
- function oe(t, s) {
1443
- const e = s.match(Y);
1444
- C.notStrictEqual(
744
+ function te(t, o) {
745
+ const e = o.match(Z);
746
+ E.notStrictEqual(
1445
747
  e,
1446
748
  null,
1447
- `Unexpected structure for document UID: ${s}`
749
+ `Unexpected structure for document UID: ${o}`
1448
750
  );
1449
- const a = e.groups, f = i.join(
751
+ const i = e.groups, u = s.join(
1450
752
  t,
1451
- a.documentType ?? a.documentType2
1452
- ), d = i.join(f, a.chambre ?? a.chambre2), c = i.join(
1453
- d,
1454
- a.republique ?? a.republique2
1455
- ), _ = i.join(
1456
- c,
1457
- a.legislature ?? a.legislature2
1458
- ), j = a.etat;
1459
- if (j === void 0)
1460
- return n.ensureDirSync(_), i.join(_, s);
1461
- const F = i.join(_, j);
1462
- let A = "000000" + (a.numero ?? a.numero2);
1463
- A = A.substring(A.length - 6);
1464
- const D = i.join(F, A.substring(0, 3));
1465
- return n.ensureDirSync(D), i.join(D, s);
753
+ i.documentType ?? i.documentType2
754
+ ), f = s.join(u, i.chambre ?? i.chambre2), l = s.join(
755
+ f,
756
+ i.republique ?? i.republique2
757
+ ), h = s.join(
758
+ l,
759
+ i.legislature ?? i.legislature2
760
+ ), y = i.etat;
761
+ if (y === void 0)
762
+ return m.ensureDirSync(h), s.join(h, o);
763
+ const A = s.join(h, y);
764
+ let S = "000000" + (i.numero ?? i.numero2);
765
+ S = S.substring(S.length - 6);
766
+ const U = s.join(A, S.substring(0, 3));
767
+ return m.ensureDirSync(U), s.join(U, o);
1466
768
  }
1467
- function $e(t, s) {
1468
- return H(t, s, te);
769
+ function Ue(t, o) {
770
+ return Y(t, o, ee);
1469
771
  }
1470
- function Le(t, s) {
1471
- const e = G.exec(s);
1472
- C.notStrictEqual(
772
+ function ve(t, o) {
773
+ const e = G.exec(o);
774
+ E.notStrictEqual(
1473
775
  e,
1474
776
  null,
1475
- `Unexpected structure for reunion UID: ${s}`
777
+ `Unexpected structure for reunion UID: ${o}`
1476
778
  );
1477
- const a = i.join(t, e[1]), f = i.join(a, e[2]), d = i.join(f, e[3]), c = i.join(d, e[4]), _ = i.join(c, e[5]);
1478
- let j = "000000000" + e[6];
1479
- j = j.substring(j.length - 9);
1480
- const F = i.join(_, j.substring(0, 3)), A = i.join(F, j.substring(3, 3));
1481
- return n.ensureDirSync(A), i.join(A, s);
779
+ const i = s.join(t, e[1]), u = s.join(i, e[2]), f = s.join(u, e[3]), l = s.join(f, e[4]), h = s.join(l, e[5]);
780
+ let y = "000000000" + e[6];
781
+ y = y.substring(y.length - 9);
782
+ const A = s.join(h, y.substring(0, 3)), S = s.join(A, y.substring(3, 3));
783
+ return m.ensureDirSync(S), s.join(S, o);
1482
784
  }
1483
- function Pe(t, s) {
1484
- const e = K.exec(s);
1485
- C.notStrictEqual(
785
+ function Ce(t, o) {
786
+ const e = H.exec(o);
787
+ E.notStrictEqual(
1486
788
  e,
1487
789
  null,
1488
- `Unexpected structure for scrutin UID: ${s}`
790
+ `Unexpected structure for scrutin UID: ${o}`
1489
791
  );
1490
- const a = i.join(t, e[1]), f = i.join(a, e[2]), d = i.join(f, e[3]);
1491
- let c = "000000" + e[4];
1492
- c = c.substring(c.length - 6);
1493
- const _ = i.join(d, c.substring(0, 3));
1494
- return n.ensureDirSync(_), i.join(_, s);
792
+ const i = s.join(t, e[1]), u = s.join(i, e[2]), f = s.join(u, e[3]);
793
+ let l = "000000" + e[4];
794
+ l = l.substring(l.length - 6);
795
+ const h = s.join(f, l.substring(0, 3));
796
+ return m.ensureDirSync(h), s.join(h, o);
1495
797
  }
1496
- function xe(t, s) {
1497
- return H(t, s, se);
798
+ function Re(t, o) {
799
+ return Y(t, o, ne);
1498
800
  }
1499
- function ze(t, s) {
1500
- const e = ee.exec(s);
1501
- C.notStrictEqual(
801
+ function xe(t, o) {
802
+ const e = K.exec(o);
803
+ E.notStrictEqual(
1502
804
  e,
1503
805
  null,
1504
- `Unexpected structure for object with UID: ${s}`
806
+ `Unexpected structure for object with UID: ${o}`
1505
807
  );
1506
- const a = i.join(t, e[2]), f = i.join(a, e[3]), d = i.join(f, e[4]), c = i.join(d, e[5]);
1507
- let _ = "000000000" + e[7];
1508
- _ = _.substring(_.length - 9);
1509
- const j = i.join(c, _.substring(0, 3)), F = i.join(j, _.substring(3, 3));
1510
- return n.ensureDirSync(F), i.join(F, s);
808
+ const i = s.join(t, e[2]), u = s.join(i, e[3]), f = s.join(u, e[4]), l = s.join(f, e[5]);
809
+ let h = "000000000" + e[7];
810
+ h = h.substring(h.length - 9);
811
+ const y = s.join(l, h.substring(0, 3)), A = s.join(y, h.substring(3, 3));
812
+ return m.ensureDirSync(A), s.join(A, o);
1511
813
  }
1512
- function H(t, s, e) {
1513
- const a = e.exec(s);
1514
- C.notStrictEqual(
1515
- a,
814
+ function Y(t, o, e) {
815
+ const i = e.exec(o);
816
+ E.notStrictEqual(
817
+ i,
1516
818
  null,
1517
- `Unexpected structure for object with UID: ${s}`
819
+ `Unexpected structure for object with UID: ${o}`
1518
820
  );
1519
- const f = i.join(t, a[1]), d = i.join(f, a[2]);
1520
- let c = "000000" + a[3];
1521
- c = c.substring(c.length - 6);
1522
- const _ = i.join(d, c.substring(0, 3));
1523
- return n.ensureDirSync(_), i.join(_, s);
821
+ const u = s.join(t, i[1]), f = s.join(u, i[2]);
822
+ let l = "000000" + i[3];
823
+ l = l.substring(l.length - 6);
824
+ const h = s.join(f, l.substring(0, 3));
825
+ return m.ensureDirSync(h), s.join(h, o);
1524
826
  }
1525
827
  export {
1526
- v as EnabledDatasets,
1527
- pe as iterLoadAssembleeActeurs,
1528
- _e as iterLoadAssembleeAmendements,
1529
- Fe as iterLoadAssembleeComptesRendus,
1530
- ve as iterLoadAssembleeComptesRendusCommissions,
828
+ P as EnabledDatasets,
829
+ de as iterLoadAssembleeActeurs,
830
+ ge as iterLoadAssembleeAmendements,
831
+ Se as iterLoadAssembleeComptesRendus,
832
+ Ae as iterLoadAssembleeComptesRendusCommissions,
1531
833
  je as iterLoadAssembleeDocuments,
1532
834
  he as iterLoadAssembleeDossiersParlementaires,
1533
- ge as iterLoadAssembleeOrganes,
1534
- Ae as iterLoadAssembleeQuestions,
1535
- ye as iterLoadAssembleeReunions,
1536
- Se as iterLoadAssembleeScrutins,
1537
- Ie as loadAssembleeData,
1538
- be as loadAssembleeDataFromBigFiles,
1539
- De as loadAssembleeDocumentFile,
1540
- Xe as loadAssembleePhotosDeputes,
1541
- Ve as loadAssembleePhotosSenateurs,
1542
- ze as pathFromCompteRenduUid,
1543
- oe as pathFromDocumentUid,
1544
- $e as pathFromDossierParlementaireUid,
1545
- xe as pathFromQuestionUid,
1546
- Le as pathFromReunionUid,
1547
- Pe as pathFromScrutinUid,
1548
- x as walkDir
835
+ me as iterLoadAssembleeOrganes,
836
+ Fe as iterLoadAssembleeQuestions,
837
+ pe as iterLoadAssembleeReunions,
838
+ ye as iterLoadAssembleeScrutins,
839
+ Pe as loadAssembleeData,
840
+ Le as loadAssembleeDataFromBigFiles,
841
+ $e as loadAssembleeDocumentFile,
842
+ be as loadAssembleePhotosDeputes,
843
+ De as loadAssembleePhotosSenateurs,
844
+ xe as pathFromCompteRenduUid,
845
+ te as pathFromDocumentUid,
846
+ Ue as pathFromDossierParlementaireUid,
847
+ Re as pathFromQuestionUid,
848
+ ve as pathFromReunionUid,
849
+ Ce as pathFromScrutinUid,
850
+ R as walkDir
1549
851
  };