@tricoteuses/senat 3.2.0 → 3.2.2

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 (112) hide show
  1. package/LICENSE.md +32 -32
  2. package/README.md +326 -326
  3. package/lib/src/config.d.ts +43 -0
  4. package/lib/src/config.js +37 -0
  5. package/lib/src/conversion_textes.d.ts +11 -0
  6. package/lib/src/conversion_textes.js +320 -0
  7. package/lib/src/databases_postgres.d.ts +4 -0
  8. package/lib/src/databases_postgres.js +23 -0
  9. package/lib/src/datasets.d.ts +38 -0
  10. package/lib/src/datasets.js +247 -0
  11. package/lib/src/git.d.ts +27 -0
  12. package/lib/src/git.js +251 -0
  13. package/lib/src/index.d.ts +1 -1
  14. package/lib/src/loaders.d.ts +52 -0
  15. package/lib/src/loaders.js +260 -0
  16. package/lib/src/model/agenda.d.ts +6 -0
  17. package/lib/src/model/agenda.js +148 -0
  18. package/lib/src/model/ameli.d.ts +67 -0
  19. package/lib/src/model/ameli.js +150 -0
  20. package/lib/src/model/commission.d.ts +19 -0
  21. package/lib/src/model/commission.js +269 -0
  22. package/lib/src/model/debats.d.ts +39 -0
  23. package/lib/src/model/debats.js +112 -0
  24. package/lib/src/model/documents.d.ts +32 -0
  25. package/lib/src/model/documents.js +182 -0
  26. package/lib/src/model/dosleg.d.ts +144 -0
  27. package/lib/src/model/dosleg.js +468 -0
  28. package/lib/src/model/index.d.ts +7 -0
  29. package/lib/src/model/index.js +7 -0
  30. package/lib/src/model/questions.d.ts +54 -0
  31. package/lib/src/model/questions.js +91 -0
  32. package/lib/src/model/scrutins.d.ts +48 -0
  33. package/lib/src/model/scrutins.js +121 -0
  34. package/lib/src/model/seance.d.ts +3 -0
  35. package/lib/src/model/seance.js +267 -0
  36. package/lib/src/model/sens.d.ts +112 -0
  37. package/lib/src/model/sens.js +385 -0
  38. package/lib/src/model/util.d.ts +1 -0
  39. package/lib/src/model/util.js +15 -0
  40. package/lib/src/parsers/plf/amendement.d.ts +3 -0
  41. package/lib/src/parsers/plf/amendement.js +152 -0
  42. package/lib/src/raw_types/ameli.d.ts +1762 -0
  43. package/lib/src/raw_types/ameli.js +1074 -0
  44. package/lib/src/raw_types/debats.d.ts +380 -0
  45. package/lib/src/raw_types/debats.js +266 -0
  46. package/lib/src/raw_types/dosleg.d.ts +2954 -0
  47. package/lib/src/raw_types/dosleg.js +2005 -0
  48. package/lib/src/raw_types/questions.d.ts +699 -0
  49. package/lib/src/raw_types/questions.js +493 -0
  50. package/lib/src/raw_types/sens.d.ts +7843 -0
  51. package/lib/src/raw_types/sens.js +4691 -0
  52. package/lib/src/raw_types_schemats/ameli.d.ts +541 -0
  53. package/lib/src/raw_types_schemats/ameli.js +2 -0
  54. package/lib/src/raw_types_schemats/debats.d.ts +127 -0
  55. package/lib/src/raw_types_schemats/debats.js +2 -0
  56. package/lib/src/raw_types_schemats/dosleg.d.ts +977 -0
  57. package/lib/src/raw_types_schemats/dosleg.js +2 -0
  58. package/lib/src/raw_types_schemats/questions.d.ts +237 -0
  59. package/lib/src/raw_types_schemats/questions.js +2 -0
  60. package/lib/src/raw_types_schemats/sens.d.ts +2709 -0
  61. package/lib/src/raw_types_schemats/sens.js +2 -0
  62. package/lib/src/rich_types/ameli.d.ts +12 -0
  63. package/lib/src/scripts/debug_dosleg_query.d.ts +6 -0
  64. package/lib/src/scripts/debug_dosleg_query.js +50 -0
  65. package/lib/src/scripts/retrieve_collaborateurs.js +6 -3
  66. package/lib/src/scripts/retrieve_open_data.js +2 -1
  67. package/lib/src/scripts/shared/incremental_import_sql.js +866 -866
  68. package/lib/src/scripts/shared/schema_version.js +85 -84
  69. package/lib/src/scripts/shared/staging_metadata_sql.js +214 -214
  70. package/lib/src/scripts/validate_prefixed_tables.js +12 -12
  71. package/lib/src/server/ameli.js +18 -11
  72. package/lib/src/server/conversion_textes.js +106 -106
  73. package/lib/src/server/datasets.js +1 -0
  74. package/lib/src/server/debats.js +10 -10
  75. package/lib/src/server/documents.js +22 -22
  76. package/lib/src/server/dosleg.js +33 -33
  77. package/lib/src/server/questions.js +10 -10
  78. package/lib/src/server/scrutins.js +3 -3
  79. package/lib/src/server/sens.js +19 -19
  80. package/lib/src/types/agenda.d.ts +45 -0
  81. package/lib/src/types/ameli.d.ts +5 -0
  82. package/lib/src/types/ameli.js +1 -0
  83. package/lib/src/types/compte_rendu.d.ts +83 -0
  84. package/lib/src/types/compte_rendu.js +1 -0
  85. package/lib/src/types/debats.d.ts +2 -0
  86. package/lib/src/types/debats.js +1 -0
  87. package/lib/src/types/dosleg.d.ts +70 -0
  88. package/lib/src/types/dosleg.js +1 -0
  89. package/lib/src/types/questions.d.ts +2 -0
  90. package/lib/src/types/questions.js +1 -0
  91. package/lib/src/types/sens.d.ts +8 -0
  92. package/lib/src/types/sens.js +1 -0
  93. package/lib/src/types/sessions.d.ts +6 -0
  94. package/lib/src/types/sessions.js +19 -0
  95. package/lib/src/types/texte.d.ts +72 -0
  96. package/lib/src/types/texte.js +15 -0
  97. package/lib/src/validators/config.d.ts +9 -0
  98. package/lib/src/validators/config.js +10 -0
  99. package/lib/src/videos/match.js +4 -4
  100. package/lib/tests/parsers/plf/amendement.test.d.ts +1 -0
  101. package/lib/tests/parsers/plf/amendement.test.js +153 -0
  102. package/lib/tests/parsers/plf/credits.test.js +72 -72
  103. package/lib/tests/parsers/plf/test_utils.js +13 -13
  104. package/lib/tests/parsers/texte.test_utils.js +22 -22
  105. package/lib/tests/videoMatching.test.js +1 -1
  106. package/package.json +123 -123
  107. package/lib/src/scripts/extract_plf_fixtures.d.ts +0 -1
  108. package/lib/src/scripts/extract_plf_fixtures.js +0 -101
  109. package/lib/tests/plf/credits.test.js +0 -458
  110. package/lib/tests/plf/test_utils.d.ts +0 -20
  111. package/lib/tests/plf/test_utils.js +0 -85
  112. /package/lib/{tests/plf/credits.test.d.ts → src/types/agenda.js} +0 -0
