@tricoteuses/assemblee 3.8.6 → 3.9.1

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.
@@ -168,6 +168,15 @@ export declare const MetadonneesCleanSchema: z.ZodObject<{
168
168
  }, z.core.$strip>;
169
169
  }, z.core.$strip>;
170
170
  export type MetadonneesClean = z.infer<typeof MetadonneesCleanSchema>;
171
+ /**
172
+ * État de publication d'un compte rendu, calculé au nettoyage.
173
+ */
174
+ export declare const EtatPublicationCompteRenduSchema: z.ZodEnum<{
175
+ finalise: "finalise";
176
+ en_cours_de_finalisation: "en_cours_de_finalisation";
177
+ sans_compte_rendu_ecrit: "sans_compte_rendu_ecrit";
178
+ }>;
179
+ export type EtatPublicationCompteRendu = z.infer<typeof EtatPublicationCompteRenduSchema>;
171
180
  /**
172
181
  * Compte Rendu (single debate transcript) - clean version
173
182
  * Note: schemaVersion optional (from QuickType types)
@@ -212,6 +221,11 @@ export declare const CompteRenduCleanSchema: z.ZodObject<{
212
221
  }, z.core.$strip>>;
213
222
  paragraphe: z.ZodOptional<z.ZodPreprocess<z.ZodArray<z.ZodType<PointClean, unknown, z.core.$ZodTypeInternals<PointClean, unknown>>>, unknown>>;
214
223
  }, z.core.$strip>;
224
+ etatPublication: z.ZodOptional<z.ZodEnum<{
225
+ finalise: "finalise";
226
+ en_cours_de_finalisation: "en_cours_de_finalisation";
227
+ sans_compte_rendu_ecrit: "sans_compte_rendu_ecrit";
228
+ }>>;
215
229
  videoUrl: z.ZodOptional<z.ZodString>;
216
230
  videoTimecode: z.ZodOptional<z.ZodNumber>;
217
231
  }, z.core.$strip>;
@@ -260,6 +274,11 @@ export declare const ComptesRendusCleanSchema: z.ZodObject<{
260
274
  }, z.core.$strip>>;
261
275
  paragraphe: z.ZodOptional<z.ZodPreprocess<z.ZodArray<z.ZodType<PointClean, unknown, z.core.$ZodTypeInternals<PointClean, unknown>>>, unknown>>;
262
276
  }, z.core.$strip>;
277
+ etatPublication: z.ZodOptional<z.ZodEnum<{
278
+ finalise: "finalise";
279
+ en_cours_de_finalisation: "en_cours_de_finalisation";
280
+ sans_compte_rendu_ecrit: "sans_compte_rendu_ecrit";
281
+ }>>;
263
282
  videoUrl: z.ZodOptional<z.ZodString>;
264
283
  videoTimecode: z.ZodOptional<z.ZodNumber>;
265
284
  }, z.core.$strip>>;
@@ -185,6 +185,11 @@ export declare const CompteRenduEnrichedSchema: z.ZodObject<{
185
185
  uid: z.ZodString;
186
186
  seanceRef: z.ZodString;
187
187
  sessionRef: z.ZodString;
188
+ etatPublication: z.ZodOptional<z.ZodEnum<{
189
+ finalise: "finalise";
190
+ en_cours_de_finalisation: "en_cours_de_finalisation";
191
+ sans_compte_rendu_ecrit: "sans_compte_rendu_ecrit";
192
+ }>>;
188
193
  videoUrl: z.ZodOptional<z.ZodString>;
189
194
  videoTimecode: z.ZodOptional<z.ZodNumber>;
190
195
  metadonnees: z.ZodObject<{
@@ -233,6 +238,11 @@ export declare const ComptesRendusEnrichedSchema: z.ZodObject<{
233
238
  uid: z.ZodString;
234
239
  seanceRef: z.ZodString;
235
240
  sessionRef: z.ZodString;
241
+ etatPublication: z.ZodOptional<z.ZodEnum<{
242
+ finalise: "finalise";
243
+ en_cours_de_finalisation: "en_cours_de_finalisation";
244
+ sans_compte_rendu_ecrit: "sans_compte_rendu_ecrit";
245
+ }>>;
236
246
  videoUrl: z.ZodOptional<z.ZodString>;
237
247
  videoTimecode: z.ZodOptional<z.ZodNumber>;
238
248
  metadonnees: z.ZodObject<{
@@ -122,9 +122,6 @@ export declare function downloadAndParse(document: Document, _datasetDir: string
122
122
  forceParseDocuments?: boolean;
123
123
  parseDocuments?: boolean;
124
124
  }): Promise<void>;
125
- export declare function downloadAndParseVideosAndComptesRendus(reunion: Reunion, datasetCleanDir: string, options: Options, { removeMissingSeanceCR, legislature, }?: {
126
- removeMissingSeanceCR?: boolean;
127
- legislature?: number;
128
- }): Promise<void>;
125
+ export declare function downloadAndParseVideosAndComptesRendus(reunion: Reunion, datasetCleanDir: string, options: Options): Promise<void>;
129
126
  export declare function parseDocumentOrDivisionHtml(documentOrDivision: Document | Division, documentsFilesDir: string): Promise<void>;
130
127
  export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -1,3 +1,9 @@
1
1
  import { ReunionClean as Reunion } from '../schemas/clean/agendas.js';
2
2
  import { Options } from './retrieve_documents';
3
+ /**
4
+ * Written in `Videos_*_nettoye/<uid>/` when a search finds no valid video,
5
+ * so that the reunion is not searched again on every run (see
6
+ * `videoHarvestDecision`). Removed once a video is found.
7
+ */
8
+ export declare const FAILED_SEARCH_FILENAME = "failed_search.json";
3
9
  export declare function downloadAndParseVideos(reunion: Reunion, datasetCleanDir: string, options: Options): Promise<void>;
