@tricoteuses/assemblee 3.1.0 → 3.1.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/README.md +2 -2
- package/lib/amendements-Blw6Aa6-.js +4133 -0
- package/lib/amendements-DiMsxlUL.js +178 -0
- package/lib/cleaners/reunions.d.ts +2 -1
- package/lib/cleaners.js +653 -581
- package/lib/datasets.d.ts +2 -6
- package/lib/git.js +127 -142
- package/lib/index.js +758 -555
- package/lib/loaders.js +2145 -4
- package/lib/parsers.js +10324 -8388
- package/lib/questions-XokaUGcy.js +3037 -0
- package/lib/scripts/retrieve_documents.d.ts +4 -0
- package/lib/scripts/retrieve_open_data.d.ts +4 -0
- package/lib/scripts/shared/cli_helpers.d.ts +8 -0
- package/package.json +1 -1
- package/lib/amendements-DrQ9BA7A.js +0 -3715
- package/lib/amendements-uxFcHcO5.js +0 -152
- package/lib/loaders-BtLzIUCT.js +0 -1348
- package/lib/questions-CxGnKVDB.js +0 -1578
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
|
-
|
|
37
|
-
|
|
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,150 +1,135 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"ignore",
|
|
13
|
-
"ignore",
|
|
14
|
-
"pipe"
|
|
15
|
-
]
|
|
16
|
-
}));
|
|
1
|
+
import { execSync as i } from "node:child_process";
|
|
2
|
+
import d from "fs-extra";
|
|
3
|
+
import a from "node:path";
|
|
4
|
+
const f = 50 * 1024 * 1024;
|
|
5
|
+
function m(t) {
|
|
6
|
+
d.existsSync(a.join(t, ".git")) || (d.ensureDirSync(t), i("git init", {
|
|
7
|
+
cwd: t,
|
|
8
|
+
env: process.env,
|
|
9
|
+
encoding: "utf-8",
|
|
10
|
+
stdio: ["ignore", "ignore", "pipe"]
|
|
11
|
+
}));
|
|
17
12
|
}
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
]
|
|
40
|
-
}), !0;
|
|
41
|
-
} catch (e) {
|
|
42
|
-
let t = e;
|
|
43
|
-
if (t.stdout === null || !/nothing to commit|rien à valider/.test(String(t.stdout ?? ""))) throw console.error(t.output), e;
|
|
44
|
-
return !1;
|
|
45
|
-
}
|
|
13
|
+
function h(t, n) {
|
|
14
|
+
m(t), i("git add .", {
|
|
15
|
+
cwd: t,
|
|
16
|
+
env: process.env,
|
|
17
|
+
encoding: "utf-8",
|
|
18
|
+
stdio: ["ignore", "ignore", "pipe"],
|
|
19
|
+
maxBuffer: f
|
|
20
|
+
});
|
|
21
|
+
try {
|
|
22
|
+
return i(`git commit -m "${n}" --quiet`, {
|
|
23
|
+
cwd: t,
|
|
24
|
+
env: process.env,
|
|
25
|
+
encoding: "utf-8",
|
|
26
|
+
stdio: ["ignore", "pipe", "pipe"]
|
|
27
|
+
}), !0;
|
|
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;
|
|
32
|
+
return !1;
|
|
33
|
+
}
|
|
46
34
|
}
|
|
47
|
-
function
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
return i;
|
|
35
|
+
function x(t, n, o) {
|
|
36
|
+
let e = 0;
|
|
37
|
+
if (h(t, n))
|
|
38
|
+
for (const c of o || [])
|
|
39
|
+
try {
|
|
40
|
+
i(`git push ${c} master`, {
|
|
41
|
+
cwd: t,
|
|
42
|
+
env: process.env,
|
|
43
|
+
encoding: "utf-8",
|
|
44
|
+
stdio: ["ignore", "ignore", "pipe"]
|
|
45
|
+
});
|
|
46
|
+
} catch (r) {
|
|
47
|
+
const s = r;
|
|
48
|
+
console.error(s.output), e = s.status ?? 1;
|
|
49
|
+
}
|
|
50
|
+
else
|
|
51
|
+
e = 10;
|
|
52
|
+
return e;
|
|
66
53
|
}
|
|
67
|
-
function
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
env: process.env,
|
|
80
|
-
encoding: "utf-8",
|
|
81
|
-
stdio: [
|
|
82
|
-
"ignore",
|
|
83
|
-
"ignore",
|
|
84
|
-
"pipe"
|
|
85
|
-
]
|
|
86
|
-
}), !0;
|
|
54
|
+
function P(t) {
|
|
55
|
+
return i("git reset --hard origin/master", {
|
|
56
|
+
cwd: t,
|
|
57
|
+
env: process.env,
|
|
58
|
+
encoding: "utf-8",
|
|
59
|
+
stdio: ["ignore", "ignore", "pipe"]
|
|
60
|
+
}), i("git pull --rebase", {
|
|
61
|
+
cwd: t,
|
|
62
|
+
env: process.env,
|
|
63
|
+
encoding: "utf-8",
|
|
64
|
+
stdio: ["ignore", "ignore", "pipe"]
|
|
65
|
+
}), !0;
|
|
87
66
|
}
|
|
88
|
-
function
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
"ignore",
|
|
96
|
-
"pipe"
|
|
97
|
-
]
|
|
98
|
-
});
|
|
67
|
+
function A(t, n, o) {
|
|
68
|
+
t !== void 0 && i(`git clone ${t}/${n}.git`, {
|
|
69
|
+
cwd: o,
|
|
70
|
+
env: process.env,
|
|
71
|
+
encoding: "utf-8",
|
|
72
|
+
stdio: ["ignore", "ignore", "pipe"]
|
|
73
|
+
});
|
|
99
74
|
}
|
|
100
|
-
function
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
75
|
+
function $(t, n, o) {
|
|
76
|
+
try {
|
|
77
|
+
o && console.log(`git -C ${t} ${n}`);
|
|
78
|
+
const e = i(`git ${n}`, {
|
|
79
|
+
cwd: t,
|
|
80
|
+
maxBuffer: f
|
|
81
|
+
}).toString().trim();
|
|
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;
|
|
88
|
+
}
|
|
113
89
|
}
|
|
114
|
-
function
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
} catch (e) {
|
|
128
|
-
if (e.status != 0) return !1;
|
|
129
|
-
throw e;
|
|
130
|
-
}
|
|
90
|
+
function F(t, n, o) {
|
|
91
|
+
try {
|
|
92
|
+
o && console.log(`git -C ${t} ${n}`);
|
|
93
|
+
const e = i(`git ${n}`, {
|
|
94
|
+
cwd: t,
|
|
95
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
96
|
+
maxBuffer: f
|
|
97
|
+
}).toString().trim();
|
|
98
|
+
return o && console.log(e), !0;
|
|
99
|
+
} catch (e) {
|
|
100
|
+
if (e.status != 0) return !1;
|
|
101
|
+
throw e;
|
|
102
|
+
}
|
|
131
103
|
}
|
|
132
|
-
function
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
104
|
+
function B(t, n, o = {}) {
|
|
105
|
+
const { diffFilter: e } = o;
|
|
106
|
+
try {
|
|
107
|
+
const r = $(
|
|
108
|
+
t,
|
|
109
|
+
`diff --name-status --diff-filter=${e ?? "AMR"} ${n}`,
|
|
110
|
+
!1
|
|
111
|
+
), s = /* @__PURE__ */ new Map();
|
|
112
|
+
for (const g of r.split(`
|
|
113
|
+
`)) {
|
|
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);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return s;
|
|
122
|
+
} catch {
|
|
123
|
+
return console.error(`Error getting changed files since commit ${n}`), /* @__PURE__ */ new Map();
|
|
124
|
+
}
|
|
148
125
|
}
|
|
149
|
-
|
|
150
|
-
|
|
126
|
+
export {
|
|
127
|
+
A as clone,
|
|
128
|
+
h as commit,
|
|
129
|
+
x as commitAndPush,
|
|
130
|
+
B as getChangedFilesSinceCommit,
|
|
131
|
+
m as initRepo,
|
|
132
|
+
P as resetAndPull,
|
|
133
|
+
$ as run,
|
|
134
|
+
F as test
|
|
135
|
+
};
|