@tricoteuses/assemblee 2.5.30 → 2.5.31

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 CHANGED
@@ -93,6 +93,7 @@ npm run data:download ../assemblee-data -- -l 16 -l 17
93
93
  - `--clone` or `-C <url>`: Clone Git repositories from a remote group or organization
94
94
  - `--remote` or `-r <name>`: Push commits to specified Git remote(s)
95
95
  - `--keepDir`: Keep Dir (Implement before cleaning data)
96
+ - `--only-recent` (number): If files are already present, skip files that are above the specified number of days and skip old legislatures (e.g. `-only-recent 30`)
96
97
 
97
98
  If you use such options, use them in all subsequent commands too (_data:regorganize_data_ and _data:clean_data_).
98
99
 
@@ -6,3 +6,5 @@ export declare class GetFileNotFoundError {
6
6
  constructor(message: string);
7
7
  }
8
8
  export declare function getFiles(args: any): any;
9
+ export declare function pathNonEmpty(p: string): Promise<boolean>;
10
+ export declare function shouldSkipOldLegislatureDataset(dataset: any, outputDir: string, options: any): Promise<boolean>;
package/lib/loaders.js CHANGED
@@ -3,6 +3,7 @@ import g from "fs-extra";
3
3
  import t from "node:path";
4
4
  import { a1 as F, a2 as L, L as j, a3 as _, a4 as M, a5 as J, a6 as N, a7 as Q, a8 as T, Y as X, $ as Y, a0 as Z, X as G, Z as H, _ as K } from "./datasets-Cb3wpfRH.js";
5
5
  import "glob";
6
+ import "node:fs/promises";
6
7
  import { getChangedFilesSinceCommit as z } from "./git.js";
7
8
  import { C as w } from "./amendements-40Z7OJLT.js";
