@tricoteuses/senat 2.22.9 → 2.22.10

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 (136) hide show
  1. package/lib/config.d.ts +21 -0
  2. package/lib/config.js +27 -0
  3. package/lib/databases.d.ts +2 -0
  4. package/lib/databases.js +26 -0
  5. package/lib/datasets.d.ts +34 -0
  6. package/lib/datasets.js +233 -0
  7. package/lib/git.d.ts +26 -0
  8. package/lib/git.js +167 -0
  9. package/lib/index.d.ts +13 -0
  10. package/lib/index.js +1 -0
  11. package/lib/loaders.d.ts +58 -0
  12. package/lib/loaders.js +286 -0
  13. package/lib/model/agenda.d.ts +6 -0
  14. package/lib/model/agenda.js +148 -0
  15. package/lib/model/ameli.d.ts +51 -0
  16. package/lib/model/ameli.js +147 -0
  17. package/lib/model/commission.d.ts +18 -0
  18. package/lib/model/commission.js +269 -0
  19. package/lib/model/debats.d.ts +67 -0
  20. package/lib/model/debats.js +95 -0
  21. package/lib/model/documents.d.ts +12 -0
  22. package/lib/model/documents.js +138 -0
  23. package/lib/model/dosleg.d.ts +7 -0
  24. package/lib/model/dosleg.js +326 -0
  25. package/lib/model/index.d.ts +7 -0
  26. package/lib/model/index.js +7 -0
  27. package/lib/model/questions.d.ts +45 -0
  28. package/lib/model/questions.js +89 -0
  29. package/lib/model/scrutins.d.ts +13 -0
  30. package/lib/model/scrutins.js +114 -0
  31. package/lib/model/seance.d.ts +3 -0
  32. package/lib/model/seance.js +267 -0
  33. package/lib/model/sens.d.ts +146 -0
  34. package/lib/model/sens.js +454 -0
  35. package/lib/model/texte.d.ts +7 -0
  36. package/lib/model/texte.js +228 -0
  37. package/lib/model/util.d.ts +9 -0
  38. package/lib/model/util.js +38 -0
  39. package/lib/parsers/texte.d.ts +7 -0
  40. package/lib/parsers/texte.js +228 -0
  41. package/lib/raw_types/ameli.d.ts +914 -0
  42. package/lib/raw_types/ameli.js +5 -0
  43. package/lib/raw_types/debats.d.ts +207 -0
  44. package/lib/raw_types/debats.js +5 -0
  45. package/lib/raw_types/dosleg.d.ts +1619 -0
  46. package/lib/raw_types/dosleg.js +5 -0
  47. package/lib/raw_types/questions.d.ts +423 -0
  48. package/lib/raw_types/questions.js +5 -0
  49. package/lib/raw_types/senat.d.ts +11372 -0
  50. package/lib/raw_types/senat.js +5 -0
  51. package/lib/raw_types/sens.d.ts +8248 -0
  52. package/lib/raw_types/sens.js +5 -0
  53. package/lib/raw_types_schemats/ameli.d.ts +539 -0
  54. package/lib/raw_types_schemats/ameli.js +2 -0
  55. package/lib/raw_types_schemats/debats.d.ts +127 -0
  56. package/lib/raw_types_schemats/debats.js +2 -0
  57. package/lib/raw_types_schemats/dosleg.d.ts +977 -0
  58. package/lib/raw_types_schemats/dosleg.js +2 -0
  59. package/lib/raw_types_schemats/questions.d.ts +237 -0
  60. package/lib/raw_types_schemats/questions.js +2 -0
  61. package/lib/raw_types_schemats/sens.d.ts +6915 -0
  62. package/lib/raw_types_schemats/sens.js +2 -0
  63. package/lib/scripts/convert_data.d.ts +1 -0
  64. package/lib/scripts/convert_data.js +354 -0
  65. package/lib/scripts/data-download.d.ts +1 -0
  66. package/lib/scripts/data-download.js +12 -0
  67. package/lib/scripts/datautil.d.ts +8 -0
  68. package/lib/scripts/datautil.js +34 -0
  69. package/lib/scripts/parse_textes.d.ts +1 -0
  70. package/lib/scripts/parse_textes.js +44 -0
  71. package/lib/scripts/retrieve_agenda.d.ts +1 -0
  72. package/lib/scripts/retrieve_agenda.js +132 -0
  73. package/lib/scripts/retrieve_cr_commission.d.ts +1 -0
  74. package/lib/scripts/retrieve_cr_commission.js +364 -0
  75. package/lib/scripts/retrieve_cr_seance.d.ts +6 -0
  76. package/lib/scripts/retrieve_cr_seance.js +347 -0
  77. package/lib/scripts/retrieve_documents.d.ts +3 -0
  78. package/lib/scripts/retrieve_documents.js +219 -0
  79. package/lib/scripts/retrieve_open_data.d.ts +1 -0
  80. package/lib/scripts/retrieve_open_data.js +316 -0
  81. package/lib/scripts/retrieve_senateurs_photos.d.ts +1 -0
  82. package/lib/scripts/retrieve_senateurs_photos.js +147 -0
  83. package/lib/scripts/retrieve_videos.d.ts +1 -0
  84. package/lib/scripts/retrieve_videos.js +461 -0
  85. package/lib/scripts/shared/cli_helpers.d.ts +95 -0
  86. package/lib/scripts/shared/cli_helpers.js +91 -0
  87. package/lib/scripts/shared/util.d.ts +4 -0
  88. package/lib/scripts/shared/util.js +35 -0
  89. package/lib/scripts/test_iter_load.d.ts +1 -0
  90. package/lib/scripts/test_iter_load.js +12 -0
  91. package/lib/src/utils/nvs-timecode.d.ts +17 -0
  92. package/lib/src/utils/nvs-timecode.js +79 -0
  93. package/lib/src/utils/scoring.d.ts +3 -0
  94. package/lib/src/utils/scoring.js +37 -6
  95. package/lib/src/utils/weights_scoring_config.d.ts +2 -0
  96. package/lib/src/utils/weights_scoring_config.js +15 -0
  97. package/lib/src/videos/types.d.ts +2 -2
  98. package/lib/strings.d.ts +1 -0
  99. package/lib/strings.js +18 -0
  100. package/lib/types/agenda.d.ts +44 -0
  101. package/lib/types/agenda.js +1 -0
  102. package/lib/types/ameli.d.ts +5 -0
  103. package/lib/types/ameli.js +1 -0
  104. package/lib/types/compte_rendu.d.ts +83 -0
  105. package/lib/types/compte_rendu.js +1 -0
  106. package/lib/types/debats.d.ts +2 -0
  107. package/lib/types/debats.js +1 -0
  108. package/lib/types/dosleg.d.ts +70 -0
  109. package/lib/types/dosleg.js +1 -0
  110. package/lib/types/questions.d.ts +2 -0
  111. package/lib/types/questions.js +1 -0
  112. package/lib/types/sens.d.ts +10 -0
  113. package/lib/types/sens.js +1 -0
  114. package/lib/types/sessions.d.ts +5 -0
  115. package/lib/types/sessions.js +84 -0
  116. package/lib/types/texte.d.ts +74 -0
  117. package/lib/types/texte.js +16 -0
  118. package/lib/utils/cr_spliting.d.ts +28 -0
  119. package/lib/utils/cr_spliting.js +265 -0
  120. package/lib/utils/date.d.ts +10 -0
  121. package/lib/utils/date.js +100 -0
  122. package/lib/utils/nvs-timecode.d.ts +7 -0
  123. package/lib/utils/nvs-timecode.js +79 -0
  124. package/lib/utils/reunion_grouping.d.ts +11 -0
  125. package/lib/utils/reunion_grouping.js +337 -0
  126. package/lib/utils/reunion_odj_building.d.ts +5 -0
  127. package/lib/utils/reunion_odj_building.js +154 -0
  128. package/lib/utils/reunion_parsing.d.ts +23 -0
  129. package/lib/utils/reunion_parsing.js +209 -0
  130. package/lib/utils/scoring.d.ts +14 -0
  131. package/lib/utils/scoring.js +147 -0
  132. package/lib/utils/string_cleaning.d.ts +7 -0
  133. package/lib/utils/string_cleaning.js +57 -0
  134. package/lib/validators/config.d.ts +9 -0
  135. package/lib/validators/config.js +10 -0
  136. package/package.json +1 -1
