@tricoteuses/assemblee 3.2.0 → 3.2.2

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/loaders.js CHANGED
@@ -1,2 +1,2 @@
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 };
1
+ 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-DUazQFWL.js";
2
+ 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 };
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-D3Jr9MQa.js";
2
- import { t as a } from "./amendements-DaB_5WaI.js";
1
+ import { _t as e, gt as t, ht as n, r, vt as i } from "./amendements-DHZKmvto.js";
2
+ import { t as a } from "./amendements-Aa0U8Egw.js";
3
3
  import o from "node:assert";
4
4
  import s from "fs-extra";
5
5
  import c from "node:path";
@@ -8407,23 +8407,23 @@ function Hu(e, t) {
8407
8407
  }
8408
8408
  //#endregion
8409
8409
  //#region node_modules/date-fns/formatISO.js
8410
- function Uu(e, r) {
8411
- let i = n(e, r?.in);
8412
- if (isNaN(+i)) throw RangeError("Invalid time value");
8413
- let a = r?.format ?? "extended", o = r?.representation ?? "complete", s = "", c = "", l = a === "extended" ? "-" : "", u = a === "extended" ? ":" : "";
8410
+ function Uu(t, n) {
8411
+ let r = i(t, n?.in);
8412
+ if (isNaN(+r)) throw RangeError("Invalid time value");
8413
+ let a = n?.format ?? "extended", o = n?.representation ?? "complete", s = "", c = "", l = a === "extended" ? "-" : "", u = a === "extended" ? ":" : "";
8414
8414
  if (o !== "time") {
8415
- let e = t(i.getDate(), 2), n = t(i.getMonth() + 1, 2);
8416
- s = `${t(i.getFullYear(), 4)}${l}${n}${l}${e}`;
8415
+ let t = e(r.getDate(), 2), n = e(r.getMonth() + 1, 2);
8416
+ s = `${e(r.getFullYear(), 4)}${l}${n}${l}${t}`;
8417
8417
  }
8418
8418
  if (o !== "date") {
8419
- let e = i.getTimezoneOffset();
8420
- if (e !== 0) {
8421
- let n = Math.abs(e), r = t(Math.trunc(n / 60), 2), i = t(n % 60, 2);
8422
- c = `${e < 0 ? "+" : "-"}${r}:${i}`;
8419
+ let t = r.getTimezoneOffset();
8420
+ if (t !== 0) {
8421
+ let n = Math.abs(t), r = e(Math.trunc(n / 60), 2), i = e(n % 60, 2);
8422
+ c = `${t < 0 ? "+" : "-"}${r}:${i}`;
8423
8423
  } else c = "Z";
8424
- let n = t(i.getHours(), 2), r = t(i.getMinutes(), 2), a = t(i.getSeconds(), 2), o = s === "" ? "" : "T", l = [
8424
+ let n = e(r.getHours(), 2), i = e(r.getMinutes(), 2), a = e(r.getSeconds(), 2), o = s === "" ? "" : "T", l = [
8425
8425
  n,
8426
- r,
8426
+ i,
8427
8427
  a
8428
8428
  ].join(u);
8429
8429
  s = `${s}${o}${l}${c}`;
@@ -8432,16 +8432,16 @@ function Uu(e, r) {
8432
8432
  }
8433
8433
  //#endregion
8434
8434
  //#region src/parsers/recherche_amendements.ts
8435
- async function* Wu(e, t, n, r, o, s = {}) {
8436
- for await (let [c, l] of Gu(e, t, n, r, o, s)) a(l), yield [c, i.toAmendement(JSON.stringify(l))];
8435
+ async function* Wu(e, t, n, i, o, s = {}) {
8436
+ for await (let [c, l] of Gu(e, t, n, i, o, s)) a(l), yield [c, r.toAmendement(JSON.stringify(l))];
8437
8437
  }
8438
- async function* Gu(t, n, i, a, p, m = {}) {
8439
- await s.ensureDir(t), o.strictEqual(/[?&]date_depot=/.exec(n), null, `URL ${n} already contains a deposit date`), o.strictEqual(/[?&]order=/.exec(n), null, `URL ${n} already contains a sort order`), o.strictEqual(/[?&]page=/.exec(n), null, `URL ${n} already contains a page number`), i && o.notStrictEqual(/[?&]etat=/.exec(n), null, `In incremental mode, URL ${n} must contain an "etat" query parameter`), n += (n.includes("?") ? "&" : "?") + "order=date_depot,desc&page=1", a != null && o.notStrictEqual(/\d{4}-\d{2}-\d{2}/.exec(a), null, `Invalid format for minimum date: ${a}`);
8438
+ async function* Gu(e, r, i, a, p, m = {}) {
8439
+ await s.ensureDir(e), o.strictEqual(/[?&]date_depot=/.exec(r), null, `URL ${r} already contains a deposit date`), o.strictEqual(/[?&]order=/.exec(r), null, `URL ${r} already contains a sort order`), o.strictEqual(/[?&]page=/.exec(r), null, `URL ${r} already contains a page number`), i && o.notStrictEqual(/[?&]etat=/.exec(r), null, `In incremental mode, URL ${r} must contain an "etat" query parameter`), r += (r.includes("?") ? "&" : "?") + "order=date_depot,desc&page=1", a != null && o.notStrictEqual(/\d{4}-\d{2}-\d{2}/.exec(a), null, `Invalid format for minimum date: ${a}`);
8440
8440
  let ee = 0;
8441
8441
  iterSearchPages: for (;;) {
8442
- m.verbose && console.log(`Fetching amendements search page at ${n}…`);
8443
- let h = await fetch(n);
8444
- o(h.ok, `Retrieval of search page at ${n} failed with error: ${h.status} ${h.statusText}`);
8442
+ m.verbose && console.log(`Fetching amendements search page at ${r}…`);
8443
+ let h = await fetch(r);
8444
+ o(h.ok, `Retrieval of search page at ${r} failed with error: ${h.status} ${h.statusText}`);
8445
8445
  let g = f(await h.text());
8446
8446
  if (g.querySelector("div.no-result") !== null) break;
8447
8447
  let _ = g.querySelector("div.mirror-card-subtitle");
@@ -8470,25 +8470,25 @@ async function* Gu(t, n, i, a, p, m = {}) {
8470
8470
  o.notStrictEqual(ie.length, 0);
8471
8471
  for (let l of ie) {
8472
8472
  if (ee++, a != null || p != null) {
8473
- let t = l.querySelectorAll("td");
8474
- if (o.strictEqual(t.length, 11, `Unexpected number of columns in amendment row: ${l.outerHTML}`), a != null) {
8475
- let n = t[10];
8476
- if (Uu(e(n.text, "d MMMM y", /* @__PURE__ */ new Date(), { locale: r }), { representation: "date" }) < a) break iterSearchPages;
8473
+ let e = l.querySelectorAll("td");
8474
+ if (o.strictEqual(e.length, 11, `Unexpected number of columns in amendment row: ${l.outerHTML}`), a != null) {
8475
+ let r = e[10];
8476
+ if (Uu(n(r.text, "d MMMM y", /* @__PURE__ */ new Date(), { locale: t }), { representation: "date" }) < a) break iterSearchPages;
8477
8477
  }
8478
8478
  if (p != null) {
8479
- let n = t[7];
8480
- if (n.text && Uu(e(n.text, "d MMMM y", /* @__PURE__ */ new Date(), { locale: r }), { representation: "date" }) < p) continue;
8479
+ let r = e[7];
8480
+ if (r.text && Uu(n(r.text, "d MMMM y", /* @__PURE__ */ new Date(), { locale: t }), { representation: "date" }) < p) continue;
8481
8481
  }
8482
8482
  }
8483
8483
  let h = l.getAttribute("data-href");
8484
8484
  o.notStrictEqual(h, void 0);
8485
8485
  let g = h.split("/");
8486
8486
  o.strictEqual(g[0], "", `Unexpected URL path for amendement: ${h}`), o.strictEqual(g[1], "dyn", `Unexpected URL path for amendement: ${h}`);
8487
- let _ = c.join(t, ...g.slice(2)) + ".html";
8487
+ let _ = c.join(e, ...g.slice(2)) + ".html";
8488
8488
  await s.ensureDir(c.dirname(_));
8489
8489
  let v = await s.pathExists(_) ? await s.readFile(_, "utf8") : null, ne = l.outerHTML, re = `---\n${d.dump({
8490
8490
  position: te - ee,
8491
- search: n.replace(/&page=[\d]+/, "")
8491
+ search: r.replace(/&page=[\d]+/, "")
8492
8492
  }, { sortKeys: !0 })}---\n\n${ne}`;
8493
8493
  if (re === v) {
8494
8494
  if (i) break iterSearchPages;
@@ -8519,7 +8519,7 @@ async function* Gu(t, n, i, a, p, m = {}) {
8519
8519
  let ae = g.querySelector("div.an-pagination--item > i.an-icons-chevron-right ~ a");
8520
8520
  if (ae === null) break;
8521
8521
  let oe = ae.getAttribute("href");
8522
- o.notStrictEqual(oe, void 0), n = new URL(oe, "https://www.assemblee-nationale.fr/").toString();
8522
+ o.notStrictEqual(oe, void 0), r = new URL(oe, "https://www.assemblee-nationale.fr/").toString();
8523
8523
  }
8524
8524
  }
8525
8525
  //#endregion
@@ -269,7 +269,7 @@ export type RenouvellementClean = z.infer<typeof RenouvellementCleanSchema>;
269
269
  * Renouvellements (renewals) - clean version
270
270
  * Note: Array unwrapped from wrapper object by cleaner
271
271
  */
272
- export declare const RenouvellementCleanssSchema: z.ZodObject<{
272
+ export declare const RenouvellementCleansSchema: z.ZodObject<{
273
273
  renouvellement: z.ZodArray<z.ZodObject<{
274
274
  infoJO: z.ZodObject<{
275
275
  typeJO: z.ZodOptional<z.ZodEnum<{
@@ -285,7 +285,7 @@ export declare const RenouvellementCleanssSchema: z.ZodObject<{
285
285
  }, z.core.$strip>;
286
286
  }, z.core.$strip>>;
287
287
  }, z.core.$strip>;
288
- export type RenouvellementCleans = z.infer<typeof RenouvellementCleanssSchema>;
288
+ export type RenouvellementCleans = z.infer<typeof RenouvellementCleansSchema>;
289
289
  /**
290
290
  * Question.
291
291
  *