8
9
  function* C(s, i = []) {
@@ -69,7 +70,7 @@ function ee(s, i) {
69
70
  const e = Array.isArray(s) ? s : s !== void 0 ? [s] : [];
70
71
  return s === void 0 || e.includes(0) || i.legislature === j.All ? !0 : e.includes(i.legislature);
71
72
  }
72
- function* le(s, i, e = {}, o) {
73
+ function* ue(s, i, e = {}, o) {
73
74
  for (const {
74
75
  datasetLegislature: m,
75
76
  item: f,
@@ -90,7 +91,7 @@ function* le(s, i, e = {}, o) {
90
91
  ...a && { gitStatus: a }
91
92
  };
92
93
  }
93
- function* ue(s, i, e = {}, o) {
94
+ function* fe(s, i, e = {}, o) {
94
95
  for (const {
95
96
  item: m,
96
97
  datasetLegislature: f,
@@ -111,7 +112,7 @@ function* ue(s, i, e = {}, o) {
111
112
  ...a && { gitStatus: a }
112
113
  };
113
114
  }
114
- function* fe(s, i, e = {}, o) {
115
+ function* de(s, i, e = {}, o) {
115
116
  for (const {
116
117
  datasetLegislature: m,
117
118
  item: f,
@@ -132,7 +133,7 @@ function* fe(s, i, e = {}, o) {
132
133
  ...a && { gitStatus: a }
133
134
  };
134
135
  }
135
- function* de(s, i, e = {}, o) {
136
+ function* me(s, i, e = {}, o) {
136
137
  for (const {
137
138
  item: m,
138
139
  datasetLegislature: f,
@@ -153,7 +154,7 @@ function* de(s, i, e = {}, o) {
153
154
  ...a && { gitStatus: a }
154
155
  };
155
156
  }
156
- function* me(s, i, e = {}, o) {
157
+ function* ge(s, i, e = {}, o) {
157
158
  for (const {
158
159
  item: m,
159
160
  datasetLegislature: f,
@@ -174,7 +175,7 @@ function* me(s, i, e = {}, o) {
174
175
  ...a && { gitStatus: a }
175
176
  };
176
177
  }
177
- function* ge(s, i, e = {}, o) {
178
+ function* je(s, i, e = {}, o) {
178
179
  for (const {
179
180
  item: m,
180
181
  datasetLegislature: f,
@@ -195,7 +196,7 @@ function* ge(s, i, e = {}, o) {
195
196
  ...a && { gitStatus: a }
196
197
  };
197
198
  }
198
- function* je(s, i, e = {}, o) {
199
+ function* he(s, i, e = {}, o) {
199
200
  for (const {
200
201
  item: m,
201
202
  datasetLegislature: f,
@@ -216,7 +217,7 @@ function* je(s, i, e = {}, o) {
216
217
  ...a && { gitStatus: a }
217
218
  };
218
219
  }
219
- function* he(s, i, e = {}, o) {
220
+ function* pe(s, i, e = {}, o) {
220
221
  for (const {
221
222
  item: m,
222
223
  datasetLegislature: f,
@@ -237,7 +238,7 @@ function* he(s, i, e = {}, o) {
237
238
  ...a && { gitStatus: a }
238
239
  };
239
240
  }
240
- function* pe(s, i, e = {}, o) {
241
+ function* ye(s, i, e = {}, o) {
241
242
  for (const {
242
243
  item: m,
243
244
  datasetLegislature: f,
@@ -258,7 +259,7 @@ function* pe(s, i, e = {}, o) {
258
259
  ...a && { gitStatus: a }
259
260
  };
260
261
  }
261
- function ye(s, i, e, { log: o = !1 } = {}) {
262
+ function Fe(s, i, e, { log: o = !1 } = {}) {
262
263
  const m = {}, f = {};
263
264
  if (i & L.ActeursEtOrganes)
264
265
  for (const n of F.acteursEtOrganes) {
@@ -474,7 +475,7 @@ function ye(s, i, e, { log: o = !1 } = {}) {
474
475
  compteRenduByUid: U
475
476
  };
476
477
  }
477
- function Fe(s, i, e, { log: o = !1 } = {}) {
478
+ function Se(s, i, e, { log: o = !1 } = {}) {
478
479
  const m = {}, f = {};
479
480
  if (i & L.ActeursEtOrganes)
480
481
  for (const n of F.acteursEtOrganes) {
@@ -637,7 +638,7 @@ function Fe(s, i, e, { log: o = !1 } = {}) {
637
638
  compteRenduByUid: U
638
639
  };
639
640
  }
640
- function Se(s, i, e) {
641
+ function Ae(s, i, e) {
641
642
  const o = t.join(s, "Documents"), m = ne(o, i), f = t.join(m, "index.json");
642
643
  if (!g.pathExistsSync(f))
643
644
  return;
@@ -647,7 +648,7 @@ function Se(s, i, e) {
647
648
  if (p !== void 0)
648
649
  return { format: a, path: t.join(m, p), url: S };
649
650
  }
650
- function Ae(s, i, { log: e = !1 } = {}) {
651
+ function Pe(s, i, { log: e = !1 } = {}) {
651
652
  const o = t.join(
652
653
  s,
653
654
  `photos_deputes_${// TODO: Handle Legislature.All.
@@ -658,7 +659,7 @@ function Ae(s, i, { log: e = !1 } = {}) {
658
659
  const m = g.readFileSync(o, { encoding: "utf8" });
659
660
  return JSON.parse(m);
660
661
  }
661
- function Pe(s, { log: i = !1 } = {}) {
662
+ function Le(s, { log: i = !1 } = {}) {
662
663
  const e = t.join(
663
664
  s,
664
665
  "photos_senateurs",
@@ -693,10 +694,10 @@ function ne(s, i) {
693
694
  const P = t.join(S, A.substring(0, 3));
694
695
  return g.ensureDirSync(P), t.join(P, i);
695
696
  }
696
- function Le(s, i) {
697
+ function $e(s, i) {
697
698
  return V(s, i, H);
698
699
  }
699
- function $e(s, i) {
700
+ function De(s, i) {
700
701
  const e = Y.exec(i);
701
702
  E.notStrictEqual(
702
703
  e,
@@ -709,7 +710,7 @@ function $e(s, i) {
709
710
  const S = t.join(a, p.substring(0, 3)), A = t.join(S, p.substring(3, 3));
710
711
  return g.ensureDirSync(A), t.join(A, i);
711
712
  }
712
- function De(s, i) {
713
+ function be(s, i) {
713
714
  const e = Z.exec(i);
714
715
  E.notStrictEqual(
715
716
  e,
@@ -722,10 +723,10 @@ function De(s, i) {
722
723
  const a = t.join(f, d.substring(0, 3));
723
724
  return g.ensureDirSync(a), t.join(a, i);
724
725
  }
725
- function be(s, i) {
726
+ function Ue(s, i) {
726
727
  return V(s, i, K);
727
728
  }
728
- function Ue(s, i) {
729
+ function ve(s, i) {
729
730
  const e = G.exec(i);
730
731
  E.notStrictEqual(
731
732
  e,
@@ -753,25 +754,25 @@ function V(s, i, e) {
753
754
  }
754
755
  export {
755
756
  L as EnabledDatasets,
756
- le as iterLoadAssembleeActeurs,
757
- fe as iterLoadAssembleeAmendements,
758
- pe as iterLoadAssembleeComptesRendus,
759
- de as iterLoadAssembleeDocuments,
760
- me as iterLoadAssembleeDossiersParlementaires,
761
- ue as iterLoadAssembleeOrganes,
762
- he as iterLoadAssembleeQuestions,
763
- ge as iterLoadAssembleeReunions,
764
- je as iterLoadAssembleeScrutins,
765
- ye as loadAssembleeData,
766
- Fe as loadAssembleeDataFromBigFiles,
767
- Se as loadAssembleeDocumentFile,
768
- Ae as loadAssembleePhotosDeputes,
769
- Pe as loadAssembleePhotosSenateurs,
770
- Ue as pathFromCompteRenduUid,
757
+ ue as iterLoadAssembleeActeurs,
758
+ de as iterLoadAssembleeAmendements,
759
+ ye as iterLoadAssembleeComptesRendus,
760
+ me as iterLoadAssembleeDocuments,
761
+ ge as iterLoadAssembleeDossiersParlementaires,
762
+ fe as iterLoadAssembleeOrganes,
763
+ pe as iterLoadAssembleeQuestions,
764
+ je as iterLoadAssembleeReunions,
765
+ he as iterLoadAssembleeScrutins,
766
+ Fe as loadAssembleeData,
767
+ Se as loadAssembleeDataFromBigFiles,
768
+ Ae as loadAssembleeDocumentFile,
769
+ Pe as loadAssembleePhotosDeputes,
770
+ Le as loadAssembleePhotosSenateurs,
771
+ ve as pathFromCompteRenduUid,
771
772
  ne as pathFromDocumentUid,
772
- Le as pathFromDossierParlementaireUid,
773
- be as pathFromQuestionUid,
774
- $e as pathFromReunionUid,
775
- De as pathFromScrutinUid,
773
+ $e as pathFromDossierParlementaireUid,
774
+ Ue as pathFromQuestionUid,
775
+ De as pathFromReunionUid,
776
+ be as pathFromScrutinUid,
776
777
  C as walkDir
777
778
  };
@@ -1,2 +1,3 @@
1
1
  export declare const writeIfChanged: (p: string, content: string) => Promise<void>;
2
2
  export declare function fetchWithRetry(url: string, retries?: number, backoff?: number): Promise<Response>;
3
+ export declare function newestRequestedLegislature(options: any): number | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tricoteuses/assemblee",
3
- "version": "2.5.30",
3
+ "version": "2.5.31",
4
4
  "description": "Retrieve, clean up & handle French Assemblée nationale's open data",
5
5
  "keywords": [
6
6
  "Assemblée nationale",