@@ -0,0 +1,12 @@
1
+ import { iterLoadSenatRapports, } from "../loaders";
2
+ import commandLineArgs from "command-line-args";
3
+ import { dataDirDefaultOption } from "./shared/cli_helpers";
4
+ const optionsDefinitions = [dataDirDefaultOption];
5
+ const options = commandLineArgs(optionsDefinitions);
6
+ const session = 2024;
7
+ const sinceCommit = undefined;
8
+ for (const { item: rapport } of iterLoadSenatRapports(options["dataDir"], session, {
9
+ sinceCommit: sinceCommit,
10
+ })) {
11
+ console.log(rapport);
12
+ }
@@ -0,0 +1,17 @@
1
+ export type L1Chapter = {
2
+ id: string;
3
+ label: string;
4
+ index: number;
5
+ };
6
+ export declare function getLevel1Chapters(dataNvs: string): L1Chapter[];
7
+ export declare function pickBestLevel1ChapterForAgenda(chapters: L1Chapter[], agendaTitle: string): {
8
+ chapter: L1Chapter;
9
+ score: number;
10
+ } | null;
11
+ export declare function getAgendaSegmentTimecodes(dataNvs: string, finalPlayerNvs: string, agendaTitleOrObjet: string): {
12
+ start: number;
13
+ end: number | null;
14
+ chapterId: string;
15
+ nextChapterId: string | null;
16
+ score: number;
17
+ } | null;
@@ -0,0 +1,79 @@
1
+ import { XMLParser } from "fast-xml-parser";
2
+ import { dice, normalize } from "./scoring";
3
+ import { decodeHtmlEntities } from "./string_cleaning";
4
+ const CHAPTER_MATCH_THRESHOLD = 0.5;
5
+ const xmlParser = new XMLParser({
6
+ ignoreAttributes: false,
7
+ attributeNamePrefix: "@_",
8
+ });
9
+ function getTimecodeForChapterId(finalPlayerNvs, chapterId) {
10
+ const xml = xmlParser.parse(finalPlayerNvs);
11
+ const synchros = xml?.player?.synchro;
12
+ if (!synchros)
13
+ return null;
14
+ const synchsArray = Array.isArray(synchros) ? synchros : [synchros];
15
+ const match = synchsArray.find((s) => String(s["@_id"]) === String(chapterId));
16
+ if (!match)
17
+ return null;
18
+ const rawTimecode = match["@_timecode"];
19
+ if (rawTimecode == null)
20
+ return null;
21
+ const ms = Number(rawTimecode);
22
+ if (Number.isNaN(ms))
23
+ return null;
24
+ return Math.floor(ms / 1000);
25
+ }
26
+ function toArray(v) {
27
+ if (!v)
28
+ return [];
29
+ return Array.isArray(v) ? v : [v];
30
+ }
31
+ export function getLevel1Chapters(dataNvs) {
32
+ const xml = xmlParser.parse(dataNvs);
33
+ const root = xml?.data?.chapters?.chapter ?? xml?.chapters?.chapter;
34
+ const roots = toArray(root);
35
+ return roots
36
+ .map((ch, i) => {
37
+ const id = ch?.id ?? ch?.["@_id"];
38
+ const labelRaw = ch?.label ?? ch?.["@_label"] ?? "";
39
+ return {
40
+ id: String(id),
41
+ label: decodeHtmlEntities(String(labelRaw)).trim(),
42
+ index: i,
43
+ };
44
+ })
45
+ .filter((c) => c.id && c.label);
46
+ }
47
+ export function pickBestLevel1ChapterForAgenda(chapters, agendaTitle) {
48
+ const q = normalize(agendaTitle);
49
+ let best = null;
50
+ for (const ch of chapters) {
51
+ const s = dice(q, ch.label);
52
+ if (!best || s > best.score)
53
+ best = { chapter: ch, score: s };
54
+ }
55
+ if (!best || best.score < CHAPTER_MATCH_THRESHOLD)
56
+ return { chapter: chapters[0], score: 0 };
57
+ return best;
58
+ }
59
+ export function getAgendaSegmentTimecodes(dataNvs, finalPlayerNvs, agendaTitleOrObjet) {
60
+ const l1 = getLevel1Chapters(dataNvs);
61
+ if (!l1.length)
62
+ return null;
63
+ const best = pickBestLevel1ChapterForAgenda(l1, agendaTitleOrObjet);
64
+ if (!best)
65
+ return null;
66
+ const chapter = best.chapter;
67
+ const next = l1[chapter.index + 1] ?? null;
68
+ const start = getTimecodeForChapterId(finalPlayerNvs, chapter.id);
69
+ if (start == null)
70
+ return null;
71
+ const end = next ? getTimecodeForChapterId(finalPlayerNvs, next.id) : null;
72
+ return {
73
+ start,
74
+ end,
75
+ chapterId: chapter.id,
76
+ nextChapterId: next?.id ?? null,
77
+ score: best.score,
78
+ };
79
+ }
@@ -13,6 +13,9 @@ export declare function isNoiseBlock(text: string): boolean;
13
13
  export declare function scoreSommaireBlockForEvent(blockText: string, ev: AgendaEvent): number;
