@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.
Files changed (107) hide show
  1. package/LICENSE.md +32 -32
  2. package/README.md +326 -326
  3. package/lib/src/other_types/collaborateurs.d.ts +5 -0
  4. package/lib/src/other_types/manifest.d.ts +11 -0
  5. package/lib/src/parsers/collaborateurs.d.ts +44 -0
  6. package/lib/src/parsers/collaborateurs.js +157 -0
  7. package/lib/src/scripts/retrieve_agenda.js +38 -4
  8. package/lib/src/scripts/retrieve_collaborateurs.js +166 -0
  9. package/lib/src/scripts/shared/incremental_import_sql.js +859 -859
  10. package/lib/src/scripts/shared/schema_version.js +84 -84
  11. package/lib/src/scripts/shared/staging_metadata_sql.js +214 -214
  12. package/lib/src/scripts/validate_prefixed_tables.js +12 -12
  13. package/lib/src/server/ameli.js +11 -11
  14. package/lib/src/server/conversion_textes.js +106 -106
  15. package/lib/src/server/debats.js +10 -10
  16. package/lib/src/server/documents.js +22 -22
  17. package/lib/src/server/dosleg.js +33 -33
  18. package/lib/src/server/questions.js +10 -10
  19. package/lib/src/server/scrutins.js +3 -3
  20. package/lib/src/server/sens.js +19 -19
  21. package/lib/src/utils/manifest.d.ts +6 -0
  22. package/lib/src/utils/manifest.js +37 -0
  23. package/lib/src/utils/reunion_deletion.d.ts +2 -0
  24. package/lib/src/utils/reunion_deletion.js +27 -0
  25. package/lib/src/videos/match.js +4 -4
  26. package/lib/tests/collaborateurs.test.js +115 -0
  27. package/package.json +117 -117
  28. package/lib/src/config.d.ts +0 -21
  29. package/lib/src/config.js +0 -27
  30. package/lib/src/conversion_textes.d.ts +0 -11
  31. package/lib/src/conversion_textes.js +0 -316
  32. package/lib/src/databases.d.ts +0 -2
  33. package/lib/src/databases.js +0 -26
  34. package/lib/src/datasets.d.ts +0 -34
  35. package/lib/src/datasets.js +0 -233
  36. package/lib/src/git.d.ts +0 -26
  37. package/lib/src/git.js +0 -217
  38. package/lib/src/loaders.d.ts +0 -52
  39. package/lib/src/loaders.js +0 -254
  40. package/lib/src/model/agenda.d.ts +0 -6
  41. package/lib/src/model/agenda.js +0 -148
  42. package/lib/src/model/ameli.d.ts +0 -55
  43. package/lib/src/model/ameli.js +0 -148
  44. package/lib/src/model/commission.d.ts +0 -18
  45. package/lib/src/model/commission.js +0 -269
  46. package/lib/src/model/debats.d.ts +0 -67
  47. package/lib/src/model/debats.js +0 -95
  48. package/lib/src/model/documents.d.ts +0 -12
  49. package/lib/src/model/documents.js +0 -141
  50. package/lib/src/model/dosleg.d.ts +0 -7
  51. package/lib/src/model/dosleg.js +0 -326
  52. package/lib/src/model/index.d.ts +0 -7
  53. package/lib/src/model/index.js +0 -7
  54. package/lib/src/model/questions.d.ts +0 -45
  55. package/lib/src/model/questions.js +0 -89
  56. package/lib/src/model/scrutins.d.ts +0 -13
  57. package/lib/src/model/scrutins.js +0 -114
  58. package/lib/src/model/seance.d.ts +0 -3
  59. package/lib/src/model/seance.js +0 -267
  60. package/lib/src/model/sens.d.ts +0 -182
  61. package/lib/src/model/sens.js +0 -485
  62. package/lib/src/model/util.d.ts +0 -9
  63. package/lib/src/model/util.js +0 -38
  64. package/lib/src/raw_types/ameli.d.ts +0 -914
  65. package/lib/src/raw_types/ameli.js +0 -5
  66. package/lib/src/raw_types/debats.d.ts +0 -207
  67. package/lib/src/raw_types/debats.js +0 -5
  68. package/lib/src/raw_types/dosleg.d.ts +0 -1619
  69. package/lib/src/raw_types/dosleg.js +0 -5
  70. package/lib/src/raw_types/questions.d.ts +0 -423
  71. package/lib/src/raw_types/questions.js +0 -5
  72. package/lib/src/raw_types/senat.d.ts +0 -11372
  73. package/lib/src/raw_types/senat.js +0 -5
  74. package/lib/src/raw_types/sens.d.ts +0 -8248
  75. package/lib/src/raw_types/sens.js +0 -5
  76. package/lib/src/raw_types_schemats/ameli.d.ts +0 -539
  77. package/lib/src/raw_types_schemats/ameli.js +0 -2
  78. package/lib/src/raw_types_schemats/debats.d.ts +0 -127
  79. package/lib/src/raw_types_schemats/debats.js +0 -2
  80. package/lib/src/raw_types_schemats/dosleg.d.ts +0 -977
  81. package/lib/src/raw_types_schemats/dosleg.js +0 -2
  82. package/lib/src/raw_types_schemats/questions.d.ts +0 -237
  83. package/lib/src/raw_types_schemats/questions.js +0 -2
  84. package/lib/src/raw_types_schemats/sens.d.ts +0 -6915
  85. package/lib/src/raw_types_schemats/sens.js +0 -2
  86. package/lib/src/scripts/test_iter_load.js +0 -12
  87. package/lib/src/types/agenda.d.ts +0 -45
  88. package/lib/src/types/ameli.d.ts +0 -5
  89. package/lib/src/types/compte_rendu.d.ts +0 -83
  90. package/lib/src/types/debats.d.ts +0 -2
  91. package/lib/src/types/debats.js +0 -1
  92. package/lib/src/types/dosleg.d.ts +0 -70
  93. package/lib/src/types/dosleg.js +0 -1
  94. package/lib/src/types/questions.d.ts +0 -2
  95. package/lib/src/types/questions.js +0 -1
  96. package/lib/src/types/sens.d.ts +0 -10
  97. package/lib/src/types/sens.js +0 -1
  98. package/lib/src/types/sessions.d.ts +0 -6
  99. package/lib/src/types/sessions.js +0 -19
  100. package/lib/src/types/texte.d.ts +0 -72
  101. package/lib/src/types/texte.js +0 -15
  102. package/lib/src/validators/config.d.ts +0 -9
  103. package/lib/src/validators/config.js +0 -10
  104. /package/lib/src/{scripts/test_iter_load.d.ts → other_types/collaborateurs.js} +0 -0
  105. /package/lib/src/{types/agenda.js → other_types/manifest.js} +0 -0
  106. /package/lib/src/{types/ameli.js → scripts/retrieve_collaborateurs.d.ts} +0 -0
  107. /package/lib/{src/types/compte_rendu.js → tests/collaborateurs.test.d.ts} +0 -0
