@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
@@ -1,85 +0,0 @@
1
- import { JSDOM } from "jsdom";
2
- export function parseXml(xml) {
3
- return new JSDOM(xml, { contentType: "text/xml" }).window.document;
4
- }
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>
11
- </akomaNtoso>`;
12
- }
13
- export function buildArticle(etatId, num, alineas) {
14
- return `<article class="etat" eId="${etatId}"><num>${num}</num>${alineas}</article>`;
15
- }
16
- // ---------------------------------------------------------------------------
17
- // Helpers to build mission / programme / lgncred / total rows (format classé)
18
- // ---------------------------------------------------------------------------
19
- /* eslint-disable max-len */
20
- export function missionRow(libelle, ae, cp) {
21
- return `<tr class="mission"><td class="libelle" style="font-weight: bold;border-top:1px solid black"><p>${libelle}</p></td><td class="engagement" style="font-weight: bold"><p>${ae}</p></td><td class="credit" style="font-weight: bold"><p>${cp}</p></td></tr>`;
22
- }
23
- export function missionRow5(libelle, ae, cp, aeAnnule, cpAnnule) {
24
- return `<tr class="mission"><td class="libelle" style="font-weight: bold;border-top:1px solid black"><p>${libelle}</p></td><td class="engagement" style="font-weight: bold"><p>${ae}</p></td><td class="credit" style="font-weight: bold"><p>${cp}</p></td><td style="font-weight: bold"><p>${aeAnnule}</p></td><td style="font-weight: bold"><p>${cpAnnule}</p></td></tr>`;
25
- }
26
- export function programmeRow(libelle, ae, cp) {
27
- return `<tr class="programme"><td class="libelle" style="border-top:0px solid black"><p>${libelle}</p></td><td class="engagement"><p>${ae}</p></td><td class="credit"><p>${cp}</p></td></tr>`;
28
- }
29
- export function programmeRow5(libelle, ae, cp, aeAnnule, cpAnnule) {
30
- return `<tr class="programme"><td class="libelle" style="border-top:0px solid black"><p>${libelle}</p></td><td class="engagement"><p>${ae}</p></td><td class="credit"><p>${cp}</p></td><td><p>${aeAnnule}</p></td><td><p>${cpAnnule}</p></td></tr>`;
31
- }
32
- export function lgncredRow(libelle, ae, cp) {
33
- return `<tr class="lgncred"><td class="libelle" style="font-style: italic;border-top:0px solid black"><p>${libelle}</p></td><td class="engagement" style="font-style: italic"><p>${ae}</p></td><td class="credit" style="font-style: italic"><p>${cp}</p></td></tr>`;
34
- }
35
- export function lgncredRow5(libelle, ae, cp, aeAnnule, cpAnnule) {
36
- return `<tr class="lgncred"><td class="libelle" style="font-style: italic;border-top:0px solid black"><p>${libelle}</p></td><td class="engagement" style="font-style: italic"><p>${ae}</p></td><td class="credit" style="font-style: italic"><p>${cp}</p></td><td style="font-style: italic"><p>${aeAnnule}</p></td><td style="font-style: italic"><p>${cpAnnule}</p></td></tr>`;
37
- }
38
- export function totalRow(ae, cp) {
39
- return `<tr class="total"><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>${ae}</p></td><td style="font-weight: bold"><p>${cp}</p></td></tr>`;
40
- }
41
- export function totalRow5(ae, cp, aeAnnule, cpAnnule) {
42
- return `<tr class="total"><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>${ae}</p></td><td style="font-weight: bold"><p>${cp}</p></td><td style="font-weight: bold"><p>${aeAnnule}</p></td><td style="font-weight: bold"><p>${cpAnnule}</p></td></tr>`;
43
- }
44
- // ---------------------------------------------------------------------------
45
- // Helpers for format non-classé (style only)
46
- // ---------------------------------------------------------------------------
47
- export function styledMissionRow(libelle, ae, cp) {
48
- return `<tr><td style="font-weight: bold;border-top:1px solid black"><p>${libelle}</p></td><td style="font-weight: bold"><p>${ae}</p></td><td style="font-weight: bold"><p>${cp}</p></td></tr>`;
49
- }
50
- export function styledMissionRow5(libelle, ae, cp, aeAnnule, cpAnnule) {
51
- return `<tr><td style="font-weight: bold;border-top:1px solid black"><p>${libelle}</p></td><td style="font-weight: bold"><p>${ae}</p></td><td style="font-weight: bold"><p>${cp}</p></td><td style="font-weight: bold"><p>${aeAnnule}</p></td><td style="font-weight: bold"><p>${cpAnnule}</p></td></tr>`;
52
- }
53
- export function styledProgrammeRow(libelle, ae, cp) {
54
- return `<tr><td style="border-top:0px solid black"><p>${libelle}</p></td><td><p>${ae}</p></td><td><p>${cp}</p></td></tr>`;
55
- }
56
- export function styledProgrammeRow5(libelle, ae, cp, aeAnnule, cpAnnule) {
57
- return `<tr><td style="border-top:0px solid black"><p>${libelle}</p></td><td><p>${ae}</p></td><td><p>${cp}</p></td><td><p>${aeAnnule}</p></td><td><p>${cpAnnule}</p></td></tr>`;
58
- }
59
- export function styledDontTitreRow(ae, cp) {
60
- return `<tr><td style="font-style: italic;border-top:0px solid black"><p>Dont titre 2</p></td><td style="font-style: italic"><p>${ae}</p></td><td style="font-style: italic"><p>${cp}</p></td></tr>`;
61
- }
62
- export function styledTotalRow(ae, cp) {
63
- return `<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>${ae}</p></td><td style="font-weight: bold"><p>${cp}</p></td></tr>`;
64
- }
65
- export function styledTotalRow5(ae, cp, aeAnnule, cpAnnule) {
66
- return `<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>${ae}</p></td><td style="font-weight: bold"><p>${cp}</p></td><td style="font-weight: bold"><p>${aeAnnule}</p></td><td style="font-weight: bold"><p>${cpAnnule}</p></td></tr>`;
67
- }
68
- // ---------------------------------------------------------------------------
69
- // Build table with header (3 or 5 columns)
70
- // ---------------------------------------------------------------------------
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}
76
- </table></content></alinea>`;
77
- }
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}
83
- </table></content></alinea>`;
84
- }
85
- /* eslint-enable max-len */