@tricoteuses/assemblee 3.8.3 → 3.8.5
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 +2 -2
- package/lib/{amendements-BYKlEcWb.js → amendements-BtCdrXW8.js} +36 -33
- package/lib/{amendements-CvlD2dI4.js → amendements-DfZse75q.js} +924 -672
- package/lib/amendements-xiii.d.ts +56 -0
- package/lib/amendements-xiii.test.d.ts +1 -0
- package/lib/browser-Dl6SgoZX.js +8164 -0
- package/lib/cleaners/amendements-xiv.test.d.ts +1 -0
- package/lib/cleaners/amendements.d.ts +18 -1
- package/lib/cleaners.js +3 -3
- package/lib/index.d.ts +5 -2
- package/lib/index.js +596 -99
- package/lib/inserters.d.ts +2 -2
- package/lib/{loaders-BNXs79lC.js → loaders-Dd8i-E7o.js} +11 -2
- package/lib/loaders.js +1 -1
- package/lib/open_data/artifacts.d.ts +12 -0
- package/lib/parsers.js +359 -8521
- package/lib/schemas/clean/amendements-xiii.d.ts +579 -0
- package/lib/schemas/clean/amendements.d.ts +502 -11
- package/lib/schemas/enriched/amendements.d.ts +6 -6
- package/lib/schemas/raw/amendements-xiii.d.ts +754 -0
- package/lib/schemas/raw/amendements-xiv.test.d.ts +1 -0
- package/lib/schemas/raw/amendements.d.ts +1769 -2
- package/lib/schemas/raw/amendements.test.d.ts +1 -0
- package/lib/scripts/clean_reorganized_data.test.d.ts +1 -0
- package/lib/scripts/data-download.d.ts +132 -0
- package/lib/scripts/retrieve_amendements_xiii.d.ts +51 -0
- package/lib/scripts/retrieve_open_data.d.ts +39 -24
- package/lib/scripts/shared/amendements_xiv_stream.d.ts +29 -0
- package/lib/scripts/shared/amendements_xiv_stream.test.d.ts +1 -0
- package/lib/scripts/shared/cli_helpers.d.ts +20 -0
- package/lib/{scrutins-BUVxV-QV.js → scrutins-CLWnMYLE.js} +266 -266
- package/package.json +7 -7
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { AmendementXiiiRaw } from './schemas/raw/amendements-xiii.js';
|
|
2
|
+
import { AmendementXiiiClean } from './schemas/clean/amendements-xiii.js';
|
|
3
|
+
/** Base of the legacy XIIIth legislature site. */
|
|
4
|
+
export declare const ASSEMBLEE_XIII_BASE_URL = "https://www.assemblee-nationale.fr";
|
|
5
|
+
/**
|
|
6
|
+
* Decode a page using the charset it declares.
|
|
7
|
+
*
|
|
8
|
+
* Pages up to 2011 are `iso-8859-1`, the 2012 ones are `utf-8`: decoding all
|
|
9
|
+
* of them as one or the other produces mojibake on part of the corpus.
|
|
10
|
+
*/
|
|
11
|
+
export declare function decodeXiiiHtml(bytes: Uint8Array): string;
|
|
12
|
+
/** URL of one amendment page, from its text number and slug. */
|
|
13
|
+
export declare function xiiiAmendementUrl(texte: string, slug: string): string;
|
|
14
|
+
/** URL of one amendment PDF. */
|
|
15
|
+
export declare function xiiiAmendementPdfUrl(texte: string, slug: string): string;
|
|
16
|
+
/**
|
|
17
|
+
* URL of the paginated archive listing the amendments of one text.
|
|
18
|
+
*
|
|
19
|
+
* This is the only enumeration endpoint: the directory `/13/amendements/`
|
|
20
|
+
* is not browsable (403) and the slugs are not predictable.
|
|
21
|
+
*/
|
|
22
|
+
export declare function xiiiListeUrl(texte: string, offset?: number, nbres?: number): string;
|
|
23
|
+
/**
|
|
24
|
+
* Build the uid of a XIIIth legislature amendment.
|
|
25
|
+
*
|
|
26
|
+
* The AN has no uid for these amendments (its own search API returns
|
|
27
|
+
* degenerate ids such as `S-AMANR5L13B189NPII`). The number alone is not
|
|
28
|
+
* unique — on the 2012 finance bill, 1 076 amendments share 737 numbers —
|
|
29
|
+
* so the serie letter taken from the URL slug is part of the uid.
|
|
30
|
+
*/
|
|
31
|
+
export declare function amendementXiiiUid({ numero, serie, texte, }: {
|
|
32
|
+
numero: string;
|
|
33
|
+
serie: string;
|
|
34
|
+
texte: string;
|
|
35
|
+
}): string;
|
|
36
|
+
/**
|
|
37
|
+
* Title of the text support, as printed on the page.
|
|
38
|
+
*
|
|
39
|
+
* The 2007-2011 pages carry a `<TITRE_INIT>` element, the 2012 ones only a
|
|
40
|
+
* `TITRE_INIT` META tag; the value is HTML-encoded in both cases.
|
|
41
|
+
*/
|
|
42
|
+
export declare function xiiiTitreFromPage(html: string): string;
|
|
43
|
+
/**
|
|
44
|
+
* Turn one XIIIth legislature amendment page into its raw JSON.
|
|
45
|
+
*
|
|
46
|
+
* @param html the page, already decoded (see {@link decodeXiiiHtml})
|
|
47
|
+
* @param url the absolute URL the page was fetched from
|
|
48
|
+
*/
|
|
49
|
+
export declare function parseAmendementXiiiPage(html: string, url: string): AmendementXiiiRaw;
|
|
50
|
+
/**
|
|
51
|
+
* Apply the same conventions as the XIV cleaner: `avant_A_Apres` becomes
|
|
52
|
+
* `avantAApres`, `cosignataires.acteurRef` becomes `cosignatairesRefs`, null
|
|
53
|
+
* optional values are dropped, and `amendementParent` is renamed
|
|
54
|
+
* `amendementParentRef`. No field is added.
|
|
55
|
+
*/
|
|
56
|
+
export declare function cleanAmendementXiii(amendement: AmendementXiiiRaw): AmendementXiiiClean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|