@@ -1,114 +0,0 @@
1
- import { sql } from "kysely";
2
- import { jsonArrayFrom } from "kysely/helpers/postgres";
3
- import { dbSenat } from "../databases";
4
- import { rtrim, toDateString } from "./util";
5
- function votes(scrutinNum, scrutinSession, scrutinDate) {
6
- return jsonArrayFrom(dbSenat
7
- .selectFrom("dosleg.votsen")
8
- .leftJoin("dosleg.titsen", "dosleg.titsen.titsencod", "dosleg.votsen.titsencod")
9
- .leftJoin("dosleg.stavot", "dosleg.stavot.stavotidt", "dosleg.votsen.stavotidt")
10
- .leftJoin("dosleg.posvot", "dosleg.posvot.posvotcod", "dosleg.votsen.posvotcod")
11
- .leftJoin("sens.memgrppol", (join) => join
12
- .onRef("sens.memgrppol.senmat", "=", "dosleg.votsen.senmat")
13
- .onRef("sens.memgrppol.memgrppoldatdeb", "<=", scrutinDate)
14
- .on((eb) => eb.or([
15
- eb("sens.memgrppol.memgrppoldatfin", ">=", scrutinDate),
16
- eb("sens.memgrppol.memgrppoldatfin", "is", null),
17
- ])))
18
- .where("dosleg.votsen.scrnum", "=", scrutinNum)
19
- .where("dosleg.votsen.sesann", "=", scrutinSession)
20
- .orderBy("sens.memgrppol.memgrppoldatdeb", "desc")
21
- .select([
22
- "dosleg.votsen.senmat as matricule_votant",
23
- "dosleg.votsen.senmatdel as matricule_delegant",
24
- "dosleg.posvot.posvotlib as position",
25
- "dosleg.stavot.stavotlib as statut_votant",
26
- "dosleg.titsen.titsenlib as titre_votant",
27
- "sens.memgrppol.memgrppolid as groupe_politique_id",
28
- "sens.memgrppol.grppolcod as groupe_politique_code",
29
- ]));
30
- }
31
- function groupesVotants(scrutinNum, scrutinSession, scrutinDate) {
32
- return jsonArrayFrom(dbSenat
33
- .selectFrom((eb) => eb
34
- .selectFrom("dosleg.votsen")
35
- .leftJoin("dosleg.posvot", "dosleg.posvot.posvotcod", "dosleg.votsen.posvotcod")
36
- .leftJoin("dosleg.stavot", "dosleg.stavot.stavotidt", "dosleg.votsen.stavotidt")
37
- .leftJoin("sens.memgrppol", (join) => join
38
- .onRef("sens.memgrppol.senmat", "=", "dosleg.votsen.senmat")
39
- .onRef("sens.memgrppol.memgrppoldatdeb", "<=", scrutinDate)
40
- .on((eb) => eb.or([
41
- eb("sens.memgrppol.memgrppoldatfin", ">=", scrutinDate),
42
- eb("sens.memgrppol.memgrppoldatfin", "is", null),
43
- ])))
44
- .where("dosleg.votsen.scrnum", "=", scrutinNum)
45
- .where("dosleg.votsen.sesann", "=", scrutinSession)
46
- .orderBy("sens.memgrppol.memgrppoldatdeb", "desc")
47
- .select([
48
- "dosleg.votsen.senmat",
49
- "dosleg.posvot.posvotlib",
50
- "dosleg.stavot.stavotlib",
51
- "sens.memgrppol.grppolcod",
52
- ])
53
- .as("unique_votes"))
54
- .groupBy(["unique_votes.grppolcod"])
55
- .select(({ fn, eb }) => [
56
- "unique_votes.grppolcod as groupe_politique_code",
57
- fn.sum(eb.case().when("unique_votes.posvotlib", "=", "pour").then(1).else(0).end()).as("nombre_pour"),
58
- fn.sum(eb.case().when("unique_votes.posvotlib", "=", "contre").then(1).else(0).end()).as("nombre_contre"),
59
- fn
60
- .sum(eb.case().when("unique_votes.posvotlib", "=", "abstention").then(1).else(0).end())
61
- .as("nombre_abstentions"),
62
- fn
63
- .sum(eb.case().when("unique_votes.posvotlib", "=", "non-votant").then(1).else(0).end())
64
- .as("nombre_non_votants"),
65
- fn.count("unique_votes.senmat").as("nombre_votants"),
66
- ]));
67
- }
68
- function misesAuPoint(scrutinNum) {
69
- return jsonArrayFrom(dbSenat
70
- .withSchema("dosleg")
71
- .selectFrom("corscr")
72
- .where("corscr.scrnum", "=", scrutinNum)
73
- .select(["corscr.corscrtxt as texte", "corscr.corscrord as ordre", "corscr.corscrurl as url"]));
74
- }
75
- const findAllScrutinsQuery = dbSenat
76
- .withSchema("dosleg")
77
- .selectFrom("scr")
78
- .leftJoin("date_seance", "scr.code", "date_seance.code")
79
- .leftJoin("lecass", "date_seance.lecidt", "lecass.lecassidt")
80
- .leftJoin("lecture", "lecture.lecidt", "lecass.lecidt")
81
- .leftJoin("loi", "loi.loicod", "lecture.loicod")
82
- .leftJoin("typlec", "typlec.typleccod", "lecture.typleccod")
83
- .select(({ eb, ref, val }) => [
84
- "scr.sesann as session",
85
- "scr.scrnum as numero",
86
- rtrim(ref("date_seance.lecidt")).as("lecture_id"),
87
- rtrim(ref("lecture.leccom")).as("lecture_libelle"),
88
- "loi.signet as signet_dossier",
89
- rtrim(ref("typlec.typleclib")).as("type_lecture"),
90
- toDateString(ref("scr.scrdat")).as("date_scrutin"),
91
- toDateString(ref("scr.scrdateff")).as("date_scrutin_effective"),
92
- sql `REPLACE(scr.scrint, E'\\u0092', '''')`.as("intitule"),
93
- "scr.scrbaspag as note",
94
- "scr.scrmaj as nombre_majorite",
95
- "scr.scrmajsea as nombre_majorite_seance",
96
- "scr.scrvot as nombre_votants",
97
- "scr.scrvotsea as nombre_votants_seance",
98
- "scr.scrsuf as nombre_suffrages",
99
- "scr.scrsufsea as nombre_suffrages_seance",
100
- "scr.scrcon as nombre_contre",
101
- "scr.scrconsea as nombre_contre_seance",
102
- "scr.scrpou as nombre_pour",
103
- "scr.scrpousea as nombre_pour_seance",
104
- votes(ref("scr.scrnum"), ref("scr.sesann"), ref("scr.scrdat")).as("votes"),
105
- groupesVotants(ref("scr.scrnum"), ref("scr.sesann"), ref("scr.scrdat")).as("groupes_votants"),
106
- misesAuPoint(ref("scr.scrnum")).as("mises_au_point"),
107
- ])
108
- .$narrowType();
109
- export function findAllScrutins(fromSession) {
110
- if (fromSession !== undefined) {
111
- return findAllScrutinsQuery.where("scr.sesann", ">=", fromSession).stream();
112
- }
113
- return findAllScrutinsQuery.stream();
114
- }
@@ -1,3 +0,0 @@
1
- import { CompteRendu } from "../types/compte_rendu";
2
- export declare function parseCompteRenduIntervalFromFile(xmlFilePath: string, startIndex: number, endIndex: number, agendaEventId: string): Promise<CompteRendu | null>;
3
- export declare function sessionStartYearFromDate(d: Date): number;
@@ -1,267 +0,0 @@
1
- import fs from "fs";
2
- import * as cheerio from "cheerio";
3
- import { toCRDate } from "./util";
4
- import { makeReunionUid } from "../utils/reunion_parsing";
5
- import { yyyymmddFromPath } from "../utils/date";
6
- import { decodeHtmlEntities, dedupeSpeaker, fixApostrophes, norm } from "../utils/string_cleaning";
7
- export async function parseCompteRenduIntervalFromFile(xmlFilePath, startIndex, endIndex, agendaEventId) {
8
- try {
9
- const raw = fs.readFileSync(xmlFilePath, "utf8");
10
- const $ = cheerio.load(raw, { xml: false });
11
- const metadonnees = extractMetadonnees($, xmlFilePath);
12
- const order = $("body *").toArray();
13
- const idx = new Map(order.map((el, i) => [el, i]));
14
- const totalNodes = order.length;
15
- const clampedStart = Math.max(0, Math.min(startIndex, totalNodes - 1));
16
- const clampedEnd = Math.max(0, Math.min(endIndex, totalNodes - 1));
17
- const intervals = [
18
- {
19
- start: clampedStart,
20
- end: clampedEnd,
21
- },
22
- ];
23
- metadonnees.sommaire = extractSommaireForIntervals($, idx, intervals);
24
- const points = [];
25
- let ordre = 0;
26
- const addPoint = (p) => points.push({ ...p, ordre_absolu_seance: String(++ordre) });
27
- // Interventions
28
- $("div.intervenant").each((_, block) => {
29
- if (!elementInAnyInterval(block, idx, intervals))
30
- return;
31
- const $block = $(block);
32
- $block
33
- .find([
34
- "p[class^='titre_S']",
35
- "p.mention_titre",
36
- "p.intitule_titre",
37
- "p.mention_chapitre",
38
- "p.intitule_chapitre",
39
- "p.mention_article",
40
- "p.intitule_article",
41
- "p.mention_section",
42
- "p.intitule_section",
43
- ].join(","))
44
- .remove();
45
- const firstP = $block.find("p").first();
46
- if (!firstP || firstP.length === 0)
47
- return;
48
- const speakerLabelRaw = firstP.find(".orateur_nom").text() || firstP.find("a.lien_senfic").text() || "";
49
- const speakerLabel = dedupeSpeaker(speakerLabelRaw);
50
- const { mat, nom: nomCRI, qua: quaCRI } = readIntervenantMeta($block);
51
- const qualFromSpans = extractAndRemoveLeadingQualite($, $block);
52
- const qualite = norm(decodeHtmlEntities(quaCRI || "")) || qualFromSpans;
53
- const canonicalName = dedupeSpeaker(nomCRI || speakerLabel);
54
- const role = roleForSpeaker(speakerLabel) || roleForSpeaker(qualite) || roleForSpeaker(quaCRI || "");
55
- const speechHtml = sanitizeInterventionHtml($, $block);
56
- const speechText = norm(cheerio.load(speechHtml).text() || "");
57
- if (!speechText)
58
- return;
59
- addPoint({
60
- code_grammaire: "PAROLE_GENERIQUE",
61
- roledebat: role,
62
- orateurs: { orateur: { nom: canonicalName, id: mat || "", qualite } },
63
- texte: { _: speechHtml },
64
- });
65
- });
66
- const contenu = {
67
- quantiemes: {
68
- journee: metadonnees.dateSeance,
69
- session: metadonnees.session,
70
- },
71
- point: points,
72
- };
73
- const yyyymmdd = yyyymmddFromPath(xmlFilePath);
74
- const dateISO = `${yyyymmdd.slice(0, 4)}-${yyyymmdd.slice(4, 6)}-${yyyymmdd.slice(6, 8)}`;
75
- const seanceRef = makeReunionUid(dateISO, "SP", agendaEventId, null);
76
- return {
77
- uid: `CRSSN${yyyymmdd}E${agendaEventId}`,
78
- seanceRef,
79
- sessionRef: metadonnees.session,
80
- metadonnees,
81
- contenu,
82
- };
83
- }
84
- catch (e) {
85
- console.error(`[CRI] parseInterval error file=${xmlFilePath} interval=[${startIndex}..${endIndex}] event=${agendaEventId}:`, e);
86
- return null;
87
- }
88
- }
89
- export function sessionStartYearFromDate(d) {
90
- // Session (1th oct N → 30 sept N+1)
91
- const m = d.getMonth();
92
- const y = d.getFullYear();
93
- return m >= 9 ? y : y - 1;
94
- }
95
- function roleForSpeaker(labelOrQualite) {
96
- const s = (labelOrQualite || "").toLowerCase();
97
- if (/^(m\.|mme)?\s*(le|la)\s+pr[ée]sident(e)?\b/.test(s) || /\bpr[ée]sident[e]?\s+de\s+séance\b/.test(s))
98
- return "président";
99
- return "";
100
- }
101
- function readIntervenantMeta($block) {
102
- const int = $block.find("cri\\:intervenant").first();
103
- if (int.length)
104
- return { mat: int.attr("mat") || undefined, nom: int.attr("nom") || undefined, qua: int.attr("qua") || undefined };
105
- const html = $block.html() || "";
106
- const m = html.match(/<!--\s*cri:intervenant\b([^>]+)-->/i);
107
- if (!m)
108
- return {};
109
- const out = {};
110
- const re = /(\w+)="([^"]*)"/g;
111
- let a;
112
- while ((a = re.exec(m[1])))
113
- out[a[1]] = decodeHtmlEntities(a[2]);
114
- return { mat: out["mat"], nom: out["nom"], qua: out["qua"] };
115
- }
116
- function extractAndRemoveLeadingQualite($, $block) {
117
- const firstP = $block.find("p").first();
118
- if (firstP.length === 0)
119
- return "";
120
- const parts = [];
121
- let stop = false;
122
- firstP.contents().each((_, node) => {
123
- if (stop)
124
- return;
125
- if (node.type === "tag") {
126
- const $node = $(node);
127
- if ($node.hasClass("orateur_nom")) {
128
- $node.remove();
129
- return;
130
- }
131
- if ($node.hasClass("orateur_qualite")) {
132
- parts.push($node.text() || "");
133
- $node.remove();
134
- return;
135
- }
136
- const t = norm($node.text() || "");
137
- if (t)
138
- stop = true;
139
- else
140
- $node.remove();
141
- }
142
- else if (node.type === "text") {
143
- const t = norm(node.data || "");
144
- if (!t || /^[:.,;–—-]+$/.test(t)) {
145
- ;
146
- node.data = "";
147
- return;
148
- }
149
- stop = true;
150
- }
151
- });
152
- return fixApostrophes(norm(parts.join(" ")));
153
- }
154
- function sanitizeInterventionHtml($, $block) {
155
- const ps = $block.find("p").toArray();
156
- const cleaned = ps
157
- .map((p) => {
158
- const $p = $(p).clone();
159
- $p.find(".orateur_nom, .orateur_qualite").remove();
160
- $p.find("a").each((_, a) => {
161
- const $a = $(a);
162
- $a.replaceWith($a.text());
163
- });
164
- $p.find(".info_entre_parentheses").each((_, el) => {
165
- const txt = $(el).text();
166
- $(el).replaceWith($("<em/>").text(txt));
167
- });
168
- $p.find("span").each((_, span) => {
169
- const $s = $(span);
170
- if (!$s.text().trim())
171
- $s.remove();
172
- });
173
- const inner = ($p.html() || "").trim();
174
- if (!inner)
175
- return null;
176
- return `<p>${inner}</p>`;
177
- })
178
- .filter(Boolean);
179
- return cleaned.join("<br/>");
180
- }
181
- function extractSommaireForIntervals($, idx, intervals) {
182
- const inIv = (el) => elementInAnyInterval(el, idx, intervals);
183
- const root = $("body");
184
- const sommaire = { presidentSeance: { _: "" }, sommaire1: [] };
185
- // (1) Présidence (tm2) — première ligne dans l’intervalle
186
- const pres = root
187
- .find("p.tm2")
188
- .filter((_, el) => inIv(el))
189
- .first();
190
- if (pres.length)
191
- sommaire.presidentSeance = { _: norm(pres.text()) };
192
- // (2) Paras tm5 présents dans l’intervalle
193
- const paras = [];
194
- root.find("p.tm5").each((_, el) => {
195
- if (!inIv(el))
196
- return;
197
- const t = norm($(el).text());
198
- if (t)
199
- paras.push({ _: t });
200
- });
201
- if (paras.length)
202
- sommaire.para = paras.length === 1 ? paras[0] : paras;
203
- // (3) Items de 1er niveau (tm3) présents dans l’intervalle
204
- const items = [];
205
- root.find("p.tm3").each((_, el) => {
206
- if (!inIv(el))
207
- return;
208
- const $p = $(el);
209
- const full = norm($p.text() || "");
210
- if (!full)
211
- return;
212
- const numMatch = full.match(/^(\d+)\s*[.\-–—]\s*/);
213
- const valeur = numMatch ? numMatch[1] : undefined;
214
- // prefere intitule in ancre <a> if present
215
- const a = $p.find("a").first();
216
- const intituleRaw = a.length ? a.text() : full.replace(/^(\d+)\s*[.\-–—]\s*/, "");
217
- const intitule = norm(intituleRaw);
218
- // id_syceron from href="#Niv1_SOMx"
219
- const href = (a.attr("href") || "").trim();
220
- const idSyceron = href.startsWith("#") ? href.slice(1) : href;
221
- const titreStruct = { id_syceron: idSyceron || "", intitule };
222
- items.push({ valeur_pts_odj: valeur, titreStruct });
223
- });
224
- if (items.length)
225
- sommaire.sommaire1 = items;
226
- return sommaire;
227
- }
228
- function extractMetadonnees($, filePath) {
229
- let dateText = norm($("h1, h2, .page-title").first().text() || "");
230
- if (!dateText)
231
- dateText = norm($("p").first().text() || "");
232
- const dateMatch = dateText.match(/\b(\d{1,2}\s+\w+\s+\d{4})\b/i);
233
- const allText = norm($("body").text() || "");
234
- const sessionMatch = allText.match(/\bsession\s+(\d{4}-\d{4})\b/i);
235
- let dateSeance = dateMatch?.[1] || "";
236
- if (!dateSeance) {
237
- const m = filePath.match(/d(\d{4})(\d{2})(\d{2})\.xml$/i);
238
- if (m)
239
- dateSeance = `${m[1]}-${m[2]}-${m[3]}`;
240
- }
241
- dateSeance = toCRDate(dateSeance, null);
242
- return {
243
- dateSeance,
244
- dateSeanceJour: dateSeance,
245
- numSeanceJour: "",
246
- numSeance: "",
247
- typeAssemblee: "SN",
248
- legislature: "",
249
- session: sessionMatch?.[1] || "",
250
- nomFichierJo: "",
251
- validite: "",
252
- etat: "",
253
- diffusion: "",
254
- version: "1.0",
255
- environnement: "",
256
- heureGeneration: new Date(),
257
- };
258
- }
259
- function elementInAnyInterval(el, idx, intervals) {
260
- const p = idx.get(el);
261
- if (p == null)
262
- return false;
263
- for (const iv of intervals)
264
- if (p >= iv.start && p < iv.end)
265
- return true;
266
- return false;
267
- }
@@ -1,182 +0,0 @@
1
- import { InferResult } from "kysely";
2
- export type SenateurResult = InferResult<typeof findAllQuery>[0];
3
- export type CirconscriptionResult = InferResult<typeof findAllCirconscriptionsQuery>[0];
4
- export type OrganismeResult = InferResult<typeof findAllOrganismesQuery>[0];
5
- declare const findAllQuery: import("kysely").SelectQueryBuilder<{
6
- [x: string]: any;
7
- [x: number]: any;
8
- [x: symbol]: any;
9
- }, "sen" | "etasen" | "pcs" | "pcs42" | "pcs24" | "pcs8" | "grppol" | "com", {
10
- [x: string]: any;
11
- date_naissance: string;
12
- date_deces: string;
13
- urls: {
14
- code_url: any;
15
- url: any;
16
- }[];
17
- mandats_senateur: {
18
- [x: string]: any;
19
- date_debut: string;
20
- date_fin: string;
21
- }[];
22
- commissions: {
23
- [x: string]: any;
24
- date_debut: string;
25
- date_fin: string;
26
- fonctions: {
27
- date_debut: string;
28
- date_fin: string;
29
- libelle: unknown;
30
- }[];
31
- }[];
32
- delegations: {
33
- [x: string]: any;
34
- date_debut: string;
35
- date_fin: string;
36
- fonctions: {
37
- date_debut: string;
38
- date_fin: string;
39
- libelle: unknown;
40
- }[];
41
- }[];
42
- groupes: {
43
- [x: string]: any;
44
- date_debut: string;
45
- date_fin: string;
46
- fonctions: {
47
- date_debut: string;
48
- date_fin: string;
49
- libelle: unknown;
50
- }[];
51
- }[];
52
- fonctions_bureau: {
53
- date_debut: string;
54
- date_fin: string;
55
- libelle: unknown;
56
- }[];
57
- points_contact: {
58
- [x: string]: any;
59
- adresses: {
60
- numero_voie: any;
61
- nom_voie: any;
62
- complement: any;
63
- complement2: any;
64
- code_postal: any;
65
- commune: any;
66
- code_cedex: any;
67
- libelle_cedex: any;
68
- bureau_distributeur: any;
69
- }[];
70
- telephones: {
71
- type: any;
72
- numero: any;
73
- }[];
74
- }[];
75
- }>;
76
- declare const findAllCirconscriptionsQuery: import("kysely").SelectQueryBuilder<{
77
- [x: string]: any;
78
- [x: number]: any;
79
- [x: symbol]: any;
80
- }, "dpt" | "reg", {
81
- [x: string]: any;
82
- date_debut: string;
83
- date_fin: string;
84
- }>;
85
- declare const findAllOrganismesQuery: import("kysely").SelectQueryBuilder<{
86
- [x: string]: any;
87
- [x: number]: any;
88
- [x: symbol]: any;
89
- }, "typorg" | "all_organismes", {
90
- [x: string]: any;
91
- url: string;
92
- date_debut: string;
93
- date_fin: string;
94
- libelle_long: string;
95
- type_libelle: string;
96
- }>;
97
- export declare function findAll(): AsyncIterableIterator<{
98
- [x: string]: any;
99
- date_naissance: string;
100
- date_deces: string;
101
- urls: {
102
- code_url: any;
103
- url: any;
104
- }[];
105
- mandats_senateur: {
106
- [x: string]: any;
107
- date_debut: string;
108
- date_fin: string;
109
- }[];
110
- commissions: {
111
- [x: string]: any;
112
- date_debut: string;
113
- date_fin: string;
114
- fonctions: {
115
- date_debut: string;
116
- date_fin: string;
117
- libelle: unknown;
118
- }[];
119
- }[];
120
- delegations: {
121
- [x: string]: any;
122
- date_debut: string;
123
- date_fin: string;
124
- fonctions: {
125
- date_debut: string;
126
- date_fin: string;
127
- libelle: unknown;
128
- }[];
129
- }[];
130
- groupes: {
131
- [x: string]: any;
132
- date_debut: string;
133
- date_fin: string;
134
- fonctions: {
135
- date_debut: string;
136
- date_fin: string;
137
- libelle: unknown;
138
- }[];
139
- }[];
140
- fonctions_bureau: {
141
- date_debut: string;
142
- date_fin: string;
143
- libelle: unknown;
144
- }[];
145
- points_contact: {
146
- [x: string]: any;
147
- adresses: {
148
- numero_voie: any;
149
- nom_voie: any;
150
- complement: any;
151
- complement2: any;
152
- code_postal: any;
153
- commune: any;
154
- code_cedex: any;
155
- libelle_cedex: any;
156
- bureau_distributeur: any;
157
- }[];
158
- telephones: {
159
- type: any;
160
- numero: any;
161
- }[];
162
- }[];
163
- }>;
164
- export declare function findAllCirconscriptions(): AsyncIterableIterator<{
165
- [x: string]: any;
166
- date_debut: string;
167
- date_fin: string;
168
- }>;
169
- export declare function findAllOrganismes(): AsyncIterableIterator<{
170
- [x: string]: any;
171
- url: string;
172
- date_debut: string;
173
- date_fin: string;
174
- libelle_long: string;
175
- type_libelle: string;
176
- }>;
177
- export declare function findActif(): AsyncIterableIterator<{
178
- senmat: string;
179
- sennomuse: string;
180
- senprenomuse: string;
181
- }>;
182
- export {};