@tricoteuses/assemblee 2.5.23 → 2.5.25

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
@@ -1,5 +1,6 @@
1
1
  import { Legislature } from './types/legislatures';
2
2
  export interface Dataset {
3
+ name: string;
3
4
  filename: string;
4
5
  ignoreForWeb?: boolean;
5
6
  legislature: Legislature;
package/lib/git.js CHANGED
@@ -116,10 +116,9 @@ function B(t, o, e = {}) {
116
116
  }
117
117
  }
118
118
  return f;
119
- } catch (c) {
119
+ } catch {
120
120
  return console.error(
121
- `Error getting changed files since commit ${o}:`,
122
- c
121
+ `Error getting changed files since commit ${o}`
123
122
  ), /* @__PURE__ */ new Map();
124
123
  }
125
124
  }
package/lib/index.d.ts CHANGED
@@ -16,3 +16,4 @@ export { TypeQuestion, type Analyse, type AuteurQuestion, type Cloture, type Gro
16
16
  export { CausePositionVote, CodeSortScrutin, CodeTypeVote, type DecompteNominatif, type DecompteVoix, type Demandeur, type Dysfonctionnement, LibelleSortScrutin, LibelleTypeVote, LieuVote, type MiseAuPoint, ModePublicationDesVotes, type ObjetVote, PositionMajoritaire, type SortScrutin, type Scrutin, type SyntheseVote, TypeMajorite, type TypeVote, type VentilationVotes, type VentilationVotesGroupe, type Votant, type Vote, } from './types/scrutins';
17
17
  export { compteRenduUidRegex, documentUidRegex, dossierUidRegex, questionUidRegex, reunionUidRegex, scrutinUidRegex, } from './uids';
18
18
  export { DocumentUrlFormat, iterDocumentOrDivisionUrls, urlFromDocument, urlFromScrutin, } from './urls';
19
+ export { datasets } from './datasets';
package/lib/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { c as B, t as x, g as _, m as Q, a as s, b as X, d as V, e as z, f as J, h as Z, i as K, l as ee, j as te, k as ne, w as re, n as U, o as k, p as ie, q as C } from "./parse-Ccs6wcUg.js";
2
- import { C as O } from "./uids-DaRrTkI-.js";
3
- import { n as mt, G as gt, b as pt, a as yt, c as ht, H as Rt, I as xt, D as Tt, o as Dt, p as wt, E as vt, F as bt, f as St, L as At, J as Et, K as Ot, O as Ct, U as Mt, M as _t, N as Pt, g as Lt, h as Nt, V as It, P as Bt, i as Ut, j as kt, q as Yt, r as qt, Q as Ft, R as jt, d as $t, k as Wt, S as Ht, s as Gt, t as Qt, u as Xt, v as Vt, w as zt, x as Jt, B as Zt, W as Kt, T as en, y as tn, e as nn, l as rn, A as on, m as an, z as sn, X as un, Y as cn, Z as fn, _ as dn, $ as ln, a0 as mn } from "./uids-DaRrTkI-.js";
4
- import { A as pn, a as yn, C as hn, b as Rn, c as xn, D as Tn, E as Dn, d as wn, S as vn, T as bn, e as Sn, f as An, g as En } from "./amendements-40Z7OJLT.js";
2
+ import { C as O } from "./datasets-BCg11CdK.js";
3
+ import { n as mt, G as gt, b as pt, a as yt, c as ht, H as Rt, I as xt, D as Tt, o as Dt, p as wt, E as St, F as vt, f as bt, L as At, J as Et, K as Ot, O as Ct, U as Mt, M as _t, N as Pt, g as Lt, h as Nt, V as It, P as Bt, i as Ut, j as kt, q as Yt, r as qt, Q as Ft, R as jt, d as $t, k as Wt, S as Ht, s as Gt, t as Qt, u as Xt, v as Vt, w as zt, x as Jt, B as Zt, W as Kt, T as en, y as tn, e as nn, l as rn, A as on, m as an, z as sn, X as un, a1 as cn, Y as fn, Z as dn, _ as ln, $ as mn, a0 as gn } from "./datasets-BCg11CdK.js";
4
+ import { A as yn, a as hn, C as Rn, b as xn, c as Tn, D as Dn, E as wn, d as Sn, S as vn, T as bn, e as An, f as En, g as On } from "./amendements-40Z7OJLT.js";
5
5
  var Y = /* @__PURE__ */ ((e) => (e.Amendements = "amendements", e))(Y || {});
6
6
  const Qe = Object.values(Y);
7
7
  var q = /* @__PURE__ */ ((e) => (e.Acte_organe = "acte.organe", e.Acte_provenance = "acte.provenance", e.Acte_rapporteurs_acteur = "acte.rapporteurs.acteur", e.Acte_reunion = "acte.reunion", e.Acte_texteAdopte = "acte.texteAdopte", e.Acte_texteAssocie = "acte.texteAssocie", e.Acte_textesAssocies_texteAssocie = "acte.textesAssocies.texteAssocie", e.Acte_votes = "acte.votes", e.Acteur_mandats_organes = "acteur.mandats.organes", e.Amendement_signataires_auteur_acteur = "amendement.signataires.auteur.acteur", e.Amendement_signataires_auteur_auteurRapporteurOrgane = "amendement.signataires.auteur.auteurRapporteurOrgane", e.Amendement_signataires_auteur_gouvernement = "amendement.signataires.auteur.gouvernement", e.Amendement_signataires_auteur_groupePolitique = "amendement.signataires.auteur.groupePolitique", e.Amendement_signataires_cosignataires = "amendement.signataires.cosignataires", e.Amendement_texteLegislatif = "amendement.texteLegislatif", e.Document_auteurs_acteur_acteur = "document.auteurs.acteur.acteur", e.Document_auteurs_organe = "document.auteurs.organe", e.Document_dossier = "document.dossier", e.Dossier_initiateur_acteurs_acteur = "dossier.initiateur.acteurs.acteur", e.Dossier_initiateur_organe = "dossier.initiateur.organe", e.Organe_organeParent = "organe.organeParent", e.Organe_organePrecedent = "organe.organePrecedent", e.Reunion_demandeurs_acteurs_acteur = "reunion.demandeurs.acteurs.acteur", e.Reunion_demandeurs_organe_organe = "reunion.demandeurs.organe.organe", e.Reunion_organeReuni = "reunion.organeReuni", e.Reunion_participants_participantsInternes_acteur = "reunion.participants.participantsInternes.acteur", e.Scrutin_miseAuPoint = "scrutin.miseAuPoint", e.Scrutin_organe = "scrutin.organe", e.Scrutin_ventilationVotes_groupes_organe = "scrutin.ventilationVotes.groupes.organe", e))(q || {});
@@ -710,7 +710,7 @@ function ye(e) {
710
710
  const t = e.match(me);
711
711
  return t ? t[1].replace(ge, "'") : e;
712
712
  }
713
- function S(e, t) {
713
+ function b(e, t) {
714
714
  const r = () => B(t?.in, NaN), i = Te(e);
715
715
  let o;
716
716
  if (i.date) {
@@ -720,10 +720,10 @@ function S(e, t) {
720
720
  if (!o || isNaN(+o)) return r();
721
721
  const a = +o;
722
722
  let c = 0, u;
723
- if (i.time && (c = ve(i.time), isNaN(c)))
723
+ if (i.time && (c = Se(i.time), isNaN(c)))
724
724
  return r();
725
725
  if (i.timezone) {
726
- if (u = be(i.timezone), isNaN(u)) return r();
726
+ if (u = ve(i.timezone), isNaN(u)) return r();
727
727
  } else {
728
728
  const f = new Date(a + c), d = x(0, t?.in);
729
729
  return d.setFullYear(
@@ -775,7 +775,7 @@ function we(e, t) {
775
775
  if (!r) return /* @__PURE__ */ new Date(NaN);
776
776
  const n = !!r[4], i = D(r[1]), o = D(r[2]) - 1, a = D(r[3]), c = D(r[4]), u = D(r[5]) - 1;
777
777
  if (n)
778
- return Ce(t, c, u) ? Se(t, c, u) : /* @__PURE__ */ new Date(NaN);
778
+ return Ce(t, c, u) ? be(t, c, u) : /* @__PURE__ */ new Date(NaN);
779
779
  {
780
780
  const f = /* @__PURE__ */ new Date(0);
781
781
  return !Ee(t, o, a) || !Oe(t, i) ? /* @__PURE__ */ new Date(NaN) : (f.setUTCFullYear(t, o, Math.max(i, a)), f);
@@ -784,7 +784,7 @@ function we(e, t) {
784
784
  function D(e) {
785
785
  return e ? parseInt(e) : 1;
786
786
  }
787
- function ve(e) {
787
+ function Se(e) {
788
788
  const t = e.match(Re);
789
789
  if (!t) return NaN;
790
790
  const r = E(t[1]), n = E(t[2]), i = E(t[3]);
@@ -793,14 +793,14 @@ function ve(e) {
793
793
  function E(e) {
794
794
  return e && parseFloat(e.replace(",", ".")) || 0;
795
795
  }
796
- function be(e) {
796
+ function ve(e) {
797
797
  if (e === "Z") return 0;
798
798
  const t = e.match(xe);
799
799
  if (!t) return 0;
800
800
  const r = t[1] === "+" ? -1 : 1, n = parseInt(t[2]), i = t[3] && parseInt(t[3]) || 0;
801
801
  return _e(n, i) ? r * (n * U + i * k) : NaN;
802
802
  }
803
- function Se(e, t, r) {
803
+ function be(e, t, r) {
804
804
  const n = /* @__PURE__ */ new Date(0);
805
805
  n.setUTCFullYear(e, 0, 4);
806
806
  const i = n.getUTCDay() || 7, o = (t - 1) * 7 + r + 1 - i;
@@ -860,25 +860,25 @@ const Pe = Date.prototype.toJSON, Le = function() {
860
860
  minute: "2-digit"
861
861
  });
862
862
  function ze(e, t) {
863
- return e instanceof Date ? e : typeof e == "string" ? S(e) : t;
863
+ return e instanceof Date ? e : typeof e == "string" ? b(e) : t;
864
864
  }
865
865
  function Je(e) {
866
866
  return ie(e, "yyyy-MM-ddXXX", /* @__PURE__ */ new Date());
867
867
  }
868
868
  function Ze(e) {
869
- const t = S(e);
869
+ const t = b(e);
870
870
  return e = M(t, "EEEE d LLLL yyyy H'h'mm", { locale: C }), e.endsWith(" 0h00") && (e = e.substring(0, e.length - 5)), e;
871
871
  }
872
872
  function Ke(e, t) {
873
873
  return e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate() ? Ie.format(e) : Ne.format(e);
874
874
  }
875
875
  function et(e) {
876
- const t = e instanceof Date ? e : S(e);
876
+ const t = e instanceof Date ? e : b(e);
877
877
  let r = M(t, "d LLLL yyyy H'h'mm", { locale: C });
878
878
  return r.endsWith(" 0h00") && (r = r.substring(0, r.length - 5)), r;
879
879
  }
880
880
  function tt(e) {
881
- const t = e instanceof Date ? e : S(e);
881
+ const t = e instanceof Date ? e : b(e);
882
882
  return M(t, "H'h'mm", { locale: C });
883
883
  }
884
884
  function nt(e) {
@@ -1055,7 +1055,7 @@ function W(e, t, r) {
1055
1055
  if (!r.has(e.uid)) {
1056
1056
  if (r.add(e.uid), t.documentByUid !== void 0 && e.depotInitialLectureDefinitiveRef !== void 0) {
1057
1057
  const n = t.documentByUid[e.depotInitialLectureDefinitiveRef];
1058
- n !== void 0 && (e.depotInitialLectureDefinitive = n, v(n, t, r));
1058
+ n !== void 0 && (e.depotInitialLectureDefinitive = n, S(n, t, r));
1059
1059
  }
1060
1060
  if (t.organeByUid !== void 0 && e.organeRef !== void 0) {
1061
1061
  const n = t.organeByUid[e.organeRef];
@@ -1085,16 +1085,16 @@ function W(e, t, r) {
1085
1085
  }
1086
1086
  if (t.documentByUid !== void 0 && e.texteAdopteRef !== void 0) {
1087
1087
  const n = t.documentByUid[e.texteAdopteRef];
1088
- n !== void 0 && (e.texteAdopte = n, v(n, t, r));
1088
+ n !== void 0 && (e.texteAdopte = n, S(n, t, r));
1089
1089
  }
1090
1090
  if (t.documentByUid !== void 0 && e.texteAssocieRef !== void 0) {
1091
1091
  const n = t.documentByUid[e.texteAssocieRef];
1092
- n !== void 0 && (e.texteAssocie = n, v(n, t, r));
1092
+ n !== void 0 && (e.texteAssocie = n, S(n, t, r));
1093
1093
  }
1094
1094
  if (t.documentByUid !== void 0 && e.textesAssocies !== void 0)
1095
1095
  for (const n of e.textesAssocies) {
1096
1096
  const i = t.documentByUid[n.texteAssocieRef];
1097
- i !== void 0 && (n.texteAssocie = i, v(i, t, r));
1097
+ i !== void 0 && (n.texteAssocie = i, S(i, t, r));
1098
1098
  }
1099
1099
  if (t.scrutinByUid !== void 0 && e.voteRefs !== void 0) {
1100
1100
  const n = [];
@@ -1172,7 +1172,7 @@ function H(e, t, r) {
1172
1172
  H(n, t, r);
1173
1173
  return e;
1174
1174
  }
1175
- function v(e, t, r) {
1175
+ function S(e, t, r) {
1176
1176
  if (!r.has(e.uid)) {
1177
1177
  r.add(e.uid);
1178
1178
  for (const n of e.auteurs) {
@@ -1405,7 +1405,7 @@ function We(e) {
1405
1405
  return ".asp";
1406
1406
  }
1407
1407
  }
1408
- function* ut(e, t = void 0) {
1408
+ function* ut(e, t = void 0, r = !1) {
1409
1409
  if (t === void 0 || t === "raw-html") {
1410
1410
  yield {
1411
1411
  format: "raw-html",
@@ -1416,27 +1416,27 @@ function* ut(e, t = void 0) {
1416
1416
  type: "dyn-docs",
1417
1417
  url: `https://www.assemblee-nationale.fr/dyn/docs/${e.uid}.raw`
1418
1418
  };
1419
- const r = b(
1419
+ const n = v(
1420
1420
  e,
1421
- "raw-html"
1422
- /* RawHtml */
1421
+ "raw-html",
1422
+ r
1423
1423
  );
1424
- r !== null && (yield {
1424
+ n !== null && (yield {
1425
1425
  format: "raw-html",
1426
- type: r.directory.replaceAll("/", "-"),
1427
- url: r.url
1426
+ type: n.directory.replaceAll("/", "-"),
1427
+ url: n.url
1428
1428
  });
1429
1429
  }
1430
1430
  if (t === void 0 || t === "html") {
1431
- const r = b(
1431
+ const n = v(
1432
1432
  e,
1433
- "html"
1434
- /* Html */
1433
+ "html",
1434
+ r
1435
1435
  );
1436
- r !== null && (yield {
1436
+ n !== null && (yield {
1437
1437
  format: "html",
1438
- type: r.directory.replaceAll("/", "-"),
1439
- url: r.url
1438
+ type: n.directory.replaceAll("/", "-"),
1439
+ url: n.url
1440
1440
  });
1441
1441
  }
1442
1442
  if (t === void 0 || t === "pdf") {
@@ -1449,20 +1449,20 @@ function* ut(e, t = void 0) {
1449
1449
  type: "dyn-docs",
1450
1450
  url: `https://www.assemblee-nationale.fr/dyn/docs/${e.uid}.pdf`
1451
1451
  };
1452
- const r = b(
1452
+ const n = v(
1453
1453
  e,
1454
1454
  "pdf"
1455
1455
  /* Pdf */
1456
1456
  );
1457
- r !== null && (yield {
1457
+ n !== null && (yield {
1458
1458
  format: "pdf",
1459
- type: r.directory.replaceAll("/", "-"),
1460
- url: r.url
1459
+ type: n.directory.replaceAll("/", "-"),
1460
+ url: n.url
1461
1461
  });
1462
1462
  }
1463
1463
  }
1464
1464
  function ct(e, t) {
1465
- const r = b(e, t);
1465
+ const r = v(e, t);
1466
1466
  return r === null ? null : r.url;
1467
1467
  }
1468
1468
  function ft(e) {
@@ -1474,69 +1474,69 @@ function ft(e) {
1474
1474
  const r = t[2], n = t[3];
1475
1475
  return `http://www2.assemblee-nationale.fr/scrutins/detail/(legislature)/${r}/(num)/${n}`;
1476
1476
  }
1477
- function b(e, t) {
1478
- const r = We(t), n = /^(.{4})([ANS]*)(R[0-9])([LS]*)([0-9]*)([BTACP]*)(.*)$/.exec(
1477
+ function v(e, t, r = !1) {
1478
+ const n = We(t), i = /^(.{4})([ANS]*)(R[0-9])([LS]*)([0-9]*)([BTACP]*)(.*)$/.exec(
1479
1479
  e.uid
1480
1480
  );
1481
- if (n === null)
1482
- return console.log(
1481
+ if (i === null)
1482
+ return r && console.log(
1483
1483
  `Unable to generate URL from document or division with unexpected UID: "${e.uid}"`
1484
1484
  ), null;
1485
- if (n[2] === "SN")
1486
- return console.log(
1485
+ if (i[2] === "SN")
1486
+ return r && console.log(
1487
1487
  `Unable to generate URL for document or division in Sénat. UID: "${e.uid}"`
1488
1488
  ), null;
1489
- const o = n[5];
1490
- let a = n[7];
1489
+ const a = i[5];
1490
+ let c = i[7];
1491
1491
  if (t === "raw-html")
1492
1492
  return {
1493
1493
  directory: "textes",
1494
- url: `https://www.assemblee-nationale.fr/${o}/textes/${a}${r}`
1494
+ url: `https://www.assemblee-nationale.fr/${a}/textes/${c}${n}`
1495
1495
  };
1496
- let c = {
1496
+ let u = {
1497
1497
  BTC: "TCOM",
1498
1498
  BTA: "TADO",
1499
1499
  TAP: "TADO"
1500
- }[n[6]] || n[1];
1501
- e.classification !== void 0 && e.classification.sousType !== void 0 && e.classification.sousType.code === "COMPA" && (a = a.replace(/-COMPA/, "-aCOMPA")), c == "AVCE" && (c = `AVCE${e.classification.famille?.classe.code}`);
1502
- const u = $e[c];
1503
- if (u === void 0)
1504
- return console.log(
1505
- `Unable to generate URL from document or division of UID "${e.uid}" and type "${c}"`
1500
+ }[i[6]] || i[1];
1501
+ e.classification !== void 0 && e.classification.sousType !== void 0 && e.classification.sousType.code === "COMPA" && (c = c.replace(/-COMPA/, "-aCOMPA")), u == "AVCE" && (u = `AVCE${e.classification.famille?.classe.code}`);
1502
+ const f = $e[u];
1503
+ if (f === void 0)
1504
+ return r && console.log(
1505
+ `Unable to generate URL from document or division of UID "${e.uid}" and type "${u}"`
1506
1506
  ), null;
1507
- const f = t === "pdf" ? `pdf/${u.directory}` : u.directory;
1507
+ const d = t === "pdf" ? `pdf/${f.directory}` : f.directory;
1508
1508
  return {
1509
- directory: f,
1510
- url: `https://www.assemblee-nationale.fr/${o}/${f}/${u.prefix}${a}${u.suffix}${r}`
1509
+ directory: d,
1510
+ url: `https://www.assemblee-nationale.fr/${a}/${d}/${f.prefix}${c}${f.suffix}${n}`
1511
1511
  };
1512
1512
  }
1513
1513
  export {
1514
- pn as AccordGouvernementDepotHorsDelai,
1515
- yn as Action,
1516
- hn as AmendementsConvert,
1517
- Rn as AvantAApres,
1514
+ yn as AccordGouvernementDepotHorsDelai,
1515
+ hn as Action,
1516
+ Rn as AmendementsConvert,
1517
+ xn as AvantAApres,
1518
1518
  mt as Cause,
1519
1519
  gt as CausePositionVote,
1520
1520
  pt as Civ,
1521
1521
  yt as CodeActe,
1522
- xn as CodeEtat,
1522
+ Tn as CodeEtat,
1523
1523
  ht as CodeNatureDep,
1524
1524
  Rt as CodeSortScrutin,
1525
1525
  O as CodeTypeOrgane,
1526
1526
  xt as CodeTypeVote,
1527
1527
  Tt as Decision,
1528
- Tn as DivisionType,
1528
+ Dn as DivisionType,
1529
1529
  Dt as DocumentDenominationStructurelle,
1530
1530
  je as DocumentUrlFormat,
1531
1531
  wt as DossierParlementaireXsiType,
1532
- Dn as EtatAmendementCode,
1533
- wn as EtatAmendementLibelle,
1534
- vt as EtatCycleDeVie,
1532
+ wn as EtatAmendementCode,
1533
+ Sn as EtatAmendementLibelle,
1534
+ St as EtatCycleDeVie,
1535
1535
  Y as Facet,
1536
- bt as FamSocPro,
1536
+ vt as FamSocPro,
1537
1537
  Be as FinalStatus,
1538
1538
  q as Follow,
1539
- St as FormatReunion,
1539
+ bt as FormatReunion,
1540
1540
  At as Legislature,
1541
1541
  Et as LibelleSortScrutin,
1542
1542
  Ot as LibelleTypeVote,
@@ -1569,12 +1569,12 @@ export {
1569
1569
  Zt as TypeJoQuestion,
1570
1570
  Kt as TypeMajorite,
1571
1571
  en as TypeMandat,
1572
- Sn as TypeMimeNom,
1573
- An as TypeMimeType,
1572
+ An as TypeMimeNom,
1573
+ En as TypeMimeType,
1574
1574
  tn as TypeMission,
1575
1575
  nn as TypeOrgane,
1576
1576
  rn as TypePointOdj,
1577
- En as TypePosition,
1577
+ On as TypePosition,
1578
1578
  on as TypeQuestion,
1579
1579
  an as TypeReunion,
1580
1580
  sn as TypeTexte,
@@ -1583,11 +1583,12 @@ export {
1583
1583
  rt as capitalizeFirstLetter,
1584
1584
  it as commissionFondUidFromDossier,
1585
1585
  un as compteRenduUidRegex,
1586
+ cn as datasets,
1586
1587
  ze as dateFromNullableDateOrIsoString,
1587
1588
  Je as dateFromYearMonthDayTimezoneString,
1588
1589
  Ze as displayDateFromLocalIsoString,
1589
- cn as documentUidRegex,
1590
- fn as dossierUidRegex,
1590
+ fn as documentUidRegex,
1591
+ dn as dossierUidRegex,
1591
1592
  Pe as existingDateToJson,
1592
1593
  Ke as formatRelativeFrenchTime,
1593
1594
  Ve as frenchDateFormat,
@@ -1597,7 +1598,7 @@ export {
1597
1598
  tt as frenchTimeFromDateOrString,
1598
1599
  h as insertActeurReferences,
1599
1600
  at as insertAmendementReferences,
1600
- v as insertDocumentReferences,
1601
+ S as insertDocumentReferences,
1601
1602
  G as insertDossierReferences,
1602
1603
  m as insertOrganeReferences,
1603
1604
  qe as insertReunionReferences,
@@ -1605,9 +1606,9 @@ export {
1605
1606
  ut as iterDocumentOrDivisionUrls,
1606
1607
  nt as localIso8601StringFromDate,
1607
1608
  Le as patchedDateToJson,
1608
- dn as questionUidRegex,
1609
- ln as reunionUidRegex,
1610
- mn as scrutinUidRegex,
1609
+ ln as questionUidRegex,
1610
+ mn as reunionUidRegex,
1611
+ gn as scrutinUidRegex,
1611
1612
  st as shortNameFromOrgane,
1612
1613
  ke as stateFromActePath,
1613
1614
  j as stateFromActes,