@@ -123,24 +123,24 @@ describe("parsePlfCredits — fixtures synthétiques", () => {
123
123
  // 7. État D — 2 sous-tableaux CAS + CCF (format classé)
124
124
  // ---------------------------------------------------------------------
125
125
  it("parses État D with two sub-tables (CAS then CCF)", () => {
126
- const articleBody = `
127
- <alinea style="font-family: 'Courier New';font-weight: bold">
128
- <num>I. –</num>
129
- <alinea>
126
+ const articleBody = `
127
+ <alinea style="font-family: 'Courier New';font-weight: bold">
128
+ <num>I. –</num>
129
+ <alinea>
130
130
  <content>${etatTable3Col("D", missionRow("Contrôle de la circulation et du stationnement routiers", "1 928 700 107", "1 928 700 107") +
131
131
  programmeRow("Structures et dispositifs de sécurité routière", "344 340 107", "344 340 107") +
132
- totalRow("77 975 293 936", "78 086 793 936"))}</content>
133
- </alinea>
134
- <content><p>I. – COMPTES D'AFFECTATION SPÉCIALE</p></content>
135
- </alinea>
136
- <alinea style="font-family: 'Courier New';font-weight: bold">
137
- <num>II. –</num>
138
- <alinea>
132
+ totalRow("77 975 293 936", "78 086 793 936"))}</content>
133
+ </alinea>
134
+ <content><p>I. – COMPTES D'AFFECTATION SPÉCIALE</p></content>
135
+ </alinea>
136
+ <alinea style="font-family: 'Courier New';font-weight: bold">
137
+ <num>II. –</num>
138
+ <alinea>
139
139
  <content>${etatTable3Col("D", missionRow("Accords monétaires internationaux", "100 000 000", "100 000 000") +
140
140
  programmeRow("Relations monétaires internationales", "100 000 000", "100 000 000") +
141
- totalRow("150 236 603 151", "150 715 243 603"))}</content>
142
- </alinea>
143
- <content><p>II. – COMPTES DE CONCOURS FINANCIERS</p></content>
141
+ totalRow("150 236 603 151", "150 715 243 603"))}</content>
142
+ </alinea>
143
+ <content><p>II. – COMPTES DE CONCOURS FINANCIERS</p></content>
144
144
  </alinea>`;
145
145
  const doc = parseXml(xmlDoc(buildArticle("etat_D", "État D", articleBody)));
146
146
  const result = parsePlfCredits(doc);
@@ -191,9 +191,9 @@ describe("parsePlfCredits — fixtures synthétiques", () => {
191
191
  // 11. Document sans body
192
192
  // ---------------------------------------------------------------------
193
193
  it("returns empty array for document without body", () => {
194
- const doc = parseXml(`<?xml version="1.0" encoding="UTF-8"?>
195
- <akomaNtoso xmlns="http://docs.oasis-open.org/legaldocml/ns/akn/3.0">
196
- <bill><preamble><docTitle>Test</docTitle></preamble></bill>
194
+ const doc = parseXml(`<?xml version="1.0" encoding="UTF-8"?>
195
+ <akomaNtoso xmlns="http://docs.oasis-open.org/legaldocml/ns/akn/3.0">
196
+ <bill><preamble><docTitle>Test</docTitle></preamble></bill>
197
197
  </akomaNtoso>`);
