@tricoteuses/assemblee 3.0.18 → 3.1.1

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 +2 -2
  2. package/lib/{amendements-Bab1iUCY.js → amendements-Blw6Aa6-.js} +3 -3
  3. package/lib/amendements-DiMsxlUL.js +178 -0
  4. package/lib/cleaners/actes_legislatifs.d.ts +2 -2
  5. package/lib/cleaners/acteurs.d.ts +7 -2
  6. package/lib/cleaners/amendements.d.ts +2 -2
  7. package/lib/cleaners/documents.d.ts +1 -1
  8. package/lib/cleaners/dossiers_legislatifs.d.ts +1 -1
  9. package/lib/cleaners/organes.d.ts +1 -1
  10. package/lib/cleaners/reunions.d.ts +1 -1
  11. package/lib/cleaners/scrutins.d.ts +10 -2
  12. package/lib/cleaners.js +576 -485
  13. package/lib/datasets.d.ts +2 -6
  14. package/lib/git.js +54 -51
  15. package/lib/index.js +263 -257
  16. package/lib/inserters.d.ts +22 -2
  17. package/lib/loaders.js +495 -544
  18. package/lib/logger.d.ts +1 -1
  19. package/lib/parsers.js +5 -5
  20. package/lib/{questions-BiakXZ6q.js → questions-XokaUGcy.js} +4 -1
  21. package/lib/registries.d.ts +4 -4
  22. package/lib/schemas/clean/acteurs_et_organes.d.ts +37 -37
  23. package/lib/schemas/clean/amendements.d.ts +38 -25
  24. package/lib/schemas/clean/dossiers_legislatifs.d.ts +16 -16
  25. package/lib/schemas/clean/scrutins.d.ts +2 -2
  26. package/lib/schemas/enriched/acteurs_et_organes.d.ts +2 -2
  27. package/lib/schemas/enriched/amendements.d.ts +135 -15
  28. package/lib/schemas/enriched/dossiers_legislatifs.d.ts +12 -12
  29. package/lib/schemas/enriched/scrutins.d.ts +2 -2
  30. package/lib/schemas/raw/acteurs_et_organes.d.ts +99 -99
  31. package/lib/schemas/raw/agendas.d.ts +11 -11
  32. package/lib/schemas/raw/amendements.d.ts +49 -37
  33. package/lib/schemas/raw/dossiers_legislatifs.d.ts +146 -63
  34. package/lib/schemas/raw/questions.d.ts +44 -44
  35. package/lib/schemas/raw/scrutins.d.ts +4 -4
  36. package/lib/scripts/retrieve_documents.d.ts +5 -1
  37. package/lib/scripts/retrieve_open_data.d.ts +4 -0
  38. package/lib/scripts/shared/cli_helpers.d.ts +8 -0
  39. package/package.json +26 -26
  40. package/lib/amendements-BKGwufEi.js +0 -170
package/lib/datasets.d.ts CHANGED
@@ -16,8 +16,6 @@ export interface Datasets {
16
16
  dossiersLegislatifs: Dataset[];
17
17
  scrutins: Dataset[];
18
18
  questions: Dataset[];
19
- comptesRendusSeances: Dataset[];
20
- comptesRendusCommissions: Dataset[];
21
19
  comptesRendus: Dataset[];
22
20
  }
