@tricoteuses/senat 3.1.5 → 3.1.7

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.
@@ -68,7 +68,7 @@ export interface SenateurResult {
68
68
  fonctions_bureau: FonctionRow[];
69
69
  groupe_politique: string | null;
70
70
  groupes: MandatOrganismeRow[];
71
- groupes_amitie: MandatOrganismeRow[];
71
+ groupes_senatoriaux: MandatOrganismeRow[];
72
72
  mandats_senateur: MandatSenateurRow[];
73
73
  matricule: string;
74
74
  nom_usuel: string | null;
@@ -337,13 +337,15 @@ async function convertDatasetSens(dataDir, options) {
337
337
  });
338
338
  }
339
339
  for await (const organisme of findAllOrganismes()) {
340
+ const sanitizedCode = organisme.code.trim().replace(/\s+/g, "-");
341
+ if (sanitizedCode !== organisme.code) {
342
+ console.warn(`Warning: code "${organisme.code}" contains leading/trailing or multiple consecutive whitespace characters. It has been sanitized to "${sanitizedCode}". Please check the original code for potential issues.`);
343
+ }
340
344
  if (options["verbose"]) {
341
- console.log(`Converting ${organisme["code"]} file…`);
345
+ console.log(`Converting ${sanitizedCode} file…`);
342
346
  }
343
- const organismeFileName = `${organisme["code"]}.json`;
344
- fs.outputJSONSync(path.join(organismesReorganizedDir, organisme["type_code"], organismeFileName), organisme, {
345
- spaces: 2,
346
- });
347
+ const organismeFileName = `${sanitizedCode}.json`;
348
+ fs.outputJSONSync(path.join(organismesReorganizedDir, organisme["type_code"], organismeFileName), { ...organisme, code: sanitizedCode }, { spaces: 2 });
347
349
  }
348
350
  }
349
351
  convertData()
@@ -230,7 +230,7 @@ export async function* findAll() {
230
230
  .orderBy("fonmemgrpsen.fonmemgrpsendatdeb", (ob) => ob.desc().nullsLast())).as("fonctions"),
231
231
  ])
232
232
  .whereRef("memgrpsen.senmat", "=", "sen.senmat")
233
- .orderBy("memgrpsen.memgrpsendatent", (ob) => ob.desc().nullsLast())).as("groupes_amitie"),
233
+ .orderBy("memgrpsen.memgrpsendatent", (ob) => ob.desc().nullsLast())).as("groupes_senatoriaux"),
234
234
  // Fonctions au bureau du Sénat
235
235
  jsonArrayFrom(eb
236
236
  .withSchema("senat")
@@ -294,7 +294,7 @@ export async function* findAll() {
294
294
  delegations: row.delegations ?? [],
295
295
  fonctions_bureau: row.fonctions_bureau ?? [],
296
296
  groupes: row.groupes ?? [],
297
- groupes_amitie: row.groupes_amitie ?? [],
297
+ groupes_senatoriaux: row.groupes_senatoriaux ?? [],
298
298
  mandats_senateur: row.mandats_senateur ?? [],
299
299
  organismes: row.organismes ?? [],
300
300
  points_contact: row.points_contact ?? [],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tricoteuses/senat",
3
- "version": "3.1.5",
3
+ "version": "3.1.7",
4
4
  "description": "Handle French Sénat's open data",
5
5
  "keywords": [
6
6
  "France",