@tricoteuses/assemblee 3.1.2 → 3.2.0
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 +21 -3
- package/lib/amendements-D3Jr9MQa.js +3715 -0
- package/lib/amendements-DaB_5WaI.js +152 -0
- package/lib/cleaners.js +594 -653
- package/lib/datasets.d.ts +1 -0
- package/lib/git.js +153 -127
- package/lib/index.d.ts +1 -1
- package/lib/index.js +555 -758
- package/lib/inserters.d.ts +4 -0
- package/lib/loaders-CY8EGNSM.js +1325 -0
- package/lib/loaders.js +2 -2145
- package/lib/parsers.js +8388 -10324
- package/lib/questions-CsNQoayp.js +1581 -0
- package/lib/schemas/clean/scrutins.d.ts +18 -0
- package/lib/schemas/enriched/scrutins.d.ts +8 -0
- package/lib/schemas/raw/scrutins.d.ts +25 -5
- package/package.json +7 -7
- package/lib/amendements-Blw6Aa6-.js +0 -4133
- package/lib/amendements-DiMsxlUL.js +0 -178
- package/lib/questions-XokaUGcy.js +0 -3037
package/lib/datasets.d.ts
CHANGED
|
@@ -34,6 +34,7 @@ export declare enum EnabledDatasets {
|
|
|
34
34
|
ComptesRendus = 128,
|
|
35
35
|
All = 255
|
|
36
36
|
}
|
|
37
|
+
export declare function getEnabledDatasetNames(): string[];
|
|
37
38
|
export declare function getDatasets(): string[];
|
|
38
39
|
export declare function validDataset(dir: string[]): boolean;
|
|
39
40
|
export declare function getSchemas(): string[];
|
package/lib/git.js
CHANGED
|
@@ -1,135 +1,161 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
env: process.env,
|
|
9
|
-
encoding: "utf-8",
|
|
10
|
-
stdio: ["ignore", "ignore", "pipe"]
|
|
11
|
-
}));
|
|
1
|
+
import e from "fs-extra";
|
|
2
|
+
import t from "node:path";
|
|
3
|
+
import { execFileSync as n } from "node:child_process";
|
|
4
|
+
//#region src/git.ts
|
|
5
|
+
var r = 50 * 1024 * 1024;
|
|
6
|
+
function i(e) {
|
|
7
|
+
return Array.isArray(e) ? e : e.trim().split(/\s+/).filter(Boolean);
|
|
12
8
|
}
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
try {
|
|
22
|
-
return i(`git commit -m "${n}" --quiet`, {
|
|
23
|
-
cwd: t,
|
|
24
|
-
env: process.env,
|
|
25
|
-
encoding: "utf-8",
|
|
26
|
-
stdio: ["ignore", "pipe", "pipe"]
|
|
27
|
-
}), !0;
|
|
28
|
-
} catch (o) {
|
|
29
|
-
const e = o;
|
|
30
|
-
if (e.stdout === null || !/nothing to commit|rien à valider/.test(String(e.stdout ?? "")))
|
|
31
|
-
throw console.error(e.output), o;
|
|
32
|
-
return !1;
|
|
33
|
-
}
|
|
9
|
+
function a(e, { cwd: t, encoding: r = "utf-8", maxBuffer: a, stdio: o }) {
|
|
10
|
+
return n("git", i(e), {
|
|
11
|
+
cwd: t,
|
|
12
|
+
env: process.env,
|
|
13
|
+
encoding: r,
|
|
14
|
+
maxBuffer: a,
|
|
15
|
+
stdio: o
|
|
16
|
+
});
|
|
34
17
|
}
|
|
35
|
-
function
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
stdio: ["ignore", "ignore", "pipe"]
|
|
45
|
-
});
|
|
46
|
-
} catch (r) {
|
|
47
|
-
const s = r;
|
|
48
|
-
console.error(s.output), e = s.status ?? 1;
|
|
49
|
-
}
|
|
50
|
-
else
|
|
51
|
-
e = 10;
|
|
52
|
-
return e;
|
|
18
|
+
function o(n) {
|
|
19
|
+
e.existsSync(t.join(n, ".git")) || (e.ensureDirSync(n), a(["init"], {
|
|
20
|
+
cwd: n,
|
|
21
|
+
stdio: [
|
|
22
|
+
"ignore",
|
|
23
|
+
"ignore",
|
|
24
|
+
"pipe"
|
|
25
|
+
]
|
|
26
|
+
}));
|
|
53
27
|
}
|
|
54
|
-
function
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
28
|
+
function s(e, t) {
|
|
29
|
+
o(e), a(["add", "."], {
|
|
30
|
+
cwd: e,
|
|
31
|
+
stdio: [
|
|
32
|
+
"ignore",
|
|
33
|
+
"ignore",
|
|
34
|
+
"pipe"
|
|
35
|
+
],
|
|
36
|
+
maxBuffer: r
|
|
37
|
+
});
|
|
38
|
+
try {
|
|
39
|
+
return a([
|
|
40
|
+
"commit",
|
|
41
|
+
"-m",
|
|
42
|
+
t,
|
|
43
|
+
"--quiet"
|
|
44
|
+
], {
|
|
45
|
+
cwd: e,
|
|
46
|
+
stdio: [
|
|
47
|
+
"ignore",
|
|
48
|
+
"pipe",
|
|
49
|
+
"pipe"
|
|
50
|
+
]
|
|
51
|
+
}), !0;
|
|
52
|
+
} catch (e) {
|
|
53
|
+
let t = e;
|
|
54
|
+
if (t.stdout === null || !/nothing to commit|rien à valider/.test(String(t.stdout ?? ""))) throw console.error(t.output), e;
|
|
55
|
+
return !1;
|
|
56
|
+
}
|
|
66
57
|
}
|
|
67
|
-
function
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
58
|
+
function c(e, t, n) {
|
|
59
|
+
let r = 0;
|
|
60
|
+
if (s(e, t)) for (let t of n || []) try {
|
|
61
|
+
a([
|
|
62
|
+
"push",
|
|
63
|
+
t,
|
|
64
|
+
"master"
|
|
65
|
+
], {
|
|
66
|
+
cwd: e,
|
|
67
|
+
stdio: [
|
|
68
|
+
"ignore",
|
|
69
|
+
"ignore",
|
|
70
|
+
"pipe"
|
|
71
|
+
]
|
|
72
|
+
});
|
|
73
|
+
} catch (e) {
|
|
74
|
+
let t = e;
|
|
75
|
+
console.error(t.output), r = t.status ?? 1;
|
|
76
|
+
}
|
|
77
|
+
else r = 10;
|
|
78
|
+
return r;
|
|
74
79
|
}
|
|
75
|
-
function
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
80
|
+
function l(e) {
|
|
81
|
+
return a([
|
|
82
|
+
"reset",
|
|
83
|
+
"--hard",
|
|
84
|
+
"origin/master"
|
|
85
|
+
], {
|
|
86
|
+
cwd: e,
|
|
87
|
+
stdio: [
|
|
88
|
+
"ignore",
|
|
89
|
+
"ignore",
|
|
90
|
+
"pipe"
|
|
91
|
+
]
|
|
92
|
+
}), a(["pull", "--rebase"], {
|
|
93
|
+
cwd: e,
|
|
94
|
+
stdio: [
|
|
95
|
+
"ignore",
|
|
96
|
+
"ignore",
|
|
97
|
+
"pipe"
|
|
98
|
+
]
|
|
99
|
+
}), !0;
|
|
89
100
|
}
|
|
90
|
-
function
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
} catch (e) {
|
|
100
|
-
if (e.status != 0) return !1;
|
|
101
|
-
throw e;
|
|
102
|
-
}
|
|
101
|
+
function u(e, t, n) {
|
|
102
|
+
e !== void 0 && a(["clone", `${e}/${t}.git`], {
|
|
103
|
+
cwd: n,
|
|
104
|
+
stdio: [
|
|
105
|
+
"ignore",
|
|
106
|
+
"ignore",
|
|
107
|
+
"pipe"
|
|
108
|
+
]
|
|
109
|
+
});
|
|
103
110
|
}
|
|
104
|
-
function
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
const l = u[0].charAt(0), p = u[1];
|
|
118
|
-
s.set(p, l);
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
return s;
|
|
122
|
-
} catch {
|
|
123
|
-
return console.error(`Error getting changed files since commit ${n}`), /* @__PURE__ */ new Map();
|
|
124
|
-
}
|
|
111
|
+
function d(e, t, n) {
|
|
112
|
+
try {
|
|
113
|
+
n && console.log(`git -C ${e} ${t}`);
|
|
114
|
+
let i = a(t, {
|
|
115
|
+
cwd: e,
|
|
116
|
+
maxBuffer: r
|
|
117
|
+
}).trim();
|
|
118
|
+
return n && console.log(i), i;
|
|
119
|
+
} catch (e) {
|
|
120
|
+
let t = e;
|
|
121
|
+
for (let e of ["stdout", "stderr"]) console.error(`${e}: ${String(t[e] ?? "")}`);
|
|
122
|
+
throw e;
|
|
123
|
+
}
|
|
125
124
|
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
125
|
+
function f(e, t, n) {
|
|
126
|
+
try {
|
|
127
|
+
n && console.log(`git -C ${e} ${t}`);
|
|
128
|
+
let i = a(t, {
|
|
129
|
+
cwd: e,
|
|
130
|
+
stdio: [
|
|
131
|
+
"ignore",
|
|
132
|
+
"pipe",
|
|
133
|
+
"pipe"
|
|
134
|
+
],
|
|
135
|
+
maxBuffer: r
|
|
136
|
+
}).trim();
|
|
137
|
+
return n && console.log(i), !0;
|
|
138
|
+
} catch (e) {
|
|
139
|
+
if (e.status != 0) return !1;
|
|
140
|
+
throw e;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
function p(e, t, n = {}) {
|
|
144
|
+
let { diffFilter: r } = n;
|
|
145
|
+
try {
|
|
146
|
+
let n = d(e, `diff --name-status --diff-filter=${r ?? "AMR"} ${t}`, !1), i = /* @__PURE__ */ new Map();
|
|
147
|
+
for (let e of n.split("\n")) {
|
|
148
|
+
if (e.trim().length === 0) continue;
|
|
149
|
+
let t = e.split(" ");
|
|
150
|
+
if (t.length >= 2) {
|
|
151
|
+
let e = t[0].charAt(0), n = t[1];
|
|
152
|
+
i.set(n, e);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
return i;
|
|
156
|
+
} catch {
|
|
157
|
+
return console.error(`Error getting changed files since commit ${t}`), /* @__PURE__ */ new Map();
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
//#endregion
|
|
161
|
+
export { u as clone, s as commit, c as commitAndPush, p as getChangedFilesSinceCommit, o as initRepo, l as resetAndPull, d as run, f as test };
|
package/lib/index.d.ts
CHANGED
|
@@ -21,4 +21,4 @@ export { type CompteRenduClean as CompteRendu, type ContenuClean as Contenu, typ
|
|
|
21
21
|
export { acteLegislatifXsiTypeOptions, documentXsiTypeOptions, dossierParlementaireXsiTypeOptions, type ActeLegislatifClean as ActeLegislatif, type ActeLegislatifXsiType as TypeActeLegislatif, type AmendementsCommissionElementClean as AmendementsCommission, type AmendementsSeanceClean as AmendementsSeance, type AuteurActeurClean as AuteurActeur, type AuteurClean as Auteur, type Cause, type ChronoClean as ChronoDocument, type ClassificationClean as Classification, type ContributionInternauteClean as ContributionInternaute, type CorrectionClean as Correction, type CoSignataireElementClean as CoSignataireElement, type CoSignataireOrganeClean as CoSignataireOrgane, type CycleDeVieClean as CycleDeVieDocument, type DepotAmendementsClean as DepotAmendements, type DivisionClean as Division, type DocumentClean as Document, type DocumentDenominationStructurelle, type DocumentXsiType as TypeDocument, type DossierParlementaireClean as DossierParlementaire, type DossierParlementaireXsiType, type EtudePlfClean as EtudePlf, type FamCodeEtLibelleClean as FamCodeEtLibelle, type FamilleClean as Famille, type FusionDossierClean as FusionDossier, type ImprimerieClean as Imprimerie, type IndexationClean as Indexation, type InfoJoceClean as InfoJoce, type InfoJoElementClean as InfoJo, type InitiateurActeurElementClean as InitiateurActeur, type InitiateurClean as Initiateur, type LibelleActeClean as LibelleActe, type MissionMinefiElementClean as MissionMinefi, type Motif, type NoticeClean as Notice, type ProcedureParlementaireClean as ProcedureParlementaire, type Provenance, type Qualite, type RapporteurClean as Rapporteur, type SousTypeClean as SousType, type StatutAdoption, type TexteAssocieElementClean as TexteAssocie, type TexteEuropeenClean as TexteEuropeen, type TexteExterneAssocieClean as TexteExterneAssocie, type TexteExterneAssocieTypeDoc, type ThemeClean as Theme, type ThemesClean as Themes, type TitreDossierClean as TitreDossier, type TitresClean as Titres, type TypeBudget, type TypeCorrection, type TypeJo, type TypeMission, type TypeTexte, } from './schemas/clean/dossiers_legislatifs.js';
|
|
22
22
|
export { type ContenuSubdivisionEnriched as ContenuSubdivision, type SubdivisionEnriched as Subdivision, } from './schemas/enriched/dossiers_legislatifs.js';
|
|
23
23
|
export { typeJoQuestionOptions, type AnalyseClean as Analyse, type AuteurQuestionClean as AuteurQuestion, type ClotureClean as Cloture, type GroupeClean as Groupe, type IdentifiantClean as Identifiant, type IdentiteAuteurQuestionClean as IdentiteAuteurQuestion, type IndexationAnClean as IndexationAn, type InfoJoQuestionClean as InfoJoQuestion, type MinAttribElementClean as MinAttribElement, type MinAttribsClean as MinAttribs, type QuestionClean as Question, type RenouvellementClean as Renouvellement, type RenouvellementCleans as Renouvellements, type SignalementClean as Signalement, type TexteQuestionClean as TexteQuestion, type TextesQuestionClean as TextesQuestion, type TextesReponseClean as TextesReponse, type TypeJoQuestion, } from './schemas/clean/questions.js';
|
|
24
|
-
export { type DecompteNominatifClean as DecompteNominatif, type DecompteVoixClean as DecompteVoix, type DemandeurClean as Demandeur, type DysfonctionnementClean as Dysfonctionnement, type MiseAuPointClean as MiseAuPoint, type ObjetVoteClean as ObjetVote, type ScrutinClean as Scrutin, type SortScrutinClean as SortScrutin, type SyntheseVoteClean as SyntheseVote, type TypeVoteClean as TypeVote, type VentilationVotesClean as VentilationVotes, type VentilationVotesGroupeClean as VentilationVotesGroupe, type VotantClean as Votant, type VoteClean as Vote, } from './schemas/clean/scrutins.js';
|
|
24
|
+
export { type DossierLegislatifObjetClean as DossierLegislatifObjet, type DecompteNominatifClean as DecompteNominatif, type DecompteVoixClean as DecompteVoix, type DemandeurClean as Demandeur, type DysfonctionnementClean as Dysfonctionnement, type MiseAuPointClean as MiseAuPoint, type ObjetVoteClean as ObjetVote, type ScrutinClean as Scrutin, type SortScrutinClean as SortScrutin, type SyntheseVoteClean as SyntheseVote, type TypeVoteClean as TypeVote, type VentilationVotesClean as VentilationVotes, type VentilationVotesGroupeClean as VentilationVotesGroupe, type VotantClean as Votant, type VoteClean as Vote, } from './schemas/clean/scrutins.js';
|