23
21
  export declare enum DatasetStructure {
@@ -33,10 +31,8 @@ export declare enum EnabledDatasets {
33
31
  Photos = 16,
34
32
  Scrutins = 32,
35
33
  Questions = 64,
36
- ComptesRendusSeances = 128,
37
- ComptesRendusCommissions = 256,
38
- ComptesRendus = 512,
39
- All = 1023
34
+ ComptesRendus = 128,
35
+ All = 255
40
36
  }
41
37
  export declare function getDatasets(): string[];
42
38
  export declare function validDataset(dir: string[]): boolean;
package/lib/git.js CHANGED
@@ -1,40 +1,41 @@
1
1
  import { execSync as i } from "node:child_process";
2
- import g from "fs-extra";
2
+ import d from "fs-extra";
3
3
  import a from "node:path";
4
- const u = 50 * 1024 * 1024;
4
+ const f = 50 * 1024 * 1024;
5
5
  function m(t) {
6
- g.existsSync(a.join(t, ".git")) || (g.ensureDirSync(t), i("git init", {
6
+ d.existsSync(a.join(t, ".git")) || (d.ensureDirSync(t), i("git init", {
7
7
  cwd: t,
8
8
  env: process.env,
9
9
  encoding: "utf-8",
10
10
  stdio: ["ignore", "ignore", "pipe"]
11
11
  }));
12
12
  }
13
- function h(t, o) {
13
+ function h(t, n) {
14
14
  m(t), i("git add .", {
15
15
  cwd: t,
16
16
  env: process.env,
17
17
  encoding: "utf-8",
18
18
  stdio: ["ignore", "ignore", "pipe"],
19
- maxBuffer: u
19
+ maxBuffer: f
20
20
  });
21
21
  try {
22
- return i(`git commit -m "${o}" --quiet`, {
22
+ return i(`git commit -m "${n}" --quiet`, {
23
23
  cwd: t,
24
24
  env: process.env,
25
25
  encoding: "utf-8",
26
26
  stdio: ["ignore", "pipe", "pipe"]
27
27
  }), !0;
28
- } catch (e) {
29
- if (e.stdout === null || !/nothing to commit|rien à valider/.test(e.stdout))
30
- throw console.error(e.output), e;
28
+ } catch (o) {
29
+ const e = o;
30
+ if (e.stdout === null || !/nothing to commit|rien à valider/.test(String(e.stdout ?? "")))
31
+ throw console.error(e.output), o;
31
32
  return !1;
32
33
  }
33
34
  }
34
- function P(t, o, e) {
35
- let n = 0;
36
- if (h(t, o))
37
- for (const c of e || [])
35
+ function x(t, n, o) {
36
+ let e = 0;
37
+ if (h(t, n))
38
+ for (const c of o || [])
38
39
  try {
39
40
  i(`git push ${c} master`, {
40
41
  cwd: t,
@@ -43,13 +44,14 @@ function P(t, o, e) {
43
44
  stdio: ["ignore", "ignore", "pipe"]
44
45
  });
45
46
  } catch (r) {
46
- console.error(r.output), n = r.status;
47
+ const s = r;
48
+ console.error(s.output), e = s.status ?? 1;
47
49
  }
48
50
  else
49
- n = 10;
50
- return n;
51
+ e = 10;
52
+ return e;
51
53
  }
52
- function S(t) {
54
+ function P(t) {
53
55
  return i("git reset --hard origin/master", {
54
56
  cwd: t,
55
57
  env: process.env,
@@ -62,71 +64,72 @@ function S(t) {
62
64
  stdio: ["ignore", "ignore", "pipe"]
63
65
  }), !0;
64
66
  }
65
- function A(t, o, e) {
66
- t !== void 0 && i(`git clone ${t}/${o}.git`, {
67
- cwd: e,
67
+ function A(t, n, o) {
68
+ t !== void 0 && i(`git clone ${t}/${n}.git`, {
69
+ cwd: o,
68
70
  env: process.env,
69
71
  encoding: "utf-8",
70
72
  stdio: ["ignore", "ignore", "pipe"]
71
73
  });
72
74
  }
73
- function $(t, o, e) {
75
+ function $(t, n, o) {
74
76
  try {
75
- e && console.log(`git -C ${t} ${o}`);
76
- const n = i(`git ${o}`, {
77
+ o && console.log(`git -C ${t} ${n}`);
78
+ const e = i(`git ${n}`, {
77
79
  cwd: t,
78
- maxBuffer: u
80
+ maxBuffer: f
79
81
  }).toString().trim();
80
- return e && console.log(n), n;
81
- } catch (n) {
82
- for (const c of ["stdout", "stderr"])
83
- console.error(`${c}: ${n[c]}`);
84
- throw n;
82
+ return o && console.log(e), e;
83
+ } catch (e) {
84
+ const c = e;
85
+ for (const r of ["stdout", "stderr"])
86
+ console.error(`${r}: ${String(c[r] ?? "")}`);
87
+ throw e;
85
88
  }
86
89
  }
87
- function F(t, o, e) {
90
+ function F(t, n, o) {
88
91
  try {
89
- e && console.log(`git -C ${t} ${o}`);
90
- const n = i(`git ${o}`, {
92
+ o && console.log(`git -C ${t} ${n}`);
93
+ const e = i(`git ${n}`, {
91
94
  cwd: t,
92
95
  stdio: ["ignore", "pipe", "pipe"],
93
- maxBuffer: u
96
+ maxBuffer: f
94
97
  }).toString().trim();
95
- return e && console.log(n), !0;
96
- } catch (n) {
97
- if (n.status != 0) return !1;
98
- throw n;
98
+ return o && console.log(e), !0;
99
+ } catch (e) {
100
+ if (e.status != 0) return !1;
101
+ throw e;
99
102
  }
100
103
  }
101
- function B(t, o, e = {}) {
102
- const { diffFilter: n } = e;
104
+ function B(t, n, o = {}) {
105
+ const { diffFilter: e } = o;
103
106
  try {
104
107
  const r = $(
105
108
  t,
106
- `diff --name-status --diff-filter=${n ?? "AMR"} ${o}`,
109
+ `diff --name-status --diff-filter=${e ?? "AMR"} ${n}`,
107
110
  !1
108
- ), f = /* @__PURE__ */ new Map();
109
- for (const d of r.split(`
111
+ ), s = /* @__PURE__ */ new Map();
112
+ for (const g of r.split(`
110
113
  `)) {
111
- if (d.trim().length === 0) continue;
112
- const s = d.split(" ");
113
- if (s.length >= 2) {
114
- const l = s[0].charAt(0), p = s[1];
115
- f.set(p, l);
114
+ if (g.trim().length === 0) continue;
115
+ const u = g.split(" ");
116
+ if (u.length >= 2) {
117
+ const l = u[0].charAt(0), p = u[1];
118
+ s.set(p, l);
116
119
  }
117
120
  }
118
- return f;
121
+ return s;
119
122
  } catch {
120
- return console.error(`Error getting changed files since commit ${o}`), /* @__PURE__ */ new Map();
123
+ return console.error(`Error getting changed files since commit ${n}`), /* @__PURE__ */ new Map();
121
124
  }
122
125
  }
123
126
  export {
124
127
  A as clone,
125
128
  h as commit,
126
- P as commitAndPush,
129
+ x as commitAndPush,
127
130
  B as getChangedFilesSinceCommit,
128
131
  m as initRepo,
129
- S as resetAndPull,
132
+ P as resetAndPull,
130
133
  $ as run,
131
134
  F as test
132
135
  };