198
198
  expect(parsePlfCredits(doc)).toEqual([]);
199
199
  });
@@ -209,11 +209,11 @@ describe("parsePlfCredits — fixtures synthétiques", () => {
209
209
  totalRow("1 000 000", "2 000 000")));
210
210
  const etatD = buildArticle("etat_D", "État D", `<alinea><num>I. –</num><alinea><content>${etatTable3Col("D", missionRow("Mission CAS", "100 000", "200 000") +
211
211
  programmeRow("Programme CAS", "50 000", "100 000") +
212
- totalRow("100 000", "200 000"))}</content></alinea>
213
- <content><p>I. – COMPTES D'AFFECTATION SPÉCIALE</p></content></alinea>
212
+ totalRow("100 000", "200 000"))}</content></alinea>
213
+ <content><p>I. – COMPTES D'AFFECTATION SPÉCIALE</p></content></alinea>
214
214
  <alinea><num>II. –</num><alinea><content>${etatTable3Col("D", missionRow("Mission CCF", "300 000", "400 000") +
215
215
  programmeRow("Programme CCF", "150 000", "200 000") +
216
- totalRow("300 000", "400 000"))}</content></alinea>
216
+ totalRow("300 000", "400 000"))}</content></alinea>
217
217
  <content><p>II. – COMPTES DE CONCOURS FINANCIERS</p></content></alinea>`);
218
218
  const doc = parseXml(xmlDoc(etatB + etatC + etatD));
219
219
  const result = parsePlfCredits(doc);
