@tricoteuses/senat 2.10.5 → 2.11.1

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 (54) hide show
  1. package/lib/databases.d.ts +1 -28
  2. package/lib/databases.js +0 -6
  3. package/lib/datasets.d.ts +6 -0
  4. package/lib/datasets.js +233 -0
  5. package/lib/loaders.d.ts +5 -0
  6. package/lib/loaders.js +14 -9
  7. package/lib/model/ameli.d.ts +31 -143
  8. package/lib/model/ameli.js +102 -95
  9. package/lib/model/commission.d.ts +5 -0
  10. package/lib/model/commission.js +263 -0
  11. package/lib/model/debats.d.ts +13 -51
  12. package/lib/model/documents.d.ts +2 -0
  13. package/lib/model/documents.js +37 -0
  14. package/lib/model/dosleg.d.ts +9 -104
  15. package/lib/model/dosleg.js +76 -108
  16. package/lib/model/index.d.ts +4 -2
  17. package/lib/model/index.js +4 -2
  18. package/lib/model/questions.d.ts +10 -458
  19. package/lib/model/scrutins.d.ts +3 -0
  20. package/lib/model/scrutins.js +74 -0
  21. package/lib/model/{compte_rendu.js → seance.js} +47 -28
  22. package/lib/model/sens.d.ts +28 -1002
  23. package/lib/model/sens.js +65 -33
  24. package/lib/model/util.d.ts +1 -0
  25. package/lib/model/util.js +19 -1
  26. package/lib/raw_types/ameli.d.ts +778 -1521
  27. package/lib/raw_types/ameli.js +5 -345
  28. package/lib/raw_types/debats.d.ts +163 -306
  29. package/lib/raw_types/debats.js +5 -84
  30. package/lib/raw_types/dosleg.d.ts +1349 -2293
  31. package/lib/raw_types/dosleg.js +5 -550
  32. package/lib/raw_types/questions.d.ts +374 -519
  33. package/lib/raw_types/questions.js +5 -84
  34. package/lib/raw_types/senat.d.ts +11389 -0
  35. package/lib/raw_types/senat.js +5 -0
  36. package/lib/raw_types/sens.d.ts +6729 -12571
  37. package/lib/raw_types/sens.js +5 -2944
  38. package/lib/raw_types_schemats/ameli.d.ts +2 -2
  39. package/lib/raw_types_schemats/debats.d.ts +2 -2
  40. package/lib/raw_types_schemats/dosleg.d.ts +2 -2
  41. package/lib/raw_types_schemats/questions.d.ts +2 -2
  42. package/lib/raw_types_schemats/sens.d.ts +2 -2
  43. package/lib/scripts/convert_data.js +37 -31
  44. package/lib/scripts/retrieve_cr_commission.d.ts +1 -0
  45. package/lib/scripts/retrieve_cr_commission.js +291 -0
  46. package/lib/scripts/{retrieve_comptes_rendus.js → retrieve_cr_seance.js} +1 -1
  47. package/lib/scripts/retrieve_open_data.js +35 -1
  48. package/lib/utils/cr_spliting.d.ts +22 -1
  49. package/lib/utils/cr_spliting.js +273 -12
  50. package/lib/utils/reunion_grouping.d.ts +3 -0
  51. package/lib/utils/reunion_grouping.js +1 -1
  52. package/package.json +12 -11
  53. /package/lib/model/{compte_rendu.d.ts → seance.d.ts} +0 -0
  54. /package/lib/scripts/{retrieve_comptes_rendus.d.ts → retrieve_cr_seance.d.ts} +0 -0
@@ -1,113 +1,18 @@
1
1
  import { InferResult, SelectQueryBuilder } from "kysely";
2
2
  declare const findAllDossiersQuery: SelectQueryBuilder<any, any, any>;
3
3
  export declare function findAllDossiers(): AsyncIterableIterator<DossierLegislatifResult>;