@@ -11,19 +11,43 @@
11
11
  /** Stop retrying a missing commission report after this many days. */
12
12
  export declare const CR_COMMISSION_RETRY_DAYS = 120;
13
13
  export declare function reunionStartMs(timestampDebut: string | Date): number;
14
+ /**
15
+ * A reunion without video is searched on every run during this many days
16
+ * (99% of videos are online within 2.4 days).
17
+ */
18
+ export declare const VIDEO_PUBLICATION_DAYS = 3;
19
+ /**
20
+ * Afterwards, a reunion still without video is searched at most once per
21
+ * this interval, until it leaves the onlyRecent window.
22
+ */
23
+ export declare const VIDEO_FAILED_SEARCH_INTERVAL_MS: number;
14
24
  /**
15
25
  * - `search`: query the video site;
16
- * - `use-cache`: reuse the already downloaded `.nvs` files;
17
- * - `skip`: do nothing (reunion not held yet, or older than the window with
18
- * no video found).
26
+ * - `use-cache`: reuse the already downloaded `.nvs` files (a video found
27
+ * for a reunion never changes);
28
+ * - `skip`: do nothing (reunion not held yet, older than the window with no
29
+ * video found, or searched without success less than a day ago).
19
30
  */
20
31
  export type VideoHarvestDecision = "search" | "use-cache" | "skip";
21
- export declare function videoHarvestDecision({ hasCachedVideo, nowMs, onlyRecentDays, startMs, }: {
32
+ export declare function videoHarvestDecision({ hasCachedVideo, lastFailedSearchMs, nowMs, onlyRecentDays, startMs, }: {
22
33
  hasCachedVideo: boolean;
34
+ /** Time of the last search that found no valid video, if any. */
35
+ lastFailedSearchMs?: number;
23
36
  nowMs: number;
24
37
  onlyRecentDays: number | undefined;
25
38
  startMs: number;
26
39
  }): VideoHarvestDecision;
40
+ /**
41
+ * Calendar date and day part of a reunion as used by the video search form,
42
+ * in Paris civil time whatever the process time zone (pods run in UTC).
43
+ */
44
+ export declare function parisVideoSearchDate(timestamp: string | Date): {
45
+ day: string;
46
+ month: string;
47
+ year: string;
48
+ /** "1": morning (< 12h), "2": afternoon (< 19h), "3": evening. */
49
+ heure: "1" | "2" | "3";
50
+ };
27
51
  export declare function shouldFetchCrCommission({ hasContent, nowMs, onlyRecentDays, startMs, }: {
28
52
  hasContent: boolean;
29
53
  nowMs: number;