@@ -243,9 +243,9 @@ describe("parsePlfCredits — fixtures synthétiques", () => {
243
243
  it("skips a table that has only headers and no data rows", () => {
244
244
  const doc = parseXml(xmlDoc(buildArticle("etat_B", "État B",
245
245
  /* eslint-disable max-len */
246
- `<alinea><content><table class="alinea-table etat-tableau" data:code="B">
247
- <tr><td colspan="3" style="font-style: italic;border-bottom:1px solid black"><p>(En euros)</p></td></tr>
248
- <tr><td style="font-weight: bold;border-bottom:1px solid black"><p>Mission / Programme</p></td><td style="font-weight: bold;border-bottom:1px solid black"><p>AE</p></td><td style="font-weight: bold;border-bottom:1px solid black"><p>CP</p></td></tr>
246
+ `<alinea><content><table class="alinea-table etat-tableau" data:code="B">
247
+ <tr><td colspan="3" style="font-style: italic;border-bottom:1px solid black"><p>(En euros)</p></td></tr>
248
+ <tr><td style="font-weight: bold;border-bottom:1px solid black"><p>Mission / Programme</p></td><td style="font-weight: bold;border-bottom:1px solid black"><p>AE</p></td><td style="font-weight: bold;border-bottom:1px solid black"><p>CP</p></td></tr>
249
249
  </table></content></alinea>`)));
250
250
  expect(parsePlfCredits(doc)).toEqual([]);
251
251
  });
@@ -264,18 +264,18 @@ describe("parsePlfCredits — fixtures synthétiques", () => {
264
264
  // 16. État D — fallback positionnel si le label n'est pas trouvé
265
265
  // ---------------------------------------------------------------------
266
266
  it("falls back to positional CAS/CCF when label text is missing", () => {
267
- const articleBody = `
268
- <alinea>
269
- <alinea>
267
+ const articleBody = `
268
+ <alinea>
269
+ <alinea>
270
270
  <content>${etatTable3Col("D", missionRow("Mission sans label 1", "100 000", "200 000") +
271
- totalRow("100 000", "200 000"))}</content>
272
- </alinea>
273
- </alinea>
274
- <alinea>
275
- <alinea>
271
+ totalRow("100 000", "200 000"))}</content>
272
+ </alinea>
273
+ </alinea>
274
+ <alinea>
275
+ <alinea>
276
276
  <content>${etatTable3Col("D", missionRow("Mission sans label 2", "300 000", "400 000") +
277
- totalRow("300 000", "400 000"))}</content>
278
- </alinea>
277
+ totalRow("300 000", "400 000"))}</content>
278
+ </alinea>
279
279
  </alinea>`;
280
280
  const doc = parseXml(xmlDoc(buildArticle("etat_D", "État D", articleBody)));
281
281
  const result = parsePlfCredits(doc);
@@ -300,26 +300,26 @@ describe("parsePlfCredits — fixtures synthétiques", () => {
300
300
  // 18. État D — 3 tables (la 3e sans label ni fallback → ignorée)
301
301
  // ---------------------------------------------------------------------
302
302
  it("skips a third sub-table in État D (no positional fallback beyond index 1)", () => {
303
- const articleBody = `
304
- <alinea>
305
- <alinea>
303
+ const articleBody = `
304
+ <alinea>
305
+ <alinea>
306
306
  <content>${etatTable3Col("D", missionRow("Mission 1", "100 000", "200 000") +
307
- totalRow("100 000", "200 000"))}</content>
308
- </alinea>
309
- <content><p>I. – COMPTES D'AFFECTATION SPÉCIALE</p></content>
310
- </alinea>
311
- <alinea>
312
- <alinea>
307
+ totalRow("100 000", "200 000"))}</content>
308
+ </alinea>
309
+ <content><p>I. – COMPTES D'AFFECTATION SPÉCIALE</p></content>
310
+ </alinea>
311
+ <alinea>
312
+ <alinea>
313
313
  <content>${etatTable3Col("D", missionRow("Mission 2", "300 000", "400 000") +
314
- totalRow("300 000", "400 000"))}</content>
315
- </alinea>
316
- <content><p>II. – COMPTES DE CONCOURS FINANCIERS</p></content>
317
- </alinea>
318
- <alinea>
319
- <alinea>
314
+ totalRow("300 000", "400 000"))}</content>
315
+ </alinea>
316
+ <content><p>II. – COMPTES DE CONCOURS FINANCIERS</p></content>
317
+ </alinea>
318
+ <alinea>
319
+ <alinea>
320
320
  <content>${etatTable3Col("D", missionRow("Mission 3 (inconnue)", "500 000", "600 000") +
321
- totalRow("500 000", "600 000"))}</content>
322
- </alinea>
321
+ totalRow("500 000", "600 000"))}</content>
322
+ </alinea>
323
323
  </alinea>`;
324
324
  const doc = parseXml(xmlDoc(buildArticle("etat_D", "État D", articleBody)));
325
325
  const result = parsePlfCredits(doc);
@@ -330,9 +330,9 @@ describe("parsePlfCredits — fixtures synthétiques", () => {
330
330
  // 19. État avec <num> qui n'est pas B/C/D → ignoré
331
331
  // ---------------------------------------------------------------------
332
332
  it("ignores etat article whose num is not État B/C/D", () => {
333
- const doc = parseXml(xmlDoc(buildArticle("etat_A", "État A", `<alinea><content><table class="alinea-table etat-tableau" data:code="A">
334
- <tr><td colspan="3"><p>(En euros)</p></td></tr>
335
- <tr><td style="font-weight: bold"><p>Recettes</p></td><td><p>100</p></td><td><p>200</p></td></tr>
333
+ const doc = parseXml(xmlDoc(buildArticle("etat_A", "État A", `<alinea><content><table class="alinea-table etat-tableau" data:code="A">
334
+ <tr><td colspan="3"><p>(En euros)</p></td></tr>
335
+ <tr><td style="font-weight: bold"><p>Recettes</p></td><td><p>100</p></td><td><p>200</p></td></tr>
336
336
  </table></content></alinea>`)));
337
337
  expect(parsePlfCredits(doc)).toEqual([]);
338
338
  });
@@ -384,20 +384,20 @@ describe("parsePlfCredits — fixtures synthétiques", () => {
384
384
  // 24. État D — label sans correspondance → repli positionnel
385
385
  // ---------------------------------------------------------------------
386
386
  it("falls back to positional when label text doesn't match CAS or CCF", () => {
387
- const articleBody = `
388
- <alinea>
389
- <alinea>
387
+ const articleBody = `
388
+ <alinea>
389
+ <alinea>
390
390
  <content>${etatTable3Col("D", missionRow("Mission 1", "100 000", "200 000") +
391
- totalRow("100 000", "200 000"))}</content>
392
- </alinea>
393
- <content><p>I. – AUTRE LABEL INCONNU</p></content>
394
- </alinea>
395
- <alinea>
396
- <alinea>
391
+ totalRow("100 000", "200 000"))}</content>
392
+ </alinea>
393
+ <content><p>I. – AUTRE LABEL INCONNU</p></content>
394
+ </alinea>
395
+ <alinea>
396
+ <alinea>
397
397
  <content>${etatTable3Col("D", missionRow("Mission 2", "300 000", "400 000") +
398
- totalRow("300 000", "400 000"))}</content>
399
- </alinea>
400
- <content><p>II. – ENCORE UN AUTRE</p></content>
398
+ totalRow("300 000", "400 000"))}</content>
399
+ </alinea>
400
+ <content><p>II. – ENCORE UN AUTRE</p></content>
401
401
  </alinea>`;
402
402
  const doc = parseXml(xmlDoc(buildArticle("etat_D", "État D", articleBody)));
403
403
  const result = parsePlfCredits(doc);
@@ -411,13 +411,13 @@ describe("parsePlfCredits — fixtures synthétiques", () => {
411
411
  it("skips rows with fewer than 3 td cells", () => {
412
412
  const doc = parseXml(xmlDoc(buildArticle("etat_B", "État B",
413
413
  /* eslint-disable max-len */
414
- `<alinea><content><table class="alinea-table etat-tableau" data:code="B">
415
- <tr><td colspan="3" style="font-style: italic;border-bottom:1px solid black"><p>(En euros)</p></td></tr>
416
- <tr><td style="font-weight: bold;border-bottom:1px solid black"><p>Mission / Programme</p></td><td style="font-weight: bold;border-bottom:1px solid black"><p>AE</p></td><td style="font-weight: bold;border-bottom:1px solid black"><p>CP</p></td></tr>
417
- <tr><td style="border-top:1px solid black;font-weight: bold"><p>Mission valide</p></td><td style="font-weight: bold"><p>1 000</p></td><td style="font-weight: bold"><p>2 000</p></td></tr>
418
- <tr><td colspan="3"><p>Sous-titre sans données</p></td></tr>
419
- <tr><td style="border-top:0px solid black"><p>Programme</p></td><td><p>500</p></td><td><p>600</p></td></tr>
420
- <tr><td style="font-weight: bold;border-top:1px solid black;border-bottom:1px solid black"><p>Total</p></td><td style="font-weight: bold"><p>1 500</p></td><td style="font-weight: bold"><p>2 600</p></td></tr>
414
+ `<alinea><content><table class="alinea-table etat-tableau" data:code="B">
415
+ <tr><td colspan="3" style="font-style: italic;border-bottom:1px solid black"><p>(En euros)</p></td></tr>
416
+ <tr><td style="font-weight: bold;border-bottom:1px solid black"><p>Mission / Programme</p></td><td style="font-weight: bold;border-bottom:1px solid black"><p>AE</p></td><td style="font-weight: bold;border-bottom:1px solid black"><p>CP</p></td></tr>
417
+ <tr><td style="border-top:1px solid black;font-weight: bold"><p>Mission valide</p></td><td style="font-weight: bold"><p>1 000</p></td><td style="font-weight: bold"><p>2 000</p></td></tr>
418
+ <tr><td colspan="3"><p>Sous-titre sans données</p></td></tr>
419
+ <tr><td style="border-top:0px solid black"><p>Programme</p></td><td><p>500</p></td><td><p>600</p></td></tr>
420
+ <tr><td style="font-weight: bold;border-top:1px solid black;border-bottom:1px solid black"><p>Total</p></td><td style="font-weight: bold"><p>1 500</p></td><td style="font-weight: bold"><p>2 600</p></td></tr>
421
421
  </table></content></alinea>`)));
