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