@tricoteuses/senat 2.10.5 → 2.11.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/databases.d.ts +1 -28
- package/lib/databases.js +0 -6
- package/lib/datasets.d.ts +6 -0
- package/lib/datasets.js +233 -0
- package/lib/loaders.d.ts +5 -0
- package/lib/loaders.js +14 -9
- package/lib/model/ameli.d.ts +31 -143
- package/lib/model/ameli.js +102 -95
- package/lib/model/commission.d.ts +5 -0
- package/lib/model/commission.js +263 -0
- package/lib/model/debats.d.ts +13 -51
- package/lib/model/documents.d.ts +2 -0
- package/lib/model/documents.js +37 -0
- package/lib/model/dosleg.d.ts +9 -104
- package/lib/model/dosleg.js +76 -108
- package/lib/model/index.d.ts +4 -2
- package/lib/model/index.js +4 -2
- package/lib/model/questions.d.ts +10 -458
- package/lib/model/scrutins.d.ts +3 -0
- package/lib/model/scrutins.js +74 -0
- package/lib/model/{compte_rendu.js → seance.js} +47 -28
- package/lib/model/sens.d.ts +28 -1002
- package/lib/model/sens.js +65 -33
- package/lib/model/util.d.ts +1 -0
- package/lib/model/util.js +19 -1
- package/lib/raw_types/ameli.d.ts +778 -1521
- package/lib/raw_types/ameli.js +5 -345
- package/lib/raw_types/debats.d.ts +163 -306
- package/lib/raw_types/debats.js +5 -84
- package/lib/raw_types/dosleg.d.ts +1349 -2293
- package/lib/raw_types/dosleg.js +5 -550
- package/lib/raw_types/questions.d.ts +374 -519
- package/lib/raw_types/questions.js +5 -84
- package/lib/raw_types/senat.d.ts +11389 -0
- package/lib/raw_types/senat.js +5 -0
- package/lib/raw_types/sens.d.ts +6729 -12571
- package/lib/raw_types/sens.js +5 -2944
- 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 +37 -31
- package/lib/scripts/retrieve_cr_commission.d.ts +1 -0
- package/lib/scripts/retrieve_cr_commission.js +291 -0
- package/lib/scripts/{retrieve_comptes_rendus.js → retrieve_cr_seance.js} +1 -1
- package/lib/scripts/retrieve_open_data.js +35 -1
- package/lib/utils/cr_spliting.d.ts +22 -1
- package/lib/utils/cr_spliting.js +273 -12
- package/lib/utils/reunion_grouping.d.ts +3 -0
- package/lib/utils/reunion_grouping.js +1 -1
- package/package.json +12 -11
- /package/lib/model/{compte_rendu.d.ts → seance.d.ts} +0 -0
- /package/lib/scripts/{retrieve_comptes_rendus.d.ts → retrieve_cr_seance.d.ts} +0 -0
package/lib/databases.d.ts
CHANGED
|
@@ -1,29 +1,2 @@
|
|
|
1
1
|
import { Kysely } from "kysely";
|
|
2
|
-
|
|
3
|
-
import { TableTypes as DebatsTableTypes } from "./raw_types/debats";
|
|
4
|
-
import { TableTypes as DoslegTableTypes } from "./raw_types/dosleg";
|
|
5
|
-
import { TableTypes as QuestionsTableTypes } from "./raw_types/questions";
|
|
6
|
-
import { TableTypes as SensTableTypes } from "./raw_types/sens";
|
|
7
|
-
type AmeliDb = {
|
|
8
|
-
[K in keyof AmeliTableTypes]: AmeliTableTypes[K]["select"];
|
|
9
|
-
};
|
|
10
|
-
type DebatsDb = {
|
|
11
|
-
[K in keyof DebatsTableTypes]: DebatsTableTypes[K]["select"];
|
|
12
|
-
};
|
|
13
|
-
type DoslegDb = {
|
|
14
|
-
[K in keyof DoslegTableTypes]: DoslegTableTypes[K]["select"];
|
|
15
|
-
};
|
|
16
|
-
type QuestionsDb = {
|
|
17
|
-
[K in keyof QuestionsTableTypes]: QuestionsTableTypes[K]["select"];
|
|
18
|
-
};
|
|
19
|
-
type SensDb = {
|
|
20
|
-
[K in keyof SensTableTypes]: SensTableTypes[K]["select"];
|
|
21
|
-
};
|
|
22
|
-
export type SenatDb = AmeliDb & DebatsDb & DoslegDb & QuestionsDb & SensDb;
|
|
23
|
-
export declare const dbSenat: Kysely<SenatDb>;
|
|
24
|
-
export declare const dbAmeli: Kysely<AmeliDb>;
|
|
25
|
-
export declare const dbDebats: Kysely<DebatsDb>;
|
|
26
|
-
export declare const dbDosleg: Kysely<DoslegDb>;
|
|
27
|
-
export declare const dbQuestions: Kysely<QuestionsDb>;
|
|
28
|
-
export declare const dbSens: Kysely<SensDb>;
|
|
29
|
-
export {};
|
|
2
|
+
export declare const dbSenat: Kysely<any>;
|
package/lib/databases.js
CHANGED
|
@@ -3,7 +3,6 @@ import * as pg from "pg";
|
|
|
3
3
|
import { types } from "pg";
|
|
4
4
|
import Cursor from "pg-cursor";
|
|
5
5
|
import config from "./config";
|
|
6
|
-
import { datasets } from "./datasets";
|
|
7
6
|
// Map int8 to number instead of string
|
|
8
7
|
// https://github.com/brianc/node-pg-types#use
|
|
9
8
|
pg.types.setTypeParser(types.builtins.INT8, (val) => {
|
|
@@ -25,8 +24,3 @@ export const dbSenat = new Kysely({
|
|
|
25
24
|
log: ["error"],
|
|
26
25
|
dialect: senatDialect,
|
|
27
26
|
});
|
|
28
|
-
export const dbAmeli = dbSenat.withSchema(datasets.ameli.database);
|
|
29
|
-
export const dbDebats = dbSenat.withSchema(datasets.debats.database);
|
|
30
|
-
export const dbDosleg = dbSenat.withSchema(datasets.dosleg.database);
|
|
31
|
-
export const dbQuestions = dbSenat.withSchema(datasets.questions.database);
|
|
32
|
-
export const dbSens = dbSenat.withSchema(datasets.sens.database);
|
package/lib/datasets.d.ts
CHANGED
|
@@ -4,6 +4,12 @@ export interface Dataset {
|
|
|
4
4
|
repairZip?: (dataset: Dataset, dataDir: string) => void;
|
|
5
5
|
title: string;
|
|
6
6
|
url: string;
|
|
7
|
+
indexes?: {
|
|
8
|
+
[table: string]: Array<{
|
|
9
|
+
name: string;
|
|
10
|
+
columns: string[];
|
|
11
|
+
}>;
|
|
12
|
+
};
|
|
7
13
|
}
|
|
8
14
|
export interface Datasets {
|
|
9
15
|
ameli: Dataset;
|
package/lib/datasets.js
CHANGED
|
@@ -25,24 +25,231 @@ export const datasets = {
|
|
|
25
25
|
},
|
|
26
26
|
title: "Amendements",
|
|
27
27
|
url: "https://data.senat.fr/data/ameli/ameli.zip",
|
|
28
|
+
indexes: {
|
|
29
|
+
amdsen: [
|
|
30
|
+
{ name: "idx_amdid", columns: ["amdid"] },
|
|
31
|
+
{ name: "idx_senid", columns: ["senid"] },
|
|
32
|
+
{ name: "idx_grpid", columns: ["grpid"] },
|
|
33
|
+
],
|
|
34
|
+
sen_ameli: [
|
|
35
|
+
{ name: "idx_entid", columns: ["entid"] },
|
|
36
|
+
],
|
|
37
|
+
grppol_ameli: [
|
|
38
|
+
{ name: "idx_entid", columns: ["entid"] },
|
|
39
|
+
],
|
|
40
|
+
sub: [
|
|
41
|
+
{ name: "idx_id", columns: ["id"] },
|
|
42
|
+
{ name: "idx_typid", columns: ["typid"] },
|
|
43
|
+
{ name: "idx_merid", columns: ["merid"] },
|
|
44
|
+
{ name: "idx_comdelid", columns: ["comdelid"] },
|
|
45
|
+
],
|
|
46
|
+
typsub: [
|
|
47
|
+
{ name: "idx_id", columns: ["id"] },
|
|
48
|
+
],
|
|
49
|
+
typrect: [
|
|
50
|
+
{ name: "idx_id", columns: ["id"] },
|
|
51
|
+
],
|
|
52
|
+
txt_ameli: [
|
|
53
|
+
{ name: "idx_id", columns: ["id"] },
|
|
54
|
+
{ name: "idx_txtetaid", columns: ["txtetaid"] },
|
|
55
|
+
{ name: "idx_sesdepid", columns: ["sesdepid"] },
|
|
56
|
+
{ name: "idx_natid", columns: ["natid"] },
|
|
57
|
+
{ name: "idx_lecid", columns: ["lecid"] },
|
|
58
|
+
],
|
|
59
|
+
etatxt: [
|
|
60
|
+
{ name: "idx_id", columns: ["id"] },
|
|
61
|
+
],
|
|
62
|
+
ses: [
|
|
63
|
+
{ name: "idx_id", columns: ["id"] },
|
|
64
|
+
{ name: "idx_typid", columns: ["typid"] },
|
|
65
|
+
{ name: "idx_ann", columns: ["ann"] }
|
|
66
|
+
],
|
|
67
|
+
typses: [
|
|
68
|
+
{ name: "idx_id", columns: ["id"] },
|
|
69
|
+
],
|
|
70
|
+
nat: [
|
|
71
|
+
{ name: "idx_id", columns: ["id"] },
|
|
72
|
+
],
|
|
73
|
+
lec_ameli: [
|
|
74
|
+
{ name: "idx_id", columns: ["id"] },
|
|
75
|
+
],
|
|
76
|
+
mot: [
|
|
77
|
+
{ name: "idx_id", columns: ["id"] },
|
|
78
|
+
],
|
|
79
|
+
avicom: [
|
|
80
|
+
{ name: "idx_id", columns: ["id"] },
|
|
81
|
+
],
|
|
82
|
+
avigvt: [
|
|
83
|
+
{ name: "idx_id", columns: ["id"] },
|
|
84
|
+
],
|
|
85
|
+
sor: [
|
|
86
|
+
{ name: "idx_id", columns: ["id"] },
|
|
87
|
+
],
|
|
88
|
+
irr: [
|
|
89
|
+
{ name: "idx_id", columns: ["id"] },
|
|
90
|
+
],
|
|
91
|
+
com_ameli: [
|
|
92
|
+
{ name: "idx_entid", columns: ["entid"] },
|
|
93
|
+
],
|
|
94
|
+
cab: [
|
|
95
|
+
{ name: "idx_entid", columns: ["entid"] },
|
|
96
|
+
],
|
|
97
|
+
amd: [
|
|
98
|
+
{ name: "idx_subid", columns: ["subid"] },
|
|
99
|
+
{ name: "idx_typrectid", columns: ["typrectid"] },
|
|
100
|
+
{ name: "idx_txtid", columns: ["txtid"] },
|
|
101
|
+
{ name: "idx_motid", columns: ["motid"] },
|
|
102
|
+
{ name: "idx_avcid", columns: ["avcid"] },
|
|
103
|
+
{ name: "idx_avgid", columns: ["avgid"] },
|
|
104
|
+
{ name: "idx_sorid", columns: ["sorid"] },
|
|
105
|
+
{ name: "idx_irrid", columns: ["irrid"] },
|
|
106
|
+
{ name: "idx_nomentid", columns: ["nomentid"] },
|
|
107
|
+
],
|
|
108
|
+
},
|
|
28
109
|
},
|
|
29
110
|
debats: {
|
|
30
111
|
database: "debats",
|
|
31
112
|
repairEncoding: true,
|
|
32
113
|
title: "Informations relatives aux comptes rendus intégraux de la séance publique",
|
|
33
114
|
url: "https://data.senat.fr/data/debats/debats.zip",
|
|
115
|
+
indexes: {
|
|
116
|
+
secdis: [
|
|
117
|
+
{ name: "idx_datsea", columns: ["datsea"] },
|
|
118
|
+
{ name: "idx_typseccod", columns: ["typseccod"] },
|
|
119
|
+
],
|
|
120
|
+
intpjl: [
|
|
121
|
+
{ name: "idx_secdiscle", columns: ["secdiscle"] },
|
|
122
|
+
],
|
|
123
|
+
secdivers: [
|
|
124
|
+
{ name: "idx_datsea", columns: ["datsea"] },
|
|
125
|
+
{ name: "idx_typseccod", columns: ["typseccod"] },
|
|
126
|
+
],
|
|
127
|
+
intdivers: [
|
|
128
|
+
{ name: "idx_intdiverscle", columns: ["intdiverscle"] },
|
|
129
|
+
],
|
|
130
|
+
lecassdeb: [
|
|
131
|
+
{ name: "idx_datsea", columns: ["datsea"] },
|
|
132
|
+
],
|
|
133
|
+
},
|
|
34
134
|
},
|
|
35
135
|
dosleg: {
|
|
36
136
|
database: "dosleg",
|
|
37
137
|
repairEncoding: true,
|
|
38
138
|
title: "Dossiers législatifs",
|
|
39
139
|
url: "https://data.senat.fr/data/dosleg/dosleg.zip",
|
|
140
|
+
indexes: {
|
|
141
|
+
amescr: [
|
|
142
|
+
{ name: "idx_scrnum", columns: ["scrnum"] },
|
|
143
|
+
],
|
|
144
|
+
auteur: [
|
|
145
|
+
{ name: "idx_autcod", columns: ["autcod"] },
|
|
146
|
+
],
|
|
147
|
+
corscr: [
|
|
148
|
+
{ name: "idx_scrnum", columns: ["scrnum"] },
|
|
149
|
+
],
|
|
150
|
+
date_seance: [
|
|
151
|
+
{ name: "idx_code", columns: ["code"] },
|
|
152
|
+
{ name: "idx_lecidt", columns: ["lecidt"] },
|
|
153
|
+
],
|
|
154
|
+
deccoc: [
|
|
155
|
+
{ name: "idx_deccoccod", columns: ["deccoccod"] },
|
|
156
|
+
],
|
|
157
|
+
etaloi: [
|
|
158
|
+
{ name: "idx_etaloicod", columns: ["etaloicod"] },
|
|
159
|
+
],
|
|
160
|
+
lecass: [
|
|
161
|
+
{ name: "idx_lecidt", columns: ["lecidt"] },
|
|
162
|
+
{ name: "idx_codass", columns: ["codass"] },
|
|
163
|
+
{ name: "idx_orgcod", columns: ["orgcod"] },
|
|
164
|
+
{ name: "idx_orippr", columns: ["orippr"] },
|
|
165
|
+
],
|
|
166
|
+
lecassrap: [
|
|
167
|
+
{ name: "idx_rapcod", columns: ["rapcod"] },
|
|
168
|
+
{ name: "idx_lecassidt", columns: ["lecassidt"] },
|
|
169
|
+
],
|
|
170
|
+
lecture: [
|
|
171
|
+
{ name: "idx_loicod", columns: ["loicod"] },
|
|
172
|
+
{ name: "idx_typleccod", columns: ["typleccod"] },
|
|
173
|
+
{ name: "idx_lecidt", columns: ["lecidt"] },
|
|
174
|
+
],
|
|
175
|
+
loi: [
|
|
176
|
+
{ name: "idx_typloicod", columns: ["typloicod"] },
|
|
177
|
+
{ name: "idx_etaloicod", columns: ["etaloicod"] },
|
|
178
|
+
{ name: "idx_deccoccod", columns: ["deccoccod"] },
|
|
179
|
+
{ name: "idx_loicod", columns: ["loicod"] },
|
|
180
|
+
],
|
|
181
|
+
loithe: [
|
|
182
|
+
{ name: "idx_thecle", columns: ["thecle"] },
|
|
183
|
+
{ name: "idx_loicod", columns: ["loicod"] },
|
|
184
|
+
],
|
|
185
|
+
posvot: [
|
|
186
|
+
{ name: "idx_posvotcod", columns: ["posvotcod"] },
|
|
187
|
+
],
|
|
188
|
+
rap: [
|
|
189
|
+
{ name: "idx_rapcod", columns: ["rapcod"] },
|
|
190
|
+
{ name: "idx_coddenrap", columns: ["coddenrap"] },
|
|
191
|
+
],
|
|
192
|
+
rolsig: [
|
|
193
|
+
{ name: "idx_signataire", columns: ["signataire"] },
|
|
194
|
+
],
|
|
195
|
+
scr: [
|
|
196
|
+
{ name: "idx_code", columns: ["code"] },
|
|
197
|
+
{ name: "idx_scrnum", columns: ["scrnum"] },
|
|
198
|
+
{ name: "idx_sesann", columns: ["sesann"] },
|
|
199
|
+
],
|
|
200
|
+
stavot: [
|
|
201
|
+
{ name: "idx_stavotidt", columns: ["stavotidt"] },
|
|
202
|
+
],
|
|
203
|
+
texte: [
|
|
204
|
+
{ name: "idx_lecassidt", columns: ["lecassidt"] },
|
|
205
|
+
{ name: "idx_oritxtcod", columns: ["oritxtcod"] },
|
|
206
|
+
{ name: "idx_typtxtcod", columns: ["typtxtcod"] },
|
|
207
|
+
{ name: "idx_texcod", columns: ["texcod"] },
|
|
208
|
+
],
|
|
209
|
+
the: [
|
|
210
|
+
{ name: "idx_thecle", columns: ["thecle"] },
|
|
211
|
+
],
|
|
212
|
+
titsen: [
|
|
213
|
+
{ name: "idx_titsencod", columns: ["titsencod"] },
|
|
214
|
+
],
|
|
215
|
+
typloi: [
|
|
216
|
+
{ name: "idx_typloicod", columns: ["typloicod"] },
|
|
217
|
+
],
|
|
218
|
+
typtxt: [
|
|
219
|
+
{ name: "idx_typtxtcod", columns: ["typtxtcod"] },
|
|
220
|
+
],
|
|
221
|
+
votsen: [
|
|
222
|
+
{ name: "idx_scrnum", columns: ["scrnum"] },
|
|
223
|
+
{ name: "idx_titsencod", columns: ["titsencod"] },
|
|
224
|
+
{ name: "idx_stavotidt", columns: ["stavotidt"] },
|
|
225
|
+
{ name: "idx_posvotcod", columns: ["posvotcod"] },
|
|
226
|
+
{ name: "idx_senmat", columns: ["senmat"] },
|
|
227
|
+
],
|
|
228
|
+
},
|
|
40
229
|
},
|
|
41
230
|
questions: {
|
|
42
231
|
database: "questions",
|
|
43
232
|
repairEncoding: true,
|
|
44
233
|
title: "Questions écrites et orales posées par les sénateurs au Gouvernement",
|
|
45
234
|
url: "https://data.senat.fr/data/questions/questions.zip",
|
|
235
|
+
indexes: {
|
|
236
|
+
tam_reponses: [
|
|
237
|
+
{ name: "idx_idque", columns: ["idque"] },
|
|
238
|
+
],
|
|
239
|
+
tam_questions: [
|
|
240
|
+
{ name: "idx_sorquecod", columns: ["sorquecod"] },
|
|
241
|
+
{ name: "idx_etaquecod", columns: ["etaquecod"] },
|
|
242
|
+
],
|
|
243
|
+
the: [
|
|
244
|
+
{ name: "idx_thenouidt", columns: ["thenouidt"] },
|
|
245
|
+
],
|
|
246
|
+
sortquestion: [
|
|
247
|
+
{ name: "idx_sorquecod", columns: ["sorquecod"] },
|
|
248
|
+
],
|
|
249
|
+
etatquestion: [
|
|
250
|
+
{ name: "idx_etaquecod", columns: ["etaquecod"] },
|
|
251
|
+
],
|
|
252
|
+
},
|
|
46
253
|
},
|
|
47
254
|
sens: {
|
|
48
255
|
database: "sens",
|
|
@@ -55,6 +262,32 @@ export const datasets = {
|
|
|
55
262
|
},
|
|
56
263
|
title: "Sénateurs (y compris organes et présence)",
|
|
57
264
|
url: "https://data.senat.fr/data/senateurs/export_sens.zip",
|
|
265
|
+
indexes: {
|
|
266
|
+
dpt: [
|
|
267
|
+
{ name: "idx_dptnum", columns: ["dptnum"] },
|
|
268
|
+
{ name: "idx_regcod", columns: ["regcod"] },
|
|
269
|
+
],
|
|
270
|
+
activite_loi: [
|
|
271
|
+
{ name: "idx_actid", columns: ["actid"] },
|
|
272
|
+
],
|
|
273
|
+
activite_delegation: [
|
|
274
|
+
{ name: "idx_actid", columns: ["actid"] },
|
|
275
|
+
],
|
|
276
|
+
activite_participant: [
|
|
277
|
+
{ name: "idx_senmat", columns: ["senmat"] },
|
|
278
|
+
],
|
|
279
|
+
activite_senateur: [
|
|
280
|
+
{ name: "idx_senmat", columns: ["senmat"] },
|
|
281
|
+
],
|
|
282
|
+
senbur: [
|
|
283
|
+
{ name: "idx_senmat", columns: ["senmat"] },
|
|
284
|
+
{ name: "idx_burcod", columns: ["burcod"] },
|
|
285
|
+
],
|
|
286
|
+
elucan: [
|
|
287
|
+
{ name: "idx_senmat", columns: ["senmat"] },
|
|
288
|
+
{ name: "idx_typmancod", columns: ["typmancod"] },
|
|
289
|
+
],
|
|
290
|
+
},
|
|
58
291
|
},
|
|
59
292
|
};
|
|
60
293
|
export function getEnabledDatasets(categories) {
|
package/lib/loaders.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { CompteRendu } from "./types/compte_rendu";
|
|
|
9
9
|
export { EnabledDatasets } from "./datasets";
|
|
10
10
|
export declare const AGENDA_FOLDER = "agenda";
|
|
11
11
|
export declare const COMPTES_RENDUS_FOLDER = "seances";
|
|
12
|
+
export declare const COMMISSION_FOLDER = "commissions";
|
|
12
13
|
export declare const DOSLEG_DOSSIERS_FOLDER = "dossiers";
|
|
13
14
|
export declare const SCRUTINS_FOLDER = "scrutins";
|
|
14
15
|
export declare const RAPPORT_FOLDER = "rap";
|
|
@@ -68,6 +69,10 @@ export declare function iterLoadSenatComptesRendusSeances(dataDir: string, sessi
|
|
|
68
69
|
compteRendu: CompteRendu;
|
|
69
70
|
session: number;
|
|
70
71
|
}>;
|
|
72
|
+
export declare function iterLoadSenatComptesRendusCommissions(dataDir: string, session: number): Generator<{
|
|
73
|
+
compteRendu: CompteRendu;
|
|
74
|
+
session: number;
|
|
75
|
+
}>;
|
|
71
76
|
export declare function iterLoadSenatDossiersLegislatifs(dataDir: string, session: number | undefined, options?: {}): Generator<IterItem<DossierLegislatifResult>>;
|
|
72
77
|
export declare function iterLoadSenatDossiersLegislatifsRapportUrls(dataDir: string, session: number | undefined): Generator<IterItem<RapportMetadata>>;
|
|
73
78
|
export declare function iterLoadSenatDossiersLegislatifsTexteUrls(dataDir: string, session: number | undefined): Generator<IterItem<TexteMetadata>>;
|
package/lib/loaders.js
CHANGED
|
@@ -6,6 +6,7 @@ import { UNDEFINED_SESSION } from "./types/sessions";
|
|
|
6
6
|
export { EnabledDatasets } from "./datasets";
|
|
7
7
|
export const AGENDA_FOLDER = "agenda";
|
|
8
8
|
export const COMPTES_RENDUS_FOLDER = "seances";
|
|
9
|
+
export const COMMISSION_FOLDER = "commissions";
|
|
9
10
|
export const DOSLEG_DOSSIERS_FOLDER = "dossiers";
|
|
10
11
|
export const SCRUTINS_FOLDER = "scrutins";
|
|
11
12
|
export const RAPPORT_FOLDER = "rap";
|
|
@@ -61,13 +62,13 @@ export function* iterLoadSenatDebats(dataDir, session, options = {}) {
|
|
|
61
62
|
yield debatItem;
|
|
62
63
|
}
|
|
63
64
|
}
|
|
64
|
-
|
|
65
|
-
const basePath = path.join(dataDir,
|
|
66
|
-
if (!fs.existsSync(basePath))
|
|
65
|
+
function* iterLoadSenatComptesRendusGeneric(dataDir, session, subFolder) {
|
|
66
|
+
const basePath = path.join(dataDir, subFolder, DATA_TRANSFORMED_FOLDER, String(session));
|
|
67
|
+
if (!fs.existsSync(basePath)) {
|
|
68
|
+
console.warn(`[SN] Missing basePath → ${basePath}`);
|
|
67
69
|
return;
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
.sort();
|
|
70
|
+
}
|
|
71
|
+
const files = (fs.readdirSync(basePath) || []).filter((f) => f.endsWith(".json")).sort();
|
|
71
72
|
for (const fileName of files) {
|
|
72
73
|
const filePath = path.join(basePath, fileName);
|
|
73
74
|
try {
|
|
@@ -84,6 +85,12 @@ export function* iterLoadSenatComptesRendusSeances(dataDir, session) {
|
|
|
84
85
|
}
|
|
85
86
|
}
|
|
86
87
|
}
|
|
88
|
+
export function* iterLoadSenatComptesRendusSeances(dataDir, session) {
|
|
89
|
+
yield* iterLoadSenatComptesRendusGeneric(dataDir, session, COMPTES_RENDUS_FOLDER);
|
|
90
|
+
}
|
|
91
|
+
export function* iterLoadSenatComptesRendusCommissions(dataDir, session) {
|
|
92
|
+
yield* iterLoadSenatComptesRendusGeneric(dataDir, session, COMMISSION_FOLDER);
|
|
93
|
+
}
|
|
87
94
|
export function* iterLoadSenatDossiersLegislatifs(dataDir, session, options = {}) {
|
|
88
95
|
for (const dossierLegislatifItem of iterLoadSenatItems(dataDir, datasets.dosleg.database, session, DOSLEG_DOSSIERS_FOLDER, options)) {
|
|
89
96
|
yield dossierLegislatifItem;
|
|
@@ -193,9 +200,7 @@ export function* iterLoadSenatAgendasGrouped(dataDir, session) {
|
|
|
193
200
|
const baseDir = path.join(dataDir, AGENDA_FOLDER, DATA_TRANSFORMED_FOLDER, String(session ?? ""));
|
|
194
201
|
if (!fs.existsSync(baseDir))
|
|
195
202
|
return;
|
|
196
|
-
const files = (fs.readdirSync(baseDir) || [])
|
|
197
|
-
.filter((f) => f.startsWith("RUSN") && f.endsWith(".json"))
|
|
198
|
-
.sort();
|
|
203
|
+
const files = (fs.readdirSync(baseDir) || []).filter((f) => f.startsWith("RUSN") && f.endsWith(".json")).sort();
|
|
199
204
|
for (const fileName of files) {
|
|
200
205
|
const filePath = path.join(baseDir, fileName);
|
|
201
206
|
let raw;
|
package/lib/model/ameli.d.ts
CHANGED
|
@@ -1,161 +1,49 @@
|
|
|
1
1
|
import { InferResult } from "kysely";
|
|
2
|
-
export type AmendementResult = InferResult<typeof
|
|
3
|
-
declare const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
avicom: import("kysely").Nullable<import("../raw_types/ameli").Avicom>;
|
|
10
|
-
avigvt: import("kysely").Nullable<import("../raw_types/ameli").Avigvt>;
|
|
11
|
-
irr: import("kysely").Nullable<import("../raw_types/ameli").Irr>;
|
|
12
|
-
txt_ameli: import("kysely").Nullable<import("../raw_types/ameli").TxtAmeli>;
|
|
13
|
-
typrect: import("kysely").Nullable<import("../raw_types/ameli").Typrect>;
|
|
14
|
-
amdsen: import("../raw_types/ameli").Amdsen;
|
|
15
|
-
sen_ameli: import("../raw_types/ameli").SenAmeli;
|
|
16
|
-
grppol_ameli: import("kysely").Nullable<import("../raw_types/ameli").GrppolAmeli>;
|
|
17
|
-
cab: import("kysely").Nullable<import("../raw_types/ameli").Cab>;
|
|
18
|
-
com_ameli: import("kysely").Nullable<import("../raw_types/ameli").ComAmeli>;
|
|
19
|
-
etatxt: import("kysely").Nullable<import("../raw_types/ameli").Etatxt>;
|
|
20
|
-
fbu: import("../raw_types/ameli").Fbu;
|
|
21
|
-
ses: import("kysely").Nullable<import("../raw_types/ameli").Ses>;
|
|
22
|
-
gvt: import("../raw_types/ameli").Gvt;
|
|
23
|
-
intora: import("../raw_types/ameli").Intora;
|
|
24
|
-
sea: import("../raw_types/ameli").Sea;
|
|
25
|
-
orarol: import("../raw_types/ameli").Orarol;
|
|
26
|
-
lec_ameli: import("kysely").Nullable<import("../raw_types/ameli").LecAmeli>;
|
|
27
|
-
nat: import("kysely").Nullable<import("../raw_types/ameli").Nat>;
|
|
28
|
-
sai: import("../raw_types/ameli").Sai;
|
|
29
|
-
saisen: import("../raw_types/ameli").Saisen;
|
|
30
|
-
typses: import("kysely").Nullable<import("../raw_types/ameli").Typses>;
|
|
31
|
-
typsub: import("kysely").Nullable<import("../raw_types/ameli").Typsub>;
|
|
32
|
-
w_nivrec: import("../raw_types/ameli").WNivrec;
|
|
33
|
-
}, "amd" | "mot" | "sub" | "sor" | "avicom" | "avigvt" | "irr" | "txt_ameli" | "typrect" | "grppol_ameli" | "cab" | "com_ameli" | "etatxt" | "ses" | "lec_ameli" | "nat" | "typses" | "typsub", {
|
|
34
|
-
session: number | null;
|
|
35
|
-
session_libelle: string | null;
|
|
36
|
-
type_session: string | null;
|
|
37
|
-
signet_dossier_legislatif: string | null;
|
|
38
|
-
nature_texte: string | null;
|
|
39
|
-
nature_texte_libelle: string | null;
|
|
40
|
-
numero_texte: number | null;
|
|
41
|
-
numero_adoption_texte: number | null;
|
|
42
|
-
intitule_texte: string | null;
|
|
43
|
-
etat_texte: string | null;
|
|
44
|
-
etat_texte_libelle: string | null;
|
|
45
|
-
type_texte: string | null;
|
|
46
|
-
lecture: string | null;
|
|
2
|
+
export type AmendementResult = InferResult<typeof findAllAmendementsQuery>[0];
|
|
3
|
+
declare const findAllAmendementsQuery: import("kysely").SelectQueryBuilder<{
|
|
4
|
+
[x: string]: any;
|
|
5
|
+
[x: number]: any;
|
|
6
|
+
[x: symbol]: any;
|
|
7
|
+
}, "ameli.amd" | "ameli.sub" | "ameli.typsub" | "ameli.typrect" | "ameli.txt_ameli" | "ameli.etatxt" | "ameli.ses" | "ameli.typses" | "ameli.nat" | "ameli.lec_ameli" | "ameli.mot" | "ameli.avicom" | "ameli.avigvt" | "ameli.sor" | "ameli.irr" | "ameli.grppol_ameli" | "ameli.com_ameli" | "ameli.cab" | "dosleg.amescr", {
|
|
8
|
+
[x: string]: any;
|
|
47
9
|
nature: string;
|
|
48
|
-
id: number;
|
|
49
|
-
parent_id: number | null;
|
|
50
|
-
rendu_similaire_id: number | null;
|
|
51
|
-
identique_id: number | null;
|
|
52
|
-
discussion_commune_id: number | null;
|
|
53
|
-
numero: string | null;
|
|
54
|
-
numero_absolu: number | null;
|
|
55
|
-
ordre: number | null;
|
|
56
|
-
accepte_gouvernement: string | null;
|
|
57
|
-
subdivision_libelle: string | null;
|
|
58
|
-
subdivision_libelle_court: string | null;
|
|
59
|
-
subdivision_position_texte: number | null;
|
|
60
|
-
subdivision_position_discussion: number | null;
|
|
61
|
-
subdivision_mere_id: number | null;
|
|
62
|
-
subdivision_signet: string | null;
|
|
63
|
-
subdivision_commission_id: number | null;
|
|
64
|
-
subdivision_dupliquee: string | null;
|
|
65
|
-
subdivision_type: string | null;
|
|
66
|
-
alinea: number | null;
|
|
67
|
-
commentaire_probleme: string | null;
|
|
68
|
-
observations: string | null;
|
|
69
|
-
observations_additionnelles: string | null;
|
|
70
10
|
date_depot: string;
|
|
71
|
-
dispositif: string | null;
|
|
72
|
-
objet: string | null;
|
|
73
|
-
type_rectification: string | null;
|
|
74
|
-
motion_libelle: string | null;
|
|
75
11
|
etat: string;
|
|
76
|
-
|
|
77
|
-
avis_gouvernement: string | null;
|
|
78
|
-
sort: string | null;
|
|
79
|
-
revision: number;
|
|
12
|
+
sort: any;
|
|
80
13
|
url: string;
|
|
81
|
-
au_nom_de_groupe_politique: string | null;
|
|
82
|
-
au_nom_de_commission: string | null;
|
|
83
14
|
auteur_est_gouvernement: boolean;
|
|
84
15
|
auteurs: {
|
|
85
|
-
prenom:
|
|
86
|
-
homonyme:
|
|
87
|
-
nom:
|
|
88
|
-
qualite:
|
|
89
|
-
rang:
|
|
90
|
-
matricule:
|
|
91
|
-
groupe_politique_id:
|
|
92
|
-
group_politique_code:
|
|
93
|
-
groupe_politique_libelle_court:
|
|
94
|
-
groupe_politique_libelle:
|
|
16
|
+
prenom: any;
|
|
17
|
+
homonyme: any;
|
|
18
|
+
nom: any;
|
|
19
|
+
qualite: any;
|
|
20
|
+
rang: any;
|
|
21
|
+
matricule: any;
|
|
22
|
+
groupe_politique_id: any;
|
|
23
|
+
group_politique_code: any;
|
|
24
|
+
groupe_politique_libelle_court: any;
|
|
25
|
+
groupe_politique_libelle: any;
|
|
95
26
|
}[];
|
|
96
27
|
}>;
|
|
97
|
-
export declare function
|
|
98
|
-
|
|
99
|
-
session_libelle: string | null;
|
|
100
|
-
type_session: string | null;
|
|
101
|
-
signet_dossier_legislatif: string | null;
|
|
102
|
-
nature_texte: string | null;
|
|
103
|
-
nature_texte_libelle: string | null;
|
|
104
|
-
numero_texte: number | null;
|
|
105
|
-
numero_adoption_texte: number | null;
|
|
106
|
-
intitule_texte: string | null;
|
|
107
|
-
etat_texte: string | null;
|
|
108
|
-
etat_texte_libelle: string | null;
|
|
109
|
-
type_texte: string | null;
|
|
110
|
-
lecture: string | null;
|
|
28
|
+
export declare function findAllAmendements(fromSession?: number): AsyncIterableIterator<{
|
|
29
|
+
[x: string]: any;
|
|
111
30
|
nature: string;
|
|
112
|
-
id: number;
|
|
113
|
-
parent_id: number | null;
|
|
114
|
-
rendu_similaire_id: number | null;
|
|
115
|
-
identique_id: number | null;
|
|
116
|
-
discussion_commune_id: number | null;
|
|
117
|
-
numero: string | null;
|
|
118
|
-
numero_absolu: number | null;
|
|
119
|
-
ordre: number | null;
|
|
120
|
-
accepte_gouvernement: string | null;
|
|
121
|
-
subdivision_libelle: string | null;
|
|
122
|
-
subdivision_libelle_court: string | null;
|
|
123
|
-
subdivision_position_texte: number | null;
|
|
124
|
-
subdivision_position_discussion: number | null;
|
|
125
|
-
subdivision_mere_id: number | null;
|
|
126
|
-
subdivision_signet: string | null;
|
|
127
|
-
subdivision_commission_id: number | null;
|
|
128
|
-
subdivision_dupliquee: string | null;
|
|
129
|
-
subdivision_type: string | null;
|
|
130
|
-
alinea: number | null;
|
|
131
|
-
commentaire_probleme: string | null;
|
|
132
|
-
observations: string | null;
|
|
133
|
-
observations_additionnelles: string | null;
|
|
134
31
|
date_depot: string;
|
|
135
|
-
dispositif: string | null;
|
|
136
|
-
objet: string | null;
|
|
137
|
-
type_rectification: string | null;
|
|
138
|
-
motion_libelle: string | null;
|
|
139
32
|
etat: string;
|
|
140
|
-
|
|
141
|
-
avis_gouvernement: string | null;
|
|
142
|
-
sort: string | null;
|
|
143
|
-
revision: number;
|
|
33
|
+
sort: any;
|
|
144
34
|
url: string;
|
|
145
|
-
au_nom_de_groupe_politique: string | null;
|
|
146
|
-
au_nom_de_commission: string | null;
|
|
147
35
|
auteur_est_gouvernement: boolean;
|
|
148
36
|
auteurs: {
|
|
149
|
-
prenom:
|
|
150
|
-
homonyme:
|
|
151
|
-
nom:
|
|
152
|
-
qualite:
|
|
153
|
-
rang:
|
|
154
|
-
matricule:
|
|
155
|
-
groupe_politique_id:
|
|
156
|
-
group_politique_code:
|
|
157
|
-
groupe_politique_libelle_court:
|
|
158
|
-
groupe_politique_libelle:
|
|
37
|
+
prenom: any;
|
|
38
|
+
homonyme: any;
|
|
39
|
+
nom: any;
|
|
40
|
+
qualite: any;
|
|
41
|
+
rang: any;
|
|
42
|
+
matricule: any;
|
|
43
|
+
groupe_politique_id: any;
|
|
44
|
+
group_politique_code: any;
|
|
45
|
+
groupe_politique_libelle_court: any;
|
|
46
|
+
groupe_politique_libelle: any;
|
|
159
47
|
}[];
|
|
160
48
|
}>;
|
|
161
49
|
export {};
|