422
422
  const result = parsePlfCredits(doc);
423
423
  expect(result).toHaveLength(1);
@@ -3,11 +3,11 @@ export function parseXml(xml) {
3
3
  return new JSDOM(xml, { contentType: "text/xml" }).window.document;
4
4
  }
5
5
  export function xmlDoc(body) {
6
- return `<?xml version="1.0" encoding="UTF-8"?>
7
- <akomaNtoso xmlns="http://docs.oasis-open.org/legaldocml/ns/akn/3.0" xmlns:data="http://data.parlement.fr/v1">
8
- <bill>
9
- <body>${body}</body>
10
- </bill>
6
+ return `<?xml version="1.0" encoding="UTF-8"?>
7
+ <akomaNtoso xmlns="http://docs.oasis-open.org/legaldocml/ns/akn/3.0" xmlns:data="http://data.parlement.fr/v1">
8
+ <bill>
9
+ <body>${body}</body>
10
+ </bill>
11
11
  </akomaNtoso>`;
12
12
  }
13
13
  export function buildArticle(etatId, num, alineas) {
@@ -69,17 +69,17 @@ export function styledTotalRow5(ae, cp, aeAnnule, cpAnnule) {
69
69
  // Build table with header (3 or 5 columns)
70
70
  // ---------------------------------------------------------------------------
71
71
  export function etatTable3Col(dataCode, rows) {
72
- return `<alinea><content><table class="alinea-table etat-tableau" data:code="${dataCode}">
73
- <tr><td colspan="3" style="font-style: italic;border-bottom:1px solid black"><p>(En euros)</p></td></tr>
74
- <tr><td style="font-weight: bold;border-top:1px solid black;border-bottom:1px solid black"><p>Mission / Programme</p></td><td style="font-weight: bold;border-bottom:1px solid black"><p>Autorisations d'engagement</p></td><td style="font-weight: bold;border-bottom:1px solid black"><p>Crédits de paiement</p></td></tr>
75
- ${rows}
72
+ return `<alinea><content><table class="alinea-table etat-tableau" data:code="${dataCode}">
73
+ <tr><td colspan="3" style="font-style: italic;border-bottom:1px solid black"><p>(En euros)</p></td></tr>
74
+ <tr><td style="font-weight: bold;border-top:1px solid black;border-bottom:1px solid black"><p>Mission / Programme</p></td><td style="font-weight: bold;border-bottom:1px solid black"><p>Autorisations d'engagement</p></td><td style="font-weight: bold;border-bottom:1px solid black"><p>Crédits de paiement</p></td></tr>
75
+ ${rows}
76
76
  </table></content></alinea>`;
77
77
  }
