@tricoteuses/senat 2.20.31 → 2.20.33
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 +11 -2
- package/package.json +1 -1
package/lib/loaders.js
CHANGED
|
@@ -50,6 +50,9 @@ function* iterLoadSenatItems(dataDir, dataName, legislatureOrSession, subDir, {
|
|
|
50
50
|
console.log(`Found ${changedFiles?.size || 0} changed files (AMR)`);
|
|
51
51
|
}
|
|
52
52
|
for (const filePath of iterFilePaths(itemsDir)) {
|
|
53
|
+
if (!filePath.endsWith(".json")) {
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
53
56
|
const relativePath = path.relative(path.join(dataDir, dataName), filePath);
|
|
54
57
|
const gitStatus = changedFiles?.get(relativePath);
|
|
55
58
|
// Filter by changed files if sinceCommit is specified
|
|
@@ -185,8 +188,12 @@ export function* iterLoadSenatDocuments(dataDir, session, documentType, options
|
|
|
185
188
|
const lecturesSenat = lecture.lectures_assemblee.filter((lectureAssemblee) => lectureAssemblee.assemblee === "Sénat");
|
|
186
189
|
for (const lectureSenat of lecturesSenat) {
|
|
187
190
|
for (const document of lectureSenat[documentType]) {
|
|
191
|
+
const enrichedDocument = {
|
|
192
|
+
signet_dossier: dossierLegislatif["signet"],
|
|
193
|
+
...document,
|
|
194
|
+
};
|
|
188
195
|
const documentItem = {
|
|
189
|
-
item:
|
|
196
|
+
item: enrichedDocument
|
|
190
197
|
};
|
|
191
198
|
if (document.url) {
|
|
192
199
|
const documentName = path.parse(document.url).name;
|
|
@@ -200,7 +207,9 @@ export function* iterLoadSenatDocuments(dataDir, session, documentType, options
|
|
|
200
207
|
}
|
|
201
208
|
export function* iterLoadSenatRapports(dataDir, session, options = {}) {
|
|
202
209
|
for (const iterItem of iterLoadSenatItems(dataDir, RAPPORT_FOLDER, session, "original", options)) {
|
|
203
|
-
|
|
210
|
+
if (iterItem.item?.["id"]) {
|
|
211
|
+
yield iterItem;
|
|
212
|
+
}
|
|
204
213
|
}
|
|
205
214
|
}
|
|
206
215
|
export function* iterLoadSenatTextes(dataDir, session, options = {}) {
|