@tricoteuses/senat 2.19.5 → 2.19.7
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/datasets.js +40 -116
- package/lib/index.d.ts +5 -5
- package/lib/model/ameli.js +1 -1
- package/lib/model/debats.js +8 -8
- package/lib/model/dosleg.js +31 -22
- package/lib/model/index.d.ts +2 -2
- package/lib/model/index.js +2 -2
- package/lib/model/questions.js +3 -5
- package/lib/model/scrutins.js +15 -34
- package/lib/model/sens.js +43 -68
- package/lib/model/texte.js +15 -43
- package/lib/raw_types/ameli.d.ts +9 -9
- package/lib/raw_types/senat.d.ts +9 -9
- package/lib/raw_types_schemats/ameli.d.ts +2 -2
- package/lib/raw_types_schemats/debats.d.ts +2 -2
- package/lib/raw_types_schemats/dosleg.d.ts +2 -2
- package/lib/raw_types_schemats/questions.d.ts +2 -2
- package/lib/raw_types_schemats/sens.d.ts +2 -2
- package/lib/scripts/convert_data.js +18 -22
- package/lib/scripts/datautil.js +1 -1
- package/lib/scripts/parse_textes.js +2 -2
- package/lib/scripts/retrieve_open_data.js +5 -7
- package/lib/scripts/retrieve_senateurs_photos.js +1 -4
- package/lib/scripts/test_iter_load.js +4 -1
- package/lib/types/dosleg.d.ts +1 -1
- package/lib/types/sessions.d.ts +1 -1
- package/lib/types/sessions.js +1 -1
- package/package.json +11 -11
package/lib/model/sens.js
CHANGED
|
@@ -7,27 +7,17 @@ function circonscription(dptNum) {
|
|
|
7
7
|
.selectFrom("dpt")
|
|
8
8
|
.leftJoin("reg", "dpt.regcod", "reg.regcod")
|
|
9
9
|
.where("dpt.dptnum", "=", dptNum)
|
|
10
|
-
.select([
|
|
11
|
-
"dpt.dptcod as code",
|
|
12
|
-
"dpt.dptlib as libelle_departement",
|
|
13
|
-
"reg.reglib as libelle_region",
|
|
14
|
-
]));
|
|
10
|
+
.select(["dpt.dptcod as code", "dpt.dptlib as libelle_departement", "reg.reglib as libelle_region"]));
|
|
15
11
|
}
|
|
16
12
|
function textes(actId) {
|
|
17
13
|
return jsonArrayFrom(dbSenat
|
|
18
14
|
.withSchema("sens")
|
|
19
15
|
.selectFrom("activite_loi")
|
|
20
16
|
.where("actid", "=", actId)
|
|
21
|
-
.select(({ ref }) => [
|
|
22
|
-
rtrim(ref("loicod")).as("loicod"),
|
|
23
|
-
]));
|
|
17
|
+
.select(({ ref }) => [rtrim(ref("loicod")).as("loicod")]));
|
|
24
18
|
}
|
|
25
19
|
function delegations(actId) {
|
|
26
|
-
return jsonArrayFrom(dbSenat
|
|
27
|
-
.withSchema("sens")
|
|
28
|
-
.selectFrom("activite_delegation")
|
|
29
|
-
.where("actid", "=", actId)
|
|
30
|
-
.orderBy("delegidx asc"));
|
|
20
|
+
return jsonArrayFrom(dbSenat.withSchema("sens").selectFrom("activite_delegation").where("actid", "=", actId).orderBy("delegidx", "asc"));
|
|
31
21
|
}
|
|
32
22
|
function activites(senMat) {
|
|
33
23
|
return jsonArrayFrom(dbSenat
|
|
@@ -41,7 +31,7 @@ function activites(senMat) {
|
|
|
41
31
|
delegations(ref("activite.actid")).as("delegations"),
|
|
42
32
|
textes(ref("activite.actid")).as("textes"),
|
|
43
33
|
])
|
|
44
|
-
.orderBy("activite.datdeb desc"));
|
|
34
|
+
.orderBy("activite.datdeb", "desc"));
|
|
45
35
|
}
|
|
46
36
|
function activitesPerso(senMat) {
|
|
47
37
|
return jsonArrayFrom(dbSenat
|
|
@@ -49,7 +39,7 @@ function activitesPerso(senMat) {
|
|
|
49
39
|
.selectFrom("activite_senateur")
|
|
50
40
|
.leftJoin("type_activite_senateur", "activite_senateur.typactsencod", "type_activite_senateur.typactsencod")
|
|
51
41
|
.where("activite_senateur.senmat", "=", senMat)
|
|
52
|
-
.orderBy("activite_senateur.datdeb desc"));
|
|
42
|
+
.orderBy("activite_senateur.datdeb", "desc"));
|
|
53
43
|
}
|
|
54
44
|
function fonctionsBureau(senMat) {
|
|
55
45
|
return jsonArrayFrom(dbSenat
|
|
@@ -62,7 +52,7 @@ function fonctionsBureau(senMat) {
|
|
|
62
52
|
toDateString(ref("senbur.senburdatfin")).as("date_fin"),
|
|
63
53
|
eb.fn.coalesce(nullIf(ref("bur.burlib")), nullIf(ref("bur.burlil")), nullIf(ref("bur.burlic"))).as("libelle"),
|
|
64
54
|
])
|
|
65
|
-
.orderBy("senbur.senburdatdeb desc"));
|
|
55
|
+
.orderBy("senbur.senburdatdeb", "desc"));
|
|
66
56
|
}
|
|
67
57
|
function mandatsEluConseillerGeneral(senMat) {
|
|
68
58
|
return jsonArrayFrom(dbSenat
|
|
@@ -70,10 +60,8 @@ function mandatsEluConseillerGeneral(senMat) {
|
|
|
70
60
|
.selectFrom("elucan")
|
|
71
61
|
.leftJoin("typman", "elucan.typmancod", "typman.typmancod")
|
|
72
62
|
.where("elucan.senmat", "=", senMat)
|
|
73
|
-
.select(({ ref }) => [
|
|
74
|
-
|
|
75
|
-
])
|
|
76
|
-
.orderBy("elucan.eludatdeb desc"));
|
|
63
|
+
.select(({ ref }) => [circonscription(ref("elucan.dptnum").$notNull()).as("circonscription")])
|
|
64
|
+
.orderBy("elucan.eludatdeb", "desc"));
|
|
77
65
|
}
|
|
78
66
|
function mandatsEluDepute(senMat) {
|
|
79
67
|
return jsonArrayFrom(dbSenat
|
|
@@ -81,10 +69,8 @@ function mandatsEluDepute(senMat) {
|
|
|
81
69
|
.selectFrom("eludep")
|
|
82
70
|
.leftJoin("typman", "eludep.typmancod", "typman.typmancod")
|
|
83
71
|
.where("eludep.senmat", "=", senMat)
|
|
84
|
-
.select(({ ref }) => [
|
|
85
|
-
|
|
86
|
-
])
|
|
87
|
-
.orderBy("eludep.eludatdeb desc"));
|
|
72
|
+
.select(({ ref }) => [circonscription(ref("eludep.circo").$notNull()).as("circonscription")])
|
|
73
|
+
.orderBy("eludep.eludatdeb", "desc"));
|
|
88
74
|
}
|
|
89
75
|
function mandatsEluDivers(senMat) {
|
|
90
76
|
return jsonArrayFrom(dbSenat
|
|
@@ -92,7 +78,7 @@ function mandatsEluDivers(senMat) {
|
|
|
92
78
|
.selectFrom("eludiv")
|
|
93
79
|
.leftJoin("typman", "eludiv.typmancod", "typman.typmancod")
|
|
94
80
|
.where("eludiv.senmat", "=", senMat)
|
|
95
|
-
.orderBy("eludiv.eludatdeb desc"));
|
|
81
|
+
.orderBy("eludiv.eludatdeb", "desc"));
|
|
96
82
|
}
|
|
97
83
|
function mandatsEluEuropeen(senMat) {
|
|
98
84
|
return jsonArrayFrom(dbSenat
|
|
@@ -101,7 +87,7 @@ function mandatsEluEuropeen(senMat) {
|
|
|
101
87
|
.leftJoin("nation", "elueur.nationcod", "nation.nationcod")
|
|
102
88
|
.leftJoin("typman", "elueur.typmancod", "typman.typmancod")
|
|
103
89
|
.where("elueur.senmat", "=", senMat)
|
|
104
|
-
.orderBy("elueur.eludatdeb desc"));
|
|
90
|
+
.orderBy("elueur.eludatdeb", "desc"));
|
|
105
91
|
}
|
|
106
92
|
function mandatsEluConseillerRegional(senMat) {
|
|
107
93
|
return jsonArrayFrom(dbSenat
|
|
@@ -110,7 +96,7 @@ function mandatsEluConseillerRegional(senMat) {
|
|
|
110
96
|
.leftJoin("reg", "elureg.regcod", "reg.regcod")
|
|
111
97
|
.leftJoin("typman", "elureg.typmancod", "typman.typmancod")
|
|
112
98
|
.where("elureg.senmat", "=", senMat)
|
|
113
|
-
.orderBy("elureg.eludatdeb desc"));
|
|
99
|
+
.orderBy("elureg.eludatdeb", "desc"));
|
|
114
100
|
}
|
|
115
101
|
function mandatsEluSenateur(senMat) {
|
|
116
102
|
return jsonArrayFrom(dbSenat
|
|
@@ -128,7 +114,7 @@ function mandatsEluSenateur(senMat) {
|
|
|
128
114
|
"etadebman.etadebmanlib as etat_debut",
|
|
129
115
|
"etafinman.etafinman as etat_fin",
|
|
130
116
|
])
|
|
131
|
-
.orderBy("elusen.eludatdeb desc"));
|
|
117
|
+
.orderBy("elusen.eludatdeb", "desc"));
|
|
132
118
|
}
|
|
133
119
|
function mandatsEluTerritorial(senMat) {
|
|
134
120
|
return jsonArrayFrom(dbSenat
|
|
@@ -137,7 +123,7 @@ function mandatsEluTerritorial(senMat) {
|
|
|
137
123
|
.leftJoin("asster", "eluter.asstercod", "asster.asstercod")
|
|
138
124
|
.leftJoin("typman", "eluter.typmancod", "typman.typmancod")
|
|
139
125
|
.where("eluter.senmat", "=", senMat)
|
|
140
|
-
.orderBy("eluter.eludatdeb desc"));
|
|
126
|
+
.orderBy("eluter.eludatdeb", "desc"));
|
|
141
127
|
}
|
|
142
128
|
function mandatsEluConseillerMunicipal(senMat) {
|
|
143
129
|
return jsonArrayFrom(dbSenat
|
|
@@ -145,7 +131,7 @@ function mandatsEluConseillerMunicipal(senMat) {
|
|
|
145
131
|
.selectFrom("eluvil")
|
|
146
132
|
.leftJoin("typman", "eluvil.typmancod", "typman.typmancod")
|
|
147
133
|
.where("eluvil.senmat", "=", senMat)
|
|
148
|
-
.orderBy("eluvil.eludatdeb desc"));
|
|
134
|
+
.orderBy("eluvil.eludatdeb", "desc"));
|
|
149
135
|
}
|
|
150
136
|
function fonctionsMembreCommission(memComId) {
|
|
151
137
|
return jsonArrayFrom(dbSenat
|
|
@@ -156,9 +142,11 @@ function fonctionsMembreCommission(memComId) {
|
|
|
156
142
|
.select(({ eb, ref }) => [
|
|
157
143
|
toDateString(ref("fonmemcom.fonmemcomdatdeb")).as("date_debut"),
|
|
158
144
|
toDateString(ref("fonmemcom.fonmemcomdatfin")).as("date_fin"),
|
|
159
|
-
eb.fn
|
|
145
|
+
eb.fn
|
|
146
|
+
.coalesce(nullIf(ref("foncom.foncomlib")), nullIf(ref("foncom.foncomlil")), nullIf(ref("foncom.foncomlic")))
|
|
147
|
+
.as("libelle"),
|
|
160
148
|
])
|
|
161
|
-
.orderBy("fonmemcom.fonmemcomdatdeb desc"));
|
|
149
|
+
.orderBy("fonmemcom.fonmemcomdatdeb", "desc"));
|
|
162
150
|
}
|
|
163
151
|
function mandatsMembreCommission(senMat) {
|
|
164
152
|
return jsonArrayFrom(dbSenat
|
|
@@ -177,7 +165,7 @@ function mandatsMembreCommission(senMat) {
|
|
|
177
165
|
"memcom.temvalcod as etat",
|
|
178
166
|
fonctionsMembreCommission(ref("memcom.memcomid")).as("fonctions"),
|
|
179
167
|
])
|
|
180
|
-
.orderBy("memcom.memcomdatdeb desc"));
|
|
168
|
+
.orderBy("memcom.memcomdatdeb", "desc"));
|
|
181
169
|
}
|
|
182
170
|
function fonctionsMembreDelegation(memDelegaId) {
|
|
183
171
|
return jsonArrayFrom(dbSenat
|
|
@@ -188,9 +176,11 @@ function fonctionsMembreDelegation(memDelegaId) {
|
|
|
188
176
|
.select(({ eb, ref }) => [
|
|
189
177
|
toDateString(ref("fonmemdelega.fonmemdeldatdeb")).as("date_debut"),
|
|
190
178
|
toDateString(ref("fonmemdelega.fonmemdeldatfin")).as("date_fin"),
|
|
191
|
-
eb.fn
|
|
179
|
+
eb.fn
|
|
180
|
+
.coalesce(nullIf(ref("fondelega.fondellib")), nullIf(ref("fondelega.fondellil")), nullIf(ref("fondelega.fondellic")))
|
|
181
|
+
.as("libelle"),
|
|
192
182
|
])
|
|
193
|
-
.orderBy("fonmemdelega.fonmemdeldatdeb desc"));
|
|
183
|
+
.orderBy("fonmemdelega.fonmemdeldatdeb", "desc"));
|
|
194
184
|
}
|
|
195
185
|
function mandatsMembreDelegation(senMat) {
|
|
196
186
|
return jsonArrayFrom(dbSenat
|
|
@@ -210,7 +200,7 @@ function mandatsMembreDelegation(senMat) {
|
|
|
210
200
|
"memdelega.temvalcod as etat",
|
|
211
201
|
fonctionsMembreDelegation(ref("memdelega.memdelegaid")).as("fonctions"),
|
|
212
202
|
])
|
|
213
|
-
.orderBy("memdelega.memdelegadatdeb desc"));
|
|
203
|
+
.orderBy("memdelega.memdelegadatdeb", "desc"));
|
|
214
204
|
}
|
|
215
205
|
function mandatsMembreExtraParlementaire(senMat) {
|
|
216
206
|
return jsonArrayFrom(dbSenat
|
|
@@ -219,7 +209,7 @@ function mandatsMembreExtraParlementaire(senMat) {
|
|
|
219
209
|
.leftJoin("orgext", "memextpar.orgcod", "orgext.orgcod")
|
|
220
210
|
.leftJoin("design", "memextpar.designcod", "design.designcod")
|
|
221
211
|
.where("memextpar.senmat", "=", senMat)
|
|
222
|
-
.orderBy("memextpar.memextpardatdeb desc"));
|
|
212
|
+
.orderBy("memextpar.memextpardatdeb", "desc"));
|
|
223
213
|
}
|
|
224
214
|
function fonctionsMembreGroupePolitique(memGrpPolId) {
|
|
225
215
|
return jsonArrayFrom(dbSenat
|
|
@@ -230,9 +220,11 @@ function fonctionsMembreGroupePolitique(memGrpPolId) {
|
|
|
230
220
|
.select(({ eb, ref }) => [
|
|
231
221
|
toDateString(ref("fonmemgrppol.fonmemgrppoldatdeb")).as("date_debut"),
|
|
232
222
|
toDateString(ref("fonmemgrppol.fonmemgrppoldatfin")).as("date_fin"),
|
|
233
|
-
eb.fn
|
|
223
|
+
eb.fn
|
|
224
|
+
.coalesce(nullIf(ref("fongrppol.fongrppollib")), nullIf(ref("fongrppol.fongrppollil")), nullIf(ref("fongrppol.fongrppollic")))
|
|
225
|
+
.as("libelle"),
|
|
234
226
|
])
|
|
235
|
-
.orderBy("fonmemgrppol.fonmemgrppoldatdeb desc"));
|
|
227
|
+
.orderBy("fonmemgrppol.fonmemgrppoldatdeb", "desc"));
|
|
236
228
|
}
|
|
237
229
|
function mandatsMembreGroupePolitique(senMat) {
|
|
238
230
|
return jsonArrayFrom(dbSenat
|
|
@@ -252,7 +244,7 @@ function mandatsMembreGroupePolitique(senMat) {
|
|
|
252
244
|
"memgrppol.temvalcod as etat",
|
|
253
245
|
fonctionsMembreGroupePolitique(ref("memgrppol.memgrppolid")).as("fonctions"),
|
|
254
246
|
])
|
|
255
|
-
.orderBy("memgrppol.memgrppoldatdeb desc"));
|
|
247
|
+
.orderBy("memgrppol.memgrppoldatdeb", "desc"));
|
|
256
248
|
}
|
|
257
249
|
function fonctionsMembreGroupeSenatorial(memGrpSenId) {
|
|
258
250
|
return jsonArrayFrom(dbSenat
|
|
@@ -260,7 +252,7 @@ function fonctionsMembreGroupeSenatorial(memGrpSenId) {
|
|
|
260
252
|
.selectFrom("fonmemgrpsen")
|
|
261
253
|
.leftJoin("fongrpsen", "fonmemgrpsen.fongrpsencod", "fongrpsen.fongrpsencod")
|
|
262
254
|
.where("fonmemgrpsen.memgrpsenid", "=", memGrpSenId)
|
|
263
|
-
.orderBy("fonmemgrpsen.fonmemgrpsendatdeb desc"));
|
|
255
|
+
.orderBy("fonmemgrpsen.fonmemgrpsendatdeb", "desc"));
|
|
264
256
|
}
|
|
265
257
|
function mandatsMembreGroupeSenatorial(senMat) {
|
|
266
258
|
return jsonArrayFrom(dbSenat
|
|
@@ -269,10 +261,8 @@ function mandatsMembreGroupeSenatorial(senMat) {
|
|
|
269
261
|
.leftJoin("grpsenami", "memgrpsen.orgcod", "grpsenami.orgcod")
|
|
270
262
|
.leftJoin("typgrpsen", "grpsenami.typgrpsencod", "typgrpsen.typgrpsencod")
|
|
271
263
|
.where("memgrpsen.senmat", "=", senMat)
|
|
272
|
-
.select(({ ref }) => [
|
|
273
|
-
|
|
274
|
-
])
|
|
275
|
-
.orderBy("memgrpsen.memgrpsendatent desc"));
|
|
264
|
+
.select(({ ref }) => [fonctionsMembreGroupeSenatorial(ref("memgrpsen.memgrpsenid")).as("fonctions")])
|
|
265
|
+
.orderBy("memgrpsen.memgrpsendatent", "desc"));
|
|
276
266
|
}
|
|
277
267
|
function fonctionsMembreOrganisme(memOrgId) {
|
|
278
268
|
return jsonArrayFrom(dbSenat
|
|
@@ -280,7 +270,7 @@ function fonctionsMembreOrganisme(memOrgId) {
|
|
|
280
270
|
.selectFrom("fonmemorg")
|
|
281
271
|
.leftJoin("fonorg", "fonmemorg.fonorgcod", "fonorg.fonorgcod")
|
|
282
272
|
.where("fonmemorg.memorgid", "=", memOrgId)
|
|
283
|
-
.orderBy("fonmemorg.fonmemorgdatdeb desc"));
|
|
273
|
+
.orderBy("fonmemorg.fonmemorgdatdeb", "desc"));
|
|
284
274
|
}
|
|
285
275
|
function mandatsMembreOrganisme(senMat) {
|
|
286
276
|
return jsonArrayFrom(dbSenat
|
|
@@ -290,17 +280,15 @@ function mandatsMembreOrganisme(senMat) {
|
|
|
290
280
|
.leftJoin("typorg", "org.typorgcod", "typorg.typorgcod")
|
|
291
281
|
.leftJoin("designorg", "memorg.designcod", "designorg.designcod")
|
|
292
282
|
.where("memorg.senmat", "=", senMat)
|
|
293
|
-
.select(({ ref }) => [
|
|
294
|
-
|
|
295
|
-
])
|
|
296
|
-
.orderBy("memorg.memorgdatdeb desc"));
|
|
283
|
+
.select(({ ref }) => [fonctionsMembreOrganisme(ref("memorg.memorgid")).as("fonctions")])
|
|
284
|
+
.orderBy("memorg.memorgdatdeb", "desc"));
|
|
297
285
|
}
|
|
298
286
|
function mandatsMinistre(senMat) {
|
|
299
287
|
return jsonArrayFrom(dbSenat
|
|
300
288
|
.withSchema("sens")
|
|
301
289
|
.selectFrom("minind")
|
|
302
290
|
.where("minind.senmat", "=", senMat)
|
|
303
|
-
.orderBy("minind.mindatdeb desc"));
|
|
291
|
+
.orderBy("minind.mindatdeb", "desc"));
|
|
304
292
|
}
|
|
305
293
|
function contacts(senMat) {
|
|
306
294
|
return jsonArrayFrom(dbSenat
|
|
@@ -310,18 +298,15 @@ function contacts(senMat) {
|
|
|
310
298
|
.leftJoin("mel", "poicon.poiconid", "mel.poiconid")
|
|
311
299
|
.leftJoin("telephone", "poicon.poiconid", "telephone.poiconid")
|
|
312
300
|
.where("poicon.senmat", "=", senMat)
|
|
313
|
-
.orderBy("poicon.poiconnumtri asc"));
|
|
301
|
+
.orderBy("poicon.poiconnumtri", "asc"));
|
|
314
302
|
}
|
|
315
303
|
function urls(senMat) {
|
|
316
304
|
return jsonArrayFrom(dbSenat
|
|
317
305
|
.withSchema("sens")
|
|
318
306
|
.selectFrom("senurl")
|
|
319
307
|
.where("senurl.senmat", "=", senMat)
|
|
320
|
-
.select([
|
|
321
|
-
"senurl.
|
|
322
|
-
"senurl.senurlurl as url",
|
|
323
|
-
])
|
|
324
|
-
.orderBy("senurl.senurlnumtri asc"));
|
|
308
|
+
.select(["senurl.typurlcod as code_url", "senurl.senurlurl as url"])
|
|
309
|
+
.orderBy("senurl.senurlnumtri", "asc"));
|
|
325
310
|
}
|
|
326
311
|
const findAllQuery = dbSenat
|
|
327
312
|
.withSchema("sens")
|
|
@@ -383,17 +368,7 @@ const findAllOrganismesQuery = dbSenat
|
|
|
383
368
|
.withSchema("sens")
|
|
384
369
|
.selectFrom((eb) => eb
|
|
385
370
|
.selectFrom("com")
|
|
386
|
-
.select([
|
|
387
|
-
"orgcod",
|
|
388
|
-
"evelic",
|
|
389
|
-
"evelib",
|
|
390
|
-
"evelil",
|
|
391
|
-
"typorgcod",
|
|
392
|
-
"orgurlsim",
|
|
393
|
-
"orgdatcre",
|
|
394
|
-
"orgdatfin",
|
|
395
|
-
"temvalcod",
|
|
396
|
-
])
|
|
371
|
+
.select(["orgcod", "evelic", "evelib", "evelil", "typorgcod", "orgurlsim", "orgdatcre", "orgdatfin", "temvalcod"])
|
|
397
372
|
.union(eb
|
|
398
373
|
.selectFrom("delega")
|
|
399
374
|
.select([
|
package/lib/model/texte.js
CHANGED
|
@@ -9,15 +9,11 @@ function buildWorklow(metaElement) {
|
|
|
9
9
|
const identificationParts = AKN_WORKFLOW_IDENTIFICATION_STRUCTURE_REGEXP.exec(identification)?.groups;
|
|
10
10
|
steps.push({
|
|
11
11
|
eId: stepElement.getAttribute("eId"),
|
|
12
|
-
date: stepElement.getAttribute("date")
|
|
13
|
-
? new Date(stepElement.getAttribute("date") ?? "")
|
|
14
|
-
: null,
|
|
12
|
+
date: stepElement.getAttribute("date") ? new Date(stepElement.getAttribute("date") ?? "") : null,
|
|
15
13
|
type: identificationParts?.["type"] || null,
|
|
16
14
|
session: identificationParts?.["session"] || null,
|
|
17
15
|
numero: identificationParts?.["numTexte"] || null,
|
|
18
|
-
version: identificationParts?.["version"]
|
|
19
|
-
? identificationParts["version"]
|
|
20
|
-
: null,
|
|
16
|
+
version: identificationParts?.["version"] ? identificationParts["version"] : null,
|
|
21
17
|
outcome: stepElement.getAttribute("outcome"),
|
|
22
18
|
});
|
|
23
19
|
}
|
|
@@ -131,48 +127,26 @@ function flattenTexte(texteContentRoot) {
|
|
|
131
127
|
export function transformTexte(document) {
|
|
132
128
|
const metaElement = document.querySelector("meta");
|
|
133
129
|
const preambleElement = document.querySelector("preamble");
|
|
134
|
-
const identification = metaElement
|
|
135
|
-
?.querySelector("FRBRExpression FRBRuri")
|
|
136
|
-
?.getAttribute("value") ?? "";
|
|
130
|
+
const identification = metaElement?.querySelector("FRBRExpression FRBRuri")?.getAttribute("value") ?? "";
|
|
137
131
|
const identificationParts = AKN_IDENTIFICATION_STRUCTURE_REGEXP.exec(identification)?.groups;
|
|
138
132
|
const bodyElement = document.querySelector("body");
|
|
139
133
|
const sessionYears = identificationParts?.["session"]?.split("-") || null;
|
|
140
|
-
const datePresentation = metaElement
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
const dateDepot = metaElement
|
|
144
|
-
?.querySelector("FRBRdate[name='#depot']")
|
|
145
|
-
?.getAttribute("date");
|
|
146
|
-
const datePublicationXml = metaElement
|
|
147
|
-
?.querySelector("FRBRdate[name='#publication-xml']")
|
|
148
|
-
?.getAttribute("date");
|
|
134
|
+
const datePresentation = metaElement?.querySelector("FRBRdate[name='#presentation']")?.getAttribute("date");
|
|
135
|
+
const dateDepot = metaElement?.querySelector("FRBRdate[name='#depot']")?.getAttribute("date");
|
|
136
|
+
const datePublicationXml = metaElement?.querySelector("FRBRdate[name='#publication-xml']")?.getAttribute("date");
|
|
149
137
|
return {
|
|
150
138
|
titre: preambleElement?.querySelector("docTitle")?.textContent || null,
|
|
151
|
-
titreCourt: metaElement
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
?.querySelector("FRBRalias[name='signet-dossier-legislatif-senat']")
|
|
156
|
-
?.getAttribute("value") || null,
|
|
157
|
-
urlDossierSenat: metaElement
|
|
158
|
-
?.querySelector("FRBRalias[name='url-senat']")
|
|
159
|
-
?.getAttribute("value") || null,
|
|
160
|
-
urlDossierAssemblee: metaElement
|
|
161
|
-
?.querySelector("FRBRalias[name='url-AN']")
|
|
162
|
-
?.getAttribute("value") || null,
|
|
139
|
+
titreCourt: metaElement?.querySelector("FRBRalias[name='intitule-court']")?.getAttribute("value") || null,
|
|
140
|
+
signetDossier: metaElement?.querySelector("FRBRalias[name='signet-dossier-legislatif-senat']")?.getAttribute("value") || null,
|
|
141
|
+
urlDossierSenat: metaElement?.querySelector("FRBRalias[name='url-senat']")?.getAttribute("value") || null,
|
|
142
|
+
urlDossierAssemblee: metaElement?.querySelector("FRBRalias[name='url-AN']")?.getAttribute("value") || null,
|
|
163
143
|
type: identificationParts?.["type"] || null,
|
|
164
144
|
session: sessionYears && sessionYears.length > 0 ? sessionYears[0] : null,
|
|
165
|
-
numero: identificationParts?.["numTexte"]
|
|
166
|
-
? parseInt(identificationParts["numTexte"])
|
|
167
|
-
: null,
|
|
145
|
+
numero: identificationParts?.["numTexte"] ? parseInt(identificationParts["numTexte"]) : null,
|
|
168
146
|
datePresentation: datePresentation ? new Date(datePresentation) : null,
|
|
169
147
|
dateDepot: dateDepot ? new Date(dateDepot) : null,
|
|
170
|
-
datePublicationXml: datePublicationXml
|
|
171
|
-
|
|
172
|
-
: null,
|
|
173
|
-
version: identificationParts?.["version"]
|
|
174
|
-
? identificationParts["version"]
|
|
175
|
-
: null,
|
|
148
|
+
datePublicationXml: datePublicationXml ? new Date(datePublicationXml) : null,
|
|
149
|
+
version: identificationParts?.["version"] ? identificationParts["version"] : null,
|
|
176
150
|
workflow: metaElement ? buildWorklow(metaElement) : [],
|
|
177
151
|
divisions: bodyElement ? flattenTexte(bodyElement) : [],
|
|
178
152
|
};
|
|
@@ -188,10 +162,8 @@ export function transformExposeDesMotifs(document) {
|
|
|
188
162
|
}
|
|
189
163
|
const firstParagraphContent = firstParagraph.textContent;
|
|
190
164
|
const secondParagraphContent = secondParagraph?.textContent;
|
|
191
|
-
if (!firstParagraphContent ||
|
|
192
|
-
!exposeDesMotifsRegexp.test(
|
|
193
|
-
if (!secondParagraphContent ||
|
|
194
|
-
!exposeDesMotifsRegexp.test(secondParagraphContent.toUpperCase())) {
|
|
165
|
+
if (!firstParagraphContent || !exposeDesMotifsRegexp.test(firstParagraphContent.toUpperCase())) {
|
|
166
|
+
if (!secondParagraphContent || !exposeDesMotifsRegexp.test(secondParagraphContent.toUpperCase())) {
|
|
195
167
|
continue;
|
|
196
168
|
}
|
|
197
169
|
else {
|
package/lib/raw_types/ameli.d.ts
CHANGED
|
@@ -68,7 +68,7 @@ export interface Amd {
|
|
|
68
68
|
*/
|
|
69
69
|
irrlo1113valid: Generated<string | null>;
|
|
70
70
|
/**
|
|
71
|
-
*
|
|
71
|
+
* Identité de l'entité qui a saisi l'irrecevabilité
|
|
72
72
|
*/
|
|
73
73
|
irrsaisiepar: number | null;
|
|
74
74
|
/**
|
|
@@ -494,7 +494,7 @@ export interface Sai {
|
|
|
494
494
|
*/
|
|
495
495
|
id: number;
|
|
496
496
|
/**
|
|
497
|
-
* Indique si la commission saisie pour avis est
|
|
497
|
+
* Indique si la commission saisie pour avis est déléguée au fond
|
|
498
498
|
*/
|
|
499
499
|
isdelegfond: Generated<string>;
|
|
500
500
|
/**
|
|
@@ -642,7 +642,7 @@ export interface Sor {
|
|
|
642
642
|
}
|
|
643
643
|
export interface Sub {
|
|
644
644
|
/**
|
|
645
|
-
* Id de la commission pour avis avec
|
|
645
|
+
* Id de la commission pour avis avec délégation au fond
|
|
646
646
|
*/
|
|
647
647
|
comdelid: number | null;
|
|
648
648
|
/**
|
|
@@ -687,7 +687,7 @@ export interface Sub {
|
|
|
687
687
|
sig: string | null;
|
|
688
688
|
sorid: string | null;
|
|
689
689
|
/**
|
|
690
|
-
* Style daffichage dans le
|
|
690
|
+
* Style daffichage dans le dérouleur
|
|
691
691
|
*/
|
|
692
692
|
style: Generated<string>;
|
|
693
693
|
/**
|
|
@@ -699,7 +699,7 @@ export interface Sub {
|
|
|
699
699
|
*/
|
|
700
700
|
txtid: number;
|
|
701
701
|
/**
|
|
702
|
-
* ID du
|
|
702
|
+
* ID du dérouleur texte
|
|
703
703
|
*/
|
|
704
704
|
txtidder: number | null;
|
|
705
705
|
/**
|
|
@@ -729,19 +729,19 @@ export interface TxtAmeli {
|
|
|
729
729
|
*/
|
|
730
730
|
fbuid: number | null;
|
|
731
731
|
/**
|
|
732
|
-
* O sil sagit dun
|
|
732
|
+
* O sil sagit dun dérouleur fusionné, N sinon
|
|
733
733
|
*/
|
|
734
734
|
fusder: Generated<string>;
|
|
735
735
|
/**
|
|
736
|
-
* ID du
|
|
736
|
+
* ID du dérouleur fusionné
|
|
737
737
|
*/
|
|
738
738
|
fusderid: number | null;
|
|
739
739
|
/**
|
|
740
|
-
* Ordre de discussion des textes dans un
|
|
740
|
+
* Ordre de discussion des textes dans un dérouleur fusionné
|
|
741
741
|
*/
|
|
742
742
|
fusderord: Generated<number>;
|
|
743
743
|
/**
|
|
744
|
-
* Type de fusion
|
|
744
|
+
* Type de fusion dérouleur DG ou DA
|
|
745
745
|
*/
|
|
746
746
|
fusdertyp: Generated<string | null>;
|
|
747
747
|
/**
|
package/lib/raw_types/senat.d.ts
CHANGED
|
@@ -69,7 +69,7 @@ export interface AmeliAmd {
|
|
|
69
69
|
*/
|
|
70
70
|
irrlo1113valid: Generated<string | null>;
|
|
71
71
|
/**
|
|
72
|
-
*
|
|
72
|
+
* Identité de l'entité qui a saisi l'irrecevabilité
|
|
73
73
|
*/
|
|
74
74
|
irrsaisiepar: number | null;
|
|
75
75
|
/**
|
|
@@ -495,7 +495,7 @@ export interface AmeliSai {
|
|
|
495
495
|
*/
|
|
496
496
|
id: number;
|
|
497
497
|
/**
|
|
498
|
-
* Indique si la commission saisie pour avis est
|
|
498
|
+
* Indique si la commission saisie pour avis est déléguée au fond
|
|
499
499
|
*/
|
|
500
500
|
isdelegfond: Generated<string>;
|
|
501
501
|
/**
|
|
@@ -643,7 +643,7 @@ export interface AmeliSor {
|
|
|
643
643
|
}
|
|
644
644
|
export interface AmeliSub {
|
|
645
645
|
/**
|
|
646
|
-
* Id de la commission pour avis avec
|
|
646
|
+
* Id de la commission pour avis avec délégation au fond
|
|
647
647
|
*/
|
|
648
648
|
comdelid: number | null;
|
|
649
649
|
/**
|
|
@@ -688,7 +688,7 @@ export interface AmeliSub {
|
|
|
688
688
|
sig: string | null;
|
|
689
689
|
sorid: string | null;
|
|
690
690
|
/**
|
|
691
|
-
* Style daffichage dans le
|
|
691
|
+
* Style daffichage dans le dérouleur
|
|
692
692
|
*/
|
|
693
693
|
style: Generated<string>;
|
|
694
694
|
/**
|
|
@@ -700,7 +700,7 @@ export interface AmeliSub {
|
|
|
700
700
|
*/
|
|
701
701
|
txtid: number;
|
|
702
702
|
/**
|
|
703
|
-
* ID du
|
|
703
|
+
* ID du dérouleur texte
|
|
704
704
|
*/
|
|
705
705
|
txtidder: number | null;
|
|
706
706
|
/**
|
|
@@ -730,19 +730,19 @@ export interface AmeliTxtAmeli {
|
|
|
730
730
|
*/
|
|
731
731
|
fbuid: number | null;
|
|
732
732
|
/**
|
|
733
|
-
* O sil sagit dun
|
|
733
|
+
* O sil sagit dun dérouleur fusionné, N sinon
|
|
734
734
|
*/
|
|
735
735
|
fusder: Generated<string>;
|
|
736
736
|
/**
|
|
737
|
-
* ID du
|
|
737
|
+
* ID du dérouleur fusionné
|
|
738
738
|
*/
|
|
739
739
|
fusderid: number | null;
|
|
740
740
|
/**
|
|
741
|
-
* Ordre de discussion des textes dans un
|
|
741
|
+
* Ordre de discussion des textes dans un dérouleur fusionné
|
|
742
742
|
*/
|
|
743
743
|
fusderord: Generated<number>;
|
|
744
744
|
/**
|
|
745
|
-
* Type de fusion
|
|
745
|
+
* Type de fusion dérouleur DG ou DA
|
|
746
746
|
*/
|
|
747
747
|
fusdertyp: Generated<string | null>;
|
|
748
748
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* AUTO-GENERATED FILE - DO NOT EDIT!
|
|
3
3
|
*
|
|
4
|
-
* This file was automatically generated by schemats v.2.
|
|
5
|
-
* $ schemats generate -c postgres://username:password@localhost:
|
|
4
|
+
* This file was automatically generated by schemats v.2.19.6
|
|
5
|
+
* $ schemats generate -c postgres://username:password@localhost:5432/senat -t amd -t amdsen -t avicom -t avigvt -t cab -t com_ameli -t ent -t etatxt -t fbu -t grppol_ameli -t gvt -t intora -t irr -t lec_ameli -t mot -t nat -t orarol -t sai -t saisen -t sea -t sen_ameli -t ses -t sor -t sub -t txt_ameli -t typrect -t typses -t typsub -t w_nivrec -s ameli
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
export declare namespace amdFields {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* AUTO-GENERATED FILE - DO NOT EDIT!
|
|
3
3
|
*
|
|
4
|
-
* This file was automatically generated by schemats v.2.
|
|
5
|
-
* $ schemats generate -c postgres://username:password@localhost:
|
|
4
|
+
* This file was automatically generated by schemats v.2.19.6
|
|
5
|
+
* $ schemats generate -c postgres://username:password@localhost:5432/senat -t debats -t intdivers -t intpjl -t lecassdeb -t secdis -t secdivers -t syndeb -t typsec -s debats
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
export declare namespace debatsFields {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* AUTO-GENERATED FILE - DO NOT EDIT!
|
|
3
3
|
*
|
|
4
|
-
* This file was automatically generated by schemats v.2.
|
|
5
|
-
* $ schemats generate -c postgres://username:password@localhost:
|
|
4
|
+
* This file was automatically generated by schemats v.2.19.6
|
|
5
|
+
* $ schemats generate -c postgres://username:password@localhost:5432/senat -t amescr -t ass -t aud -t auteur -t ble -t catrap -t corscr -t date_seance -t deccoc -t denrap -t doc -t docatt -t docsea -t ecr -t etaloi -t evtsea -t forpub -t gen -t lecass -t lecassrap -t lecture -t lnkrap -t loi -t loithe -t natloi -t org -t orgnomhis -t orippr -t oritxt -t posvot -t qua -t rap -t raporg -t rapthe -t rolsig -t scr -t ses -t stavot -t texte -t texte_ancien -t the -t titsen -t typatt -t typaut -t typdoc -t typevtsea -t typlec -t typloi -t typorg -t typrap -t typtxt -t typurl -t votsen -s dosleg
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
export declare namespace amescrFields {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* AUTO-GENERATED FILE - DO NOT EDIT!
|
|
3
3
|
*
|
|
4
|
-
* This file was automatically generated by schemats v.2.
|
|
5
|
-
* $ schemats generate -c postgres://username:password@localhost:
|
|
4
|
+
* This file was automatically generated by schemats v.2.19.6
|
|
5
|
+
* $ schemats generate -c postgres://username:password@localhost:5432/senat -t etatquestion -t legquestion -t naturequestion -t sortquestion -t tam_ministeres -t tam_questions -t tam_reponses -t the -s questions
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
export declare namespace etatquestionFields {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* AUTO-GENERATED FILE - DO NOT EDIT!
|
|
3
3
|
*
|
|
4
|
-
* This file was automatically generated by schemats v.2.
|
|
5
|
-
* $ schemats generate -c postgres://username:password@localhost:
|
|
4
|
+
* This file was automatically generated by schemats v.2.19.6
|
|
5
|
+
* $ schemats generate -c postgres://username:password@localhost:5432/senat -t acr -t activite -t activite_audit -t activite_delegation -t activite_delegation_audit -t activite_loi -t activite_loi_audit -t activite_obligatoire -t activite_participant -t activite_participant_audit -t activite_senateur -t activite_senateur_audit -t activite_senateur_params -t activite_senateur_params_audit -t activites_liees -t activites_liees_audit -t actpro -t adhgrpsen -t adr -t adresse -t adrsen -t app -t assparint -t asster -t autgrpsen -t autorisation_profil -t autorisations -t avis_nomination_art13 -t basdes -t bur -t bur3r -t bur4r -t cad -t candid -t candidat -t candtodelete -t categorie_activite -t catpro -t catpro2e -t catterrit -t cible_categorie_periode -t cirdep -t com -t con -t cotgip -t csp -t cspfam -t databasechangelog -t databasechangeloglock -t delega -t derogation -t derogation_audit -t derogation_senateur -t derogation_senateur_audit -t design -t designoep -t designorg -t discou -t div -t dpt -t dpt_seuil_presence -t dptele -t dptele_files -t dptele_processing -t dptele_processing_type -t dpttypman -t droits_acces -t droits_acces_audit -t droits_type_derogation -t ele -t eleloc -t elucan -t eludep -t eludiv -t elueur -t elueur_apf -t elumet -t elureg -t elusen -t elusen2e -t elusen3r -t elusen4r -t elusencommu -t elusenpair -t eluter -t elutit -t eluvil -t etadebman -t etadebman3r -t etadebman4r -t etafinman -t etafinman3r -t etafinman4r -t etaprr -t etarpm -t etasen -t ext2e_bio -t ext2e_csp -t ext2e_mandats -t ext2e_minist -t extsencom_identite -t extsencom_mandat -t fonact_participant -t foncandid -t foncom -t fondelega -t fongrppol -t fongrpsen -t fonmemcom -t fonmemdelega -t fonmemextpar -t fonmemgrppol -t fonmemgrpsen -t fonmemorg -t fonorg -t grppol -t grppol4r -t grpsenami -t grpsenamiadh -t grpsenamiadhreq -t grpsenamiadhreqeta -t grpsenamiunadh -t grpsim -t gvt -t insee_pays2008 -t jhi_authority -t jhi_user -t jhi_user_authority -t lanetr -t libcom -t libdelega -t libgrppol -t libgrpsen -t liborg -t lisdptele -t mel -t memcom -t memcomsea -t memdelega -t memextpar -t memgrppol -t memgrpsen -t memorg -t met -t minind -t minist -t mis -t misetafin -t mismin -t misrapeta -t missen -t moddes -t mode_acces_elusenpair -t nation -t nationgrpsen -t nivlan -t org -t orgext -t orgextpres -t orgthe -t pairie_elusenpair -t parpol -t parpolglo -t participa -t pcs -t pcs24 -t pcs42 -t pcs8 -t pcscatpro -t per -t per_sen -t perapp -t periode_presence -t perpolglo -t perrol -t pj_justificatif -t pj_justificatif_audit -t plaind -t plan_table -t plsql_profiler_runs -t plsql_profiler_units -t poicon -t posvot -t presences_scrutin_surcharge -t presencesrevisionentity -t profil_applicatif -t qua -t rap_the -t reg -t reladr -t requetes_profil -t reslis -t resultat -t reu -t revchanges -t rne_mandat -t rne_mandat_diff -t rne_sen -t rne_sen_diff -t rne_type_mandat -t rol -t sal -t scr -t scrusoldelega -t sea -t sec -t sec2e -t secexe -t sen -t senbur -t senbur3r -t senbur4r -t sennom -t senpj -t sensim -t sentablenom -t senurl -t seuil_presence -t sirpas_elusen -t sirpas_fonmemcom -t sirpas_fonmemdelega -t sirpas_fonmemgrppol -t sirpas_memcom -t sirpas_memdelega -t sirpas_memgrppol -t sirpas_mvt -t sirpas_mvtcm -t sirpas_mvttri -t sirpas_sen -t sirpas_senbur -t sirpas_trf -t srv -t stajur -t stavot -t suspensiontravaux -t suspensiontravaux_audit -t sysage -t syscognos -t sysevt -t sysvar -t sysvar_sendev -t sysvar_senprod -t tapsenrevchanges -t tapsenrevisionentity -t telephone -t temval -t tenpol -t territ -t testoracle -t titele -t titelerne -t titmin -t titnob -t tmpsd -t toutes -t turelu -t typadr -t typapppol -t typbister -t typcandid -t type_activite -t type_activite_participant -t type_activite_rol -t type_activite_senateur -t type_categorie -t type_derogation -t type_droit_acces -t type_pj_justificatif -t type_rne_diff -t type_type_derogation -t typele -t typgrpsen -t typman -t typmin -t typmoddes -t typorg -t typorgext -t typparpol -t typpoicon -t typprs -t typprssta -t typscr -t typtel -t typurl -t typvoi -t uploaded_file -t uploaded_file_type -t validation -t validation_defview_profil -t validation_profil -t vercand -t verres -t votes -t zongeo -s sens
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
export declare namespace acrFields {
|