@tricoteuses/senat 2.22.12 → 2.22.13
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/config.d.ts +21 -0
- package/lib/config.js +27 -0
- package/lib/databases.d.ts +2 -0
- package/lib/databases.js +26 -0
- package/lib/datasets.d.ts +34 -0
- package/lib/datasets.js +233 -0
- package/lib/git.d.ts +26 -0
- package/lib/git.js +167 -0
- package/lib/index.d.ts +13 -0
- package/lib/index.js +1 -0
- package/lib/loaders.d.ts +58 -0
- package/lib/loaders.js +286 -0
- package/lib/model/agenda.d.ts +6 -0
- package/lib/model/agenda.js +148 -0
- package/lib/model/ameli.d.ts +51 -0
- package/lib/model/ameli.js +147 -0
- package/lib/model/commission.d.ts +18 -0
- package/lib/model/commission.js +269 -0
- package/lib/model/debats.d.ts +67 -0
- package/lib/model/debats.js +95 -0
- package/lib/model/documents.d.ts +12 -0
- package/lib/model/documents.js +138 -0
- package/lib/model/dosleg.d.ts +7 -0
- package/lib/model/dosleg.js +326 -0
- package/lib/model/index.d.ts +7 -0
- package/lib/model/index.js +7 -0
- package/lib/model/questions.d.ts +45 -0
- package/lib/model/questions.js +89 -0
- package/lib/model/scrutins.d.ts +13 -0
- package/lib/model/scrutins.js +114 -0
- package/lib/model/seance.d.ts +3 -0
- package/lib/model/seance.js +267 -0
- package/lib/model/sens.d.ts +146 -0
- package/lib/model/sens.js +454 -0
- package/lib/model/texte.d.ts +7 -0
- package/lib/model/texte.js +228 -0
- package/lib/model/util.d.ts +9 -0
- package/lib/model/util.js +38 -0
- package/lib/parsers/texte.d.ts +7 -0
- package/lib/parsers/texte.js +228 -0
- package/lib/raw_types/ameli.d.ts +914 -0
- package/lib/raw_types/ameli.js +5 -0
- package/lib/raw_types/debats.d.ts +207 -0
- package/lib/raw_types/debats.js +5 -0
- package/lib/raw_types/dosleg.d.ts +1619 -0
- package/lib/raw_types/dosleg.js +5 -0
- package/lib/raw_types/questions.d.ts +423 -0
- package/lib/raw_types/questions.js +5 -0
- package/lib/raw_types/senat.d.ts +11372 -0
- package/lib/raw_types/senat.js +5 -0
- package/lib/raw_types/sens.d.ts +8248 -0
- package/lib/raw_types/sens.js +5 -0
- package/lib/raw_types_schemats/ameli.d.ts +539 -0
- package/lib/raw_types_schemats/ameli.js +2 -0
- package/lib/raw_types_schemats/debats.d.ts +127 -0
- package/lib/raw_types_schemats/debats.js +2 -0
- package/lib/raw_types_schemats/dosleg.d.ts +977 -0
- package/lib/raw_types_schemats/dosleg.js +2 -0
- package/lib/raw_types_schemats/questions.d.ts +237 -0
- package/lib/raw_types_schemats/questions.js +2 -0
- package/lib/raw_types_schemats/sens.d.ts +6915 -0
- package/lib/raw_types_schemats/sens.js +2 -0
- package/lib/scripts/convert_data.d.ts +1 -0
- package/lib/scripts/convert_data.js +354 -0
- package/lib/scripts/data-download.d.ts +1 -0
- package/lib/scripts/data-download.js +12 -0
- package/lib/scripts/datautil.d.ts +8 -0
- package/lib/scripts/datautil.js +34 -0
- package/lib/scripts/parse_textes.d.ts +1 -0
- package/lib/scripts/parse_textes.js +44 -0
- package/lib/scripts/retrieve_agenda.d.ts +1 -0
- package/lib/scripts/retrieve_agenda.js +132 -0
- package/lib/scripts/retrieve_cr_commission.d.ts +1 -0
- package/lib/scripts/retrieve_cr_commission.js +364 -0
- package/lib/scripts/retrieve_cr_seance.d.ts +6 -0
- package/lib/scripts/retrieve_cr_seance.js +347 -0
- package/lib/scripts/retrieve_documents.d.ts +3 -0
- package/lib/scripts/retrieve_documents.js +219 -0
- package/lib/scripts/retrieve_open_data.d.ts +1 -0
- package/lib/scripts/retrieve_open_data.js +316 -0
- package/lib/scripts/retrieve_senateurs_photos.d.ts +1 -0
- package/lib/scripts/retrieve_senateurs_photos.js +147 -0
- package/lib/scripts/retrieve_videos.d.ts +1 -0
- package/lib/scripts/retrieve_videos.js +461 -0
- package/lib/scripts/shared/cli_helpers.d.ts +95 -0
- package/lib/scripts/shared/cli_helpers.js +91 -0
- package/lib/scripts/shared/util.d.ts +4 -0
- package/lib/scripts/shared/util.js +35 -0
- package/lib/scripts/test_iter_load.d.ts +1 -0
- package/lib/scripts/test_iter_load.js +12 -0
- package/lib/src/scripts/retrieve_cr_commission.js +12 -0
- package/lib/src/scripts/retrieve_cr_seance.js +12 -0
- package/lib/src/scripts/retrieve_videos.js +13 -1
- package/lib/src/utils/nvs-timecode.d.ts +17 -0
- package/lib/src/utils/nvs-timecode.js +79 -0
- package/lib/src/utils/weights_scoring_config.d.ts +2 -0
- package/lib/src/utils/weights_scoring_config.js +15 -0
- package/lib/strings.d.ts +1 -0
- package/lib/strings.js +18 -0
- package/lib/types/agenda.d.ts +44 -0
- package/lib/types/agenda.js +1 -0
- package/lib/types/ameli.d.ts +5 -0
- package/lib/types/ameli.js +1 -0
- package/lib/types/compte_rendu.d.ts +83 -0
- package/lib/types/compte_rendu.js +1 -0
- package/lib/types/debats.d.ts +2 -0
- package/lib/types/debats.js +1 -0
- package/lib/types/dosleg.d.ts +70 -0
- package/lib/types/dosleg.js +1 -0
- package/lib/types/questions.d.ts +2 -0
- package/lib/types/questions.js +1 -0
- package/lib/types/sens.d.ts +10 -0
- package/lib/types/sens.js +1 -0
- package/lib/types/sessions.d.ts +5 -0
- package/lib/types/sessions.js +84 -0
- package/lib/types/texte.d.ts +74 -0
- package/lib/types/texte.js +16 -0
- package/lib/utils/cr_spliting.d.ts +28 -0
- package/lib/utils/cr_spliting.js +265 -0
- package/lib/utils/date.d.ts +10 -0
- package/lib/utils/date.js +100 -0
- package/lib/utils/nvs-timecode.d.ts +7 -0
- package/lib/utils/nvs-timecode.js +79 -0
- package/lib/utils/reunion_grouping.d.ts +11 -0
- package/lib/utils/reunion_grouping.js +337 -0
- package/lib/utils/reunion_odj_building.d.ts +5 -0
- package/lib/utils/reunion_odj_building.js +154 -0
- package/lib/utils/reunion_parsing.d.ts +23 -0
- package/lib/utils/reunion_parsing.js +209 -0
- package/lib/utils/scoring.d.ts +14 -0
- package/lib/utils/scoring.js +147 -0
- package/lib/utils/string_cleaning.d.ts +7 -0
- package/lib/utils/string_cleaning.js +57 -0
- package/lib/validators/config.d.ts +9 -0
- package/lib/validators/config.js +10 -0
- package/package.json +1 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { iterLoadSenatRapports, } from "../loaders";
|
|
2
|
+
import commandLineArgs from "command-line-args";
|
|
3
|
+
import { dataDirDefaultOption } from "./shared/cli_helpers";
|
|
4
|
+
const optionsDefinitions = [dataDirDefaultOption];
|
|
5
|
+
const options = commandLineArgs(optionsDefinitions);
|
|
6
|
+
const session = 2024;
|
|
7
|
+
const sinceCommit = undefined;
|
|
8
|
+
for (const { item: rapport } of iterLoadSenatRapports(options["dataDir"], session, {
|
|
9
|
+
sinceCommit: sinceCommit,
|
|
10
|
+
})) {
|
|
11
|
+
console.log(rapport);
|
|
12
|
+
}
|
|
@@ -11,6 +11,7 @@ import { sessionStartYearFromDate } from "../model/seance";
|
|
|
11
11
|
import { getSessionsFromStart } from "../types/sessions";
|
|
12
12
|
import { ensureAndClearDir, fetchWithRetry } from "./shared/util";
|
|
13
13
|
import { jaccard, jaccardTokenSim } from "../utils/scoring";
|
|
14
|
+
import * as git from "../git.js";
|
|
14
15
|
class CommissionCRDownloadError extends Error {
|
|
15
16
|
constructor(message, url) {
|
|
16
17
|
super(`An error occurred while retrieving Commission CR ${url}: ${message}`);
|
|
@@ -104,6 +105,15 @@ async function discoverCommissionWeeklyPages(fromSession) {
|
|
|
104
105
|
}
|
|
105
106
|
return results.sort((a, b) => a.yyyymmdd.localeCompare(b.yyyymmdd));
|
|
106
107
|
}
|
|
108
|
+
function commitAndPushGit(datasetDir, options) {
|
|
109
|
+
let exitCode = 10; // 0: some data changed, 10: no modification
|
|
110
|
+
if (options.commit) {
|
|
111
|
+
const errorCode = git.commitAndPush(datasetDir, "Nouvelle moisson", options.remote);
|
|
112
|
+
if ((exitCode === 10 && errorCode !== 10) || (exitCode === 0 && errorCode !== 0 && errorCode !== 10)) {
|
|
113
|
+
exitCode = errorCode;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
107
117
|
function toHourShort(hhmm) {
|
|
108
118
|
if (!hhmm)
|
|
109
119
|
return null;
|
|
@@ -348,6 +358,8 @@ async function retrieveCommissionCRs(options = {}) {
|
|
|
348
358
|
}
|
|
349
359
|
}
|
|
350
360
|
}
|
|
361
|
+
const debatsDir = path.join(dataDir, COMMISSION_FOLDER, DATA_TRANSFORMED_FOLDER);
|
|
362
|
+
commitAndPushGit(debatsDir, options);
|
|
351
363
|
}
|
|
352
364
|
async function main() {
|
|
353
365
|
const dataDir = options["dataDir"];
|
|
@@ -17,6 +17,7 @@ import { getSessionsFromStart } from "../types/sessions";
|
|
|
17
17
|
import { ensureAndClearDir, fetchWithRetry } from "./shared/util";
|
|
18
18
|
import { isNoiseBlock, scoreSommaireBlockForEvent } from "../utils/scoring";
|
|
19
19
|
import { parseYYYYMMDD } from "../utils/date";
|
|
20
|
+
import * as git from "../git.js";
|
|
20
21
|
const optionsDefinitions = [
|
|
21
22
|
...commonOptions,
|
|
22
23
|
{
|
|
@@ -204,6 +205,17 @@ export async function retrieveCriXmlDump(dataDir, options = {}) {
|
|
|
204
205
|
}
|
|
205
206
|
}
|
|
206
207
|
}
|
|
208
|
+
const debatsDir = path.join(dataDir, COMPTES_RENDUS_FOLDER, DATA_TRANSFORMED_FOLDER);
|
|
209
|
+
commitAndPushGit(debatsDir, options);
|
|
210
|
+
}
|
|
211
|
+
function commitAndPushGit(datasetDir, options) {
|
|
212
|
+
let exitCode = 10; // 0: some data changed, 10: no modification
|
|
213
|
+
if (options.commit) {
|
|
214
|
+
const errorCode = git.commitAndPush(datasetDir, "Nouvelle moisson", options.remote);
|
|
215
|
+
if ((exitCode === 10 && errorCode !== 10) || (exitCode === 0 && errorCode !== 0 && errorCode !== 10)) {
|
|
216
|
+
exitCode = errorCode;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
207
219
|
}
|
|
208
220
|
async function linkCriEventIntoAgenda(dataDir, yyyymmdd, agendaEventId, crUid, cr, session) {
|
|
209
221
|
const agendadDir = path.join(dataDir, AGENDA_FOLDER, DATA_TRANSFORMED_FOLDER, session.toString());
|
|
@@ -4,7 +4,8 @@ import commandLineArgs from "command-line-args";
|
|
|
4
4
|
import fs from "fs-extra";
|
|
5
5
|
import fsp from "fs/promises";
|
|
6
6
|
import path from "path";
|
|
7
|
-
import
|
|
7
|
+
import * as git from "../git.js";
|
|
8
|
+
import { AGENDA_FOLDER, DATA_TRANSFORMED_FOLDER, iterLoadSenatAgendas } from "../loaders";
|
|
8
9
|
import { getSessionsFromStart } from "../types/sessions";
|
|
9
10
|
import { commonOptions } from "./shared/cli_helpers";
|
|
10
11
|
import { getAgendaSegmentTimecodes, buildSenatVodMasterM3u8FromNvs } from "../utils/nvs-parsing";
|
|
@@ -168,6 +169,17 @@ async function processAll(dataDir, sessions) {
|
|
|
168
169
|
}
|
|
169
170
|
}
|
|
170
171
|
}
|
|
172
|
+
const debatsDir = path.join(dataDir, AGENDA_FOLDER, DATA_TRANSFORMED_FOLDER);
|
|
173
|
+
commitAndPushGit(debatsDir, options);
|
|
174
|
+
}
|
|
175
|
+
function commitAndPushGit(datasetDir, options) {
|
|
176
|
+
let exitCode = 10; // 0: some data changed, 10: no modification
|
|
177
|
+
if (options.commit) {
|
|
178
|
+
const errorCode = git.commitAndPush(datasetDir, "Nouvelle moisson", options.remote);
|
|
179
|
+
if ((exitCode === 10 && errorCode !== 10) || (exitCode === 0 && errorCode !== 0 && errorCode !== 10)) {
|
|
180
|
+
exitCode = errorCode;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
171
183
|
}
|
|
172
184
|
async function main() {
|
|
173
185
|
const dataDir = options["dataDir"];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type L1Chapter = {
|
|
2
|
+
id: string;
|
|
3
|
+
label: string;
|
|
4
|
+
index: number;
|
|
5
|
+
};
|
|
6
|
+
export declare function getLevel1Chapters(dataNvs: string): L1Chapter[];
|
|
7
|
+
export declare function pickBestLevel1ChapterForAgenda(chapters: L1Chapter[], agendaTitle: string): {
|
|
8
|
+
chapter: L1Chapter;
|
|
9
|
+
score: number;
|
|
10
|
+
} | null;
|
|
11
|
+
export declare function getAgendaSegmentTimecodes(dataNvs: string, finalPlayerNvs: string, agendaTitleOrObjet: string): {
|
|
12
|
+
start: number;
|
|
13
|
+
end: number | null;
|
|
14
|
+
chapterId: string;
|
|
15
|
+
nextChapterId: string | null;
|
|
16
|
+
score: number;
|
|
17
|
+
} | null;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { XMLParser } from "fast-xml-parser";
|
|
2
|
+
import { dice, normalize } from "./scoring";
|
|
3
|
+
import { decodeHtmlEntities } from "./string_cleaning";
|
|
4
|
+
const CHAPTER_MATCH_THRESHOLD = 0.5;
|
|
5
|
+
const xmlParser = new XMLParser({
|
|
6
|
+
ignoreAttributes: false,
|
|
7
|
+
attributeNamePrefix: "@_",
|
|
8
|
+
});
|
|
9
|
+
function getTimecodeForChapterId(finalPlayerNvs, chapterId) {
|
|
10
|
+
const xml = xmlParser.parse(finalPlayerNvs);
|
|
11
|
+
const synchros = xml?.player?.synchro;
|
|
12
|
+
if (!synchros)
|
|
13
|
+
return null;
|
|
14
|
+
const synchsArray = Array.isArray(synchros) ? synchros : [synchros];
|
|
15
|
+
const match = synchsArray.find((s) => String(s["@_id"]) === String(chapterId));
|
|
16
|
+
if (!match)
|
|
17
|
+
return null;
|
|
18
|
+
const rawTimecode = match["@_timecode"];
|
|
19
|
+
if (rawTimecode == null)
|
|
20
|
+
return null;
|
|
21
|
+
const ms = Number(rawTimecode);
|
|
22
|
+
if (Number.isNaN(ms))
|
|
23
|
+
return null;
|
|
24
|
+
return Math.floor(ms / 1000);
|
|
25
|
+
}
|
|
26
|
+
function toArray(v) {
|
|
27
|
+
if (!v)
|
|
28
|
+
return [];
|
|
29
|
+
return Array.isArray(v) ? v : [v];
|
|
30
|
+
}
|
|
31
|
+
export function getLevel1Chapters(dataNvs) {
|
|
32
|
+
const xml = xmlParser.parse(dataNvs);
|
|
33
|
+
const root = xml?.data?.chapters?.chapter ?? xml?.chapters?.chapter;
|
|
34
|
+
const roots = toArray(root);
|
|
35
|
+
return roots
|
|
36
|
+
.map((ch, i) => {
|
|
37
|
+
const id = ch?.id ?? ch?.["@_id"];
|
|
38
|
+
const labelRaw = ch?.label ?? ch?.["@_label"] ?? "";
|
|
39
|
+
return {
|
|
40
|
+
id: String(id),
|
|
41
|
+
label: decodeHtmlEntities(String(labelRaw)).trim(),
|
|
42
|
+
index: i,
|
|
43
|
+
};
|
|
44
|
+
})
|
|
45
|
+
.filter((c) => c.id && c.label);
|
|
46
|
+
}
|
|
47
|
+
export function pickBestLevel1ChapterForAgenda(chapters, agendaTitle) {
|
|
48
|
+
const q = normalize(agendaTitle);
|
|
49
|
+
let best = null;
|
|
50
|
+
for (const ch of chapters) {
|
|
51
|
+
const s = dice(q, ch.label);
|
|
52
|
+
if (!best || s > best.score)
|
|
53
|
+
best = { chapter: ch, score: s };
|
|
54
|
+
}
|
|
55
|
+
if (!best || best.score < CHAPTER_MATCH_THRESHOLD)
|
|
56
|
+
return { chapter: chapters[0], score: 0 };
|
|
57
|
+
return best;
|
|
58
|
+
}
|
|
59
|
+
export function getAgendaSegmentTimecodes(dataNvs, finalPlayerNvs, agendaTitleOrObjet) {
|
|
60
|
+
const l1 = getLevel1Chapters(dataNvs);
|
|
61
|
+
if (!l1.length)
|
|
62
|
+
return null;
|
|
63
|
+
const best = pickBestLevel1ChapterForAgenda(l1, agendaTitleOrObjet);
|
|
64
|
+
if (!best)
|
|
65
|
+
return null;
|
|
66
|
+
const chapter = best.chapter;
|
|
67
|
+
const next = l1[chapter.index + 1] ?? null;
|
|
68
|
+
const start = getTimecodeForChapterId(finalPlayerNvs, chapter.id);
|
|
69
|
+
if (start == null)
|
|
70
|
+
return null;
|
|
71
|
+
const end = next ? getTimecodeForChapterId(finalPlayerNvs, next.id) : null;
|
|
72
|
+
return {
|
|
73
|
+
start,
|
|
74
|
+
end,
|
|
75
|
+
chapterId: chapter.id,
|
|
76
|
+
nextChapterId: next?.id ?? null,
|
|
77
|
+
score: best.score,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// BASED ON TESTS RESULTS
|
|
2
|
+
// these weights yield good results in the benchmark test suite
|
|
3
|
+
// aiming at 0 WRONG matches while maximizing HITs
|
|
4
|
+
export const weights = {
|
|
5
|
+
wTitle: 0.7,
|
|
6
|
+
wOrg: 0.1,
|
|
7
|
+
wSalle: 0,
|
|
8
|
+
wTime: 0.2,
|
|
9
|
+
sameOrgBonus: 0.2,
|
|
10
|
+
minAccept: 0.5,
|
|
11
|
+
margin: 0.1,
|
|
12
|
+
titleMin: 0.2,
|
|
13
|
+
titleDominance: 0,
|
|
14
|
+
orgUncertainPenalty: 0.8,
|
|
15
|
+
};
|
package/lib/strings.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function slugify(string: string, replacement?: string): string;
|
package/lib/strings.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import originalSlugify from "slug";
|
|
2
|
+
const slugifyCharmap = {
|
|
3
|
+
...originalSlugify.defaults.charmap,
|
|
4
|
+
"'": " ",
|
|
5
|
+
"@": " ",
|
|
6
|
+
".": " ",
|
|
7
|
+
"-": "_",
|
|
8
|
+
};
|
|
9
|
+
export function slugify(string, replacement) {
|
|
10
|
+
const options = {
|
|
11
|
+
charmap: slugifyCharmap,
|
|
12
|
+
mode: "rfc3986",
|
|
13
|
+
};
|
|
14
|
+
if (replacement) {
|
|
15
|
+
options.replacement = replacement;
|
|
16
|
+
}
|
|
17
|
+
return originalSlugify(string, options);
|
|
18
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export interface AgendaEvent {
|
|
2
|
+
id: string;
|
|
3
|
+
type: string | null;
|
|
4
|
+
date: string;
|
|
5
|
+
startTime: string | null;
|
|
6
|
+
endTime: string | null;
|
|
7
|
+
timeOriginal: string | null;
|
|
8
|
+
titre: string;
|
|
9
|
+
organe: string | null;
|
|
10
|
+
objet: string | null;
|
|
11
|
+
lieu: string | null;
|
|
12
|
+
captationVideo: boolean;
|
|
13
|
+
urlDossierSenat: string | null;
|
|
14
|
+
quantieme: string | null;
|
|
15
|
+
}
|
|
16
|
+
export type TimeSlot = "MATIN" | "APRES-MIDI" | "SOIR" | "UNKNOWN";
|
|
17
|
+
export interface Reunion {
|
|
18
|
+
uid: string;
|
|
19
|
+
chambre: "SN";
|
|
20
|
+
date: string;
|
|
21
|
+
startTime: string | null;
|
|
22
|
+
endTime: string | null;
|
|
23
|
+
captationVideo: boolean;
|
|
24
|
+
titre: string;
|
|
25
|
+
type: string;
|
|
26
|
+
organe?: string;
|
|
27
|
+
objet?: string;
|
|
28
|
+
lieu?: string;
|
|
29
|
+
events: AgendaEvent[];
|
|
30
|
+
compteRenduRefUid?: string;
|
|
31
|
+
transcriptionRef?: string;
|
|
32
|
+
urlVideo?: string;
|
|
33
|
+
timecodeDebutVideo?: number;
|
|
34
|
+
timecodeFinVideo?: number;
|
|
35
|
+
odj?: ReunionOdj;
|
|
36
|
+
}
|
|
37
|
+
export interface ReunionOdjPoint {
|
|
38
|
+
objet: string | null;
|
|
39
|
+
dossierLegislatifRef: string | null;
|
|
40
|
+
codeEtape: string | null;
|
|
41
|
+
}
|
|
42
|
+
export interface ReunionOdj {
|
|
43
|
+
pointsOdj: ReunionOdjPoint[];
|
|
44
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
export interface CompteRendu {
|
|
2
|
+
uid: string;
|
|
3
|
+
seanceRef: string;
|
|
4
|
+
sessionRef: string;
|
|
5
|
+
metadonnees: Metadonnees;
|
|
6
|
+
contenu: Contenu;
|
|
7
|
+
}
|
|
8
|
+
export interface Metadonnees {
|
|
9
|
+
dateSeance: string;
|
|
10
|
+
dateSeanceJour: string;
|
|
11
|
+
numSeanceJour: string;
|
|
12
|
+
numSeance: string;
|
|
13
|
+
typeAssemblee: "AN" | "SN";
|
|
14
|
+
legislature: string;
|
|
15
|
+
session: string;
|
|
16
|
+
nomFichierJo: string;
|
|
17
|
+
validite: string;
|
|
18
|
+
etat: string;
|
|
19
|
+
diffusion: string;
|
|
20
|
+
version: string;
|
|
21
|
+
environnement: string;
|
|
22
|
+
heureGeneration: Date;
|
|
23
|
+
sommaire?: Sommaire;
|
|
24
|
+
}
|
|
25
|
+
export interface Contenu {
|
|
26
|
+
quantiemes: Quantiemes;
|
|
27
|
+
ouvertureSeance?: Point[] | Point;
|
|
28
|
+
point: Point[] | Point;
|
|
29
|
+
finSeance?: FinSeance;
|
|
30
|
+
paragraphe?: Point[];
|
|
31
|
+
}
|
|
32
|
+
export interface FinSeance {
|
|
33
|
+
point: Point;
|
|
34
|
+
}
|
|
35
|
+
export interface Quantiemes {
|
|
36
|
+
journee: string;
|
|
37
|
+
session: string;
|
|
38
|
+
}
|
|
39
|
+
export interface Point {
|
|
40
|
+
ordre_absolu_seance: string;
|
|
41
|
+
code_grammaire: string;
|
|
42
|
+
roledebat?: string;
|
|
43
|
+
orateurs?: {
|
|
44
|
+
orateur: {
|
|
45
|
+
nom: string;
|
|
46
|
+
id: string;
|
|
47
|
+
qualite: string;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
texte: {
|
|
51
|
+
_: string;
|
|
52
|
+
};
|
|
53
|
+
code_style?: string;
|
|
54
|
+
}
|
|
55
|
+
export interface Texte {
|
|
56
|
+
_?: string;
|
|
57
|
+
id_syceron?: string;
|
|
58
|
+
stime?: string;
|
|
59
|
+
sup?: string;
|
|
60
|
+
lienAdt?: Texte[] | Texte;
|
|
61
|
+
}
|
|
62
|
+
export interface Sommaire {
|
|
63
|
+
presidentSeance: Texte;
|
|
64
|
+
sommaire1: SommaireElement[] | SommaireElement;
|
|
65
|
+
sommaire3?: SommaireElement[] | SommaireElement;
|
|
66
|
+
sommaire2?: SommaireElement[] | SommaireElement;
|
|
67
|
+
para?: Texte[] | Texte;
|
|
68
|
+
}
|
|
69
|
+
export interface SommaireElement {
|
|
70
|
+
valeur_pts_odj: string | undefined;
|
|
71
|
+
titreStruct: TitreStruct;
|
|
72
|
+
para?: Array<Texte | string> | Texte;
|
|
73
|
+
sommaire2?: SommaireElement[] | SommaireElement;
|
|
74
|
+
sommaire3?: SommaireElement[] | SommaireElement;
|
|
75
|
+
presidentSeance?: Texte[] | Texte;
|
|
76
|
+
type_debat?: string;
|
|
77
|
+
}
|
|
78
|
+
export interface TitreStruct {
|
|
79
|
+
id_syceron: string;
|
|
80
|
+
intitule?: string;
|
|
81
|
+
sousIntitule?: string;
|
|
82
|
+
type_debat?: string;
|
|
83
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { txt_ameliFields } from "../raw_types_schemats/ameli";
|
|
2
|
+
import { ass as Ass, aud, audFields, auteur, date_seance, date_seanceFields as dateSeanceFields, deccoc as DecCoc, denrap as DenRap, docatt, docattFields, ecr, ecrFields, etaloi as EtaLoi, lecass, lecassFields, lecassrap, lecture, lectureFields, loi, org as Org, oritxt as OriTxt, qua as Qua, rap, raporg as RapOrg, raporgFields, scr as Scr, texte, texteFields, typatt as TypAtt, typlec as TypLec, typloi as TypLoi, typtxt as TypTxt, typurl as TypUrl, typurlFields } from "../raw_types_schemats/dosleg";
|
|
3
|
+
import { Debat } from "./debats";
|
|
4
|
+
import { TxtAmeli } from "./ameli";
|
|
5
|
+
export type { Ass, DecCoc, DenRap, EtaLoi, Org, OriTxt, Qua, RapOrg, Scr, TypAtt, TypLec, TypLoi, TypTxt, TypUrl };
|
|
6
|
+
export interface Aud extends aud {
|
|
7
|
+
org?: Org;
|
|
8
|
+
}
|
|
9
|
+
export interface Auteur extends auteur {
|
|
10
|
+
qua?: Qua;
|
|
11
|
+
}
|
|
12
|
+
export interface DateSeance extends date_seance {
|
|
13
|
+
debat?: Debat;
|
|
14
|
+
scrids?: string[];
|
|
15
|
+
scrs?: Scr[];
|
|
16
|
+
}
|
|
17
|
+
export interface DocAtt extends docatt {
|
|
18
|
+
rap?: Rap;
|
|
19
|
+
typatt?: TypAtt;
|
|
20
|
+
}
|
|
21
|
+
export interface Ecr extends ecr {
|
|
22
|
+
aut?: Auteur;
|
|
23
|
+
}
|
|
24
|
+
export interface LecAss extends lecass {
|
|
25
|
+
ass?: Ass;
|
|
26
|
+
auds?: Aud[];
|
|
27
|
+
audcles?: audFields.audcle[];
|
|
28
|
+
datesSeances?: DateSeance[];
|
|
29
|
+
datesSeancesCodes?: dateSeanceFields.code[];
|
|
30
|
+
debatdatseas: Date[];
|
|
31
|
+
lecassraps?: LecAssRap[];
|
|
32
|
+
lecassrapids?: string[];
|
|
33
|
+
org?: Org;
|
|
34
|
+
texcods: texteFields.texcod[];
|
|
35
|
+
textes?: Texte[];
|
|
36
|
+
}
|
|
37
|
+
export interface LecAssRap extends lecassrap {
|
|
38
|
+
rap?: Rap;
|
|
39
|
+
}
|
|
40
|
+
export interface Lecture extends lecture {
|
|
41
|
+
typlec?: TypLec;
|
|
42
|
+
lecassidts?: lecassFields.lecassidt[];
|
|
43
|
+
lecasss?: LecAss[];
|
|
44
|
+
}
|
|
45
|
+
export interface Loi extends loi {
|
|
46
|
+
deccoc?: DecCoc;
|
|
47
|
+
etaloi?: EtaLoi;
|
|
48
|
+
lecidts?: lectureFields.lecidt[];
|
|
49
|
+
lectures?: Lecture[];
|
|
50
|
+
typloi?: TypLoi;
|
|
51
|
+
}
|
|
52
|
+
export interface Rap extends rap {
|
|
53
|
+
denrap?: DenRap;
|
|
54
|
+
docattcles?: docattFields.docattcle[];
|
|
55
|
+
docatts?: DocAtt[];
|
|
56
|
+
ecrnums?: ecrFields.ecrnum[];
|
|
57
|
+
ecrs?: Ecr[];
|
|
58
|
+
orgcods?: raporgFields.orgcod[];
|
|
59
|
+
orgs?: Org[];
|
|
60
|
+
}
|
|
61
|
+
export interface Texte extends texte {
|
|
62
|
+
ecrs?: Ecr[];
|
|
63
|
+
ecrnums?: ecrFields.ecrnum[];
|
|
64
|
+
libtypurl?: typurlFields.libtypurl;
|
|
65
|
+
org?: Org;
|
|
66
|
+
oritxt: OriTxt;
|
|
67
|
+
typtxt?: TypTxt;
|
|
68
|
+
txtAmeli?: TxtAmeli;
|
|
69
|
+
txtAmeliId: txt_ameliFields.id;
|
|
70
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const UNDEFINED_SESSION = 0;
|
|
2
|
+
declare const sessions: readonly [0, 1958, 1959, 1960, 1961, 1962, 1963, 1964, 1965, 1966, 1967, 1968, 1969, 1970, 1971, 1972, 1973, 1974, 1975, 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024, 2025, 2026];
|
|
3
|
+
export type Session = (typeof sessions)[number];
|
|
4
|
+
export declare function getSessionsFromStart(startSession: Session): (0 | 1958 | 1959 | 1960 | 1961 | 1962 | 1963 | 1964 | 1965 | 1966 | 1967 | 1968 | 1969 | 1970 | 1971 | 1972 | 1973 | 1974 | 1975 | 1976 | 1977 | 1978 | 1979 | 1980 | 1981 | 1982 | 1983 | 1984 | 1985 | 1986 | 1987 | 1988 | 1989 | 1990 | 1991 | 1992 | 1993 | 1994 | 1995 | 1996 | 1997 | 1998 | 1999 | 2000 | 2001 | 2002 | 2003 | 2004 | 2005 | 2006 | 2007 | 2008 | 2009 | 2010 | 2011 | 2012 | 2013 | 2014 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 2023 | 2024 | 2025 | 2026)[];
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
export const UNDEFINED_SESSION = 0;
|
|
2
|
+
const sessions = [
|
|
3
|
+
UNDEFINED_SESSION,
|
|
4
|
+
1958,
|
|
5
|
+
1959,
|
|
6
|
+
1960,
|
|
7
|
+
1961,
|
|
8
|
+
1962,
|
|
9
|
+
1963,
|
|
10
|
+
1964,
|
|
11
|
+
1965,
|
|
12
|
+
1966,
|
|
13
|
+
1967,
|
|
14
|
+
1968,
|
|
15
|
+
1969,
|
|
16
|
+
1970,
|
|
17
|
+
1971,
|
|
18
|
+
1972,
|
|
19
|
+
1973,
|
|
20
|
+
1974,
|
|
21
|
+
1975,
|
|
22
|
+
1976,
|
|
23
|
+
1977,
|
|
24
|
+
1978,
|
|
25
|
+
1979,
|
|
26
|
+
1980,
|
|
27
|
+
1981,
|
|
28
|
+
1982,
|
|
29
|
+
1983,
|
|
30
|
+
1984,
|
|
31
|
+
1985,
|
|
32
|
+
1986,
|
|
33
|
+
1987,
|
|
34
|
+
1988,
|
|
35
|
+
1989,
|
|
36
|
+
1990,
|
|
37
|
+
1991,
|
|
38
|
+
1992,
|
|
39
|
+
1993,
|
|
40
|
+
1994,
|
|
41
|
+
1995,
|
|
42
|
+
1996,
|
|
43
|
+
1997,
|
|
44
|
+
1998,
|
|
45
|
+
1999,
|
|
46
|
+
2000,
|
|
47
|
+
2001,
|
|
48
|
+
2002,
|
|
49
|
+
2003,
|
|
50
|
+
2004,
|
|
51
|
+
2005,
|
|
52
|
+
2006,
|
|
53
|
+
2007,
|
|
54
|
+
2008,
|
|
55
|
+
2009,
|
|
56
|
+
2010,
|
|
57
|
+
2011,
|
|
58
|
+
2012,
|
|
59
|
+
2013,
|
|
60
|
+
2014,
|
|
61
|
+
2015,
|
|
62
|
+
2016,
|
|
63
|
+
2017,
|
|
64
|
+
2018,
|
|
65
|
+
2019,
|
|
66
|
+
2020,
|
|
67
|
+
2021,
|
|
68
|
+
2022,
|
|
69
|
+
2023,
|
|
70
|
+
2024,
|
|
71
|
+
2025,
|
|
72
|
+
2026,
|
|
73
|
+
// TO COMPLETE EVERY YEAR :)
|
|
74
|
+
];
|
|
75
|
+
export function getSessionsFromStart(startSession) {
|
|
76
|
+
if (startSession === 0) {
|
|
77
|
+
return Array.from(sessions);
|
|
78
|
+
}
|
|
79
|
+
const sessionIndex = sessions.findIndex((session) => startSession === session);
|
|
80
|
+
if (sessionIndex >= 0) {
|
|
81
|
+
return sessions.slice(sessionIndex);
|
|
82
|
+
}
|
|
83
|
+
return [];
|
|
84
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
export declare enum DivisionType {
|
|
2
|
+
tome = 1,
|
|
3
|
+
part = 2,
|
|
4
|
+
book = 3,
|
|
5
|
+
title = 4,
|
|
6
|
+
subtitle = 5,
|
|
7
|
+
chapter = 6,
|
|
8
|
+
section = 7,
|
|
9
|
+
subsection = 8,
|
|
10
|
+
paragraph = 9,
|
|
11
|
+
article = 10,
|
|
12
|
+
alinea = 11,
|
|
13
|
+
division = 12
|
|
14
|
+
}
|
|
15
|
+
export type DivisionTag = keyof typeof DivisionType;
|
|
16
|
+
export interface DocumentMetadata {
|
|
17
|
+
name: string;
|
|
18
|
+
session: number | null | undefined;
|
|
19
|
+
date?: string | null;
|
|
20
|
+
url_expose_des_motifs?: URL;
|
|
21
|
+
url_xml?: URL;
|
|
22
|
+
url_html: URL;
|
|
23
|
+
url_pdf: URL;
|
|
24
|
+
}
|
|
25
|
+
export interface FlatTexte {
|
|
26
|
+
titre: string | null;
|
|
27
|
+
titreCourt: string | null;
|
|
28
|
+
signetDossier: string | null;
|
|
29
|
+
urlDossierSenat: string | null;
|
|
30
|
+
urlDossierAssemblee: string | null;
|
|
31
|
+
type: string | null;
|
|
32
|
+
session: string | null;
|
|
33
|
+
numero: number | null;
|
|
34
|
+
datePresentation: Date | null;
|
|
35
|
+
dateDepot: Date | null;
|
|
36
|
+
datePublicationXml: Date | null;
|
|
37
|
+
version: Version | null;
|
|
38
|
+
workflow: Step[];
|
|
39
|
+
divisions: Division[];
|
|
40
|
+
exposeDesMotifs?: ExposeDesMotifs | null;
|
|
41
|
+
}
|
|
42
|
+
export type Version = "RECT" | "RECT_BIS" | "RECT_TER" | "RECT_QUATER" | "RECT_QUINQUIES";
|
|
43
|
+
export interface Step {
|
|
44
|
+
eId: string;
|
|
45
|
+
date: Date | null;
|
|
46
|
+
type: string | null;
|
|
47
|
+
session: string | null;
|
|
48
|
+
numero: string | null;
|
|
49
|
+
version: Version | null;
|
|
50
|
+
outcome: string | null;
|
|
51
|
+
}
|
|
52
|
+
export interface Division {
|
|
53
|
+
index: number;
|
|
54
|
+
eId: string;
|
|
55
|
+
tag: DivisionTag;
|
|
56
|
+
level: number;
|
|
57
|
+
headings: DivisionContent[];
|
|
58
|
+
}
|
|
59
|
+
export interface Article extends Division {
|
|
60
|
+
alineas: Alinea[];
|
|
61
|
+
}
|
|
62
|
+
export interface DivisionContent {
|
|
63
|
+
text: string | null;
|
|
64
|
+
html?: string | null;
|
|
65
|
+
}
|
|
66
|
+
export interface Alinea extends DivisionContent {
|
|
67
|
+
eId: string;
|
|
68
|
+
heading: DivisionContent;
|
|
69
|
+
pastille: string | null;
|
|
70
|
+
}
|
|
71
|
+
export interface ExposeDesMotifs {
|
|
72
|
+
text: string | null;
|
|
73
|
+
html: string | null;
|
|
74
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/* eslint no-use-before-define: 0 */
|
|
2
|
+
export var DivisionType;
|
|
3
|
+
(function (DivisionType) {
|
|
4
|
+
DivisionType[DivisionType["tome"] = 1] = "tome";
|
|
5
|
+
DivisionType[DivisionType["part"] = 2] = "part";
|
|
6
|
+
DivisionType[DivisionType["book"] = 3] = "book";
|
|
7
|
+
DivisionType[DivisionType["title"] = 4] = "title";
|
|
8
|
+
DivisionType[DivisionType["subtitle"] = 5] = "subtitle";
|
|
9
|
+
DivisionType[DivisionType["chapter"] = 6] = "chapter";
|
|
10
|
+
DivisionType[DivisionType["section"] = 7] = "section";
|
|
11
|
+
DivisionType[DivisionType["subsection"] = 8] = "subsection";
|
|
12
|
+
DivisionType[DivisionType["paragraph"] = 9] = "paragraph";
|
|
13
|
+
DivisionType[DivisionType["article"] = 10] = "article";
|
|
14
|
+
DivisionType[DivisionType["alinea"] = 11] = "alinea";
|
|
15
|
+
DivisionType[DivisionType["division"] = 12] = "division";
|
|
16
|
+
})(DivisionType || (DivisionType = {}));
|