@tricoteuses/senat 1.3.4 → 1.4.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 +1 -3
- package/lib/config.js +4 -6
- package/lib/databases.js +34 -75
- package/lib/datasets.js +20 -28
- package/lib/index.d.ts +0 -3
- package/lib/index.js +1 -43
- package/lib/loaders.js +56 -74
- package/lib/model/ameli.d.ts +2 -2
- package/lib/model/ameli.js +22 -17
- package/lib/model/dosleg.js +47 -52
- package/lib/model/index.js +4 -13
- package/lib/model/questions.js +15 -18
- package/lib/model/sens.js +65 -71
- package/lib/model/texte.js +17 -25
- package/lib/model/util.js +13 -21
- package/lib/raw_types/ameli.js +1 -2
- package/lib/raw_types/debats.js +1 -2
- package/lib/raw_types/dosleg.js +1 -2
- package/lib/raw_types/questions.js +1 -2
- package/lib/raw_types/sens.js +1 -2
- package/lib/raw_types_schemats/ameli.js +1 -2
- package/lib/raw_types_schemats/debats.js +1 -2
- package/lib/raw_types_schemats/dosleg.js +1 -2
- package/lib/raw_types_schemats/questions.js +1 -2
- package/lib/raw_types_schemats/sens.js +1 -2
- package/lib/scripts/convert_data.js +78 -83
- package/lib/scripts/datautil.js +9 -13
- package/lib/scripts/parse_textes.js +23 -28
- package/lib/scripts/retrieve_documents.js +56 -61
- package/lib/scripts/retrieve_open_data.js +44 -49
- package/lib/scripts/retrieve_senateurs_photos.js +31 -36
- package/lib/scripts/shared/cli_helpers.js +9 -12
- package/lib/scripts/shared/util.js +7 -15
- package/lib/strings.js +4 -10
- package/lib/types/ameli.d.ts +0 -5
- package/lib/types/ameli.js +1 -16
- package/lib/types/debats.d.ts +0 -2
- package/lib/types/debats.js +1 -5
- package/lib/types/dosleg.d.ts +0 -28
- package/lib/types/dosleg.js +1 -154
- package/lib/types/questions.js +1 -2
- package/lib/types/sens.js +1 -2
- package/lib/types/sessions.js +2 -5
- package/lib/types/texte.js +2 -5
- package/lib/validators/config.js +4 -7
- package/package.json +2 -2
package/lib/types/dosleg.js
CHANGED
|
@@ -1,154 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.typurlFieldsToTrim = exports.typtxtFieldsToTrim = exports.typloiFieldsToTrim = exports.typlecFieldsToTrim = exports.typattFieldsToTrim = exports.texteFieldsToTrim = exports.texteFieldsToParseInt = exports.scrFieldsToTrim = exports.raporgFieldsToTrim = exports.rapFieldsToTrim = exports.rapFieldsToParseInt = exports.quaFieldsToTrim = exports.oritxtFieldsToTrim = exports.orgFieldsToTrim = exports.loiFieldsToTrim = exports.lectureFieldsToTrim = exports.lecassrapFieldsToTrim = exports.lecassFieldsToTrim = exports.etaloiFieldsToTrim = exports.ecrFieldsToTrim = exports.docattFieldsToTrim = exports.docattFieldsToParseInt = exports.denrapFieldsToTrim = exports.deccocFieldsToTrim = exports.dateSeanceFieldsToTrim = exports.auteurFieldsToTrim = exports.audFieldsToTrim = exports.assFieldsToTrim = void 0;
|
|
4
|
-
exports.assFieldsToTrim = ["libass"];
|
|
5
|
-
exports.audFieldsToTrim = ["lecassidt", "audtit", "audurl", "orgcod"];
|
|
6
|
-
exports.auteurFieldsToTrim = [
|
|
7
|
-
"autcod",
|
|
8
|
-
"quacod",
|
|
9
|
-
"typautcod",
|
|
10
|
-
"nomuse",
|
|
11
|
-
"prenom",
|
|
12
|
-
"nomtec",
|
|
13
|
-
"autmat",
|
|
14
|
-
"autfct",
|
|
15
|
-
];
|
|
16
|
-
exports.dateSeanceFieldsToTrim = ["lecidt", "statut"];
|
|
17
|
-
exports.deccocFieldsToTrim = ["deccoccod", "deccoclib"];
|
|
18
|
-
exports.denrapFieldsToTrim = [
|
|
19
|
-
"coddenrap",
|
|
20
|
-
"typraprap",
|
|
21
|
-
"libdenrap",
|
|
22
|
-
"denrapmin",
|
|
23
|
-
"denraptit",
|
|
24
|
-
"denrapstymin",
|
|
25
|
-
"solnatrapcod",
|
|
26
|
-
];
|
|
27
|
-
exports.docattFieldsToParseInt = ["docattcle", "rapcod"];
|
|
28
|
-
exports.docattFieldsToTrim = ["docatturl"];
|
|
29
|
-
exports.ecrFieldsToTrim = ["autcod", "ecrqua"];
|
|
30
|
-
exports.etaloiFieldsToTrim = ["etaloilib"];
|
|
31
|
-
exports.lecassFieldsToTrim = [
|
|
32
|
-
"lecassidt",
|
|
33
|
-
"lecidt",
|
|
34
|
-
"ptlurl",
|
|
35
|
-
"ptlnumcpl",
|
|
36
|
-
"ptlnot",
|
|
37
|
-
"ptlurl2",
|
|
38
|
-
"ptlnot2",
|
|
39
|
-
"ptlurl3",
|
|
40
|
-
"ptlnot3",
|
|
41
|
-
"ptlnumcpl2",
|
|
42
|
-
"ptlnumcpl3",
|
|
43
|
-
"lecassame",
|
|
44
|
-
"orgcod",
|
|
45
|
-
"loiintmod",
|
|
46
|
-
"reucom",
|
|
47
|
-
"debatsurl",
|
|
48
|
-
"libppr",
|
|
49
|
-
"ptlurlcom",
|
|
50
|
-
"aliasppr",
|
|
51
|
-
"lecassamecom",
|
|
52
|
-
];
|
|
53
|
-
exports.lecassrapFieldsToTrim = ["lecassidt"];
|
|
54
|
-
exports.lectureFieldsToTrim = ["lecidt", "loicod", "typleccod", "leccom"];
|
|
55
|
-
exports.loiFieldsToTrim = [
|
|
56
|
-
"loicod",
|
|
57
|
-
"typloicod",
|
|
58
|
-
"deccoccod",
|
|
59
|
-
"numero",
|
|
60
|
-
"loient",
|
|
61
|
-
"motclef",
|
|
62
|
-
"loitit",
|
|
63
|
-
"loiint",
|
|
64
|
-
"url_jo",
|
|
65
|
-
"loinumjo",
|
|
66
|
-
"loititjo",
|
|
67
|
-
"url_jo2",
|
|
68
|
-
"loinumjo2",
|
|
69
|
-
"deccocurl",
|
|
70
|
-
"num_decision",
|
|
71
|
-
"loicodmai",
|
|
72
|
-
"loinoudelibcod",
|
|
73
|
-
"motionloiorigcod",
|
|
74
|
-
"url_ordonnance",
|
|
75
|
-
"saisine_par",
|
|
76
|
-
"loinumjo3",
|
|
77
|
-
"url_jo3",
|
|
78
|
-
"url_an",
|
|
79
|
-
"url_presart",
|
|
80
|
-
"signetalt",
|
|
81
|
-
"orgcod",
|
|
82
|
-
"doscocurl",
|
|
83
|
-
"loiintori",
|
|
84
|
-
];
|
|
85
|
-
exports.orgFieldsToTrim = [
|
|
86
|
-
"orgcod",
|
|
87
|
-
"typorgcod",
|
|
88
|
-
"orgnom",
|
|
89
|
-
"orgliblon",
|
|
90
|
-
"orglibaff",
|
|
91
|
-
"orgurl",
|
|
92
|
-
"orglibcou",
|
|
93
|
-
"org_de",
|
|
94
|
-
"urltra",
|
|
95
|
-
"inttra",
|
|
96
|
-
"orgnomcouv",
|
|
97
|
-
"senorgcod",
|
|
98
|
-
"html_color",
|
|
99
|
-
];
|
|
100
|
-
exports.oritxtFieldsToTrim = ["oritxtcod", "oritxtlib", "oritxtlibfem"];
|
|
101
|
-
exports.quaFieldsToTrim = ["quacod", "qualic", "quaabr", "quaabrplu"];
|
|
102
|
-
exports.rapFieldsToParseInt = ["rapcod", "sesann", "rapnum", "rapnuman"];
|
|
103
|
-
exports.rapFieldsToTrim = [
|
|
104
|
-
"coddenrap",
|
|
105
|
-
"blecod",
|
|
106
|
-
"raptitcou",
|
|
107
|
-
"raptil",
|
|
108
|
-
"rapurl",
|
|
109
|
-
"url2",
|
|
110
|
-
"url3",
|
|
111
|
-
"url4",
|
|
112
|
-
"url2txt",
|
|
113
|
-
"url3txt",
|
|
114
|
-
"url4txt",
|
|
115
|
-
"prix",
|
|
116
|
-
"numerobis",
|
|
117
|
-
"rapsoustit",
|
|
118
|
-
"rapres",
|
|
119
|
-
"forpubcod",
|
|
120
|
-
];
|
|
121
|
-
exports.raporgFieldsToTrim = ["orgcod"];
|
|
122
|
-
exports.scrFieldsToTrim = ["scrint", "soslib"];
|
|
123
|
-
exports.texteFieldsToParseInt = ["texcod", "sesann", "texnum"];
|
|
124
|
-
exports.texteFieldsToTrim = [
|
|
125
|
-
"oritxtcod",
|
|
126
|
-
"typtxtcod",
|
|
127
|
-
"lecassidt",
|
|
128
|
-
"orgcod",
|
|
129
|
-
"texurl",
|
|
130
|
-
"url2",
|
|
131
|
-
"url3",
|
|
132
|
-
"url4",
|
|
133
|
-
"url2txt",
|
|
134
|
-
"url3txt",
|
|
135
|
-
"url4txt",
|
|
136
|
-
"prix",
|
|
137
|
-
"numerobis",
|
|
138
|
-
"reserve_comspe",
|
|
139
|
-
];
|
|
140
|
-
exports.typattFieldsToTrim = ["typattlib"];
|
|
141
|
-
exports.typlecFieldsToTrim = ["typleccod", "typleclib"];
|
|
142
|
-
exports.typloiFieldsToTrim = [
|
|
143
|
-
"typloicod",
|
|
144
|
-
"typloilib",
|
|
145
|
-
"groupe",
|
|
146
|
-
"typloiden",
|
|
147
|
-
"typloigen",
|
|
148
|
-
"typloitit",
|
|
149
|
-
"typloidenplu",
|
|
150
|
-
"typloide",
|
|
151
|
-
"typloiabr",
|
|
152
|
-
];
|
|
153
|
-
exports.typtxtFieldsToTrim = ["typtxtcod", "typtxtlib"];
|
|
154
|
-
exports.typurlFieldsToTrim = ["libtypurl"];
|
|
1
|
+
export {};
|
package/lib/types/questions.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
package/lib/types/sens.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
package/lib/types/sessions.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Session = void 0;
|
|
4
|
-
var Session;
|
|
1
|
+
export var Session;
|
|
5
2
|
(function (Session) {
|
|
6
3
|
Session[Session["2012-2013"] = 2012] = "2012-2013";
|
|
7
4
|
Session[Session["2013-2014"] = 2013] = "2013-2014";
|
|
@@ -43,4 +40,4 @@ var Session;
|
|
|
43
40
|
Session[Session["2049-2050"] = 2049] = "2049-2050";
|
|
44
41
|
Session[Session["2050-2051"] = 2050] = "2050-2051";
|
|
45
42
|
Session[Session["All"] = 0] = "All";
|
|
46
|
-
})(Session || (
|
|
43
|
+
})(Session || (Session = {}));
|
package/lib/types/texte.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/* eslint no-use-before-define: 0 */
|
|
3
|
-
|
|
4
|
-
exports.DivisionType = void 0;
|
|
5
|
-
var DivisionType;
|
|
2
|
+
export var DivisionType;
|
|
6
3
|
(function (DivisionType) {
|
|
7
4
|
DivisionType[DivisionType["tome"] = 1] = "tome";
|
|
8
5
|
DivisionType[DivisionType["part"] = 2] = "part";
|
|
@@ -16,4 +13,4 @@ var DivisionType;
|
|
|
16
13
|
DivisionType[DivisionType["article"] = 10] = "article";
|
|
17
14
|
DivisionType[DivisionType["alinea"] = 11] = "alinea";
|
|
18
15
|
DivisionType[DivisionType["division"] = 12] = "division";
|
|
19
|
-
})(DivisionType || (
|
|
16
|
+
})(DivisionType || (DivisionType = {}));
|
package/lib/validators/config.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateConfig = validateConfig;
|
|
4
|
-
const core_1 = require("@biryani/core");
|
|
1
|
+
import { validateChain, validateInteger, validateNonEmptyTrimmedString, validateNumber, validateOption, validateString, validateStringToNumber, validateTest, } from "@biryani/core";
|
|
5
2
|
function validateDb(data) {
|
|
6
3
|
if (data === null || data === undefined) {
|
|
7
4
|
return [data, "Missing value"];
|
|
@@ -14,7 +11,7 @@ function validateDb(data) {
|
|
|
14
11
|
const remainingKeys = new Set(Object.keys(data));
|
|
15
12
|
for (const key of ["host", "password", "user"]) {
|
|
16
13
|
remainingKeys.delete(key);
|
|
17
|
-
const [value, error] =
|
|
14
|
+
const [value, error] = validateNonEmptyTrimmedString(data[key]);
|
|
18
15
|
data[key] = value;
|
|
19
16
|
if (error !== null) {
|
|
20
17
|
errors[key] = error;
|
|
@@ -23,7 +20,7 @@ function validateDb(data) {
|
|
|
23
20
|
{
|
|
24
21
|
const key = "port";
|
|
25
22
|
remainingKeys.delete(key);
|
|
26
|
-
const [value, error] =
|
|
23
|
+
const [value, error] = validateChain(validateOption([validateString, validateStringToNumber], validateNumber), validateInteger, validateTest((value) => 0 <= value && value <= 65535, "Must be an integer between 0 and 65535"))(data[key]);
|
|
27
24
|
data[key] = value;
|
|
28
25
|
if (error !== null) {
|
|
29
26
|
errors[key] = error;
|
|
@@ -34,7 +31,7 @@ function validateDb(data) {
|
|
|
34
31
|
}
|
|
35
32
|
return [data, Object.keys(errors).length === 0 ? null : errors];
|
|
36
33
|
}
|
|
37
|
-
function validateConfig(data) {
|
|
34
|
+
export function validateConfig(data) {
|
|
38
35
|
if (data === null || data === undefined) {
|
|
39
36
|
return [data, "Missing value"];
|
|
40
37
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tricoteuses/senat",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"description": "Handle French Sénat's open data",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"France",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"import": "./lib/index.js",
|
|
31
31
|
"types": "./lib/index.d.ts"
|
|
32
32
|
},
|
|
33
|
-
"./
|
|
33
|
+
"./loaders": {
|
|
34
34
|
"import": "./lib/loaders.js",
|
|
35
35
|
"types": "./lib/loaders.d.ts"
|
|
36
36
|
},
|