78
78
  export function etatTable5Col(dataCode, rows) {
79
- return `<alinea><content><table class="alinea-table etat-tableau" data:code="${dataCode}">
80
- <tr><td colspan="5" style="font-style: italic;border-bottom:1px solid black"><p>(En euros)</p></td></tr>
81
- <tr><td style="font-weight: bold;border-top:1px solid black;border-bottom:1px solid black"><p>Mission / Programme</p></td><td style="font-weight: bold;border-bottom:1px solid black"><p>AE ouvertes</p></td><td style="font-weight: bold;border-bottom:1px solid black"><p>CP ouverts</p></td><td style="font-weight: bold;border-bottom:1px solid black"><p>AE annulées</p></td><td style="font-weight: bold;border-bottom:1px solid black"><p>CP annulés</p></td></tr>
82
- ${rows}
79
+ return `<alinea><content><table class="alinea-table etat-tableau" data:code="${dataCode}">
80
+ <tr><td colspan="5" style="font-style: italic;border-bottom:1px solid black"><p>(En euros)</p></td></tr>
81
+ <tr><td style="font-weight: bold;border-top:1px solid black;border-bottom:1px solid black"><p>Mission / Programme</p></td><td style="font-weight: bold;border-bottom:1px solid black"><p>AE ouvertes</p></td><td style="font-weight: bold;border-bottom:1px solid black"><p>CP ouverts</p></td><td style="font-weight: bold;border-bottom:1px solid black"><p>AE annulées</p></td><td style="font-weight: bold;border-bottom:1px solid black"><p>CP annulés</p></td></tr>
82
+ ${rows}
83
83
  </table></content></alinea>`;
84
84
  }
85
85
  /* eslint-enable max-len */
@@ -3,19 +3,19 @@ import { parseTexte } from "../../src/parsers/texte.js";
3
3
  // Document wrapper
4
4
  // ---------------------------------------------------------------------------
5
5
  export function xmlDoc(body) {
6
- return `<?xml version="1.0" encoding="UTF-8"?>
7
- <akomaNtoso xmlns="http://docs.oasis-open.org/legaldocml/ns/akn/3.0" xmlns:data="http://data.parlement.fr/v1">
8
- <meta>
9
- <identification>
10
- <FRBRExpression>
11
- <FRBRuri value="/akn/fr/senat/dossier/pjlf2026/2025-11-24/depot/pjl25-138"/>
12
- </FRBRExpression>
13
- </identification>
14
- </meta>
15
- <preamble>
16
- <docTitle>Projet de loi de finances pour 2026</docTitle>
17
- </preamble>
18
- <body>${body}</body>
6
+ return `<?xml version="1.0" encoding="UTF-8"?>
7
+ <akomaNtoso xmlns="http://docs.oasis-open.org/legaldocml/ns/akn/3.0" xmlns:data="http://data.parlement.fr/v1">
8
+ <meta>
9
+ <identification>
10
+ <FRBRExpression>
11
+ <FRBRuri value="/akn/fr/senat/dossier/pjlf2026/2025-11-24/depot/pjl25-138"/>
12
+ </FRBRExpression>
13
+ </identification>
14
+ </meta>
15
+ <preamble>
16
+ <docTitle>Projet de loi de finances pour 2026</docTitle>
17
+ </preamble>
18
+ <body>${body}</body>
19
19
  </akomaNtoso>`;
20
20
  }
