@tricoteuses/senat 3.1.19 → 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 (108) 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/retrieve_videos.js +5 -1
  10. package/lib/src/scripts/shared/incremental_import_sql.js +859 -859
  11. package/lib/src/scripts/shared/schema_version.js +84 -84
  12. package/lib/src/scripts/shared/staging_metadata_sql.js +214 -214
  13. package/lib/src/scripts/validate_prefixed_tables.js +12 -12
  14. package/lib/src/server/ameli.js +11 -11
  15. package/lib/src/server/conversion_textes.js +106 -106
  16. package/lib/src/server/debats.js +10 -10
  17. package/lib/src/server/documents.js +22 -22
  18. package/lib/src/server/dosleg.js +33 -33
  19. package/lib/src/server/questions.js +10 -10
  20. package/lib/src/server/scrutins.js +3 -3
  21. package/lib/src/server/sens.js +19 -19
  22. package/lib/src/utils/manifest.d.ts +6 -0
  23. package/lib/src/utils/manifest.js +37 -0
  24. package/lib/src/utils/reunion_deletion.d.ts +2 -0
  25. package/lib/src/utils/reunion_deletion.js +27 -0
  26. package/lib/src/videos/match.js +4 -4
  27. package/lib/tests/collaborateurs.test.js +115 -0
  28. package/package.json +117 -117
  29. package/lib/src/config.d.ts +0 -21
  30. package/lib/src/config.js +0 -27
  31. package/lib/src/conversion_textes.d.ts +0 -11
  32. package/lib/src/conversion_textes.js +0 -316
  33. package/lib/src/databases.d.ts +0 -2
  34. package/lib/src/databases.js +0 -26
  35. package/lib/src/datasets.d.ts +0 -34
  36. package/lib/src/datasets.js +0 -233
  37. package/lib/src/git.d.ts +0 -26
  38. package/lib/src/git.js +0 -217
  39. package/lib/src/loaders.d.ts +0 -52
  40. package/lib/src/loaders.js +0 -254
  41. package/lib/src/model/agenda.d.ts +0 -6
  42. package/lib/src/model/agenda.js +0 -148
  43. package/lib/src/model/ameli.d.ts +0 -55
  44. package/lib/src/model/ameli.js +0 -148
  45. package/lib/src/model/commission.d.ts +0 -18
  46. package/lib/src/model/commission.js +0 -269
  47. package/lib/src/model/debats.d.ts +0 -67
  48. package/lib/src/model/debats.js +0 -95
  49. package/lib/src/model/documents.d.ts +0 -12
  50. package/lib/src/model/documents.js +0 -141
  51. package/lib/src/model/dosleg.d.ts +0 -7
  52. package/lib/src/model/dosleg.js +0 -326
  53. package/lib/src/model/index.d.ts +0 -7
  54. package/lib/src/model/index.js +0 -7
  55. package/lib/src/model/questions.d.ts +0 -45
  56. package/lib/src/model/questions.js +0 -89
  57. package/lib/src/model/scrutins.d.ts +0 -13
  58. package/lib/src/model/scrutins.js +0 -114
  59. package/lib/src/model/seance.d.ts +0 -3
  60. package/lib/src/model/seance.js +0 -267
  61. package/lib/src/model/sens.d.ts +0 -182
  62. package/lib/src/model/sens.js +0 -485
  63. package/lib/src/model/util.d.ts +0 -9
  64. package/lib/src/model/util.js +0 -38
  65. package/lib/src/raw_types/ameli.d.ts +0 -914
  66. package/lib/src/raw_types/ameli.js +0 -5
  67. package/lib/src/raw_types/debats.d.ts +0 -207
  68. package/lib/src/raw_types/debats.js +0 -5
  69. package/lib/src/raw_types/dosleg.d.ts +0 -1619
  70. package/lib/src/raw_types/dosleg.js +0 -5
  71. package/lib/src/raw_types/questions.d.ts +0 -423
  72. package/lib/src/raw_types/questions.js +0 -5
  73. package/lib/src/raw_types/senat.d.ts +0 -11372
  74. package/lib/src/raw_types/senat.js +0 -5
  75. package/lib/src/raw_types/sens.d.ts +0 -8248
  76. package/lib/src/raw_types/sens.js +0 -5
  77. package/lib/src/raw_types_schemats/ameli.d.ts +0 -539
  78. package/lib/src/raw_types_schemats/ameli.js +0 -2
  79. package/lib/src/raw_types_schemats/debats.d.ts +0 -127
  80. package/lib/src/raw_types_schemats/debats.js +0 -2
  81. package/lib/src/raw_types_schemats/dosleg.d.ts +0 -977
  82. package/lib/src/raw_types_schemats/dosleg.js +0 -2
  83. package/lib/src/raw_types_schemats/questions.d.ts +0 -237
  84. package/lib/src/raw_types_schemats/questions.js +0 -2
  85. package/lib/src/raw_types_schemats/sens.d.ts +0 -6915
  86. package/lib/src/raw_types_schemats/sens.js +0 -2
  87. package/lib/src/scripts/test_iter_load.js +0 -12
  88. package/lib/src/types/agenda.d.ts +0 -45
  89. package/lib/src/types/ameli.d.ts +0 -5
  90. package/lib/src/types/compte_rendu.d.ts +0 -83
  91. package/lib/src/types/debats.d.ts +0 -2
  92. package/lib/src/types/debats.js +0 -1
  93. package/lib/src/types/dosleg.d.ts +0 -70
  94. package/lib/src/types/dosleg.js +0 -1
  95. package/lib/src/types/questions.d.ts +0 -2
  96. package/lib/src/types/questions.js +0 -1
  97. package/lib/src/types/sens.d.ts +0 -10
  98. package/lib/src/types/sens.js +0 -1
  99. package/lib/src/types/sessions.d.ts +0 -6
  100. package/lib/src/types/sessions.js +0 -19
  101. package/lib/src/types/texte.d.ts +0 -72
  102. package/lib/src/types/texte.js +0 -15
  103. package/lib/src/validators/config.d.ts +0 -9
  104. package/lib/src/validators/config.js +0 -10
  105. /package/lib/src/{scripts/test_iter_load.d.ts → other_types/collaborateurs.js} +0 -0
  106. /package/lib/src/{types/agenda.js → other_types/manifest.js} +0 -0
  107. /package/lib/src/{types/ameli.js → scripts/retrieve_collaborateurs.d.ts} +0 -0
  108. /package/lib/{src/types/compte_rendu.js → tests/collaborateurs.test.d.ts} +0 -0
