@tricoteuses/senat 3.1.20 → 3.1.21
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/LICENSE.md +32 -32
- package/README.md +326 -326
- package/lib/src/other_types/collaborateurs.d.ts +5 -0
- package/lib/src/other_types/manifest.d.ts +11 -0
- package/lib/src/parsers/collaborateurs.d.ts +44 -0
- package/lib/src/parsers/collaborateurs.js +157 -0
- package/lib/src/scripts/retrieve_agenda.js +38 -4
- package/lib/src/scripts/retrieve_collaborateurs.js +166 -0
- package/lib/src/scripts/shared/incremental_import_sql.js +859 -859
- package/lib/src/scripts/shared/schema_version.js +84 -84
- package/lib/src/scripts/shared/staging_metadata_sql.js +214 -214
- package/lib/src/scripts/validate_prefixed_tables.js +12 -12
- package/lib/src/server/ameli.js +11 -11
- package/lib/src/server/conversion_textes.js +106 -106
- package/lib/src/server/debats.js +10 -10
- package/lib/src/server/documents.js +22 -22
- package/lib/src/server/dosleg.js +33 -33
- package/lib/src/server/questions.js +10 -10
- package/lib/src/server/scrutins.js +3 -3
- package/lib/src/server/sens.js +19 -19
- package/lib/src/utils/manifest.d.ts +6 -0
- package/lib/src/utils/manifest.js +37 -0
- package/lib/src/utils/reunion_deletion.d.ts +2 -0
- package/lib/src/utils/reunion_deletion.js +27 -0
- package/lib/src/videos/match.js +4 -4
- package/lib/tests/collaborateurs.test.js +115 -0
- package/package.json +117 -117
- package/lib/src/config.d.ts +0 -21
- package/lib/src/config.js +0 -27
- package/lib/src/conversion_textes.d.ts +0 -11
- package/lib/src/conversion_textes.js +0 -316
- package/lib/src/databases.d.ts +0 -2
- package/lib/src/databases.js +0 -26
- package/lib/src/datasets.d.ts +0 -34
- package/lib/src/datasets.js +0 -233
- package/lib/src/git.d.ts +0 -26
- package/lib/src/git.js +0 -217
- package/lib/src/loaders.d.ts +0 -52
- package/lib/src/loaders.js +0 -254
- package/lib/src/model/agenda.d.ts +0 -6
- package/lib/src/model/agenda.js +0 -148
- package/lib/src/model/ameli.d.ts +0 -55
- package/lib/src/model/ameli.js +0 -148
- package/lib/src/model/commission.d.ts +0 -18
- package/lib/src/model/commission.js +0 -269
- package/lib/src/model/debats.d.ts +0 -67
- package/lib/src/model/debats.js +0 -95
- package/lib/src/model/documents.d.ts +0 -12
- package/lib/src/model/documents.js +0 -141
- package/lib/src/model/dosleg.d.ts +0 -7
- package/lib/src/model/dosleg.js +0 -326
- package/lib/src/model/index.d.ts +0 -7
- package/lib/src/model/index.js +0 -7
- package/lib/src/model/questions.d.ts +0 -45
- package/lib/src/model/questions.js +0 -89
- package/lib/src/model/scrutins.d.ts +0 -13
- package/lib/src/model/scrutins.js +0 -114
- package/lib/src/model/seance.d.ts +0 -3
- package/lib/src/model/seance.js +0 -267
- package/lib/src/model/sens.d.ts +0 -182
- package/lib/src/model/sens.js +0 -485
- package/lib/src/model/util.d.ts +0 -9
- package/lib/src/model/util.js +0 -38
- package/lib/src/raw_types/ameli.d.ts +0 -914
- package/lib/src/raw_types/ameli.js +0 -5
- package/lib/src/raw_types/debats.d.ts +0 -207
- package/lib/src/raw_types/debats.js +0 -5
- package/lib/src/raw_types/dosleg.d.ts +0 -1619
- package/lib/src/raw_types/dosleg.js +0 -5
- package/lib/src/raw_types/questions.d.ts +0 -423
- package/lib/src/raw_types/questions.js +0 -5
- package/lib/src/raw_types/senat.d.ts +0 -11372
- package/lib/src/raw_types/senat.js +0 -5
- package/lib/src/raw_types/sens.d.ts +0 -8248
- package/lib/src/raw_types/sens.js +0 -5
- package/lib/src/raw_types_schemats/ameli.d.ts +0 -539
- package/lib/src/raw_types_schemats/ameli.js +0 -2
- package/lib/src/raw_types_schemats/debats.d.ts +0 -127
- package/lib/src/raw_types_schemats/debats.js +0 -2
- package/lib/src/raw_types_schemats/dosleg.d.ts +0 -977
- package/lib/src/raw_types_schemats/dosleg.js +0 -2
- package/lib/src/raw_types_schemats/questions.d.ts +0 -237
- package/lib/src/raw_types_schemats/questions.js +0 -2
- package/lib/src/raw_types_schemats/sens.d.ts +0 -6915
- package/lib/src/raw_types_schemats/sens.js +0 -2
- package/lib/src/scripts/test_iter_load.js +0 -12
- package/lib/src/types/agenda.d.ts +0 -45
- package/lib/src/types/ameli.d.ts +0 -5
- package/lib/src/types/compte_rendu.d.ts +0 -83
- package/lib/src/types/debats.d.ts +0 -2
- package/lib/src/types/debats.js +0 -1
- package/lib/src/types/dosleg.d.ts +0 -70
- package/lib/src/types/dosleg.js +0 -1
- package/lib/src/types/questions.d.ts +0 -2
- package/lib/src/types/questions.js +0 -1
- package/lib/src/types/sens.d.ts +0 -10
- package/lib/src/types/sens.js +0 -1
- package/lib/src/types/sessions.d.ts +0 -6
- package/lib/src/types/sessions.js +0 -19
- package/lib/src/types/texte.d.ts +0 -72
- package/lib/src/types/texte.js +0 -15
- package/lib/src/validators/config.d.ts +0 -9
- package/lib/src/validators/config.js +0 -10
- /package/lib/src/{scripts/test_iter_load.d.ts → other_types/collaborateurs.js} +0 -0
- /package/lib/src/{types/agenda.js → other_types/manifest.js} +0 -0
- /package/lib/src/{types/ameli.js → scripts/retrieve_collaborateurs.d.ts} +0 -0
- /package/lib/{src/types/compte_rendu.js → tests/collaborateurs.test.d.ts} +0 -0
package/lib/src/videos/match.js
CHANGED
|
@@ -98,16 +98,16 @@ export async function matchOneReunion(args) {
|
|
|
98
98
|
// Accept threshold (best must pass)
|
|
99
99
|
if (best.score < minAccept) {
|
|
100
100
|
if (!options["silent"])
|
|
101
|
-
console.log(`[threshold] ${agenda.uid} score=${best.score.toFixed(2)}
|
|
102
|
-
agenda title="${agenda.titre ?? ""}"
|
|
101
|
+
console.log(`[threshold] ${agenda.uid} score=${best.score.toFixed(2)}
|
|
102
|
+
agenda title="${agenda.titre ?? ""}"
|
|
103
103
|
best title="${best.vtitle ?? ""}"`);
|
|
104
104
|
return null;
|
|
105
105
|
}
|
|
106
106
|
// Margin (confidence) gate
|
|
107
107
|
if (second && best.score - second.score < margin) {
|
|
108
108
|
if (!options["silent"]) {
|
|
109
|
-
console.log(`[Margin] ${agenda.uid} score=${best.score.toFixed(2)}
|
|
110
|
-
agenda title="${agenda.titre ?? ""}" agenda date="${agenda.startTime ?? ""}"
|
|
109
|
+
console.log(`[Margin] ${agenda.uid} score=${best.score.toFixed(2)}
|
|
110
|
+
agenda title="${agenda.titre ?? ""}" agenda date="${agenda.startTime ?? ""}"
|
|
111
111
|
best title="${best.vtitle ?? ""}" date="${best.epoch ? new Date(best.epoch * 1000).toISOString() : "null"}"`);
|
|
112
112
|
console.log("second title=", second.vtitle ?? "", " score=", second.score.toFixed(2), "date=", second.epoch ? new Date(second.epoch * 1000).toISOString() : "null");
|
|
113
113
|
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { construireLignesCollaborateurs, extraireDateEdition, normaliserPourComparaison, parseCellulePersonne, } from "../src/parsers/collaborateurs.js";
|
|
3
|
+
// Bandes x mesurées sur le vrai PDF : employeur ≈ 147, collaborateur ≈ 285.
|
|
4
|
+
const X_EMPLOYEUR = 147;
|
|
5
|
+
const X_COLLABORATEUR = 285;
|
|
6
|
+
/** Construit une page synthétique : pour chaque ligne, [employeur?, collaborateur]. */
|
|
7
|
+
function pageItems(lignes, page = 1) {
|
|
8
|
+
const items = [];
|
|
9
|
+
let y = 700;
|
|
10
|
+
for (const [employeur, collaborateur] of lignes) {
|
|
11
|
+
if (employeur)
|
|
12
|
+
items.push({ str: employeur, x: X_EMPLOYEUR, y, page });
|
|
13
|
+
items.push({ str: collaborateur, x: X_COLLABORATEUR, y, page });
|
|
14
|
+
y -= 15;
|
|
15
|
+
}
|
|
16
|
+
return items;
|
|
17
|
+
}
|
|
18
|
+
describe("parseCellulePersonne", () => {
|
|
19
|
+
it("sépare civilité, nom et prénom", () => {
|
|
20
|
+
expect(parseCellulePersonne("M. CHAREF Dahmane")).toEqual({ civilite: "M.", nom: "CHAREF", prenom: "Dahmane" });
|
|
21
|
+
expect(parseCellulePersonne("Mme OLIVIER Béatrice")).toEqual({
|
|
22
|
+
civilite: "Mme",
|
|
23
|
+
nom: "OLIVIER",
|
|
24
|
+
prenom: "Béatrice",
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
it("gère les noms composés (plusieurs jetons en majuscules)", () => {
|
|
28
|
+
expect(parseCellulePersonne("Mme MAZENOT CHAPPUY Sophie")).toEqual({
|
|
29
|
+
civilite: "Mme",
|
|
30
|
+
nom: "MAZENOT CHAPPUY",
|
|
31
|
+
prenom: "Sophie",
|
|
32
|
+
});
|
|
33
|
+
expect(parseCellulePersonne("M. DI FOLCO Camille")).toEqual({ civilite: "M.", nom: "DI FOLCO", prenom: "Camille" });
|
|
34
|
+
});
|
|
35
|
+
it("gère les particules nobiliaires en tête de nom (de, de la)", () => {
|
|
36
|
+
expect(parseCellulePersonne("Mme de CIDRAC Marta")).toEqual({ civilite: "Mme", nom: "de CIDRAC", prenom: "Marta" });
|
|
37
|
+
expect(parseCellulePersonne("Mme de LA GONTRIE Marie-Pierre")).toEqual({
|
|
38
|
+
civilite: "Mme",
|
|
39
|
+
nom: "de LA GONTRIE",
|
|
40
|
+
prenom: "Marie-Pierre",
|
|
41
|
+
});
|
|
42
|
+
expect(parseCellulePersonne("M. de LEGGE Dominique")).toEqual({
|
|
43
|
+
civilite: "M.",
|
|
44
|
+
nom: "de LEGGE",
|
|
45
|
+
prenom: "Dominique",
|
|
46
|
+
});
|
|
47
|
+
expect(parseCellulePersonne("Mme APOURCEAU-POLY Cathy")).toEqual({
|
|
48
|
+
civilite: "Mme",
|
|
49
|
+
nom: "APOURCEAU-POLY",
|
|
50
|
+
prenom: "Cathy",
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
it("conserve un prénom tronqué tel quel", () => {
|
|
54
|
+
expect(parseCellulePersonne("Mme AESCHLIMANN Marie-Do")).toEqual({
|
|
55
|
+
civilite: "Mme",
|
|
56
|
+
nom: "AESCHLIMANN",
|
|
57
|
+
prenom: "Marie-Do",
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
it("ignore le marqueur (*) de congé non rémunéré", () => {
|
|
61
|
+
expect(parseCellulePersonne("M. DURAND (*) Paul")).toEqual({ civilite: "M.", nom: "DURAND", prenom: "Paul" });
|
|
62
|
+
});
|
|
63
|
+
it("renvoie null pour une cellule vide ou une civilité seule", () => {
|
|
64
|
+
expect(parseCellulePersonne("")).toBeNull();
|
|
65
|
+
expect(parseCellulePersonne("M.")).toBeNull();
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
describe("construireLignesCollaborateurs", () => {
|
|
69
|
+
it("rattache plusieurs collaborateurs au sénateur courant (report quand l'employeur est vide)", () => {
|
|
70
|
+
const items = pageItems([
|
|
71
|
+
["Mme AESCHLIMANN Marie-Do", "M. CHAREF Dahmane"],
|
|
72
|
+
[null, "M. POURQUERY Alexandre"],
|
|
73
|
+
[null, "M. SEBRIER Valentin"],
|
|
74
|
+
["M. ALLIZARD Pascal", "Mme OLIVIER Béatrice"],
|
|
75
|
+
]);
|
|
76
|
+
const lignes = construireLignesCollaborateurs(items);
|
|
77
|
+
expect(lignes).toHaveLength(4);
|
|
78
|
+
expect(lignes.slice(0, 3).every((l) => l.senateur.nom === "AESCHLIMANN")).toBe(true);
|
|
79
|
+
expect(lignes[3].senateur.nom === "ALLIZARD" && lignes[3].collaborateur.nom === "OLIVIER").toBe(true);
|
|
80
|
+
});
|
|
81
|
+
it("ignore en-têtes, pieds de page et numéros, et gère plusieurs pages", () => {
|
|
82
|
+
const items = [
|
|
83
|
+
{ str: "Liste des collaborateurs par Sénateur", x: 208, y: 760, page: 1 },
|
|
84
|
+
{ str: "Employeur", x: 193, y: 740, page: 1 },
|
|
85
|
+
{ str: "Nom Collaborateur", x: 342, y: 740, page: 1 },
|
|
86
|
+
...pageItems([["M. BACCI Jean", "Mme BOILLOT Julie"]], 1),
|
|
87
|
+
{ str: "Edition du 24/06/2026", x: 40, y: 30, page: 1 },
|
|
88
|
+
{ str: "- 1 -", x: 296, y: 30, page: 1 },
|
|
89
|
+
...pageItems([["Mme BÉLIM Audrey", "M. BOUCHER Thibault"]], 2),
|
|
90
|
+
];
|
|
91
|
+
const lignes = construireLignesCollaborateurs(items);
|
|
92
|
+
expect(lignes).toHaveLength(2);
|
|
93
|
+
expect(lignes[0].senateur.nom).toBe("BACCI");
|
|
94
|
+
expect(lignes[1].senateur.nom).toBe("BÉLIM");
|
|
95
|
+
});
|
|
96
|
+
it("n'émet rien tant qu'aucun employeur n'a été rencontré", () => {
|
|
97
|
+
const orphelin = [{ str: "M. ORPHELIN Jean", x: X_COLLABORATEUR, y: 700, page: 1 }];
|
|
98
|
+
expect(construireLignesCollaborateurs(orphelin)).toHaveLength(0);
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
describe("extraireDateEdition", () => {
|
|
102
|
+
it("extrait la date d'édition du pied de page", () => {
|
|
103
|
+
const date = extraireDateEdition(["…", "Edition du 24/06/2026", "(*) Congé non rémunéré"]);
|
|
104
|
+
expect(date?.toISOString().slice(0, 10)).toBe("2026-06-24");
|
|
105
|
+
});
|
|
106
|
+
it("renvoie null si absente", () => {
|
|
107
|
+
expect(extraireDateEdition(["rien ici"])).toBeNull();
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
describe("normaliserPourComparaison", () => {
|
|
111
|
+
it("met en majuscules, retire les accents et compacte les espaces", () => {
|
|
112
|
+
expect(normaliserPourComparaison(" Béatrice ")).toBe("BEATRICE");
|
|
113
|
+
expect(normaliserPourComparaison("Bélim")).toBe("BELIM");
|
|
114
|
+
});
|
|
115
|
+
});
|
package/package.json
CHANGED
|
@@ -1,117 +1,117 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@tricoteuses/senat",
|
|
3
|
-
"version": "3.1.
|
|
4
|
-
"description": "Handle French Sénat's open data",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"France",
|
|
7
|
-
"open data",
|
|
8
|
-
"Parliament",
|
|
9
|
-
"Sénat"
|
|
10
|
-
],
|
|
11
|
-
"author": "Emmanuel Raviart <emmanuel@raviart.com>",
|
|
12
|
-
"contributors": [
|
|
13
|
-
"Henry Boisgibault <henry.boisgibault@proton.me>",
|
|
14
|
-
"Pierre Drege <dregop@proton.me>",
|
|
15
|
-
"Hélène Jonin <helene.jonin@gmail.com>",
|
|
16
|
-
"Paul-Henry Ngounou <ngpaulhenry@gmail.com>"
|
|
17
|
-
],
|
|
18
|
-
"bugs": {
|
|
19
|
-
"url": "https://git.tricoteuses.fr/logiciels/tricoteuses-senat/issues"
|
|
20
|
-
},
|
|
21
|
-
"homepage": "https://tricoteuses.fr/",
|
|
22
|
-
"license": "AGPL-3.0-or-later",
|
|
23
|
-
"repository": {
|
|
24
|
-
"type": "git",
|
|
25
|
-
"url": "https://git.tricoteuses.fr/logiciels/tricoteuses-senat.git"
|
|
26
|
-
},
|
|
27
|
-
"type": "module",
|
|
28
|
-
"engines": {
|
|
29
|
-
"node": ">=22"
|
|
30
|
-
},
|
|
31
|
-
"files": [
|
|
32
|
-
"lib"
|
|
33
|
-
],
|
|
34
|
-
"exports": {
|
|
35
|
-
".": {
|
|
36
|
-
"import": "./lib/src/index.js",
|
|
37
|
-
"types": "./lib/src/index.d.ts"
|
|
38
|
-
},
|
|
39
|
-
"./kysely": {
|
|
40
|
-
"import": "./lib/src/kysely/index.js",
|
|
41
|
-
"types": "./lib/src/kysely/index.d.ts"
|
|
42
|
-
},
|
|
43
|
-
"./server": {
|
|
44
|
-
"import": "./lib/src/server/index.js",
|
|
45
|
-
"types": "./lib/src/server/index.d.ts"
|
|
46
|
-
},
|
|
47
|
-
"./package.json": "./package.json"
|
|
48
|
-
},
|
|
49
|
-
"publishConfig": {
|
|
50
|
-
"access": "public"
|
|
51
|
-
},
|
|
52
|
-
"scripts": {
|
|
53
|
-
"build": "tsc",
|
|
54
|
-
"build:types": "tsc --emitDeclarationOnly",
|
|
55
|
-
"data:convert_data": "tsx src/scripts/convert_data.ts",
|
|
56
|
-
"data:download": "tsx src/scripts/data-download.ts",
|
|
57
|
-
"data:generate_schemas": "tsx src/scripts/retrieve_open_data.ts --schema",
|
|
58
|
-
"data:retrieve_agenda": "cross-env TZ='Etc/UTC' tsx src/scripts/retrieve_agenda.ts",
|
|
59
|
-
"data:retrieve_cr_seance": "tsx src/scripts/retrieve_cr_seance.ts",
|
|
60
|
-
"data:retrieve_cr_commission": "tsx src/scripts/retrieve_cr_commission.ts",
|
|
61
|
-
"data:retrieve_documents": "tsx src/scripts/retrieve_documents.ts",
|
|
62
|
-
"data:retrieve_open_data": "tsx src/scripts/retrieve_open_data.ts --all",
|
|
63
|
-
"data:retrieve_senateurs_photos": "tsx src/scripts/retrieve_senateurs_photos.ts --fetch",
|
|
64
|
-
"data:retrieve_videos": "tsx src/scripts/retrieve_videos.ts",
|
|
65
|
-
"data:validate_prefixed_tables": "tsx src/scripts/validate_prefixed_tables.ts",
|
|
66
|
-
"lint": "eslint src",
|
|
67
|
-
"lint:fix": "eslint src --fix",
|
|
68
|
-
"prepare": "npm run build",
|
|
69
|
-
"prepublishOnly": "npm run build",
|
|
70
|
-
"prettier": "prettier --write 'src/**/*.ts'",
|
|
71
|
-
"test:iter_load": "vitest tests/test_iter_load.test.ts",
|
|
72
|
-
"type-check": "tsc --noEmit",
|
|
73
|
-
"type-check:watch": "npm run type-check -- --watch",
|
|
74
|
-
"test:video-matching": "vitest tests/videoMatching.test.ts",
|
|
75
|
-
"test:prefixed-tables": "vitest tests/prefixedTables.test.ts tests/validatePrefixedTables.test.ts"
|
|
76
|
-
},
|
|
77
|
-
"dependencies": {
|
|
78
|
-
"cheerio": "^1.1.2",
|
|
79
|
-
"command-line-args": "^6.0.1",
|
|
80
|
-
"dotenv": "^17.3.1",
|
|
81
|
-
"fast-xml-parser": "^5.3.3",
|
|
82
|
-
"fs-extra": "^11.3.3",
|
|
83
|
-
"jsdom": "^27.2.0",
|
|
84
|
-
"luxon": "^3.7.2",
|
|
85
|
-
"node-stream-zip": "^1.8.2",
|
|
86
|
-
"p-limit": "^7.2.0",
|
|
87
|
-
"pg-cursor": "^2.19.0",
|
|
88
|
-
"postgres": "^3.4.8",
|
|
89
|
-
"slug": "^11.0.0",
|
|
90
|
-
"windows-1252": "^3.0.4",
|
|
91
|
-
"zod": "^4.3.5"
|
|
92
|
-
},
|
|
93
|
-
"devDependencies": {
|
|
94
|
-
"@types/cheerio": "^1.0.0",
|
|
95
|
-
"@types/command-line-args": "^5.0.0",
|
|
96
|
-
"@types/fs-extra": "^11.0.4",
|
|
97
|
-
"@types/jsdom": "^27.0.0",
|
|
98
|
-
"@types/luxon": "^3.7.1",
|
|
99
|
-
"@types/node": "^24.10.1",
|
|
100
|
-
"@types/pg": "^8.20.0",
|
|
101
|
-
"@types/pg-cursor": "^2.7.2",
|
|
102
|
-
"@types/slug": "^5.0.9",
|
|
103
|
-
"@typescript-eslint/eslint-plugin": "^8.52.0",
|
|
104
|
-
"@typescript-eslint/parser": "^8.52.0",
|
|
105
|
-
"cross-env": "^10.1.0",
|
|
106
|
-
"eslint": "^9.39.2",
|
|
107
|
-
"globals": "^17.0.0",
|
|
108
|
-
"kanel": "^4.0.1",
|
|
109
|
-
"kanel-kysely": "^4.0.0",
|
|
110
|
-
"kanel-zod": "^4.0.0",
|
|
111
|
-
"kysely": "^0.28.16",
|
|
112
|
-
"prettier": "^3.5.3",
|
|
113
|
-
"tsx": "^4.21.0",
|
|
114
|
-
"typescript": "^5.9.3",
|
|
115
|
-
"vitest": "^4.0.18"
|
|
116
|
-
}
|
|
117
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@tricoteuses/senat",
|
|
3
|
+
"version": "3.1.21",
|
|
4
|
+
"description": "Handle French Sénat's open data",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"France",
|
|
7
|
+
"open data",
|
|
8
|
+
"Parliament",
|
|
9
|
+
"Sénat"
|
|
10
|
+
],
|
|
11
|
+
"author": "Emmanuel Raviart <emmanuel@raviart.com>",
|
|
12
|
+
"contributors": [
|
|
13
|
+
"Henry Boisgibault <henry.boisgibault@proton.me>",
|
|
14
|
+
"Pierre Drege <dregop@proton.me>",
|
|
15
|
+
"Hélène Jonin <helene.jonin@gmail.com>",
|
|
16
|
+
"Paul-Henry Ngounou <ngpaulhenry@gmail.com>"
|
|
17
|
+
],
|
|
18
|
+
"bugs": {
|
|
19
|
+
"url": "https://git.tricoteuses.fr/logiciels/tricoteuses-senat/issues"
|
|
20
|
+
},
|
|
21
|
+
"homepage": "https://tricoteuses.fr/",
|
|
22
|
+
"license": "AGPL-3.0-or-later",
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "https://git.tricoteuses.fr/logiciels/tricoteuses-senat.git"
|
|
26
|
+
},
|
|
27
|
+
"type": "module",
|
|
28
|
+
"engines": {
|
|
29
|
+
"node": ">=22"
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"lib"
|
|
33
|
+
],
|
|
34
|
+
"exports": {
|
|
35
|
+
".": {
|
|
36
|
+
"import": "./lib/src/index.js",
|
|
37
|
+
"types": "./lib/src/index.d.ts"
|
|
38
|
+
},
|
|
39
|
+
"./kysely": {
|
|
40
|
+
"import": "./lib/src/kysely/index.js",
|
|
41
|
+
"types": "./lib/src/kysely/index.d.ts"
|
|
42
|
+
},
|
|
43
|
+
"./server": {
|
|
44
|
+
"import": "./lib/src/server/index.js",
|
|
45
|
+
"types": "./lib/src/server/index.d.ts"
|
|
46
|
+
},
|
|
47
|
+
"./package.json": "./package.json"
|
|
48
|
+
},
|
|
49
|
+
"publishConfig": {
|
|
50
|
+
"access": "public"
|
|
51
|
+
},
|
|
52
|
+
"scripts": {
|
|
53
|
+
"build": "tsc",
|
|
54
|
+
"build:types": "tsc --emitDeclarationOnly",
|
|
55
|
+
"data:convert_data": "tsx src/scripts/convert_data.ts",
|
|
56
|
+
"data:download": "tsx src/scripts/data-download.ts",
|
|
57
|
+
"data:generate_schemas": "tsx src/scripts/retrieve_open_data.ts --schema",
|
|
58
|
+
"data:retrieve_agenda": "cross-env TZ='Etc/UTC' tsx src/scripts/retrieve_agenda.ts",
|
|
59
|
+
"data:retrieve_cr_seance": "tsx src/scripts/retrieve_cr_seance.ts",
|
|
60
|
+
"data:retrieve_cr_commission": "tsx src/scripts/retrieve_cr_commission.ts",
|
|
61
|
+
"data:retrieve_documents": "tsx src/scripts/retrieve_documents.ts",
|
|
62
|
+
"data:retrieve_open_data": "tsx src/scripts/retrieve_open_data.ts --all",
|
|
63
|
+
"data:retrieve_senateurs_photos": "tsx src/scripts/retrieve_senateurs_photos.ts --fetch",
|
|
64
|
+
"data:retrieve_videos": "tsx src/scripts/retrieve_videos.ts",
|
|
65
|
+
"data:validate_prefixed_tables": "tsx src/scripts/validate_prefixed_tables.ts",
|
|
66
|
+
"lint": "eslint src",
|
|
67
|
+
"lint:fix": "eslint src --fix",
|
|
68
|
+
"prepare": "npm run build",
|
|
69
|
+
"prepublishOnly": "npm run build",
|
|
70
|
+
"prettier": "prettier --write 'src/**/*.ts'",
|
|
71
|
+
"test:iter_load": "vitest tests/test_iter_load.test.ts",
|
|
72
|
+
"type-check": "tsc --noEmit",
|
|
73
|
+
"type-check:watch": "npm run type-check -- --watch",
|
|
74
|
+
"test:video-matching": "vitest tests/videoMatching.test.ts",
|
|
75
|
+
"test:prefixed-tables": "vitest tests/prefixedTables.test.ts tests/validatePrefixedTables.test.ts"
|
|
76
|
+
},
|
|
77
|
+
"dependencies": {
|
|
78
|
+
"cheerio": "^1.1.2",
|
|
79
|
+
"command-line-args": "^6.0.1",
|
|
80
|
+
"dotenv": "^17.3.1",
|
|
81
|
+
"fast-xml-parser": "^5.3.3",
|
|
82
|
+
"fs-extra": "^11.3.3",
|
|
83
|
+
"jsdom": "^27.2.0",
|
|
84
|
+
"luxon": "^3.7.2",
|
|
85
|
+
"node-stream-zip": "^1.8.2",
|
|
86
|
+
"p-limit": "^7.2.0",
|
|
87
|
+
"pg-cursor": "^2.19.0",
|
|
88
|
+
"postgres": "^3.4.8",
|
|
89
|
+
"slug": "^11.0.0",
|
|
90
|
+
"windows-1252": "^3.0.4",
|
|
91
|
+
"zod": "^4.3.5"
|
|
92
|
+
},
|
|
93
|
+
"devDependencies": {
|
|
94
|
+
"@types/cheerio": "^1.0.0",
|
|
95
|
+
"@types/command-line-args": "^5.0.0",
|
|
96
|
+
"@types/fs-extra": "^11.0.4",
|
|
97
|
+
"@types/jsdom": "^27.0.0",
|
|
98
|
+
"@types/luxon": "^3.7.1",
|
|
99
|
+
"@types/node": "^24.10.1",
|
|
100
|
+
"@types/pg": "^8.20.0",
|
|
101
|
+
"@types/pg-cursor": "^2.7.2",
|
|
102
|
+
"@types/slug": "^5.0.9",
|
|
103
|
+
"@typescript-eslint/eslint-plugin": "^8.52.0",
|
|
104
|
+
"@typescript-eslint/parser": "^8.52.0",
|
|
105
|
+
"cross-env": "^10.1.0",
|
|
106
|
+
"eslint": "^9.39.2",
|
|
107
|
+
"globals": "^17.0.0",
|
|
108
|
+
"kanel": "^4.0.1",
|
|
109
|
+
"kanel-kysely": "^4.0.0",
|
|
110
|
+
"kanel-zod": "^4.0.0",
|
|
111
|
+
"kysely": "^0.28.16",
|
|
112
|
+
"prettier": "^3.5.3",
|
|
113
|
+
"tsx": "^4.21.0",
|
|
114
|
+
"typescript": "^5.9.3",
|
|
115
|
+
"vitest": "^4.0.18"
|
|
116
|
+
}
|
|
117
|
+
}
|
package/lib/src/config.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import "dotenv/config";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
export declare const configSchema: z.ZodObject<{
|
|
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;
|
package/lib/src/config.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import "dotenv/config";
|
|
2
|
-
import { z } from "zod";
|
|
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
|
-
});
|
|
13
|
-
const config = {
|
|
14
|
-
db: {
|
|
15
|
-
host: process.env["TRICOTEUSES_SENAT_DB_HOST"] || "localhost",
|
|
16
|
-
name: process.env["TRICOTEUSES_SENAT_DB_NAME"] || "postgres",
|
|
17
|
-
password: process.env["TRICOTEUSES_SENAT_DB_PASSWORD"] || "opendata",
|
|
18
|
-
port: process.env["TRICOTEUSES_SENAT_DB_PORT"] || 5432,
|
|
19
|
-
user: process.env["TRICOTEUSES_SENAT_DB_USER"] || "opendata",
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
const result = configSchema.safeParse(config);
|
|
23
|
-
if (!result.success) {
|
|
24
|
-
console.error(`Error in configuration:\n${JSON.stringify(config, null, 2)}\nError:\n${JSON.stringify(result.error.issues, null, 2)}`);
|
|
25
|
-
process.exit(-1);
|
|
26
|
-
}
|
|
27
|
-
export default result.data;
|
|
@@ -1,11 +0,0 @@
|
|
|
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>;
|