@tricoteuses/senat 2.21.4 → 2.21.6
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/config.d.ts +2 -20
- package/lib/config.js +5 -16
- package/lib/loaders.js +1 -1
- package/lib/model/ameli.js +3 -1
- package/lib/model/documents.js +18 -5
- package/lib/model/dosleg.js +11 -11
- package/lib/raw_types/questions.d.ts +0 -4
- package/lib/raw_types/senat.d.ts +0 -4
- package/lib/raw_types_schemats/ameli.d.ts +1 -1
- package/lib/raw_types_schemats/debats.d.ts +1 -1
- package/lib/raw_types_schemats/dosleg.d.ts +1 -1
- package/lib/raw_types_schemats/questions.d.ts +1 -3
- package/lib/raw_types_schemats/sens.d.ts +1 -1
- package/lib/scripts/convert_data.js +3 -3
- package/lib/scripts/retrieve_open_data.js +1 -2
- package/lib/scripts/test_iter_load.js +1 -1
- package/lib/src/conversion_textes.d.ts +11 -0
- package/lib/src/conversion_textes.js +307 -0
- package/lib/src/git.js +52 -2
- package/lib/src/loaders.d.ts +2 -3
- package/lib/src/loaders.js +14 -29
- package/lib/src/model/documents.js +9 -6
- package/lib/src/parsers/texte.js +8 -27
- package/lib/src/scripts/convert_data.js +10 -12
- package/lib/src/scripts/convert_xml_to_html.d.ts +1 -0
- package/lib/src/scripts/convert_xml_to_html.js +62 -0
- package/lib/src/scripts/retrieve_documents.js +35 -9
- package/lib/src/scripts/test_iter_load.js +4 -4
- package/lib/src/types/texte.d.ts +8 -9
- package/lib/validators/config.d.ts +1 -9
- package/lib/validators/config.js +54 -10
- package/package.json +1 -1
- package/lib/src/utils/nvs-timecode.d.ts +0 -17
- package/lib/src/utils/nvs-timecode.js +0 -79
- package/lib/src/utils/weights_scoring_config.d.ts +0 -2
- package/lib/src/utils/weights_scoring_config.js +0 -15
package/lib/config.d.ts
CHANGED
|
@@ -1,21 +1,3 @@
|
|
|
1
1
|
import "dotenv/config";
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
db: z.ZodObject<{
|
|
5
|
-
host: z.ZodString;
|
|
6
|
-
name: z.ZodString;
|
|
7
|
-
password: z.ZodString;
|
|
8
|
-
port: z.ZodCoercedNumber<unknown>;
|
|
9
|
-
user: z.ZodString;
|
|
10
|
-
}, z.core.$strip>;
|
|
11
|
-
}, z.core.$strip>;
|
|
12
|
-
declare const _default: {
|
|
13
|
-
db: {
|
|
14
|
-
host: string;
|
|
15
|
-
name: string;
|
|
16
|
-
password: string;
|
|
17
|
-
port: number;
|
|
18
|
-
user: string;
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
export default _default;
|
|
2
|
+
declare const validConfig: any;
|
|
3
|
+
export default validConfig;
|
package/lib/config.js
CHANGED
|
@@ -1,27 +1,16 @@
|
|
|
1
1
|
import "dotenv/config";
|
|
2
|
-
import {
|
|
3
|
-
const dbSchema = z.object({
|
|
4
|
-
host: z.string().trim().min(1, "Must not be empty"),
|
|
5
|
-
name: z.string().trim().min(1, "Must not be empty"),
|
|
6
|
-
password: z.string().trim().min(1, "Must not be empty"),
|
|
7
|
-
port: z.coerce.number().int().min(0).max(65535),
|
|
8
|
-
user: z.string().trim().min(1, "Must not be empty"),
|
|
9
|
-
});
|
|
10
|
-
export const configSchema = z.object({
|
|
11
|
-
db: dbSchema,
|
|
12
|
-
});
|
|
2
|
+
import { validateConfig } from "./validators/config";
|
|
13
3
|
const config = {
|
|
14
4
|
db: {
|
|
15
5
|
host: process.env["TRICOTEUSES_SENAT_DB_HOST"] || "localhost",
|
|
16
|
-
name: process.env["TRICOTEUSES_SENAT_DB_NAME"] || "postgres",
|
|
17
6
|
password: process.env["TRICOTEUSES_SENAT_DB_PASSWORD"] || "opendata",
|
|
18
7
|
port: process.env["TRICOTEUSES_SENAT_DB_PORT"] || 5432,
|
|
19
8
|
user: process.env["TRICOTEUSES_SENAT_DB_USER"] || "opendata",
|
|
20
9
|
},
|
|
21
10
|
};
|
|
22
|
-
const
|
|
23
|
-
if (
|
|
24
|
-
console.error(`Error in configuration:\n${JSON.stringify(
|
|
11
|
+
const [validConfig, error] = validateConfig(config);
|
|
12
|
+
if (error !== null) {
|
|
13
|
+
console.error(`Error in configuration:\n${JSON.stringify(validConfig, null, 2)}\nError:\n${JSON.stringify(error, null, 2)}`);
|
|
25
14
|
process.exit(-1);
|
|
26
15
|
}
|
|
27
|
-
export default
|
|
16
|
+
export default validConfig;
|
package/lib/loaders.js
CHANGED
|
@@ -193,7 +193,7 @@ export function* iterLoadSenatDocuments(dataDir, session, documentType, options
|
|
|
193
193
|
...document,
|
|
194
194
|
};
|
|
195
195
|
const documentItem = {
|
|
196
|
-
item: enrichedDocument
|
|
196
|
+
item: enrichedDocument
|
|
197
197
|
};
|
|
198
198
|
if (document.url) {
|
|
199
199
|
const documentName = path.parse(document.url).name;
|
package/lib/model/ameli.js
CHANGED
|
@@ -47,7 +47,9 @@ const findAllAmendementsQuery = dbSenat
|
|
|
47
47
|
.leftJoin("ameli.typses", "ameli.typses.id", "ameli.ses.typid")
|
|
48
48
|
.leftJoin("ameli.nat", "ameli.txt_ameli.natid", "ameli.nat.id")
|
|
49
49
|
.leftJoin("ameli.lec_ameli", "ameli.txt_ameli.lecid", "ameli.lec_ameli.id")
|
|
50
|
-
.leftJoin("dosleg.texte", (join) => join
|
|
50
|
+
.leftJoin("dosleg.texte", (join) => join
|
|
51
|
+
.onRef("ameli.ses.ann", "=", "dosleg.texte.sesann")
|
|
52
|
+
.onRef("ameli.txt_ameli.numabs", "=", "dosleg.texte.texnum"))
|
|
51
53
|
.leftJoin("dosleg.lecass", "dosleg.texte.lecassidt", "dosleg.lecass.lecassidt")
|
|
52
54
|
.leftJoin("ameli.mot", "ameli.amd.motid", "ameli.mot.id")
|
|
53
55
|
.leftJoin("ameli.avicom", "ameli.amd.avcid", "ameli.avicom.id")
|
package/lib/model/documents.js
CHANGED
|
@@ -28,7 +28,10 @@ function documentsAttaches(rapportId) {
|
|
|
28
28
|
.selectFrom("docatt")
|
|
29
29
|
.leftJoin("typatt", "docatt.typattcod", "typatt.typattcod")
|
|
30
30
|
.where("docatt.rapcod", "=", rapportId)
|
|
31
|
-
.select([
|
|
31
|
+
.select([
|
|
32
|
+
"docatt.docatturl as url",
|
|
33
|
+
"typatt.typattlib as type_document"
|
|
34
|
+
]));
|
|
32
35
|
}
|
|
33
36
|
function selectRapportAttributes({ eb, ref, val }) {
|
|
34
37
|
return [
|
|
@@ -67,9 +70,14 @@ const queryRapports = baseQueryRapports
|
|
|
67
70
|
.leftJoin("lecass", "lecass.lecassidt", "lecassrap.lecassidt")
|
|
68
71
|
.leftJoin("lecture", "lecture.lecidt", "lecass.lecidt")
|
|
69
72
|
.leftJoin("loi", "loi.loicod", "lecture.loicod")
|
|
70
|
-
.select((args) => [
|
|
73
|
+
.select((args) => [
|
|
74
|
+
"loi.signet as signet_dossier",
|
|
75
|
+
...selectRapportAttributes(args),
|
|
76
|
+
]);
|
|
71
77
|
export function rapports(lectureAssembleeId) {
|
|
72
|
-
return jsonArrayFrom(baseQueryRapports
|
|
78
|
+
return jsonArrayFrom(baseQueryRapports
|
|
79
|
+
.select(selectRapportAttributes)
|
|
80
|
+
.where("lecassrap.lecassidt", "=", lectureAssembleeId));
|
|
73
81
|
}
|
|
74
82
|
function auteursTexte(texteId) {
|
|
75
83
|
return jsonArrayFrom(dbSenat
|
|
@@ -126,9 +134,14 @@ const queryTextes = baseQueryTextes
|
|
|
126
134
|
.leftJoin("lecass", "lecass.lecassidt", "texte.lecassidt")
|
|
127
135
|
.leftJoin("lecture", "lecture.lecidt", "lecass.lecidt")
|
|
128
136
|
.leftJoin("loi", "loi.loicod", "lecture.loicod")
|
|
129
|
-
.select((args) => [
|
|
137
|
+
.select((args) => [
|
|
138
|
+
"loi.signet as signet_dossier",
|
|
139
|
+
...selectTexteAttributes(args),
|
|
140
|
+
]);
|
|
130
141
|
export function textes(lectureAssembleeId) {
|
|
131
|
-
return jsonArrayFrom(baseQueryTextes
|
|
142
|
+
return jsonArrayFrom(baseQueryTextes
|
|
143
|
+
.select(selectTexteAttributes)
|
|
144
|
+
.where("texte.lecassidt", "=", lectureAssembleeId));
|
|
132
145
|
}
|
|
133
146
|
export function findAllTextes() {
|
|
134
147
|
return queryTextes.stream();
|
package/lib/model/dosleg.js
CHANGED
|
@@ -203,10 +203,10 @@ export function buildActesLegislatifs(dossier) {
|
|
|
203
203
|
numero: depotTexte.numero,
|
|
204
204
|
uid: `${loiSignet}-${phasePrefix}-DEPOT`,
|
|
205
205
|
session: lecAss.session,
|
|
206
|
-
chambre:
|
|
206
|
+
chambre: 'SN',
|
|
207
207
|
signet_dossier: loiSignet,
|
|
208
208
|
texte_url: depotTexte.url,
|
|
209
|
-
code_organisme: null
|
|
209
|
+
code_organisme: null
|
|
210
210
|
});
|
|
211
211
|
}
|
|
212
212
|
// =================================================================
|
|
@@ -225,7 +225,7 @@ export function buildActesLegislatifs(dossier) {
|
|
|
225
225
|
adoption: rap.adoption,
|
|
226
226
|
uid: `${loiSignet}-${phasePrefix}-COM`,
|
|
227
227
|
session: lecAss.session,
|
|
228
|
-
chambre:
|
|
228
|
+
chambre: 'SN',
|
|
229
229
|
signet_dossier: loiSignet,
|
|
230
230
|
texte_url: rap.url,
|
|
231
231
|
});
|
|
@@ -247,9 +247,9 @@ export function buildActesLegislatifs(dossier) {
|
|
|
247
247
|
libelle: `Discussion en séance publique`,
|
|
248
248
|
uid: `${loiSignet}-${phasePrefix}-DEBATS-SEANCE`,
|
|
249
249
|
session: lecAss.session,
|
|
250
|
-
chambre:
|
|
250
|
+
chambre: 'SN',
|
|
251
251
|
signet_dossier: loiSignet,
|
|
252
|
-
code_organisme: null
|
|
252
|
+
code_organisme: null
|
|
253
253
|
});
|
|
254
254
|
}
|
|
255
255
|
}
|
|
@@ -281,10 +281,10 @@ export function buildActesLegislatifs(dossier) {
|
|
|
281
281
|
adoption: libelleStatut,
|
|
282
282
|
uid: `${loiSignet}-DEC-${texteFinal.numero}`,
|
|
283
283
|
session: lecAss.session,
|
|
284
|
-
chambre:
|
|
284
|
+
chambre: 'SN',
|
|
285
285
|
signet_dossier: loiSignet,
|
|
286
286
|
texte_url: texteFinal.url,
|
|
287
|
-
code_organisme: null
|
|
287
|
+
code_organisme: null
|
|
288
288
|
});
|
|
289
289
|
}
|
|
290
290
|
}
|
|
@@ -294,19 +294,19 @@ export function buildActesLegislatifs(dossier) {
|
|
|
294
294
|
// =================================================================
|
|
295
295
|
if (dossier.date_decision_CoC) {
|
|
296
296
|
actes.push({
|
|
297
|
-
code_acte:
|
|
297
|
+
code_acte: 'CC',
|
|
298
298
|
date: dossier.date_decision_CoC,
|
|
299
299
|
libelle: `Décision du Conseil constitutionnel`,
|
|
300
300
|
id: dossier.url_decision_CoC,
|
|
301
301
|
uid: `${loiSignet}-CC`,
|
|
302
|
-
chambre:
|
|
302
|
+
chambre: 'AN',
|
|
303
303
|
signet_dossier: loiSignet,
|
|
304
304
|
texte_url: dossier.url_decision_CoC || dossier.url_dossier_CoC,
|
|
305
305
|
});
|
|
306
306
|
}
|
|
307
307
|
if (dossier.date_promulgation) {
|
|
308
308
|
actes.push({
|
|
309
|
-
code_acte:
|
|
309
|
+
code_acte: 'PROM',
|
|
310
310
|
date: dossier.date_promulgation,
|
|
311
311
|
libelle: `Promulgation de la loi`,
|
|
312
312
|
date_publication_JO: dossier.date_publication_JO,
|
|
@@ -314,7 +314,7 @@ export function buildActesLegislatifs(dossier) {
|
|
|
314
314
|
url_legifrance: dossier.url_JO,
|
|
315
315
|
id: dossier.url_JO,
|
|
316
316
|
uid: `${loiSignet}-PROM`,
|
|
317
|
-
chambre:
|
|
317
|
+
chambre: 'AN',
|
|
318
318
|
signet_dossier: loiSignet,
|
|
319
319
|
});
|
|
320
320
|
}
|
package/lib/raw_types/senat.d.ts
CHANGED
|
@@ -2735,10 +2735,6 @@ export interface QuestionsTamMinisteres {
|
|
|
2735
2735
|
titreministre: string | null;
|
|
2736
2736
|
}
|
|
2737
2737
|
export interface QuestionsTamQuestions {
|
|
2738
|
-
/**
|
|
2739
|
-
* Question caduque redéposée
|
|
2740
|
-
*/
|
|
2741
|
-
caduque_redeposee: string | null;
|
|
2742
2738
|
/**
|
|
2743
2739
|
* Libellé de la circonscription
|
|
2744
2740
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* AUTO-GENERATED FILE - DO NOT EDIT!
|
|
3
3
|
*
|
|
4
|
-
* This file was automatically generated by schemats v.2.
|
|
4
|
+
* This file was automatically generated by schemats v.2.19.6
|
|
5
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
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* AUTO-GENERATED FILE - DO NOT EDIT!
|
|
3
3
|
*
|
|
4
|
-
* This file was automatically generated by schemats v.2.
|
|
4
|
+
* This file was automatically generated by schemats v.2.19.6
|
|
5
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
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* AUTO-GENERATED FILE - DO NOT EDIT!
|
|
3
3
|
*
|
|
4
|
-
* This file was automatically generated by schemats v.2.
|
|
4
|
+
* This file was automatically generated by schemats v.2.19.6
|
|
5
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
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* AUTO-GENERATED FILE - DO NOT EDIT!
|
|
3
3
|
*
|
|
4
|
-
* This file was automatically generated by schemats v.2.
|
|
4
|
+
* This file was automatically generated by schemats v.2.19.6
|
|
5
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
|
*/
|
|
@@ -76,7 +76,6 @@ export interface tam_ministeres {
|
|
|
76
76
|
titreministre: tam_ministeresFields.titreministre;
|
|
77
77
|
}
|
|
78
78
|
export declare namespace tam_questionsFields {
|
|
79
|
-
type caduque_redeposee = string | null;
|
|
80
79
|
type circonscription = string | null;
|
|
81
80
|
type cirnum = number | null;
|
|
82
81
|
type codequalite = string | null;
|
|
@@ -136,7 +135,6 @@ export declare namespace tam_questionsFields {
|
|
|
136
135
|
type version = number | null;
|
|
137
136
|
}
|
|
138
137
|
export interface tam_questions {
|
|
139
|
-
caduque_redeposee: tam_questionsFields.caduque_redeposee;
|
|
140
138
|
circonscription: tam_questionsFields.circonscription;
|
|
141
139
|
cirnum: tam_questionsFields.cirnum;
|
|
142
140
|
codequalite: tam_questionsFields.codequalite;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* AUTO-GENERATED FILE - DO NOT EDIT!
|
|
3
3
|
*
|
|
4
|
-
* This file was automatically generated by schemats v.2.
|
|
4
|
+
* This file was automatically generated by schemats v.2.19.6
|
|
5
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
|
*/
|
|
@@ -5,7 +5,7 @@ import path from "path";
|
|
|
5
5
|
import pLimit from "p-limit";
|
|
6
6
|
import * as git from "../git";
|
|
7
7
|
import { datasets, EnabledDatasets, getEnabledDatasets } from "../datasets";
|
|
8
|
-
import { DATA_ORIGINAL_FOLDER, DATA_TRANSFORMED_FOLDER, DOCUMENT_METADATA_FILE, DOSLEG_DOSSIERS_FOLDER, SCRUTINS_FOLDER, RAPPORT_FOLDER, SENS_CIRCONSCRIPTIONS_FOLDER, SENS_ORGANISMES_FOLDER, SENS_SENATEURS_FOLDER, TEXTE_FOLDER
|
|
8
|
+
import { DATA_ORIGINAL_FOLDER, DATA_TRANSFORMED_FOLDER, DOCUMENT_METADATA_FILE, DOSLEG_DOSSIERS_FOLDER, SCRUTINS_FOLDER, RAPPORT_FOLDER, SENS_CIRCONSCRIPTIONS_FOLDER, SENS_ORGANISMES_FOLDER, SENS_SENATEURS_FOLDER, TEXTE_FOLDER } from "../loaders";
|
|
9
9
|
import { findAllAmendements, findAllCirconscriptions, findAllDebats, findAllDossiers, findAllScrutins, findAllOrganismes, findAllQuestions, findAllSens, findAllTextes, findAllRapports, } from "../model";
|
|
10
10
|
import { processRapport, processTexte } from "./retrieve_documents";
|
|
11
11
|
import { buildActesLegislatifs } from "../model/dosleg";
|
|
@@ -164,7 +164,7 @@ async function convertDatasetDosLeg(dataDir, options) {
|
|
|
164
164
|
const actesBrutsNormalises = buildActesLegislatifs(dossier);
|
|
165
165
|
const dossierWithActes = {
|
|
166
166
|
...dossier,
|
|
167
|
-
actes_legislatifs: actesBrutsNormalises
|
|
167
|
+
actes_legislatifs: actesBrutsNormalises
|
|
168
168
|
};
|
|
169
169
|
const dossierFile = `${dossier["signet"]}.json`;
|
|
170
170
|
await fs.outputJSON(path.join(dossierReorganizedDir, dossierFile), dossierWithActes, { spaces: 2 });
|
|
@@ -236,7 +236,7 @@ async function convertTextes(dataDir, options) {
|
|
|
236
236
|
const texteName = path.parse(texte["url"]).name;
|
|
237
237
|
const texteDir = path.join(originalTextesDir, `${session}`, texteName);
|
|
238
238
|
// oritxtcod = 1 corresponds to "Texte de loi déposé au Sénat"
|
|
239
|
-
const hasExposeDesMotifs = texte["origine"] ===
|
|
239
|
+
const hasExposeDesMotifs = texte["origine"] === 'Sénat' && texte["ordre_origine"] === '1';
|
|
240
240
|
const metadata = {
|
|
241
241
|
name: texteName,
|
|
242
242
|
session: texte["session"],
|
|
@@ -271,8 +271,7 @@ async function retrieveOpenData() {
|
|
|
271
271
|
process.env = {
|
|
272
272
|
...process.env,
|
|
273
273
|
PGHOST: process.env["PGHOST"] || config.db.host,
|
|
274
|
-
PGPORT: process.env["PGPORT"] ||
|
|
275
|
-
PGDATABASE: process.env["PGDATABASE"] || config.db.name,
|
|
274
|
+
PGPORT: process.env["PGPORT"] || config.db.port,
|
|
276
275
|
PGUSER: process.env["PGUSER"] || config.db.user,
|
|
277
276
|
PGPASSWORD: process.env["PGPASSWORD"] || config.db.password,
|
|
278
277
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { iterLoadSenatRapports
|
|
1
|
+
import { iterLoadSenatRapports } from "../loaders";
|
|
2
2
|
import commandLineArgs from "command-line-args";
|
|
3
3
|
import { dataDirDefaultOption } from "./shared/cli_helpers";
|
|
4
4
|
const optionsDefinitions = [dataDirDefaultOption];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface SenatMetadata {
|
|
2
|
+
number: string | null;
|
|
3
|
+
session: string | null;
|
|
4
|
+
date: string | null;
|
|
5
|
+
type: string | null;
|
|
6
|
+
authors: string | null;
|
|
7
|
+
title: string | null;
|
|
8
|
+
commission: string | null;
|
|
9
|
+
}
|
|
10
|
+
export declare function extractMetadata(xmlDoc: Document): SenatMetadata;
|
|
11
|
+
export declare function convertSenatXmlToHtml(texteXml: string, outputFilePath: string): Promise<void>;
|