@tricoteuses/senat 2.9.7 → 2.9.9
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.
- package/LICENSE.md +22 -22
- package/README.md +116 -116
- package/lib/databases.d.ts +26 -10
- package/lib/loaders.d.ts +5 -4
- package/lib/loaders.js +5 -4
- package/lib/model/ameli.d.ts +44 -22
- package/lib/model/ameli.js +11 -0
- package/lib/model/debats.d.ts +18 -9
- package/lib/model/dosleg.d.ts +48 -152
- package/lib/model/dosleg.js +50 -7
- package/lib/model/index.d.ts +1 -1
- package/lib/model/index.js +1 -1
- package/lib/model/questions.d.ts +6 -6
- package/lib/model/sens.d.ts +41 -41
- package/lib/raw_types/ameli.d.ts +1521 -778
- package/lib/raw_types/ameli.js +345 -5
- package/lib/raw_types/debats.d.ts +306 -163
- package/lib/raw_types/debats.js +84 -5
- package/lib/raw_types/dosleg.d.ts +2297 -1353
- package/lib/raw_types/dosleg.js +550 -5
- package/lib/raw_types/kysely-table-types.d.ts +5 -0
- package/lib/raw_types/kysely-table-types.js +1 -0
- package/lib/raw_types/questions.d.ts +519 -374
- package/lib/raw_types/questions.js +84 -5
- package/lib/raw_types/sens.d.ts +12562 -6720
- package/lib/raw_types/sens.js +2944 -5
- package/lib/raw_types_schemats/ameli.d.ts +1 -1
- package/lib/raw_types_schemats/debats.d.ts +1 -1
- package/lib/raw_types_schemats/dosleg.d.ts +1 -1
- package/lib/raw_types_schemats/questions.d.ts +1 -1
- package/lib/raw_types_schemats/sens.d.ts +1 -1
- package/lib/scripts/convert_data.js +29 -7
- package/lib/scripts/retrieve_open_data.js +1 -2
- package/package.json +97 -96
- package/lib/validators/senat.d.ts +0 -0
- package/lib/validators/senat.js +0 -24
package/LICENSE.md
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
# Tricoteuses-Senat
|
|
2
|
-
|
|
3
|
-
## _Handle French Sénat's open data_
|
|
4
|
-
|
|
5
|
-
By: Emmanuel Raviart <mailto:emmanuel@raviart.com>
|
|
6
|
-
|
|
7
|
-
Copyright (C) 2019, 2020, 2021 Emmanuel Raviart
|
|
8
|
-
|
|
9
|
-
https://git.tricoteuses.fr/logiciels/tricoteuses-senat
|
|
10
|
-
|
|
11
|
-
> Tricoteuses-Senat is free software; you can redistribute it and/or modify
|
|
12
|
-
> it under the terms of the GNU Affero General Public License as
|
|
13
|
-
> published by the Free Software Foundation, either version 3 of the
|
|
14
|
-
> License, or (at your option) any later version.
|
|
15
|
-
>
|
|
16
|
-
> Tricoteuses-Senat is distributed in the hope that it will be useful,
|
|
17
|
-
> but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18
|
-
> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
19
|
-
> GNU Affero General Public License for more details.
|
|
20
|
-
>
|
|
21
|
-
> You should have received a copy of the GNU Affero General Public License
|
|
22
|
-
> along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
1
|
+
# Tricoteuses-Senat
|
|
2
|
+
|
|
3
|
+
## _Handle French Sénat's open data_
|
|
4
|
+
|
|
5
|
+
By: Emmanuel Raviart <mailto:emmanuel@raviart.com>
|
|
6
|
+
|
|
7
|
+
Copyright (C) 2019, 2020, 2021 Emmanuel Raviart
|
|
8
|
+
|
|
9
|
+
https://git.tricoteuses.fr/logiciels/tricoteuses-senat
|
|
10
|
+
|
|
11
|
+
> Tricoteuses-Senat is free software; you can redistribute it and/or modify
|
|
12
|
+
> it under the terms of the GNU Affero General Public License as
|
|
13
|
+
> published by the Free Software Foundation, either version 3 of the
|
|
14
|
+
> License, or (at your option) any later version.
|
|
15
|
+
>
|
|
16
|
+
> Tricoteuses-Senat is distributed in the hope that it will be useful,
|
|
17
|
+
> but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18
|
+
> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
19
|
+
> GNU Affero General Public License for more details.
|
|
20
|
+
>
|
|
21
|
+
> You should have received a copy of the GNU Affero General Public License
|
|
22
|
+
> along with this program. If not, see <http://www.gnu.org/licenses/>.
|
package/README.md
CHANGED
|
@@ -1,116 +1,116 @@
|
|
|
1
|
-
# Tricoteuses-Senat
|
|
2
|
-
|
|
3
|
-
## _Retrieve, clean up & handle French Sénat's open data_
|
|
4
|
-
|
|
5
|
-
## Requirements
|
|
6
|
-
|
|
7
|
-
- Node >= 22
|
|
8
|
-
|
|
9
|
-
## Installation
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
git clone https://git.tricoteuses.fr/logiciels/tricoteuses-senat
|
|
13
|
-
cd tricoteuses-senat/
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
Create a `.env` file to set PostgreSQL database informations and other configuration variables (you can use `example.env` as a template). Then
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
npm install
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
### Database creation (not needed if downloading with Docker image)
|
|
23
|
-
|
|
24
|
-
#### Using Docker
|
|
25
|
-
|
|
26
|
-
```bash
|
|
27
|
-
docker run --name local-postgres -d -p 5432:5432 -e POSTGRES_PASSWORD=$YOUR_CUSTOM_DB_PASSWORD postgres
|
|
28
|
-
# Default Postgres user is postgres
|
|
29
|
-
# But scripts require an "opendata" role
|
|
30
|
-
docker exec -it local-postgres psql -U postgres -c "CREATE ROLE opendata;"
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
## Download data
|
|
34
|
-
|
|
35
|
-
Create a folder where the data will be downloaded and run the following command to download the data and convert it into JSON files.
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
mkdir ../senat-data/
|
|
39
|
-
|
|
40
|
-
# Available options for optional `categories` parameter : All, Ameli, Debats, DosLeg, Questions, Sens
|
|
41
|
-
npm run data:download ../senat-data -- [--categories All]
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
Data from other sources is also available :
|
|
45
|
-
```bash
|
|
46
|
-
# Retrieval of textes and rapports from Sénat's website
|
|
47
|
-
# Available options for optional `formats` parameter : xml, html, pdf
|
|
48
|
-
# Available options for optional `types` parameter : textes, rapports
|
|
49
|
-
npm run data:retrieve_documents ../senat-data -- --fromSession 2022 [--formats xml pdf] [--types textes]
|
|
50
|
-
|
|
51
|
-
# Retrieval & parsing (textes in xml format only for now)
|
|
52
|
-
npm run data:retrieve_documents ../senat-data -- --fromSession 2022 --parseDocuments
|
|
53
|
-
|
|
54
|
-
# Parsing only
|
|
55
|
-
npm run data:parse_textes_lois ../senat-data
|
|
56
|
-
|
|
57
|
-
# Retrieval (& parsing) of agenda from Sénat's website
|
|
58
|
-
npm run data:retrieve_agenda ../senat-data -- --fromSession 2022 [--parseAgenda]
|
|
59
|
-
|
|
60
|
-
# Retrieval (& parsing) of comptes-rendus des débats from Sénat's website
|
|
61
|
-
npm run data:retrieve_comptes_rendus ../senat-data -- [--parseDebats]
|
|
62
|
-
|
|
63
|
-
# Retrieval of sénateurs' pictures from Sénat's website
|
|
64
|
-
npm run data:retrieve_senateurs_photos ../senat-data
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
## Data download using Docker
|
|
68
|
-
|
|
69
|
-
A Docker image that downloads and converts the data all at once is available. Build it locally or run it from the container registry.
|
|
70
|
-
Use the environment variables `FROM_SESSION` and `CATEGORIES` if needed.
|
|
71
|
-
|
|
72
|
-
```bash
|
|
73
|
-
docker run --pull always --name tricoteuses-senat -v ../senat-data:/app/senat-data -d git.tricoteuses.fr/logiciels/tricoteuses-senat:latest
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
Use the environment variable `CATEGORIES` and `FROM_SESSION` if needed.
|
|
77
|
-
|
|
78
|
-
## Using the data
|
|
79
|
-
|
|
80
|
-
Once the data is downloaded, you can use loaders to retrieve it.
|
|
81
|
-
To use loaders in your project, you can install the _@tricoteuses/senat_ package, and import the iterator functions that you need.
|
|
82
|
-
|
|
83
|
-
```bash
|
|
84
|
-
npm install @tricoteuses/senat
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
```js
|
|
88
|
-
import { iterLoadSenatQuestions } from "@tricoteuses/senat/loaders"
|
|
89
|
-
|
|
90
|
-
// Pass data directory and legislature as arguments
|
|
91
|
-
for (const { item: question } of iterLoadSenatQuestions("../senat-data", 17)) {
|
|
92
|
-
console.log(question.id)
|
|
93
|
-
}
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
## Generation of raw types from SQL schema (for contributors only)
|
|
97
|
-
|
|
98
|
-
```bash
|
|
99
|
-
npm run data:generate_schemas ../senat-data
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
## Publishing
|
|
103
|
-
|
|
104
|
-
To publish a new version of this package onto npm, bump the package version and publish.
|
|
105
|
-
|
|
106
|
-
```bash
|
|
107
|
-
npm version x.y.z # Bumps version in package.json and creates a new tag x.y.z
|
|
108
|
-
npx tsc
|
|
109
|
-
npm publish
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
The Docker image will be automatically built during a CI Workflow if you push the tag to the remote repository.
|
|
113
|
-
|
|
114
|
-
```bash
|
|
115
|
-
git push --tags
|
|
116
|
-
```
|
|
1
|
+
# Tricoteuses-Senat
|
|
2
|
+
|
|
3
|
+
## _Retrieve, clean up & handle French Sénat's open data_
|
|
4
|
+
|
|
5
|
+
## Requirements
|
|
6
|
+
|
|
7
|
+
- Node >= 22
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
git clone https://git.tricoteuses.fr/logiciels/tricoteuses-senat
|
|
13
|
+
cd tricoteuses-senat/
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Create a `.env` file to set PostgreSQL database informations and other configuration variables (you can use `example.env` as a template). Then
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm install
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### Database creation (not needed if downloading with Docker image)
|
|
23
|
+
|
|
24
|
+
#### Using Docker
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
docker run --name local-postgres -d -p 5432:5432 -e POSTGRES_PASSWORD=$YOUR_CUSTOM_DB_PASSWORD postgres
|
|
28
|
+
# Default Postgres user is postgres
|
|
29
|
+
# But scripts require an "opendata" role
|
|
30
|
+
docker exec -it local-postgres psql -U postgres -c "CREATE ROLE opendata;"
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Download data
|
|
34
|
+
|
|
35
|
+
Create a folder where the data will be downloaded and run the following command to download the data and convert it into JSON files.
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
mkdir ../senat-data/
|
|
39
|
+
|
|
40
|
+
# Available options for optional `categories` parameter : All, Ameli, Debats, DosLeg, Questions, Sens
|
|
41
|
+
npm run data:download ../senat-data -- [--categories All]
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Data from other sources is also available :
|
|
45
|
+
```bash
|
|
46
|
+
# Retrieval of textes and rapports from Sénat's website
|
|
47
|
+
# Available options for optional `formats` parameter : xml, html, pdf
|
|
48
|
+
# Available options for optional `types` parameter : textes, rapports
|
|
49
|
+
npm run data:retrieve_documents ../senat-data -- --fromSession 2022 [--formats xml pdf] [--types textes]
|
|
50
|
+
|
|
51
|
+
# Retrieval & parsing (textes in xml format only for now)
|
|
52
|
+
npm run data:retrieve_documents ../senat-data -- --fromSession 2022 --parseDocuments
|
|
53
|
+
|
|
54
|
+
# Parsing only
|
|
55
|
+
npm run data:parse_textes_lois ../senat-data
|
|
56
|
+
|
|
57
|
+
# Retrieval (& parsing) of agenda from Sénat's website
|
|
58
|
+
npm run data:retrieve_agenda ../senat-data -- --fromSession 2022 [--parseAgenda]
|
|
59
|
+
|
|
60
|
+
# Retrieval (& parsing) of comptes-rendus des débats from Sénat's website
|
|
61
|
+
npm run data:retrieve_comptes_rendus ../senat-data -- [--parseDebats]
|
|
62
|
+
|
|
63
|
+
# Retrieval of sénateurs' pictures from Sénat's website
|
|
64
|
+
npm run data:retrieve_senateurs_photos ../senat-data
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Data download using Docker
|
|
68
|
+
|
|
69
|
+
A Docker image that downloads and converts the data all at once is available. Build it locally or run it from the container registry.
|
|
70
|
+
Use the environment variables `FROM_SESSION` and `CATEGORIES` if needed.
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
docker run --pull always --name tricoteuses-senat -v ../senat-data:/app/senat-data -d git.tricoteuses.fr/logiciels/tricoteuses-senat:latest
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Use the environment variable `CATEGORIES` and `FROM_SESSION` if needed.
|
|
77
|
+
|
|
78
|
+
## Using the data
|
|
79
|
+
|
|
80
|
+
Once the data is downloaded, you can use loaders to retrieve it.
|
|
81
|
+
To use loaders in your project, you can install the _@tricoteuses/senat_ package, and import the iterator functions that you need.
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
npm install @tricoteuses/senat
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
```js
|
|
88
|
+
import { iterLoadSenatQuestions } from "@tricoteuses/senat/loaders"
|
|
89
|
+
|
|
90
|
+
// Pass data directory and legislature as arguments
|
|
91
|
+
for (const { item: question } of iterLoadSenatQuestions("../senat-data", 17)) {
|
|
92
|
+
console.log(question.id)
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Generation of raw types from SQL schema (for contributors only)
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
npm run data:generate_schemas ../senat-data
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Publishing
|
|
103
|
+
|
|
104
|
+
To publish a new version of this package onto npm, bump the package version and publish.
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
npm version x.y.z # Bumps version in package.json and creates a new tag x.y.z
|
|
108
|
+
npx tsc
|
|
109
|
+
npm publish
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
The Docker image will be automatically built during a CI Workflow if you push the tag to the remote repository.
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
git push --tags
|
|
116
|
+
```
|
package/lib/databases.d.ts
CHANGED
|
@@ -1,11 +1,27 @@
|
|
|
1
1
|
import { Kysely } from "kysely";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
import { TableTypes as AmeliTableTypes } from "./raw_types/ameli";
|
|
3
|
+
import { TableTypes as DebatsTableTypes } from "./raw_types/debats";
|
|
4
|
+
import { TableTypes as DoslegTableTypes } from "./raw_types/dosleg";
|
|
5
|
+
import { TableTypes as QuestionsTableTypes } from "./raw_types/questions";
|
|
6
|
+
import { TableTypes as SensTableTypes } from "./raw_types/sens";
|
|
7
|
+
type AmeliDb = {
|
|
8
|
+
[K in keyof AmeliTableTypes]: AmeliTableTypes[K]["select"];
|
|
9
|
+
};
|
|
10
|
+
type DebatsDb = {
|
|
11
|
+
[K in keyof DebatsTableTypes]: DebatsTableTypes[K]["select"];
|
|
12
|
+
};
|
|
13
|
+
type DoslegDb = {
|
|
14
|
+
[K in keyof DoslegTableTypes]: DoslegTableTypes[K]["select"];
|
|
15
|
+
};
|
|
16
|
+
type QuestionsDb = {
|
|
17
|
+
[K in keyof QuestionsTableTypes]: QuestionsTableTypes[K]["select"];
|
|
18
|
+
};
|
|
19
|
+
type SensDb = {
|
|
20
|
+
[K in keyof SensTableTypes]: SensTableTypes[K]["select"];
|
|
21
|
+
};
|
|
22
|
+
export declare const dbAmeli: Kysely<AmeliDb>;
|
|
23
|
+
export declare const dbDebats: Kysely<DebatsDb>;
|
|
24
|
+
export declare const dbDosleg: Kysely<DoslegDb>;
|
|
25
|
+
export declare const dbQuestions: Kysely<QuestionsDb>;
|
|
26
|
+
export declare const dbSens: Kysely<SensDb>;
|
|
27
|
+
export {};
|
package/lib/loaders.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export { EnabledDatasets } from "./datasets";
|
|
|
10
10
|
export declare const AGENDA_FOLDER = "agenda";
|
|
11
11
|
export declare const COMPTES_RENDUS_FOLDER = "seances";
|
|
12
12
|
export declare const DOSLEG_DOSSIERS_FOLDER = "dossiers";
|
|
13
|
+
export declare const SCRUTINS_FOLDER = "scrutins";
|
|
13
14
|
export declare const RAPPORT_FOLDER = "rap";
|
|
14
15
|
export declare const SENS_CIRCONSCRIPTIONS_FOLDER = "circonscriptions";
|
|
15
16
|
export declare const SENS_ORGANISMES_FOLDER = "organismes";
|
|
@@ -25,7 +26,7 @@ export type IterItem<T> = {
|
|
|
25
26
|
};
|
|
26
27
|
export interface TexteMetadata {
|
|
27
28
|
name: string;
|
|
28
|
-
session:
|
|
29
|
+
session: number | null | undefined;
|
|
29
30
|
url_expose_des_motifs?: URL;
|
|
30
31
|
url_xml: URL;
|
|
31
32
|
url_html: URL;
|
|
@@ -33,7 +34,7 @@ export interface TexteMetadata {
|
|
|
33
34
|
}
|
|
34
35
|
export interface RapportMetadata {
|
|
35
36
|
name: string;
|
|
36
|
-
session:
|
|
37
|
+
session: number | null | undefined;
|
|
37
38
|
url_html: URL;
|
|
38
39
|
url_pdf: URL;
|
|
39
40
|
}
|
|
@@ -44,13 +45,13 @@ export interface DossierLegislatifDocumentResult {
|
|
|
44
45
|
type_lecture: string;
|
|
45
46
|
libelle_lecture: string;
|
|
46
47
|
libelle_organisme: string | null;
|
|
47
|
-
numero:
|
|
48
|
+
numero: number | null;
|
|
48
49
|
id: string | null;
|
|
49
50
|
url: string;
|
|
50
51
|
origine?: string | null | undefined;
|
|
51
52
|
type: string;
|
|
52
53
|
date: string;
|
|
53
|
-
session:
|
|
54
|
+
session: number | null;
|
|
54
55
|
auteurs: {
|
|
55
56
|
prenom: string | null;
|
|
56
57
|
nom_usuel: string;
|
package/lib/loaders.js
CHANGED
|
@@ -6,6 +6,7 @@ export { EnabledDatasets } from "./datasets";
|
|
|
6
6
|
export const AGENDA_FOLDER = "agenda";
|
|
7
7
|
export const COMPTES_RENDUS_FOLDER = "seances";
|
|
8
8
|
export const DOSLEG_DOSSIERS_FOLDER = "dossiers";
|
|
9
|
+
export const SCRUTINS_FOLDER = "scrutins";
|
|
9
10
|
export const RAPPORT_FOLDER = "rap";
|
|
10
11
|
export const SENS_CIRCONSCRIPTIONS_FOLDER = "circonscriptions";
|
|
11
12
|
export const SENS_ORGANISMES_FOLDER = "organismes";
|
|
@@ -98,14 +99,14 @@ export function* iterLoadSenatDossiersLegislatifsTexteUrls(dataDir, session) {
|
|
|
98
99
|
}
|
|
99
100
|
export function* iterLoadSenatDossiersLegislatifsDocuments(dataDir, session, documentType, options = {}) {
|
|
100
101
|
for (const { item: dossierLegislatif } of iterLoadSenatDossiersLegislatifs(dataDir, session, options)) {
|
|
101
|
-
for (const lecture of dossierLegislatif
|
|
102
|
+
for (const lecture of dossierLegislatif["lectures"]) {
|
|
102
103
|
const lecturesSenat = lecture.lectures_assemblee.filter((lectureAssemblee) => lectureAssemblee.assemblee === "Sénat");
|
|
103
104
|
for (const lectureSenat of lecturesSenat) {
|
|
104
105
|
for (const document of lectureSenat[documentType]) {
|
|
105
106
|
const enrichedDocument = {
|
|
106
|
-
signet_dossier: dossierLegislatif
|
|
107
|
-
url_dossier_senat: dossierLegislatif
|
|
108
|
-
url_dossier_assemblee_nationale: dossierLegislatif
|
|
107
|
+
signet_dossier: dossierLegislatif["signet"],
|
|
108
|
+
url_dossier_senat: dossierLegislatif["url"],
|
|
109
|
+
url_dossier_assemblee_nationale: dossierLegislatif["url_dossier_assemblee_nationale"],
|
|
109
110
|
type_lecture: lecture.type_lecture,
|
|
110
111
|
libelle_lecture: lecture.libelle,
|
|
111
112
|
libelle_organisme: lectureSenat.libelle_organisme,
|
package/lib/model/ameli.d.ts
CHANGED
|
@@ -2,101 +2,123 @@ import { InferResult } from "kysely";
|
|
|
2
2
|
export type AmendementResult = InferResult<typeof findAllQuery>[0];
|
|
3
3
|
declare const findAllQuery: import("kysely").SelectQueryBuilder<{
|
|
4
4
|
amd: import("../raw_types/ameli").Amd;
|
|
5
|
-
|
|
5
|
+
mot: import("../raw_types/ameli").Mot;
|
|
6
|
+
sub: import("kysely").Nullable<import("../raw_types/ameli").Sub>;
|
|
7
|
+
ent: import("../raw_types/ameli").Ent;
|
|
8
|
+
sor: import("kysely").Nullable<import("../raw_types/ameli").Sor>;
|
|
6
9
|
avicom: import("kysely").Nullable<import("../raw_types/ameli").Avicom>;
|
|
7
10
|
avigvt: import("kysely").Nullable<import("../raw_types/ameli").Avigvt>;
|
|
11
|
+
irr: import("kysely").Nullable<import("../raw_types/ameli").Irr>;
|
|
12
|
+
txt_ameli: import("kysely").Nullable<import("../raw_types/ameli").TxtAmeli>;
|
|
13
|
+
typrect: import("../raw_types/ameli").Typrect;
|
|
14
|
+
amdsen: import("../raw_types/ameli").Amdsen;
|
|
15
|
+
sen_ameli: import("../raw_types/ameli").SenAmeli;
|
|
16
|
+
grppol_ameli: import("kysely").Nullable<import("../raw_types/ameli").GrppolAmeli>;
|
|
8
17
|
cab: import("kysely").Nullable<import("../raw_types/ameli").Cab>;
|
|
9
18
|
com_ameli: import("kysely").Nullable<import("../raw_types/ameli").ComAmeli>;
|
|
10
|
-
ent: import("../raw_types/ameli").Ent;
|
|
11
19
|
etatxt: import("../raw_types/ameli").Etatxt;
|
|
12
20
|
fbu: import("../raw_types/ameli").Fbu;
|
|
13
|
-
|
|
21
|
+
ses: import("kysely").Nullable<import("../raw_types/ameli").Ses>;
|
|
14
22
|
gvt: import("../raw_types/ameli").Gvt;
|
|
15
23
|
intora: import("../raw_types/ameli").Intora;
|
|
16
|
-
|
|
24
|
+
sea: import("../raw_types/ameli").Sea;
|
|
25
|
+
orarol: import("../raw_types/ameli").Orarol;
|
|
17
26
|
lec_ameli: import("kysely").Nullable<import("../raw_types/ameli").LecAmeli>;
|
|
18
|
-
mot: import("../raw_types/ameli").Mot;
|
|
19
27
|
nat: import("kysely").Nullable<import("../raw_types/ameli").Nat>;
|
|
20
|
-
orarol: import("../raw_types/ameli").Orarol;
|
|
21
28
|
sai: import("../raw_types/ameli").Sai;
|
|
22
29
|
saisen: import("../raw_types/ameli").Saisen;
|
|
23
|
-
sea: import("../raw_types/ameli").Sea;
|
|
24
|
-
sen_ameli: import("../raw_types/ameli").SenAmeli;
|
|
25
|
-
ses: import("kysely").Nullable<import("../raw_types/ameli").Ses>;
|
|
26
|
-
sor: import("kysely").Nullable<import("../raw_types/ameli").Sor>;
|
|
27
|
-
sub: import("kysely").Nullable<import("../raw_types/ameli").Sub>;
|
|
28
|
-
txt_ameli: import("kysely").Nullable<import("../raw_types/ameli").TxtAmeli>;
|
|
29
|
-
typrect: import("../raw_types/ameli").Typrect;
|
|
30
30
|
typses: import("../raw_types/ameli").Typses;
|
|
31
31
|
typsub: import("kysely").Nullable<import("../raw_types/ameli").Typsub>;
|
|
32
32
|
w_nivrec: import("../raw_types/ameli").WNivrec;
|
|
33
|
-
}, "amd" | "
|
|
34
|
-
session:
|
|
33
|
+
}, "amd" | "sub" | "sor" | "avicom" | "avigvt" | "irr" | "txt_ameli" | "grppol_ameli" | "cab" | "com_ameli" | "ses" | "lec_ameli" | "nat" | "typsub", {
|
|
34
|
+
session: number | null;
|
|
35
35
|
signet_dossier_legislatif: string | null;
|
|
36
36
|
nature_texte: string | null;
|
|
37
37
|
numero_texte: number | null;
|
|
38
|
+
numero_adoption_texte: number | null;
|
|
38
39
|
intitule_texte: string | null;
|
|
39
40
|
lecture: string | null;
|
|
40
41
|
nature: string;
|
|
41
42
|
id: number;
|
|
42
43
|
parent_id: number | null;
|
|
44
|
+
rendu_similaire_id: number | null;
|
|
45
|
+
identique_id: number | null;
|
|
43
46
|
numero: string | null;
|
|
44
|
-
numero_absolu:
|
|
45
|
-
ordre:
|
|
47
|
+
numero_absolu: number | null;
|
|
48
|
+
ordre: number | null;
|
|
49
|
+
accepte_gouvernement: string | null;
|
|
46
50
|
subdivision_libelle: string | null;
|
|
47
51
|
subdivision_libelle_court: string | null;
|
|
48
52
|
subdivision_type: string | null;
|
|
49
53
|
alinea: number | null;
|
|
54
|
+
commentaire_probleme: string | null;
|
|
55
|
+
observations: string | null;
|
|
56
|
+
observations_additionnelles: string | null;
|
|
50
57
|
date_depot: string;
|
|
51
58
|
dispositif: string | null;
|
|
59
|
+
discussion_commune_id: number | null;
|
|
52
60
|
objet: string | null;
|
|
53
61
|
etat: string;
|
|
54
62
|
avis_commission: string | null;
|
|
55
63
|
avis_gouvernement: string | null;
|
|
56
64
|
sort: string | null;
|
|
57
|
-
revision:
|
|
65
|
+
revision: number;
|
|
58
66
|
url: string;
|
|
59
67
|
au_nom_de_groupe_politique: string | null;
|
|
60
68
|
au_nom_de_commission: string | null;
|
|
61
69
|
auteur_est_gouvernement: boolean;
|
|
62
70
|
auteurs: {
|
|
63
71
|
prenom: string | null;
|
|
72
|
+
homonyme: string | null;
|
|
64
73
|
nom: string | null;
|
|
74
|
+
qualite: string | null;
|
|
75
|
+
rang: number | null;
|
|
65
76
|
matricule: string | null;
|
|
66
77
|
}[];
|
|
67
78
|
}>;
|
|
68
79
|
export declare function findAll(): AsyncIterableIterator<{
|
|
69
|
-
session:
|
|
80
|
+
session: number | null;
|
|
70
81
|
signet_dossier_legislatif: string | null;
|
|
71
82
|
nature_texte: string | null;
|
|
72
83
|
numero_texte: number | null;
|
|
84
|
+
numero_adoption_texte: number | null;
|
|
73
85
|
intitule_texte: string | null;
|
|
74
86
|
lecture: string | null;
|
|
75
87
|
nature: string;
|
|
76
88
|
id: number;
|
|
77
89
|
parent_id: number | null;
|
|
90
|
+
rendu_similaire_id: number | null;
|
|
91
|
+
identique_id: number | null;
|
|
78
92
|
numero: string | null;
|
|
79
|
-
numero_absolu:
|
|
80
|
-
ordre:
|
|
93
|
+
numero_absolu: number | null;
|
|
94
|
+
ordre: number | null;
|
|
95
|
+
accepte_gouvernement: string | null;
|
|
81
96
|
subdivision_libelle: string | null;
|
|
82
97
|
subdivision_libelle_court: string | null;
|
|
83
98
|
subdivision_type: string | null;
|
|
84
99
|
alinea: number | null;
|
|
100
|
+
commentaire_probleme: string | null;
|
|
101
|
+
observations: string | null;
|
|
102
|
+
observations_additionnelles: string | null;
|
|
85
103
|
date_depot: string;
|
|
86
104
|
dispositif: string | null;
|
|
105
|
+
discussion_commune_id: number | null;
|
|
87
106
|
objet: string | null;
|
|
88
107
|
etat: string;
|
|
89
108
|
avis_commission: string | null;
|
|
90
109
|
avis_gouvernement: string | null;
|
|
91
110
|
sort: string | null;
|
|
92
|
-
revision:
|
|
111
|
+
revision: number;
|
|
93
112
|
url: string;
|
|
94
113
|
au_nom_de_groupe_politique: string | null;
|
|
95
114
|
au_nom_de_commission: string | null;
|
|
96
115
|
auteur_est_gouvernement: boolean;
|
|
97
116
|
auteurs: {
|
|
98
117
|
prenom: string | null;
|
|
118
|
+
homonyme: string | null;
|
|
99
119
|
nom: string | null;
|
|
120
|
+
qualite: string | null;
|
|
121
|
+
rang: number | null;
|
|
100
122
|
matricule: string | null;
|
|
101
123
|
}[];
|
|
102
124
|
}>;
|
package/lib/model/ameli.js
CHANGED
|
@@ -8,7 +8,10 @@ function auteurs(amendementId) {
|
|
|
8
8
|
.where("amdsen.amdid", "=", amendementId)
|
|
9
9
|
.select([
|
|
10
10
|
"amdsen.prenomuse as prenom",
|
|
11
|
+
"amdsen.hom as homonyme",
|
|
11
12
|
"amdsen.nomuse as nom",
|
|
13
|
+
"amdsen.qua as qualite",
|
|
14
|
+
"amdsen.rng as rang",
|
|
12
15
|
"sen_ameli.mat as matricule",
|
|
13
16
|
])
|
|
14
17
|
.orderBy("amdsen.rng asc"));
|
|
@@ -33,6 +36,7 @@ const findAllQuery = dbAmeli
|
|
|
33
36
|
"txt_ameli.doslegsignet as signet_dossier_legislatif",
|
|
34
37
|
"nat.libcourt as nature_texte",
|
|
35
38
|
"txt_ameli.numabs as numero_texte",
|
|
39
|
+
"txt_ameli.numado as numero_adoption_texte",
|
|
36
40
|
"txt_ameli.int as intitule_texte",
|
|
37
41
|
"lec_ameli.lib as lecture",
|
|
38
42
|
eb
|
|
@@ -48,15 +52,22 @@ const findAllQuery = dbAmeli
|
|
|
48
52
|
.as("nature"),
|
|
49
53
|
"amd.id as id",
|
|
50
54
|
"amd.amdperid as parent_id",
|
|
55
|
+
"amd.amdrendusim as rendu_similaire_id",
|
|
56
|
+
"amd.ideid as identique_id",
|
|
51
57
|
"amd.num as numero",
|
|
52
58
|
"amd.numabs as numero_absolu",
|
|
53
59
|
"amd.ord as ordre",
|
|
60
|
+
"amd.accgou as accepte_gouvernement",
|
|
54
61
|
"sub.lib as subdivision_libelle",
|
|
55
62
|
"sub.lic as subdivision_libelle_court",
|
|
56
63
|
"typsub.lib as subdivision_type",
|
|
57
64
|
"amd.alinea as alinea",
|
|
65
|
+
"amd.commentprobleme as commentaire_probleme",
|
|
66
|
+
"amd.obs as observations",
|
|
67
|
+
"amd.mot as observations_additionnelles",
|
|
58
68
|
toDateString(ref("amd.datdep")).as("date_depot"),
|
|
59
69
|
"amd.dis as dispositif",
|
|
70
|
+
"amd.discomid as discussion_commune_id",
|
|
60
71
|
"amd.obj as objet",
|
|
61
72
|
eb
|
|
62
73
|
.case()
|
package/lib/model/debats.d.ts
CHANGED
|
@@ -1,20 +1,29 @@
|
|
|
1
1
|
import { InferResult } from "kysely";
|
|
2
2
|
export type DebatResult = InferResult<typeof findAllQuery>[0];
|
|
3
|
-
declare const findAllQuery: import("kysely").SelectQueryBuilder<
|
|
3
|
+
declare const findAllQuery: import("kysely").SelectQueryBuilder<{
|
|
4
|
+
debats: import("../raw_types/debats").Debats;
|
|
5
|
+
intdivers: import("../raw_types/debats").Intdivers;
|
|
6
|
+
intpjl: import("../raw_types/debats").Intpjl;
|
|
7
|
+
lecassdeb: import("../raw_types/debats").Lecassdeb;
|
|
8
|
+
secdis: import("../raw_types/debats").Secdis;
|
|
9
|
+
secdivers: import("../raw_types/debats").Secdivers;
|
|
10
|
+
syndeb: import("../raw_types/debats").Syndeb;
|
|
11
|
+
typsec: import("../raw_types/debats").Typsec;
|
|
12
|
+
}, "debats", {
|
|
4
13
|
id: string;
|
|
5
14
|
date_seance: string;
|
|
6
|
-
numero:
|
|
15
|
+
numero: number | null;
|
|
7
16
|
url: string | null;
|
|
8
17
|
etat_synchronisation: string | null;
|
|
9
18
|
sections: {
|
|
10
|
-
id:
|
|
19
|
+
id: number | null;
|
|
11
20
|
numero: string | null;
|
|
12
21
|
objet: string | null;
|
|
13
22
|
url: string | null;
|
|
14
23
|
type: string | null;
|
|
15
24
|
categorie: string | null;
|
|
16
25
|
interventions: {
|
|
17
|
-
id:
|
|
26
|
+
id: number | null;
|
|
18
27
|
auteur_code: string;
|
|
19
28
|
fonction_intervenant: string | null;
|
|
20
29
|
url: string | null;
|
|
@@ -28,7 +37,7 @@ declare const findAllQuery: import("kysely").SelectQueryBuilder<import("../raw_t
|
|
|
28
37
|
libelle: string | null;
|
|
29
38
|
objet: string | null;
|
|
30
39
|
interventions: {
|
|
31
|
-
id:
|
|
40
|
+
id: number | null;
|
|
32
41
|
auteur_code: string;
|
|
33
42
|
fonction_intervenant: string | null;
|
|
34
43
|
url: string | null;
|
|
@@ -42,18 +51,18 @@ declare const findAllQuery: import("kysely").SelectQueryBuilder<import("../raw_t
|
|
|
42
51
|
export declare function findAll(): AsyncIterableIterator<{
|
|
43
52
|
id: string;
|
|
44
53
|
date_seance: string;
|
|
45
|
-
numero:
|
|
54
|
+
numero: number | null;
|
|
46
55
|
url: string | null;
|
|
47
56
|
etat_synchronisation: string | null;
|
|
48
57
|
sections: {
|
|
49
|
-
id:
|
|
58
|
+
id: number | null;
|
|
50
59
|
numero: string | null;
|
|
51
60
|
objet: string | null;
|
|
52
61
|
url: string | null;
|
|
53
62
|
type: string | null;
|
|
54
63
|
categorie: string | null;
|
|
55
64
|
interventions: {
|
|
56
|
-
id:
|
|
65
|
+
id: number | null;
|
|
57
66
|
auteur_code: string;
|
|
58
67
|
fonction_intervenant: string | null;
|
|
59
68
|
url: string | null;
|
|
@@ -67,7 +76,7 @@ export declare function findAll(): AsyncIterableIterator<{
|
|
|
67
76
|
libelle: string | null;
|
|
68
77
|
objet: string | null;
|
|
69
78
|
interventions: {
|
|
70
|
-
id:
|
|
79
|
+
id: number | null;
|
|
71
80
|
auteur_code: string;
|
|
72
81
|
fonction_intervenant: string | null;
|
|
73
82
|
url: string | null;
|