@tricoteuses/assemblee 3.0.16 → 3.0.17
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/lib/datasets.d.ts +3 -1
- package/lib/loaders.js +46 -46
- package/package.json +1 -1
package/lib/datasets.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export interface Datasets {
|
|
|
18
18
|
questions: Dataset[];
|
|
19
19
|
comptesRendusSeances: Dataset[];
|
|
20
20
|
comptesRendusCommissions: Dataset[];
|
|
21
|
+
comptesRendus: Dataset[];
|
|
21
22
|
}
|
|
22
23
|
export declare enum DatasetStructure {
|
|
23
24
|
SingleFile = 0,
|
|
@@ -34,7 +35,8 @@ export declare enum EnabledDatasets {
|
|
|
34
35
|
Questions = 64,
|
|
35
36
|
ComptesRendusSeances = 128,
|
|
36
37
|
ComptesRendusCommissions = 256,
|
|
37
|
-
|
|
38
|
+
ComptesRendus = 512,
|
|
39
|
+
All = 1023
|
|
38
40
|
}
|
|
39
41
|
export declare function getDatasets(): string[];
|
|
40
42
|
export declare function validDataset(dir: string[]): boolean;
|
package/lib/loaders.js
CHANGED
|
@@ -6,9 +6,9 @@ import "node:fs/promises";
|
|
|
6
6
|
import { getChangedFilesSinceCommit as ue } from "./git.js";
|
|
7
7
|
import { z as e } from "zod";
|
|
8
8
|
import { E as x, F as Y, G as K, H as T, I as z, J as V, B as ie } from "./amendements-Bab1iUCY.js";
|
|
9
|
-
import { C as me, D as se, F as
|
|
9
|
+
import { C as me, D as se, F as ve, j as de, L as pe, e as ge, M as Ie, b as Fe, P as Ve, R as De, O as Pe, a0 as fe, Y as Xe, aa as Oe, a2 as we, _ as qe, W as Le, a8 as Re, a4 as xe, a6 as $e, ao as l, ap as oe, aq as W, ar as ae, ac as Me, af as Ne, ag as ze, ab as ke, ad as Te, ae as Ue } from "./questions-DgERya4J.js";
|
|
10
10
|
import { D as Je } from "./questions-C3qN4PsC.js";
|
|
11
|
-
var h = /* @__PURE__ */ ((t) => (t[t.SingleFile = 0] = "SingleFile", t[t.SegmentedFiles = 1] = "SegmentedFiles", t))(h || {}), F = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.ActeursEtOrganes = 1] = "ActeursEtOrganes", t[t.Agendas = 2] = "Agendas", t[t.Amendements = 4] = "Amendements", t[t.DossiersLegislatifs = 8] = "DossiersLegislatifs", t[t.Photos = 16] = "Photos", t[t.Scrutins = 32] = "Scrutins", t[t.Questions = 64] = "Questions", t[t.ComptesRendusSeances = 128] = "ComptesRendusSeances", t[t.ComptesRendusCommissions = 256] = "ComptesRendusCommissions", t[t.All =
|
|
11
|
+
var h = /* @__PURE__ */ ((t) => (t[t.SingleFile = 0] = "SingleFile", t[t.SegmentedFiles = 1] = "SegmentedFiles", t))(h || {}), F = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.ActeursEtOrganes = 1] = "ActeursEtOrganes", t[t.Agendas = 2] = "Agendas", t[t.Amendements = 4] = "Amendements", t[t.DossiersLegislatifs = 8] = "DossiersLegislatifs", t[t.Photos = 16] = "Photos", t[t.Scrutins = 32] = "Scrutins", t[t.Questions = 64] = "Questions", t[t.ComptesRendusSeances = 128] = "ComptesRendusSeances", t[t.ComptesRendusCommissions = 256] = "ComptesRendusCommissions", t[t.ComptesRendus = 512] = "ComptesRendus", t[t.All = 1023] = "All", t))(F || {});
|
|
12
12
|
function* R(t, n = []) {
|
|
13
13
|
const i = s.join(t, ...n);
|
|
14
14
|
if (r.existsSync(i))
|
|
@@ -46,7 +46,7 @@ const Qe = [
|
|
|
46
46
|
description: "L'état civil est la situation de la personne dans la société, résultat d'une procédure écrite d'identification administrative."
|
|
47
47
|
}), Ge = e.object({
|
|
48
48
|
catSocPro: e.string().optional().meta({ description: "Catégorie socio professionelle de l'INSEE." }),
|
|
49
|
-
famSocPro:
|
|
49
|
+
famSocPro: ve.optional().meta({
|
|
50
50
|
description: "Famille socio professionelle de l'INSEE."
|
|
51
51
|
})
|
|
52
52
|
}), He = e.object({
|
|
@@ -373,7 +373,7 @@ const Z = {
|
|
|
373
373
|
qualite: e.string().optional()
|
|
374
374
|
}).meta({ description: "Orateur de la séance du débat." }), At = e.object({
|
|
375
375
|
orateur: V(ne)
|
|
376
|
-
}),
|
|
376
|
+
}), Ct = e.union([
|
|
377
377
|
At,
|
|
378
378
|
V(ne),
|
|
379
379
|
ne,
|
|
@@ -391,7 +391,7 @@ const Z = {
|
|
|
391
391
|
code_style: e.string().optional(),
|
|
392
392
|
code_parole: e.string().optional(),
|
|
393
393
|
valeur: e.string().optional(),
|
|
394
|
-
orateurs:
|
|
394
|
+
orateurs: Ct.optional(),
|
|
395
395
|
texte: e.union([k, e.string()]).optional(),
|
|
396
396
|
paragraphe: V(M).optional(),
|
|
397
397
|
interExtraction: V(M).optional(),
|
|
@@ -416,7 +416,7 @@ const Z = {
|
|
|
416
416
|
qualite: e.string().optional(),
|
|
417
417
|
nom_orateur: e.string().optional()
|
|
418
418
|
}).meta({ description: "Point de la séance du débat." })
|
|
419
|
-
),
|
|
419
|
+
), vt = e.object({
|
|
420
420
|
point: M
|
|
421
421
|
}), It = e.object({
|
|
422
422
|
journee: e.string(),
|
|
@@ -425,7 +425,7 @@ const Z = {
|
|
|
425
425
|
quantiemes: It,
|
|
426
426
|
ouvertureSeance: V(M).optional(),
|
|
427
427
|
point: V(M),
|
|
428
|
-
finSeance:
|
|
428
|
+
finSeance: vt.optional(),
|
|
429
429
|
paragraphe: V(M).optional()
|
|
430
430
|
}).meta({ description: "Contenu de la séance du débat." }), Vt = e.object({
|
|
431
431
|
id_syceron: e.string(),
|
|
@@ -1381,26 +1381,26 @@ const le = {
|
|
|
1381
1381
|
};
|
|
1382
1382
|
function* N(t, n, i, o, p, { log: f = !1, noValidation: _ = !1, sinceCommits: m } = {}) {
|
|
1383
1383
|
const S = /* @__PURE__ */ new Set();
|
|
1384
|
-
for (const
|
|
1385
|
-
if (
|
|
1384
|
+
for (const C of i) {
|
|
1385
|
+
if (C.ignoreForWeb || !Ht(n, C))
|
|
1386
1386
|
continue;
|
|
1387
|
-
const
|
|
1387
|
+
const v = s.join(t, `${C.name}_nettoye`), I = m ? m[C.name] : void 0, L = I ? ue(v, I, {
|
|
1388
1388
|
diffFilter: "AMR"
|
|
1389
1389
|
}) : null;
|
|
1390
1390
|
f && I && (console.log(
|
|
1391
|
-
`Filtering files changed since commit ${I} in ${
|
|
1391
|
+
`Filtering files changed since commit ${I} in ${v}`
|
|
1392
1392
|
), console.log(`Found ${L?.size || 0} changed files`));
|
|
1393
|
-
for (const D of R(
|
|
1393
|
+
for (const D of R(v, p)) {
|
|
1394
1394
|
if (!D[D.length - 1].endsWith(".json"))
|
|
1395
1395
|
continue;
|
|
1396
|
-
const X = s.join(
|
|
1396
|
+
const X = s.join(v, ...D), O = s.join(...D), w = L?.get(O);
|
|
1397
1397
|
if (L != null && w == null)
|
|
1398
1398
|
continue;
|
|
1399
1399
|
f && console.log(`Loading file: ${X}…`);
|
|
1400
1400
|
let a = r.readFileSync(X, { encoding: "utf8" });
|
|
1401
1401
|
const u = _ ? JSON.parse(a) : o(a);
|
|
1402
1402
|
S.has(u.uid) || (S.add(u.uid), yield {
|
|
1403
|
-
datasetLegislature:
|
|
1403
|
+
datasetLegislature: C.legislature,
|
|
1404
1404
|
filePath: X,
|
|
1405
1405
|
item: u,
|
|
1406
1406
|
...w && { gitStatus: w }
|
|
@@ -1408,18 +1408,18 @@ function* N(t, n, i, o, p, { log: f = !1, noValidation: _ = !1, sinceCommits: m
|
|
|
1408
1408
|
}
|
|
1409
1409
|
if (I) {
|
|
1410
1410
|
const D = ue(
|
|
1411
|
-
|
|
1411
|
+
v,
|
|
1412
1412
|
I,
|
|
1413
1413
|
{
|
|
1414
1414
|
diffFilter: "D"
|
|
1415
1415
|
}
|
|
1416
1416
|
);
|
|
1417
1417
|
for (const [$, X] of D.entries()) {
|
|
1418
|
-
const O = s.join(
|
|
1418
|
+
const O = s.join(v, $);
|
|
1419
1419
|
f && console.log(`Deleted file: ${O}`);
|
|
1420
1420
|
const a = { uid: s.parse($).name };
|
|
1421
1421
|
yield {
|
|
1422
|
-
datasetLegislature:
|
|
1422
|
+
datasetLegislature: C.legislature,
|
|
1423
1423
|
filePath: O,
|
|
1424
1424
|
item: a,
|
|
1425
1425
|
gitStatus: X
|
|
@@ -1683,7 +1683,7 @@ function Sn(t, n, i, { log: o = !1 } = {}) {
|
|
|
1683
1683
|
}
|
|
1684
1684
|
}
|
|
1685
1685
|
}
|
|
1686
|
-
const
|
|
1686
|
+
const C = {};
|
|
1687
1687
|
if (n & F.Amendements)
|
|
1688
1688
|
for (const a of A.amendements) {
|
|
1689
1689
|
if (a.ignoreForWeb || i !== l.All && a.legislature !== l.All && i !== a.legislature)
|
|
@@ -1700,10 +1700,10 @@ function Sn(t, n, i, { log: o = !1 } = {}) {
|
|
|
1700
1700
|
const j = r.readFileSync(c, {
|
|
1701
1701
|
encoding: "utf8"
|
|
1702
1702
|
}), g = ie.toAmendement(j);
|
|
1703
|
-
|
|
1703
|
+
C[g.uid] === void 0 && (C[g.uid] = g);
|
|
1704
1704
|
}
|
|
1705
1705
|
}
|
|
1706
|
-
const
|
|
1706
|
+
const v = {}, I = {}, L = {}, D = {};
|
|
1707
1707
|
if (n & F.DossiersLegislatifs)
|
|
1708
1708
|
for (const a of A.dossiersLegislatifs) {
|
|
1709
1709
|
if (a.ignoreForWeb || i !== l.All && a.legislature !== l.All && i !== a.legislature)
|
|
@@ -1720,7 +1720,7 @@ function Sn(t, n, i, { log: o = !1 } = {}) {
|
|
|
1720
1720
|
const j = r.readFileSync(c, {
|
|
1721
1721
|
encoding: "utf8"
|
|
1722
1722
|
}), g = W.toDocument(j);
|
|
1723
|
-
|
|
1723
|
+
v[g.uid] === void 0 && (v[g.uid] = g);
|
|
1724
1724
|
}
|
|
1725
1725
|
for (const d of R(u, ["dossiers"])) {
|
|
1726
1726
|
if (!d[d.length - 1].endsWith(".json"))
|
|
@@ -1823,8 +1823,8 @@ function Sn(t, n, i, { log: o = !1 } = {}) {
|
|
|
1823
1823
|
}
|
|
1824
1824
|
return {
|
|
1825
1825
|
acteurByUid: p,
|
|
1826
|
-
amendementByUid:
|
|
1827
|
-
documentByUid:
|
|
1826
|
+
amendementByUid: C,
|
|
1827
|
+
documentByUid: v,
|
|
1828
1828
|
dossierParlementaireBySenatChemin: I,
|
|
1829
1829
|
dossierParlementaireByTitreChemin: L,
|
|
1830
1830
|
dossierParlementaireByUid: D,
|
|
@@ -1880,7 +1880,7 @@ function bn(t, n, i, { log: o = !1 } = {}) {
|
|
|
1880
1880
|
}
|
|
1881
1881
|
}
|
|
1882
1882
|
}
|
|
1883
|
-
const
|
|
1883
|
+
const C = {};
|
|
1884
1884
|
if (n & F.Amendements)
|
|
1885
1885
|
for (const a of A.amendements) {
|
|
1886
1886
|
if (a.ignoreForWeb || i !== l.All && a.legislature !== l.All && i !== a.legislature)
|
|
@@ -1893,9 +1893,9 @@ function bn(t, n, i, { log: o = !1 } = {}) {
|
|
|
1893
1893
|
const d = r.readFileSync(u, { encoding: "utf8" }), y = ie.toAmendements(d);
|
|
1894
1894
|
for (const c of y.textesLegislatifs)
|
|
1895
1895
|
for (const j of c.amendements)
|
|
1896
|
-
|
|
1896
|
+
C[j.uid] === void 0 && (C[j.uid] = j);
|
|
1897
1897
|
}
|
|
1898
|
-
const
|
|
1898
|
+
const v = {}, I = {}, L = {}, D = {};
|
|
1899
1899
|
if (n & F.DossiersLegislatifs)
|
|
1900
1900
|
for (const a of A.dossiersLegislatifs) {
|
|
1901
1901
|
if (a.ignoreForWeb || i !== l.All && a.legislature !== l.All && i !== a.legislature)
|
|
@@ -1907,7 +1907,7 @@ function bn(t, n, i, { log: o = !1 } = {}) {
|
|
|
1907
1907
|
o && console.log(`Loading file: ${u}`);
|
|
1908
1908
|
const d = r.readFileSync(u, { encoding: "utf8" }), y = W.toDossiersLegislatifs(d);
|
|
1909
1909
|
for (const c of y.textesLegislatifs)
|
|
1910
|
-
|
|
1910
|
+
v[c.uid] === void 0 && (v[c.uid] = c);
|
|
1911
1911
|
for (const c of y.dossiersParlementaires) {
|
|
1912
1912
|
const j = c.titreDossier;
|
|
1913
1913
|
j.senatChemin && I[j.senatChemin] === void 0 && (I[j.senatChemin] = c), j.titreChemin && L[j.titreChemin] === void 0 && (L[j.titreChemin] = c), D[c.uid] === void 0 && (D[c.uid] = c);
|
|
@@ -1986,8 +1986,8 @@ function bn(t, n, i, { log: o = !1 } = {}) {
|
|
|
1986
1986
|
}
|
|
1987
1987
|
return {
|
|
1988
1988
|
acteurByUid: p,
|
|
1989
|
-
amendementByUid:
|
|
1990
|
-
documentByUid:
|
|
1989
|
+
amendementByUid: C,
|
|
1990
|
+
documentByUid: v,
|
|
1991
1991
|
dossierParlementaireBySenatChemin: I,
|
|
1992
1992
|
dossierParlementaireByTitreChemin: L,
|
|
1993
1993
|
dossierParlementaireByUid: D,
|
|
@@ -2007,9 +2007,9 @@ function yn(t, n, i) {
|
|
|
2007
2007
|
return;
|
|
2008
2008
|
const _ = r.readJsonSync(f);
|
|
2009
2009
|
for (const m of i)
|
|
2010
|
-
for (const { filename: S, url:
|
|
2010
|
+
for (const { filename: S, url: C } of _[m] ?? [])
|
|
2011
2011
|
if (S !== void 0)
|
|
2012
|
-
return { format: m, path: s.join(p, S), url:
|
|
2012
|
+
return { format: m, path: s.join(p, S), url: C };
|
|
2013
2013
|
}
|
|
2014
2014
|
function An(t, n, { log: i = !1 } = {}) {
|
|
2015
2015
|
const o = s.join(
|
|
@@ -2022,7 +2022,7 @@ function An(t, n, { log: i = !1 } = {}) {
|
|
|
2022
2022
|
const p = r.readFileSync(o, { encoding: "utf8" });
|
|
2023
2023
|
return JSON.parse(p);
|
|
2024
2024
|
}
|
|
2025
|
-
function
|
|
2025
|
+
function Cn(t, { log: n = !1 } = {}) {
|
|
2026
2026
|
const i = s.join(
|
|
2027
2027
|
t,
|
|
2028
2028
|
"photos_senateurs",
|
|
@@ -2051,14 +2051,14 @@ function Yt(t, n) {
|
|
|
2051
2051
|
), S = o.etat;
|
|
2052
2052
|
if (S === void 0)
|
|
2053
2053
|
return r.ensureDirSync(m), s.join(m, n);
|
|
2054
|
-
const
|
|
2055
|
-
let
|
|
2056
|
-
|
|
2057
|
-
const I = s.join(
|
|
2054
|
+
const C = s.join(m, S);
|
|
2055
|
+
let v = "000000" + (o.numero ?? o.numero2);
|
|
2056
|
+
v = v.substring(v.length - 6);
|
|
2057
|
+
const I = s.join(C, v.substring(0, 3));
|
|
2058
2058
|
return r.ensureDirSync(I), s.join(I, n);
|
|
2059
2059
|
}
|
|
2060
|
-
function
|
|
2061
|
-
return
|
|
2060
|
+
function vn(t, n) {
|
|
2061
|
+
return Ce(t, n, Te);
|
|
2062
2062
|
}
|
|
2063
2063
|
function In(t, n) {
|
|
2064
2064
|
const i = Ne.exec(n);
|
|
@@ -2070,8 +2070,8 @@ function In(t, n) {
|
|
|
2070
2070
|
const o = s.join(t, i[1]), p = s.join(o, i[2]), f = s.join(p, i[3]), _ = s.join(f, i[4]), m = s.join(_, i[5]);
|
|
2071
2071
|
let S = "000000000" + i[6];
|
|
2072
2072
|
S = S.substring(S.length - 9);
|
|
2073
|
-
const
|
|
2074
|
-
return r.ensureDirSync(
|
|
2073
|
+
const C = s.join(m, S.substring(0, 3)), v = s.join(C, S.substring(3, 3));
|
|
2074
|
+
return r.ensureDirSync(v), s.join(v, n);
|
|
2075
2075
|
}
|
|
2076
2076
|
function Fn(t, n) {
|
|
2077
2077
|
const i = ze.exec(n);
|
|
@@ -2087,7 +2087,7 @@ function Fn(t, n) {
|
|
|
2087
2087
|
return r.ensureDirSync(m), s.join(m, n);
|
|
2088
2088
|
}
|
|
2089
2089
|
function Vn(t, n) {
|
|
2090
|
-
return
|
|
2090
|
+
return Ce(t, n, Ue);
|
|
2091
2091
|
}
|
|
2092
2092
|
function Dn(t, n) {
|
|
2093
2093
|
const i = ke.exec(n);
|
|
@@ -2099,10 +2099,10 @@ function Dn(t, n) {
|
|
|
2099
2099
|
const o = s.join(t, i[2]), p = s.join(o, i[3]), f = s.join(p, i[4]), _ = s.join(f, i[5]);
|
|
2100
2100
|
let m = "000000000" + i[7];
|
|
2101
2101
|
m = m.substring(m.length - 9);
|
|
2102
|
-
const S = s.join(_, m.substring(0, 3)),
|
|
2103
|
-
return r.ensureDirSync(
|
|
2102
|
+
const S = s.join(_, m.substring(0, 3)), C = s.join(S, m.substring(3, 3));
|
|
2103
|
+
return r.ensureDirSync(C), s.join(C, n);
|
|
2104
2104
|
}
|
|
2105
|
-
function
|
|
2105
|
+
function Ce(t, n, i) {
|
|
2106
2106
|
const o = i.exec(n);
|
|
2107
2107
|
B.notStrictEqual(
|
|
2108
2108
|
o,
|
|
@@ -2138,10 +2138,10 @@ export {
|
|
|
2138
2138
|
bn as loadAssembleeDataFromBigFiles,
|
|
2139
2139
|
yn as loadAssembleeDocumentFile,
|
|
2140
2140
|
An as loadAssembleePhotosDeputes,
|
|
2141
|
-
|
|
2141
|
+
Cn as loadAssembleePhotosSenateurs,
|
|
2142
2142
|
Dn as pathFromCompteRenduUid,
|
|
2143
2143
|
Yt as pathFromDocumentUid,
|
|
2144
|
-
|
|
2144
|
+
vn as pathFromDossierParlementaireUid,
|
|
2145
2145
|
Vn as pathFromQuestionUid,
|
|
2146
2146
|
In as pathFromReunionUid,
|
|
2147
2147
|
Fn as pathFromScrutinUid,
|