14
14
  export declare function getOrgKey(norm: string): string;
15
15
  export declare function dice(a: string, b: string): number;
16
+ export declare function coverage(reference?: string | null, candidate?: string | null): number;
17
+ export declare function diceFiltered(a?: string | null, b?: string | null): number;
18
+ export declare function similarityScore(a?: string | null, b?: string | null): number;
16
19
  export declare function normalize(s?: string | null): string;
17
20
  export declare function normalizeSalle(s?: string | null): string | null;
18
21
  export declare function scoreVideo(agenda: Reunion, agendaTs: number | null, sameOrg: boolean, w: VideoScoreWeights, videoTitle?: string, videoEpoch?: number, videoOrganes?: string[], timeAmbigious?: boolean, salle?: string, chapterTitles?: L1Chapter[]): {
@@ -154,6 +154,38 @@ export function dice(a, b) {
154
154
  inter++;
155
155
  return (2 * inter) / (A.size + B.size);
156
156
  }
157
+ function tokenSet(s) {
158
+ if (!s)
159
+ return new Set();
160
+ return new Set(tokens(s));
161
+ }
162
+ export function coverage(reference, candidate) {
163
+ const A = tokenSet(reference);
164
+ const B = tokenSet(candidate);
165
+ if (!A.size || !B.size)
166
+ return 0;
167
+ let inter = 0;
168
+ for (const t of A)
169
+ if (B.has(t))
170
+ inter++;
171
+ return inter / A.size;
172
+ }
173
+ export function diceFiltered(a, b) {
174
+ const A = tokenSet(a);
175
+ const B = tokenSet(b);
176
+ if (!A.size || !B.size)
177
+ return 0;
178
+ let inter = 0;
179
+ for (const t of A)
180
+ if (B.has(t))
181
+ inter++;
182
+ return (2 * inter) / (A.size + B.size);
183
+ }
184
+ export function similarityScore(a, b) {
185
+ const cov = coverage(a, b);
186
+ const d = diceFiltered(a, b);
187
+ return 0.7 * cov + 0.3 * d;
188
+ }
157
189
  export function normalize(s) {
158
190
  return (s ?? "")
159
191
  .toLowerCase()
@@ -174,13 +206,13 @@ export function normalizeSalle(s) {
174
206
  }
175
207
  export function scoreVideo(agenda, agendaTs, sameOrg, w, videoTitle, videoEpoch, videoOrganes, timeAmbigious = false, salle, chapterTitles) {
176
208
  const weights = w;
177
- const objetS = dice(agenda.objet || "", videoTitle || "");
178
- const titleS = dice(agenda.titre || "", videoTitle || "");
209
+ const objetS = similarityScore(agenda.objet || "", videoTitle || "");
210
+ const titleS = similarityScore(agenda.titre || "", videoTitle || "");
179
211
  let titleScore = Math.max(objetS, titleS);
180
212
  chapterTitles = chapterTitles || [];
181
213
  for (const ch of chapterTitles) {
182
- const chObjetS = dice(agenda.objet || "", ch.label);
183
- const chTitreS = dice(agenda.titre || "", ch.label);
214
+ const chObjetS = similarityScore(agenda.objet || "", ch.label);
215
+ const chTitreS = similarityScore(agenda.titre || "", ch.label);
184
216
  titleScore = Math.max(titleScore, Math.max(chObjetS, chTitreS));
185
217
  }
186
218
  let timeScore = 0;
@@ -190,8 +222,7 @@ export function scoreVideo(agenda, agendaTs, sameOrg, w, videoTitle, videoEpoch,
190
222
  }
191
223
  let orgScore = 0;
192
224
  if (agenda.organe && videoOrganes?.length) {
193
- // NOTE: if you already normalize organes elsewhere, keep it there.
194
- orgScore = Math.max(...videoOrganes.map((v) => dice(agenda.organe, v)));
225
+ orgScore = Math.max(...videoOrganes.map((v) => similarityScore(agenda.organe, v)));
195
226
  }
196
227
  // Salle: normalized "A263" matching
197
228
  let salleScore = 0;
@@ -0,0 +1,2 @@
1
+ import { MatchWeights } from "./scoring";
2
+ export declare const weights: MatchWeights;
@@ -0,0 +1,15 @@
1
+ // BASED ON TESTS RESULTS
2
+ // these weights yield good results in the benchmark test suite
3
+ // aiming at 0 WRONG matches while maximizing HITs
4
+ export const weights = {
5
+ wTitle: 0.7,
6
+ wOrg: 0.1,
7
+ wSalle: 0,
8
+ wTime: 0.2,
9
+ sameOrgBonus: 0.2,
10
+ minAccept: 0.5,
11
+ margin: 0.1,
12
+ titleMin: 0.2,
13
+ titleDominance: 0,
14
+ orgUncertainPenalty: 0.8,
15
+ };
@@ -12,8 +12,8 @@ export type MatchResult = {
12
12
  reason?: "margin_ambiguous_time_sp";
13
13
  };
14
14
  export type MatchWeights = {
15
- minAccept?: number;
16
- margin?: number;
15
+ minAccept: number;
16
+ margin: number;
17
17
  titleDominance?: number;
18
18
  orgUncertainPenalty?: number;
19
19
  orgSkipDice?: number;
@@ -0,0 +1 @@
1
+ export declare function slugify(string: string, replacement?: string): string;
package/lib/strings.js ADDED
@@ -0,0 +1,18 @@
1
+ import originalSlugify from "slug";
2
+ const slugifyCharmap = {
3
+ ...originalSlugify.defaults.charmap,
4
+ "'": " ",
5
+ "@": " ",
6
+ ".": " ",
7
+ "-": "_",
8
+ };
9
+ export function slugify(string, replacement) {
10
+ const options = {
11
+ charmap: slugifyCharmap,
12
+ mode: "rfc3986",
13
+ };
14
+ if (replacement) {
15
+ options.replacement = replacement;
16
+ }
17
+ return originalSlugify(string, options);
18
+ }
@@ -0,0 +1,44 @@
1
+ export interface AgendaEvent {
2
+ id: string;
3
+ type: string | null;
4
+ date: string;
5
+ startTime: string | null;
6
+ endTime: string | null;
7
+ timeOriginal: string | null;
8
+ titre: string;
9
+ organe: string | null;
10
+ objet: string | null;
11
+ lieu: string | null;
12
+ captationVideo: boolean;
13
+ urlDossierSenat: string | null;
14
+ quantieme: string | null;
15
+ }
16
+ export type TimeSlot = "MATIN" | "APRES-MIDI" | "SOIR" | "UNKNOWN";
17
+ export interface Reunion {
18
+ uid: string;
19
+ chambre: "SN";
20
+ date: string;
21
+ startTime: string | null;
22
+ endTime: string | null;
23
+ captationVideo: boolean;
24
+ titre: string;
25
+ type: string;
26
+ organe?: string;
27
+ objet?: string;
28
+ lieu?: string;
29
+ events: AgendaEvent[];
30
+ compteRenduRefUid?: string;
31
+ transcriptionRef?: string;
32
+ urlVideo?: string;
33
+ timecodeDebutVideo?: number;
34
+ timecodeFinVideo?: number;
35
+ odj?: ReunionOdj;
36
+ }
37
+ export interface ReunionOdjPoint {
38
+ objet: string | null;
39
+ dossierLegislatifRef: string | null;
40
+ codeEtape: string | null;
41
+ }
42
+ export interface ReunionOdj {
43
+ pointsOdj: ReunionOdjPoint[];
44
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ import { ses as Ses, sub as Sub, subFields, txt_ameli } from "../raw_types_schemats/ameli";
2
+ export type { Ses, Sub };
3
+ export interface TxtAmeli extends txt_ameli {
4
+ subids?: subFields.id[];
5
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,83 @@
1
+ export interface CompteRendu {
2
+ uid: string;
3
+ seanceRef: string;
4
+ sessionRef: string;
5
+ metadonnees: Metadonnees;
6
+ contenu: Contenu;
7
+ }
8
+ export interface Metadonnees {
9
+ dateSeance: string;
10
+ dateSeanceJour: string;
11
+ numSeanceJour: string;
12
+ numSeance: string;
13
+ typeAssemblee: "AN" | "SN";
14
+ legislature: string;
15
+ session: string;
16
+ nomFichierJo: string;
17
+ validite: string;
18
+ etat: string;
19
+ diffusion: string;
20
+ version: string;
21
+ environnement: string;
22
+ heureGeneration: Date;
23
+ sommaire?: Sommaire;
24
+ }
25
+ export interface Contenu {
26
+ quantiemes: Quantiemes;
27
+ ouvertureSeance?: Point[] | Point;
28
+ point: Point[] | Point;
29
+ finSeance?: FinSeance;
30
+ paragraphe?: Point[];
31
+ }
32
+ export interface FinSeance {
33
+ point: Point;
34
+ }
35
+ export interface Quantiemes {
36
+ journee: string;
37
+ session: string;
38
+ }
39
+ export interface Point {
40
+ ordre_absolu_seance: string;
41
+ code_grammaire: string;
42
+ roledebat?: string;
43
+ orateurs?: {
44
+ orateur: {
45
+ nom: string;
46
+ id: string;
47
+ qualite: string;
48
+ };
49
+ };
50
+ texte: {
51
+ _: string;
52
+ };
53
+ code_style?: string;
54
+ }
55
+ export interface Texte {
56
+ _?: string;
57
+ id_syceron?: string;
58
+ stime?: string;
59
+ sup?: string;
60
+ lienAdt?: Texte[] | Texte;
61
+ }
62
+ export interface Sommaire {
63
+ presidentSeance: Texte;
64
+ sommaire1: SommaireElement[] | SommaireElement;
65
+ sommaire3?: SommaireElement[] | SommaireElement;
66
+ sommaire2?: SommaireElement[] | SommaireElement;
67
+ para?: Texte[] | Texte;
68
+ }
69
+ export interface SommaireElement {
70
+ valeur_pts_odj: string | undefined;
71
+ titreStruct: TitreStruct;
72
+ para?: Array<Texte | string> | Texte;
73
+ sommaire2?: SommaireElement[] | SommaireElement;
74
+ sommaire3?: SommaireElement[] | SommaireElement;
75
+ presidentSeance?: Texte[] | Texte;
76
+ type_debat?: string;
77
+ }
78
+ export interface TitreStruct {
79
+ id_syceron: string;
80
+ intitule?: string;
81
+ sousIntitule?: string;
82
+ type_debat?: string;
83
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import { debats as Debat, lecassdeb as LecAssDeb } from "../raw_types_schemats/debats";
2
+ export type { Debat, LecAssDeb };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,70 @@
1
+ import { txt_ameliFields } from "../raw_types_schemats/ameli";
2
+ import { ass as Ass, aud, audFields, auteur, date_seance, date_seanceFields as dateSeanceFields, deccoc as DecCoc, denrap as DenRap, docatt, docattFields, ecr, ecrFields, etaloi as EtaLoi, lecass, lecassFields, lecassrap, lecture, lectureFields, loi, org as Org, oritxt as OriTxt, qua as Qua, rap, raporg as RapOrg, raporgFields, scr as Scr, texte, texteFields, typatt as TypAtt, typlec as TypLec, typloi as TypLoi, typtxt as TypTxt, typurl as TypUrl, typurlFields } from "../raw_types_schemats/dosleg";
3
+ import { Debat } from "./debats";
4
+ import { TxtAmeli } from "./ameli";
5
+ export type { Ass, DecCoc, DenRap, EtaLoi, Org, OriTxt, Qua, RapOrg, Scr, TypAtt, TypLec, TypLoi, TypTxt, TypUrl };
6
+ export interface Aud extends aud {
7
+ org?: Org;
8
+ }
9
+ export interface Auteur extends auteur {
10
+ qua?: Qua;
11
+ }
12
+ export interface DateSeance extends date_seance {
13
+ debat?: Debat;
14
+ scrids?: string[];
15
+ scrs?: Scr[];
16
+ }
17
+ export interface DocAtt extends docatt {
18
+ rap?: Rap;
19
+ typatt?: TypAtt;
20
+ }
21
+ export interface Ecr extends ecr {
22
+ aut?: Auteur;
23
+ }
24
+ export interface LecAss extends lecass {
25
+ ass?: Ass;
26
+ auds?: Aud[];
27
+ audcles?: audFields.audcle[];
28
+ datesSeances?: DateSeance[];
29
+ datesSeancesCodes?: dateSeanceFields.code[];
30
+ debatdatseas: Date[];
31
+ lecassraps?: LecAssRap[];
32
+ lecassrapids?: string[];
33
+ org?: Org;
34
+ texcods: texteFields.texcod[];
35
+ textes?: Texte[];
36
+ }
37
+ export interface LecAssRap extends lecassrap {
38
+ rap?: Rap;
39
+ }
40
+ export interface Lecture extends lecture {
41
+ typlec?: TypLec;
42
+ lecassidts?: lecassFields.lecassidt[];
43
+ lecasss?: LecAss[];
44
+ }
45
+ export interface Loi extends loi {
46
+ deccoc?: DecCoc;
47
+ etaloi?: EtaLoi;
48
+ lecidts?: lectureFields.lecidt[];
49
+ lectures?: Lecture[];
50
+ typloi?: TypLoi;
51
+ }
52
+ export interface Rap extends rap {
53
+ denrap?: DenRap;
54
+ docattcles?: docattFields.docattcle[];
55
+ docatts?: DocAtt[];
56
+ ecrnums?: ecrFields.ecrnum[];
57
+ ecrs?: Ecr[];
58
+ orgcods?: raporgFields.orgcod[];
59
+ orgs?: Org[];
60
+ }
61
+ export interface Texte extends texte {
62
+ ecrs?: Ecr[];
63
+ ecrnums?: ecrFields.ecrnum[];
64
+ libtypurl?: typurlFields.libtypurl;
65
+ org?: Org;
66
+ oritxt: OriTxt;
67
+ typtxt?: TypTxt;
68
+ txtAmeli?: TxtAmeli;
69
+ txtAmeliId: txt_ameliFields.id;
70
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import { tam_questions as Question } from "../raw_types_schemats/questions";
2
+ export type { Question };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,10 @@
1
+ import { sen as Sen } from "../raw_types_schemats/sens";
2
+ export type { Sen };
3
+ export interface Photo {
4
+ chemin: string;
5
+ cheminMosaique: string;
6
+ hauteur: number;
7
+ largeur: number;
8
+ xMosaique: number;
9
+ yMosaique: number;
10
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ export declare const UNDEFINED_SESSION = 0;
2
+ declare const sessions: readonly [0, 1958, 1959, 1960, 1961, 1962, 1963, 1964, 1965, 1966, 1967, 1968, 1969, 1970, 1971, 1972, 1973, 1974, 1975, 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024, 2025, 2026];
3
+ export type Session = (typeof sessions)[number];
4
+ export declare function getSessionsFromStart(startSession: Session): (0 | 1958 | 1959 | 1960 | 1961 | 1962 | 1963 | 1964 | 1965 | 1966 | 1967 | 1968 | 1969 | 1970 | 1971 | 1972 | 1973 | 1974 | 1975 | 1976 | 1977 | 1978 | 1979 | 1980 | 1981 | 1982 | 1983 | 1984 | 1985 | 1986 | 1987 | 1988 | 1989 | 1990 | 1991 | 1992 | 1993 | 1994 | 1995 | 1996 | 1997 | 1998 | 1999 | 2000 | 2001 | 2002 | 2003 | 2004 | 2005 | 2006 | 2007 | 2008 | 2009 | 2010 | 2011 | 2012 | 2013 | 2014 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 2023 | 2024 | 2025 | 2026)[];
5
+ export {};
@@ -0,0 +1,84 @@
1
+ export const UNDEFINED_SESSION = 0;
2
+ const sessions = [
3
+ UNDEFINED_SESSION,
4
+ 1958,
5
+ 1959,
6
+ 1960,
7
+ 1961,
8
+ 1962,
9
+ 1963,
10
+ 1964,
11
+ 1965,
12
+ 1966,
13
+ 1967,
14
+ 1968,
15
+ 1969,
16
+ 1970,
17
+ 1971,
18
+ 1972,
19
+ 1973,
20
+ 1974,
21
+ 1975,
22
+ 1976,
23
+ 1977,
24
+ 1978,
25
+ 1979,
26
+ 1980,
27
+ 1981,
28
+ 1982,
29
+ 1983,
30
+ 1984,
31
+ 1985,
32
+ 1986,
33
+ 1987,
34
+ 1988,
35
+ 1989,
36
+ 1990,
37
+ 1991,
38
+ 1992,
39
+ 1993,
40
+ 1994,
41
+ 1995,
42
+ 1996,
43
+ 1997,
44
+ 1998,
45
+ 1999,
46
+ 2000,
47
+ 2001,
48
+ 2002,
49
+ 2003,
50
+ 2004,
51
+ 2005,
52
+ 2006,
53
+ 2007,
54
+ 2008,
55
+ 2009,
56
+ 2010,
57
+ 2011,
58
+ 2012,
59
+ 2013,
60
+ 2014,
61
+ 2015,
62
+ 2016,
63
+ 2017,
64
+ 2018,
65
+ 2019,
66
+ 2020,
67
+ 2021,
68
+ 2022,
69
+ 2023,
70
+ 2024,
71
+ 2025,
72
+ 2026,
73
+ // TO COMPLETE EVERY YEAR :)
74
+ ];
75
+ export function getSessionsFromStart(startSession) {
76
+ if (startSession === 0) {
77
+ return Array.from(sessions);
78
+ }
79
+ const sessionIndex = sessions.findIndex((session) => startSession === session);
80
+ if (sessionIndex >= 0) {
81
+ return sessions.slice(sessionIndex);
82
+ }
83
+ return [];
84
+ }
@@ -0,0 +1,74 @@
1
+ export declare enum DivisionType {
2
+ tome = 1,
3
+ part = 2,
4
+ book = 3,
5
+ title = 4,
6
+ subtitle = 5,
7
+ chapter = 6,
8
+ section = 7,
9
+ subsection = 8,
10
+ paragraph = 9,
11
+ article = 10,
12
+ alinea = 11,
13
+ division = 12
14
+ }
15
+ export type DivisionTag = keyof typeof DivisionType;
16
+ export interface DocumentMetadata {
17
+ name: string;
18
+ session: number | null | undefined;
19
+ date?: string | null;
20
+ url_expose_des_motifs?: URL;
21
+ url_xml?: URL;
22
+ url_html: URL;
23
+ url_pdf: URL;
24
+ }
25
+ export interface FlatTexte {
26
+ titre: string | null;
27
+ titreCourt: string | null;
28
+ signetDossier: string | null;
29
+ urlDossierSenat: string | null;
30
+ urlDossierAssemblee: string | null;
31
+ type: string | null;
32
+ session: string | null;
33
+ numero: number | null;
34
+ datePresentation: Date | null;
35
+ dateDepot: Date | null;
36
+ datePublicationXml: Date | null;
37
+ version: Version | null;
38
+ workflow: Step[];
39
+ divisions: Division[];
40
+ exposeDesMotifs?: ExposeDesMotifs | null;
41
+ }
42
+ export type Version = "RECT" | "RECT_BIS" | "RECT_TER" | "RECT_QUATER" | "RECT_QUINQUIES";
43
+ export interface Step {
44
+ eId: string;
45
+ date: Date | null;
46
+ type: string | null;
47
+ session: string | null;
48
+ numero: string | null;
49
+ version: Version | null;
50
+ outcome: string | null;
51
+ }
52
+ export interface Division {
53
+ index: number;
54
+ eId: string;
55
+ tag: DivisionTag;
56
+ level: number;
57
+ headings: DivisionContent[];
58
+ }
59
+ export interface Article extends Division {
60
+ alineas: Alinea[];
61
+ }
62
+ export interface DivisionContent {
63
+ text: string | null;
64
+ html?: string | null;
65
+ }
66
+ export interface Alinea extends DivisionContent {
67
+ eId: string;
68
+ heading: DivisionContent;
69
+ pastille: string | null;
70
+ }
71
+ export interface ExposeDesMotifs {
72
+ text: string | null;
73
+ html: string | null;
74
+ }
@@ -0,0 +1,16 @@
1
+ /* eslint no-use-before-define: 0 */
2
+ export var DivisionType;
3
+ (function (DivisionType) {
4
+ DivisionType[DivisionType["tome"] = 1] = "tome";
5
+ DivisionType[DivisionType["part"] = 2] = "part";
6
+ DivisionType[DivisionType["book"] = 3] = "book";
7
+ DivisionType[DivisionType["title"] = 4] = "title";
8
+ DivisionType[DivisionType["subtitle"] = 5] = "subtitle";
9
+ DivisionType[DivisionType["chapter"] = 6] = "chapter";
10
+ DivisionType[DivisionType["section"] = 7] = "section";
11
+ DivisionType[DivisionType["subsection"] = 8] = "subsection";
12
+ DivisionType[DivisionType["paragraph"] = 9] = "paragraph";
13
+ DivisionType[DivisionType["article"] = 10] = "article";
14
+ DivisionType[DivisionType["alinea"] = 11] = "alinea";
15
+ DivisionType[DivisionType["division"] = 12] = "division";
16
+ })(DivisionType || (DivisionType = {}));