@tricoteuses/assemblee 2.5.25 → 2.5.26
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/git.js +1 -3
- package/lib/loaders.d.ts +10 -10
- package/lib/loaders.js +195 -195
- package/package.json +1 -1
package/lib/git.js
CHANGED
|
@@ -117,9 +117,7 @@ function B(t, o, e = {}) {
|
|
|
117
117
|
}
|
|
118
118
|
return f;
|
|
119
119
|
} catch {
|
|
120
|
-
return console.error(
|
|
121
|
-
`Error getting changed files since commit ${o}`
|
|
122
|
-
), /* @__PURE__ */ new Map();
|
|
120
|
+
return console.error(`Error getting changed files since commit ${o}`), /* @__PURE__ */ new Map();
|
|
123
121
|
}
|
|
124
122
|
}
|
|
125
123
|
export {
|
package/lib/loaders.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EnabledDatasets } from './datasets';
|
|
1
|
+
import { EnabledDatasets, Dataset } from './datasets';
|
|
2
2
|
import { Acteur, Organe, Photo } from './types/acteurs_et_organes';
|
|
3
3
|
import { Reunion } from './types/agendas';
|
|
4
4
|
import { Amendement } from './types/amendements';
|
|
@@ -54,55 +54,55 @@ export interface Data {
|
|
|
54
54
|
[uid: string]: CompteRendu;
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
|
-
export declare function iterLoadAssembleeActeurs(dataDir: string, legislature: Legislature, options?: {}): Generator<{
|
|
57
|
+
export declare function iterLoadAssembleeActeurs(dataDir: string, legislature: Legislature, options?: {}, customDatasets?: Dataset[]): Generator<{
|
|
58
58
|
acteur: Acteur;
|
|
59
59
|
datasetLegislature: Legislature;
|
|
60
60
|
filePath: string;
|
|
61
61
|
gitStatus?: "A" | "M" | "D" | "R" | "C" | "T" | "U";
|
|
62
62
|
}, void, unknown>;
|
|
63
|
-
export declare function iterLoadAssembleeOrganes(dataDir: string, legislature: Legislature, options?: {}): Generator<{
|
|
63
|
+
export declare function iterLoadAssembleeOrganes(dataDir: string, legislature: Legislature, options?: {}, customDatasets?: Dataset[]): Generator<{
|
|
64
64
|
organe: Organe;
|
|
65
65
|
datasetLegislature: Legislature;
|
|
66
66
|
filePath: string;
|
|
67
67
|
gitStatus?: "A" | "M" | "D" | "R" | "C" | "T" | "U";
|
|
68
68
|
}, void, unknown>;
|
|
69
|
-
export declare function iterLoadAssembleeAmendements(dataDir: string, legislature: Legislature, options?: {}): Generator<{
|
|
69
|
+
export declare function iterLoadAssembleeAmendements(dataDir: string, legislature: Legislature, options?: {}, customDatasets?: Dataset[]): Generator<{
|
|
70
70
|
amendement: Amendement;
|
|
71
71
|
datasetLegislature: Legislature;
|
|
72
72
|
filePath: string;
|
|
73
73
|
gitStatus?: "A" | "M" | "D" | "R" | "C" | "T" | "U";
|
|
74
74
|
}, void, unknown>;
|
|
75
|
-
export declare function iterLoadAssembleeDocuments(dataDir: string, legislature: Legislature, options?: {}): Generator<{
|
|
75
|
+
export declare function iterLoadAssembleeDocuments(dataDir: string, legislature: Legislature, options?: {}, customDatasets?: Dataset[]): Generator<{
|
|
76
76
|
document: Document;
|
|
77
77
|
datasetLegislature: Legislature;
|
|
78
78
|
filePath: string;
|
|
79
79
|
gitStatus?: "A" | "M" | "D" | "R" | "C" | "T" | "U";
|
|
80
80
|
}, void, unknown>;
|
|
81
|
-
export declare function iterLoadAssembleeDossiersParlementaires(dataDir: string, legislature: Legislature, options?: {}): Generator<{
|
|
81
|
+
export declare function iterLoadAssembleeDossiersParlementaires(dataDir: string, legislature: Legislature, options?: {}, customDatasets?: Dataset[]): Generator<{
|
|
82
82
|
dossierParlementaire: DossierParlementaire;
|
|
83
83
|
datasetLegislature: Legislature;
|
|
84
84
|
filePath: string;
|
|
85
85
|
gitStatus?: "A" | "M" | "D" | "R" | "C" | "T" | "U";
|
|
86
86
|
}, void, unknown>;
|
|
87
|
-
export declare function iterLoadAssembleeReunions(dataDir: string, legislature: Legislature, options?: {}): Generator<{
|
|
87
|
+
export declare function iterLoadAssembleeReunions(dataDir: string, legislature: Legislature, options?: {}, customDatasets?: Dataset[]): Generator<{
|
|
88
88
|
reunion: Reunion;
|
|
89
89
|
datasetLegislature: Legislature;
|
|
90
90
|
filePath: string;
|
|
91
91
|
gitStatus?: "A" | "M" | "D" | "R" | "C" | "T" | "U";
|
|
92
92
|
}, void, unknown>;
|
|
93
|
-
export declare function iterLoadAssembleeScrutins(dataDir: string, legislature: Legislature, options?: {}): Generator<{
|
|
93
|
+
export declare function iterLoadAssembleeScrutins(dataDir: string, legislature: Legislature, options?: {}, customDatasets?: Dataset[]): Generator<{
|
|
94
94
|
scrutin: Scrutin;
|
|
95
95
|
datasetLegislature: Legislature;
|
|
96
96
|
filePath: string;
|
|
97
97
|
gitStatus?: "A" | "M" | "D" | "R" | "C" | "T" | "U";
|
|
98
98
|
}, void, unknown>;
|
|
99
|
-
export declare function iterLoadAssembleeQuestions(dataDir: string, legislature: Legislature, options?: {}): Generator<{
|
|
99
|
+
export declare function iterLoadAssembleeQuestions(dataDir: string, legislature: Legislature, options?: {}, customDatasets?: Dataset[]): Generator<{
|
|
100
100
|
question: Question;
|
|
101
101
|
datasetLegislature: Legislature;
|
|
102
102
|
filePath: string;
|
|
103
103
|
gitStatus?: "A" | "M" | "D" | "R" | "C" | "T" | "U";
|
|
104
104
|
}, void, unknown>;
|
|
105
|
-
export declare function iterLoadAssembleeComptesRendus(dataDir: string, legislature: Legislature, options?: {}): Generator<{
|
|
105
|
+
export declare function iterLoadAssembleeComptesRendus(dataDir: string, legislature: Legislature, options?: {}, customDatasets?: Dataset[]): Generator<{
|
|
106
106
|
compteRendu: CompteRendu;
|
|
107
107
|
datasetLegislature: Legislature;
|
|
108
108
|
filePath: string;
|
package/lib/loaders.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import E from "node:assert";
|
|
2
|
-
import
|
|
2
|
+
import g from "fs-extra";
|
|
3
3
|
import s from "node:path";
|
|
4
|
-
import { a1 as F, a2 as P, L as
|
|
4
|
+
import { a1 as F, a2 as P, L as j, a3 as W, a4 as M, a5 as J, a6 as w, a7 as T, a8 as Q, Y as Z, $ as G, a0 as H, X as K, Z as ee, _ as ne } from "./datasets-BCg11CdK.js";
|
|
5
5
|
import "glob";
|
|
6
6
|
import { getChangedFilesSinceCommit as V } from "./git.js";
|
|
7
7
|
import { C as X } from "./amendements-40Z7OJLT.js";
|
|
8
8
|
function* R(t, o = []) {
|
|
9
9
|
const e = s.join(t, ...o);
|
|
10
|
-
if (
|
|
11
|
-
for (const i of
|
|
10
|
+
if (g.existsSync(e))
|
|
11
|
+
for (const i of g.readdirSync(e)) {
|
|
12
12
|
if (i[0] === ".")
|
|
13
13
|
continue;
|
|
14
14
|
const u = s.join(e, i), f = [...o, i];
|
|
15
|
-
|
|
15
|
+
g.statSync(u).isDirectory() ? yield* R(t, f) : yield f;
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
const I = [
|
|
@@ -54,7 +54,7 @@ function oe(t) {
|
|
|
54
54
|
o += I[e + 1], t -= I[e];
|
|
55
55
|
return o;
|
|
56
56
|
}
|
|
57
|
-
function* B(t, o, e, i, u, f = "json", { log:
|
|
57
|
+
function* B(t, o, e, i, u, f = "json", { log: d = !1, noValidation: l = !1, sinceCommits: y } = {}) {
|
|
58
58
|
const A = /* @__PURE__ */ new Set();
|
|
59
59
|
for (const S of e) {
|
|
60
60
|
if (S.ignoreForWeb || !ie(o, S))
|
|
@@ -65,7 +65,7 @@ function* B(t, o, e, i, u, f = "json", { log: l = !1, noValidation: h = !1, sinc
|
|
|
65
65
|
), $ = y ? y[S.name] : void 0, x = $ ? V(L, $, {
|
|
66
66
|
diffFilter: "AMR"
|
|
67
67
|
}) : null;
|
|
68
|
-
|
|
68
|
+
d && $ && (console.log(
|
|
69
69
|
`Filtering files changed since commit ${$} in ${L}`
|
|
70
70
|
), console.log(`Found ${x?.size || 0} changed files`));
|
|
71
71
|
for (const b of R(L, u)) {
|
|
@@ -74,9 +74,9 @@ function* B(t, o, e, i, u, f = "json", { log: l = !1, noValidation: h = !1, sinc
|
|
|
74
74
|
const D = s.join(L, ...b), n = s.join(...b), c = x?.get(n);
|
|
75
75
|
if (x && !c)
|
|
76
76
|
continue;
|
|
77
|
-
|
|
78
|
-
let a =
|
|
79
|
-
const p =
|
|
77
|
+
d && console.log(`Loading file: ${D}…`);
|
|
78
|
+
let a = g.readFileSync(D, { encoding: "utf8" });
|
|
79
|
+
const p = l ? JSON.parse(a) : i(a);
|
|
80
80
|
A.has(p.uid) || (A.add(p.uid), yield {
|
|
81
81
|
datasetLegislature: S.legislature,
|
|
82
82
|
filePath: D,
|
|
@@ -94,7 +94,7 @@ function* B(t, o, e, i, u, f = "json", { log: l = !1, noValidation: h = !1, sinc
|
|
|
94
94
|
);
|
|
95
95
|
for (const [C, D] of b.entries()) {
|
|
96
96
|
const n = s.join(L, C);
|
|
97
|
-
|
|
97
|
+
d && console.log(`Deleted file: ${n}`);
|
|
98
98
|
const a = { uid: s.basename(C, `.${f}`) };
|
|
99
99
|
yield {
|
|
100
100
|
datasetLegislature: S.legislature,
|
|
@@ -109,212 +109,212 @@ function* B(t, o, e, i, u, f = "json", { log: l = !1, noValidation: h = !1, sinc
|
|
|
109
109
|
}
|
|
110
110
|
function ie(t, o) {
|
|
111
111
|
const e = Array.isArray(t) ? t : t !== void 0 ? [t] : [];
|
|
112
|
-
return t === void 0 || e.includes(0) || o.legislature ===
|
|
112
|
+
return t === void 0 || e.includes(0) || o.legislature === j.All ? !0 : e.includes(o.legislature);
|
|
113
113
|
}
|
|
114
|
-
function* de(t, o, e = {}) {
|
|
114
|
+
function* de(t, o, e = {}, i) {
|
|
115
115
|
for (const {
|
|
116
|
-
datasetLegislature:
|
|
117
|
-
item:
|
|
118
|
-
filePath:
|
|
116
|
+
datasetLegislature: u,
|
|
117
|
+
item: f,
|
|
118
|
+
filePath: d,
|
|
119
119
|
gitStatus: l
|
|
120
120
|
} of B(
|
|
121
121
|
t,
|
|
122
122
|
o,
|
|
123
|
-
F.acteursEtOrganes,
|
|
123
|
+
i ?? F.acteursEtOrganes,
|
|
124
124
|
W.toActeur,
|
|
125
125
|
["acteurs"],
|
|
126
126
|
"json",
|
|
127
127
|
e
|
|
128
128
|
))
|
|
129
129
|
yield {
|
|
130
|
-
acteur:
|
|
131
|
-
datasetLegislature:
|
|
132
|
-
filePath:
|
|
130
|
+
acteur: f,
|
|
131
|
+
datasetLegislature: u,
|
|
132
|
+
filePath: d,
|
|
133
133
|
...l && { gitStatus: l }
|
|
134
134
|
};
|
|
135
135
|
}
|
|
136
|
-
function* me(t, o, e = {}) {
|
|
136
|
+
function* me(t, o, e = {}, i) {
|
|
137
137
|
for (const {
|
|
138
|
-
item:
|
|
139
|
-
datasetLegislature:
|
|
140
|
-
filePath:
|
|
138
|
+
item: u,
|
|
139
|
+
datasetLegislature: f,
|
|
140
|
+
filePath: d,
|
|
141
141
|
gitStatus: l
|
|
142
142
|
} of B(
|
|
143
143
|
t,
|
|
144
144
|
o,
|
|
145
|
-
F.acteursEtOrganes,
|
|
145
|
+
i ?? F.acteursEtOrganes,
|
|
146
146
|
W.toOrgane,
|
|
147
147
|
["organes"],
|
|
148
148
|
"json",
|
|
149
149
|
e
|
|
150
150
|
))
|
|
151
151
|
yield {
|
|
152
|
-
organe:
|
|
153
|
-
datasetLegislature:
|
|
154
|
-
filePath:
|
|
152
|
+
organe: u,
|
|
153
|
+
datasetLegislature: f,
|
|
154
|
+
filePath: d,
|
|
155
155
|
...l && { gitStatus: l }
|
|
156
156
|
};
|
|
157
157
|
}
|
|
158
|
-
function* ge(t, o, e = {}) {
|
|
158
|
+
function* ge(t, o, e = {}, i) {
|
|
159
159
|
for (const {
|
|
160
|
-
datasetLegislature:
|
|
161
|
-
item:
|
|
162
|
-
filePath:
|
|
160
|
+
datasetLegislature: u,
|
|
161
|
+
item: f,
|
|
162
|
+
filePath: d,
|
|
163
163
|
gitStatus: l
|
|
164
164
|
} of B(
|
|
165
165
|
t,
|
|
166
166
|
o,
|
|
167
|
-
F.amendements,
|
|
167
|
+
i ?? F.amendements,
|
|
168
168
|
X.toAmendement,
|
|
169
169
|
[],
|
|
170
170
|
"json",
|
|
171
171
|
e
|
|
172
172
|
))
|
|
173
173
|
yield {
|
|
174
|
-
amendement:
|
|
175
|
-
datasetLegislature:
|
|
176
|
-
filePath:
|
|
174
|
+
amendement: f,
|
|
175
|
+
datasetLegislature: u,
|
|
176
|
+
filePath: d,
|
|
177
177
|
...l && { gitStatus: l }
|
|
178
178
|
};
|
|
179
179
|
}
|
|
180
|
-
function* je(t, o, e = {}) {
|
|
180
|
+
function* je(t, o, e = {}, i) {
|
|
181
181
|
for (const {
|
|
182
|
-
item:
|
|
183
|
-
datasetLegislature:
|
|
184
|
-
filePath:
|
|
182
|
+
item: u,
|
|
183
|
+
datasetLegislature: f,
|
|
184
|
+
filePath: d,
|
|
185
185
|
gitStatus: l
|
|
186
186
|
} of B(
|
|
187
187
|
t,
|
|
188
188
|
o,
|
|
189
|
-
F.dossiersLegislatifs,
|
|
189
|
+
i ?? F.dossiersLegislatifs,
|
|
190
190
|
J.toDocument,
|
|
191
191
|
["documents"],
|
|
192
192
|
"json",
|
|
193
193
|
e
|
|
194
194
|
))
|
|
195
195
|
yield {
|
|
196
|
-
document:
|
|
197
|
-
datasetLegislature:
|
|
198
|
-
filePath:
|
|
196
|
+
document: u,
|
|
197
|
+
datasetLegislature: f,
|
|
198
|
+
filePath: d,
|
|
199
199
|
...l && { gitStatus: l }
|
|
200
200
|
};
|
|
201
201
|
}
|
|
202
|
-
function* he(t, o, e = {}) {
|
|
202
|
+
function* he(t, o, e = {}, i) {
|
|
203
203
|
for (const {
|
|
204
|
-
item:
|
|
205
|
-
datasetLegislature:
|
|
206
|
-
filePath:
|
|
204
|
+
item: u,
|
|
205
|
+
datasetLegislature: f,
|
|
206
|
+
filePath: d,
|
|
207
207
|
gitStatus: l
|
|
208
208
|
} of B(
|
|
209
209
|
t,
|
|
210
210
|
o,
|
|
211
|
-
F.dossiersLegislatifs,
|
|
211
|
+
i ?? F.dossiersLegislatifs,
|
|
212
212
|
J.toDossierParlementaire,
|
|
213
213
|
["dossiers"],
|
|
214
214
|
"json",
|
|
215
215
|
e
|
|
216
216
|
))
|
|
217
217
|
yield {
|
|
218
|
-
dossierParlementaire:
|
|
219
|
-
datasetLegislature:
|
|
220
|
-
filePath:
|
|
218
|
+
dossierParlementaire: u,
|
|
219
|
+
datasetLegislature: f,
|
|
220
|
+
filePath: d,
|
|
221
221
|
...l && { gitStatus: l }
|
|
222
222
|
};
|
|
223
223
|
}
|
|
224
|
-
function* pe(t, o, e = {}) {
|
|
224
|
+
function* pe(t, o, e = {}, i) {
|
|
225
225
|
for (const {
|
|
226
|
-
item:
|
|
227
|
-
datasetLegislature:
|
|
228
|
-
filePath:
|
|
226
|
+
item: u,
|
|
227
|
+
datasetLegislature: f,
|
|
228
|
+
filePath: d,
|
|
229
229
|
gitStatus: l
|
|
230
230
|
} of B(
|
|
231
231
|
t,
|
|
232
232
|
o,
|
|
233
|
-
F.agendas,
|
|
233
|
+
i ?? F.agendas,
|
|
234
234
|
M.toReunion,
|
|
235
235
|
[],
|
|
236
236
|
"json",
|
|
237
237
|
e
|
|
238
238
|
))
|
|
239
239
|
yield {
|
|
240
|
-
reunion:
|
|
241
|
-
datasetLegislature:
|
|
242
|
-
filePath:
|
|
240
|
+
reunion: u,
|
|
241
|
+
datasetLegislature: f,
|
|
242
|
+
filePath: d,
|
|
243
243
|
...l && { gitStatus: l }
|
|
244
244
|
};
|
|
245
245
|
}
|
|
246
|
-
function* ye(t, o, e = {}) {
|
|
246
|
+
function* ye(t, o, e = {}, i) {
|
|
247
247
|
for (const {
|
|
248
|
-
item:
|
|
249
|
-
datasetLegislature:
|
|
250
|
-
filePath:
|
|
248
|
+
item: u,
|
|
249
|
+
datasetLegislature: f,
|
|
250
|
+
filePath: d,
|
|
251
251
|
gitStatus: l
|
|
252
252
|
} of B(
|
|
253
253
|
t,
|
|
254
254
|
o,
|
|
255
|
-
F.scrutins,
|
|
255
|
+
i ?? F.scrutins,
|
|
256
256
|
w.toScrutin,
|
|
257
257
|
[],
|
|
258
258
|
"json",
|
|
259
259
|
e
|
|
260
260
|
))
|
|
261
261
|
yield {
|
|
262
|
-
scrutin:
|
|
263
|
-
datasetLegislature:
|
|
264
|
-
filePath:
|
|
262
|
+
scrutin: u,
|
|
263
|
+
datasetLegislature: f,
|
|
264
|
+
filePath: d,
|
|
265
265
|
...l && { gitStatus: l }
|
|
266
266
|
};
|
|
267
267
|
}
|
|
268
|
-
function* Fe(t, o, e = {}) {
|
|
268
|
+
function* Fe(t, o, e = {}, i) {
|
|
269
269
|
for (const {
|
|
270
|
-
item:
|
|
271
|
-
datasetLegislature:
|
|
272
|
-
filePath:
|
|
270
|
+
item: u,
|
|
271
|
+
datasetLegislature: f,
|
|
272
|
+
filePath: d,
|
|
273
273
|
gitStatus: l
|
|
274
274
|
} of B(
|
|
275
275
|
t,
|
|
276
276
|
o,
|
|
277
|
-
F.questions,
|
|
277
|
+
i ?? F.questions,
|
|
278
278
|
T.toQuestion,
|
|
279
279
|
[],
|
|
280
280
|
"json",
|
|
281
281
|
e
|
|
282
282
|
))
|
|
283
283
|
yield {
|
|
284
|
-
question:
|
|
285
|
-
datasetLegislature:
|
|
286
|
-
filePath:
|
|
284
|
+
question: u,
|
|
285
|
+
datasetLegislature: f,
|
|
286
|
+
filePath: d,
|
|
287
287
|
...l && { gitStatus: l }
|
|
288
288
|
};
|
|
289
289
|
}
|
|
290
|
-
function* Se(t, o, e = {}) {
|
|
290
|
+
function* Se(t, o, e = {}, i) {
|
|
291
291
|
for (const {
|
|
292
|
-
item:
|
|
293
|
-
datasetLegislature:
|
|
294
|
-
filePath:
|
|
292
|
+
item: u,
|
|
293
|
+
datasetLegislature: f,
|
|
294
|
+
filePath: d,
|
|
295
295
|
gitStatus: l
|
|
296
296
|
} of B(
|
|
297
297
|
t,
|
|
298
298
|
o,
|
|
299
|
-
F.comptesRendusSeances,
|
|
299
|
+
i ?? F.comptesRendusSeances,
|
|
300
300
|
Q.toCompteRendu,
|
|
301
301
|
[],
|
|
302
302
|
"xml",
|
|
303
303
|
e
|
|
304
304
|
))
|
|
305
305
|
yield {
|
|
306
|
-
compteRendu:
|
|
307
|
-
datasetLegislature:
|
|
308
|
-
filePath:
|
|
306
|
+
compteRendu: u,
|
|
307
|
+
datasetLegislature: f,
|
|
308
|
+
filePath: d,
|
|
309
309
|
...l && { gitStatus: l }
|
|
310
310
|
};
|
|
311
311
|
}
|
|
312
312
|
function* Ae(t, o, {} = {}) {
|
|
313
313
|
const e = `Comptes_Rendus_Commissions_${oe(o)}_nettoye`, i = s.join(t, e);
|
|
314
|
-
if (
|
|
314
|
+
if (g.existsSync(i))
|
|
315
315
|
for (const u of z(i))
|
|
316
316
|
try {
|
|
317
|
-
const f =
|
|
317
|
+
const f = g.readFileSync(u, "utf-8");
|
|
318
318
|
yield {
|
|
319
319
|
compteRendu: JSON.parse(f),
|
|
320
320
|
datasetLegislature: o,
|
|
@@ -325,8 +325,8 @@ function* Ae(t, o, {} = {}) {
|
|
|
325
325
|
}
|
|
326
326
|
}
|
|
327
327
|
function* z(t) {
|
|
328
|
-
if (
|
|
329
|
-
for (const o of
|
|
328
|
+
if (g.existsSync(t))
|
|
329
|
+
for (const o of g.readdirSync(t, { withFileTypes: !0 })) {
|
|
330
330
|
const e = s.join(t, o.name);
|
|
331
331
|
o.isDirectory() ? yield* z(e) : o.isFile() && e.endsWith(".json") && (yield e);
|
|
332
332
|
}
|
|
@@ -335,7 +335,7 @@ function Pe(t, o, e, { log: i = !1 } = {}) {
|
|
|
335
335
|
const u = {}, f = {};
|
|
336
336
|
if (o & P.ActeursEtOrganes)
|
|
337
337
|
for (const n of F.acteursEtOrganes) {
|
|
338
|
-
if (n.ignoreForWeb || e !==
|
|
338
|
+
if (n.ignoreForWeb || e !== j.All && n.legislature !== j.All && e !== n.legislature)
|
|
339
339
|
continue;
|
|
340
340
|
const c = s.join(
|
|
341
341
|
t,
|
|
@@ -346,26 +346,26 @@ function Pe(t, o, e, { log: i = !1 } = {}) {
|
|
|
346
346
|
continue;
|
|
347
347
|
const r = s.join(c, ...a);
|
|
348
348
|
i && console.log(`Loading file: ${r}…`);
|
|
349
|
-
const
|
|
349
|
+
const h = g.readFileSync(r, {
|
|
350
350
|
encoding: "utf8"
|
|
351
|
-
}),
|
|
352
|
-
u[
|
|
351
|
+
}), m = W.toActeur(h);
|
|
352
|
+
u[m.uid] === void 0 && (u[m.uid] = m);
|
|
353
353
|
}
|
|
354
354
|
for (const a of R(c, ["organes"])) {
|
|
355
355
|
if (!a[a.length - 1].endsWith(".json"))
|
|
356
356
|
continue;
|
|
357
357
|
const r = s.join(c, ...a);
|
|
358
358
|
i && console.log(`Loading file: ${r}…`);
|
|
359
|
-
const
|
|
359
|
+
const h = g.readFileSync(r, {
|
|
360
360
|
encoding: "utf8"
|
|
361
|
-
}),
|
|
362
|
-
f[
|
|
361
|
+
}), m = W.toOrgane(h);
|
|
362
|
+
f[m.uid] === void 0 && (f[m.uid] = m);
|
|
363
363
|
}
|
|
364
364
|
}
|
|
365
|
-
const
|
|
365
|
+
const d = {}, l = {}, y = {};
|
|
366
366
|
if (o & P.Agendas)
|
|
367
367
|
for (const n of F.agendas) {
|
|
368
|
-
if (n.ignoreForWeb || e !==
|
|
368
|
+
if (n.ignoreForWeb || e !== j.All && n.legislature !== j.All && e !== n.legislature)
|
|
369
369
|
continue;
|
|
370
370
|
const c = s.join(
|
|
371
371
|
t,
|
|
@@ -376,26 +376,26 @@ function Pe(t, o, e, { log: i = !1 } = {}) {
|
|
|
376
376
|
continue;
|
|
377
377
|
const r = s.join(c, ...a);
|
|
378
378
|
i && console.log(`Loading file: ${r}…`);
|
|
379
|
-
const
|
|
379
|
+
const h = g.readFileSync(r, {
|
|
380
380
|
encoding: "utf8"
|
|
381
|
-
}),
|
|
382
|
-
|
|
383
|
-
const v =
|
|
384
|
-
let O =
|
|
385
|
-
O === void 0 && (O =
|
|
386
|
-
const _ =
|
|
381
|
+
}), m = M.toReunion(h);
|
|
382
|
+
d[m.uid] === void 0 && (d[m.uid] = m);
|
|
383
|
+
const v = m.timestampDebut.toISOString().split("T")[0];
|
|
384
|
+
let O = l[v];
|
|
385
|
+
O === void 0 && (O = l[v] = []), O.push(m);
|
|
386
|
+
const _ = m.odj;
|
|
387
387
|
if (_ !== void 0)
|
|
388
388
|
for (const q of _.pointsOdj || [])
|
|
389
389
|
for (const k of q.dossiersLegislatifsRefs || []) {
|
|
390
390
|
let N = y[k];
|
|
391
|
-
N === void 0 && (N = y[k] = []), N.push(
|
|
391
|
+
N === void 0 && (N = y[k] = []), N.push(m);
|
|
392
392
|
}
|
|
393
393
|
}
|
|
394
394
|
}
|
|
395
395
|
const A = {};
|
|
396
396
|
if (o & P.Amendements)
|
|
397
397
|
for (const n of F.amendements) {
|
|
398
|
-
if (n.ignoreForWeb || e !==
|
|
398
|
+
if (n.ignoreForWeb || e !== j.All && n.legislature !== j.All && e !== n.legislature)
|
|
399
399
|
continue;
|
|
400
400
|
const c = s.join(
|
|
401
401
|
t,
|
|
@@ -406,16 +406,16 @@ function Pe(t, o, e, { log: i = !1 } = {}) {
|
|
|
406
406
|
continue;
|
|
407
407
|
const r = s.join(c, ...a);
|
|
408
408
|
i && console.log(`Loading file: ${r}…`);
|
|
409
|
-
const
|
|
409
|
+
const h = g.readFileSync(r, {
|
|
410
410
|
encoding: "utf8"
|
|
411
|
-
}),
|
|
412
|
-
A[
|
|
411
|
+
}), m = X.toAmendement(h);
|
|
412
|
+
A[m.uid] === void 0 && (A[m.uid] = m);
|
|
413
413
|
}
|
|
414
414
|
}
|
|
415
415
|
const S = {}, U = {}, L = {}, $ = {};
|
|
416
416
|
if (o & P.DossiersLegislatifs)
|
|
417
417
|
for (const n of F.dossiersLegislatifs) {
|
|
418
|
-
if (n.ignoreForWeb || e !==
|
|
418
|
+
if (n.ignoreForWeb || e !== j.All && n.legislature !== j.All && e !== n.legislature)
|
|
419
419
|
continue;
|
|
420
420
|
const c = s.join(
|
|
421
421
|
t,
|
|
@@ -426,20 +426,20 @@ function Pe(t, o, e, { log: i = !1 } = {}) {
|
|
|
426
426
|
continue;
|
|
427
427
|
const r = s.join(c, ...a);
|
|
428
428
|
i && console.log(`Loading file: ${r}…`);
|
|
429
|
-
const
|
|
429
|
+
const h = g.readFileSync(r, {
|
|
430
430
|
encoding: "utf8"
|
|
431
|
-
}),
|
|
432
|
-
S[
|
|
431
|
+
}), m = J.toDocument(h);
|
|
432
|
+
S[m.uid] === void 0 && (S[m.uid] = m);
|
|
433
433
|
}
|
|
434
434
|
for (const a of R(c, ["dossiers"])) {
|
|
435
435
|
if (!a[a.length - 1].endsWith(".json"))
|
|
436
436
|
continue;
|
|
437
437
|
const r = s.join(c, ...a);
|
|
438
438
|
i && console.log(`Loading file: ${r}…`);
|
|
439
|
-
const
|
|
439
|
+
const h = g.readFileSync(r, {
|
|
440
440
|
encoding: "utf8"
|
|
441
|
-
}),
|
|
442
|
-
v.senatChemin && U[v.senatChemin] === void 0 && (U[v.senatChemin] =
|
|
441
|
+
}), m = J.toDossierParlementaire(h), v = m.titreDossier;
|
|
442
|
+
v.senatChemin && U[v.senatChemin] === void 0 && (U[v.senatChemin] = m), v.titreChemin && L[v.titreChemin] === void 0 && (L[v.titreChemin] = m), $[m.uid] === void 0 && ($[m.uid] = m);
|
|
443
443
|
}
|
|
444
444
|
}
|
|
445
445
|
let x = {};
|
|
@@ -448,12 +448,12 @@ function Pe(t, o, e, { log: i = !1 } = {}) {
|
|
|
448
448
|
const n = s.join(
|
|
449
449
|
t,
|
|
450
450
|
`photos_deputes_${// TODO: Handle Legislature.All.
|
|
451
|
-
e ===
|
|
451
|
+
e === j.All ? j.DixSept : e}`,
|
|
452
452
|
"deputes.json"
|
|
453
453
|
);
|
|
454
|
-
if (
|
|
454
|
+
if (g.existsSync(n)) {
|
|
455
455
|
i && console.log(`Loading file: ${n}`);
|
|
456
|
-
const c =
|
|
456
|
+
const c = g.readFileSync(n, { encoding: "utf8" });
|
|
457
457
|
Object.assign(x, JSON.parse(c));
|
|
458
458
|
} else i && console.log(`Ignoring missing file: ${n}`);
|
|
459
459
|
}
|
|
@@ -463,9 +463,9 @@ function Pe(t, o, e, { log: i = !1 } = {}) {
|
|
|
463
463
|
"photos_senateurs",
|
|
464
464
|
"senateurs.json"
|
|
465
465
|
);
|
|
466
|
-
if (
|
|
466
|
+
if (g.existsSync(n)) {
|
|
467
467
|
i && console.log(`Loading file: ${n}`);
|
|
468
|
-
const c =
|
|
468
|
+
const c = g.readFileSync(n, { encoding: "utf8" });
|
|
469
469
|
Object.assign(x, JSON.parse(c));
|
|
470
470
|
} else i && console.log(`Ignoring missing file: ${n}`);
|
|
471
471
|
}
|
|
@@ -473,7 +473,7 @@ function Pe(t, o, e, { log: i = !1 } = {}) {
|
|
|
473
473
|
const b = {};
|
|
474
474
|
if (o & P.Scrutins)
|
|
475
475
|
for (const n of F.scrutins) {
|
|
476
|
-
if (n.ignoreForWeb || e !==
|
|
476
|
+
if (n.ignoreForWeb || e !== j.All && n.legislature !== j.All && e !== n.legislature)
|
|
477
477
|
continue;
|
|
478
478
|
const c = s.join(
|
|
479
479
|
t,
|
|
@@ -484,16 +484,16 @@ function Pe(t, o, e, { log: i = !1 } = {}) {
|
|
|
484
484
|
continue;
|
|
485
485
|
const r = s.join(c, ...a);
|
|
486
486
|
i && console.log(`Loading file: ${r}…`);
|
|
487
|
-
const
|
|
487
|
+
const h = g.readFileSync(r, {
|
|
488
488
|
encoding: "utf8"
|
|
489
|
-
}),
|
|
490
|
-
b[
|
|
489
|
+
}), m = w.toScrutin(h);
|
|
490
|
+
b[m.uid] === void 0 && (b[m.uid] = m);
|
|
491
491
|
}
|
|
492
492
|
}
|
|
493
493
|
const C = {};
|
|
494
494
|
if (o & P.Questions)
|
|
495
495
|
for (const n of F.questions) {
|
|
496
|
-
if (n.ignoreForWeb || e !==
|
|
496
|
+
if (n.ignoreForWeb || e !== j.All && n.legislature !== j.All && e !== n.legislature)
|
|
497
497
|
continue;
|
|
498
498
|
const c = s.join(
|
|
499
499
|
t,
|
|
@@ -504,16 +504,16 @@ function Pe(t, o, e, { log: i = !1 } = {}) {
|
|
|
504
504
|
continue;
|
|
505
505
|
const r = s.join(c, ...a);
|
|
506
506
|
i && console.log(`Loading file: ${r}…`);
|
|
507
|
-
const
|
|
507
|
+
const h = g.readFileSync(r, {
|
|
508
508
|
encoding: "utf8"
|
|
509
|
-
}),
|
|
510
|
-
C[
|
|
509
|
+
}), m = T.toQuestion(h);
|
|
510
|
+
C[m.uid] === void 0 && (C[m.uid] = m);
|
|
511
511
|
}
|
|
512
512
|
}
|
|
513
513
|
const D = {};
|
|
514
514
|
if (o & P.ComptesRendusSeances)
|
|
515
515
|
for (const n of F.comptesRendusSeances) {
|
|
516
|
-
if (n.ignoreForWeb || e !==
|
|
516
|
+
if (n.ignoreForWeb || e !== j.All && n.legislature !== j.All && e !== n.legislature)
|
|
517
517
|
continue;
|
|
518
518
|
const c = s.join(
|
|
519
519
|
t,
|
|
@@ -524,10 +524,10 @@ function Pe(t, o, e, { log: i = !1 } = {}) {
|
|
|
524
524
|
continue;
|
|
525
525
|
const r = s.join(c, ...a);
|
|
526
526
|
i && console.log(`Loading file: ${r}…`);
|
|
527
|
-
const
|
|
527
|
+
const h = g.readFileSync(r, {
|
|
528
528
|
encoding: "utf8"
|
|
529
|
-
}),
|
|
530
|
-
D[
|
|
529
|
+
}), m = Q.toCompteRendu(h);
|
|
530
|
+
D[m.uid] === void 0 && (D[m.uid] = m);
|
|
531
531
|
}
|
|
532
532
|
}
|
|
533
533
|
return {
|
|
@@ -539,8 +539,8 @@ function Pe(t, o, e, { log: i = !1 } = {}) {
|
|
|
539
539
|
dossierParlementaireByUid: $,
|
|
540
540
|
organeByUid: f,
|
|
541
541
|
photoByUid: x,
|
|
542
|
-
reunionByUid:
|
|
543
|
-
reunionsByDay:
|
|
542
|
+
reunionByUid: d,
|
|
543
|
+
reunionsByDay: l,
|
|
544
544
|
reunionsByDossierUid: y,
|
|
545
545
|
scrutinByUid: b,
|
|
546
546
|
questionByUid: C,
|
|
@@ -551,35 +551,35 @@ function Le(t, o, e, { log: i = !1 } = {}) {
|
|
|
551
551
|
const u = {}, f = {};
|
|
552
552
|
if (o & P.ActeursEtOrganes)
|
|
553
553
|
for (const n of F.acteursEtOrganes) {
|
|
554
|
-
if (n.ignoreForWeb || e !==
|
|
554
|
+
if (n.ignoreForWeb || e !== j.All && n.legislature !== j.All && e !== n.legislature)
|
|
555
555
|
continue;
|
|
556
556
|
const c = s.join(
|
|
557
557
|
t,
|
|
558
558
|
n.filename.replace(/\.json$/, "_nettoye.json")
|
|
559
559
|
);
|
|
560
560
|
i && console.log(`Loading file: ${c}`);
|
|
561
|
-
const a =
|
|
561
|
+
const a = g.readFileSync(c, { encoding: "utf8" }), p = W.toActeursEtOrganes(a);
|
|
562
562
|
for (const r of p.acteurs)
|
|
563
563
|
u[r.uid] === void 0 && (u[r.uid] = r);
|
|
564
564
|
for (const r of p.organes)
|
|
565
565
|
f[r.uid] === void 0 && (f[r.uid] = r);
|
|
566
566
|
}
|
|
567
|
-
const
|
|
567
|
+
const d = {}, l = {}, y = {};
|
|
568
568
|
if (o & P.Agendas)
|
|
569
569
|
for (const n of F.agendas) {
|
|
570
|
-
if (n.ignoreForWeb || e !==
|
|
570
|
+
if (n.ignoreForWeb || e !== j.All && n.legislature !== j.All && e !== n.legislature)
|
|
571
571
|
continue;
|
|
572
572
|
const c = s.join(
|
|
573
573
|
t,
|
|
574
574
|
n.filename.replace(/\.json$/, "_nettoye.json")
|
|
575
575
|
);
|
|
576
576
|
i && console.log(`Loading file: ${c}`);
|
|
577
|
-
const a =
|
|
577
|
+
const a = g.readFileSync(c, { encoding: "utf8" }), p = M.toAgendas(a);
|
|
578
578
|
for (const r of p.reunions) {
|
|
579
|
-
|
|
580
|
-
const
|
|
581
|
-
let
|
|
582
|
-
|
|
579
|
+
d[r.uid] === void 0 && (d[r.uid] = r);
|
|
580
|
+
const h = r.timestampDebut.toISOString().split("T")[0];
|
|
581
|
+
let m = l[h];
|
|
582
|
+
m === void 0 && (m = l[h] = []), m.push(r);
|
|
583
583
|
const v = r.odj;
|
|
584
584
|
if (v !== void 0)
|
|
585
585
|
for (const O of v.pointsOdj || [])
|
|
@@ -592,34 +592,34 @@ function Le(t, o, e, { log: i = !1 } = {}) {
|
|
|
592
592
|
const A = {};
|
|
593
593
|
if (o & P.Amendements)
|
|
594
594
|
for (const n of F.amendements) {
|
|
595
|
-
if (n.ignoreForWeb || e !==
|
|
595
|
+
if (n.ignoreForWeb || e !== j.All && n.legislature !== j.All && e !== n.legislature)
|
|
596
596
|
continue;
|
|
597
597
|
const c = s.join(
|
|
598
598
|
t,
|
|
599
599
|
n.filename.replace(/\.json$/, "_nettoye.json")
|
|
600
600
|
);
|
|
601
601
|
i && console.log(`Loading file: ${c}`);
|
|
602
|
-
const a =
|
|
602
|
+
const a = g.readFileSync(c, { encoding: "utf8" }), p = X.toAmendements(a);
|
|
603
603
|
for (const r of p.textesLegislatifs)
|
|
604
|
-
for (const
|
|
605
|
-
A[
|
|
604
|
+
for (const h of r.amendements)
|
|
605
|
+
A[h.uid] === void 0 && (A[h.uid] = h);
|
|
606
606
|
}
|
|
607
607
|
const S = {}, U = {}, L = {}, $ = {};
|
|
608
608
|
if (o & P.DossiersLegislatifs)
|
|
609
609
|
for (const n of F.dossiersLegislatifs) {
|
|
610
|
-
if (n.ignoreForWeb || e !==
|
|
610
|
+
if (n.ignoreForWeb || e !== j.All && n.legislature !== j.All && e !== n.legislature)
|
|
611
611
|
continue;
|
|
612
612
|
const c = s.join(
|
|
613
613
|
t,
|
|
614
614
|
n.filename.replace(/\.json$/, "_nettoye.json")
|
|
615
615
|
);
|
|
616
616
|
i && console.log(`Loading file: ${c}`);
|
|
617
|
-
const a =
|
|
617
|
+
const a = g.readFileSync(c, { encoding: "utf8" }), p = J.toDossiersLegislatifs(a);
|
|
618
618
|
for (const r of p.textesLegislatifs)
|
|
619
619
|
S[r.uid] === void 0 && (S[r.uid] = r);
|
|
620
620
|
for (const r of p.dossiersParlementaires) {
|
|
621
|
-
const
|
|
622
|
-
|
|
621
|
+
const h = r.titreDossier;
|
|
622
|
+
h.senatChemin && U[h.senatChemin] === void 0 && (U[h.senatChemin] = r), h.titreChemin && L[h.titreChemin] === void 0 && (L[h.titreChemin] = r), $[r.uid] === void 0 && ($[r.uid] = r);
|
|
623
623
|
}
|
|
624
624
|
}
|
|
625
625
|
const x = {};
|
|
@@ -629,12 +629,12 @@ function Le(t, o, e, { log: i = !1 } = {}) {
|
|
|
629
629
|
const c = s.join(
|
|
630
630
|
t,
|
|
631
631
|
`photos_deputes_${// TODO: Handle Legislature.All.
|
|
632
|
-
e ===
|
|
632
|
+
e === j.All ? j.DixSept : e}`,
|
|
633
633
|
"deputes.json"
|
|
634
634
|
);
|
|
635
|
-
if (
|
|
635
|
+
if (g.existsSync(c)) {
|
|
636
636
|
i && console.log(`Loading file: ${c}`);
|
|
637
|
-
const a =
|
|
637
|
+
const a = g.readFileSync(c, { encoding: "utf8" });
|
|
638
638
|
Object.assign(n, JSON.parse(a));
|
|
639
639
|
} else i && console.log(`Ignoring missing file: ${c}`);
|
|
640
640
|
}
|
|
@@ -644,9 +644,9 @@ function Le(t, o, e, { log: i = !1 } = {}) {
|
|
|
644
644
|
"photos_senateurs",
|
|
645
645
|
"senateurs.json"
|
|
646
646
|
);
|
|
647
|
-
if (
|
|
647
|
+
if (g.existsSync(c)) {
|
|
648
648
|
i && console.log(`Loading file: ${c}`);
|
|
649
|
-
const a =
|
|
649
|
+
const a = g.readFileSync(c, { encoding: "utf8" });
|
|
650
650
|
Object.assign(n, JSON.parse(a));
|
|
651
651
|
} else i && console.log(`Ignoring missing file: ${c}`);
|
|
652
652
|
}
|
|
@@ -654,42 +654,42 @@ function Le(t, o, e, { log: i = !1 } = {}) {
|
|
|
654
654
|
const b = {};
|
|
655
655
|
if (o & P.Scrutins)
|
|
656
656
|
for (const n of F.scrutins) {
|
|
657
|
-
if (n.ignoreForWeb || e !==
|
|
657
|
+
if (n.ignoreForWeb || e !== j.All && n.legislature !== j.All && e !== n.legislature)
|
|
658
658
|
continue;
|
|
659
659
|
const c = s.join(
|
|
660
660
|
t,
|
|
661
661
|
n.filename.replace(/\.json$/, "_nettoye.json")
|
|
662
662
|
);
|
|
663
663
|
i && console.log(`Loading file: ${c}`);
|
|
664
|
-
const a =
|
|
664
|
+
const a = g.readFileSync(c, { encoding: "utf8" }), p = w.toScrutins(a);
|
|
665
665
|
for (const r of p.scrutins)
|
|
666
666
|
b[r.uid] === void 0 && (b[r.uid] = r);
|
|
667
667
|
}
|
|
668
668
|
const C = {};
|
|
669
669
|
if (o & P.Questions)
|
|
670
670
|
for (const n of F.questions) {
|
|
671
|
-
if (n.ignoreForWeb || e !==
|
|
671
|
+
if (n.ignoreForWeb || e !== j.All && n.legislature !== j.All && e !== n.legislature)
|
|
672
672
|
continue;
|
|
673
673
|
const c = s.join(
|
|
674
674
|
t,
|
|
675
675
|
n.filename.replace(/\.json$/, "_nettoye.json")
|
|
676
676
|
);
|
|
677
677
|
i && console.log(`Loading file: ${c}`);
|
|
678
|
-
const a =
|
|
678
|
+
const a = g.readFileSync(c, { encoding: "utf8" }), p = T.toQuestions(a);
|
|
679
679
|
for (const r of p.questions)
|
|
680
680
|
C[r.uid] === void 0 && (C[r.uid] = r);
|
|
681
681
|
}
|
|
682
682
|
const D = {};
|
|
683
683
|
if (o & P.ComptesRendusSeances)
|
|
684
684
|
for (const n of F.comptesRendusSeances) {
|
|
685
|
-
if (n.ignoreForWeb || e !==
|
|
685
|
+
if (n.ignoreForWeb || e !== j.All && n.legislature !== j.All && e !== n.legislature)
|
|
686
686
|
continue;
|
|
687
687
|
const c = s.join(
|
|
688
688
|
t,
|
|
689
689
|
n.filename.replace(/\.json$/, "_nettoye.json")
|
|
690
690
|
);
|
|
691
691
|
i && console.log(`Loading file: ${c}`);
|
|
692
|
-
const a =
|
|
692
|
+
const a = g.readFileSync(c, { encoding: "utf8" }), p = Q.toComptesRendus(a);
|
|
693
693
|
for (const r of p.comptesRendus)
|
|
694
694
|
D[r.uid] === void 0 && (D[r.uid] = r);
|
|
695
695
|
}
|
|
@@ -702,8 +702,8 @@ function Le(t, o, e, { log: i = !1 } = {}) {
|
|
|
702
702
|
dossierParlementaireByUid: $,
|
|
703
703
|
organeByUid: f,
|
|
704
704
|
photoByUid: x,
|
|
705
|
-
reunionByUid:
|
|
706
|
-
reunionsByDay:
|
|
705
|
+
reunionByUid: d,
|
|
706
|
+
reunionsByDay: l,
|
|
707
707
|
reunionsByDossierUid: y,
|
|
708
708
|
scrutinByUid: b,
|
|
709
709
|
questionByUid: C,
|
|
@@ -712,23 +712,23 @@ function Le(t, o, e, { log: i = !1 } = {}) {
|
|
|
712
712
|
}
|
|
713
713
|
function $e(t, o, e) {
|
|
714
714
|
const i = s.join(t, "Documents"), u = te(i, o), f = s.join(u, "index.json");
|
|
715
|
-
if (!
|
|
715
|
+
if (!g.pathExistsSync(f))
|
|
716
716
|
return;
|
|
717
|
-
const
|
|
718
|
-
for (const
|
|
719
|
-
for (const { filename: y, url: A } of l
|
|
717
|
+
const d = g.readJsonSync(f);
|
|
718
|
+
for (const l of e)
|
|
719
|
+
for (const { filename: y, url: A } of d[l] ?? [])
|
|
720
720
|
if (y !== void 0)
|
|
721
|
-
return { format:
|
|
721
|
+
return { format: l, path: s.join(u, y), url: A };
|
|
722
722
|
}
|
|
723
723
|
function be(t, o, { log: e = !1 } = {}) {
|
|
724
724
|
const i = s.join(
|
|
725
725
|
t,
|
|
726
726
|
`photos_deputes_${// TODO: Handle Legislature.All.
|
|
727
|
-
o ===
|
|
727
|
+
o === j.All ? j.DixSept : o}`,
|
|
728
728
|
"deputes.json"
|
|
729
729
|
);
|
|
730
730
|
e && console.log(`Loading file: ${i}`);
|
|
731
|
-
const u =
|
|
731
|
+
const u = g.readFileSync(i, { encoding: "utf8" });
|
|
732
732
|
return JSON.parse(u);
|
|
733
733
|
}
|
|
734
734
|
function De(t, { log: o = !1 } = {}) {
|
|
@@ -738,7 +738,7 @@ function De(t, { log: o = !1 } = {}) {
|
|
|
738
738
|
"senateurs.json"
|
|
739
739
|
);
|
|
740
740
|
o && console.log(`Loading file: ${e}`);
|
|
741
|
-
const i =
|
|
741
|
+
const i = g.readFileSync(e, { encoding: "utf8" });
|
|
742
742
|
return JSON.parse(i);
|
|
743
743
|
}
|
|
744
744
|
function te(t, o) {
|
|
@@ -751,20 +751,20 @@ function te(t, o) {
|
|
|
751
751
|
const i = e.groups, u = s.join(
|
|
752
752
|
t,
|
|
753
753
|
i.documentType ?? i.documentType2
|
|
754
|
-
), f = s.join(u, i.chambre ?? i.chambre2),
|
|
754
|
+
), f = s.join(u, i.chambre ?? i.chambre2), d = s.join(
|
|
755
755
|
f,
|
|
756
756
|
i.republique ?? i.republique2
|
|
757
|
-
),
|
|
758
|
-
|
|
757
|
+
), l = s.join(
|
|
758
|
+
d,
|
|
759
759
|
i.legislature ?? i.legislature2
|
|
760
760
|
), y = i.etat;
|
|
761
761
|
if (y === void 0)
|
|
762
|
-
return
|
|
763
|
-
const A = s.join(
|
|
762
|
+
return g.ensureDirSync(l), s.join(l, o);
|
|
763
|
+
const A = s.join(l, y);
|
|
764
764
|
let S = "000000" + (i.numero ?? i.numero2);
|
|
765
765
|
S = S.substring(S.length - 6);
|
|
766
766
|
const U = s.join(A, S.substring(0, 3));
|
|
767
|
-
return
|
|
767
|
+
return g.ensureDirSync(U), s.join(U, o);
|
|
768
768
|
}
|
|
769
769
|
function Ue(t, o) {
|
|
770
770
|
return Y(t, o, ee);
|
|
@@ -776,11 +776,11 @@ function ve(t, o) {
|
|
|
776
776
|
null,
|
|
777
777
|
`Unexpected structure for reunion UID: ${o}`
|
|
778
778
|
);
|
|
779
|
-
const i = s.join(t, e[1]), u = s.join(i, e[2]), f = s.join(u, e[3]),
|
|
779
|
+
const i = s.join(t, e[1]), u = s.join(i, e[2]), f = s.join(u, e[3]), d = s.join(f, e[4]), l = s.join(d, e[5]);
|
|
780
780
|
let y = "000000000" + e[6];
|
|
781
781
|
y = y.substring(y.length - 9);
|
|
782
|
-
const A = s.join(
|
|
783
|
-
return
|
|
782
|
+
const A = s.join(l, y.substring(0, 3)), S = s.join(A, y.substring(3, 3));
|
|
783
|
+
return g.ensureDirSync(S), s.join(S, o);
|
|
784
784
|
}
|
|
785
785
|
function Ce(t, o) {
|
|
786
786
|
const e = H.exec(o);
|
|
@@ -790,10 +790,10 @@ function Ce(t, o) {
|
|
|
790
790
|
`Unexpected structure for scrutin UID: ${o}`
|
|
791
791
|
);
|
|
792
792
|
const i = s.join(t, e[1]), u = s.join(i, e[2]), f = s.join(u, e[3]);
|
|
793
|
-
let
|
|
794
|
-
|
|
795
|
-
const
|
|
796
|
-
return
|
|
793
|
+
let d = "000000" + e[4];
|
|
794
|
+
d = d.substring(d.length - 6);
|
|
795
|
+
const l = s.join(f, d.substring(0, 3));
|
|
796
|
+
return g.ensureDirSync(l), s.join(l, o);
|
|
797
797
|
}
|
|
798
798
|
function Re(t, o) {
|
|
799
799
|
return Y(t, o, ne);
|
|
@@ -805,11 +805,11 @@ function xe(t, o) {
|
|
|
805
805
|
null,
|
|
806
806
|
`Unexpected structure for object with UID: ${o}`
|
|
807
807
|
);
|
|
808
|
-
const i = s.join(t, e[2]), u = s.join(i, e[3]), f = s.join(u, e[4]),
|
|
809
|
-
let
|
|
810
|
-
|
|
811
|
-
const y = s.join(
|
|
812
|
-
return
|
|
808
|
+
const i = s.join(t, e[2]), u = s.join(i, e[3]), f = s.join(u, e[4]), d = s.join(f, e[5]);
|
|
809
|
+
let l = "000000000" + e[7];
|
|
810
|
+
l = l.substring(l.length - 9);
|
|
811
|
+
const y = s.join(d, l.substring(0, 3)), A = s.join(y, l.substring(3, 3));
|
|
812
|
+
return g.ensureDirSync(A), s.join(A, o);
|
|
813
813
|
}
|
|
814
814
|
function Y(t, o, e) {
|
|
815
815
|
const i = e.exec(o);
|
|
@@ -819,10 +819,10 @@ function Y(t, o, e) {
|
|
|
819
819
|
`Unexpected structure for object with UID: ${o}`
|
|
820
820
|
);
|
|
821
821
|
const u = s.join(t, i[1]), f = s.join(u, i[2]);
|
|
822
|
-
let
|
|
823
|
-
|
|
824
|
-
const
|
|
825
|
-
return
|
|
822
|
+
let d = "000000" + i[3];
|
|
823
|
+
d = d.substring(d.length - 6);
|
|
824
|
+
const l = s.join(f, d.substring(0, 3));
|
|
825
|
+
return g.ensureDirSync(l), s.join(l, o);
|
|
826
826
|
}
|
|
827
827
|
export {
|
|
828
828
|
P as EnabledDatasets,
|