21
21
  export function parseDoc(body) {
@@ -33,11 +33,11 @@ export function articleAlinea(eId, content, options = {}) {
33
33
  // Divisional alineas (structural headings of a title/part, eId prefix aldiv_)
34
34
  // ---------------------------------------------------------------------------
35
35
  export function divisionalAlinea(eId, num, text) {
36
- return `<alinea eId="${eId}">
37
- <num>${num}</num>
38
- <content>
39
- <p>${text}</p>
40
- </content>
36
+ return `<alinea eId="${eId}">
37
+ <num>${num}</num>
38
+ <content>
39
+ <p>${text}</p>
40
+ </content>
41
41
  </alinea>`;
42
42
  }
43
43
  // ---------------------------------------------------------------------------
@@ -47,10 +47,10 @@ export function article(eId, children) {
47
47
  return `<article eId="${eId}">${children}</article>`;
48
48
  }
49
49
  export function structuralDivision(tag, eId, num, heading, children) {
50
- return `<${tag} eId="${eId}">
51
- <num>${num}</num>
52
- <heading>${heading}</heading>
53
- ${children}
50
+ return `<${tag} eId="${eId}">
51
+ <num>${num}</num>
52
+ <heading>${heading}</heading>
53
+ ${children}
54
54
  </${tag}>`;
55
55
  }
56
56
  export function title(eId, num, heading, children) {
@@ -306,7 +306,7 @@ function cmpBestOverall(a, b) {
306
306
  return bMar - aMar;
307
307
  return 0;
308
308
  }
309
- describe("video matching LIVE benchmark (gold) — HIT/WRONG/MISS", () => {
309
+ describe.skip("video matching LIVE benchmark (gold) — HIT/WRONG/MISS", () => {
310
310
  it("grid search (target WRONG=0, maximize HIT)", async () => {
311
311
  const gold = await readJson(GOLD_PATH);
312
312
  // Prefetch + features
package/package.json CHANGED
@@ -1,123 +1,123 @@
1
- {
2
- "name": "@tricoteuses/senat",
3
- "version": "3.2.0",
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_collaborateurs": "tsx src/scripts/retrieve_collaborateurs.ts",
64
- "data:retrieve_senateurs_photos": "tsx src/scripts/retrieve_senateurs_photos.ts --fetch",
65
- "data:retrieve_videos": "tsx src/scripts/retrieve_videos.ts",
66
- "data:validate_prefixed_tables": "tsx src/scripts/validate_prefixed_tables.ts",
67
- "lint": "eslint src",
68
- "lint:fix": "eslint src --fix",
69
- "prepare": "npm run build",
70
- "prepublishOnly": "npm run build",
71
- "prettier": "prettier --write 'src/**/*.ts'",
72
- "test": "vitest run",
73
- "test:iter_load": "vitest tests/test_iter_load.test.ts",
74
- "type-check": "tsc --noEmit",
75
- "type-check:watch": "npm run type-check -- --watch",
76
- "test:video-matching": "vitest tests/videoMatching.test.ts",
77
- "test:texte": "vitest tests/parsers/texte.test.ts",
78
- "test:prefixed-tables": "vitest tests/prefixedTables.test.ts tests/validatePrefixedTables.test.ts"
79
- },
80
- "dependencies": {
81
- "cheerio": "^1.2.0",
82
- "command-line-args": "^6.0.2",
83
- "domhandler": "^6.0.1",
84
- "dotenv": "^17.4.2",
85
- "fast-xml-parser": "^5.9.3",
86
- "fs-extra": "^11.3.6",
87
- "jsdom": "^29.1.1",
88
- "luxon": "^3.7.2",
89
- "node-stream-zip": "^1.15.0",
90
- "p-limit": "^7.3.0",
91
- "pg": "^8.22.0",
92
- "pg-cursor": "^2.21.0",
93
- "slug": "^11.0.1",
94
- "unpdf": "^1.8.0",
95
- "windows-1252": "^3.0.4",
96
- "zod": "^4.4.3"
97
- },
98
- "devDependencies": {
99
- "@eslint/js": "^10.0.1",
100
- "@types/command-line-args": "^5.2.3",
101
- "@types/fs-extra": "^11.0.4",
102
- "@types/jsdom": "^28.0.3",
103
- "@types/luxon": "^3.7.2",
104
- "@types/node": "^26.1.1",
105
- "@types/pg": "^8.20.0",
106
- "@types/pg-cursor": "^2.7.2",
107
- "@types/slug": "^5.0.9",
108
- "@typescript-eslint/eslint-plugin": "^8.63.0",
109
- "@typescript-eslint/parser": "^8.63.0",
110
- "cross-env": "^10.1.0",
111
- "eslint": "^10.6.0",
112
- "extract-pg-schema": "^5.8.2",
113
- "globals": "^17.7.0",
114
- "kanel": "^4.0.2",
115
- "kanel-kysely": "^4.0.0",
116
- "kanel-zod": "^4.0.0",
117
- "kysely": "^0.29.3",
118
- "prettier": "^3.9.4",
119
- "tsx": "^4.23.0",
120
- "typescript": "^6.0.3",
121
- "vitest": "^4.1.10"
122
- }
123
- }
1
+ {
2
+ "name": "@tricoteuses/senat",
3
+ "version": "3.2.2",
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_collaborateurs": "tsx src/scripts/retrieve_collaborateurs.ts",
64
+ "data:retrieve_senateurs_photos": "tsx src/scripts/retrieve_senateurs_photos.ts --fetch",
65
+ "data:retrieve_videos": "tsx src/scripts/retrieve_videos.ts",
66
+ "data:validate_prefixed_tables": "tsx src/scripts/validate_prefixed_tables.ts",
67
+ "lint": "eslint src",
68
+ "lint:fix": "eslint src --fix",
69
+ "prepare": "npm run build",
70
+ "prepublishOnly": "npm run build",
71
+ "prettier": "prettier --write 'src/**/*.ts'",
72
+ "test": "vitest run",
73
+ "test:iter_load": "vitest tests/test_iter_load.test.ts",
74
+ "type-check": "tsc --noEmit",
75
+ "type-check:watch": "npm run type-check -- --watch",
76
+ "test:video-matching": "vitest tests/videoMatching.test.ts",
77
+ "test:texte": "vitest tests/parsers/texte.test.ts",
78
+ "test:prefixed-tables": "vitest tests/prefixedTables.test.ts tests/validatePrefixedTables.test.ts"
79
+ },
80
+ "dependencies": {
81
+ "cheerio": "^1.2.0",
82
+ "command-line-args": "^6.0.2",
83
+ "domhandler": "^6.0.1",
84
+ "dotenv": "^17.4.2",
85
+ "fast-xml-parser": "^5.9.3",
86
+ "fs-extra": "^11.3.6",
87
+ "jsdom": "^29.1.1",
88
+ "luxon": "^3.7.2",
89
+ "node-stream-zip": "^1.15.0",
90
+ "p-limit": "^7.3.0",
91
+ "pg": "^8.22.0",
92
+ "pg-cursor": "^2.21.0",
93
+ "slug": "^11.0.1",
94
+ "unpdf": "^1.8.0",
95
+ "windows-1252": "^3.0.4",
96
+ "zod": "^4.4.3"
97
+ },
98
+ "devDependencies": {
99
+ "@eslint/js": "^10.0.1",
100
+ "@types/command-line-args": "^5.2.3",
101
+ "@types/fs-extra": "^11.0.4",
102
+ "@types/jsdom": "^28.0.3",
103
+ "@types/luxon": "^3.7.2",
104
+ "@types/node": "^26.1.1",
105
+ "@types/pg": "^8.20.0",
106
+ "@types/pg-cursor": "^2.7.2",
107
+ "@types/slug": "^5.0.9",
108
+ "@typescript-eslint/eslint-plugin": "^8.63.0",
109
+ "@typescript-eslint/parser": "^8.63.0",
110
+ "cross-env": "^10.1.0",
111
+ "eslint": "^10.6.0",
112
+ "extract-pg-schema": "^5.8.2",
113
+ "globals": "^17.7.0",
114
+ "kanel": "^4.0.2",
115
+ "kanel-kysely": "^4.0.0",
116
+ "kanel-zod": "^4.0.0",
117
+ "kysely": "^0.29.3",
118
+ "prettier": "^3.9.4",
119
+ "tsx": "^4.23.0",
120
+ "typescript": "^6.0.3",
121
+ "vitest": "^4.1.10"
122
+ }
123
+ }
@@ -1 +0,0 @@
1
- export declare function extractEtats(srcPath: string): Promise<Element[]>;