@@ -1,2 +0,0 @@
1
- /* tslint:disable */
2
- export {};
@@ -1,12 +0,0 @@
1
- import { iterLoadSenatTextes, } 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 = 2025;
7
- const sinceCommit = undefined;
8
- for (const { item: texte } of iterLoadSenatTextes(options["dataDir"], session, {
9
- sinceCommit: sinceCommit,
10
- })) {
11
- console.log(texte);
12
- }
@@ -1,45 +0,0 @@
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
- urlPageVideo?: string;
34
- timecodeDebutVideo?: number;
35
- timecodeFinVideo?: number;
36
- odj?: ReunionOdj;
37
- }
38
- export interface ReunionOdjPoint {
39
- objet: string | null;
40
- dossierLegislatifRef: string | null;
41
- codeEtape: string | null;
42
- }
43
- export interface ReunionOdj {
44
- pointsOdj: ReunionOdjPoint[];
45
- }
@@ -1,5 +0,0 @@
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
- }
@@ -1,83 +0,0 @@
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
- }
@@ -1,2 +0,0 @@
1
- import { debats as Debat, lecassdeb as LecAssDeb } from "../raw_types_schemats/debats";
2
- export type { Debat, LecAssDeb };
@@ -1 +0,0 @@
1
- export {};
@@ -1,70 +0,0 @@
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
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,2 +0,0 @@
1
- import { tam_questions as Question } from "../raw_types_schemats/questions";
2
- export type { Question };
@@ -1 +0,0 @@
1
- export {};
@@ -1,10 +0,0 @@
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
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,6 +0,0 @@
1
- export declare const UNDEFINED_SESSION = 0;
2
- export declare const sessionOptions: readonly [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 declare const sessionOptionsOrAll: 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];
4
- export type Session = (typeof sessionOptions)[number];
5
- export type SessionOrAll = (typeof sessionOptionsOrAll)[number];
6
- export declare function getSessionsFromStart(startSession: SessionOrAll): (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)[];
@@ -1,19 +0,0 @@
1
- export const UNDEFINED_SESSION = 0;
2
- export const sessionOptions = [
3
- 1958, 1959, 1960, 1961, 1962, 1963, 1964, 1965, 1966, 1967, 1968, 1969, 1970, 1971, 1972, 1973, 1974, 1975, 1976,
4
- 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
5
- 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014,
6
- 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024, 2025, 2026,
7
- // TO COMPLETE EVERY YEAR :)
8
- ];
9
- export const sessionOptionsOrAll = [UNDEFINED_SESSION, ...sessionOptions];
10
- export function getSessionsFromStart(startSession) {
11
- if (startSession === UNDEFINED_SESSION) {
12
- return Array.from(sessionOptions);
13
- }
14
- const sessionIndex = sessionOptions.findIndex((session) => startSession === session);
15
- if (sessionIndex >= 0) {
16
- return sessionOptions.slice(sessionIndex);
17
- }
18
- return [];
19
- }
@@ -1,72 +0,0 @@
1
- import { DocumentResult } from "../loaders";
2
- export declare enum DivisionType {
3
- tome = 1,
4
- part = 2,
5
- book = 3,
6
- title = 4,
7
- subtitle = 5,
8
- chapter = 6,
9
- section = 7,
10
- subsection = 8,
11
- paragraph = 9,
12
- article = 10,
13
- alinea = 11,
14
- division = 12
15
- }
16
- export type DivisionTag = keyof typeof DivisionType;
17
- export interface DocumentMetadata {
18
- name: string;
19
- session: number | null | undefined;
20
- date?: string | null;
21
- url_expose_des_motifs?: URL;
22
- url_xml?: URL;
23
- url_html: URL;
24
- url_pdf: URL;
25
- }
26
- export interface FlatTexte extends DocumentResult {
27
- titre: string | null;
28
- titre_court: string | null;
29
- url_dossier_senat: string | null;
30
- url_dossier_assemblee: string | null;
31
- date_presentation: Date | null;
32
- date_depot: Date | null;
33
- date_publication_xml: Date | null;
34
- version: Version | null;
35
- divisions: Division[];
36
- expose_motifs?: ExposeDesMotifs | null;
37
- }
38
- export type Version = "RECT" | "RECT_BIS" | "RECT_TER" | "RECT_QUATER" | "RECT_QUINQUIES";
39
- export interface Step {
40
- eId: string;
41
- date: Date | null;
42
- type: string | null;
43
- session: string | null;
44
- numero: string | null;
45
- version: Version | null;
46
- outcome: string | null;
47
- }
48
- export interface Division {
49
- index: number;
50
- eId: string;
51
- tag: DivisionTag;
52
- level: number;
53
- headings: DivisionContent[];
54
- }
55
- export interface Article extends Division {
56
- alineas: Alinea[];
57
- }
58
- export interface DivisionContent {
59
- text: string | null;
60
- html?: string | null;
61
- }
62
- export interface Alinea extends DivisionContent {
63
- eId: string;
64
- heading: DivisionContent;
65
- pastille: string | null;
66
- text_avec_liens?: string | null;
67
- html_avec_liens?: string | null;
68
- }
69
- export interface ExposeDesMotifs {
70
- text: string | null;
71
- html: string | null;
72
- }
@@ -1,15 +0,0 @@
1
- export var DivisionType;
2
- (function (DivisionType) {
3
- DivisionType[DivisionType["tome"] = 1] = "tome";
4
- DivisionType[DivisionType["part"] = 2] = "part";
5
- DivisionType[DivisionType["book"] = 3] = "book";
6
- DivisionType[DivisionType["title"] = 4] = "title";
7
- DivisionType[DivisionType["subtitle"] = 5] = "subtitle";
8
- DivisionType[DivisionType["chapter"] = 6] = "chapter";
9
- DivisionType[DivisionType["section"] = 7] = "section";
10
- DivisionType[DivisionType["subsection"] = 8] = "subsection";
11
- DivisionType[DivisionType["paragraph"] = 9] = "paragraph";
12
- DivisionType[DivisionType["article"] = 10] = "article";
13
- DivisionType[DivisionType["alinea"] = 11] = "alinea";
14
- DivisionType[DivisionType["division"] = 12] = "division";
15
- })(DivisionType || (DivisionType = {}));
@@ -1,9 +0,0 @@
1
- import { z } from "zod";
2
- export declare const configSchema: z.ZodObject<{
3
- db: z.ZodObject<{
4
- host: z.ZodString;
5
- password: z.ZodString;
6
- user: z.ZodString;
7
- port: z.ZodCoercedNumber<unknown>;
8
- }, z.core.$strip>;
9
- }, z.core.$strip>;
@@ -1,10 +0,0 @@
1
- import { z } from "zod";
2
- const dbSchema = z.object({
3
- host: z.string().trim().min(1, "Must not be empty"),
4
- password: z.string().trim().min(1, "Must not be empty"),
5
- user: z.string().trim().min(1, "Must not be empty"),
6
- port: z.coerce.number().int().min(0).max(65535),
7
- });
8
- export const configSchema = z.object({
9
- db: dbSchema,
10
- });