4
- export declare function findAllScrutins(): AsyncIterableIterator<{
5
- numero: number;
6
- votes: {
7
- matricule_votant: string;
8
- matricule_delegant: string | null;
9
- position: string | null;
10
- statut_votant: string | null;
11
- titre_votant: string | null;
12
- }[];
13
- session: number;
14
- date_scrutin: string;
15
- date_scrutin_effective: string;
16
- lecture_id: string | null;
17
- intitule: string | null;
18
- note: string | null;
19
- nombre_majorite: number | null;
20
- nombre_majorite_seance: number | null;
21
- nombre_votants: number | null;
22
- nombre_votants_seance: number | null;
23
- nombre_suffrages: number | null;
24
- nombre_suffrages_seance: number | null;
25
- nombre_contre: number | null;
26
- nombre_contre_seance: number | null;
27
- nombre_pour: number | null;
28
- nombre_pour_seance: number | null;
29
- }>;
30
- export declare function findSenatTexteUrls(sessions?: number[]): AsyncIterableIterator<{
31
- session: number | null | undefined;
32
- url: string;
33
- hasExposeDesMotifs: boolean;
34
- }>;
35
- export declare function findSenatRapportUrls(sessions?: number[]): AsyncIterableIterator<{
36
- url: string;
37
- session: number | null | undefined;
38
- }>;
39
- declare const findAuteursQuery: SelectQueryBuilder<{
40
- amescr: import("../raw_types/dosleg").Amescr;
41
- ass: import("../raw_types/dosleg").Ass;
42
- aud: import("../raw_types/dosleg").Aud;
43
- auteur: import("../raw_types/dosleg").Auteur;
44
- ble: import("../raw_types/dosleg").Ble;
45
- catrap: import("../raw_types/dosleg").Catrap;
46
- corscr: import("../raw_types/dosleg").Corscr;
47
- date_seance: import("../raw_types/dosleg").DateSeance;
48
- deccoc: import("../raw_types/dosleg").Deccoc;
49
- denrap: import("../raw_types/dosleg").Denrap;
50
- doc: import("../raw_types/dosleg").Doc;
51
- docatt: import("../raw_types/dosleg").Docatt;
52
- docsea: import("../raw_types/dosleg").Docsea;
53
- ecr: import("../raw_types/dosleg").Ecr;
54
- etaloi: import("../raw_types/dosleg").Etaloi;
55
- evtsea: import("../raw_types/dosleg").Evtsea;
56
- forpub: import("../raw_types/dosleg").Forpub;
57
- gen: import("../raw_types/dosleg").Gen;
58
- lecass: import("../raw_types/dosleg").Lecass;
59
- lecassrap: import("../raw_types/dosleg").Lecassrap;
60
- lecture: import("../raw_types/dosleg").Lecture;
61
- lnkrap: import("../raw_types/dosleg").Lnkrap;
62
- loi: import("../raw_types/dosleg").Loi;
63
- loithe: import("../raw_types/dosleg").Loithe;
64
- natloi: import("../raw_types/dosleg").Natloi;
65
- org: import("../raw_types/dosleg").Org;
66
- orgnomhis: import("../raw_types/dosleg").Orgnomhis;
67
- orippr: import("../raw_types/dosleg").Orippr;
68
- oritxt: import("../raw_types/dosleg").Oritxt;
69
- posvot: import("../raw_types/dosleg").Posvot;
70
- qua: import("../raw_types/dosleg").Qua;
71
- rap: import("../raw_types/dosleg").Rap;
72
- raporg: import("../raw_types/dosleg").Raporg;
73
- rapthe: import("../raw_types/dosleg").Rapthe;
74
- rolsig: import("../raw_types/dosleg").Rolsig;
75
- scr: import("../raw_types/dosleg").Scr;
76
- ses: import("../raw_types/dosleg").Ses;
77
- stavot: import("../raw_types/dosleg").Stavot;
78
- texte: import("../raw_types/dosleg").Texte;
79
- texte_ancien: import("../raw_types/dosleg").TexteAncien;
80
- the: import("../raw_types/dosleg").The;
81
- titsen: import("../raw_types/dosleg").Titsen;
82
- typatt: import("../raw_types/dosleg").Typatt;
83
- typaut: import("../raw_types/dosleg").Typaut;
84
- typdoc: import("../raw_types/dosleg").Typdoc;
85
- typevtsea: import("../raw_types/dosleg").Typevtsea;
86
- typlec: import("../raw_types/dosleg").Typlec;
87
- typloi: import("../raw_types/dosleg").Typloi;
88
- typorg: import("../raw_types/dosleg").Typorg;
89
- typrap: import("../raw_types/dosleg").Typrap;
90
- typtxt: import("../raw_types/dosleg").Typtxt;
91
- typurl: import("../raw_types/dosleg").Typurl;
92
- votsen: import("../raw_types/dosleg").Votsen;
93
- }, "auteur", {
94
- code: string;
95
- nom: string;
96
- prenom: string | null;
97
- matricule: string | null;
4
+ declare const findAuteursQuery: SelectQueryBuilder<any, "dosleg.auteur", {
5
+ code: any;
6
+ nom: any;
7
+ prenom: any;
8
+ matricule: any;
98
9
  }>;
99
10
  export declare function findAuteurs(): Promise<{
100
- code: string;
101
- nom: string;
102
- prenom: string | null;
103
- matricule: string | null;
11
+ code: any;
12
+ nom: any;
13
+ prenom: any;
14
+ matricule: any;
104
15
  }[]>;
105
- export declare function findAuteur(auteurCode: string): Promise<{
106
- code: string;
107
- nom: string;
108
- prenom: string | null;
109
- matricule: string | null;
110
- } | undefined>;
111
16
  export type DossierLegislatifResult = InferResult<typeof findAllDossiersQuery>[0];
112
17
  export type AuteurResult = InferResult<typeof findAuteursQuery>[0];
113
18
  export {};
@@ -1,32 +1,39 @@
1
1
  import { sql } from "kysely";
2
2
  import { jsonArrayFrom } from "kysely/helpers/postgres";
3
- import { dbDosleg } from "../databases";
3
+ import { dbSenat } from "../databases";
4
4
  import { concat, removeSubstring, rtrim, toDateString } from "./util";
5
5
  function orderOrdreOrigineTexte(expr) {
6
6
  return sql `array_position(array['0','2','1'], ${expr})`;
7
7
  }
8
8
  function datesSeances(lectureAssembleeId) {
9
- return jsonArrayFrom(dbDosleg
10
- .selectFrom("date_seance")
11
- .where("date_seance.lecidt", "=", lectureAssembleeId)
9
+ return jsonArrayFrom(dbSenat
10
+ .withSchema("dosleg")
11
+ .selectFrom("dosleg.date_seance")
12
+ .where("dosleg.date_seance.lecidt", "=", lectureAssembleeId)
12
13
  .select(({ ref }) => [
13
- toDateString(ref("date_seance.date_s")).as("date"),
14
+ toDateString(ref("dosleg.date_seance.date_s")).as("date"),
14
15
  ]));
15
16
  }
16
17
  function auteursRapport(rapportId) {
17
- return jsonArrayFrom(dbDosleg
18
- .selectFrom("auteur")
19
- .leftJoin("ecr", "ecr.autcod", "auteur.autcod")
20
- .where("ecr.rapcod", "=", rapportId)
18
+ return jsonArrayFrom(dbSenat
19
+ .withSchema("dosleg")
20
+ .selectFrom("dosleg.auteur")
21
+ .leftJoin("dosleg.ecr", "dosleg.ecr.autcod", "dosleg.auteur.autcod")
22
+ .leftJoin("dosleg.rolsig", "dosleg.rolsig.signataire", "dosleg.ecr.signataire")
23
+ .where("dosleg.ecr.rapcod", "=", rapportId)
21
24
  .select([
22
- "auteur.prenom as prenom",
23
- "auteur.nomuse as nom_usuel",
24
- "auteur.autmat as matricule",
25
+ "dosleg.auteur.prenom as prenom",
26
+ "dosleg.auteur.nomuse as nom_usuel",
27
+ "dosleg.auteur.autmat as matricule",
28
+ "dosleg.ecr.ecrnumtri as ordre",
29
+ "dosleg.rolsig.rolsiglib as role",
30
+ "dosleg.ecr.ecrqua as qualite"
25
31
  ])
26
- .orderBy("ecr.ecrnumtri", "asc"));
32
+ .orderBy("dosleg.ecr.ecrnumtri", "asc"));
27
33
  }
28
34
  function rapports(lectureAssembleeId) {
29
- return jsonArrayFrom(dbDosleg
35
+ return jsonArrayFrom(dbSenat
36
+ .withSchema("dosleg")
30
37
  .selectFrom("rap")
31
38
  .leftJoin("lecassrap", "lecassrap.rapcod", "rap.rapcod")
32
39
  .leftJoin("denrap", "denrap.coddenrap", "rap.coddenrap")
@@ -54,19 +61,25 @@ function rapports(lectureAssembleeId) {
54
61
  ]));
55
62
  }
56
63
  function auteursTexte(texteId) {
57
- return jsonArrayFrom(dbDosleg
64
+ return jsonArrayFrom(dbSenat
65
+ .withSchema("dosleg")
58
66
  .selectFrom("auteur")
59
67
  .leftJoin("ecr", "ecr.autcod", "auteur.autcod")
68
+ .leftJoin("rolsig", "rolsig.signataire", "ecr.signataire")
60
69
  .where("ecr.texcod", "=", texteId)
61
70
  .select([
62
71
  "auteur.prenom as prenom",
63
72
  "auteur.nomuse as nom_usuel",
64
73
  "auteur.autmat as matricule",
74
+ "ecr.ecrnumtri as ordre",
75
+ "rolsig.rolsiglib as role",
76
+ "ecr.ecrqua as qualite"
65
77
  ])
66
78
  .orderBy("ecr.ecrnumtri", "asc"));
67
79
  }
68
80
  function textes(lectureAssembleeId) {
69
- return jsonArrayFrom(dbDosleg
81
+ return jsonArrayFrom(dbSenat
82
+ .withSchema("dosleg")
70
83
  .selectFrom("texte")
71
84
  .leftJoin("oritxt", "oritxt.oritxtcod", "texte.oritxtcod")
72
85
  .leftJoin("typtxt", "typtxt.typtxtcod", "texte.typtxtcod")
@@ -88,6 +101,9 @@ function textes(lectureAssembleeId) {
88
101
  .end()
89
102
  .as("url"),
90
103
  rtrim(ref("oritxt.oritxtlib")).as("origine"),
104
+ "oritxt.oriordre as ordre_origine",
105
+ "oritxt.oritxtado as code_adoption",
106
+ "oritxt.oritxtmod as modification",
91
107
  rtrim(ref("typtxt.typtxtlib")).as("type"),
92
108
  toDateString(ref("texte.txtoritxtdat")).as("date"),
93
109
  "sesann as session",
@@ -96,17 +112,26 @@ function textes(lectureAssembleeId) {
96
112
  .orderBy(({ ref }) => orderOrdreOrigineTexte(ref("oritxt.oriordre"))));
97
113
  }
98
114
  function lecturesAssemblee(lectureId) {
99
- return jsonArrayFrom(dbDosleg
115
+ return jsonArrayFrom(dbSenat
116
+ .withSchema("dosleg")
100
117
  .selectFrom("lecass")
101
118
  .where("lecass.lecidt", "=", lectureId)
102
119
  .leftJoin("ass", "ass.codass", "lecass.codass")
103
120
  .leftJoin("org", "org.orgcod", "lecass.orgcod")
121
+ .leftJoin("orippr", "orippr.oripprcod", "lecass.orippr")
104
122
  .select(({ ref }) => [
105
123
  rtrim(ref("ass.libass")).as("assemblee"),
106
124
  "org.orgnom as libelle_organisme",
107
125
  "org.senorgcod as code_organisme",
108
126
  "lecass.ordreass as ordre_lecture_assemblee",
109
127
  "lecass.sesann as session",
128
+ "orippr.oripprlib as origine_proposition",
129
+ "lecass.ptlnum as numero_petite_loi",
130
+ "lecass.ptlurl as url_petite_loi",
131
+ "lecass.loiintmod as loi_intitule_modifie",
132
+ "lecass.debatsurl as url_cr_debats",
133
+ toDateString(ref("lecass.lecassamecomdat")).as("date_publication_amendements_commission"),
134
+ toDateString(ref("lecass.lecassamedat")).as("date_publication_amendements_seance"),
110
135
  textes(ref("lecass.lecassidt")).as("textes"),
111
136
  rapports(ref("lecass.lecassidt")).as("rapports"),
112
137
  datesSeances(ref("lecass.lecassidt")).as("dates_seances"),
@@ -114,7 +139,8 @@ function lecturesAssemblee(lectureId) {
114
139
  .orderBy("lecass.ordreass", "asc"));
115
140
  }
116
141
  function lectures(loiId) {
117
- return jsonArrayFrom(dbDosleg
142
+ return jsonArrayFrom(dbSenat
143
+ .withSchema("dosleg")
118
144
  .selectFrom("lecture")
119
145
  .leftJoin("typlec", "typlec.typleccod", "lecture.typleccod")
120
146
  .where("lecture.loicod", "=", loiId)
@@ -127,7 +153,8 @@ function lectures(loiId) {
127
153
  .orderBy("typlec.typlecord", "asc"));
128
154
  }
129
155
  function themes(loiId) {
130
- return jsonArrayFrom(dbDosleg
156
+ return jsonArrayFrom(dbSenat
157
+ .withSchema("dosleg")
131
158
  .selectFrom("the")
132
159
  .leftJoin("loithe", "loithe.thecle", "the.thecle")
133
160
  .where("loithe.loicod", "=", loiId)
@@ -135,66 +162,43 @@ function themes(loiId) {
135
162
  "the.thelib as libelle",
136
163
  ]));
137
164
  }
138
- function votes(scrutinNum) {
139
- return jsonArrayFrom(dbDosleg
140
- .selectFrom("votsen")
141
- .leftJoin("titsen", "titsen.titsencod", "votsen.titsencod")
142
- .leftJoin("stavot", "stavot.stavotidt", "votsen.stavotidt")
143
- .leftJoin("posvot", "posvot.posvotcod", "votsen.posvotcod")
144
- .where("votsen.scrnum", "=", scrutinNum)
145
- .select([
146
- "votsen.senmat as matricule_votant",
147
- "votsen.senmatdel as matricule_delegant",
148
- "posvot.posvotlib as position",
149
- "stavot.stavotlib as statut_votant",
150
- "titsen.titsenlib as titre_votant",
151
- ]));
152
- }
153
- const findAllScrutinsQuery = dbDosleg
154
- .selectFrom("scr")
155
- .leftJoin("date_seance", "scr.code", "date_seance.code")
156
- .leftJoin("lecture", "date_seance.lecidt", "lecture.lecidt")
157
- .select(({ eb, ref, val }) => [
158
- "scr.sesann as session",
159
- "scr.scrnum as numero",
160
- "date_seance.lecidt as lecture_id",
161
- toDateString(ref("scr.scrdat")).as("date_scrutin"),
162
- toDateString(ref("scr.scrdateff")).as("date_scrutin_effective"),
163
- "scr.scrint as intitule",
164
- "scr.scrbaspag as note",
165
- "scr.scrmaj as nombre_majorite",
166
- "scr.scrmajsea as nombre_majorite_seance",
167
- "scr.scrvot as nombre_votants",
168
- "scr.scrvotsea as nombre_votants_seance",
169
- "scr.scrsuf as nombre_suffrages",
170
- "scr.scrsufsea as nombre_suffrages_seance",
171
- "scr.scrcon as nombre_contre",
172
- "scr.scrconsea as nombre_contre_seance",
173
- "scr.scrpou as nombre_pour",
174
- "scr.scrpousea as nombre_pour_seance",
175
- votes(ref("scr.scrnum")).as("votes"),
176
- ])
177
- .$narrowType();
178
- const findAllDossiersQuery = dbDosleg
165
+ const findAllDossiersQuery = dbSenat
166
+ .withSchema("dosleg")
179
167
  .selectFrom("loi")
180
168
  .leftJoin("typloi", "typloi.typloicod", "loi.typloicod")
181
169
  .leftJoin("etaloi", "etaloi.etaloicod", "loi.etaloicod")
170
+ .leftJoin("deccoc", "deccoc.deccoccod", "loi.deccoccod")
182
171
  .select(({ eb, ref, val }) => [
172
+ rtrim(ref("loi.loicod")).as("code"),
173
+ "loi.numero as numero",
183
174
  "loi.signet as signet",
184
- concat(val("https://www.senat.fr/dossier-legislatif/"), ref("loi.signet"), val(".html")).as("url"),
185
- concat(rtrim(ref("typloi.typloiden")), val(" "), rtrim(ref("loi.loitit"))).as("titre"),
175
+ sql `NULLIF(regexp_replace(loi.url_an, '^.*\\/(DL[^\\/]+)\\.asp$', '\\1'), '')`.as("code_dossier_an"),
176
+ "loi.signetalt as signet_alternatif",
177
+ rtrim(ref("loi.motclef")).as("mot_cle"),
186
178
  rtrim(ref("loi.loient")).as("titre_court"),
179
+ concat(rtrim(ref("typloi.typloiden")), val(" "), rtrim(ref("loi.loitit"))).as("titre"),
180
+ concat(rtrim(ref("typloi.typloiden")), val(" "), rtrim(ref("loi.loiint"))).as("titre_long"),
181
+ concat(rtrim(ref("typloi.typloiden")), val(" "), rtrim(ref("loi.loiintori"))).as("titre_long_original"),
182
+ concat(val("https://www.senat.fr/dossier-legislatif/"), ref("loi.signet"), val(".html")).as("url"),
183
+ "loi.urgence as urgence",
187
184
  rtrim(ref("typloi.groupe")).as("code_nature_dossier"),
188
185
  rtrim(ref("typloi.typloilib")).as("libelle_type_dossier"),
189
186
  rtrim(ref("etaloi.etaloilib")).as("etat_dossier"),
190
187
  "loi.url_an as url_dossier_assemblee_nationale",
188
+ "loi.url_presart as url_presentation_articles",
189
+ "loi.url_ordonnance as url_ordonnance",
190
+ "loi.orgcod as code_organisme_resolution",
191
+ "deccoc.deccoclib as libelle_decision_CoC",
191
192
  toDateString(ref("loi.date_decision")).as("date_decision_CoC"),
192
193
  "loi.num_decision as num_decision_CoC",
193
194
  "loi.deccocurl as url_decision_CoC",
195
+ "loi.doscocurl as url_dossier_CoC",
194
196
  toDateString(ref("loi.saisine_date")).as("date_saisine_CoC"),
195
197
  "loi.saisine_par as condition_saisine_CoC",
198
+ toDateString(ref("loi.proaccdat")).as("date_procedure_acceleree"),
199
+ toDateString(ref("loi.proaccoppdat")).as("date_opposition_procedure_acceleree"),
200
+ toDateString(ref("loi.retproaccdat")).as("date_retrait_procedure_acceleree"),
196
201
  toDateString(ref("loi.date_loi")).as("date_promulgation"),
197
- "loi.numero as numero_loi",
198
202
  eb
199
203
  .case()
200
204
  .when("loi.loititjo", "is not", null)
@@ -205,6 +209,12 @@ const findAllDossiersQuery = dbDosleg
205
209
  toDateString(ref("loi.loidatjo")).as("date_publication_JO"),
206
210
  "loi.loinumjo as numero_JO",
207
211
  "loi.url_jo as url_JO",
212
+ toDateString(ref("loi.loidatjo2")).as("date_publication_JO_correctif_1"),
213
+ "loi.loinumjo2 as numero_JO_correctif_1",
214
+ "loi.url_jo2 as url_JO_correctif_1",
215
+ toDateString(ref("loi.loidatjo3")).as("date_publication_JO_correctif_2"),
216
+ "loi.loinumjo3 as numero_JO_correctif_2",
217
+ "loi.url_jo3 as url_JO_correctif_2",
208
218
  lectures(ref("loi.loicod")).as("lectures"),
209
219
  themes(ref("loi.loicod")).as("themes"),
210
220
  ])
@@ -212,46 +222,9 @@ const findAllDossiersQuery = dbDosleg
212
222
  export function findAllDossiers() {
213
223
  return findAllDossiersQuery.stream();
214
224
  }
215
- export function findAllScrutins() {
216
- return findAllScrutinsQuery.stream();
217
- }
218
- export function findSenatTexteUrls(sessions = []) {
219
- const sessionsList = sessions.map(session => session);
220
- return dbDosleg
221
- .selectFrom("texte")
222
- .where("texurl", "is not", null)
223
- .where("typurl", "=", "I")
224
- .$if(sessionsList.length > 0, (qb) => qb.where("sesann", "in", sessionsList))
225
- .select(({ eb, ref }) => [
226
- "sesann as session",
227
- rtrim(ref("texurl")).as("url"),
228
- eb
229
- .case()
230
- .when("oritxtcod", "=", "1")
231
- .then(true)
232
- .else(false)
233
- .end()
234
- .as("hasExposeDesMotifs"),
235
- ])
236
- .$narrowType()
237
- .stream();
238
- }
239
- export function findSenatRapportUrls(sessions = []) {
240
- const sessionsList = sessions.map(session => session);
241
- return dbDosleg
242
- .selectFrom("rap")
243
- .where("rapurl", "is not", null)
244
- .where("typurl", "=", "I")
245
- .$if(sessionsList.length > 0, (qb) => qb.where("sesann", "in", sessionsList))
246
- .select(({ ref }) => [
247
- "sesann as session",
248
- rtrim(ref("rapurl")).as("url"),
249
- ])
250
- .$narrowType()
251
- .stream();
252
- }
253
- const findAuteursQuery = dbDosleg
254
- .selectFrom("auteur")
225
+ const findAuteursQuery = dbSenat
226
+ .withSchema("dosleg")
227
+ .selectFrom("dosleg.auteur")
255
228
  .select([
256
229
  "autcod as code",
257
230
  "nomuse as nom",
@@ -262,8 +235,3 @@ export async function findAuteurs() {
262
235
  return findAuteursQuery
263
236
  .execute();
264
237
  }
265
- export async function findAuteur(auteurCode) {
266
- return findAuteursQuery
267
- .where("autcod", "=", auteurCode)
268
- .executeTakeFirst();
269
- }
@@ -1,5 +1,7 @@
1
- export { findAll as findAllAmendements } from "./ameli";
1
+ export { findAllAmendements } from "./ameli";
2
2
  export { findAll as findAllDebats } from "./debats";
3
- export { findAllDossiers, findAllScrutins, findAuteur, findAuteurs, findSenatRapportUrls, findSenatTexteUrls, } from "./dosleg";
3
+ export { findAllDossiers, findAuteurs, } from "./dosleg";
4
+ export { findSenatTexteUrls, findSenatRapportUrls } from "./documents";
5
+ export { findAllScrutins } from "./scrutins";
4
6
  export { findAll as findAllQuestions } from "./questions";
5
7
  export { findAll as findAllSens, findAllCirconscriptions, findAllOrganismes, } from "./sens";
@@ -1,5 +1,7 @@
1
- export { findAll as findAllAmendements } from "./ameli";
1
+ export { findAllAmendements } from "./ameli";
2
2
  export { findAll as findAllDebats } from "./debats";
3
- export { findAllDossiers, findAllScrutins, findAuteur, findAuteurs, findSenatRapportUrls, findSenatTexteUrls, } from "./dosleg";
3
+ export { findAllDossiers, findAuteurs, } from "./dosleg";
4
+ export { findSenatTexteUrls, findSenatRapportUrls } from "./documents";
5
+ export { findAllScrutins } from "./scrutins";
4
6
  export { findAll as findAllQuestions } from "./questions";
5
7
  export { findAll as findAllSens, findAllCirconscriptions, findAllOrganismes, } from "./sens";