@tricoteuses/assemblee 3.2.16 → 3.3.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.
- package/lib/cleaners.js +7 -7
- package/lib/index.d.ts +1 -0
- package/lib/index.js +20 -20
- package/lib/{loaders-Bqy18Qs1.js → loaders-DbLMTnJA.js} +152 -152
- package/lib/loaders.js +1 -1
- package/lib/open_data/artifacts.d.ts +38 -0
- package/lib/parsers/index.d.ts +2 -0
- package/lib/parsers/plf/credits.d.ts +2 -0
- package/lib/parsers/plf/credits.test.d.ts +1 -0
- package/lib/parsers/plf/depot.d.ts +2 -0
- package/lib/parsers/plf/depot.test.d.ts +1 -0
- package/lib/parsers/plf/index.d.ts +3 -0
- package/lib/parsers/plf/integration.test.d.ts +1 -0
- package/lib/parsers/plf/later_stage.d.ts +2 -0
- package/lib/parsers/plf/later_stage.test.d.ts +1 -0
- package/lib/parsers/plf/parser_utils.d.ts +11 -0
- package/lib/parsers/plf/test_utils.d.ts +18 -0
- package/lib/parsers/plf/variant_detection.d.ts +2 -0
- package/lib/parsers/plf/variant_detection.test.d.ts +1 -0
- package/lib/parsers/utils.d.ts +7 -0
- package/lib/parsers.js +3726 -3326
- package/lib/schemas/clean/dossiers_legislatifs.d.ts +97 -0
- package/lib/schemas/enriched/dossiers_legislatifs.d.ts +6 -0
- package/lib/scripts/monitor_open_data_updates.d.ts +2 -0
- package/lib/scripts/retrieve_open_data.d.ts +1 -0
- package/lib/{scrutins-D1qWLlRT.js → scrutins-CcBKz4TE.js} +156 -121
- package/package.json +1 -1
package/lib/loaders.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as e, S as t, _ as n, a as r, b as i, c as a, d as o, f as s, g as c, h as l, i as u, l as d, m as f, n as p, o as m, p as h, r as g, s as _, t as v, u as y, v as b, x, y as S } from "./loaders-
|
|
1
|
+
import { C as e, S as t, _ as n, a as r, b as i, c as a, d as o, f as s, g as c, h as l, i as u, l as d, m as f, n as p, o as m, p as h, r as g, s as _, t as v, u as y, v as b, x, y as S } from "./loaders-DbLMTnJA.js";
|
|
2
2
|
export { e as EnabledDatasets, v as datasets, p as iterLoadAssembleeActeurs, g as iterLoadAssembleeAmendements, u as iterLoadAssembleeComptesRendus, r as iterLoadAssembleeDocuments, m as iterLoadAssembleeDossiersParlementaires, _ as iterLoadAssembleeOrganes, a as iterLoadAssembleeQuestions, d as iterLoadAssembleeReunions, y as iterLoadAssembleeScrutins, o as loadAssembleeData, s as loadAssembleeDataFromBigFiles, h as loadAssembleeDocumentFile, f as loadAssembleePhotosDeputes, l as loadAssembleePhotosSenateurs, c as pathFromCompteRenduUid, n as pathFromDocumentUid, b as pathFromDossierParlementaireUid, S as pathFromQuestionUid, i as pathFromReunionUid, x as pathFromScrutinUid, t as walkDir };
|
|
@@ -16,10 +16,48 @@ export interface DiscoveryOptions {
|
|
|
16
16
|
timeoutMs?: number;
|
|
17
17
|
}
|
|
18
18
|
export interface DownloadOptions {
|
|
19
|
+
chunkSizeBytes?: number;
|
|
19
20
|
fetch?: typeof fetch;
|
|
21
|
+
maxRetryDurationMs?: number;
|
|
22
|
+
now?: () => number;
|
|
23
|
+
onRetry?: (event: DownloadRetryEvent) => void;
|
|
20
24
|
retries?: number;
|
|
25
|
+
sleep?: (milliseconds: number) => Promise<void>;
|
|
21
26
|
timeoutMs?: number;
|
|
22
27
|
}
|
|
28
|
+
export interface DownloadRetryEvent {
|
|
29
|
+
chunkSizeBytes: number;
|
|
30
|
+
consecutiveFailuresWithoutProgress: number;
|
|
31
|
+
delayMs: number;
|
|
32
|
+
error: ErrorDiagnostic;
|
|
33
|
+
offsetAfter: number;
|
|
34
|
+
offsetBefore: number;
|
|
35
|
+
progressBytes: number;
|
|
36
|
+
remainingTimeMs: number;
|
|
37
|
+
request: number;
|
|
38
|
+
sourceUrl: string;
|
|
39
|
+
}
|
|
40
|
+
export declare function formatDuration(milliseconds: number): string;
|
|
41
|
+
export interface ErrorDiagnostic {
|
|
42
|
+
cause?: ErrorDiagnostic;
|
|
43
|
+
causes?: ErrorDiagnostic[];
|
|
44
|
+
code?: string;
|
|
45
|
+
message: string;
|
|
46
|
+
name: string;
|
|
47
|
+
}
|
|
48
|
+
export interface ArtifactProbeFailure {
|
|
49
|
+
error: ErrorDiagnostic;
|
|
50
|
+
probe: number;
|
|
51
|
+
url: string;
|
|
52
|
+
}
|
|
53
|
+
export declare class ArtifactDiscoveryError extends Error {
|
|
54
|
+
readonly artifactUrl: string;
|
|
55
|
+
readonly failures: ArtifactProbeFailure[];
|
|
56
|
+
readonly observations: ArtifactVersion[];
|
|
57
|
+
readonly successfulProbes: number;
|
|
58
|
+
constructor(artifactUrl: string, successfulProbes: number, failures: ArtifactProbeFailure[], reason?: string, observations?: ArtifactVersion[]);
|
|
59
|
+
}
|
|
60
|
+
export declare function errorDiagnostic(error: unknown, depth?: number): ErrorDiagnostic;
|
|
23
61
|
export declare function versionFromResponse(response: Response, sourceUrl: string): ArtifactVersion;
|
|
24
62
|
export declare function compareArtifactVersions(left: ArtifactVersion, right: ArtifactVersion): number;
|
|
25
63
|
export declare function isStrictlyNewer(candidate: ArtifactVersion, accepted: ArtifactVersion | undefined): boolean;
|
package/lib/parsers/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AnyNode } from 'domhandler';
|
|
2
|
+
import { ContenuSubdivisionEnriched as ContenuSubdivision, SubdivisionEnriched as Subdivision } from '../../schemas/enriched/dossiers_legislatifs.js';
|
|
3
|
+
import type * as cheerio from "cheerio";
|
|
4
|
+
export type PlfSubdivisionParseResult = {
|
|
5
|
+
subdivisions: Subdivision[];
|
|
6
|
+
};
|
|
7
|
+
export declare function normalizeId(text: string): string;
|
|
8
|
+
export declare function nodeToContenuSubdivision($el: cheerio.Cheerio<AnyNode>): ContenuSubdivision;
|
|
9
|
+
export declare function makeSubdivision(id: string, type: string, niveau: number, niveauRelatif: number): Subdivision;
|
|
10
|
+
export declare function isEtatsAnnexesBoundary(text: string): boolean;
|
|
11
|
+
export declare function extractTableContent($el: cheerio.Cheerio<AnyNode>): ContenuSubdivision;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { parsePlfCredits } from './credits.js';
|
|
2
|
+
import { PlfSubdivisionParseResult } from './parser_utils.js';
|
|
3
|
+
export type Subdivision = PlfSubdivisionParseResult["subdivisions"][number];
|
|
4
|
+
export type SubdivisionContent = NonNullable<Subdivision["alineas"]>[number];
|
|
5
|
+
export type CreditSection = ReturnType<typeof parsePlfCredits>[number];
|
|
6
|
+
export declare function loadFixture(name: string): string;
|
|
7
|
+
export declare function loadDocumentFromDataDir(dataDir: string, uid: string): string;
|
|
8
|
+
export declare function articlesOf(subdivisions: Subdivision[]): Subdivision[];
|
|
9
|
+
export declare function allContentOf(subdivisions: Subdivision[]): {
|
|
10
|
+
texte?: string | undefined;
|
|
11
|
+
texte_avec_liens?: string | null | undefined;
|
|
12
|
+
html?: string | undefined;
|
|
13
|
+
html_avec_liens?: string | null | undefined;
|
|
14
|
+
}[];
|
|
15
|
+
export declare function isImageContent({ html }: SubdivisionContent): boolean;
|
|
16
|
+
export declare function isTableContent({ html }: SubdivisionContent): boolean;
|
|
17
|
+
export declare function expectValidSubdivisions(subdivisions: Subdivision[]): void;
|
|
18
|
+
export declare function expectValidCreditSections(sections: CreditSection[]): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AnyNode } from 'domhandler';
|
|
2
|
+
import * as cheerio from "cheerio";
|
|
3
|
+
export declare function cleanHtml(html: string, { removeEmptyElements }?: {
|
|
4
|
+
removeEmptyElements?: boolean;
|
|
5
|
+
}): string;
|
|
6
|
+
export declare function cleanText(text: string | null): string;
|
|
7
|
+
export declare function extractTableText($table: cheerio.Cheerio<AnyNode>): string;
|