@tricoteuses/assemblee 3.0.18 → 3.1.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/README.md +2 -2
- package/lib/{amendements-Bab1iUCY.js → amendements-Blw6Aa6-.js} +3 -3
- package/lib/amendements-DiMsxlUL.js +178 -0
- package/lib/cleaners/actes_legislatifs.d.ts +2 -2
- package/lib/cleaners/acteurs.d.ts +7 -2
- package/lib/cleaners/amendements.d.ts +2 -2
- package/lib/cleaners/documents.d.ts +1 -1
- package/lib/cleaners/dossiers_legislatifs.d.ts +1 -1
- package/lib/cleaners/organes.d.ts +1 -1
- package/lib/cleaners/reunions.d.ts +1 -1
- package/lib/cleaners/scrutins.d.ts +10 -2
- package/lib/cleaners.js +576 -485
- package/lib/datasets.d.ts +2 -6
- package/lib/git.js +54 -51
- package/lib/index.js +263 -257
- package/lib/inserters.d.ts +22 -2
- package/lib/loaders.js +495 -544
- package/lib/logger.d.ts +1 -1
- package/lib/parsers.js +5 -5
- package/lib/{questions-BiakXZ6q.js → questions-XokaUGcy.js} +4 -1
- package/lib/registries.d.ts +4 -4
- package/lib/schemas/clean/acteurs_et_organes.d.ts +37 -37
- package/lib/schemas/clean/amendements.d.ts +38 -25
- package/lib/schemas/clean/dossiers_legislatifs.d.ts +16 -16
- package/lib/schemas/clean/scrutins.d.ts +2 -2
- package/lib/schemas/enriched/acteurs_et_organes.d.ts +2 -2
- package/lib/schemas/enriched/amendements.d.ts +135 -15
- package/lib/schemas/enriched/dossiers_legislatifs.d.ts +12 -12
- package/lib/schemas/enriched/scrutins.d.ts +2 -2
- package/lib/schemas/raw/acteurs_et_organes.d.ts +99 -99
- package/lib/schemas/raw/agendas.d.ts +11 -11
- package/lib/schemas/raw/amendements.d.ts +49 -37
- package/lib/schemas/raw/dossiers_legislatifs.d.ts +146 -63
- package/lib/schemas/raw/questions.d.ts +44 -44
- package/lib/schemas/raw/scrutins.d.ts +4 -4
- package/lib/scripts/retrieve_documents.d.ts +5 -1
- package/lib/scripts/retrieve_open_data.d.ts +4 -0
- package/lib/scripts/shared/cli_helpers.d.ts +8 -0
- package/package.json +26 -26
- package/lib/amendements-BKGwufEi.js +0 -170
package/README.md
CHANGED
|
@@ -66,7 +66,7 @@ npm run data:download ../assemblee-data -- -l 16 -l 17
|
|
|
66
66
|
|
|
67
67
|
### Common Options
|
|
68
68
|
|
|
69
|
-
- `--categories` or `-k <name>`: Filter by dataset categories (Available options : `ActeursEtOrganes`, `Agendas`, `Amendements`, `DossiersLegislatifs`, `Photos`, `Scrutins`, `Questions`, `
|
|
69
|
+
- `--categories` or `-k <name>`: Filter by dataset categories (Available options : `ActeursEtOrganes`, `Agendas`, `Amendements`, `DossiersLegislatifs`, `Photos`, `Scrutins`, `Questions`, `ComptesRendus`)
|
|
70
70
|
|
|
71
71
|
- `--legislature` or `-l <number>`: Specify one or more legislatures to process (e.g., `-l 15 -l 16`)
|
|
72
72
|
- `--dataDir <path>` (Mandatory): Path to the working directory where all data is stored (required)
|
|
@@ -90,6 +90,7 @@ If you use such options, use them in all subsequent commands too (_data:regorgan
|
|
|
90
90
|
- `--fetchDocuments` : Specify to retrieve documents
|
|
91
91
|
- `--parseDocuments`: Specify to parse documents into cleaned json
|
|
92
92
|
- `--fetchVideos`: Retrieve videos
|
|
93
|
+
- `--fetchCrCommissions`: Retrieve and parse CR commissions
|
|
93
94
|
|
|
94
95
|
### Options for Retrieving Documents
|
|
95
96
|
|
|
@@ -132,4 +133,3 @@ for (const { acteur } of iterLoadAssembleeActeurs("../assemblee-data", 17)) {
|
|
|
132
133
|
console.log(acteur.uid)
|
|
133
134
|
}
|
|
134
135
|
```
|
|
135
|
-
|
|
@@ -3263,8 +3263,8 @@ const Ki = Date.prototype.toJSON, er = function() {
|
|
|
3263
3263
|
return s + u + l + Math.abs(r).toString().split(".")[0] + ":00";
|
|
3264
3264
|
} catch {
|
|
3265
3265
|
Date.prototype.toJSON = Ki;
|
|
3266
|
-
const
|
|
3267
|
-
return Date.prototype.toJSON = er,
|
|
3266
|
+
const t = this.toJSON();
|
|
3267
|
+
return Date.prototype.toJSON = er, t;
|
|
3268
3268
|
}
|
|
3269
3269
|
}, Sa = new Intl.DateTimeFormat("fr-FR", {
|
|
3270
3270
|
day: "numeric",
|
|
@@ -3339,7 +3339,6 @@ const We = a.preprocess((t) => {
|
|
|
3339
3339
|
} catch {
|
|
3340
3340
|
return t;
|
|
3341
3341
|
}
|
|
3342
|
-
return t;
|
|
3343
3342
|
}
|
|
3344
3343
|
}, a.date().optional()), z = () => We, U = () => We.refine((t) => t !== void 0, { message: "Required" }).transform((t) => t), _e = a.preprocess((t) => {
|
|
3345
3344
|
if (typeof t != "string") return t;
|
|
@@ -3485,6 +3484,7 @@ const sr = [
|
|
|
3485
3484
|
autorisationEngagementAnnule: a.string(),
|
|
3486
3485
|
creditPaiementAnnule: a.string(),
|
|
3487
3486
|
action: _,
|
|
3487
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
3488
3488
|
lignesCredits: Rr.optional(),
|
|
3489
3489
|
id: a.string().optional()
|
|
3490
3490
|
})
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import f from "node:assert";
|
|
2
|
+
import { u as C } from "./amendements-Blw6Aa6-.js";
|
|
3
|
+
const x = {
|
|
4
|
+
false: !1,
|
|
5
|
+
true: !0
|
|
6
|
+
}, E = "http://schemas.assemblee-nationale.fr/referentiel", O = "http://www.w3.org/2001/XMLSchema-instance";
|
|
7
|
+
function u(i, t) {
|
|
8
|
+
const e = i[t];
|
|
9
|
+
if (e == null) {
|
|
10
|
+
delete i[t];
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
const r = x[e];
|
|
14
|
+
return f.notStrictEqual(
|
|
15
|
+
r,
|
|
16
|
+
void 0,
|
|
17
|
+
`Invalid boolean value: ${t} = ${e}`
|
|
18
|
+
), i[t] = r, r;
|
|
19
|
+
}
|
|
20
|
+
function j(i, t) {
|
|
21
|
+
const e = i[t];
|
|
22
|
+
if (e == null) {
|
|
23
|
+
delete i[t];
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const r = Number.parseInt(e);
|
|
27
|
+
return f(
|
|
28
|
+
!Number.isNaN(r),
|
|
29
|
+
`Invalid number value: ${t} = ${e}`
|
|
30
|
+
), i[t] = r, r;
|
|
31
|
+
}
|
|
32
|
+
function s(i, { recursive: t } = {}) {
|
|
33
|
+
if (i != null) {
|
|
34
|
+
if (Array.isArray(i)) {
|
|
35
|
+
if (i.length === 0)
|
|
36
|
+
return;
|
|
37
|
+
if (t)
|
|
38
|
+
for (const [e, r] of i.entries()) {
|
|
39
|
+
const a = s(r, { recursive: t });
|
|
40
|
+
a !== r && (i[e] = a ?? null);
|
|
41
|
+
}
|
|
42
|
+
return i;
|
|
43
|
+
}
|
|
44
|
+
if (typeof i == "object" && i.constructor === Object) {
|
|
45
|
+
const e = i;
|
|
46
|
+
if (Object.keys(e).length === 0 || e["@xsi:nil"] === "true")
|
|
47
|
+
return;
|
|
48
|
+
const r = e["@xmlns"] ?? e.xmlns;
|
|
49
|
+
if (r !== void 0 && (f.strictEqual(r, E), delete e["@xmlns"], delete e.xmlns), e["@xmlns:xsi"] === O && delete e["@xmlns:xsi"], t)
|
|
50
|
+
for (const [a, o] of Object.entries(e)) {
|
|
51
|
+
const c = s(o, { recursive: t });
|
|
52
|
+
c === void 0 ? delete e[a] : c !== o && (e[a] = c);
|
|
53
|
+
}
|
|
54
|
+
else
|
|
55
|
+
for (const [a, o] of Object.entries(e))
|
|
56
|
+
(o == null || o["@xsi:nil"] === "true" || Array.isArray(o) && o.length === 0 || !Array.isArray(o) && o.constructor === Object && Object.keys(o).length === 0) && delete e[a];
|
|
57
|
+
return Object.keys(e).length === 0 ? void 0 : e;
|
|
58
|
+
}
|
|
59
|
+
return i;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
function v(i) {
|
|
63
|
+
return Array.isArray(i) ? i : [i];
|
|
64
|
+
}
|
|
65
|
+
function R(i) {
|
|
66
|
+
return i === "Après" ? "Apres" : C.includes(i) ? i : "A";
|
|
67
|
+
}
|
|
68
|
+
function S(i) {
|
|
69
|
+
const t = i;
|
|
70
|
+
s(t);
|
|
71
|
+
const e = t.signataires;
|
|
72
|
+
s(e);
|
|
73
|
+
const r = e.auteur;
|
|
74
|
+
s(r);
|
|
75
|
+
const a = e.cosignataires;
|
|
76
|
+
if (a !== void 0) {
|
|
77
|
+
const n = a.acteurRef;
|
|
78
|
+
n !== void 0 && (e.cosignatairesRefs = v(n)), delete e.cosignataires;
|
|
79
|
+
}
|
|
80
|
+
const o = e.libelle;
|
|
81
|
+
if (o !== void 0) {
|
|
82
|
+
const n = o.replace(/ |\u00A0/g, " ").split(" ").filter(Boolean).join(" ");
|
|
83
|
+
n ? e.libelle = n : delete e.libelle;
|
|
84
|
+
}
|
|
85
|
+
const c = t.pointeurFragmentTexte;
|
|
86
|
+
s(c);
|
|
87
|
+
const d = c.division;
|
|
88
|
+
if (d !== void 0) {
|
|
89
|
+
s(d);
|
|
90
|
+
const n = d.avant_A_Apres;
|
|
91
|
+
n !== void 0 && (delete d.avant_A_Apres, d.avantAApres = n === "Après" ? "Apres" : n);
|
|
92
|
+
}
|
|
93
|
+
const m = c.amendementStandard;
|
|
94
|
+
if (m !== void 0) {
|
|
95
|
+
s(m);
|
|
96
|
+
const n = m.alinea;
|
|
97
|
+
if (n !== void 0) {
|
|
98
|
+
s(n);
|
|
99
|
+
const l = n.avant_A_Apres;
|
|
100
|
+
typeof l == "string" && (delete n.avant_A_Apres, n.avantAApres = R(l)), c.alinea = n;
|
|
101
|
+
}
|
|
102
|
+
delete c.amendementStandard;
|
|
103
|
+
}
|
|
104
|
+
const p = t.corps;
|
|
105
|
+
if (p !== void 0) {
|
|
106
|
+
s(p);
|
|
107
|
+
const n = p.contenuAuteur;
|
|
108
|
+
if (n !== void 0) {
|
|
109
|
+
s(n);
|
|
110
|
+
const l = n.avantAppel;
|
|
111
|
+
l !== void 0 && (s(l), A(l.dispositifAmdtCreditPLF, {
|
|
112
|
+
rectificatif: !1
|
|
113
|
+
}), A(l.dispositifAmdtCreditPLFR, {
|
|
114
|
+
rectificatif: !0
|
|
115
|
+
}), Object.keys(l).length === 0 && delete n.avantAppel), f.strictEqual(n.annexeExposeSommaire, void 0), A(n.dispositifAmdtCreditPLF, {
|
|
116
|
+
rectificatif: !1
|
|
117
|
+
}), A(n.dispositifAmdtCreditPLFR, {
|
|
118
|
+
rectificatif: !0
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
const g = t.cycleDeVie;
|
|
123
|
+
if (g !== void 0) {
|
|
124
|
+
s(g);
|
|
125
|
+
const n = g.etatDesTraitements;
|
|
126
|
+
s(n), s(n.etat), n.sousEtat !== void 0 && s(n.sousEtat);
|
|
127
|
+
}
|
|
128
|
+
const b = t.representations;
|
|
129
|
+
if (b !== void 0) {
|
|
130
|
+
const n = b.representation;
|
|
131
|
+
f(!Array.isArray(n)), t.representation = n, delete t.representations, s(n), f.strictEqual(n.repSource, void 0), f.strictEqual(n.offset, void 0), f.strictEqual(n.dateDispoRepresentation, void 0);
|
|
132
|
+
const l = n.statutRepresentation;
|
|
133
|
+
u(l, "canonique"), u(l, "enregistrement"), u(l, "officielle"), u(l, "transcription"), u(l, "verbatim");
|
|
134
|
+
}
|
|
135
|
+
return t.loiReference !== void 0 && s(t.loiReference), t.discussionCommune !== void 0 && s(t.discussionCommune), t.discussionIdentique !== void 0 && s(t.discussionIdentique), t;
|
|
136
|
+
}
|
|
137
|
+
function A(i, { rectificatif: t }) {
|
|
138
|
+
if (i !== void 0) {
|
|
139
|
+
const e = i.listeProgrammes, r = e === void 0 ? void 0 : Array.isArray(e) ? e : e.programme === void 0 ? void 0 : v(e.programme);
|
|
140
|
+
if (r !== void 0) {
|
|
141
|
+
i.listeProgrammes = r;
|
|
142
|
+
for (const a of r) {
|
|
143
|
+
s(a);
|
|
144
|
+
const o = a.lignesCredits;
|
|
145
|
+
if (o !== void 0) {
|
|
146
|
+
const c = Array.isArray(o) ? o : o.ligneCredit === void 0 ? void 0 : v(o.ligneCredit);
|
|
147
|
+
if (c === void 0)
|
|
148
|
+
delete a.lignesCredits;
|
|
149
|
+
else {
|
|
150
|
+
a.lignesCredits = c;
|
|
151
|
+
for (const d of c)
|
|
152
|
+
t ? y(d) : s(d);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
function y(i) {
|
|
160
|
+
s(i);
|
|
161
|
+
const t = i.lignesCredits;
|
|
162
|
+
if (t !== void 0) {
|
|
163
|
+
const e = Array.isArray(t) ? t : t.ligneCredit === void 0 ? void 0 : v(t.ligneCredit);
|
|
164
|
+
if (e === void 0)
|
|
165
|
+
delete i.lignesCredits;
|
|
166
|
+
else {
|
|
167
|
+
i.lignesCredits = e;
|
|
168
|
+
for (const r of e)
|
|
169
|
+
y(r);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
export {
|
|
174
|
+
u as a,
|
|
175
|
+
j as b,
|
|
176
|
+
s as c,
|
|
177
|
+
S as d
|
|
178
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function cleanActeLegislatif(
|
|
2
|
-
export declare function cleanActeOuDossierInitiateur(
|
|
1
|
+
export declare function cleanActeLegislatif(data: unknown): void;
|
|
2
|
+
export declare function cleanActeOuDossierInitiateur(data: unknown): void;
|
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
import { ActeurClean } from '../schemas/clean/acteurs_et_organes';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { RapporteurRaw } from '../schemas/raw/dossiers_legislatifs';
|
|
3
|
+
type RapporteurMutable = RapporteurRaw & {
|
|
4
|
+
etudePlfRef?: string;
|
|
5
|
+
};
|
|
6
|
+
export declare function cleanActeur(data: unknown): ActeurClean;
|
|
7
|
+
export declare function cleanRapporteur(rapporteur: RapporteurMutable): void;
|
|
8
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { AmendementClean } from '../schemas/clean/amendements.js';
|
|
2
|
-
export declare function cleanAmendement(
|
|
3
|
-
export declare function cleanTexteLegislatif(
|
|
2
|
+
export declare function cleanAmendement(data: unknown): AmendementClean;
|
|
3
|
+
export declare function cleanTexteLegislatif(data: unknown): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { DocumentClean } from '../schemas/clean/dossiers_legislatifs';
|
|
2
|
-
export declare function cleanDocumentOrDivision(
|
|
2
|
+
export declare function cleanDocumentOrDivision(data: unknown): DocumentClean;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { DossierParlementaireClean } from '../schemas/clean/dossiers_legislatifs';
|
|
2
|
-
export declare function cleanDossierParlementaire(
|
|
2
|
+
export declare function cleanDossierParlementaire(data: unknown): DossierParlementaireClean;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { OrganeClean } from '../schemas/clean/acteurs_et_organes';
|
|
2
|
-
export declare function cleanOrgane(
|
|
2
|
+
export declare function cleanOrgane(data: unknown): OrganeClean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReunionClean } from '../schemas/clean/agendas';
|
|
2
2
|
import { Point, Reunion } from '..';
|
|
3
|
-
export declare function cleanReunion(
|
|
3
|
+
export declare function cleanReunion(data: unknown): ReunionClean;
|
|
4
4
|
export declare function hasMissingOrNotFinalizedText(node: Point | undefined | null): boolean;
|
|
5
5
|
/**
|
|
6
6
|
* Remove compteRenduRef from reunion if the referenced compte rendu is missing or has missing/not finalized content,
|
|
@@ -1,3 +1,11 @@
|
|
|
1
1
|
import { ScrutinClean } from '../schemas/clean/scrutins';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
type DecompteVoixMutable = {
|
|
3
|
+
abstention?: unknown;
|
|
4
|
+
abstentions?: unknown;
|
|
5
|
+
nonVotant?: unknown;
|
|
6
|
+
nonVotants?: unknown;
|
|
7
|
+
[key: string]: unknown;
|
|
8
|
+
};
|
|
9
|
+
export declare function cleanDecompteVoix(decompteVoix: DecompteVoixMutable): void;
|
|
10
|
+
export declare function cleanScrutin(data: unknown): ScrutinClean;
|
|
11
|
+
export {};
|