@tricoteuses/assemblee 2.5.31 → 3.0.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.
Files changed (94) hide show
  1. package/LICENSE.md +16 -6
  2. package/README.md +1 -19
  3. package/lib/amendements-CXmsqoof.js +170 -0
  4. package/lib/amendements-CZHXlq07.js +4198 -0
  5. package/lib/cleaners/acteurs.d.ts +2 -1
  6. package/lib/cleaners/amendements.d.ts +2 -1
  7. package/lib/cleaners/debats.d.ts +2 -1
  8. package/lib/cleaners/documents.d.ts +2 -1
  9. package/lib/cleaners/dossiers_legislatifs.d.ts +2 -1
  10. package/lib/cleaners/organes.d.ts +2 -1
  11. package/lib/cleaners/questions.d.ts +2 -1
  12. package/lib/cleaners/reunions.d.ts +2 -1
  13. package/lib/cleaners/scrutins.d.ts +2 -1
  14. package/lib/cleaners/xml.d.ts +5 -5
  15. package/lib/cleaners.js +186 -179
  16. package/lib/datasets.d.ts +5 -7
  17. package/lib/dossiers_legislatifs.d.ts +5 -2
  18. package/lib/file_systems.d.ts +9 -4
  19. package/lib/index.d.ts +24 -19
  20. package/lib/index.js +390 -1234
  21. package/lib/inserters.d.ts +466 -9
  22. package/lib/loaders.d.ts +13 -12
  23. package/lib/loaders.js +1900 -538
  24. package/lib/organes.d.ts +1 -1
  25. package/lib/parsers/compte_rendu.d.ts +2 -1
  26. package/lib/parsers/compte_rendu_commission.d.ts +1 -1
  27. package/lib/parsers/recherche_amendements.d.ts +2 -2
  28. package/lib/parsers/textes_lois.d.ts +1 -1
  29. package/lib/parsers.js +2109 -2075
  30. package/lib/questions-DTO3nK5V.js +2777 -0
  31. package/lib/questions-DXAzvI1T.js +230 -0
  32. package/lib/registries.d.ts +112 -0
  33. package/lib/schemas/clean/acteurs_et_organes.d.ts +2377 -0
  34. package/lib/schemas/clean/agendas.d.ts +830 -0
  35. package/lib/schemas/clean/amendements.d.ts +2305 -0
  36. package/lib/schemas/clean/debats.d.ts +300 -0
  37. package/lib/schemas/clean/dossiers_legislatifs.d.ts +1365 -0
  38. package/lib/schemas/clean/questions.d.ts +625 -0
  39. package/lib/schemas/clean/scrutins.d.ts +1137 -0
  40. package/lib/schemas/enriched/acteurs_et_organes.d.ts +112 -0
  41. package/lib/schemas/enriched/agendas.d.ts +501 -0
  42. package/lib/schemas/enriched/amendements.d.ts +1230 -0
  43. package/lib/schemas/enriched/debats.d.ts +308 -0
  44. package/lib/schemas/enriched/dossiers_legislatifs.d.ts +1131 -0
  45. package/lib/schemas/enriched/questions.d.ts +589 -0
  46. package/lib/schemas/enriched/scrutins.d.ts +1094 -0
  47. package/lib/schemas/raw/acteurs_et_organes.d.ts +5870 -0
  48. package/lib/schemas/raw/agendas.d.ts +1734 -0
  49. package/lib/schemas/raw/amendements.d.ts +4758 -0
  50. package/lib/schemas/raw/debats.d.ts +410 -0
  51. package/lib/schemas/raw/dossiers_legislatifs.d.ts +3252 -0
  52. package/lib/schemas/raw/questions.d.ts +983 -0
  53. package/lib/schemas/raw/scrutins.d.ts +2763 -0
  54. package/lib/scripts/retrieve_deputes_photos.d.ts +58 -4
  55. package/lib/scripts/retrieve_documents.d.ts +100 -12
  56. package/lib/scripts/retrieve_open_data.d.ts +75 -4
  57. package/lib/scripts/retrieve_videos.d.ts +1 -1
  58. package/lib/scripts/shared/cli_helpers.d.ts +103 -77
  59. package/lib/scripts/shared/photos.d.ts +106 -0
  60. package/lib/scripts/shared/utils.d.ts +4 -1
  61. package/lib/urls.d.ts +2 -2
  62. package/package.json +16 -12
  63. package/lib/amendements-40Z7OJLT.js +0 -682
  64. package/lib/amendements-J6Sx61n8.js +0 -154
  65. package/lib/datasets-Cb3wpfRH.js +0 -3580
  66. package/lib/parse-Ccs6wcUg.js +0 -2512
  67. package/lib/raw_types/acteurs_et_organes.d.ts +0 -464
  68. package/lib/raw_types/agendas.d.ts +0 -265
  69. package/lib/raw_types/amendements.d.ts +0 -365
  70. package/lib/raw_types/debats.d.ts +0 -140
  71. package/lib/raw_types/dossiers_legislatifs.d.ts +0 -567
  72. package/lib/raw_types/questions.d.ts +0 -115
  73. package/lib/raw_types/scrutins.d.ts +0 -187
  74. package/lib/schemas/acteurs_et_organes.json +0 -1167
  75. package/lib/schemas/agendas.json +0 -1757
  76. package/lib/schemas/amendements.json +0 -2087
  77. package/lib/schemas/compte_rendu_commission/CompteRenduCommission.json +0 -63
  78. package/lib/schemas/debats.json +0 -847
  79. package/lib/schemas/dossiers_legislatifs.json +0 -3884
  80. package/lib/schemas/legislatures.json +0 -17
  81. package/lib/schemas/questions.json +0 -711
  82. package/lib/schemas/scrutins.json +0 -701
  83. package/lib/scripts/copy-schemas.d.ts +0 -1
  84. package/lib/scripts/generate-json-schemas.d.ts +0 -1
  85. package/lib/shared_types/acteurs_et_organes.d.ts +0 -149
  86. package/lib/shared_types/dossiers_legislatifs.d.ts +0 -222
  87. package/lib/types/acteurs_et_organes.d.ts +0 -598
  88. package/lib/types/agendas.d.ts +0 -442
  89. package/lib/types/amendements.d.ts +0 -615
  90. package/lib/types/debats.d.ts +0 -186
  91. package/lib/types/dossiers_legislatifs.d.ts +0 -826
  92. package/lib/types/questions.d.ts +0 -203
  93. package/lib/types/scrutins.d.ts +0 -254
  94. /package/lib/{types/legislatures.d.ts → legislatures.d.ts} +0 -0
