@tricoteuses/assemblee 3.1.3 → 3.2.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.
- package/README.md +21 -3
- package/lib/{amendements-DrQ9BA7A.js → amendements-D3Jr9MQa.js} +4 -4
- package/lib/{amendements-uxFcHcO5.js → amendements-DaB_5WaI.js} +1 -1
- package/lib/cleaners.js +176 -173
- package/lib/datasets.d.ts +1 -0
- package/lib/git.js +57 -46
- package/lib/index.js +2 -2
- package/lib/{loaders-BjOHOabR.js → loaders-CY8EGNSM.js} +4 -3
- package/lib/loaders.js +2 -4
- package/lib/parsers.js +3 -3
- package/lib/{questions-DDxOcCAG.js → questions-CsNQoayp.js} +1 -1
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -62,6 +62,9 @@ npm run data:download ../assemblee-data -- -k Amendements
|
|
|
62
62
|
|
|
63
63
|
# Only process 16th and 17th legislatures
|
|
64
64
|
npm run data:download ../assemblee-data -- -l 16 -l 17
|
|
65
|
+
|
|
66
|
+
# Retrieve comptes rendus de seance and commissions for one legislature
|
|
67
|
+
npm run data:retrieve_open_data ../assemblee-data -- --categories ComptesRendus --legislature 17 --fetchCrCommissions
|
|
65
68
|
```
|
|
66
69
|
|
|
67
70
|
### Common Options
|
|
@@ -82,15 +85,30 @@ npm run data:download ../assemblee-data -- -l 16 -l 17
|
|
|
82
85
|
|
|
83
86
|
If you use such options, use them in all subsequent commands too (_data:regorganize_data_ and _data:clean_data_).
|
|
84
87
|
|
|
88
|
+
### Options for Data Retrieval
|
|
89
|
+
|
|
90
|
+
With `data:retrieve_open_data`,
|
|
91
|
+
|
|
92
|
+
- use `--categories=ComptesRendus` to retrieve comptes rendus de séance for the selected legislature(s).
|
|
93
|
+
|
|
94
|
+
Note:
|
|
95
|
+
|
|
96
|
+
- Comptes-rendus & videos of commissions are retrieved when cleaning agendas data.
|
|
97
|
+
|
|
85
98
|
### Options for Cleaning Data
|
|
86
99
|
|
|
87
100
|
- `--dataset` or `-d <name>`: Clean a specific dataset only
|
|
101
|
+
- `--fetchCrCommissions`: Retrieve and parse CR commissions
|
|
102
|
+
- `--fetchVideos`: Retrieve videos
|
|
103
|
+
- `--fetchDocuments` : Specify to retrieve documents
|
|
88
104
|
- `--no-reset-after-commit`: Skip Git reset after committing (useful to preserve local changes)
|
|
89
105
|
- `--no-validate` or `-V`: Skip schema validation during cleaning
|
|
90
|
-
- `--fetchDocuments` : Specify to retrieve documents
|
|
91
106
|
- `--parseDocuments`: Specify to parse documents into cleaned json
|
|
92
|
-
|
|
93
|
-
|
|
107
|
+
|
|
108
|
+
Note:
|
|
109
|
+
|
|
110
|
+
- use `--categories=Agendas` together with `--fetchCrCommissions` to retrieve comptes rendus de commission.
|
|
111
|
+
- use `--categories=Agendas` together with `--fetchVideos` to retrieve videos of commissions.
|
|
94
112
|
|
|
95
113
|
### Options for Retrieving Documents
|
|
96
114
|
|
|
@@ -1564,7 +1564,7 @@ function Qe(e) {
|
|
|
1564
1564
|
return typeof e == "function" && e.prototype?.constructor === e;
|
|
1565
1565
|
}
|
|
1566
1566
|
//#endregion
|
|
1567
|
-
//#region \0@oxc-project+runtime@0.
|
|
1567
|
+
//#region \0@oxc-project+runtime@0.122.0/helpers/typeof.js
|
|
1568
1568
|
function k(e) {
|
|
1569
1569
|
"@babel/helpers - typeof";
|
|
1570
1570
|
return k = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
@@ -1574,7 +1574,7 @@ function k(e) {
|
|
|
1574
1574
|
}, k(e);
|
|
1575
1575
|
}
|
|
1576
1576
|
//#endregion
|
|
1577
|
-
//#region \0@oxc-project+runtime@0.
|
|
1577
|
+
//#region \0@oxc-project+runtime@0.122.0/helpers/toPrimitive.js
|
|
1578
1578
|
function $e(e, t) {
|
|
1579
1579
|
if (k(e) != "object" || !e) return e;
|
|
1580
1580
|
var n = e[Symbol.toPrimitive];
|
|
@@ -1586,13 +1586,13 @@ function $e(e, t) {
|
|
|
1586
1586
|
return (t === "string" ? String : Number)(e);
|
|
1587
1587
|
}
|
|
1588
1588
|
//#endregion
|
|
1589
|
-
//#region \0@oxc-project+runtime@0.
|
|
1589
|
+
//#region \0@oxc-project+runtime@0.122.0/helpers/toPropertyKey.js
|
|
1590
1590
|
function et(e) {
|
|
1591
1591
|
var t = $e(e, "string");
|
|
1592
1592
|
return k(t) == "symbol" ? t : t + "";
|
|
1593
1593
|
}
|
|
1594
1594
|
//#endregion
|
|
1595
|
-
//#region \0@oxc-project+runtime@0.
|
|
1595
|
+
//#region \0@oxc-project+runtime@0.122.0/helpers/defineProperty.js
|
|
1596
1596
|
function A(e, t, n) {
|
|
1597
1597
|
return (t = et(t)) in e ? Object.defineProperty(e, t, {
|
|
1598
1598
|
value: n,
|
package/lib/cleaners.js
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import "
|
|
5
|
-
import o from "node:assert";
|
|
1
|
+
import { F as e, H as t } from "./questions-CsNQoayp.js";
|
|
2
|
+
import { i as n, n as r, r as i, t as a } from "./amendements-DaB_5WaI.js";
|
|
3
|
+
import { S as o } from "./loaders-CY8EGNSM.js";
|
|
4
|
+
import s from "node:assert";
|
|
6
5
|
import "fs-extra";
|
|
7
6
|
import "node:path";
|
|
8
7
|
//#region src/cleaners/acteurs.ts
|
|
9
|
-
function
|
|
8
|
+
function c(e) {
|
|
10
9
|
let t = e;
|
|
11
10
|
n(t);
|
|
12
11
|
let r = t.uid;
|
|
13
|
-
|
|
12
|
+
s.strictEqual(r["@xsi:type"], "IdActeur_type"), t.uid = r["#text"], s(t.uid);
|
|
14
13
|
let i = t.etatCivil;
|
|
15
14
|
{
|
|
16
15
|
n(i);
|
|
@@ -25,22 +24,22 @@ function s(e) {
|
|
|
25
24
|
if (a !== void 0) {
|
|
26
25
|
n(a);
|
|
27
26
|
let e = a.socProcINSEE;
|
|
28
|
-
|
|
27
|
+
s(e), n(e), delete a.socProcINSEE, a.socProcInsee = e;
|
|
29
28
|
}
|
|
30
|
-
let
|
|
31
|
-
|
|
29
|
+
let o = t.uri_hatvp;
|
|
30
|
+
o !== void 0 && (t.uriHatvp = o, delete t.uri_hatvp);
|
|
32
31
|
let c = t.adresses;
|
|
33
32
|
if (c !== void 0) {
|
|
34
33
|
let e = Array.isArray(c) ? c : c.adresse;
|
|
35
|
-
if (e === void 0 ? delete t.adresses : Array.isArray(e) ? t.adresses = e : (
|
|
34
|
+
if (e === void 0 ? delete t.adresses : Array.isArray(e) ? t.adresses = e : (s.notStrictEqual(e, null), s.strictEqual(typeof e, "object"), t.adresses = e = [e]), e !== void 0) for (let t of e) {
|
|
36
35
|
n(t);
|
|
37
36
|
let e = t["@xsi:type"];
|
|
38
|
-
|
|
37
|
+
s([
|
|
39
38
|
"AdresseMail_Type",
|
|
40
39
|
"AdressePostale_Type",
|
|
41
40
|
"AdresseSiteWeb_Type",
|
|
42
41
|
"AdresseTelephonique_Type"
|
|
43
|
-
].includes(e ?? ""), `Unexpected "@xsi:type": ${e}`), t.xsiType = e, delete t["@xsi:type"],
|
|
42
|
+
].includes(e ?? ""), `Unexpected "@xsi:type": ${e}`), t.xsiType = e, delete t["@xsi:type"], s.notStrictEqual(t.uid, void 0), s.notStrictEqual(t.type, void 0), s.notStrictEqual(t.typeLibelle, void 0), e === "AdressePostale_Type" && s.strictEqual(t.adresseDeRattachement, void 0);
|
|
44
43
|
}
|
|
45
44
|
}
|
|
46
45
|
let l = t.mandats;
|
|
@@ -54,13 +53,13 @@ function s(e) {
|
|
|
54
53
|
let r = t.infosQualite;
|
|
55
54
|
n(r);
|
|
56
55
|
let i = t.organes;
|
|
57
|
-
|
|
56
|
+
s(i), delete t.organes;
|
|
58
57
|
let a = i.organeRef;
|
|
59
|
-
|
|
60
|
-
let
|
|
61
|
-
if (delete t.suppleants,
|
|
62
|
-
let e =
|
|
63
|
-
|
|
58
|
+
s(a), Array.isArray(a) || (a = [a]), t.organesRefs = a;
|
|
59
|
+
let o = t.suppleants;
|
|
60
|
+
if (delete t.suppleants, o) {
|
|
61
|
+
let e = o.suppleant;
|
|
62
|
+
s(e), t.suppleant = e, n(e);
|
|
64
63
|
}
|
|
65
64
|
let c = t.election;
|
|
66
65
|
if (c !== void 0) {
|
|
@@ -69,7 +68,7 @@ function s(e) {
|
|
|
69
68
|
n(e);
|
|
70
69
|
}
|
|
71
70
|
let l = t.mandature;
|
|
72
|
-
l !== void 0 && n(l),
|
|
71
|
+
l !== void 0 && n(l), s.strictEqual(t.chambre, void 0);
|
|
73
72
|
let u = t.collaborateurs;
|
|
74
73
|
if (u != null) {
|
|
75
74
|
let e = Array.isArray(u) ? u.filter((e) => e !== null) : [u], r = [];
|
|
@@ -77,10 +76,10 @@ function s(e) {
|
|
|
77
76
|
if (Array.isArray(e)) for (let t of e) t !== null && r.push(t);
|
|
78
77
|
else e && r.push(e);
|
|
79
78
|
}), r.length === 0 ? delete t.collaborateurs : t.collaborateurs = r;
|
|
80
|
-
for (let e of r) n(e),
|
|
79
|
+
for (let e of r) n(e), s.strictEqual(e.dateDebut, void 0), s.strictEqual(e.dateFin, void 0);
|
|
81
80
|
}
|
|
82
81
|
let d = t.InfosHorsSIAN;
|
|
83
|
-
d !== void 0 && (n(d),
|
|
82
|
+
d !== void 0 && (n(d), s.strictEqual(d.HATVP_URI, void 0), s.strictEqual(Object.keys(d).length, 0), delete t.InfosHorsSIAN);
|
|
84
83
|
}
|
|
85
84
|
e.sort((e, t) => e.uid.length === t.uid.length ? e.uid.localeCompare(t.uid) : e.uid.length - t.uid.length);
|
|
86
85
|
}
|
|
@@ -91,22 +90,22 @@ function s(e) {
|
|
|
91
90
|
for (let t of e) {
|
|
92
91
|
n(t);
|
|
93
92
|
let e = t.cible;
|
|
94
|
-
n(e),
|
|
93
|
+
n(e), s.strictEqual(e.references, void 0);
|
|
95
94
|
}
|
|
96
95
|
e.sort((e, t) => e.uid.length === t.uid.length ? e.uid.localeCompare(t.uid) : e.uid.length - t.uid.length);
|
|
97
96
|
}
|
|
98
97
|
return t;
|
|
99
98
|
}
|
|
100
|
-
function
|
|
99
|
+
function l(e) {
|
|
101
100
|
let t = e.etudePLFRef;
|
|
102
101
|
e.etudePLFRef !== void 0 && (delete e.etudePLFRef, e.etudePlfRef = t);
|
|
103
102
|
}
|
|
104
103
|
//#endregion
|
|
105
104
|
//#region src/cleaners/documents.ts
|
|
106
|
-
function
|
|
105
|
+
function u(e) {
|
|
107
106
|
return Array.isArray(e) ? e : [e];
|
|
108
107
|
}
|
|
109
|
-
function
|
|
108
|
+
function d(e) {
|
|
110
109
|
let t = e;
|
|
111
110
|
if (n(t), t.metadatas?.dateSuppression !== void 0) {
|
|
112
111
|
for (let e of Object.getOwnPropertyNames(t)) delete t[e];
|
|
@@ -115,23 +114,23 @@ function u(e) {
|
|
|
115
114
|
let i = t["@xsi:type"];
|
|
116
115
|
i !== void 0 && (t.xsiType = i, delete t["@xsi:type"]);
|
|
117
116
|
let a = t.cycleDeVie;
|
|
118
|
-
|
|
117
|
+
s(a);
|
|
119
118
|
{
|
|
120
119
|
let e = a.chrono;
|
|
121
|
-
|
|
120
|
+
s(e), n(e);
|
|
122
121
|
}
|
|
123
|
-
let
|
|
124
|
-
if (
|
|
125
|
-
let e = Array.isArray(
|
|
122
|
+
let o = t.divisions;
|
|
123
|
+
if (o !== void 0) {
|
|
124
|
+
let e = Array.isArray(o) ? o : u(o.division);
|
|
126
125
|
t.divisions = e;
|
|
127
|
-
for (let t of e)
|
|
126
|
+
for (let t of e) d(t);
|
|
128
127
|
}
|
|
129
|
-
|
|
128
|
+
s.strictEqual(t.redacteur, void 0);
|
|
130
129
|
let c = t.classification;
|
|
131
|
-
|
|
132
|
-
let
|
|
133
|
-
if (
|
|
134
|
-
let e = Array.isArray(
|
|
130
|
+
s(c), n(c);
|
|
131
|
+
let l = t.auteurs;
|
|
132
|
+
if (l !== void 0) {
|
|
133
|
+
let e = Array.isArray(l) ? l : u(l.auteur);
|
|
135
134
|
t.auteurs = e;
|
|
136
135
|
for (let t of e) {
|
|
137
136
|
let e = t.organe;
|
|
@@ -142,14 +141,14 @@ function u(e) {
|
|
|
142
141
|
r(f, "adoptionConforme");
|
|
143
142
|
let p = t.coSignataires;
|
|
144
143
|
if (p !== void 0) {
|
|
145
|
-
let e = Array.isArray(p) ? p :
|
|
144
|
+
let e = Array.isArray(p) ? p : u(p.coSignataire);
|
|
146
145
|
t.coSignataires = e;
|
|
147
146
|
for (let t of e) {
|
|
148
147
|
n(t), r(t, "edite");
|
|
149
148
|
let e = t.acteur;
|
|
150
149
|
if (e !== void 0) {
|
|
151
150
|
let n = e.acteurRef;
|
|
152
|
-
|
|
151
|
+
s(n), delete t.acteur, t.acteurRef = n;
|
|
153
152
|
}
|
|
154
153
|
let i = t.organe;
|
|
155
154
|
i !== void 0 && r(i, "etApparentes");
|
|
@@ -162,9 +161,9 @@ function u(e) {
|
|
|
162
161
|
n(e), r(e, "amendable");
|
|
163
162
|
let t = m.amendementsCommission;
|
|
164
163
|
if (t !== void 0) {
|
|
165
|
-
let e = Array.isArray(t) ? t :
|
|
164
|
+
let e = Array.isArray(t) ? t : u(t.commission);
|
|
166
165
|
m.amendementsCommission = e;
|
|
167
|
-
for (let t of e) n(t), r(t, "amendable"),
|
|
166
|
+
for (let t of e) n(t), r(t, "amendable"), s.strictEqual(t.dateLimiteDepot, void 0);
|
|
168
167
|
}
|
|
169
168
|
}
|
|
170
169
|
let h = t.imprimerie;
|
|
@@ -179,66 +178,66 @@ function u(e) {
|
|
|
179
178
|
}
|
|
180
179
|
r(t, "rapportPublie");
|
|
181
180
|
let g = t.organesReferents;
|
|
182
|
-
return g !== void 0 && (t.organesReferents = Array.isArray(g) ? g :
|
|
181
|
+
return g !== void 0 && (t.organesReferents = Array.isArray(g) ? g : u(g.organeRef)), t;
|
|
183
182
|
}
|
|
184
183
|
//#endregion
|
|
185
184
|
//#region src/cleaners/actes_legislatifs.ts
|
|
186
|
-
function
|
|
185
|
+
function f(e) {
|
|
187
186
|
return Array.isArray(e) ? e : [e];
|
|
188
187
|
}
|
|
189
|
-
function
|
|
188
|
+
function p(e) {
|
|
190
189
|
let t = e;
|
|
191
190
|
n(t);
|
|
192
191
|
let r = t["@xsi:type"];
|
|
193
192
|
r !== void 0 && (t.xsiType = r, delete t["@xsi:type"]);
|
|
194
193
|
let i = t.auteurs;
|
|
195
|
-
i !== void 0 && (t.auteursRefs =
|
|
194
|
+
i !== void 0 && (t.auteursRefs = f(i.acteurRef), delete t.auteurs);
|
|
196
195
|
let a = t.casSaisine;
|
|
197
|
-
a !== void 0 &&
|
|
198
|
-
let
|
|
199
|
-
|
|
200
|
-
let
|
|
201
|
-
|
|
196
|
+
a !== void 0 && h(a);
|
|
197
|
+
let o = t.contributionInternaute;
|
|
198
|
+
o !== void 0 && n(o), s.strictEqual(t.dateRetrait, void 0);
|
|
199
|
+
let c = t.decision;
|
|
200
|
+
c !== void 0 && h(c);
|
|
202
201
|
let u = t.infoJO;
|
|
203
|
-
u !== void 0 && (
|
|
204
|
-
let
|
|
205
|
-
if (
|
|
206
|
-
t.infoJoce =
|
|
207
|
-
let e =
|
|
208
|
-
e !== void 0 && (
|
|
209
|
-
let n =
|
|
210
|
-
n !== void 0 && (
|
|
202
|
+
u !== void 0 && (g(u), t.infoJo = u, delete t.infoJO);
|
|
203
|
+
let d = t.infoJOCE;
|
|
204
|
+
if (d !== void 0) {
|
|
205
|
+
t.infoJoce = d, delete t.infoJOCE;
|
|
206
|
+
let e = d.refJOCE;
|
|
207
|
+
e !== void 0 && (d.refJoce = e, delete d.refJOCE);
|
|
208
|
+
let n = d.dateJOCE;
|
|
209
|
+
n !== void 0 && (d.dateJoce = n, delete d.dateJOCE);
|
|
211
210
|
}
|
|
212
211
|
let _ = t.infoJORect;
|
|
213
212
|
if (_ !== void 0) {
|
|
214
|
-
let e =
|
|
213
|
+
let e = f(_);
|
|
215
214
|
t.infoJoRect = e, delete t.infoJORect;
|
|
216
|
-
for (let t of e)
|
|
215
|
+
for (let t of e) g(t);
|
|
217
216
|
}
|
|
218
|
-
|
|
217
|
+
m(t);
|
|
219
218
|
let v = t.initiateurs;
|
|
220
|
-
v !== void 0 && (
|
|
219
|
+
v !== void 0 && (s.strictEqual(t.initiateur, void 0), !Array.isArray(v) && v.acteurRef === void 0 ? (s.notStrictEqual(v.organeRef, void 0), t.initiateur = { organeRef: v.organeRef }) : t.initiateur = { acteurs: f(v) }, delete t.initiateurs), s.strictEqual(t.odSeancejRef, void 0);
|
|
221
220
|
let y = t.provenance;
|
|
222
221
|
y !== void 0 && (delete t.provenance, t.provenanceRef = y);
|
|
223
222
|
let b = t.rapporteurs;
|
|
224
223
|
if (b !== void 0 && !Array.isArray(b)) {
|
|
225
|
-
let e =
|
|
224
|
+
let e = f(b.rapporteur);
|
|
226
225
|
t.rapporteurs = e;
|
|
227
|
-
for (let t of e)
|
|
226
|
+
for (let t of e) l(t);
|
|
228
227
|
}
|
|
229
228
|
let x = t.referenceNOR;
|
|
230
|
-
x !== void 0 && (t.referenceNor = x, delete t.referenceNOR),
|
|
229
|
+
x !== void 0 && (t.referenceNor = x, delete t.referenceNOR), s.strictEqual(t.reunion, void 0);
|
|
231
230
|
let S = t.statutAdoption;
|
|
232
|
-
S !== void 0 &&
|
|
231
|
+
S !== void 0 && h(S);
|
|
233
232
|
let C = t.statutConclusion;
|
|
234
|
-
C !== void 0 && (
|
|
233
|
+
C !== void 0 && (h(C), C.famCode === "TSORTFnull" && delete t.statutConclusion);
|
|
235
234
|
let w = t.texteAdopte;
|
|
236
235
|
w !== void 0 && (delete t.texteAdopte, t.texteAdopteRef = w);
|
|
237
236
|
let T = t.texteAssocie;
|
|
238
237
|
T !== void 0 && (delete t.texteAssocie, t.texteAssocieRef = T);
|
|
239
238
|
let E = t.textesAssocies;
|
|
240
239
|
if (E !== void 0 && !Array.isArray(E)) {
|
|
241
|
-
let e =
|
|
240
|
+
let e = f(E.texteAssocie);
|
|
242
241
|
t.textesAssocies = e;
|
|
243
242
|
for (let t of e) {
|
|
244
243
|
let e = t.refTexteAssocie;
|
|
@@ -246,41 +245,41 @@ function f(e) {
|
|
|
246
245
|
}
|
|
247
246
|
}
|
|
248
247
|
let D = t.typeDeclaration;
|
|
249
|
-
D !== void 0 &&
|
|
248
|
+
D !== void 0 && h(D);
|
|
250
249
|
let O = t.typeMotion;
|
|
251
|
-
O !== void 0 &&
|
|
250
|
+
O !== void 0 && h(O);
|
|
252
251
|
let k = t.typeMotionCensure;
|
|
253
|
-
k !== void 0 &&
|
|
252
|
+
k !== void 0 && h(k);
|
|
254
253
|
let A = t.voteRefs;
|
|
255
|
-
A !== void 0 && !Array.isArray(A) && (t.voteRefs =
|
|
254
|
+
A !== void 0 && !Array.isArray(A) && (t.voteRefs = f(A.voteRef));
|
|
256
255
|
let j = t.actesLegislatifs;
|
|
257
256
|
if (j !== void 0 && !Array.isArray(j)) {
|
|
258
|
-
let e =
|
|
257
|
+
let e = f(j.acteLegislatif);
|
|
259
258
|
t.actesLegislatifs = e;
|
|
260
|
-
for (let t of e)
|
|
259
|
+
for (let t of e) p(t);
|
|
261
260
|
}
|
|
262
261
|
}
|
|
263
|
-
function
|
|
262
|
+
function m(e) {
|
|
264
263
|
let t = e, n = t.initiateur;
|
|
265
264
|
if (n !== void 0) {
|
|
266
265
|
let e = n.acteurs;
|
|
267
266
|
if (e !== void 0 && !Array.isArray(e)) {
|
|
268
|
-
let t =
|
|
267
|
+
let t = f(e.acteur);
|
|
269
268
|
t.length > 0 ? n.acteurs = t : delete n.acteurs;
|
|
270
269
|
}
|
|
271
270
|
let r = n.organes;
|
|
272
|
-
r !== void 0 && (n.organeRef = r.organe.organeRef.uid,
|
|
271
|
+
r !== void 0 && (n.organeRef = r.organe.organeRef.uid, s.notStrictEqual(n.organeRef, void 0), delete n.organes), n.acteurs === void 0 && n.organeRef === void 0 && delete t.initiateur;
|
|
273
272
|
}
|
|
274
273
|
}
|
|
275
|
-
function m(e) {
|
|
276
|
-
e.famCode = e.fam_code, delete e.fam_code, o(e.famCode), e.libelle || (e.libelle = e.famCode);
|
|
277
|
-
}
|
|
278
274
|
function h(e) {
|
|
275
|
+
e.famCode = e.fam_code, delete e.fam_code, s(e.famCode), e.libelle || (e.libelle = e.famCode);
|
|
276
|
+
}
|
|
277
|
+
function g(e) {
|
|
279
278
|
n(e);
|
|
280
279
|
let t = e.typeJO;
|
|
281
280
|
t !== void 0 && (e.typeJo = t, delete e.typeJO);
|
|
282
281
|
let r = e.dateJO;
|
|
283
|
-
r !== void 0 && (e.dateJo = r, delete e.dateJO),
|
|
282
|
+
r !== void 0 && (e.dateJo = r, delete e.dateJO), s.strictEqual(e.pageJO, void 0);
|
|
284
283
|
let i = e.numJO;
|
|
285
284
|
i !== void 0 && (e.numJo = i, delete e.numJO);
|
|
286
285
|
let a = e.referenceNOR;
|
|
@@ -288,48 +287,48 @@ function h(e) {
|
|
|
288
287
|
}
|
|
289
288
|
//#endregion
|
|
290
289
|
//#region src/cleaners/dossiers_legislatifs.ts
|
|
291
|
-
function
|
|
290
|
+
function _(e) {
|
|
292
291
|
let t = e;
|
|
293
292
|
n(t);
|
|
294
293
|
let r = t["@xsi:type"];
|
|
295
294
|
r !== void 0 && (t.xsiType = r, delete t["@xsi:type"]);
|
|
296
295
|
let i = t.titreDossier;
|
|
297
|
-
n(i),
|
|
296
|
+
n(i), m(t);
|
|
298
297
|
let a = t.actesLegislatifs;
|
|
299
298
|
if (a != null) {
|
|
300
299
|
let e = Array.isArray(a) ? a : a.acteLegislatif;
|
|
301
|
-
Array.isArray(e) || (
|
|
300
|
+
Array.isArray(e) || (s(e), e = [e]);
|
|
302
301
|
let n = e;
|
|
303
302
|
t.actesLegislatifs = n;
|
|
304
|
-
for (let e of n)
|
|
303
|
+
for (let e of n) p(e);
|
|
305
304
|
}
|
|
306
|
-
let
|
|
307
|
-
if (
|
|
308
|
-
let e =
|
|
309
|
-
|
|
305
|
+
let o = t.PLF;
|
|
306
|
+
if (o !== void 0) {
|
|
307
|
+
let e = o.EtudePLF;
|
|
308
|
+
s(Array.isArray(e)), delete t.PLF, t.plf = e;
|
|
310
309
|
for (let t of e) {
|
|
311
310
|
let e = t.rapporteur;
|
|
312
311
|
if (e !== void 0) {
|
|
313
|
-
Array.isArray(e) || (
|
|
314
|
-
for (let t of e)
|
|
312
|
+
Array.isArray(e) || (s(e), e = [e]), delete t.rapporteur, t.rapporteurs = e;
|
|
313
|
+
for (let t of e) l(t);
|
|
315
314
|
}
|
|
316
315
|
let n = t.missionMinefi;
|
|
317
|
-
n !== void 0 &&
|
|
316
|
+
n !== void 0 && v(n), t.ordreDiqs = t.ordreDIQS, delete t.ordreDIQS, s(t.ordreDiqs);
|
|
318
317
|
}
|
|
319
318
|
}
|
|
320
319
|
return t;
|
|
321
320
|
}
|
|
322
|
-
function
|
|
321
|
+
function v(e) {
|
|
323
322
|
let t = e.missions;
|
|
324
323
|
if (t !== void 0) {
|
|
325
324
|
let n = Array.isArray(t) ? t : t.mission;
|
|
326
|
-
Array.isArray(n) || (
|
|
327
|
-
for (let e of n)
|
|
325
|
+
Array.isArray(n) || (s(n), n = [n]), e.missions = n;
|
|
326
|
+
for (let e of n) v(e);
|
|
328
327
|
}
|
|
329
328
|
}
|
|
330
329
|
//#endregion
|
|
331
330
|
//#region src/cleaners/organes.ts
|
|
332
|
-
function
|
|
331
|
+
function y(e) {
|
|
333
332
|
let t = e;
|
|
334
333
|
n(t);
|
|
335
334
|
let r = t["@xsi:type"];
|
|
@@ -337,9 +336,9 @@ function v(e) {
|
|
|
337
336
|
let i = t.viMoDe;
|
|
338
337
|
i !== void 0 && n(i);
|
|
339
338
|
let a = t.organeParent;
|
|
340
|
-
a !== void 0 && (delete t.organeParent, t.organeParentRef = a),
|
|
341
|
-
let
|
|
342
|
-
|
|
339
|
+
a !== void 0 && (delete t.organeParent, t.organeParentRef = a), s.strictEqual(t.chambre, void 0);
|
|
340
|
+
let o = t.secretariat;
|
|
341
|
+
o !== void 0 && n(o);
|
|
343
342
|
let c = t.lieu;
|
|
344
343
|
if (c !== void 0) {
|
|
345
344
|
n(c);
|
|
@@ -352,42 +351,42 @@ function v(e) {
|
|
|
352
351
|
let l = t.listePays;
|
|
353
352
|
if (l !== void 0) {
|
|
354
353
|
let e = Array.isArray(l) ? l : l.paysRef;
|
|
355
|
-
Array.isArray(e) || (
|
|
354
|
+
Array.isArray(e) || (s.strictEqual(typeof e, "string"), e = [e]), t.listePays = e;
|
|
356
355
|
}
|
|
357
356
|
return t;
|
|
358
357
|
}
|
|
359
358
|
//#endregion
|
|
360
359
|
//#region src/cleaners/reunions.ts
|
|
361
|
-
function
|
|
360
|
+
function b(e) {
|
|
362
361
|
n(e);
|
|
363
362
|
let t = e.chrono;
|
|
364
|
-
|
|
363
|
+
s(t);
|
|
365
364
|
{
|
|
366
365
|
n(t);
|
|
367
366
|
let e = t.creation;
|
|
368
|
-
|
|
367
|
+
s.strictEqual(typeof e, "string"), e = new Date(e), t.creation = e;
|
|
369
368
|
let r = t.cloture;
|
|
370
|
-
r !== void 0 && (
|
|
369
|
+
r !== void 0 && (s.strictEqual(typeof r, "string"), r = new Date(r), t.cloture = r);
|
|
371
370
|
}
|
|
372
371
|
}
|
|
373
|
-
function
|
|
372
|
+
function x(e) {
|
|
374
373
|
let t = e;
|
|
375
374
|
n(t), r(t, "captationVideo"), r(t, "comiteSecret"), r(t, "ouverturePresse");
|
|
376
375
|
let i = t["@xsi:type"];
|
|
377
376
|
i !== void 0 && (t.xsiType = i, delete t["@xsi:type"]);
|
|
378
377
|
let a = t.timeStampDebut;
|
|
379
|
-
|
|
380
|
-
let
|
|
381
|
-
|
|
378
|
+
s.notStrictEqual(a, void 0), t.timestampDebut = a, delete t.timeStampDebut;
|
|
379
|
+
let o = t.timeStampFin;
|
|
380
|
+
o !== void 0 && (s.strictEqual(typeof o, "string"), t.timestampFin = new Date(o), delete t.timeStampFin);
|
|
382
381
|
let c = t.lieu;
|
|
383
382
|
c !== void 0 && n(c);
|
|
384
383
|
let l = t.cycleDeVie;
|
|
385
|
-
|
|
384
|
+
s.notStrictEqual(l, void 0), b(l);
|
|
386
385
|
let u = t.demandeurs;
|
|
387
386
|
if (u != null) {
|
|
388
387
|
let e = u.acteur;
|
|
389
388
|
if (e !== void 0) {
|
|
390
|
-
Array.isArray(e) || (
|
|
389
|
+
Array.isArray(e) || (s.notStrictEqual(e, null), s.strictEqual(typeof e, "object"), e = [e]);
|
|
391
390
|
let t = e.filter((e) => e !== null);
|
|
392
391
|
u.acteurs = t, delete u.acteur;
|
|
393
392
|
for (let e of t) n(e);
|
|
@@ -397,10 +396,10 @@ function b(e) {
|
|
|
397
396
|
}
|
|
398
397
|
let d = t.demandeur;
|
|
399
398
|
if (d != null) {
|
|
400
|
-
|
|
399
|
+
s.strictEqual(t.demandeurs, void 0), delete t.demandeur;
|
|
401
400
|
let e = d.acteur;
|
|
402
401
|
if (e !== void 0) {
|
|
403
|
-
|
|
402
|
+
s.notStrictEqual(e, null), s.strictEqual(typeof e, "object");
|
|
404
403
|
let r = [e];
|
|
405
404
|
d.acteurs = r, delete d.acteur, t.demandeurs = d;
|
|
406
405
|
for (let e of r) n(e);
|
|
@@ -414,21 +413,21 @@ function b(e) {
|
|
|
414
413
|
let e = f.participantsInternes;
|
|
415
414
|
if (e != null) {
|
|
416
415
|
let t = Array.isArray(e) ? e : e.participantInterne;
|
|
417
|
-
Array.isArray(t) || (
|
|
416
|
+
Array.isArray(t) || (s.notStrictEqual(t, null), s.strictEqual(typeof t, "object"), t = [t]), f.participantsInternes = t;
|
|
418
417
|
}
|
|
419
418
|
let t = f.personnesAuditionnees;
|
|
420
419
|
if (t !== void 0) {
|
|
421
420
|
let e = Array.isArray(t) ? t : t === null ? null : t.personneAuditionnee;
|
|
422
421
|
if (e === null) delete f.personnesAuditionnees;
|
|
423
422
|
else {
|
|
424
|
-
Array.isArray(e) || (
|
|
423
|
+
Array.isArray(e) || (s.strictEqual(typeof e, "object"), e = [e]), e = e.filter((e) => e !== null), e.length > 0 ? f.personnesAuditionnees = e : delete f.personnesAuditionnees;
|
|
425
424
|
for (let t of e) {
|
|
426
425
|
let e = t.uid, r = e["@xsi:type"];
|
|
427
|
-
|
|
426
|
+
s(r), t.xsiType = r;
|
|
428
427
|
let i = e["#text"];
|
|
429
|
-
|
|
428
|
+
s(i), t.uid = i;
|
|
430
429
|
let a = t.ident;
|
|
431
|
-
|
|
430
|
+
s(a), n(a);
|
|
432
431
|
}
|
|
433
432
|
}
|
|
434
433
|
}
|
|
@@ -451,20 +450,20 @@ function b(e) {
|
|
|
451
450
|
let t = e["@xsi:type"];
|
|
452
451
|
t !== void 0 && (e.xsiType = t, delete e["@xsi:type"]);
|
|
453
452
|
let i = e.cycleDeVie;
|
|
454
|
-
|
|
453
|
+
s.notStrictEqual(i, void 0), b(i), s.strictEqual(e.demandeurPoint, void 0);
|
|
455
454
|
let a = e.dossiersLegislatifsRefs;
|
|
456
|
-
a !== void 0 && (e.dossiersLegislatifsRefs = Array.isArray(a) ? a : Array.isArray(a.dossierRef) ? a.dossierRef : [a.dossierRef]), e.typePointOdj = e.typePointODJ, delete e.typePointODJ,
|
|
457
|
-
let
|
|
458
|
-
if (
|
|
459
|
-
|
|
460
|
-
let t =
|
|
461
|
-
|
|
455
|
+
a !== void 0 && (e.dossiersLegislatifsRefs = Array.isArray(a) ? a : Array.isArray(a.dossierRef) ? a.dossierRef : [a.dossierRef]), e.typePointOdj = e.typePointODJ, delete e.typePointODJ, s.strictEqual(e.textesAssocies, void 0), e.natureTravauxOdj = e.natureTravauxODJ, delete e.natureTravauxODJ;
|
|
456
|
+
let o = e.dateConfPres;
|
|
457
|
+
if (o !== void 0) {
|
|
458
|
+
s.strictEqual(typeof o, "string");
|
|
459
|
+
let t = o;
|
|
460
|
+
s(/^\d{4}-\d{2}-\d{2}\+\d{2}:00$/.test(t)), e.dateConfPres = new Date(t.split("+")[0]);
|
|
462
461
|
}
|
|
463
462
|
let c = e.dateLettreMinistre;
|
|
464
463
|
if (c !== void 0) {
|
|
465
|
-
|
|
464
|
+
s.strictEqual(typeof c, "string");
|
|
466
465
|
let t = c;
|
|
467
|
-
|
|
466
|
+
s(/^\d{4}-\d{2}-\d{2}\+\d{2}:00$/.test(t)), e.dateLettreMinistre = new Date(t.split("+")[0]);
|
|
468
467
|
}
|
|
469
468
|
}
|
|
470
469
|
delete e.pointsODJ;
|
|
@@ -479,9 +478,9 @@ function b(e) {
|
|
|
479
478
|
let t = p.idJO;
|
|
480
479
|
t !== void 0 && (p.idJo = t, delete p.idJO);
|
|
481
480
|
let r = p.DateSeance;
|
|
482
|
-
|
|
481
|
+
s.strictEqual(typeof r, "string");
|
|
483
482
|
let i = r;
|
|
484
|
-
|
|
483
|
+
s(/^\d{4}-\d{2}-\d{2}\+\d{2}:00$/.test(i)), p.dateSeance = new Date(i.split("+")[0]), delete p.DateSeance;
|
|
485
484
|
}
|
|
486
485
|
let m = t.infosReunionsInternationale;
|
|
487
486
|
if (m !== void 0) {
|
|
@@ -489,25 +488,25 @@ function b(e) {
|
|
|
489
488
|
let e = m.listePays;
|
|
490
489
|
if (e != null) {
|
|
491
490
|
let t = Array.isArray(e) ? e : e.paysRef;
|
|
492
|
-
Array.isArray(t) || (
|
|
491
|
+
Array.isArray(t) || (s.strictEqual(typeof t, "string"), t = [t]), m.listePays = t;
|
|
493
492
|
}
|
|
494
493
|
}
|
|
495
494
|
return t;
|
|
496
495
|
}
|
|
497
496
|
//#endregion
|
|
498
497
|
//#region src/cleaners/scrutins.ts
|
|
499
|
-
function
|
|
498
|
+
function S(e) {
|
|
500
499
|
return "votant" in e;
|
|
501
500
|
}
|
|
502
|
-
function
|
|
501
|
+
function C(e) {
|
|
503
502
|
if (e == null) return;
|
|
504
|
-
if (typeof e == "string") return
|
|
503
|
+
if (typeof e == "string") return s.strictEqual(e, "0"), [];
|
|
505
504
|
if (Array.isArray(e)) {
|
|
506
505
|
let t = e.filter((e) => e !== null);
|
|
507
|
-
if (t.length === 0 || !
|
|
506
|
+
if (t.length === 0 || !S(t[0])) return t;
|
|
508
507
|
let n = [];
|
|
509
508
|
for (let e of t) {
|
|
510
|
-
|
|
509
|
+
s(S(e));
|
|
511
510
|
let t = e.votant;
|
|
512
511
|
Array.isArray(t) ? n.push(...t) : n.push(t);
|
|
513
512
|
}
|
|
@@ -516,99 +515,103 @@ function S(e) {
|
|
|
516
515
|
let t = [], n = e.votant;
|
|
517
516
|
return Array.isArray(n) ? t.push(...n) : t.push(n), t;
|
|
518
517
|
}
|
|
519
|
-
function
|
|
518
|
+
function w(e) {
|
|
520
519
|
n(e);
|
|
521
520
|
let t = e.nonVotants ?? e.nonVotant;
|
|
522
|
-
if (e.nonVotants === void 0 ? delete e.nonVotant :
|
|
523
|
-
let n =
|
|
521
|
+
if (e.nonVotants === void 0 ? delete e.nonVotant : s.strictEqual(e.nonVotant, void 0), t !== void 0) {
|
|
522
|
+
let n = C(t);
|
|
524
523
|
if (n !== void 0 && n.length === 0) delete e.nonVotants;
|
|
525
524
|
else if (n !== void 0) {
|
|
526
525
|
e.nonVotants = n;
|
|
527
|
-
for (let e of n)
|
|
526
|
+
for (let e of n) D(e);
|
|
528
527
|
}
|
|
529
528
|
}
|
|
530
529
|
let r = e.pour ?? e.pours;
|
|
531
|
-
if (e.pour === void 0 ? delete e.pours :
|
|
532
|
-
let t =
|
|
533
|
-
if (
|
|
530
|
+
if (e.pour === void 0 ? delete e.pours : s.strictEqual(e.pours, void 0), r !== void 0) {
|
|
531
|
+
let t = C(r);
|
|
532
|
+
if (s(t), t.length === 0) delete e.pour;
|
|
534
533
|
else {
|
|
535
534
|
e.pour = t;
|
|
536
|
-
for (let e of t)
|
|
535
|
+
for (let e of t) D(e);
|
|
537
536
|
}
|
|
538
537
|
}
|
|
539
538
|
let i = e.contre ?? e.contres;
|
|
540
|
-
if (e.contre === void 0 ? delete e.contres :
|
|
541
|
-
let t =
|
|
542
|
-
if (
|
|
539
|
+
if (e.contre === void 0 ? delete e.contres : s.strictEqual(e.contres, void 0), i !== void 0) {
|
|
540
|
+
let t = C(i);
|
|
541
|
+
if (s(t), t.length === 0) delete e.contre;
|
|
543
542
|
else {
|
|
544
543
|
e.contre = t;
|
|
545
|
-
for (let e of t)
|
|
544
|
+
for (let e of t) D(e);
|
|
546
545
|
}
|
|
547
546
|
}
|
|
548
547
|
let a = e.abstentions ?? e.abstention;
|
|
549
|
-
if (e.abstentions === void 0 ? delete e.abstention :
|
|
550
|
-
let t =
|
|
551
|
-
if (
|
|
548
|
+
if (e.abstentions === void 0 ? delete e.abstention : s.strictEqual(e.abstention, void 0), a !== void 0) {
|
|
549
|
+
let t = C(a);
|
|
550
|
+
if (s(t), t.length === 0) delete e.abstentions;
|
|
552
551
|
else {
|
|
553
552
|
e.abstentions = t;
|
|
554
|
-
for (let e of t)
|
|
553
|
+
for (let e of t) D(e);
|
|
555
554
|
}
|
|
556
555
|
}
|
|
557
|
-
let
|
|
558
|
-
if (
|
|
559
|
-
let t =
|
|
560
|
-
if (
|
|
556
|
+
let o = e.nonVotantsVolontaires;
|
|
557
|
+
if (o !== void 0) {
|
|
558
|
+
let t = C(o);
|
|
559
|
+
if (s(t), t.length === 0) delete e.nonVotantsVolontaires;
|
|
561
560
|
else {
|
|
562
561
|
e.nonVotantsVolontaires = t;
|
|
563
|
-
for (let e of t)
|
|
562
|
+
for (let e of t) D(e);
|
|
564
563
|
}
|
|
565
564
|
}
|
|
566
565
|
}
|
|
567
|
-
function w(e) {
|
|
568
|
-
n(e), e.abstention !== void 0 && (o.strictEqual(e.abstentions, void 0), e.abstentions = e.abstention, delete e.abstention), e.nonVotant !== void 0 && (o.strictEqual(e.nonVotants, void 0), e.nonVotants = e.nonVotant, delete e.nonVotant);
|
|
569
|
-
}
|
|
570
566
|
function T(e) {
|
|
567
|
+
n(e), e.abstention !== void 0 && (s.strictEqual(e.abstentions, void 0), e.abstentions = e.abstention, delete e.abstention), e.nonVotant !== void 0 && (s.strictEqual(e.nonVotants, void 0), e.nonVotants = e.nonVotant, delete e.nonVotant);
|
|
568
|
+
}
|
|
569
|
+
function E(e) {
|
|
571
570
|
let t = e;
|
|
572
571
|
n(t);
|
|
573
572
|
let r = t.demandeur;
|
|
574
|
-
n(r),
|
|
573
|
+
n(r), s.strictEqual(r.referenceLegislative, void 0);
|
|
575
574
|
let i = t.objet;
|
|
576
|
-
n(i),
|
|
575
|
+
n(i), s.strictEqual(i.referenceLegislative, void 0);
|
|
577
576
|
let a = t.miseAuPoint;
|
|
578
577
|
if (a !== void 0) {
|
|
579
|
-
|
|
578
|
+
w(a);
|
|
580
579
|
let e = a.dysfonctionnement;
|
|
581
|
-
e !== void 0 && (
|
|
580
|
+
e !== void 0 && (w(e), Object.values(e).every((e) => e === void 0) && delete a.dysfonctionnement), Object.values(a).every((e) => e === void 0) && delete t.miseAuPoint;
|
|
582
581
|
}
|
|
583
|
-
let
|
|
584
|
-
|
|
582
|
+
let o = t.syntheseVote;
|
|
583
|
+
T(o.decompte);
|
|
585
584
|
let c = t.ventilationVotes.organe;
|
|
586
|
-
|
|
585
|
+
s(c);
|
|
587
586
|
let l = c.groupes.groupe;
|
|
588
|
-
|
|
587
|
+
s(Array.isArray(l));
|
|
589
588
|
for (let e of l) {
|
|
590
589
|
let t = e.vote;
|
|
591
|
-
|
|
590
|
+
T(t.decompteVoix), w(t.decompteNominatif);
|
|
592
591
|
}
|
|
593
592
|
return t.ventilationVotes = {
|
|
594
593
|
...c,
|
|
595
594
|
groupes: l
|
|
596
595
|
}, t;
|
|
597
596
|
}
|
|
598
|
-
function
|
|
597
|
+
function D(e) {
|
|
599
598
|
r(e, "parDelegation"), i(e, "numPlace");
|
|
600
599
|
}
|
|
601
600
|
//#endregion
|
|
602
601
|
//#region src/cleaners/questions.ts
|
|
603
|
-
function
|
|
602
|
+
function O(t) {
|
|
604
603
|
let r = e.parse(t);
|
|
605
604
|
return n(r, { recursive: !0 }), r;
|
|
606
605
|
}
|
|
607
606
|
//#endregion
|
|
608
607
|
//#region src/cleaners/debats.ts
|
|
609
|
-
function
|
|
610
|
-
let r = t.
|
|
611
|
-
|
|
608
|
+
function k(e) {
|
|
609
|
+
let r = t.safeParse(e);
|
|
610
|
+
if (r.success) {
|
|
611
|
+
let e = r.data;
|
|
612
|
+
return n(e, { recursive: !0 }), e;
|
|
613
|
+
}
|
|
614
|
+
return o.parse(e);
|
|
612
615
|
}
|
|
613
616
|
//#endregion
|
|
614
|
-
export {
|
|
617
|
+
export { c as cleanActeur, a as cleanAmendement, k as cleanCompteRendu, d as cleanDocumentOrDivision, _ as cleanDossierParlementaire, y as cleanOrgane, O as cleanQuestion, x as cleanReunion, E as cleanScrutin };
|
package/lib/datasets.d.ts
CHANGED
|
@@ -34,6 +34,7 @@ export declare enum EnabledDatasets {
|
|
|
34
34
|
ComptesRendus = 128,
|
|
35
35
|
All = 255
|
|
36
36
|
}
|
|
37
|
+
export declare function getEnabledDatasetNames(): string[];
|
|
37
38
|
export declare function getDatasets(): string[];
|
|
38
39
|
export declare function validDataset(dir: string[]): boolean;
|
|
39
40
|
export declare function getSchemas(): string[];
|
package/lib/git.js
CHANGED
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
import e from "fs-extra";
|
|
2
2
|
import t from "node:path";
|
|
3
|
-
import {
|
|
3
|
+
import { execFileSync as n } from "node:child_process";
|
|
4
4
|
//#region src/git.ts
|
|
5
5
|
var r = 50 * 1024 * 1024;
|
|
6
|
-
function i(
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
function i(e) {
|
|
7
|
+
return Array.isArray(e) ? e : e.trim().split(/\s+/).filter(Boolean);
|
|
8
|
+
}
|
|
9
|
+
function a(e, { cwd: t, encoding: r = "utf-8", maxBuffer: a, stdio: o }) {
|
|
10
|
+
return n("git", i(e), {
|
|
11
|
+
cwd: t,
|
|
9
12
|
env: process.env,
|
|
10
|
-
encoding:
|
|
13
|
+
encoding: r,
|
|
14
|
+
maxBuffer: a,
|
|
15
|
+
stdio: o
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
function o(n) {
|
|
19
|
+
e.existsSync(t.join(n, ".git")) || (e.ensureDirSync(n), a(["init"], {
|
|
20
|
+
cwd: n,
|
|
11
21
|
stdio: [
|
|
12
22
|
"ignore",
|
|
13
23
|
"ignore",
|
|
@@ -15,11 +25,9 @@ function i(r) {
|
|
|
15
25
|
]
|
|
16
26
|
}));
|
|
17
27
|
}
|
|
18
|
-
function
|
|
19
|
-
|
|
28
|
+
function s(e, t) {
|
|
29
|
+
o(e), a(["add", "."], {
|
|
20
30
|
cwd: e,
|
|
21
|
-
env: process.env,
|
|
22
|
-
encoding: "utf-8",
|
|
23
31
|
stdio: [
|
|
24
32
|
"ignore",
|
|
25
33
|
"ignore",
|
|
@@ -28,10 +36,13 @@ function a(e, t) {
|
|
|
28
36
|
maxBuffer: r
|
|
29
37
|
});
|
|
30
38
|
try {
|
|
31
|
-
return
|
|
39
|
+
return a([
|
|
40
|
+
"commit",
|
|
41
|
+
"-m",
|
|
42
|
+
t,
|
|
43
|
+
"--quiet"
|
|
44
|
+
], {
|
|
32
45
|
cwd: e,
|
|
33
|
-
env: process.env,
|
|
34
|
-
encoding: "utf-8",
|
|
35
46
|
stdio: [
|
|
36
47
|
"ignore",
|
|
37
48
|
"pipe",
|
|
@@ -44,13 +55,15 @@ function a(e, t) {
|
|
|
44
55
|
return !1;
|
|
45
56
|
}
|
|
46
57
|
}
|
|
47
|
-
function
|
|
48
|
-
let
|
|
49
|
-
if (
|
|
50
|
-
|
|
58
|
+
function c(e, t, n) {
|
|
59
|
+
let r = 0;
|
|
60
|
+
if (s(e, t)) for (let t of n || []) try {
|
|
61
|
+
a([
|
|
62
|
+
"push",
|
|
63
|
+
t,
|
|
64
|
+
"master"
|
|
65
|
+
], {
|
|
51
66
|
cwd: e,
|
|
52
|
-
env: process.env,
|
|
53
|
-
encoding: "utf-8",
|
|
54
67
|
stdio: [
|
|
55
68
|
"ignore",
|
|
56
69
|
"ignore",
|
|
@@ -59,25 +72,25 @@ function o(e, t, r) {
|
|
|
59
72
|
});
|
|
60
73
|
} catch (e) {
|
|
61
74
|
let t = e;
|
|
62
|
-
console.error(t.output),
|
|
75
|
+
console.error(t.output), r = t.status ?? 1;
|
|
63
76
|
}
|
|
64
|
-
else
|
|
65
|
-
return
|
|
77
|
+
else r = 10;
|
|
78
|
+
return r;
|
|
66
79
|
}
|
|
67
|
-
function
|
|
68
|
-
return
|
|
80
|
+
function l(e) {
|
|
81
|
+
return a([
|
|
82
|
+
"reset",
|
|
83
|
+
"--hard",
|
|
84
|
+
"origin/master"
|
|
85
|
+
], {
|
|
69
86
|
cwd: e,
|
|
70
|
-
env: process.env,
|
|
71
|
-
encoding: "utf-8",
|
|
72
87
|
stdio: [
|
|
73
88
|
"ignore",
|
|
74
89
|
"ignore",
|
|
75
90
|
"pipe"
|
|
76
91
|
]
|
|
77
|
-
}),
|
|
92
|
+
}), a(["pull", "--rebase"], {
|
|
78
93
|
cwd: e,
|
|
79
|
-
env: process.env,
|
|
80
|
-
encoding: "utf-8",
|
|
81
94
|
stdio: [
|
|
82
95
|
"ignore",
|
|
83
96
|
"ignore",
|
|
@@ -85,11 +98,9 @@ function s(e) {
|
|
|
85
98
|
]
|
|
86
99
|
}), !0;
|
|
87
100
|
}
|
|
88
|
-
function
|
|
89
|
-
e !== void 0 &&
|
|
90
|
-
cwd:
|
|
91
|
-
env: process.env,
|
|
92
|
-
encoding: "utf-8",
|
|
101
|
+
function u(e, t, n) {
|
|
102
|
+
e !== void 0 && a(["clone", `${e}/${t}.git`], {
|
|
103
|
+
cwd: n,
|
|
93
104
|
stdio: [
|
|
94
105
|
"ignore",
|
|
95
106
|
"ignore",
|
|
@@ -97,24 +108,24 @@ function c(e, t, r) {
|
|
|
97
108
|
]
|
|
98
109
|
});
|
|
99
110
|
}
|
|
100
|
-
function
|
|
111
|
+
function d(e, t, n) {
|
|
101
112
|
try {
|
|
102
|
-
|
|
103
|
-
let
|
|
113
|
+
n && console.log(`git -C ${e} ${t}`);
|
|
114
|
+
let i = a(t, {
|
|
104
115
|
cwd: e,
|
|
105
116
|
maxBuffer: r
|
|
106
|
-
}).
|
|
107
|
-
return
|
|
117
|
+
}).trim();
|
|
118
|
+
return n && console.log(i), i;
|
|
108
119
|
} catch (e) {
|
|
109
120
|
let t = e;
|
|
110
121
|
for (let e of ["stdout", "stderr"]) console.error(`${e}: ${String(t[e] ?? "")}`);
|
|
111
122
|
throw e;
|
|
112
123
|
}
|
|
113
124
|
}
|
|
114
|
-
function
|
|
125
|
+
function f(e, t, n) {
|
|
115
126
|
try {
|
|
116
|
-
|
|
117
|
-
let
|
|
127
|
+
n && console.log(`git -C ${e} ${t}`);
|
|
128
|
+
let i = a(t, {
|
|
118
129
|
cwd: e,
|
|
119
130
|
stdio: [
|
|
120
131
|
"ignore",
|
|
@@ -122,17 +133,17 @@ function u(e, t, i) {
|
|
|
122
133
|
"pipe"
|
|
123
134
|
],
|
|
124
135
|
maxBuffer: r
|
|
125
|
-
}).
|
|
126
|
-
return
|
|
136
|
+
}).trim();
|
|
137
|
+
return n && console.log(i), !0;
|
|
127
138
|
} catch (e) {
|
|
128
139
|
if (e.status != 0) return !1;
|
|
129
140
|
throw e;
|
|
130
141
|
}
|
|
131
142
|
}
|
|
132
|
-
function
|
|
143
|
+
function p(e, t, n = {}) {
|
|
133
144
|
let { diffFilter: r } = n;
|
|
134
145
|
try {
|
|
135
|
-
let n =
|
|
146
|
+
let n = d(e, `diff --name-status --diff-filter=${r ?? "AMR"} ${t}`, !1), i = /* @__PURE__ */ new Map();
|
|
136
147
|
for (let e of n.split("\n")) {
|
|
137
148
|
if (e.trim().length === 0) continue;
|
|
138
149
|
let t = e.split(" ");
|
|
@@ -147,4 +158,4 @@ function d(e, t, n = {}) {
|
|
|
147
158
|
}
|
|
148
159
|
}
|
|
149
160
|
//#endregion
|
|
150
|
-
export {
|
|
161
|
+
export { u as clone, s as commit, c as commitAndPush, p as getChangedFilesSinceCommit, o as initRepo, l as resetAndPull, d as run, f as test };
|
package/lib/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as e, F as t, I as n, L as r, M as i, N as a, O as o, P as s, R as c, _ as l, a as ee, c as te, d as ne, f as re, g as ie, h as ae, i as oe, j as se, k as ce, l as le, m as ue, n as de, o as fe, p as pe, r as me, s as he, t as ge, u as _e, v as ve, y as ye, z as be } from "./amendements-
|
|
2
|
-
import { $ as xe, A as u, At as d, B as f, C as p, Ct as m, D as h, Dt as g, E as _, Et as v, G as y, I as b, It as x, J as S, K as C, L as w, M as T, Mt as E, N as D, Nt as O, O as k, Ot as A, P as j, Pt as M, Q as Se, R as Ce, S as we, St as Te, T as Ee, Tt as De, U as Oe, V as ke, W as Ae, X as je, Y as Me, Z as Ne, _ as Pe, _t as Fe, a as Ie, at as Le, b as Re, bt as ze, c as Be, ct as Ve, d as He, dt as Ue, et as We, f as Ge, ft as Ke, g as qe, gt as Je, h as Ye, ht as Xe, i as Ze, it as Qe, j as N, jt as $e, k as et, kt as tt, l as nt, lt as rt, m as it, mt as at, n as ot, nt as st, o as ct, ot as lt, p as ut, pt as dt, q as ft, rt as pt, st as mt, tt as ht, u as gt, ut as _t, v as vt, vt as yt, w as bt, wt as xt, x as St, xt as Ct, y as wt, yt as Tt, z as Et } from "./questions-
|
|
1
|
+
import { A as e, F as t, I as n, L as r, M as i, N as a, O as o, P as s, R as c, _ as l, a as ee, c as te, d as ne, f as re, g as ie, h as ae, i as oe, j as se, k as ce, l as le, m as ue, n as de, o as fe, p as pe, r as me, s as he, t as ge, u as _e, v as ve, y as ye, z as be } from "./amendements-D3Jr9MQa.js";
|
|
2
|
+
import { $ as xe, A as u, At as d, B as f, C as p, Ct as m, D as h, Dt as g, E as _, Et as v, G as y, I as b, It as x, J as S, K as C, L as w, M as T, Mt as E, N as D, Nt as O, O as k, Ot as A, P as j, Pt as M, Q as Se, R as Ce, S as we, St as Te, T as Ee, Tt as De, U as Oe, V as ke, W as Ae, X as je, Y as Me, Z as Ne, _ as Pe, _t as Fe, a as Ie, at as Le, b as Re, bt as ze, c as Be, ct as Ve, d as He, dt as Ue, et as We, f as Ge, ft as Ke, g as qe, gt as Je, h as Ye, ht as Xe, i as Ze, it as Qe, j as N, jt as $e, k as et, kt as tt, l as nt, lt as rt, m as it, mt as at, n as ot, nt as st, o as ct, ot as lt, p as ut, pt as dt, q as ft, rt as pt, st as mt, tt as ht, u as gt, ut as _t, v as vt, vt as yt, w as bt, wt as xt, x as St, xt as Ct, y as wt, yt as Tt, z as Et } from "./questions-CsNQoayp.js";
|
|
3
3
|
//#region src/api.ts
|
|
4
4
|
var P = /* @__PURE__ */ function(e) {
|
|
5
5
|
return e.Amendements = "amendements", e;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as e, D as t, S as n, b as r, t as i, w as a, x as o } from "./amendements-
|
|
2
|
-
import { C as s, Ct as c, Ft as l, S as u, St as d, T as f, U as p, _ as m, _t as h, b as g, bt as _, d as v, f as y, g as ee, gt as b, h as te, ht as x, m as ne, mt as re, p as ie, pt as S, r as C, s as w, t as T, v as ae, vt as E, w as oe, x as se, xt as ce, y as le, yt as ue } from "./questions-
|
|
1
|
+
import { C as e, D as t, S as n, b as r, t as i, w as a, x as o } from "./amendements-D3Jr9MQa.js";
|
|
2
|
+
import { C as s, Ct as c, Ft as l, S as u, St as d, T as f, U as p, _ as m, _t as h, b as g, bt as _, d as v, f as y, g as ee, gt as b, h as te, ht as x, m as ne, mt as re, p as ie, pt as S, r as C, s as w, t as T, v as ae, vt as E, w as oe, x as se, xt as ce, y as le, yt as ue } from "./questions-CsNQoayp.js";
|
|
3
3
|
import { getChangedFilesSinceCommit as D } from "./git.js";
|
|
4
4
|
import { z as O } from "zod";
|
|
5
5
|
import k from "node:assert";
|
|
@@ -13,6 +13,7 @@ var M = /* @__PURE__ */ function(e) {
|
|
|
13
13
|
}({}), N = /* @__PURE__ */ function(e) {
|
|
14
14
|
return e[e.None = 0] = "None", e[e.ActeursEtOrganes = 1] = "ActeursEtOrganes", e[e.Agendas = 2] = "Agendas", e[e.Amendements = 4] = "Amendements", e[e.DossiersLegislatifs = 8] = "DossiersLegislatifs", e[e.Photos = 16] = "Photos", e[e.Scrutins = 32] = "Scrutins", e[e.Questions = 64] = "Questions", e[e.ComptesRendus = 128] = "ComptesRendus", e[e.All = 255] = "All", e;
|
|
15
15
|
}({});
|
|
16
|
+
Object.keys(N).filter((e) => Number.isNaN(Number(e)) && e !== "None" && e !== "All");
|
|
16
17
|
//#endregion
|
|
17
18
|
//#region src/file_systems.ts
|
|
18
19
|
function* P(e, t = []) {
|
|
@@ -1321,4 +1322,4 @@ async function $(e, t) {
|
|
|
1321
1322
|
await A.pathExists(n) && await A.remove(n), await A.pathExists(j.join(t, `${e.filename}.temp`, "json")) ? await A.move(j.join(t, `${e.filename}.temp`, "json"), n) : await A.mkdir(n);
|
|
1322
1323
|
}
|
|
1323
1324
|
//#endregion
|
|
1324
|
-
export {
|
|
1325
|
+
export { P as C, G as S, Pt as _, Ct as a, It as b, Dt as c, kt as d, At as f, zt as g, Nt as h, Ot as i, Tt as l, Mt as m, bt as n, wt as o, jt as p, St as r, xt as s, Z as t, Et as u, Ft as v, N as w, Lt as x, Rt as y };
|
package/lib/loaders.js
CHANGED
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
|
|
3
|
-
import { C as e, S as t, _ as n, a as r, b as i, c as a, d as o, f as s, g as c, h as l, i as u, l as d, m as f, n as p, o as m, p as h, r as g, s as _, t as v, u as y, v as b, x, y as S } from "./loaders-BjOHOabR.js";
|
|
4
|
-
export { e as EnabledDatasets, v as datasets, p as iterLoadAssembleeActeurs, g as iterLoadAssembleeAmendements, u as iterLoadAssembleeComptesRendus, r as iterLoadAssembleeDocuments, m as iterLoadAssembleeDossiersParlementaires, _ as iterLoadAssembleeOrganes, a as iterLoadAssembleeQuestions, d as iterLoadAssembleeReunions, y as iterLoadAssembleeScrutins, o as loadAssembleeData, s as loadAssembleeDataFromBigFiles, h as loadAssembleeDocumentFile, f as loadAssembleePhotosDeputes, l as loadAssembleePhotosSenateurs, c as pathFromCompteRenduUid, n as pathFromDocumentUid, b as pathFromDossierParlementaireUid, S as pathFromQuestionUid, i as pathFromReunionUid, x as pathFromScrutinUid, t as walkDir };
|
|
1
|
+
import { C as e, _ as t, a as n, b as r, c as i, d as a, f as o, g as s, h as c, i as l, l as u, m as d, n as f, o as p, p as m, r as h, s as g, t as _, u as v, v as y, w as b, x, y as S } from "./loaders-CY8EGNSM.js";
|
|
2
|
+
export { b as EnabledDatasets, _ as datasets, f as iterLoadAssembleeActeurs, h as iterLoadAssembleeAmendements, l as iterLoadAssembleeComptesRendus, n as iterLoadAssembleeDocuments, p as iterLoadAssembleeDossiersParlementaires, g as iterLoadAssembleeOrganes, i as iterLoadAssembleeQuestions, u as iterLoadAssembleeReunions, v as iterLoadAssembleeScrutins, a as loadAssembleeData, o as loadAssembleeDataFromBigFiles, m as loadAssembleeDocumentFile, d as loadAssembleePhotosDeputes, c as loadAssembleePhotosSenateurs, s as pathFromCompteRenduUid, t as pathFromDocumentUid, y as pathFromDossierParlementaireUid, S as pathFromQuestionUid, r as pathFromReunionUid, x as pathFromScrutinUid, e as walkDir };
|
package/lib/parsers.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as e, H as t, U as n, V as r, t as i } from "./amendements-
|
|
2
|
-
import { t as a } from "./amendements-
|
|
1
|
+
import { B as e, H as t, U as n, V as r, t as i } from "./amendements-D3Jr9MQa.js";
|
|
2
|
+
import { t as a } from "./amendements-DaB_5WaI.js";
|
|
3
3
|
import o from "node:assert";
|
|
4
4
|
import s from "fs-extra";
|
|
5
5
|
import c from "node:path";
|
|
@@ -8495,7 +8495,7 @@ async function* Gu(t, n, i, a, p, m = {}) {
|
|
|
8495
8495
|
continue;
|
|
8496
8496
|
}
|
|
8497
8497
|
if (v !== null && u(v).body === ne) continue;
|
|
8498
|
-
m.verbose && (v === null ?
|
|
8498
|
+
m.verbose && console.log(v === null ? `Adding amendement search cache: ${_}…` : `Updating amendement search cache: ${_}…`);
|
|
8499
8499
|
let y = new URL(h, "https://www.assemblee-nationale.fr/").toString(), ie = await fetch(y);
|
|
8500
8500
|
if (ie.status === 404) {
|
|
8501
8501
|
console.log(`Amendement HTML page not found at ${y}. Skipping.`);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as e, D as t, E as n, S as r, T as i, b as a, w as o, x as s } from "./amendements-
|
|
1
|
+
import { C as e, D as t, E as n, S as r, T as i, b as a, w as o, x as s } from "./amendements-D3Jr9MQa.js";
|
|
2
2
|
import { z as c } from "zod";
|
|
3
3
|
//#region src/legislatures.ts
|
|
4
4
|
var l = /* @__PURE__ */ function(e) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tricoteuses/assemblee",
|
|
3
|
-
"version": "3.1
|
|
3
|
+
"version": "3.2.1",
|
|
4
4
|
"description": "Retrieve, clean up & handle French Assemblée nationale's open data",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Assemblée nationale",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"date-fns": "^4.1.0",
|
|
92
92
|
"deep-equal": "^2.2.3",
|
|
93
93
|
"deep-object-diff": "^1.1.9",
|
|
94
|
-
"fast-xml-parser": "^5.5.
|
|
94
|
+
"fast-xml-parser": "^5.5.9",
|
|
95
95
|
"front-matter": "^4.0.2",
|
|
96
96
|
"fs-extra": "^11.3.4",
|
|
97
97
|
"glob": "^13.0.6",
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
"@types/temp": "^0.9.4",
|
|
113
113
|
"@types/unzipper": "^0.10.11",
|
|
114
114
|
"ajv": "^8.18.0",
|
|
115
|
-
"eslint": "^10.0
|
|
115
|
+
"eslint": "^10.1.0",
|
|
116
116
|
"globals": "^17.4.0",
|
|
117
117
|
"prettier": "^3.8.1",
|
|
118
118
|
"rimraf": "^6.1.3",
|
|
@@ -120,11 +120,11 @@
|
|
|
120
120
|
"ts-json-schema-generator": "^2.9.0",
|
|
121
121
|
"tslib": "^2.8.1",
|
|
122
122
|
"tsx": "^4.21.0",
|
|
123
|
-
"typedoc": "^0.28.
|
|
124
|
-
"typedoc-plugin-markdown": "^4.
|
|
123
|
+
"typedoc": "^0.28.18",
|
|
124
|
+
"typedoc-plugin-markdown": "^4.11.0",
|
|
125
125
|
"typescript": "^5.9.3",
|
|
126
|
-
"typescript-eslint": "^8.57.
|
|
127
|
-
"vite": "^8.0.
|
|
126
|
+
"typescript-eslint": "^8.57.2",
|
|
127
|
+
"vite": "^8.0.3",
|
|
128
128
|
"vite-plugin-dts": "^4.5.4"
|
|
129
129
|
},
|
|
130
130
|
"overrides": {
|