@tricoteuses/assemblee 3.8.6 → 3.9.1

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