@tricoteuses/senat 2.15.2 → 2.15.4
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/index.d.ts +1 -0
- package/lib/loaders.d.ts +1 -1
- package/lib/loaders.js +2 -2
- package/lib/scripts/test_iter_load.d.ts +1 -0
- package/lib/scripts/test_iter_load.js +10 -0
- package/package.json +2 -1
package/lib/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export type { AmendementResult, } from "./model/ameli";
|
|
2
2
|
export type { DossierLegislatifResult, } from "./model/dosleg";
|
|
3
|
+
export type { ScrutinResult, } from "./model/scrutins";
|
|
3
4
|
export type { QuestionResult, } from "./model/questions";
|
|
4
5
|
export type { CirconscriptionResult, OrganismeResult, SenateurResult, } from "./model/sens";
|
|
5
6
|
export type { AgendaEvent, GroupedReunion } from "./types/agenda";
|
package/lib/loaders.d.ts
CHANGED
|
@@ -89,4 +89,4 @@ export declare function iterLoadSenatCirconscriptions(dataDir: string, options?:
|
|
|
89
89
|
export declare function iterLoadSenatOrganismes(dataDir: string, options?: {}): Generator<IterItem<OrganismeResult>>;
|
|
90
90
|
export declare function iterLoadSenatSenateurs(dataDir: string, options?: {}): Generator<IterItem<SenateurResult>>;
|
|
91
91
|
export declare function iterLoadSenatQuestions(dataDir: string, legislature: number, options?: {}): Generator<IterItem<QuestionResult>>;
|
|
92
|
-
export declare function iterLoadSenatScrutins(dataDir: string,
|
|
92
|
+
export declare function iterLoadSenatScrutins(dataDir: string, session: number | undefined, options?: {}): Generator<IterItem<ScrutinResult>>;
|
package/lib/loaders.js
CHANGED
|
@@ -227,8 +227,8 @@ export function* iterLoadSenatQuestions(dataDir, legislature, options = {}) {
|
|
|
227
227
|
yield questionItem;
|
|
228
228
|
}
|
|
229
229
|
}
|
|
230
|
-
export function* iterLoadSenatScrutins(dataDir,
|
|
231
|
-
for (const scrutinItem of iterLoadSenatItems(dataDir,
|
|
230
|
+
export function* iterLoadSenatScrutins(dataDir, session, options = {}) {
|
|
231
|
+
for (const scrutinItem of iterLoadSenatItems(dataDir, "scrutins", session, undefined, options)) {
|
|
232
232
|
yield scrutinItem;
|
|
233
233
|
}
|
|
234
234
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { iterLoadSenatScrutins } 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 noValidation = false;
|
|
7
|
+
const session = 2024;
|
|
8
|
+
for (const { item: scrutin } of iterLoadSenatScrutins(options["dataDir"], session, { noValidation: noValidation })) {
|
|
9
|
+
console.log(scrutin["numero"]);
|
|
10
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tricoteuses/senat",
|
|
3
|
-
"version": "2.15.
|
|
3
|
+
"version": "2.15.4",
|
|
4
4
|
"description": "Handle French Sénat's open data",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"France",
|
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
"prepare": "npm run build",
|
|
57
57
|
"prepublishOnly": "npm run build",
|
|
58
58
|
"prettier": "prettier --write 'src/**/*.ts' 'tests/**/*.test.ts'",
|
|
59
|
+
"test:iter_load": "tsx src/scripts/test_iter_load.ts",
|
|
59
60
|
"type-check": "tsc --noEmit",
|
|
60
61
|
"type-check:watch": "npm run type-check -- --watch"
|
|
61
62
|
},
|