@tricoteuses/assemblee 3.3.8 → 3.4.0

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.
Files changed (40) hide show
  1. package/README.md +11 -2
  2. package/lib/{amendements-Co_qQeCl.js → amendements-D2X2TneW.js} +1 -1
  3. package/lib/{amendements-s-5GIY_X.js → amendements-DSXfagiR.js} +680 -710
  4. package/lib/cleaners.js +3 -3
  5. package/lib/derouleur.d.ts +77 -0
  6. package/lib/derouleur.js +87 -0
  7. package/lib/eliasse.d.ts +164 -0
  8. package/lib/eliasse.js +150 -0
  9. package/lib/git.js +1 -1
  10. package/lib/index.js +7 -4
  11. package/lib/{loaders-Bdc1oCGG.js → loaders-DYFDjudN.js} +2 -2
  12. package/lib/loaders.js +1 -1
  13. package/lib/parsers.js +492 -448
  14. package/lib/registries.d.ts +8 -8
  15. package/lib/schemas/clean/acteurs_et_organes.d.ts +37 -37
  16. package/lib/schemas/clean/amendements.d.ts +12 -12
  17. package/lib/schemas/clean/debats.d.ts +26 -26
  18. package/lib/schemas/clean/dossiers_legislatifs.d.ts +16 -16
  19. package/lib/schemas/clean/questions.d.ts +122 -122
  20. package/lib/schemas/clean/scrutins.d.ts +2 -2
  21. package/lib/schemas/enriched/acteurs_et_organes.d.ts +2 -2
  22. package/lib/schemas/enriched/amendements.d.ts +9 -9
  23. package/lib/schemas/enriched/dossiers_legislatifs.d.ts +12 -12
  24. package/lib/schemas/enriched/questions.d.ts +108 -108
  25. package/lib/schemas/enriched/scrutins.d.ts +2 -2
  26. package/lib/schemas/raw/acteurs_et_organes.d.ts +132 -132
  27. package/lib/schemas/raw/agendas.d.ts +97 -97
  28. package/lib/schemas/raw/amendements.d.ts +83 -83
  29. package/lib/schemas/raw/debats.d.ts +51 -51
  30. package/lib/schemas/raw/dossiers_legislatifs.d.ts +171 -171
  31. package/lib/schemas/raw/questions.d.ts +222 -222
  32. package/lib/schemas/raw/scrutins.d.ts +164 -164
  33. package/lib/scripts/dataset_safety.test.d.ts +1 -0
  34. package/lib/scripts/forgejo_pending_status.d.ts +9 -0
  35. package/lib/scripts/forgejo_pending_status.test.d.ts +1 -0
  36. package/lib/scripts/monitor_open_data_updates.d.ts +2 -0
  37. package/lib/scripts/shared/dataset-inputs.d.ts +5 -0
  38. package/lib/{scrutins-UjCZmd8a.js → scrutins-CGHd_VPY.js} +19 -18
  39. package/lib/zod_errors-DCnjCNGy.js +34 -0
  40. package/package.json +11 -1
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ export declare function forgejoDispatchedRunStatus({ apiUrl, repository, workflow, dispatchId, dispatchedAt, token, timeoutMs, }: {
2
+ apiUrl: string;
3
+ repository: string;
4
+ workflow: string;
5
+ dispatchId: string;
6
+ dispatchedAt: string;
7
+ token: string;
8
+ timeoutMs: number;
9
+ }, fetcher?: typeof fetch): Promise<"active" | "failed" | "succeeded" | undefined>;
@@ -0,0 +1 @@
1
+ export {};
@@ -9,6 +9,8 @@ export interface MonitoredDataset {
9
9
  export interface PendingUpdate {
10
10
  expiresAt: string;
11
11
  pipelineId?: number;
12
+ dispatchId?: string;
13
+ dispatchedAt?: string;
12
14
  versionKey: string;
13
15
  }
14
16
  export interface DatasetState {
@@ -0,0 +1,5 @@
1
+ import { EnabledDatasets, Datasets } from '../../datasets.js';
2
+ /** Select before any clone, pull or output cleanup. Never mutate the catalogue. */
3
+ export declare function selectProcessingDatasets(available: Datasets, enabled: EnabledDatasets, requested?: string): Datasets;
4
+ /** An absent/empty source is not an authoritative empty dataset. */
5
+ export declare function requireDatasetInput(input: string, directory: boolean): void;
@@ -1,4 +1,5 @@
1
- import { $ as e, Q as t, X as n, Y as r, Z as i, et as a, nt as o, rt as s, tt as c } from "./amendements-s-5GIY_X.js";
1
+ import { $ as e, Q as t, X as n, Y as r, Z as i, et as a, nt as o, tt as s } from "./amendements-DSXfagiR.js";
2
+ import { t as c } from "./zod_errors-DCnjCNGy.js";
2
3
  import { z as l } from "zod";
3
4
  //#region src/legislatures.ts
4
5
  var ee = /* @__PURE__ */ function(e) {
@@ -449,7 +450,7 @@ var Gt = [
449
450
  lienAdt: t(S).optional()
450
451
  })), qt = l.object({
451
452
  nom: a(),
452
- id: c(),
453
+ id: s(),
453
454
  qualite: a()
454
455
  }), Jt = l.object({ orateur: t(qt) }), C = l.lazy(() => l.object({
455
456
  id_preparation: a(),
@@ -764,8 +765,8 @@ var qn = l.object({
764
765
  }), rr = l.object({ rapporteur: t(P) }), ir = l.lazy(() => l.object({
765
766
  typeMission: mn,
766
767
  codeMission: a(),
767
- libelleLong: c(),
768
- libelleCourt: c(),
768
+ libelleLong: s(),
769
+ libelleCourt: s(),
769
770
  typeBudget: pn,
770
771
  missions: ar.optional()
771
772
  })), ar = l.object({ mission: t(ir) }), or = l.object({
@@ -793,7 +794,7 @@ var qn = l.object({
793
794
  dateJO: l.string(),
794
795
  pageJO: l.null(),
795
796
  numJO: l.string(),
796
- urlLegifrance: c(),
797
+ urlLegifrance: s(),
797
798
  referenceNOR: a()
798
799
  }), hr = l.object({
799
800
  typeTexteEuropeen: l.string(),
@@ -918,12 +919,12 @@ var Tr = [
918
919
  }), I = l.object({
919
920
  typeJO: Ar.nullable(),
920
921
  dateJO: n().describe("Date de publication au Journal Officiel"),
921
- pageJO: c().nullable(),
922
- numJO: c().nullable(),
923
- urlLegifrance: c().nullable(),
924
- referenceNOR: c().nullable()
925
- }), Fr = l.object({ analyse: c().nullable() }), Ir = l.object({
926
- rubrique: c().nullable(),
922
+ pageJO: s().nullable(),
923
+ numJO: s().nullable(),
924
+ urlLegifrance: s().nullable(),
925
+ referenceNOR: s().nullable()
926
+ }), Fr = l.object({ analyse: s().nullable() }), Ir = l.object({
927
+ rubrique: s().nullable(),
927
928
  teteAnalyse: l.null(),
928
929
  analyses: Fr
929
930
  }), Lr = l.object({
@@ -931,7 +932,7 @@ var Tr = [
931
932
  denomination: Mr
932
933
  }), Rr = l.object({ minAttrib: t(Lr) }), zr = l.object({
933
934
  infoJO: I,
934
- texte: c().nullable(),
935
+ texte: s().nullable(),
935
936
  erratum: l.string().optional()
936
937
  }), Br = l.object({ texteQuestion: t(zr) }), Vr = l.object({ texteReponse: t(zr) }), Hr = l.object({
937
938
  codeCloture: l.string(),
@@ -1327,7 +1328,7 @@ function ha(e) {
1327
1328
  return JSON.stringify(e, null, 2);
1328
1329
  }
1329
1330
  function V(e, t, n) {
1330
- return s(e, t, n);
1331
+ return c(e, t, n);
1331
1332
  }
1332
1333
  var ga = {
1333
1334
  toActeur: ca,
@@ -1452,7 +1453,7 @@ function Ba(e) {
1452
1453
  return JSON.stringify(e, null, 2);
1453
1454
  }
1454
1455
  function Va(e, t, n) {
1455
- return s(e, t, n);
1456
+ return c(e, t, n);
1456
1457
  }
1457
1458
  var Ha = {
1458
1459
  toReunion: La,
@@ -1586,7 +1587,7 @@ function no(e) {
1586
1587
  return JSON.stringify(e, null, 2);
1587
1588
  }
1588
1589
  function ro(e, t, n) {
1589
- return s(e, t, n);
1590
+ return c(e, t, n);
1590
1591
  }
1591
1592
  var io = {
1592
1593
  toCompteRendu: $a,
@@ -1887,7 +1888,7 @@ function is(e) {
1887
1888
  return JSON.stringify(e, null, 2);
1888
1889
  }
1889
1890
  function as(e, t, n) {
1890
- return s(e, t, n);
1891
+ return c(e, t, n);
1891
1892
  }
1892
1893
  var os = {
1893
1894
  toDocument: $o,
@@ -1977,7 +1978,7 @@ function Os(e) {
1977
1978
  return JSON.stringify(e, null, 2);
1978
1979
  }
1979
1980
  function ks(e, t, n) {
1980
- return s(e, t, n);
1981
+ return c(e, t, n);
1981
1982
  }
1982
1983
  var As = {
1983
1984
  toQuestion: Ts,
@@ -2082,7 +2083,7 @@ function Ys(e) {
2082
2083
  return JSON.stringify(e, null, 2);
2083
2084
  }
2084
2085
  function Xs(e, t, n) {
2085
- return s(e, t, n);
2086
+ return c(e, t, n);
2086
2087
  }
2087
2088
  var Zs = {
2088
2089
  toScrutin: Ks,
@@ -0,0 +1,34 @@
1
+ //#region src/schemas/zod_errors.ts
2
+ var e = 160;
3
+ function t(t) {
4
+ if (typeof t == "string") {
5
+ let n = t.length > e ? `${t.slice(0, e - 3)}...` : t;
6
+ return JSON.stringify(n);
7
+ }
8
+ if (typeof t == "bigint") return `${t}n`;
9
+ if (typeof t == "symbol") return String(t);
10
+ if (typeof t == "function") return `[Function ${t.name || "anonymous"}]`;
11
+ try {
12
+ let n = JSON.stringify(t);
13
+ return n === void 0 ? String(t) : n.length > e ? `${n.slice(0, e - 3)}...` : n;
14
+ } catch {
15
+ return String(t);
16
+ }
17
+ }
18
+ function n(e, t) {
19
+ let n = e;
20
+ for (let e of t) {
21
+ if (n === null || typeof n != "object" && !Array.isArray(n)) return;
22
+ n = n[e];
23
+ }
24
+ return n;
25
+ }
26
+ function r(e, r) {
27
+ let i = e.path.length > 0 ? e.path.join(".") : "(root)", a = "input" in e && e.input !== void 0 ? e.input : r === void 0 ? void 0 : n(r, e.path), o = a === void 0 ? "" : ` (received: ${t(a)})`;
28
+ return ` - ${i}: ${e.message}${o}`;
29
+ }
30
+ function i(e, t, n) {
31
+ return `Invalid ${e}:\n${t.issues.map((e) => r(e, n)).join("\n")}`;
32
+ }
33
+ //#endregion
34
+ export { i as t };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tricoteuses/assemblee",
3
- "version": "3.3.8",
3
+ "version": "3.4.0",
4
4
  "description": "Retrieve, clean up & handle French Assemblée nationale's open data",
5
5
  "keywords": [
6
6
  "Assemblée nationale",
@@ -48,6 +48,16 @@
48
48
  "import": "./lib/cleaners.js",
49
49
  "types": "./lib/cleaners/index.d.ts"
50
50
  },
51
+ "./derouleur": {
52
+ "typedoc": "./src/derouleur.ts",
53
+ "import": "./lib/derouleur.js",
54
+ "types": "./lib/derouleur.d.ts"
55
+ },
56
+ "./eliasse": {
57
+ "typedoc": "./src/eliasse.ts",
58
+ "import": "./lib/eliasse.js",
59
+ "types": "./lib/eliasse.d.ts"
60
+ },
51
61
  "./git": {
52
62
  "typedoc": "./src/git.ts",
53
63
  "import": "./lib/git.js",