@@ -0,0 +1,230 @@
1
+ import { z as e } from "zod";
2
+ import { J as n, K as t, L as o, H as l, I as b, F as R, G as m, E as S } from "./amendements-CZHXlq07.js";
3
+ const g = [
4
+ "",
5
+ "ADOPTION amendement (main levée) adt",
6
+ "ADOPTION d’un article (vote à main levée)",
7
+ "ADOPTION d’un sous-amendement (main levée) ss-adt",
8
+ "ADOPTION de plusieurs amendements (main levée) adts",
9
+ "ADOPTION de plusieurs sous-amendements (main levée) ss-adts",
10
+ "REJET d’un amendement (main levée) adt",
11
+ "REJET d’un article (vote à main levée)",
12
+ "REJET d’un sous-amendement (main levée) ss-adt",
13
+ "REJET de plusieurs amendements (main levée) adts",
14
+ "REJET de plusieurs sous-amendements (main levée) ss-adts",
15
+ "REJET motion de rejet préalable (main levée)"
16
+ ], h = e.enum(g), i = e.lazy(
17
+ () => e.object({
18
+ _: t(),
19
+ id_syceron: t(),
20
+ stime: t(),
21
+ sup: t(),
22
+ lienAdt: n(i).optional()
23
+ })
24
+ ), j = e.object({
25
+ nom: t(),
26
+ id: o(),
27
+ qualite: t()
28
+ }), O = e.object({
29
+ orateur: n(j)
30
+ }), a = e.lazy(
31
+ () => e.object({
32
+ id_preparation: t(),
33
+ ordre_absolu_seance: t(),
34
+ code_grammaire: t(),
35
+ sommaire: t(),
36
+ id_syceron: t(),
37
+ valeur_ptsodj: t(),
38
+ nivpoint: t(),
39
+ ordinal_prise: t(),
40
+ code_style: t(),
41
+ code_parole: t(),
42
+ valeur: t(),
43
+ orateurs: e.union([O, e.string()]).optional(),
44
+ texte: e.union([i, e.string()]).optional(),
45
+ paragraphe: n(a).optional(),
46
+ interExtraction: n(a).optional(),
47
+ point: n(a).optional(),
48
+ structure: t(),
49
+ id_acteur: t(),
50
+ id_mandat: t(),
51
+ id_nomination_oe: t(),
52
+ id_nomination_op: t(),
53
+ orateur: t(),
54
+ bibard: t(),
55
+ art: t(),
56
+ adt: t(),
57
+ ssadt: t(),
58
+ roledebat: t(),
59
+ changementPresidence: n(a).optional(),
60
+ type_debat: t(),
61
+ decision: h.optional(),
62
+ ouvertureSeance: a.optional(),
63
+ qualite: t(),
64
+ nom_orateur: t()
65
+ })
66
+ ), w = e.object({
67
+ point: a
68
+ }), _ = e.object({
69
+ journee: e.string(),
70
+ session: e.string()
71
+ }), y = e.object({
72
+ quantiemes: _,
73
+ ouvertureSeance: n(a).optional(),
74
+ point: n(a),
75
+ finSeance: w.optional(),
76
+ paragraphe: n(a).optional()
77
+ }), f = e.object({
78
+ id_syceron: e.string(),
79
+ intitule: t(),
80
+ sousIntitule: t(),
81
+ type_debat: t()
82
+ }), s = e.lazy(
83
+ () => e.object({
84
+ valeur_pts_odj: t(),
85
+ titreStruct: f,
86
+ para: n(e.union([i, e.string()])).optional(),
87
+ sommaire2: n(s).optional(),
88
+ sommaire3: n(s).optional(),
89
+ presidentSeance: n(i).optional(),
90
+ type_debat: t()
91
+ })
92
+ ), v = e.object({
93
+ presidentSeance: i,
94
+ sommaire1: n(s),
95
+ sommaire2: n(s).optional(),
96
+ sommaire3: n(s).optional(),
97
+ para: n(i).optional()
98
+ }), T = e.object({
99
+ dateSeance: e.string(),
100
+ dateSeanceJour: e.string(),
101
+ numSeanceJour: e.string(),
102
+ numSeance: e.string(),
103
+ typeAssemblee: e.string(),
104
+ legislature: e.string(),
105
+ session: e.string(),
106
+ nomFichierJo: e.string(),
107
+ validite: e.string(),
108
+ etat: e.string(),
109
+ diffusion: e.string(),
110
+ version: e.string(),
111
+ environnement: e.string(),
112
+ heureGeneration: e.iso.datetime({ offset: !0 }),
113
+ sommaire: v
114
+ }), u = e.object({
115
+ xmlns: e.string(),
116
+ uid: l(),
117
+ seanceRef: e.string(),
118
+ sessionRef: e.string(),
119
+ metadonnees: T,
120
+ contenu: y
121
+ });
122
+ e.object({
123
+ compteRendu: u
124
+ });
125
+ const J = e.object({
126
+ compteRendu: n(u)
127
+ });
128
+ e.object({
129
+ compteRendu: J
130
+ });
131
+ const E = [
132
+ "QuestionEcrite_Type",
133
+ "QuestionGouvernement_Type",
134
+ "QuestionOrale_Type"
135
+ ], x = e.enum(E), A = ["QE", "QG", "QOSD"], Q = e.enum(A), I = Q, D = [
136
+ "JO_QUESTION",
137
+ "JO_LOI_DECRET",
138
+ "JO_DEBAT"
139
+ ], q = e.enum(D), C = e.object({
140
+ numero: e.string(),
141
+ regime: e.string(),
142
+ legislature: e.string()
143
+ }), c = e.object({
144
+ organeRef: b().meta({ description: "Référence à l'organe." }),
145
+ abrege: e.string(),
146
+ developpe: e.string()
147
+ }), N = e.object({
148
+ acteurRef: R().meta({ description: "Référence à l'acteur." }),
149
+ mandatRef: e.string()
150
+ }), P = e.object({
151
+ identite: N,
152
+ groupe: c
153
+ }), r = e.object({
154
+ typeJO: q.nullable(),
155
+ dateJO: m().describe(
156
+ "Date de publication au Journal Officiel"
157
+ ),
158
+ pageJO: o().nullable(),
159
+ numJO: o().nullable(),
160
+ urlLegifrance: o().nullable(),
161
+ referenceNOR: o().nullable()
162
+ }), G = e.object({
163
+ analyse: o().nullable()
164
+ }), z = e.object({
165
+ rubrique: o().nullable(),
166
+ teteAnalyse: e.null(),
167
+ analyses: G
168
+ }), F = e.object({
169
+ infoJO: r,
170
+ denomination: c
171
+ }), L = e.object({
172
+ minAttrib: n(F)
173
+ }), d = e.object({
174
+ infoJO: r,
175
+ texte: o().nullable(),
176
+ erratum: e.string().optional()
177
+ }), M = e.object({
178
+ texteQuestion: n(d)
179
+ }), X = e.object({
180
+ texteReponse: n(d)
181
+ }), B = e.object({
182
+ codeCloture: e.string(),
183
+ libelleCloture: e.string(),
184
+ dateCloture: S(),
185
+ infoJO: r.nullable()
186
+ }), H = e.object({
187
+ dateDepotSignal: m().describe(
188
+ "Date de dépôt du signalement"
189
+ ),
190
+ infoJO: r
191
+ }), K = e.object({
192
+ infoJO: r
193
+ }), U = e.object({
194
+ renouvellement: n(K)
195
+ }), p = e.object({
196
+ "@xmlns": e.string().optional(),
197
+ "@xmlns:xsi": e.string(),
198
+ "@xsi:type": x,
199
+ uid: l().meta({ description: "Identifiant unique de la question." }),
200
+ identifiant: C,
201
+ type: I,
202
+ indexationAN: z,
203
+ auteur: P,
204
+ minInt: c,
205
+ minAttribs: L,
206
+ textesQuestion: M.nullable().optional(),
207
+ textesReponse: X.nullable().optional(),
208
+ cloture: B.nullable().optional(),
209
+ signalement: H.nullable().optional(),
210
+ renouvellements: U.nullable().optional()
211
+ });
212
+ e.object({
213
+ question: p
214
+ });
215
+ const k = e.object({
216
+ question: e.array(p)
217
+ });
218
+ e.object({
219
+ questions: k
220
+ });
221
+ export {
222
+ u as C,
223
+ h as D,
224
+ x as Q,
225
+ Q as T,
226
+ p as a,
227
+ g as d,
228
+ E as q,
229
+ A as t
230
+ };
@@ -0,0 +1,112 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Metadata for UIDs (unique identifiers)
4
+ */
5
+ export interface UidMetadata {
6
+ /** Type of entity (acteur, organe, etc.) */
7
+ targetType: "acteur" | "organe" | "document" | "scrutin" | "auto";
8
+ }
9
+ /**
10
+ * Metadata for acteur/organe references
11
+ */
12
+ export interface RefMetadata {
13
+ /** Type of reference */
14
+ refType: "acteur" | "organe";
15
+ }
16
+ /**
17
+ * Registry for UIDs (PA*, PO*, etc.)
18
+ */
19
+ export declare const uidRegistry: z.core.$ZodRegistry<UidMetadata, z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
20
+ /**
21
+ * Registry for acteur references
22
+ */
23
+ export declare const acteurRefRegistry: z.core.$ZodRegistry<RefMetadata, z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
24
+ /**
25
+ * Registry for organe references
26
+ */
27
+ export declare const organeRefRegistry: z.core.$ZodRegistry<RefMetadata, z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
28
+ /**
29
+ * Registry for ISO 8601 dates
30
+ * Uses empty object as marker (presence in registry = true)
31
+ */
32
+ export declare const dateRegistry: z.core.$ZodRegistry<{}, z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
33
+ /**
34
+ * Registry for custom summarizers (future UI integration)
35
+ */
36
+ export declare const summarizerRegistry: z.core.$ZodRegistry<any, z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
37
+ /**
38
+ * Helper for creating a UID schema
39
+ *
40
+ * Validates Assemblée Nationale UID format (e.g., PA123456, PO123456)
41
+ *
42
+ * Use `.meta({ description: "..." })` on the returned schema to add documentation.
43
+ *
44
+ * @example
45
+ * ```typescript
46
+ * const acteurId = uid() // Validates PA* or PO* format
47
+ * const withDesc = uid().meta({ description: "Identifiant acteur" })
48
+ * ```
49
+ */
50
+ export declare function uid(): z.ZodString;
51
+ /**
52
+ * Helper for creating an acteur reference schema
53
+ *
54
+ * Use `.meta({ description: "..." })` on the returned schema to add documentation.
55
+ */
56
+ export declare function acteurRef(): z.ZodString;
57
+ /**
58
+ * Helper for creating an organe reference schema
59
+ *
60
+ * Use `.meta({ description: "..." })` on the returned schema to add documentation.
61
+ */
62
+ export declare function organeRef(): z.ZodString;
63
+ /**
64
+ * Date parsing for Assemblée Nationale's format quirks
65
+ * Handles: "2023-01-15", "2023-01-15+01:00", null, undefined
66
+ *
67
+ * Integrates with existing date-fns utilities:
68
+ * - parseISO() for "YYYY-MM-DD"
69
+ * - dateFromYearMonthDayTimezoneString() for "YYYY-MM-DD+TZ"
70
+ */
71
+ export declare const dateIso8601Base: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodDate>>;
72
+ /**
73
+ * Optional date in ISO 8601 format
74
+ *
75
+ * Use `.meta({ description: "..." })` on the returned schema to add documentation.
76
+ */
77
+ export declare const dateIso8601Optional: () => z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodDate>>;
78
+ /**
79
+ * Required date in ISO 8601 format
80
+ *
81
+ * Use `.meta({ description: "..." })` on the returned schema to add documentation.
82
+ */
83
+ export declare const dateIso8601Required: () => z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodDate>> & z.ZodType<Date, unknown, z.core.$ZodTypeInternals<Date, unknown>>, z.ZodTransform<Date, Date>>;
84
+ /**
85
+ * Trimmed string helper
86
+ */
87
+ export declare const trimmedStringBase: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodString>>;
88
+ export declare const trimmedStringOptional: (description?: string) => z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodString>>;
89
+ export declare const trimmedStringRequired: (description?: string) => z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodString>> & z.ZodType<string, unknown, z.core.$ZodTypeInternals<string, unknown>>, z.ZodTransform<string, string>>;
90
+ /**
91
+ * Ensure array helper
92
+ * Wraps single objects in arrays (handles XML→JSON single element quirk)
93
+ *
94
+ * XML: <item>foo</item> -> JSON: {item: "foo"} should become ["foo"]
95
+ * XML: <item>foo</item><item>bar</item> -> JSON: {item: ["foo", "bar"]}
96
+ */
97
+ export declare function ensureArray<T extends z.ZodTypeAny>(itemSchema: T): z.ZodPipe<z.ZodTransform<unknown[], unknown>, z.ZodArray<T>>;
98
+ /**
99
+ * Nullable helper
100
+ * Handles XML nil attributes and optional fields
101
+ *
102
+ * Handles:
103
+ * - {@xsi:nil: "true"} -> undefined
104
+ * - null -> undefined
105
+ * - undefined -> undefined
106
+ * - value -> value
107
+ */
108
+ export declare function nullable<T extends z.ZodTypeAny>(schema: T): z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodTransform<unknown, unknown>, T>>>;
109
+ /**
110
+ * Helper for creating enums from const arrays
111
+ */
112
+ export declare function enumFromConst<T extends readonly [string, ...string[]]>(values: T): z.ZodEnum<{ [k_1 in T[number]]: k_1; } extends infer T_1 ? { [k in keyof T_1]: T_1[k]; } : never>;