@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 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
- All = 511
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 Ce, 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";
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 = 511] = "All", t))(F || {});
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: Ce.optional().meta({
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
- }), vt = e.union([
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: vt.optional(),
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
- ), Ct = e.object({
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: Ct.optional(),
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 v of i) {
1385
- if (v.ignoreForWeb || !Ht(n, v))
1384
+ for (const C of i) {
1385
+ if (C.ignoreForWeb || !Ht(n, C))
1386
1386
  continue;
1387
- const C = s.join(t, `${v.name}_nettoye`), I = m ? m[v.name] : void 0, L = I ? ue(C, I, {
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 ${C}`
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(C, p)) {
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(C, ...D), O = s.join(...D), w = L?.get(O);
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: v.legislature,
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
- C,
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(C, $);
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: v.legislature,
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 v = {};
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
- v[g.uid] === void 0 && (v[g.uid] = g);
1703
+ C[g.uid] === void 0 && (C[g.uid] = g);
1704
1704
  }
1705
1705
  }
1706
- const C = {}, I = {}, L = {}, D = {};
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
- C[g.uid] === void 0 && (C[g.uid] = g);
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: v,
1827
- documentByUid: C,
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 v = {};
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
- v[j.uid] === void 0 && (v[j.uid] = j);
1896
+ C[j.uid] === void 0 && (C[j.uid] = j);
1897
1897
  }
1898
- const C = {}, I = {}, L = {}, D = {};
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
- C[c.uid] === void 0 && (C[c.uid] = c);
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: v,
1990
- documentByUid: C,
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: v } of _[m] ?? [])
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: v };
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 vn(t, { log: n = !1 } = {}) {
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 v = s.join(m, S);
2055
- let C = "000000" + (o.numero ?? o.numero2);
2056
- C = C.substring(C.length - 6);
2057
- const I = s.join(v, C.substring(0, 3));
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 Cn(t, n) {
2061
- return ve(t, n, Te);
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 v = s.join(m, S.substring(0, 3)), C = s.join(v, S.substring(3, 3));
2074
- return r.ensureDirSync(C), s.join(C, n);
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 ve(t, n, Ue);
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)), v = s.join(S, m.substring(3, 3));
2103
- return r.ensureDirSync(v), s.join(v, n);
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 ve(t, n, i) {
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
- vn as loadAssembleePhotosSenateurs,
2141
+ Cn as loadAssembleePhotosSenateurs,
2142
2142
  Dn as pathFromCompteRenduUid,
2143
2143
  Yt as pathFromDocumentUid,
2144
- Cn as pathFromDossierParlementaireUid,
2144
+ vn as pathFromDossierParlementaireUid,
2145
2145
  Vn as pathFromQuestionUid,
2146
2146
  In as pathFromReunionUid,
2147
2147
  Fn as pathFromScrutinUid,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tricoteuses/assemblee",
3
- "version": "3.0.16",
3
+ "version": "3.0.17",
4
4
  "description": "Retrieve, clean up & handle French Assemblée nationale's open data",
5
5
  "keywords": [
6
6
  "Assemblée nationale",